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:
@@ -142,17 +142,14 @@ void DungeonObjectRenderer::UpdateObjectBitmap() {
|
||||
bitmap_.Create(256, 256, 8, tilemap_);
|
||||
}
|
||||
|
||||
absl::Status DungeonObjectRenderer::SetPalette(const gfx::SnesPalette& palette,
|
||||
size_t transparent_index) {
|
||||
void DungeonObjectRenderer::SetPalette(const gfx::SnesPalette& palette,
|
||||
size_t transparent_index) {
|
||||
// Apply the palette to the bitmap
|
||||
RETURN_IF_ERROR(
|
||||
bitmap_.SetPaletteWithTransparent(palette, transparent_index));
|
||||
bitmap_.SetPaletteWithTransparent(palette, transparent_index);
|
||||
|
||||
// Store the palette in the VRAM structure for future reference
|
||||
vram_.palettes.clear();
|
||||
vram_.palettes.push_back(palette);
|
||||
|
||||
return absl::OkStatus();
|
||||
}
|
||||
|
||||
} // namespace zelda3
|
||||
|
||||
@@ -65,9 +65,8 @@ class DungeonObjectRenderer : public SharedRom {
|
||||
*
|
||||
* @param palette The palette to use for the object
|
||||
* @param transparent_index Index of the transparent color (default: 0)
|
||||
* @return absl::Status Success or error status
|
||||
*/
|
||||
absl::Status SetPalette(const gfx::SnesPalette& palette, size_t transparent_index = 0);
|
||||
void SetPalette(const gfx::SnesPalette& palette, size_t transparent_index = 0);
|
||||
|
||||
/**
|
||||
* @brief Gets the rendered bitmap
|
||||
|
||||
Reference in New Issue
Block a user