diff --git a/src/nostalgia/core/sdl/gfx.cpp b/src/nostalgia/core/sdl/gfx.cpp index e563dff0..76136921 100644 --- a/src/nostalgia/core/sdl/gfx.cpp +++ b/src/nostalgia/core/sdl/gfx.cpp @@ -25,8 +25,8 @@ using TileMap = std::array, 128>; struct SdlImplData { SDL_Window *window = nullptr; SDL_Renderer *renderer = nullptr; - std::array bgTextures; - std::array bgTileMaps; + std::array bgTextures{}; + std::array bgTileMaps{}; int64_t prevFpsCheckTime = 0; uint64_t draws = 0; }; @@ -188,7 +188,10 @@ void draw(Context *ctx) { void setTile(Context *ctx, int layer, int column, int row, uint8_t tile) { auto id = ctx->implData(); - id->bgTileMaps[layer][row][column] = tile; + auto z = static_cast(layer); + auto y = static_cast(row); + auto x = static_cast(column); + id->bgTileMaps[z][y][x] = tile; } }