OpenTTD Source 20241224-master-gee860a5c8e
SpriteLoader Class Referenceabstract

Interface for the loader of our sprites. More...

#include <spriteloader.hpp>

Inheritance diagram for SpriteLoader:
SpriteLoaderGrf

Data Structures

struct  CommonPixel
 Definition of a common pixel in OpenTTD's realm. More...
 
struct  Sprite
 Structure for passing information from the sprite loader to the blitter. More...
 

Public Types

using SpriteCollection = std::array< Sprite, ZOOM_LVL_END >
 Type defining a collection of sprites, one for each zoom level.
 

Public Member Functions

virtual uint8_t LoadSprite (SpriteLoader::SpriteCollection &sprite, SpriteFile &file, size_t file_pos, SpriteType sprite_type, bool load_32bpp, uint8_t control_flags)=0
 Load a sprite from the disk and return a sprite struct which is the same for all loaders.
 

Detailed Description

Interface for the loader of our sprites.

Definition at line 30 of file spriteloader.hpp.

Member Typedef Documentation

◆ SpriteCollection

Type defining a collection of sprites, one for each zoom level.

Definition at line 70 of file spriteloader.hpp.

Member Function Documentation

◆ LoadSprite()

virtual uint8_t SpriteLoader::LoadSprite ( SpriteLoader::SpriteCollection sprite,
SpriteFile file,
size_t  file_pos,
SpriteType  sprite_type,
bool  load_32bpp,
uint8_t  control_flags 
)
pure virtual

Load a sprite from the disk and return a sprite struct which is the same for all loaders.

Parameters
[out]spriteThe sprites to fill with data.
file_slotThe file "descriptor" of the file we read from.
file_posThe position within the file the image begins.
sprite_typeThe type of sprite we're trying to load.
load_32bppTrue if 32bpp sprites should be loaded, false for a 8bpp sprite.
control_flagsControl flags, see SpriteCacheCtrlFlags.
Returns
Bit mask of the zoom levels successfully loaded or 0 if no sprite could be loaded.

Implemented in SpriteLoaderGrf.


The documentation for this class was generated from the following file: