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
|
# Debug
|
||||||
|
|
||||||
def render_debug_items : Nil
|
def render_debug_items : Nil
|
||||||
ImGui.menu_item("Debug", "", pointerof(@debug_window))
|
ImGui.menu_item("Video", "", pointerof(@debug_window))
|
||||||
end
|
end
|
||||||
|
|
||||||
def render_windows : Nil
|
def render_windows : Nil
|
||||||
if @debug_window
|
if @debug_window
|
||||||
ImGui.begin("Debug", pointerof(@debug_window))
|
ImGui.begin("Video", pointerof(@debug_window))
|
||||||
ImGui.text("Palettes")
|
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))
|
ImGui.push_style_var(ImGui::ImGuiStyleVar::ItemSpacing, ImGui::ImVec2.new(0, 0))
|
||||||
pram = @emu.ppu.pram.to_unsafe.as(UInt16*)
|
pram = @emu.ppu.pram.to_unsafe.as(UInt16*)
|
||||||
flags = ImGui::ImGuiColorEditFlags::NoAlpha | ImGui::ImGuiColorEditFlags::NoPicker |
|
flags = ImGui::ImGuiColorEditFlags::NoAlpha | ImGui::ImGuiColorEditFlags::NoPicker |
|
||||||
|
@ -49,7 +57,6 @@ class GBAController < Controller
|
||||||
ImGui.same_line(spacing: 4_f32) if idx == 0
|
ImGui.same_line(spacing: 4_f32) if idx == 0
|
||||||
end
|
end
|
||||||
ImGui.pop_style_var
|
ImGui.pop_style_var
|
||||||
ImGui.end
|
ImGui.end_tab_item
|
||||||
end
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue