mirror of https://github.com/OpenTTD/OpenTTD
Codechange: Use default initialisation for 32bpp_sse2's SpriteData.
Avoids using memset.pull/13881/head
parent
828e808444
commit
5abe7c1386
|
@ -35,8 +35,7 @@ Sprite *Blitter_32bppSSE_Base::Encode(const SpriteLoader::SpriteCollection &spri
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Calculate sizes and allocate. */
|
/* Calculate sizes and allocate. */
|
||||||
SpriteData sd;
|
SpriteData sd{};
|
||||||
memset(&sd, 0, sizeof(sd));
|
|
||||||
uint all_sprites_size = 0;
|
uint all_sprites_size = 0;
|
||||||
for (ZoomLevel z = zoom_min; z <= zoom_max; z++) {
|
for (ZoomLevel z = zoom_min; z <= zoom_max; z++) {
|
||||||
const SpriteLoader::Sprite *src_sprite = &sprite[z];
|
const SpriteLoader::Sprite *src_sprite = &sprite[z];
|
||||||
|
|
|
@ -65,14 +65,14 @@ public:
|
||||||
|
|
||||||
/** Data stored about a (single) sprite. */
|
/** Data stored about a (single) sprite. */
|
||||||
struct SpriteInfo {
|
struct SpriteInfo {
|
||||||
uint32_t sprite_offset; ///< The offset to the sprite data.
|
uint32_t sprite_offset = 0; ///< The offset to the sprite data.
|
||||||
uint32_t mv_offset; ///< The offset to the map value data.
|
uint32_t mv_offset = 0; ///< The offset to the map value data.
|
||||||
uint16_t sprite_line_size; ///< The size of a single line (pitch).
|
uint16_t sprite_line_size = 0; ///< The size of a single line (pitch).
|
||||||
uint16_t sprite_width; ///< The width of the sprite.
|
uint16_t sprite_width = 0; ///< The width of the sprite.
|
||||||
};
|
};
|
||||||
struct SpriteData {
|
struct SpriteData {
|
||||||
SpriteFlags flags;
|
SpriteFlags flags{};
|
||||||
SpriteInfo infos[ZOOM_LVL_END];
|
std::array<SpriteInfo, ZOOM_LVL_END> infos{};
|
||||||
uint8_t data[]; ///< Data, all zoomlevels.
|
uint8_t data[]; ///< Data, all zoomlevels.
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue