big cleanup, replace Bytes alias with std::vector<uint8_t> to reduce ambiguity

This commit is contained in:
scawful
2024-08-20 12:02:47 -04:00
parent 2443336f9d
commit 49611d4944
33 changed files with 141 additions and 281 deletions

View File

@@ -223,7 +223,7 @@ void Overworld::AssignWorldTiles(int x, int y, int sx, int sy, int tpos,
world[position_x2][position_y2] = tiles32_unique_[tpos].tile3_;
}
void Overworld::OrganizeMapTiles(Bytes &bytes, Bytes &bytes2, int i, int sx,
void Overworld::OrganizeMapTiles(std::vector<uint8_t> &bytes, std::vector<uint8_t> &bytes2, int i, int sx,
int sy, int &ttpos) {
for (int y = 0; y < 16; y++) {
for (int x = 0; x < 16; x++) {

View File

@@ -588,7 +588,7 @@ class Overworld : public SharedRom, public core::ExperimentFlags {
void AssembleMap16Tiles();
void AssignWorldTiles(int x, int y, int sx, int sy, int tpos,
OWBlockset &world);
void OrganizeMapTiles(Bytes &bytes, Bytes &bytes2, int i, int sx, int sy,
void OrganizeMapTiles(std::vector<uint8_t> &bytes, std::vector<uint8_t> &bytes2, int i, int sx, int sy,
int &ttpos);
absl::Status DecompressAllMapTiles();

View File

@@ -525,7 +525,7 @@ absl::Status OverworldMap::BuildTiles16Gfx(int count) {
namespace {
void CopyTile8bpp16(int x, int y, int tile, Bytes& bitmap, Bytes& blockset) {
void CopyTile8bpp16(int x, int y, int tile, std::vector<uint8_t>& bitmap, std::vector<uint8_t>& blockset) {
int src_pos =
((tile - ((tile / 0x08) * 0x08)) * 0x10) + ((tile / 0x08) * 2048);
int dest_pos = (x + (y * 0x200));

View File

@@ -139,10 +139,10 @@ class OverworldMap : public editor::context::GfxContext {
uchar static_graphics_[16];
Rom rom_;
Bytes all_gfx_;
Bytes current_blockset_;
Bytes current_gfx_;
Bytes bitmap_data_;
std::vector<uint8_t> all_gfx_;
std::vector<uint8_t> current_blockset_;
std::vector<uint8_t> current_gfx_;
std::vector<uint8_t> bitmap_data_;
OWMapTiles map_tiles_;
gfx::SnesPalette current_palette_;

View File

@@ -76,7 +76,7 @@ absl::Status Inventory::BuildTileset() {
tilesheets_.reserve(6 * 0x2000);
for (int i = 0; i < 6 * 0x2000; i++) tilesheets_.push_back(0xFF);
ASSIGN_OR_RETURN(tilesheets_, rom()->Load2BppGraphics())
Bytes test;
std::vector<uint8_t> test;
for (int i = 0; i < 0x4000; i++) {
test_.push_back(tilesheets_[i]);
}

View File

@@ -26,11 +26,11 @@ class Inventory : public SharedRom {
private:
absl::Status BuildTileset();
Bytes data_;
std::vector<uint8_t> data_;
gfx::Bitmap bitmap_;
Bytes tilesheets_;
Bytes test_;
std::vector<uint8_t> tilesheets_;
std::vector<uint8_t> test_;
gfx::Bitmap tilesheets_bmp_;
gfx::SnesPalette palette_;

View File

@@ -13,10 +13,10 @@ namespace zelda3 {
namespace screen {
void TitleScreen::Create() {
tiles8Bitmap.Create(128, 512, 8, Bytes(0, 0x20000));
tilesBG1Bitmap.Create(256, 256, 8, Bytes(0, 0x80000));
tilesBG2Bitmap.Create(256, 256, 8, Bytes(0, 0x80000));
oamBGBitmap.Create(256, 256, 8, Bytes(0, 0x80000));
tiles8Bitmap.Create(128, 512, 8, std::vector<uint8_t>(0, 0x20000));
tilesBG1Bitmap.Create(256, 256, 8, std::vector<uint8_t>(0, 0x80000));
tilesBG2Bitmap.Create(256, 256, 8, std::vector<uint8_t>(0, 0x80000));
oamBGBitmap.Create(256, 256, 8, std::vector<uint8_t>(0, 0x80000));
BuildTileset();
LoadTitleScreen();
}

View File

@@ -6,7 +6,7 @@ namespace yaze {
namespace app {
namespace zelda3 {
void Sprite::InitSprite(const Bytes& src, uchar mapid, uchar id, uchar x,
void Sprite::InitSprite(const std::vector<uint8_t>& src, uchar mapid, uchar id, uchar x,
uchar y, int map_x, int map_y) {
current_gfx_ = src;
overworld_ = true;
@@ -27,7 +27,7 @@ void Sprite::InitSprite(const Bytes& src, uchar mapid, uchar id, uchar x,
}
}
Sprite::Sprite(Bytes src, uchar mapid, uchar id, uchar x, uchar y, int map_x,
Sprite::Sprite(std::vector<uint8_t> src, uchar mapid, uchar id, uchar x, uchar y, int map_x,
int map_y)
: current_gfx_(src),
map_id_(static_cast<int>(mapid)),

View File

@@ -26,9 +26,9 @@ namespace zelda3 {
class Sprite : public OverworldEntity {
public:
Sprite() = default;
Sprite(Bytes src, uchar mapid, uchar id, uchar x, uchar y, int map_x,
Sprite(std::vector<uint8_t> src, uchar mapid, uchar id, uchar x, uchar y, int map_x,
int map_y);
void InitSprite(const Bytes& src, uchar mapid, uchar id, uchar x, uchar y,
void InitSprite(const std::vector<uint8_t>& src, uchar mapid, uchar id, uchar x, uchar y,
int map_x, int map_y);
void updateBBox();
@@ -64,7 +64,7 @@ class Sprite : public OverworldEntity {
auto set_deleted(bool deleted) { deleted_ = deleted; }
private:
Bytes current_gfx_;
std::vector<uint8_t> current_gfx_;
bool overworld_;
uchar map_id_;
@@ -81,7 +81,7 @@ class Sprite : public OverworldEntity {
int map_x_;
int map_y_;
Bytes preview_gfx_;
std::vector<uint8_t> preview_gfx_;
uchar lowerX_;
uchar lowerY_;
uchar higherX_;