From e67186aa06f916e021cf4255c227ef3de1ffbf03 Mon Sep 17 00:00:00 2001 From: Anthony Moniz Date: Fri, 17 Oct 2025 23:50:01 -0400 Subject: [PATCH 1/3] Fix compilation issues on 5.6 with some compilers --- Plugins/Cog/Source/Cog/Private/CogWidgets.cpp | 3 ++- .../Source/CogEngine/Private/CogEngineWindow_Console.cpp | 2 +- .../Cog/Source/CogEngine/Private/CogEngineWindow_Levels.cpp | 2 +- .../CogAI/Source/CogAI/Private/CogAIWindow_Perception.cpp | 6 +++--- 4 files changed, 7 insertions(+), 6 deletions(-) diff --git a/Plugins/Cog/Source/Cog/Private/CogWidgets.cpp b/Plugins/Cog/Source/Cog/Private/CogWidgets.cpp index 5275a6e..516e9f1 100644 --- a/Plugins/Cog/Source/Cog/Private/CogWidgets.cpp +++ b/Plugins/Cog/Source/Cog/Private/CogWidgets.cpp @@ -518,12 +518,13 @@ bool FCogWidgets::CheckBoxState(const char* Label, ECheckBoxState& State, bool S //-------------------------------------------------------------------------------------------------------------------------- bool FCogWidgets::InputChord(const char* Label, FInputChord& InInputChord) { + FString LabelStr = Label; ImGui::PushID(Label); ImGui::AlignTextToFramePadding(); ImGui::BeginDisabled(); ImGui::SetNextItemWidth(ImGui::GetFontSize() * 15); - ImGui::InputText("##Shortcut", const_cast(Label), IM_ARRAYSIZE(Label)); + ImGui::InputText("##Shortcut", const_cast(Label), IM_ARRAYSIZE(LabelStr)); ImGui::EndDisabled(); ImGui::SameLine(); diff --git a/Plugins/Cog/Source/CogEngine/Private/CogEngineWindow_Console.cpp b/Plugins/Cog/Source/CogEngine/Private/CogEngineWindow_Console.cpp index 26dfe06..6e14586 100644 --- a/Plugins/Cog/Source/CogEngine/Private/CogEngineWindow_Console.cpp +++ b/Plugins/Cog/Source/CogEngine/Private/CogEngineWindow_Console.cpp @@ -450,7 +450,7 @@ void FCogEngineWindow_Console::RenderCommandList() const FString SelectedCommand = CommandList[SelectedCommandIndex]; const FString Help = GetConsoleCommandHelp(SelectedCommand); const auto& HelpStr = StringCast(*Help); - ImGui::TextWrapped(HelpStr.Get()); + ImGui::TextWrapped("%s", HelpStr.Get()); } ImGui::Unindent(Indent); diff --git a/Plugins/Cog/Source/CogEngine/Private/CogEngineWindow_Levels.cpp b/Plugins/Cog/Source/CogEngine/Private/CogEngineWindow_Levels.cpp index b66364e..423bdbe 100644 --- a/Plugins/Cog/Source/CogEngine/Private/CogEngineWindow_Levels.cpp +++ b/Plugins/Cog/Source/CogEngine/Private/CogEngineWindow_Levels.cpp @@ -151,7 +151,7 @@ void FCogEngineWindow_Levels::RenderLevel(int32 InIndex, const FAssetData& InAss } } - ImGui::SetItemTooltip(StringCast(*InAsset.PackageName.ToString()).Get()); + ImGui::SetItemTooltip("%s", StringCast(*InAsset.PackageName.ToString()).Get()); RenderLevelContextMenu(InIndex, InAsset); } diff --git a/Plugins/CogAI/Source/CogAI/Private/CogAIWindow_Perception.cpp b/Plugins/CogAI/Source/CogAI/Private/CogAIWindow_Perception.cpp index 5b4cfe5..a4e5715 100644 --- a/Plugins/CogAI/Source/CogAI/Private/CogAIWindow_Perception.cpp +++ b/Plugins/CogAI/Source/CogAI/Private/CogAIWindow_Perception.cpp @@ -195,9 +195,9 @@ void FCogAIWindow_Perception::RenderContent() } const FString ActorName = FCogHelper::GetActorName(Actor); - auto ActorNameStr = COG_TCHAR_TO_CHAR(*ActorName); + auto ActorNameStr = StringCast(*ActorName); - if (Filter.IsActive() && !Filter.PassFilter(ActorNameStr)) + if (Filter.IsActive() && !Filter.PassFilter(ActorNameStr.Get())) { continue; } @@ -229,7 +229,7 @@ void FCogAIWindow_Perception::RenderContent() ImGui::TableNextRow(); ImGui::TableNextColumn(); ImGui::PushStyleColor(ImGuiCol_Text, NameColor); - bool bOpenActor = ImGui::TreeNodeEx(ActorNameStr, ImGuiTreeNodeFlags_SpanFullWidth | ImGuiTreeNodeFlags_SpanAllColumns | ImGuiTreeNodeFlags_LabelSpanAllColumns); + bool bOpenActor = ImGui::TreeNodeEx(ActorNameStr.Get(), ImGuiTreeNodeFlags_SpanFullWidth | ImGuiTreeNodeFlags_SpanAllColumns | ImGuiTreeNodeFlags_LabelSpanAllColumns); ImGui::PopStyleColor(); From e9eea3f078a130d01232b06037b485e081a3c037 Mon Sep 17 00:00:00 2001 From: Anthony Moniz Date: Sat, 18 Oct 2025 00:03:25 -0400 Subject: [PATCH 2/3] Move Editor only include into WITH_EDITOR macro --- Plugins/Cog/Source/Cog/Private/CogWidgets.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Plugins/Cog/Source/Cog/Private/CogWidgets.cpp b/Plugins/Cog/Source/Cog/Private/CogWidgets.cpp index 516e9f1..2015bdf 100644 --- a/Plugins/Cog/Source/Cog/Private/CogWidgets.cpp +++ b/Plugins/Cog/Source/Cog/Private/CogWidgets.cpp @@ -5,7 +5,6 @@ #include "CogImguiHelper.h" #include "CogImguiInputHelper.h" #include "CogHelper.h" -#include "Editor.h" #include "Components/PrimitiveComponent.h" #include "EngineUtils.h" #include "imgui.h" @@ -17,6 +16,7 @@ #if WITH_EDITOR #include "IAssetTools.h" +#include "Editor.h" #include "Subsystems/AssetEditorSubsystem.h" #endif From 1bb937478d4df8d7b9a41793d9c0cf4a0ebcd5eb Mon Sep 17 00:00:00 2001 From: Anthony Moniz Date: Sat, 18 Oct 2025 00:08:37 -0400 Subject: [PATCH 3/3] Update imgui and implot to compile for other platforms --- Plugins/Cog/Source/ThirdParty/ImGui/imgui.cpp | 4 ++-- Plugins/Cog/Source/ThirdParty/ImPlot/implot.cpp | 10 +++++++--- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/Plugins/Cog/Source/ThirdParty/ImGui/imgui.cpp b/Plugins/Cog/Source/ThirdParty/ImGui/imgui.cpp index baa0338..ca12e63 100644 --- a/Plugins/Cog/Source/ThirdParty/ImGui/imgui.cpp +++ b/Plugins/Cog/Source/ThirdParty/ImGui/imgui.cpp @@ -20677,7 +20677,7 @@ static bool Platform_OpenInShellFn_DefaultImpl(ImGuiContext*, const char* path) { return (INT_PTR)::ShellExecuteA(NULL, "open", path, NULL, NULL, SW_SHOWDEFAULT) > 32; } -#else +#elif defined(__APPLE__) || defined(__linux__) #include #include static bool Platform_OpenInShellFn_DefaultImpl(ImGuiContext*, const char* path) @@ -20702,10 +20702,10 @@ static bool Platform_OpenInShellFn_DefaultImpl(ImGuiContext*, const char* path) return WEXITSTATUS(status) == 0; } } -#endif #else static bool Platform_OpenInShellFn_DefaultImpl(ImGuiContext*, const char*) { return false; } #endif // Default shell handlers +#endif //----------------------------------------------------------------------------- diff --git a/Plugins/Cog/Source/ThirdParty/ImPlot/implot.cpp b/Plugins/Cog/Source/ThirdParty/ImPlot/implot.cpp index 68addd4..44246fe 100644 --- a/Plugins/Cog/Source/ThirdParty/ImPlot/implot.cpp +++ b/Plugins/Cog/Source/ThirdParty/ImPlot/implot.cpp @@ -911,7 +911,7 @@ ImPlotTime MkGmtTime(struct tm *ptm) { ImPlotTime t; #ifdef _WIN32 t.S = _mkgmtime(ptm); -#else +#elif defined(__APPLE__) || defined(__linux__) t.S = timegm(ptm); #endif if (t.S < 0) @@ -926,8 +926,10 @@ tm* GetGmtTime(const ImPlotTime& t, tm* ptm) return ptm; else return nullptr; -#else +#elif defined(__APPLE__) || defined(__linux__) return gmtime_r(&t.S, ptm); +#else + return nullptr; #endif } @@ -945,8 +947,10 @@ tm* GetLocTime(const ImPlotTime& t, tm* ptm) { return ptm; else return nullptr; -#else +#elif defined(__APPLE__) || defined(__linux__) return localtime_r(&t.S, ptm); +#else + return nullptr; #endif }