Refactor bitmap palette management across various components to streamline palette setting and improve error handling; remove unnecessary status checks and enhance consistency in palette application methods.

This commit is contained in:
scawful
2025-04-17 21:49:47 -04:00
parent eeab477e72
commit 44e13cf4bb
17 changed files with 253 additions and 316 deletions

View File

@@ -68,7 +68,7 @@ absl::Status Inventory::Create() {
}
bitmap_.Create(256, 256, 8, data_);
RETURN_IF_ERROR(bitmap_.SetPalette(palette_));
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_.SetPalette(palette_))
tilesheets_bmp_.SetPalette(palette_);
Renderer::GetInstance().RenderBitmap(&tilesheets_bmp_);
return absl::OkStatus();
}