From 4d52b8f361c032738a4102c24998bb2047be2064 Mon Sep 17 00:00:00 2001 From: Adam Jackson Date: Mon, 12 Feb 2018 15:35:04 -0500 Subject: [PATCH] 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 Backported-by: M. Vefa Bicakci --- render/animcur.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/render/animcur.c b/render/animcur.c index 52e6b8b79fe5..975d8759d4d4 100644 --- a/render/animcur.c +++ b/render/animcur.c @@ -147,7 +147,7 @@ AnimCurTimerNotify(OsTimerPtr timer, CARD32 now, void *arg) activeDevice = TRUE; if ((INT32) (now - dev->spriteInfo->anim.time) >= 0) { - 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; @@ -165,6 +165,7 @@ AnimCurTimerNotify(OsTimerPtr timer, CARD32 now, void *arg) pScreen->DisplayCursor = DisplayCursor; dev->spriteInfo->anim.elt = elt; + dev->spriteInfo->anim.pCursor = ac->elts[elt].pCursor; dev->spriteInfo->anim.time = now + ac->elts[elt].delay; } @@ -192,7 +193,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); ret = (*pScreen->DisplayCursor) -- 2.17.0