# HG changeset patch # User eugeni # Date 1152743300 0 # Node ID 96bd8ce937866b53d63a177786ce16480e101b77 # Parent fc0b6b0ba74f196805ded595f06f0f88d115ead3 Support 6 argument variant of \move. diff -r fc0b6b0ba74f -r 96bd8ce93786 libass/ass_render.c --- a/libass/ass_render.c Wed Jul 12 21:25:23 2006 +0000 +++ b/libass/ass_render.c Wed Jul 12 22:28:20 2006 +0000 @@ -653,7 +653,7 @@ change_border(val); } else if (mystrcmp(&p, "move")) { int x1, x2, y1, y2; - long long t1, delta_t, t; + long long t1, t2, delta_t, t; int x, y; double k; skip('('); @@ -664,12 +664,25 @@ x2 = strtol(p, &p, 10); skip(','); y2 = strtol(p, &p, 10); - skip(')'); // FIXME: 2 more optional args - mp_msg(MSGT_GLOBAL, MSGL_DBG2, "movement: (%d, %d) -> (%d, %d)\n", x1, y1, x2, y2); - t1 = render_context.event->Start; - delta_t = render_context.event->Duration; - t = frame_context.time; // FIXME: move to render_context - k = ((double)(t - t1)) / delta_t; + if (*p == ',') { + skip(','); + t1 = strtoll(p, &p, 10); + skip(','); + t2 = strtoll(p, &p, 10); + mp_msg(MSGT_GLOBAL, MSGL_DBG2, "movement6: (%d, %d) -> (%d, %d), (%lld .. %lld)\n", x1, y1, x2, y2, t1, t2); + } else { + t1 = 0; + t2 = render_context.event->Duration; + mp_msg(MSGT_GLOBAL, MSGL_DBG2, "movement: (%d, %d) -> (%d, %d)\n", x1, y1, x2, y2); + } + skip(')'); + delta_t = t2 - t1; + t = frame_context.time - render_context.event->Start; + if (t < t1) + k = 0.; + else if (t > t2) + k = 1.; + else k = ((double)(t - t1)) / delta_t; x = k * (x2 - x1) + x1; y = k * (y2 - y1) + y1; render_context.pos_x = x;