equal
deleted
inserted
replaced
1985 cv->dirty = true; |
1985 cv->dirty = true; |
1986 } |
1986 } |
1987 |
1987 |
1988 static void SwitchAnimatedCursor(void) |
1988 static void SwitchAnimatedCursor(void) |
1989 { |
1989 { |
1990 CursorVars *cv = &_cursor; |
1990 const AnimCursor *cur = _cursor.animate_cur; |
1991 const CursorID *cur = cv->animate_cur; |
1991 |
1992 CursorID sprite; |
1992 if (cur == NULL || cur->sprite == AnimCursor::LAST) cur = _cursor.animate_list; |
1993 |
1993 |
1994 // ANIM_CURSOR_END is 0xFFFF in table/animcursors.h |
1994 SetCursorSprite(cur->sprite, _cursor.pal); |
1995 if (cur == NULL || *cur == 0xFFFF) cur = cv->animate_list; |
1995 |
1996 |
1996 _cursor.animate_timeout = cur->display_time; |
1997 sprite = cur[0]; |
1997 _cursor.animate_cur = cur + 1; |
1998 cv->animate_timeout = cur[1]; |
|
1999 cv->animate_cur = cur + 2; |
|
2000 |
|
2001 SetCursorSprite(sprite, cv->pal); |
|
2002 } |
1998 } |
2003 |
1999 |
2004 void CursorTick(void) |
2000 void CursorTick(void) |
2005 { |
2001 { |
2006 if (_cursor.animate_timeout != 0 && --_cursor.animate_timeout == 0) |
2002 if (_cursor.animate_timeout != 0 && --_cursor.animate_timeout == 0) |
2013 _cursor.animate_timeout = 0; |
2009 _cursor.animate_timeout = 0; |
2014 // Set cursor |
2010 // Set cursor |
2015 SetCursorSprite(sprite, pal); |
2011 SetCursorSprite(sprite, pal); |
2016 } |
2012 } |
2017 |
2013 |
2018 void SetAnimatedMouseCursor(const CursorID *table) |
2014 void SetAnimatedMouseCursor(const AnimCursor *table) |
2019 { |
2015 { |
2020 _cursor.animate_list = table; |
2016 _cursor.animate_list = table; |
2021 _cursor.animate_cur = NULL; |
2017 _cursor.animate_cur = NULL; |
2022 _cursor.pal = PAL_NONE; |
2018 _cursor.pal = PAL_NONE; |
2023 SwitchAnimatedCursor(); |
2019 SwitchAnimatedCursor(); |