From 11d48aa47c0f41d0ae7d8066f71b86e3549359b2 Mon Sep 17 00:00:00 2001 From: Rubidium Date: Thu, 23 Jan 2025 18:56:59 +0100 Subject: [PATCH] Codechange: do not use ZeroedMemoryAllocator for NewGRFSpriteLayout --- src/gfx_type.h | 4 ++-- src/newgrf_commons.h | 6 +++--- src/sprite.h | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/gfx_type.h b/src/gfx_type.h index 85eb55b094..f9ef236877 100644 --- a/src/gfx_type.h +++ b/src/gfx_type.h @@ -20,8 +20,8 @@ typedef uint32_t CursorID; ///< The number of the cursor (sprite) /** Combination of a palette sprite and a 'real' sprite */ struct PalSpriteID { - SpriteID sprite; ///< The 'real' sprite - PaletteID pal; ///< The palette (use \c PAL_NONE) if not needed) + SpriteID sprite{}; ///< The 'real' sprite + PaletteID pal{}; ///< The palette (use \c PAL_NONE) if not needed) }; enum WindowKeyCodes : uint16_t { diff --git a/src/newgrf_commons.h b/src/newgrf_commons.h index fc7d407796..13e0f9a053 100644 --- a/src/newgrf_commons.h +++ b/src/newgrf_commons.h @@ -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 * layouts on the heap. It allocates data and frees them on destruction. */ -struct NewGRFSpriteLayout : ZeroedMemoryAllocator, DrawTileSprites { - std::vector seq; - std::vector registers; +struct NewGRFSpriteLayout : DrawTileSprites { + std::vector seq{}; + std::vector registers{}; /** * Number of sprites in all referenced spritesets. diff --git a/src/sprite.h b/src/sprite.h index b330e63895..c9a89ce163 100644 --- a/src/sprite.h +++ b/src/sprite.h @@ -44,7 +44,7 @@ struct DrawTileSeqStruct { * For allocated ones from NewGRF see #NewGRFSpriteLayout. */ struct DrawTileSprites { - PalSpriteID ground; ///< Palette and sprite for the ground + PalSpriteID ground{}; ///< Palette and sprite for the ground DrawTileSprites(PalSpriteID ground) : ground(ground) {} DrawTileSprites() = default;