OpenTTD Source 20250509-master-ga45f23686d
SpriteLoaderMakeIndexed Class Reference

Sprite loader for converting graphics coming from another source. More...

#include <makeindexed.h>

Inheritance diagram for SpriteLoaderMakeIndexed:
SpriteLoader

Public Member Functions

 SpriteLoaderMakeIndexed (SpriteLoader &baseloader)
 
ZoomLevels LoadSprite (SpriteLoader::SpriteCollection &sprite, SpriteFile &file, size_t file_pos, SpriteType sprite_type, bool load_32bpp, uint8_t control_flags, ZoomLevels &avail_8bpp, ZoomLevels &avail_32bpp) override
 Load a sprite from the disk and return a sprite struct which is the same for all loaders.
 

Private Attributes

SpriteLoaderbaseloader
 

Additional Inherited Members

- Public Types inherited from SpriteLoader
using SpriteCollection = SpriteCollMap< Sprite >
 Type defining a collection of sprites, one for each zoom level.
 

Detailed Description

Sprite loader for converting graphics coming from another source.

Definition at line 16 of file makeindexed.h.

Constructor & Destructor Documentation

◆ SpriteLoaderMakeIndexed()

SpriteLoaderMakeIndexed::SpriteLoaderMakeIndexed ( SpriteLoader baseloader)
inline

Definition at line 19 of file makeindexed.h.

Member Function Documentation

◆ LoadSprite()

ZoomLevels SpriteLoaderMakeIndexed::LoadSprite ( SpriteLoader::SpriteCollection sprite,
SpriteFile file,
size_t  file_pos,
SpriteType  sprite_type,
bool  load_32bpp,
uint8_t  control_flags,
ZoomLevels avail_8bpp,
ZoomLevels avail_32bpp 
)
overridevirtual

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.
fileThe 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.
[out]avail_8bppAvailable 8bpp sprites.
[out]avail_32bppAvailable 32bpp sprites.
Returns
Available sprites matching load_32bpp.

Implements SpriteLoader.

Definition at line 51 of file makeindexed.cpp.

References Begin, Convert32bppTo8bpp(), End, SpriteLoader::LoadSprite(), and BaseBitSet< Timpl, Tvalue_type, Tstorage, Tmask >::Test().

Referenced by ReadSprite().

Field Documentation

◆ baseloader

SpriteLoader& SpriteLoaderMakeIndexed::baseloader
private

Definition at line 17 of file makeindexed.h.


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