spritecache.h
author Darkvater
Sun, 26 Mar 2006 22:55:27 +0000
changeset 3347 0ddacd451b81
parent 2436 7d5df545bd5d
child 3565 ef0a9ef56fa0
permissions -rw-r--r--
(svn r4131) - CodeChange: Add proper semantics for StationID for such variables instead of using the general uint16-type. StationID was added for depots, waypoints and stations where necessary. We probably need to change GetDepot(), IsDepotIndex(), IsStationIndex(), GetWaypoint() and IsWaypointIndex() as well to use StationID.
2186
db48cf29b983 (svn r2701) Insert Id tags into all source files
tron
parents: 2123
diff changeset
     1
/* $Id$ */
db48cf29b983 (svn r2701) Insert Id tags into all source files
tron
parents: 2123
diff changeset
     2
1349
15979a2e9001 (svn r1853) Move spritecache function declarations into a header of their own and use SpriteID as parameter type where appropriate
tron
parents:
diff changeset
     3
#ifndef SPRITECACHE_H
15979a2e9001 (svn r1853) Move spritecache function declarations into a header of their own and use SpriteID as parameter type where appropriate
tron
parents:
diff changeset
     4
#define SPRITECACHE_H
15979a2e9001 (svn r1853) Move spritecache function declarations into a header of their own and use SpriteID as parameter type where appropriate
tron
parents:
diff changeset
     5
1350
fd0136012af1 (svn r1854) Split GetSpritePtr() into GetSprite() for regular sprites (returning a Sprite*) and GetNonSprite() for "sprites" of type 0xFF (returning byte*)
tron
parents: 1349
diff changeset
     6
typedef struct Sprite {
fd0136012af1 (svn r1854) Split GetSpritePtr() into GetSprite() for regular sprites (returning a Sprite*) and GetNonSprite() for "sprites" of type 0xFF (returning byte*)
tron
parents: 1349
diff changeset
     7
	byte info;
fd0136012af1 (svn r1854) Split GetSpritePtr() into GetSprite() for regular sprites (returning a Sprite*) and GetNonSprite() for "sprites" of type 0xFF (returning byte*)
tron
parents: 1349
diff changeset
     8
	byte height;
1356
fd5b13fafff3 (svn r1860) The sprite header endianness issue was solved in r1855
tron
parents: 1352
diff changeset
     9
	uint16 width;
fd5b13fafff3 (svn r1860) The sprite header endianness issue was solved in r1855
tron
parents: 1352
diff changeset
    10
	int16 x_offs;
fd5b13fafff3 (svn r1860) The sprite header endianness issue was solved in r1855
tron
parents: 1352
diff changeset
    11
	int16 y_offs;
1350
fd0136012af1 (svn r1854) Split GetSpritePtr() into GetSprite() for regular sprites (returning a Sprite*) and GetNonSprite() for "sprites" of type 0xFF (returning byte*)
tron
parents: 1349
diff changeset
    12
	byte data[VARARRAY_SIZE];
fd0136012af1 (svn r1854) Split GetSpritePtr() into GetSprite() for regular sprites (returning a Sprite*) and GetNonSprite() for "sprites" of type 0xFF (returning byte*)
tron
parents: 1349
diff changeset
    13
} Sprite;
fd0136012af1 (svn r1854) Split GetSpritePtr() into GetSprite() for regular sprites (returning a Sprite*) and GetNonSprite() for "sprites" of type 0xFF (returning byte*)
tron
parents: 1349
diff changeset
    14
1361
5833194df433 (svn r1865) Fix some warnings
tron
parents: 1357
diff changeset
    15
const void *GetRawSprite(SpriteID sprite);
5833194df433 (svn r1865) Fix some warnings
tron
parents: 1357
diff changeset
    16
5833194df433 (svn r1865) Fix some warnings
tron
parents: 1357
diff changeset
    17
static inline const Sprite *GetSprite(SpriteID sprite)
5833194df433 (svn r1865) Fix some warnings
tron
parents: 1357
diff changeset
    18
{
5833194df433 (svn r1865) Fix some warnings
tron
parents: 1357
diff changeset
    19
	return GetRawSprite(sprite);
5833194df433 (svn r1865) Fix some warnings
tron
parents: 1357
diff changeset
    20
}
5833194df433 (svn r1865) Fix some warnings
tron
parents: 1357
diff changeset
    21
5833194df433 (svn r1865) Fix some warnings
tron
parents: 1357
diff changeset
    22
static inline const byte *GetNonSprite(SpriteID sprite)
5833194df433 (svn r1865) Fix some warnings
tron
parents: 1357
diff changeset
    23
{
5833194df433 (svn r1865) Fix some warnings
tron
parents: 1357
diff changeset
    24
	return GetRawSprite(sprite);
5833194df433 (svn r1865) Fix some warnings
tron
parents: 1357
diff changeset
    25
}
1349
15979a2e9001 (svn r1853) Move spritecache function declarations into a header of their own and use SpriteID as parameter type where appropriate
tron
parents:
diff changeset
    26
2340
e18ef06bc59a (svn r2866) Move all functions and tables which aren't directly involved in managing the sprite heap to a new file gfxinit.c.
tron
parents: 2319
diff changeset
    27
void GfxInitSpriteMem(void);
1349
15979a2e9001 (svn r1853) Move spritecache function declarations into a header of their own and use SpriteID as parameter type where appropriate
tron
parents:
diff changeset
    28
void IncreaseSpriteLRU(void);
15979a2e9001 (svn r1853) Move spritecache function declarations into a header of their own and use SpriteID as parameter type where appropriate
tron
parents:
diff changeset
    29
2340
e18ef06bc59a (svn r2866) Move all functions and tables which aren't directly involved in managing the sprite heap to a new file gfxinit.c.
tron
parents: 2319
diff changeset
    30
bool LoadNextSprite(int load_index, byte file_index);
2407
6c378ce4d469 (svn r2933) Implement the non-breaking space
tron
parents: 2340
diff changeset
    31
void DupSprite(SpriteID old, SpriteID new);
2340
e18ef06bc59a (svn r2866) Move all functions and tables which aren't directly involved in managing the sprite heap to a new file gfxinit.c.
tron
parents: 2319
diff changeset
    32
void SkipSprites(uint count);
e18ef06bc59a (svn r2866) Move all functions and tables which aren't directly involved in managing the sprite heap to a new file gfxinit.c.
tron
parents: 2319
diff changeset
    33
2436
7d5df545bd5d (svn r2962) - const correctness for all Get* functions and most Draw* functions that don't change their pointer parameters
Darkvater
parents: 2407
diff changeset
    34
#endif /* SPRITECACHE_H */