diff --git a/src/nostalgia/core/userland/gfx_opengl.cpp b/src/nostalgia/core/userland/gfx_opengl.cpp index 9d1853c5..36f26a8f 100644 --- a/src/nostalgia/core/userland/gfx_opengl.cpp +++ b/src/nostalgia/core/userland/gfx_opengl.cpp @@ -19,13 +19,13 @@ void ImGui_Impl_NewFrame() noexcept; namespace renderer { -constexpr auto TileRows = 128; -constexpr auto TileColumns = 128; -constexpr auto TileCount = TileRows * TileColumns; -constexpr unsigned BgVertexVboRows = 4; -constexpr unsigned BgVertexVboRowLength = 4; -constexpr unsigned BgVertexVboLength = BgVertexVboRows * BgVertexVboRowLength; -constexpr unsigned BgVertexEboLength = 6; +constexpr uint64_t TileRows = 128; +constexpr uint64_t TileColumns = 128; +constexpr uint64_t TileCount = TileRows * TileColumns; +constexpr uint64_t BgVertexVboRows = 4; +constexpr uint64_t BgVertexVboRowLength = 4; +constexpr uint64_t BgVertexVboLength = BgVertexVboRows * BgVertexVboRowLength; +constexpr uint64_t BgVertexEboLength = 6; struct CBB: public glutils::BufferSet { bool updated = false; @@ -179,7 +179,8 @@ static void drawBackgrounds(GlImplData *id) noexcept { for (auto &bg : id->backgrounds) { if (bg.enabled) { auto &cbb = id->cbbs[bg.cbbIdx]; - glUniform1f(uniformTileHeight, 1.0f / static_cast(cbb.tex.height / 8)); + const auto tileRows = cbb.tex.height / TileHeight; + glUniform1f(uniformTileHeight, 1.0f / static_cast(tileRows)); drawBackground(&cbb); } }