summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authortron <tron@openttd.org>2005-02-10 05:43:30 +0000
committertron <tron@openttd.org>2005-02-10 05:43:30 +0000
commit7cd19fe07adb1e93e35d983c50f3dba57420ca0c (patch)
treef80e3d1416973b1e780618876d295c1ff823868a
parent49a4d014b94ba40a489ba9c6d3deef4c3ccb6d35 (diff)
downloadopenttd-7cd19fe07adb1e93e35d983c50f3dba57420ca0c.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.c1
-rw-r--r--gfx.h12
-rw-r--r--landscape.c1
-rw-r--r--main_gui.c1
-rw-r--r--misc_gui.c1
-rw-r--r--smallmap_gui.c1
-rw-r--r--spritecache.c5
-rw-r--r--spritecache.h16
-rw-r--r--ttd.c2
-rw-r--r--vehicle.c1
-rw-r--r--viewport.c1
11 files changed, 27 insertions, 15 deletions
diff --git a/gfx.c b/gfx.c
index 0fafb1adb..a4c2d21f6 100644
--- a/gfx.c
+++ b/gfx.c
@@ -1,5 +1,6 @@
#include "stdafx.h"
#include "ttd.h"
+#include "spritecache.h"
#include "strings.h"
#include "gfx.h"
#include "table/palettes.h"
diff --git a/gfx.h b/gfx.h
index bbeb7b614..de202d298 100644
--- a/gfx.h
+++ b/gfx.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
diff --git a/ttd.c b/ttd.c
index c120f2f96..e2aa21f05 100644
--- a/ttd.c
+++ b/ttd.c
@@ -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);
diff --git a/vehicle.c b/vehicle.c
index f0f875b79..2ed6bf626 100644
--- a/vehicle.c
+++ b/vehicle.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/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"