From 98983d12290ae38785cf9e9fb0f0f45f4c520abc Mon Sep 17 00:00:00 2001 From: Gary Talent Date: Tue, 14 Nov 2023 20:23:50 -0600 Subject: [PATCH] [nostalgia/core] Cleanup --- .../modules/core/include/nostalgia/core/ptidxconv.hpp | 2 +- .../modules/core/include/nostalgia/core/tilesheet.hpp | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/nostalgia/modules/core/include/nostalgia/core/ptidxconv.hpp b/src/nostalgia/modules/core/include/nostalgia/core/ptidxconv.hpp index 4de530789..8157d34c8 100644 --- a/src/nostalgia/modules/core/include/nostalgia/core/ptidxconv.hpp +++ b/src/nostalgia/modules/core/include/nostalgia/core/ptidxconv.hpp @@ -20,7 +20,7 @@ constexpr std::size_t ptToIdx(int x, int y, int c, int scale = 1) noexcept { const auto colStart = static_cast(colLength * static_cast(x / tileWidth)); const auto rowStart = static_cast(rowLength * static_cast(y / tileHeight)); const auto colOffset = static_cast(x % tileWidth); - const auto rowOffset = static_cast(static_cast((y % tileHeight) * tileHeight)); + const auto rowOffset = static_cast((y % tileHeight) * tileHeight); return static_cast(colStart + colOffset + rowStart + rowOffset); } diff --git a/src/nostalgia/modules/core/include/nostalgia/core/tilesheet.hpp b/src/nostalgia/modules/core/include/nostalgia/core/tilesheet.hpp index e83fc528d..b7a731d1f 100644 --- a/src/nostalgia/modules/core/include/nostalgia/core/tilesheet.hpp +++ b/src/nostalgia/modules/core/include/nostalgia/core/tilesheet.hpp @@ -45,8 +45,10 @@ struct TileSheetV2 { ox::Vector pixels; constexpr SubSheet() noexcept = default; constexpr SubSheet(ox::CRStringView pName, int pColumns, int pRows, int bpp) noexcept: - name(pName), columns(pColumns), rows(pRows), - pixels(static_cast(columns * rows * PixelsPerTile) / (bpp == 4 ? 2u : 1u)) { + name(pName), + columns(pColumns), + rows(pRows), + pixels(static_cast(columns * rows * PixelsPerTile) / (bpp == 4 ? 2u : 1u)) { } };