(svn r1853) Move spritecache function declarations into a header of their own and use SpriteID as parameter type where appropriate
authortron
Thu, 10 Feb 2005 05:43:30 +0000
changeset 1349 07514c2cc6d1
parent 1348 1d123409026e
child 1350 067b22970f19
(svn r1853) Move spritecache function declarations into a header of their own and use SpriteID as parameter type where appropriate
gfx.c
gfx.h
landscape.c
main_gui.c
misc_gui.c
smallmap_gui.c
spritecache.c
spritecache.h
ttd.c
vehicle.c
viewport.c
--- a/gfx.c	Tue Feb 08 22:22:42 2005 +0000
+++ b/gfx.c	Thu Feb 10 05:43:30 2005 +0000
@@ -1,5 +1,6 @@
 #include "stdafx.h"
 #include "ttd.h"
+#include "spritecache.h"
 #include "strings.h"
 #include "gfx.h"
 #include "table/palettes.h"
--- a/gfx.h	Tue Feb 08 22:22:42 2005 +0000
+++ b/gfx.h	Thu Feb 10 05:43:30 2005 +0000
@@ -69,11 +69,6 @@
 /* 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 @@
 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];
--- a/landscape.c	Tue Feb 08 22:22:42 2005 +0000
+++ b/landscape.c	Thu Feb 10 05:43:30 2005 +0000
@@ -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"
--- a/main_gui.c	Tue Feb 08 22:22:42 2005 +0000
+++ b/main_gui.c	Thu Feb 10 05:43:30 2005 +0000
@@ -1,5 +1,6 @@
 #include "stdafx.h"
 #include "ttd.h"
+#include "spritecache.h"
 #include "strings.h"
 #include "table/strings.h"
 #include "map.h"
--- a/misc_gui.c	Tue Feb 08 22:22:42 2005 +0000
+++ b/misc_gui.c	Thu Feb 10 05:43:30 2005 +0000
@@ -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"
--- a/smallmap_gui.c	Tue Feb 08 22:22:42 2005 +0000
+++ b/smallmap_gui.c	Thu Feb 10 05:43:30 2005 +0000
@@ -1,5 +1,6 @@
 #include "stdafx.h"
 #include "ttd.h"
+#include "spritecache.h"
 #include "table/strings.h"
 #include "map.h"
 #include "tile.h"
--- a/spritecache.c	Tue Feb 08 22:22:42 2005 +0000
+++ b/spritecache.c	Thu Feb 10 05:43:30 2005 +0000
@@ -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 @@
 }
 #endif
 
-byte *GetSpritePtr(uint sprite)
+byte *GetSpritePtr(SpriteID sprite)
 {
 	byte *p;
 
@@ -976,7 +977,7 @@
 }
 
 
-const SpriteDimension *GetSpriteDimension(uint sprite)
+const SpriteDimension *GetSpriteDimension(SpriteID sprite)
 {
 	static SpriteDimension sd_static;
 	SpriteDimension *sd;
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/spritecache.h	Thu Feb 10 05:43:30 2005 +0000
@@ -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
--- a/ttd.c	Tue Feb 08 22:22:42 2005 +0000
+++ b/ttd.c	Thu Feb 10 05:43:30 2005 +0000
@@ -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);
--- a/vehicle.c	Tue Feb 08 22:22:42 2005 +0000
+++ b/vehicle.c	Thu Feb 10 05:43:30 2005 +0000
@@ -1,5 +1,6 @@
 #include "stdafx.h"
 #include "ttd.h"
+#include "spritecache.h"
 #include "table/strings.h"
 #include "map.h"
 #include "tile.h"
--- a/viewport.c	Tue Feb 08 22:22:42 2005 +0000
+++ b/viewport.c	Thu Feb 10 05:43:30 2005 +0000
@@ -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"