mirror of https://github.com/OpenTTD/OpenTTD
Codechange: do not use ZeroedMemoryAllocator for NewGRFSpriteLayout
parent
2d30df8110
commit
11d48aa47c
|
@ -20,8 +20,8 @@ typedef uint32_t CursorID; ///< The number of the cursor (sprite)
|
||||||
|
|
||||||
/** Combination of a palette sprite and a 'real' sprite */
|
/** Combination of a palette sprite and a 'real' sprite */
|
||||||
struct PalSpriteID {
|
struct PalSpriteID {
|
||||||
SpriteID sprite; ///< The 'real' sprite
|
SpriteID sprite{}; ///< The 'real' sprite
|
||||||
PaletteID pal; ///< The palette (use \c PAL_NONE) if not needed)
|
PaletteID pal{}; ///< The palette (use \c PAL_NONE) if not needed)
|
||||||
};
|
};
|
||||||
|
|
||||||
enum WindowKeyCodes : uint16_t {
|
enum WindowKeyCodes : uint16_t {
|
||||||
|
|
|
@ -109,9 +109,9 @@ static const uint TLR_MAX_VAR10 = 7; ///< Maximum value for var 10.
|
||||||
* In contrast to #DrawTileSprites this struct is for allocated
|
* In contrast to #DrawTileSprites this struct is for allocated
|
||||||
* layouts on the heap. It allocates data and frees them on destruction.
|
* layouts on the heap. It allocates data and frees them on destruction.
|
||||||
*/
|
*/
|
||||||
struct NewGRFSpriteLayout : ZeroedMemoryAllocator, DrawTileSprites {
|
struct NewGRFSpriteLayout : DrawTileSprites {
|
||||||
std::vector<DrawTileSeqStruct> seq;
|
std::vector<DrawTileSeqStruct> seq{};
|
||||||
std::vector<TileLayoutRegisters> registers;
|
std::vector<TileLayoutRegisters> registers{};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Number of sprites in all referenced spritesets.
|
* Number of sprites in all referenced spritesets.
|
||||||
|
|
|
@ -44,7 +44,7 @@ struct DrawTileSeqStruct {
|
||||||
* For allocated ones from NewGRF see #NewGRFSpriteLayout.
|
* For allocated ones from NewGRF see #NewGRFSpriteLayout.
|
||||||
*/
|
*/
|
||||||
struct DrawTileSprites {
|
struct DrawTileSprites {
|
||||||
PalSpriteID ground; ///< Palette and sprite for the ground
|
PalSpriteID ground{}; ///< Palette and sprite for the ground
|
||||||
|
|
||||||
DrawTileSprites(PalSpriteID ground) : ground(ground) {}
|
DrawTileSprites(PalSpriteID ground) : ground(ground) {}
|
||||||
DrawTileSprites() = default;
|
DrawTileSprites() = default;
|
||||||
|
|
Loading…
Reference in New Issue