From 92252c548f25dc4dc5affd8b9b4c5653575e8839 Mon Sep 17 00:00:00 2001 From: Justin Scofield Date: Wed, 27 Jul 2022 17:34:32 +0000 Subject: [PATCH] Remove unused methods --- src/app/gfx/snes_tile.cc | 58 ---------------------------------------- src/app/gfx/snes_tile.h | 10 ++----- 2 files changed, 2 insertions(+), 66 deletions(-) diff --git a/src/app/gfx/snes_tile.cc b/src/app/gfx/snes_tile.cc index 4910f1ae..2755ec8b 100644 --- a/src/app/gfx/snes_tile.cc +++ b/src/app/gfx/snes_tile.cc @@ -3,8 +3,6 @@ #include #include -#include "app/core/constants.h" - namespace yaze { namespace app { namespace gfx { @@ -24,62 +22,6 @@ TileInfo GetTilesInfo(ushort tile) { return TileInfo(tid, p, v, h, o); } -void BuildTiles16Gfx(uchar *mapblockset16, uchar *currentOWgfx16Ptr, - std::vector &allTiles) { - uchar *gfx16Data = mapblockset16; - uchar *gfx8Data = currentOWgfx16Ptr; - const int offsets[4] = {0, 8, 1024, 1032}; - auto yy = 0; - auto xx = 0; - - // Number of tiles16 3748? // its 3752 - for (auto i = 0; i < core::NumberOfMap16; i++) { - // 8x8 tile draw - // gfx8 = 4bpp so everyting is /2 - auto tiles = allTiles[i]; - - for (auto tile = 0; tile < 4; tile++) { - TileInfo info = tiles.tiles_info[tile]; - int offset = offsets[tile]; - - for (auto y = 0; y < 8; y++) { - for (auto x = 0; x < 4; x++) { - CopyTile16(x, y, xx, yy, offset, info, gfx16Data, gfx8Data); - } - } - } - - xx += 16; - if (xx >= 128) { - yy += 2048; - xx = 0; - } - } -} - -void CopyTile16(int x, int y, int xx, int yy, int offset, TileInfo tile, - uchar *gfx16Pointer, uchar *gfx8Pointer) // map,current -{ - int mx = x; - int my = y; - uchar r = 0; - - if (tile.horizontal_mirror_) { - mx = 3 - x; - r = 1; - } - if (tile.vertical_mirror_) { - my = 7 - y; - } - - int tx = ((tile.id_ / 16) * 512) + ((tile.id_ - ((tile.id_ / 16) * 16)) * 4); - auto index = xx + yy + offset + (mx * 2) + (my * 128); - uchar pixel = gfx8Pointer[tx + (y * 64) + x]; - - gfx16Pointer[index + r ^ 1] = (uchar)((pixel & 0x0F) + tile.palette_ * 16); - gfx16Pointer[index + r] = (uchar)(((pixel >> 4) & 0x0F) + tile.palette_ * 16); -} - } // namespace gfx } // namespace app } // namespace yaze \ No newline at end of file diff --git a/src/app/gfx/snes_tile.h b/src/app/gfx/snes_tile.h index e941aaac..a5310bfa 100644 --- a/src/app/gfx/snes_tile.h +++ b/src/app/gfx/snes_tile.h @@ -4,8 +4,6 @@ #include #include -#include "app/core/constants.h" - namespace yaze { namespace app { namespace gfx { @@ -16,6 +14,8 @@ typedef struct { unsigned int palette_id; } tile8; +TileInfo GetTilesInfo(ushort tile); + // vhopppcc cccccccc // [0, 1] // [2, 3] @@ -84,12 +84,6 @@ class OAMTile { } }; -TileInfo GetTilesInfo(ushort tile); -void BuildTiles16Gfx(uchar* mapblockset16, uchar* currentOWgfx16Ptr, - std::vector& allTiles); -void CopyTile16(int x, int y, int xx, int yy, int offset, TileInfo tile, - uchar* gfx16Pointer, uchar* gfx8Pointer); - } // namespace gfx } // namespace app } // namespace yaze