rename ApplyPalette with SetPalette
This commit is contained in:
@@ -34,8 +34,7 @@ absl::Status LoadDungeonMapGfxFromBinary(Rom &rom,
|
||||
gfx_sheets.emplace_back(converted_bin.begin() + (i * 0x1000),
|
||||
converted_bin.begin() + ((i + 1) * 0x1000));
|
||||
sheets[i] = gfx::Bitmap(128, 32, 8, gfx_sheets[i]);
|
||||
RETURN_IF_ERROR(
|
||||
sheets[i].ApplyPalette(*rom.mutable_dungeon_palette(3)));
|
||||
RETURN_IF_ERROR(sheets[i].SetPalette(*rom.mutable_dungeon_palette(3)));
|
||||
core::Renderer::GetInstance().RenderBitmap(&sheets[i]);
|
||||
}
|
||||
} else {
|
||||
@@ -47,5 +46,5 @@ absl::Status LoadDungeonMapGfxFromBinary(Rom &rom,
|
||||
return absl::OkStatus();
|
||||
}
|
||||
|
||||
} // namespace zelda3
|
||||
} // namespace yaze
|
||||
} // namespace zelda3
|
||||
} // namespace yaze
|
||||
|
||||
@@ -18,13 +18,13 @@ absl::Status Inventory::Create() {
|
||||
RETURN_IF_ERROR(BuildTileset())
|
||||
for (int i = 0; i < 0x500; i += 0x08) {
|
||||
ASSIGN_OR_RETURN(auto t1, rom()->ReadWord(i + kBowItemPos));
|
||||
ASSIGN_OR_RETURN(auto t2, rom()->ReadWord(i + kBowItemPos + 0x02));
|
||||
ASSIGN_OR_RETURN(auto t3, rom()->ReadWord(i + kBowItemPos + 0x04));
|
||||
ASSIGN_OR_RETURN(auto t4, rom()->ReadWord(i + kBowItemPos + 0x06));
|
||||
tiles_.push_back(gfx::GetTilesInfo(t1));
|
||||
tiles_.push_back(gfx::GetTilesInfo(t2));
|
||||
tiles_.push_back(gfx::GetTilesInfo(t3));
|
||||
tiles_.push_back(gfx::GetTilesInfo(t4));
|
||||
ASSIGN_OR_RETURN(auto t2, rom()->ReadWord(i + kBowItemPos + 0x02));
|
||||
ASSIGN_OR_RETURN(auto t3, rom()->ReadWord(i + kBowItemPos + 0x04));
|
||||
ASSIGN_OR_RETURN(auto t4, rom()->ReadWord(i + kBowItemPos + 0x06));
|
||||
tiles_.push_back(gfx::GetTilesInfo(t1));
|
||||
tiles_.push_back(gfx::GetTilesInfo(t2));
|
||||
tiles_.push_back(gfx::GetTilesInfo(t3));
|
||||
tiles_.push_back(gfx::GetTilesInfo(t4));
|
||||
}
|
||||
const int offsets[] = {0x00, 0x08, 0x800, 0x808};
|
||||
auto xx = 0;
|
||||
@@ -68,7 +68,7 @@ absl::Status Inventory::Create() {
|
||||
}
|
||||
|
||||
bitmap_.Create(256, 256, 8, data_);
|
||||
RETURN_IF_ERROR(bitmap_.ApplyPalette(palette_));
|
||||
RETURN_IF_ERROR(bitmap_.SetPalette(palette_));
|
||||
Renderer::GetInstance().RenderBitmap(&bitmap_);
|
||||
return absl::OkStatus();
|
||||
}
|
||||
@@ -87,7 +87,7 @@ absl::Status Inventory::BuildTileset() {
|
||||
tilesheets_bmp_.Create(128, 0x130, 64, test_);
|
||||
auto hud_pal_group = rom()->palette_group().hud;
|
||||
palette_ = hud_pal_group[0];
|
||||
RETURN_IF_ERROR(tilesheets_bmp_.ApplyPalette(palette_))
|
||||
RETURN_IF_ERROR(tilesheets_bmp_.SetPalette(palette_))
|
||||
Renderer::GetInstance().RenderBitmap(&tilesheets_bmp_);
|
||||
return absl::OkStatus();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user