Remove unused methods

This commit is contained in:
Justin Scofield
2022-07-27 17:34:32 +00:00
parent 856900a69d
commit 92252c548f
2 changed files with 2 additions and 66 deletions

View File

@@ -3,8 +3,6 @@
#include <cstdint>
#include <vector>
#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<Tile16> &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