mirror of https://github.com/OpenTTD/OpenTTD.git
(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:
parent
092e72d60d
commit
2a151d9354
1
gfx.c
1
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"
|
||||
|
|
12
gfx.h
12
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];
|
||||
|
|
|
@ -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"
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
#include "stdafx.h"
|
||||
#include "ttd.h"
|
||||
#include "spritecache.h"
|
||||
#include "strings.h"
|
||||
#include "table/strings.h"
|
||||
#include "map.h"
|
||||
|
|
|
@ -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"
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
#include "stdafx.h"
|
||||
#include "ttd.h"
|
||||
#include "spritecache.h"
|
||||
#include "table/strings.h"
|
||||
#include "map.h"
|
||||
#include "tile.h"
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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
2
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);
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
#include "stdafx.h"
|
||||
#include "ttd.h"
|
||||
#include "spritecache.h"
|
||||
#include "table/strings.h"
|
||||
#include "map.h"
|
||||
#include "tile.h"
|
||||
|
|
|
@ -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"
|
||||
|
|
Loading…
Reference in New Issue