OpenTTD Source 20241224-master-gee860a5c8e
SpriteLoaderGrf Class Reference

Sprite loader for graphics coming from a (New)GRF. More...

#include <grf.hpp>

Inheritance diagram for SpriteLoaderGrf:
SpriteLoader

Public Member Functions

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

Private Attributes

uint8_t container_ver
 

Additional Inherited Members

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

Detailed Description

Sprite loader for graphics coming from a (New)GRF.

Definition at line 16 of file grf.hpp.

Constructor & Destructor Documentation

◆ SpriteLoaderGrf()

SpriteLoaderGrf::SpriteLoaderGrf ( uint8_t  container_ver)
inline

Definition at line 19 of file grf.hpp.

Member Function Documentation

◆ LoadSprite()

uint8_t SpriteLoaderGrf::LoadSprite ( SpriteLoader::SpriteCollection sprite,
SpriteFile file,
size_t  file_pos,
SpriteType  sprite_type,
bool  load_32bpp,
uint8_t  control_flags 
)
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.
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.

Implements SpriteLoader.

Definition at line 353 of file grf.cpp.

Referenced by ReadSprite().

Field Documentation

◆ container_ver

uint8_t SpriteLoaderGrf::container_ver
private

Definition at line 17 of file grf.hpp.


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