Files
@ r12495:cee0dce48aaf
Branch filter:
Location: cpp/openttd-patchpack/source/src/spritecache.h - annotation
r12495:cee0dce48aaf
1.1 KiB
text/x-c
(svn r16942) -Codechange: document CanExpandRailStation and remove the 'magic' array of numbers for a named struct
r5475:3f5cd13d1b63 r5475:3f5cd13d1b63 r9111:983de9c5a848 r6420:01087f989fd1 r5475:3f5cd13d1b63 r5475:3f5cd13d1b63 r5475:3f5cd13d1b63 r8123:dde0a9a84019 r8123:dde0a9a84019 r12246:330df08e87cc r6248:b940b09d7ab8 r12246:330df08e87cc r12246:330df08e87cc r12246:330df08e87cc r12246:330df08e87cc r12246:330df08e87cc r6248:b940b09d7ab8 r5475:3f5cd13d1b63 r6803:f739da58f36c r6803:f739da58f36c r12010:5513d8f8e97d r5475:3f5cd13d1b63 r5475:3f5cd13d1b63 r10056:7a18efcd8edb r5475:3f5cd13d1b63 r10056:7a18efcd8edb r10056:7a18efcd8edb r5475:3f5cd13d1b63 r5475:3f5cd13d1b63 r10056:7a18efcd8edb r5475:3f5cd13d1b63 r10056:7a18efcd8edb r10056:7a18efcd8edb r5475:3f5cd13d1b63 r5475:3f5cd13d1b63 r6247:96e840dbefcc r6247:96e840dbefcc r5475:3f5cd13d1b63 r6908:7e03190d606c r5587:034e5e185dc2 r5475:3f5cd13d1b63 r5475:3f5cd13d1b63 | /* $Id$ */
/** @file spritecache.h Functions to cache sprites in memory. */
#ifndef SPRITECACHE_H
#define SPRITECACHE_H
#include "gfx_type.h"
/** Data structure describing a sprite. */
struct Sprite {
byte height; ///< Height of the sprite.
uint16 width; ///< Width of the sprite.
int16 x_offs; ///< Number of pixels to shift the sprite to the right.
int16 y_offs; ///< Number of pixels to shift the sprite downwards.
byte data[]; ///< Sprite data.
};
extern uint _sprite_cache_size;
void *GetRawSprite(SpriteID sprite, SpriteType type);
bool SpriteExists(SpriteID sprite);
static inline const Sprite *GetSprite(SpriteID sprite, SpriteType type)
{
assert(type != ST_RECOLOUR);
return (Sprite*)GetRawSprite(sprite, type);
}
static inline const byte *GetNonSprite(SpriteID sprite, SpriteType type)
{
assert(type == ST_RECOLOUR);
return (byte*)GetRawSprite(sprite, type);
}
void GfxInitSpriteMem();
void IncreaseSpriteLRU();
bool LoadNextSprite(int load_index, byte file_index, uint file_sprite_id);
void DupSprite(SpriteID old_spr, SpriteID new_spr);
#endif /* SPRITECACHE_H */
|