[nostalgia/core/userland] Fix magic numbers

This commit is contained in:
Gary Talent 2023-02-08 21:37:25 -06:00
parent 4f906f6e47
commit 014daa6b57

View File

@ -24,7 +24,7 @@ struct TileSheetData {
}; };
ox::Result<TileSheetData> loadTileSheet(Context *ctx, const CompactTileSheet &tilesheet) noexcept { ox::Result<TileSheetData> loadTileSheet(Context *ctx, const CompactTileSheet &tilesheet) noexcept {
const unsigned bytesPerTile = tilesheet.bpp == 8 ? 64 : 32; const unsigned bytesPerTile = tilesheet.bpp == 8 ? PixelsPerTile : PixelsPerTile / 2;
const auto tiles = tilesheet.pixels.size() / bytesPerTile; const auto tiles = tilesheet.pixels.size() / bytesPerTile;
constexpr int width = 8; constexpr int width = 8;
const int height = 8 * static_cast<int>(tiles); const int height = 8 * static_cast<int>(tiles);