diff options
author | tron <tron@openttd.org> | 2005-02-10 05:43:30 +0000 |
---|---|---|
committer | tron <tron@openttd.org> | 2005-02-10 05:43:30 +0000 |
commit | 2a151d93546db1d867a7cc0691a5c0e5973a4b98 (patch) | |
tree | f80e3d1416973b1e780618876d295c1ff823868a | |
parent | 092e72d60db91b631099d1844eba1b909e279756 (diff) | |
download | openttd-2a151d93546db1d867a7cc0691a5c0e5973a4b98.tar.xz |
(svn r1853) Move spritecache function declarations into a header of their own and use SpriteID as parameter type where appropriate
-rw-r--r-- | gfx.c | 1 | ||||
-rw-r--r-- | gfx.h | 12 | ||||
-rw-r--r-- | landscape.c | 1 | ||||
-rw-r--r-- | main_gui.c | 1 | ||||
-rw-r--r-- | misc_gui.c | 1 | ||||
-rw-r--r-- | smallmap_gui.c | 1 | ||||
-rw-r--r-- | spritecache.c | 5 | ||||
-rw-r--r-- | spritecache.h | 16 | ||||
-rw-r--r-- | ttd.c | 2 | ||||
-rw-r--r-- | vehicle.c | 1 | ||||
-rw-r--r-- | viewport.c | 1 |
11 files changed, 27 insertions, 15 deletions
@@ -1,5 +1,6 @@ #include "stdafx.h" #include "ttd.h" +#include "spritecache.h" #include "strings.h" #include "gfx.h" #include "table/palettes.h" @@ -69,11 +69,6 @@ bool FillDrawPixelInfo(DrawPixelInfo *n, DrawPixelInfo *o, int left, int top, in /* window.c */ void DrawOverlappedWindowForAll(int left, int top, int right, int bottom); -/* spritecache.c */ -byte *GetSpritePtr(uint sprite); -void GfxInitSpriteMem(byte *ptr, uint32 size); -void GfxLoadSprites(void); - void SetMouseCursor(uint cursor); void SetAnimatedMouseCursor(const uint16 *table); void CursorTick(void); @@ -83,13 +78,6 @@ void UndrawMouseCursor(void); bool ChangeResInGame(int w, int h); void ToggleFullScreen(const bool full_screen); -typedef struct { - int xoffs, yoffs; - int xsize, ysize; -} SpriteDimension; - -const SpriteDimension *GetSpriteDimension(uint sprite); - /* gfx.c */ VARDEF int _stringwidth_base; VARDEF byte _stringwidth_table[0x2A0]; diff --git a/landscape.c b/landscape.c index 462e669b1..4bd2d78cf 100644 --- a/landscape.c +++ b/landscape.c @@ -1,6 +1,7 @@ #include "stdafx.h" #include "ttd.h" #include "map.h" +#include "spritecache.h" #include "tile.h" #include <stdarg.h> #include "gfx.h" diff --git a/main_gui.c b/main_gui.c index 7aee7faa8..65f29b981 100644 --- a/main_gui.c +++ b/main_gui.c @@ -1,5 +1,6 @@ #include "stdafx.h" #include "ttd.h" +#include "spritecache.h" #include "strings.h" #include "table/strings.h" #include "map.h" diff --git a/misc_gui.c b/misc_gui.c index a2dba86a4..c24197fdf 100644 --- a/misc_gui.c +++ b/misc_gui.c @@ -1,6 +1,7 @@ #include "stdafx.h" #include "ttd.h" #include "debug.h" +#include "spritecache.h" #include "strings.h" #include "table/strings.h" #include "map.h" diff --git a/smallmap_gui.c b/smallmap_gui.c index ac9fce8a9..476867083 100644 --- a/smallmap_gui.c +++ b/smallmap_gui.c @@ -1,5 +1,6 @@ #include "stdafx.h" #include "ttd.h" +#include "spritecache.h" #include "table/strings.h" #include "map.h" #include "tile.h" diff --git a/spritecache.c b/spritecache.c index 75ded63a4..30cd4ad46 100644 --- a/spritecache.c +++ b/spritecache.c @@ -2,6 +2,7 @@ #include "ttd.h" #include "debug.h" #include "gfx.h" +#include "spritecache.h" #include "fileio.h" #include "newgrf.h" #include "md5.h" @@ -697,7 +698,7 @@ static uint RotateSprite(uint s) } #endif -byte *GetSpritePtr(uint sprite) +byte *GetSpritePtr(SpriteID sprite) { byte *p; @@ -976,7 +977,7 @@ void GfxLoadSprites(void) } -const SpriteDimension *GetSpriteDimension(uint sprite) +const SpriteDimension *GetSpriteDimension(SpriteID sprite) { static SpriteDimension sd_static; SpriteDimension *sd; diff --git a/spritecache.h b/spritecache.h new file mode 100644 index 000000000..d6a4373aa --- /dev/null +++ b/spritecache.h @@ -0,0 +1,16 @@ +#ifndef SPRITECACHE_H +#define SPRITECACHE_H + +typedef struct { + int xoffs, yoffs; + int xsize, ysize; +} SpriteDimension; + +const SpriteDimension *GetSpriteDimension(SpriteID sprite); +byte *GetSpritePtr(SpriteID sprite); + +void GfxInitSpriteMem(byte *ptr, uint32 size); +void GfxLoadSprites(void); +void IncreaseSpriteLRU(void); + +#endif @@ -8,6 +8,7 @@ #define VARDEF #include "ttd.h" +#include "spritecache.h" #include "gfx.h" #include "gui.h" #include "station.h" @@ -35,7 +36,6 @@ #include <stdarg.h> -void IncreaseSpriteLRU(void); void GenerateWorld(int mode, uint log_x, uint log_y); void CallLandscapeTick(void); void IncreaseDate(void); @@ -1,5 +1,6 @@ #include "stdafx.h" #include "ttd.h" +#include "spritecache.h" #include "table/strings.h" #include "map.h" #include "tile.h" diff --git a/viewport.c b/viewport.c index 4718a8c46..726a053a1 100644 --- a/viewport.c +++ b/viewport.c @@ -1,6 +1,7 @@ #include "stdafx.h" #include "ttd.h" #include "debug.h" +#include "spritecache.h" #include "strings.h" #include "table/strings.h" #include "map.h" |