diff --git a/src/app/core/constants.h b/src/app/core/constants.h index 061c0c89..2f977d30 100644 --- a/src/app/core/constants.h +++ b/src/app/core/constants.h @@ -5,8 +5,6 @@ #include "absl/strings/string_view.h" -#define IMGUI_DEFINE_MATH_OPERATORS - #define BASIC_BUTTON(w) if (ImGui::Button(w)) #define TAB_BAR(w) if (ImGui::BeginTabBar(w)) { diff --git a/src/app/editor/modules/palette_editor.cc b/src/app/editor/modules/palette_editor.cc index 4b2cad7f..8a2ffa85 100644 --- a/src/app/editor/modules/palette_editor.cc +++ b/src/app/editor/modules/palette_editor.cc @@ -156,8 +156,8 @@ absl::Status PaletteEditor::DrawPaletteGroup(int category) { return absl::NotFoundError("ROM not open, no palettes to display"); } - std::string group_name = kPaletteGroupNames[category].data(); - auto palette_group = *rom()->palette_group().get_group(group_name); + gfx::PaletteGroup palette_group = + *rom()->palette_group().get_group(kPaletteGroupNames[category].data()); const auto size = palette_group.size(); static bool edit_color = false; @@ -166,7 +166,7 @@ absl::Status PaletteEditor::DrawPaletteGroup(int category) { // rom()->resource_label()->SelectableLabelWithNameEdit( // false, "Palette Group Name", std::to_string(j), // std::string(kPaletteGroupNames[category])); - auto palette = palette_group.mutable_palette(j); + gfx::SnesPalette* palette = palette_group.mutable_palette(j); auto pal_size = palette->size(); for (int n = 0; n < pal_size; n++) { diff --git a/src/app/gui/canvas.h b/src/app/gui/canvas.h index 107f8154..baa046c4 100644 --- a/src/app/gui/canvas.h +++ b/src/app/gui/canvas.h @@ -148,6 +148,11 @@ class Canvas { } auto mutable_labels(int i) { if (i >= labels_.size()) { + int x = i; + while (x >= labels_.size()) { + labels_.push_back(ImVector()); + x--; + } labels_.push_back(ImVector()); } return &labels_[i]; diff --git a/src/app/gui/style.cc b/src/app/gui/style.cc index 7ce91b32..3b341a03 100644 --- a/src/app/gui/style.cc +++ b/src/app/gui/style.cc @@ -12,7 +12,7 @@ void BeginWindowWithDisplaySettings(const char* id, bool* active, ImGuiWindowFlags flags) { ImGuiStyle* ref = &ImGui::GetStyle(); static float childBgOpacity = 0.75f; - auto color = ImVec4(0.f, 0.f, 0.f, childBgOpacity); + auto color = ref->Colors[ImGuiCol_WindowBg]; ImGui::PushStyleColor(ImGuiCol_WindowBg, color); ImGui::PushStyleColor(ImGuiCol_ChildBg, color);