mirror of
https://github.com/mattrberry/crab.git
synced 2025-01-15 03:40:56 +01:00
refactor debugging windows
This commit is contained in:
parent
bf1154945b
commit
c9c5155333
1 changed files with 29 additions and 22 deletions
|
@ -22,13 +22,21 @@ class GBAController < Controller
|
|||
# Debug
|
||||
|
||||
def render_debug_items : Nil
|
||||
ImGui.menu_item("Debug", "", pointerof(@debug_window))
|
||||
ImGui.menu_item("Video", "", pointerof(@debug_window))
|
||||
end
|
||||
|
||||
def render_windows : Nil
|
||||
if @debug_window
|
||||
ImGui.begin("Debug", pointerof(@debug_window))
|
||||
ImGui.text("Palettes")
|
||||
ImGui.begin("Video", pointerof(@debug_window))
|
||||
if ImGui.begin_tab_bar "VideoTabBar"
|
||||
render_palettes_tab_item if ImGui.begin_tab_item "Palettes"
|
||||
ImGui.end_tab_bar
|
||||
end
|
||||
ImGui.end
|
||||
end
|
||||
end
|
||||
|
||||
private def render_palettes_tab_item : Nil
|
||||
ImGui.push_style_var(ImGui::ImGuiStyleVar::ItemSpacing, ImGui::ImVec2.new(0, 0))
|
||||
pram = @emu.ppu.pram.to_unsafe.as(UInt16*)
|
||||
flags = ImGui::ImGuiColorEditFlags::NoAlpha | ImGui::ImGuiColorEditFlags::NoPicker |
|
||||
|
@ -49,7 +57,6 @@ class GBAController < Controller
|
|||
ImGui.same_line(spacing: 4_f32) if idx == 0
|
||||
end
|
||||
ImGui.pop_style_var
|
||||
ImGui.end
|
||||
end
|
||||
ImGui.end_tab_item
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue