Add GraphicsBinCanvasPipeline

This commit is contained in:
Justin Scofield
2023-08-02 19:12:57 -04:00
parent b3458b56db
commit e88b2a6d2f
4 changed files with 46 additions and 32 deletions

View File

@@ -252,30 +252,8 @@ absl::Status GraphicsEditor::DrawMemoryEditor() {
}
absl::Status GraphicsEditor::DrawGraphicsBin() {
if (ImGuiID child_id = ImGui::GetID((void*)(intptr_t)3);
ImGui::BeginChild(child_id, ImGui::GetContentRegionAvail(), true,
ImGuiWindowFlags_AlwaysVerticalScrollbar)) {
super_donkey_canvas_.DrawBackground(
ImVec2(0x100 + 1, num_sheets_to_load_ * 0x40 + 1));
super_donkey_canvas_.DrawContextMenu();
if (super_donkey_) {
for (const auto& [key, value] : graphics_bin_) {
int offset = 0x40 * (key + 1);
int top_left_y = super_donkey_canvas_.GetZeroPoint().y + 2;
if (key >= 1) {
top_left_y = super_donkey_canvas_.GetZeroPoint().y + 0x40 * key;
}
super_donkey_canvas_.GetDrawList()->AddImage(
(void*)value.texture(),
ImVec2(super_donkey_canvas_.GetZeroPoint().x + 2, top_left_y),
ImVec2(super_donkey_canvas_.GetZeroPoint().x + 0x100,
super_donkey_canvas_.GetZeroPoint().y + offset));
}
}
super_donkey_canvas_.DrawGrid(16.0f);
super_donkey_canvas_.DrawOverlay();
}
ImGui::EndChild();
core::GraphicsBinCanvasPipeline(0x100, 0x40, 0x20, num_sheets_to_load_, 3,
super_donkey_, graphics_bin_);
return absl::OkStatus();
}