author | truelight |
Thu, 24 Mar 2005 14:43:40 +0000 | |
changeset 1540 | 6eef12dab5bf |
parent 1361 | 5833194df433 |
child 2014 | ccfe4fa81a14 |
permissions | -rw-r--r-- |
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
|
1 |
#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
|
2 |
#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
|
3 |
|
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
|
4 |
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
|
5 |
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
|
6 |
byte height; |
1356
fd5b13fafff3
(svn r1860) The sprite header endianness issue was solved in r1855
tron
parents:
1352
diff
changeset
|
7 |
uint16 width; |
fd5b13fafff3
(svn r1860) The sprite header endianness issue was solved in r1855
tron
parents:
1352
diff
changeset
|
8 |
int16 x_offs; |
fd5b13fafff3
(svn r1860) The sprite header endianness issue was solved in r1855
tron
parents:
1352
diff
changeset
|
9 |
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
|
10 |
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
|
11 |
} 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
|
12 |
assert_compile(sizeof(Sprite) == 8); |
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 |
|
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
|
14 |
typedef struct { |
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
|
15 |
int xoffs, yoffs; |
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
|
16 |
int xsize, ysize; |
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
|
17 |
} SpriteDimension; |
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
|
18 |
|
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
|
19 |
const SpriteDimension *GetSpriteDimension(SpriteID sprite); |
1361 | 20 |
const void *GetRawSprite(SpriteID sprite); |
21 |
||
22 |
static inline const Sprite *GetSprite(SpriteID sprite) |
|
23 |
{ |
|
24 |
return GetRawSprite(sprite); |
|
25 |
} |
|
26 |
||
27 |
static inline const byte *GetNonSprite(SpriteID sprite) |
|
28 |
{ |
|
29 |
return GetRawSprite(sprite); |
|
30 |
} |
|
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
|
31 |
|
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
|
32 |
void GfxLoadSprites(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
|
33 |
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
|
34 |
|
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
|
35 |
#endif |