OpenTTD Source: SpriteLoaderMakeIndexed Class Reference

OpenTTD Source 15.3

Public Member Functions | Private Attributes
SpriteLoaderMakeIndexed Class Reference

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

`#include <makeindexed.h>`

Inheritance diagram for SpriteLoaderMakeIndexed:

## Public Member Functions
| SpriteLoaderMakeIndexed (SpriteLoader &baseloader)
ZoomLevels | LoadSprite (SpriteLoader::SpriteCollection &sprite, SpriteFile &file, size_t file_pos, SpriteType sprite_type, bool load_32bpp, SpriteCacheCtrlFlags 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
SpriteLoader & | baseloader

## 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,
|  | SpriteCacheCtrlFlags | 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] | sprite | The sprites to fill with data.
  | file | The file "descriptor" of the file we read from.
  | file_pos | The position within the file the image begins.
  | sprite_type | The type of sprite we're trying to load.
  | load_32bpp | True if 32bpp sprites should be loaded, false for a 8bpp sprite.
  | control_flags | Control flags, see SpriteCacheCtrlFlags.
  [out] | avail_8bpp | Available 8bpp sprites.
  [out] | avail_32bpp | Available 32bpp sprites.

Returns
  Available sprites matching load_32bpp.

Implements SpriteLoader.

Definition at line 50 of file makeindexed.cpp.

References Convert32bppTo8bpp(), and SpriteLoader::LoadSprite().

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:

- src/spriteloader/makeindexed.h
- src/spriteloader/makeindexed.cpp