diff options
author | Adam Jackson <ajax@redhat.com> | 2018-02-12 15:35:04 -0500 |
---|---|---|
committer | Adam Jackson <ajax@redhat.com> | 2018-02-14 13:52:45 -0500 |
commit | 0b7a5700ad3d65e408a2fae00bdee867a8d2e1a8 (patch) | |
tree | 6870543e2a909211cdebfa98633415d0997bfd49 /render | |
parent | 8510f542e5474b719f7d7edba7ef0cc05af0271e (diff) |
animcur: Change which CursorPtr we save in external state
Formerly spriteInfo->anim.pCursor would point to the animated cursor (or
NULL if not animated). That value would also be available in
spriteInfo->sprite->current, so instead lets use anim.pCursor to point
to the current animation element.
Signed-off-by: Adam Jackson <ajax@redhat.com>
Diffstat (limited to 'render')
-rw-r--r-- | render/animcur.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/render/animcur.c b/render/animcur.c index b5d222bc6..65327df65 100644 --- a/render/animcur.c +++ b/render/animcur.c @@ -133,7 +133,7 @@ AnimCurTimerNotify(OsTimerPtr timer, CARD32 now, void *arg) ScreenPtr pScreen = dev->spriteInfo->anim.pScreen; AnimCurScreenPtr as = GetAnimCurScreen(pScreen); - AnimCurPtr ac = GetAnimCur(dev->spriteInfo->anim.pCursor); + AnimCurPtr ac = GetAnimCur(dev->spriteInfo->sprite->current); int elt = (dev->spriteInfo->anim.elt + 1) % ac->nelt; DisplayCursorProcPtr DisplayCursor = pScreen->DisplayCursor; @@ -147,6 +147,7 @@ AnimCurTimerNotify(OsTimerPtr timer, CARD32 now, void *arg) pScreen->DisplayCursor = DisplayCursor; dev->spriteInfo->anim.elt = elt; + dev->spriteInfo->anim.pCursor = ac->elts[elt].pCursor; return ac->elts[elt].delay; } @@ -154,7 +155,7 @@ AnimCurTimerNotify(OsTimerPtr timer, CARD32 now, void *arg) static void AnimCurCancelTimer(DeviceIntPtr pDev) { - CursorPtr cur = pDev->spriteInfo->anim.pCursor; + CursorPtr cur = pDev->spriteInfo->sprite->current; if (IsAnimCur(cur)) TimerCancel(GetAnimCur(cur)->timer); @@ -171,7 +172,7 @@ AnimCurDisplayCursor(DeviceIntPtr pDev, ScreenPtr pScreen, CursorPtr pCursor) Unwrap(as, pScreen, DisplayCursor); if (IsAnimCur(pCursor)) { - if (pCursor != pDev->spriteInfo->anim.pCursor) { + if (pCursor != pDev->spriteInfo->sprite->current) { AnimCurPtr ac = GetAnimCur(pCursor); AnimCurCancelTimer(pDev); |