From 142ae54a7e6855b7a82e7f0bf473c55805d280b0 Mon Sep 17 00:00:00 2001 From: Radai Date: Thu, 12 Sep 2024 12:50:04 +0200 Subject: [PATCH 1/2] init --- .../morphemeEditor/GuiManager/GuiManager.cpp | 13 ++++++++++--- DS2AnimToolset/morphemeEditor/MorphemeEditor.h | 4 ++-- .../morphemeEditor/TrackEditor/TrackEditorBase.cpp | 4 ++-- 3 files changed, 14 insertions(+), 7 deletions(-) diff --git a/DS2AnimToolset/morphemeEditor/GuiManager/GuiManager.cpp b/DS2AnimToolset/morphemeEditor/GuiManager/GuiManager.cpp index a68131b8..acd7cadd 100644 --- a/DS2AnimToolset/morphemeEditor/GuiManager/GuiManager.cpp +++ b/DS2AnimToolset/morphemeEditor/GuiManager/GuiManager.cpp @@ -8,6 +8,8 @@ #include "WorkerThread/WorkerThread.h" #include "Camera/Camera.h" +#define MSAA_SETTING_COUNT 4 + namespace { void trackEditorColorSelector(TrackEditor::TrackEditorBase* trackEditor) @@ -676,10 +678,12 @@ void GuiManager::rootWindow() { RenderManager* renderMan = RenderManager::getInstance(); - const char* msaaQualitySettings[6] = { "Off", "2x", "4x", "8x", "16x" }; + const char* msaaQualitySettings[5] = { "Off", "2x", "4x", "8x", "16x" }; int selectedSetting = 0; - switch (renderMan->getSettings()->msaaCount) + int msaaCountSetting = renderMan->getSettings()->msaaCount; + + switch (msaaCountSetting) { case 1: selectedSetting = 0; @@ -696,11 +700,14 @@ void GuiManager::rootWindow() case 16: selectedSetting = 4; break; + default: + g_appLog->panicMessage("Unsupported MSAA count %d (maximum handled is 16, recommended maximum is 8)\n", msaaCountSetting); + break; } if (ImGui::BeginCombo("MSAA", msaaQualitySettings[selectedSetting])) { - for (size_t i = 0; i < 5; i++) + for (size_t i = 0; i < MSAA_SETTING_COUNT; i++) { ImGui::Selectable(msaaQualitySettings[i]); diff --git a/DS2AnimToolset/morphemeEditor/MorphemeEditor.h b/DS2AnimToolset/morphemeEditor/MorphemeEditor.h index cb7398a7..60c83b2d 100644 --- a/DS2AnimToolset/morphemeEditor/MorphemeEditor.h +++ b/DS2AnimToolset/morphemeEditor/MorphemeEditor.h @@ -1,5 +1,5 @@ #pragma once -#define APPNAME_W L"MorphemeEditor 1.2.0" -#define APPNAME_A "MorphemeEditor 1.2.0" +#define APPNAME_W L"MorphemeEditor 1.2.1" +#define APPNAME_A "MorphemeEditor 1.2.1" #include "resource.h" \ No newline at end of file diff --git a/DS2AnimToolset/morphemeEditor/TrackEditor/TrackEditorBase.cpp b/DS2AnimToolset/morphemeEditor/TrackEditor/TrackEditorBase.cpp index b44161fa..c915bfa9 100644 --- a/DS2AnimToolset/morphemeEditor/TrackEditor/TrackEditorBase.cpp +++ b/DS2AnimToolset/morphemeEditor/TrackEditor/TrackEditorBase.cpp @@ -8,7 +8,7 @@ namespace { - int drawDurationEvent(ImDrawList* draw_list, ImVec2 startOffset, int itemHeight, int framePixelWidth, int frameStart, int frameEnd, std::string label, TrackEditor::LabelAlignment alignment, ImU32 trackColor, ImU32 boundColor, ImU32 textColor) + int drawDurationEvent(ImDrawList* draw_list, ImVec2 startOffset, int itemHeight, float framePixelWidth, int frameStart, int frameEnd, std::string label, TrackEditor::LabelAlignment alignment, ImU32 trackColor, ImU32 boundColor, ImU32 textColor) { ImVec2 slotP1(startOffset.x + frameStart * framePixelWidth - 1, startOffset.y + 2); ImVec2 slotP2(startOffset.x + frameEnd * framePixelWidth - 1, startOffset.y + itemHeight - 2); @@ -74,7 +74,7 @@ namespace return 0; } - int drawDiscreteEvent(ImDrawList* draw_list, ImVec2 startOffset, int itemHeight, int framePixelWidth, int frameStart, std::string label, int idx, TrackEditor::LabelAlignment alignment, ImU32 trackColor, ImU32 boundColor, ImU32 textColor) + int drawDiscreteEvent(ImDrawList* draw_list, ImVec2 startOffset, int itemHeight, float framePixelWidth, int frameStart, std::string label, int idx, TrackEditor::LabelAlignment alignment, ImU32 trackColor, ImU32 boundColor, ImU32 textColor) { ImVec2 slotD1(startOffset.x + frameStart * framePixelWidth - 6, startOffset.y + 2); ImVec2 slotD2(startOffset.x + frameStart * framePixelWidth + 4, startOffset.y + itemHeight - 7); From d606b0a396571a1ffba5de11eaf9a386e21ebe03 Mon Sep 17 00:00:00 2001 From: Radai Date: Thu, 12 Sep 2024 13:12:05 +0200 Subject: [PATCH 2/2] Update MorphemeEditor.h --- DS2AnimToolset/morphemeEditor/MorphemeEditor.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/DS2AnimToolset/morphemeEditor/MorphemeEditor.h b/DS2AnimToolset/morphemeEditor/MorphemeEditor.h index 60c83b2d..cb7398a7 100644 --- a/DS2AnimToolset/morphemeEditor/MorphemeEditor.h +++ b/DS2AnimToolset/morphemeEditor/MorphemeEditor.h @@ -1,5 +1,5 @@ #pragma once -#define APPNAME_W L"MorphemeEditor 1.2.1" -#define APPNAME_A "MorphemeEditor 1.2.1" +#define APPNAME_W L"MorphemeEditor 1.2.0" +#define APPNAME_A "MorphemeEditor 1.2.0" #include "resource.h" \ No newline at end of file