OpenTTD Source 20250509-master-gb1cdf5024f
|
NewGRF supplied spritelayout. More...
#include <newgrf_commons.h>
Public Member Functions | |
void | Allocate (uint num_sprites) |
Allocate a spritelayout for num_sprites building sprites. | |
void | AllocateRegisters () |
Allocate memory for register modifiers. | |
bool | NeedsPreprocessing () const |
Tests whether this spritelayout needs preprocessing by SpriteLayoutProcessor, or whether it can be used directly. | |
std::span< const DrawTileSeqStruct > | GetSequence () const override |
![]() | |
DrawTileSprites (PalSpriteID ground) | |
Data Fields | |
std::vector< DrawTileSeqStruct > | seq {} |
std::vector< TileLayoutRegisters > | registers {} |
uint | consistent_max_offset = 0 |
Number of sprites in all referenced spritesets. | |
![]() | |
PalSpriteID | ground {} |
Palette and sprite for the ground. | |
NewGRF supplied spritelayout.
In contrast to DrawTileSprites this struct is for allocated layouts on the heap. It allocates data and frees them on destruction.
Definition at line 114 of file newgrf_commons.h.
void NewGRFSpriteLayout::Allocate | ( | uint | num_sprites | ) |
Allocate a spritelayout for num_sprites building sprites.
num_sprites | Number of building sprites to allocate memory for. (not counting the terminator) |
Definition at line 570 of file newgrf_commons.cpp.
Referenced by ReadSpriteLayout().
void NewGRFSpriteLayout::AllocateRegisters | ( | ) |
Allocate memory for register modifiers.
Definition at line 580 of file newgrf_commons.cpp.
Referenced by ReadSpriteLayout(), and ReadSpriteLayoutRegisters().
|
inlineoverridevirtual |
Implements DrawTileSprites.
Definition at line 137 of file newgrf_commons.h.
|
inline |
Tests whether this spritelayout needs preprocessing by SpriteLayoutProcessor, or whether it can be used directly.
Definition at line 132 of file newgrf_commons.h.
Referenced by DrawStationTile(), and TileLayoutSpriteGroup::ProcessRegisters().
uint NewGRFSpriteLayout::consistent_max_offset = 0 |
Number of sprites in all referenced spritesets.
If these numbers are inconsistent, then this is 0 and the real values are in registers
.
Definition at line 122 of file newgrf_commons.h.
Referenced by TileLayoutSpriteGroup::ProcessRegisters(), ReadSpriteLayout(), and StationChangeInfo().
std::vector<TileLayoutRegisters> NewGRFSpriteLayout::registers {} |
Definition at line 116 of file newgrf_commons.h.
std::vector<DrawTileSeqStruct> NewGRFSpriteLayout::seq {} |
Definition at line 115 of file newgrf_commons.h.