OpenTTD Source 20241224-master-gee860a5c8e
|
Structure for passing information from the sprite loader to the blitter. More...
#include <spriteloader.hpp>
Public Member Functions | |
void | AllocateData (ZoomLevel zoom, size_t size) |
Allocate the sprite data of this sprite. | |
Data Fields | |
uint16_t | height |
Height of the sprite. | |
uint16_t | width |
Width of the sprite. | |
int16_t | x_offs |
The x-offset of where the sprite will be drawn. | |
int16_t | y_offs |
The y-offset of where the sprite will be drawn. | |
SpriteType | type |
The sprite type. | |
SpriteColourComponent | colours |
The colour components of the sprite with useful information. | |
SpriteLoader::CommonPixel * | data |
The sprite itself. | |
Static Private Attributes | |
static ReusableBuffer< SpriteLoader::CommonPixel > | buffer [ZOOM_LVL_END] |
Allocated memory to pass sprite data around. | |
Structure for passing information from the sprite loader to the blitter.
You can only use this struct once at a time when using AllocateData to allocate the memory as that will always return the same memory address. This to prevent thousands of malloc + frees just to load a sprite.
Definition at line 47 of file spriteloader.hpp.
|
inline |
Allocate the sprite data of this sprite.
zoom | Zoom level to allocate the data for. |
size | the minimum size of the data field. |
Definition at line 61 of file spriteloader.hpp.
Referenced by DecodeSingleSprite().
|
staticprivate |
Allocated memory to pass sprite data around.
Definition at line 64 of file spriteloader.hpp.
SpriteColourComponent SpriteLoader::Sprite::colours |
The colour components of the sprite with useful information.
Definition at line 53 of file spriteloader.hpp.
SpriteLoader::CommonPixel* SpriteLoader::Sprite::data |
The sprite itself.
Definition at line 54 of file spriteloader.hpp.
Referenced by DecodeSingleSprite().
uint16_t SpriteLoader::Sprite::height |
Height of the sprite.
Definition at line 48 of file spriteloader.hpp.
Referenced by DecodeSingleSprite().
SpriteType SpriteLoader::Sprite::type |
The sprite type.
Definition at line 52 of file spriteloader.hpp.
uint16_t SpriteLoader::Sprite::width |
Width of the sprite.
Definition at line 49 of file spriteloader.hpp.
Referenced by DecodeSingleSprite().
int16_t SpriteLoader::Sprite::x_offs |
The x-offset of where the sprite will be drawn.
Definition at line 50 of file spriteloader.hpp.
int16_t SpriteLoader::Sprite::y_offs |
The y-offset of where the sprite will be drawn.
Definition at line 51 of file spriteloader.hpp.