diff options
author | Darkvater <darkvater@openttd.org> | 2005-06-06 13:47:06 +0000 |
---|---|---|
committer | Darkvater <darkvater@openttd.org> | 2005-06-06 13:47:06 +0000 |
commit | 5fed47964e28c49f7af879700d013f2897341f4e (patch) | |
tree | ac935893726bc7005c7c5ad7d411354e5b8cc0f9 /gfx.c | |
parent | 71c2a573e193b0e4530cee49e02148320c84c612 (diff) | |
download | openttd-5fed47964e28c49f7af879700d013f2897341f4e.tar.xz |
(svn r2420) - Codechange: magic number elminitation of cursorsprites.
Diffstat (limited to 'gfx.c')
-rw-r--r-- | gfx.c | 16 |
1 files changed, 8 insertions, 8 deletions
@@ -1913,7 +1913,7 @@ bool FillDrawPixelInfo(DrawPixelInfo *n, DrawPixelInfo *o, int left, int top, in return true; } -static void SetCursorSprite(uint cursor) +static void SetCursorSprite(CursorID cursor) { CursorVars *cv = &_cursor; const Sprite *p; @@ -1934,12 +1934,12 @@ static void SetCursorSprite(uint cursor) static void SwitchAnimatedCursor(void) { CursorVars *cv = &_cursor; - const uint16 *cur; - uint sprite; + const CursorID *cur = cv->animate_cur; + CursorID sprite; + + // ANIM_CURSOR_END is 0xFFFF in table/animcursors.h + if (cur == NULL || *cur == 0xFFFF) cur = cv->animate_list; - cur = cv->animate_cur; - if (cur == NULL || *cur == 0xFFFF) - cur = cv->animate_list; sprite = cur[0]; cv->animate_timeout = cur[1]; cv->animate_cur = cur + 2; @@ -1954,7 +1954,7 @@ void CursorTick(void) SwitchAnimatedCursor(); } -void SetMouseCursor(uint cursor) +void SetMouseCursor(CursorID cursor) { // Turn off animation _cursor.animate_timeout = 0; @@ -1962,7 +1962,7 @@ void SetMouseCursor(uint cursor) SetCursorSprite(cursor); } -void SetAnimatedMouseCursor(const uint16 *table) +void SetAnimatedMouseCursor(const CursorID *table) { _cursor.animate_list = table; _cursor.animate_cur = NULL; |