spritecache.h
author tron
Tue, 15 Mar 2005 18:31:38 +0000
changeset 1511 32b095e3da76
parent 1361 10d9b95e7a81
child 2014 0230ed9186bc
permissions -rw-r--r--
(svn r2015) Use a struct and an inline function for colour masking on the mini-map - this should improve readability a bit
#ifndef SPRITECACHE_H
#define SPRITECACHE_H

typedef struct Sprite {
	byte info;
	byte height;
	uint16 width;
	int16 x_offs;
	int16 y_offs;
	byte data[VARARRAY_SIZE];
} Sprite;
assert_compile(sizeof(Sprite) == 8);

typedef struct {
	int xoffs, yoffs;
	int xsize, ysize;
} SpriteDimension;

const SpriteDimension *GetSpriteDimension(SpriteID sprite);
const void *GetRawSprite(SpriteID sprite);

static inline const Sprite *GetSprite(SpriteID sprite)
{
	return GetRawSprite(sprite);
}

static inline const byte *GetNonSprite(SpriteID sprite)
{
	return GetRawSprite(sprite);
}

void GfxLoadSprites(void);
void IncreaseSpriteLRU(void);

#endif