Refactor bitmap update methods to remove unnecessary parameters; simplify texture updating in Renderer and Bitmap classes
This commit is contained in:
@@ -119,14 +119,14 @@ absl::Status DungeonEditor::RefreshGraphics() {
|
||||
int block = rooms_[current_room_id_].blocks()[i];
|
||||
RETURN_IF_ERROR(graphics_bin_[block].ApplyPaletteWithTransparent(
|
||||
current_palette_group_[current_palette_id_], 0));
|
||||
Renderer::GetInstance().UpdateBitmap(&graphics_bin_[block], true);
|
||||
Renderer::GetInstance().UpdateBitmap(&graphics_bin_[block]);
|
||||
}
|
||||
auto sprites_aux1_pal_group = rom()->palette_group().sprites_aux1;
|
||||
for (int i = 9; i < 16; i++) {
|
||||
int block = rooms_[current_room_id_].blocks()[i];
|
||||
RETURN_IF_ERROR(graphics_bin_[block].ApplyPaletteWithTransparent(
|
||||
sprites_aux1_pal_group[current_palette_id_], 0));
|
||||
Renderer::GetInstance().UpdateBitmap(&graphics_bin_[block], true);
|
||||
Renderer::GetInstance().UpdateBitmap(&graphics_bin_[block]);
|
||||
}
|
||||
return absl::OkStatus();
|
||||
}
|
||||
|
||||
@@ -294,7 +294,7 @@ absl::Status GraphicsEditor::UpdateGfxTabView() {
|
||||
auto draw_tile_event = [&]() {
|
||||
current_sheet_canvas_.DrawTileOnBitmap(tile_size_, ¤t_bitmap,
|
||||
current_color_);
|
||||
Renderer::GetInstance().UpdateBitmap(¤t_bitmap, true);
|
||||
Renderer::GetInstance().UpdateBitmap(¤t_bitmap);
|
||||
};
|
||||
|
||||
current_sheet_canvas_.UpdateColorPainter(
|
||||
@@ -373,7 +373,7 @@ absl::Status GraphicsEditor::UpdatePaletteColumn() {
|
||||
->data()[current_sheet_]
|
||||
.ApplyPaletteWithTransparent(palette, edit_palette_sub_index_));
|
||||
Renderer::GetInstance().UpdateBitmap(
|
||||
&rom()->mutable_gfx_sheets()->data()[current_sheet_], true);
|
||||
&rom()->mutable_gfx_sheets()->data()[current_sheet_]);
|
||||
refresh_graphics_ = false;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user