OpenTTD Source
20240917-master-g9ab0a47812
|
Go to the documentation of this file.
32 extern uint _sprite_cache_size;
43 std::unique_ptr<uint8_t[]> data;
70 void GfxInitSpriteMem();
73 void IncreaseSpriteLRU();
uint16_t height
Height of the sprite.
bool SkipSpriteData(SpriteFile &file, uint8_t type, uint16_t num)
Skip the given amount of sprite graphics data.
int16_t x_offs
Number of pixels to shift the sprite to the right.
@ Recolour
Recolour sprite.
SpriteType GetSpriteType(SpriteID sprite)
Get the sprite type of a given sprite.
uint32_t GetSpriteLocalID(SpriteID sprite)
Get the GRF-local sprite id of a given sprite.
@ SCCF_ALLOW_ZOOM_MIN_2X_32BPP
Allow use of sprite min zoom setting at 2x in 32bpp mode.
SpriteAllocate that uses malloc to allocate memory.
SpriteFile * GetOriginFile(SpriteID sprite)
Get the SpriteFile of a given sprite.
Interface for something that can allocate memory for a sprite.
uint GetSpriteCountForFile(const std::string &filename, SpriteID begin, SpriteID end)
Count the sprites which originate from a specific file in a range of SpriteIDs.
SpriteAllocator that allocates memory via a unique_ptr array.
uint16_t width
Width of the sprite.
bool LoadNextSprite(int load_index, SpriteFile &file, uint file_sprite_id)
Load a real or recolour sprite.
void GfxClearFontSpriteCache()
Remove all encoded font sprites from the sprite cache without discarding sprite location information.
std::span< const std::unique_ptr< SpriteFile > > GetCachedSpriteFiles()
Get the list of cached SpriteFiles.
@ SCCF_ALLOW_ZOOM_MIN_1X_PAL
Allow use of sprite min zoom setting at 1x in palette mode.
Interface for something that can encode a sprite.
void * GetRawSprite(SpriteID sprite, SpriteType type, SpriteAllocator *allocator=nullptr, SpriteEncoder *encoder=nullptr)
Reads a sprite (from disk or sprite cache).
void * AllocatePtr(size_t size) override
Sprite allocator simply using malloc.
uint32_t SpriteID
The number of a sprite, without mapping bits and colourtables.
void ReadGRFSpriteOffsets(SpriteFile &file)
Parse the sprite section of GRFs.
void * AllocatePtr(size_t size) override
Allocate memory for a sprite.
RandomAccessFile with some extra information specific for sprite files.
int16_t y_offs
Number of pixels to shift the sprite downwards.
size_t GetGRFSpriteOffset(uint32_t id)
Get the file offset for a specific sprite in the sprite section of a GRF.
Subdirectory
The different kinds of subdirectories OpenTTD uses.
SpriteType
Types of sprites that might be loaded.
@ SCCF_ALLOW_ZOOM_MIN_2X_PAL
Allow use of sprite min zoom setting at 2x in palette mode.
uint GetMaxSpriteID()
Get a reasonable (upper bound) estimate of the maximum SpriteID used in OpenTTD; there will be no spr...
void GfxClearSpriteCache()
Remove all encoded sprites from the sprite cache without discarding sprite location information.
uint8_t data[]
Sprite data.
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.
@ SCCF_ALLOW_ZOOM_MIN_1X_32BPP
Allow use of sprite min zoom setting at 1x in 32bpp mode.