OpenTTD Source
12.0-beta2
|
Go to the documentation of this file.
25 extern uint _sprite_cache_size;
27 typedef void *AllocatorProc(
size_t size);
52 void GfxInitSpriteMem();
54 void IncreaseSpriteLRU();
SpriteType GetSpriteType(SpriteID sprite)
Get the sprite type of a given sprite.
size_t GetGRFSpriteOffset(uint32 id)
Get the file offset for a specific sprite in the sprite section of a GRF.
uint16 height
Height of the sprite.
int16 x_offs
Number of pixels to shift the sprite to the right.
bool SkipSpriteData(SpriteFile &file, byte type, uint16 num)
Skip the given amount of sprite graphics data.
SpriteFile * GetOriginFile(SpriteID sprite)
Get the SpriteFile of a given sprite.
uint32 SpriteID
The number of a sprite, without mapping bits and colourtables.
void * GetRawSprite(SpriteID sprite, SpriteType type, AllocatorProc *allocator=nullptr, SpriteEncoder *encoder=nullptr)
Reads a sprite (from disk or sprite cache).
uint GetSpriteCountForFile(const std::string &filename, SpriteID begin, SpriteID end)
Count the sprites which originate from a specific file in a range of SpriteIDs.
uint32 GetSpriteLocalID(SpriteID sprite)
Get the GRF-local sprite id of a given sprite.
bool LoadNextSprite(int load_index, SpriteFile &file, uint file_sprite_id)
Load a real or recolour sprite.
uint16 width
Width of the sprite.
Interface for something that can encode a sprite.
void ReadGRFSpriteOffsets(SpriteFile &file)
Parse the sprite section of GRFs.
void * SimpleSpriteAlloc(size_t size)
Sprite allocator simply using malloc.
RandomAccessFile with some extra information specific for sprite files.
SpriteType
Types of sprites that might be loaded.
Subdirectory
The different kinds of subdirectories OpenTTD uses.
int16 y_offs
Number of pixels to shift the sprite downwards.
uint GetMaxSpriteID()
Get a reasonable (upper bound) estimate of the maximum SpriteID used in OpenTTD; there will be no spr...
@ ST_RECOLOUR
Recolour sprite.
void GfxClearSpriteCache()
Remove all encoded sprites from the sprite cache without discarding sprite location information.
SpriteFile & OpenCachedSpriteFile(const std::string &filename, Subdirectory subdir, bool palette_remap)
Open/get the SpriteFile that is cached for use in the sprite cache.
Data structure describing a sprite.