(svn r1853) Move spritecache function declarations into a header of their own and use SpriteID as parameter type where appropriate

This commit is contained in:
tron 2005-02-10 05:43:30 +00:00
parent 092e72d60d
commit 2a151d9354
11 changed files with 27 additions and 15 deletions

1
gfx.c
View File

@ -1,5 +1,6 @@
#include "stdafx.h"
#include "ttd.h"
#include "spritecache.h"
#include "strings.h"
#include "gfx.h"
#include "table/palettes.h"

12
gfx.h
View File

@ -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];

View File

@ -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"

View File

@ -1,5 +1,6 @@
#include "stdafx.h"
#include "ttd.h"
#include "spritecache.h"
#include "strings.h"
#include "table/strings.h"
#include "map.h"

View File

@ -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"

View File

@ -1,5 +1,6 @@
#include "stdafx.h"
#include "ttd.h"
#include "spritecache.h"
#include "table/strings.h"
#include "map.h"
#include "tile.h"

View File

@ -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;

16
spritecache.h Normal file
View File

@ -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

2
ttd.c
View File

@ -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);

View File

@ -1,5 +1,6 @@
#include "stdafx.h"
#include "ttd.h"
#include "spritecache.h"
#include "table/strings.h"
#include "map.h"
#include "tile.h"

View File

@ -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"