Refactor canvas drawing methods to remove unnecessary bitmap parameters in context menu and bitmap drawing functions; update inventory and graphics editors to use new method signatures for improved consistency and clarity.

This commit is contained in:
scawful
2025-04-16 21:44:07 -04:00
parent e7f976fcf0
commit 97788fc033
7 changed files with 165 additions and 154 deletions

View File

@@ -406,7 +406,7 @@ absl::Status GraphicsEditor::UpdateLinkGfxView() {
for (auto& link_sheet : link_sheets_) {
int x_offset = 0;
int y_offset = gfx::kTilesheetHeight * i * 4;
link_canvas_.DrawContextMenu(&link_sheet);
link_canvas_.DrawContextMenu();
link_canvas_.DrawBitmap(link_sheet, x_offset, y_offset, 4);
i++;
}

View File

@@ -53,7 +53,7 @@ void ScreenEditor::DrawInventoryMenuEditor() {
static bool create = false;
if (!create && rom()->is_loaded()) {
status_ = inventory_.Create();
palette_ = inventory_.Palette();
palette_ = inventory_.palette();
create = true;
}
@@ -68,14 +68,14 @@ void ScreenEditor::DrawInventoryMenuEditor() {
ImGui::TableNextColumn();
screen_canvas_.DrawBackground();
screen_canvas_.DrawContextMenu();
screen_canvas_.DrawBitmap(inventory_.Bitmap(), 2, create);
screen_canvas_.DrawBitmap(inventory_.bitmap(), 2, create);
screen_canvas_.DrawGrid(32.0f);
screen_canvas_.DrawOverlay();
ImGui::TableNextColumn();
tilesheet_canvas_.DrawBackground(ImVec2(128 * 2 + 2, (192 * 2) + 4));
tilesheet_canvas_.DrawContextMenu();
tilesheet_canvas_.DrawBitmap(inventory_.Tilesheet(), 2, create);
tilesheet_canvas_.DrawBitmap(inventory_.tilesheet(), 2, create);
tilesheet_canvas_.DrawGrid(16.0f);
tilesheet_canvas_.DrawOverlay();

View File

@@ -274,7 +274,7 @@ absl::Status Tile16Editor::UpdateTile16Edit() {
TableNextColumn();
if (BeginChild("Tile8 Selector", ImVec2(0, 0x175), true)) {
tile8_source_canvas_.DrawBackground();
tile8_source_canvas_.DrawContextMenu(&current_gfx_bmp_);
tile8_source_canvas_.DrawContextMenu();
if (tile8_source_canvas_.DrawTileSelector(32)) {
RETURN_IF_ERROR(current_gfx_individual_[current_tile8_]
.SetPaletteWithTransparent(ow_main_pal_group[0],
@@ -292,7 +292,7 @@ absl::Status Tile16Editor::UpdateTile16Edit() {
TableNextColumn();
if (BeginChild("Tile16 Editor", ImVec2(0, 0x175), true)) {
tile16_edit_canvas_.DrawBackground();
tile16_edit_canvas_.DrawContextMenu(&current_tile16_bmp_);
tile16_edit_canvas_.DrawContextMenu();
tile16_edit_canvas_.DrawBitmap(current_tile16_bmp_, 0, 0, 4.0f);
if (!tile8_source_canvas_.points().empty()) {
if (tile16_edit_canvas_.DrawTilePainter(