From 9616573f402af7ccb0b0873e788737240903a4bd Mon Sep 17 00:00:00 2001 From: goat Date: Mon, 23 Dec 2024 22:36:31 +0100 Subject: [PATCH 01/11] reference and add vcxproj for cimgui, cimplot, cimguizmo --- .gitmodules | 9 ++ Dalamud.sln | 41 ++++- external/Directory.Build.props | 3 + external/cimgui/cimgui.vcxproj | 158 ++++++++++++++++++ external/cimgui/cimgui.vcxproj.filters | 45 ++++++ external/cimguizmo/cimguizmo.vcxproj | 162 +++++++++++++++++++ external/cimguizmo/cimguizmo.vcxproj.filters | 57 +++++++ external/cimplot/cimplot.vcxproj | 160 ++++++++++++++++++ external/cimplot/cimplot.vcxproj.filters | 51 ++++++ lib/cimgui | 1 + lib/cimguizmo | 1 + lib/cimplot | 1 + 12 files changed, 682 insertions(+), 7 deletions(-) create mode 100644 external/Directory.Build.props create mode 100644 external/cimgui/cimgui.vcxproj create mode 100644 external/cimgui/cimgui.vcxproj.filters create mode 100644 external/cimguizmo/cimguizmo.vcxproj create mode 100644 external/cimguizmo/cimguizmo.vcxproj.filters create mode 100644 external/cimplot/cimplot.vcxproj create mode 100644 external/cimplot/cimplot.vcxproj.filters create mode 160000 lib/cimgui create mode 160000 lib/cimguizmo create mode 160000 lib/cimplot diff --git a/.gitmodules b/.gitmodules index dd184b54e..227653d48 100644 --- a/.gitmodules +++ b/.gitmodules @@ -10,3 +10,12 @@ [submodule "lib/TsudaKageyu-minhook"] path = lib/TsudaKageyu-minhook url = https://github.com/TsudaKageyu/minhook.git +[submodule "lib/cimgui"] + path = lib/cimgui + url = https://github.com/goatcorp/gc-cimgui +[submodule "lib/cimplot"] + path = lib/cimplot + url = https://github.com/goatcorp/gc-cimplot +[submodule "lib/cimguizmo"] + path = lib/cimguizmo + url = https://github.com/goatcorp/gc-cimguizmo diff --git a/Dalamud.sln b/Dalamud.sln index 5d4b0737f..49fc9e011 100644 --- a/Dalamud.sln +++ b/Dalamud.sln @@ -53,6 +53,16 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Injector", "Injector", "{19 EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Utilities", "Utilities", "{8F079208-C227-4D96-9427-2BEBE0003944}" EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "cimgui", "external\cimgui\cimgui.vcxproj", "{8430077C-F736-4246-A052-8EA1CECE844E}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "imgui", "imgui", "{DBE5345E-6594-4A59-B183-1C3D5592269D}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "CS", "CS", "{8BBACF2D-7AB8-4610-A115-0E363D35C291}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "cimplot", "external\cimplot\cimplot.vcxproj", "{76CAA246-C405-4A8C-B0AE-F4A0EF3D4E16}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "cimguizmo", "external\cimguizmo\cimguizmo.vcxproj", "{F258347D-31BE-4605-98CE-40E43BDF6F9D}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -125,6 +135,18 @@ Global {A6AA1C3F-9470-4922-9D3F-D4549657AB22}.Debug|Any CPU.Build.0 = Debug|Any CPU {A6AA1C3F-9470-4922-9D3F-D4549657AB22}.Release|Any CPU.ActiveCfg = Release|Any CPU {A6AA1C3F-9470-4922-9D3F-D4549657AB22}.Release|Any CPU.Build.0 = Release|Any CPU + {8430077C-F736-4246-A052-8EA1CECE844E}.Debug|Any CPU.ActiveCfg = Debug|x64 + {8430077C-F736-4246-A052-8EA1CECE844E}.Debug|Any CPU.Build.0 = Debug|x64 + {8430077C-F736-4246-A052-8EA1CECE844E}.Release|Any CPU.ActiveCfg = Release|x64 + {8430077C-F736-4246-A052-8EA1CECE844E}.Release|Any CPU.Build.0 = Release|x64 + {76CAA246-C405-4A8C-B0AE-F4A0EF3D4E16}.Debug|Any CPU.ActiveCfg = Debug|x64 + {76CAA246-C405-4A8C-B0AE-F4A0EF3D4E16}.Debug|Any CPU.Build.0 = Debug|x64 + {76CAA246-C405-4A8C-B0AE-F4A0EF3D4E16}.Release|Any CPU.ActiveCfg = Release|x64 + {76CAA246-C405-4A8C-B0AE-F4A0EF3D4E16}.Release|Any CPU.Build.0 = Release|x64 + {F258347D-31BE-4605-98CE-40E43BDF6F9D}.Debug|Any CPU.ActiveCfg = Debug|x64 + {F258347D-31BE-4605-98CE-40E43BDF6F9D}.Debug|Any CPU.Build.0 = Debug|x64 + {F258347D-31BE-4605-98CE-40E43BDF6F9D}.Release|Any CPU.ActiveCfg = Release|x64 + {F258347D-31BE-4605-98CE-40E43BDF6F9D}.Release|Any CPU.Build.0 = Release|x64 EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE @@ -132,15 +154,20 @@ Global GlobalSection(NestedProjects) = preSolution {5B832F73-5F54-4ADC-870F-D0095EF72C9A} = {19775C83-7117-4A5F-AA00-18889F46A490} {8874326B-E755-4D13-90B4-59AB263A3E6B} = {19775C83-7117-4A5F-AA00-18889F46A490} - {0483026E-C6CE-4B1A-AA68-46544C08140B} = {E15BDA6D-E881-4482-94BA-BE5527E917FF} - {C0E7E797-4FBF-4F46-BC57-463F3719BA7A} = {E15BDA6D-E881-4482-94BA-BE5527E917FF} - {2F7FF0A8-B619-4572-86C7-71E46FE22FB8} = {E15BDA6D-E881-4482-94BA-BE5527E917FF} + {0483026E-C6CE-4B1A-AA68-46544C08140B} = {DBE5345E-6594-4A59-B183-1C3D5592269D} + {C0E7E797-4FBF-4F46-BC57-463F3719BA7A} = {DBE5345E-6594-4A59-B183-1C3D5592269D} + {2F7FF0A8-B619-4572-86C7-71E46FE22FB8} = {DBE5345E-6594-4A59-B183-1C3D5592269D} {4AFDB34A-7467-4D41-B067-53BC4101D9D0} = {8F079208-C227-4D96-9427-2BEBE0003944} - {C9B87BD7-AF49-41C3-91F1-D550ADEB7833} = {E15BDA6D-E881-4482-94BA-BE5527E917FF} - {E0D51896-604F-4B40-8CFE-51941607B3A1} = {E15BDA6D-E881-4482-94BA-BE5527E917FF} + {C9B87BD7-AF49-41C3-91F1-D550ADEB7833} = {8BBACF2D-7AB8-4610-A115-0E363D35C291} + {E0D51896-604F-4B40-8CFE-51941607B3A1} = {8BBACF2D-7AB8-4610-A115-0E363D35C291} {A568929D-6FF6-4DFA-9D14-5D7DC08FA5E0} = {8F079208-C227-4D96-9427-2BEBE0003944} - {3620414C-7DFC-423E-929F-310E19F5D930} = {E15BDA6D-E881-4482-94BA-BE5527E917FF} - {A6AA1C3F-9470-4922-9D3F-D4549657AB22} = {E15BDA6D-E881-4482-94BA-BE5527E917FF} + {3620414C-7DFC-423E-929F-310E19F5D930} = {8BBACF2D-7AB8-4610-A115-0E363D35C291} + {A6AA1C3F-9470-4922-9D3F-D4549657AB22} = {8BBACF2D-7AB8-4610-A115-0E363D35C291} + {8430077C-F736-4246-A052-8EA1CECE844E} = {DBE5345E-6594-4A59-B183-1C3D5592269D} + {DBE5345E-6594-4A59-B183-1C3D5592269D} = {E15BDA6D-E881-4482-94BA-BE5527E917FF} + {8BBACF2D-7AB8-4610-A115-0E363D35C291} = {E15BDA6D-E881-4482-94BA-BE5527E917FF} + {76CAA246-C405-4A8C-B0AE-F4A0EF3D4E16} = {DBE5345E-6594-4A59-B183-1C3D5592269D} + {F258347D-31BE-4605-98CE-40E43BDF6F9D} = {DBE5345E-6594-4A59-B183-1C3D5592269D} EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution SolutionGuid = {79B65AC9-C940-410E-AB61-7EA7E12C7599} diff --git a/external/Directory.Build.props b/external/Directory.Build.props new file mode 100644 index 000000000..f719442cd --- /dev/null +++ b/external/Directory.Build.props @@ -0,0 +1,3 @@ + + + diff --git a/external/cimgui/cimgui.vcxproj b/external/cimgui/cimgui.vcxproj new file mode 100644 index 000000000..c5663fa05 --- /dev/null +++ b/external/cimgui/cimgui.vcxproj @@ -0,0 +1,158 @@ + + + + + Debug + Win32 + + + Release + Win32 + + + Debug + x64 + + + Release + x64 + + + + + + + + + + + + + + + + 17.0 + Win32Proj + {8430077c-f736-4246-a052-8ea1cece844e} + cimgui + 10.0 + + + + DynamicLibrary + true + v143 + Unicode + + + DynamicLibrary + false + v143 + true + Unicode + + + DynamicLibrary + true + v143 + Unicode + + + DynamicLibrary + false + v143 + true + Unicode + + + + + + + + + + + + + + + + + + + + + + Level3 + true + WIN32;_DEBUG;CIMGUI_EXPORTS;_WINDOWS;_USRDLL;%(PreprocessorDefinitions) + true + Use + pch.h + + + Windows + true + false + + + + + Level3 + true + true + true + WIN32;NDEBUG;CIMGUI_EXPORTS;_WINDOWS;_USRDLL;%(PreprocessorDefinitions) + true + Use + pch.h + + + Windows + true + true + true + false + + + + + Level3 + true + _DEBUG;CIMGUI_EXPORTS;_WINDOWS;_USRDLL;IMGUI_DISABLE_OBSOLETE_FUNCTIONS=1;%(PreprocessorDefinitions) + true + NotUsing + + + $(SolutionDir)lib\cimgui\imgui;%(AdditionalIncludeDirectories) + + + Windows + true + false + + + + + Level3 + true + true + true + NDEBUG;CIMGUI_EXPORTS;_WINDOWS;_USRDLL;%(PreprocessorDefinitions) + true + Use + pch.h + + + Windows + true + true + true + false + + + + + + \ No newline at end of file diff --git a/external/cimgui/cimgui.vcxproj.filters b/external/cimgui/cimgui.vcxproj.filters new file mode 100644 index 000000000..d48c361f1 --- /dev/null +++ b/external/cimgui/cimgui.vcxproj.filters @@ -0,0 +1,45 @@ + + + + + {4FC737F1-C7A5-4376-A066-2A32D752A2FF} + cpp;c;cc;cxx;c++;cppm;ixx;def;odl;idl;hpj;bat;asm;asmx + + + {93995380-89BD-4b04-88EB-625FBE52EBFB} + h;hh;hpp;hxx;h++;hm;inl;inc;ipp;xsd + + + {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} + rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms + + + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + + + Header Files + + + \ No newline at end of file diff --git a/external/cimguizmo/cimguizmo.vcxproj b/external/cimguizmo/cimguizmo.vcxproj new file mode 100644 index 000000000..3fe6fb073 --- /dev/null +++ b/external/cimguizmo/cimguizmo.vcxproj @@ -0,0 +1,162 @@ + + + + + Debug + Win32 + + + Release + Win32 + + + Debug + x64 + + + Release + x64 + + + + + + + + + + + + + + + + + + + + 17.0 + Win32Proj + {F258347D-31BE-4605-98CE-40E43BDF6F9D} + cimplot + 10.0 + + + + DynamicLibrary + true + v143 + Unicode + + + DynamicLibrary + false + v143 + true + Unicode + + + DynamicLibrary + true + v143 + Unicode + + + DynamicLibrary + false + v143 + true + Unicode + + + + + + + + + + + + + + + + + + + + + + Level3 + true + WIN32;_DEBUG;CIMGUIZMO_EXPORTS;_WINDOWS;_USRDLL;%(PreprocessorDefinitions) + true + Use + pch.h + + + Windows + true + false + + + + + Level3 + true + true + true + WIN32;NDEBUG;CIMGUIZMO_EXPORTS;_WINDOWS;_USRDLL;%(PreprocessorDefinitions) + true + Use + pch.h + + + Windows + true + true + true + false + + + + + Level3 + true + _DEBUG;CIMGUIZMO_EXPORTS;_WINDOWS;_USRDLL;%(PreprocessorDefinitions) + true + NotUsing + + + $(SolutionDir)lib\cimgui\imgui;$(SolutionDir)lib\cimguizmo\ImGuizmo;$(SolutionDir)lib\cimgui;%(AdditionalIncludeDirectories) + + + Windows + true + false + + + + + Level3 + true + true + true + NDEBUG;CIMGUIZMO_EXPORTS;_WINDOWS;_USRDLL;%(PreprocessorDefinitions) + true + Use + pch.h + + + Windows + true + true + true + false + + + + + + \ No newline at end of file diff --git a/external/cimguizmo/cimguizmo.vcxproj.filters b/external/cimguizmo/cimguizmo.vcxproj.filters new file mode 100644 index 000000000..f954dcc2c --- /dev/null +++ b/external/cimguizmo/cimguizmo.vcxproj.filters @@ -0,0 +1,57 @@ + + + + + {4FC737F1-C7A5-4376-A066-2A32D752A2FF} + cpp;c;cc;cxx;c++;cppm;ixx;def;odl;idl;hpj;bat;asm;asmx + + + {93995380-89BD-4b04-88EB-625FBE52EBFB} + h;hh;hpp;hxx;h++;hm;inl;inc;ipp;xsd + + + {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} + rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms + + + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + + + Header Files + + + \ No newline at end of file diff --git a/external/cimplot/cimplot.vcxproj b/external/cimplot/cimplot.vcxproj new file mode 100644 index 000000000..872448ea8 --- /dev/null +++ b/external/cimplot/cimplot.vcxproj @@ -0,0 +1,160 @@ + + + + + Debug + Win32 + + + Release + Win32 + + + Debug + x64 + + + Release + x64 + + + + + + + + + + + + + + + + + + 17.0 + Win32Proj + {76caa246-c405-4a8c-b0ae-f4a0ef3d4e16} + cimplot + 10.0 + + + + DynamicLibrary + true + v143 + Unicode + + + DynamicLibrary + false + v143 + true + Unicode + + + DynamicLibrary + true + v143 + Unicode + + + DynamicLibrary + false + v143 + true + Unicode + + + + + + + + + + + + + + + + + + + + + + Level3 + true + WIN32;_DEBUG;CIMPLOT_EXPORTS;_WINDOWS;_USRDLL;%(PreprocessorDefinitions) + true + Use + pch.h + + + Windows + true + false + + + + + Level3 + true + true + true + WIN32;NDEBUG;CIMPLOT_EXPORTS;_WINDOWS;_USRDLL;%(PreprocessorDefinitions) + true + Use + pch.h + + + Windows + true + true + true + false + + + + + Level3 + true + _DEBUG;CIMPLOT_EXPORTS;_WINDOWS;_USRDLL;%(PreprocessorDefinitions) + true + NotUsing + + + $(SolutionDir)lib\cimgui\imgui;$(SolutionDir)lib\cimplot\implot;$(SolutionDir)lib\cimgui;%(AdditionalIncludeDirectories) + + + Windows + true + false + + + + + Level3 + true + true + true + NDEBUG;CIMPLOT_EXPORTS;_WINDOWS;_USRDLL;%(PreprocessorDefinitions) + true + Use + pch.h + + + Windows + true + true + true + false + + + + + + \ No newline at end of file diff --git a/external/cimplot/cimplot.vcxproj.filters b/external/cimplot/cimplot.vcxproj.filters new file mode 100644 index 000000000..ad8bfd11b --- /dev/null +++ b/external/cimplot/cimplot.vcxproj.filters @@ -0,0 +1,51 @@ + + + + + {4FC737F1-C7A5-4376-A066-2A32D752A2FF} + cpp;c;cc;cxx;c++;cppm;ixx;def;odl;idl;hpj;bat;asm;asmx + + + {93995380-89BD-4b04-88EB-625FBE52EBFB} + h;hh;hpp;hxx;h++;hm;inl;inc;ipp;xsd + + + {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} + rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms + + + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + + + Header Files + + + \ No newline at end of file diff --git a/lib/cimgui b/lib/cimgui new file mode 160000 index 000000000..7b4955bbd --- /dev/null +++ b/lib/cimgui @@ -0,0 +1 @@ +Subproject commit 7b4955bbd8f7bc6c022d39503dc806fa53a6a590 diff --git a/lib/cimguizmo b/lib/cimguizmo new file mode 160000 index 000000000..dbad4fdb4 --- /dev/null +++ b/lib/cimguizmo @@ -0,0 +1 @@ +Subproject commit dbad4fdb4d465e1f48d20c4c54a20925095297b0 diff --git a/lib/cimplot b/lib/cimplot new file mode 160000 index 000000000..939f8f36d --- /dev/null +++ b/lib/cimplot @@ -0,0 +1 @@ +Subproject commit 939f8f36deebd895f6cda522ee4bb2b798920935 From 43ab6bd24fdb80bed9824ffcde0c409c5207150c Mon Sep 17 00:00:00 2001 From: goat Date: Mon, 23 Dec 2024 22:39:55 +0100 Subject: [PATCH 02/11] remove win32 targets --- external/cimgui/cimgui.vcxproj | 61 ---------------------------- external/cimguizmo/cimguizmo.vcxproj | 61 ---------------------------- external/cimplot/cimplot.vcxproj | 61 ---------------------------- 3 files changed, 183 deletions(-) diff --git a/external/cimgui/cimgui.vcxproj b/external/cimgui/cimgui.vcxproj index c5663fa05..7c75fd853 100644 --- a/external/cimgui/cimgui.vcxproj +++ b/external/cimgui/cimgui.vcxproj @@ -1,14 +1,6 @@ - - Debug - Win32 - - - Release - Win32 - Debug x64 @@ -38,19 +30,6 @@ 10.0 - - DynamicLibrary - true - v143 - Unicode - - - DynamicLibrary - false - v143 - true - Unicode - DynamicLibrary true @@ -69,12 +48,6 @@ - - - - - - @@ -82,40 +55,6 @@ - - - Level3 - true - WIN32;_DEBUG;CIMGUI_EXPORTS;_WINDOWS;_USRDLL;%(PreprocessorDefinitions) - true - Use - pch.h - - - Windows - true - false - - - - - Level3 - true - true - true - WIN32;NDEBUG;CIMGUI_EXPORTS;_WINDOWS;_USRDLL;%(PreprocessorDefinitions) - true - Use - pch.h - - - Windows - true - true - true - false - - Level3 diff --git a/external/cimguizmo/cimguizmo.vcxproj b/external/cimguizmo/cimguizmo.vcxproj index 3fe6fb073..11200ad72 100644 --- a/external/cimguizmo/cimguizmo.vcxproj +++ b/external/cimguizmo/cimguizmo.vcxproj @@ -1,14 +1,6 @@ - - Debug - Win32 - - - Release - Win32 - Debug x64 @@ -42,19 +34,6 @@ 10.0 - - DynamicLibrary - true - v143 - Unicode - - - DynamicLibrary - false - v143 - true - Unicode - DynamicLibrary true @@ -73,12 +52,6 @@ - - - - - - @@ -86,40 +59,6 @@ - - - Level3 - true - WIN32;_DEBUG;CIMGUIZMO_EXPORTS;_WINDOWS;_USRDLL;%(PreprocessorDefinitions) - true - Use - pch.h - - - Windows - true - false - - - - - Level3 - true - true - true - WIN32;NDEBUG;CIMGUIZMO_EXPORTS;_WINDOWS;_USRDLL;%(PreprocessorDefinitions) - true - Use - pch.h - - - Windows - true - true - true - false - - Level3 diff --git a/external/cimplot/cimplot.vcxproj b/external/cimplot/cimplot.vcxproj index 872448ea8..eacebe3de 100644 --- a/external/cimplot/cimplot.vcxproj +++ b/external/cimplot/cimplot.vcxproj @@ -1,14 +1,6 @@ - - Debug - Win32 - - - Release - Win32 - Debug x64 @@ -40,19 +32,6 @@ 10.0 - - DynamicLibrary - true - v143 - Unicode - - - DynamicLibrary - false - v143 - true - Unicode - DynamicLibrary true @@ -71,12 +50,6 @@ - - - - - - @@ -84,40 +57,6 @@ - - - Level3 - true - WIN32;_DEBUG;CIMPLOT_EXPORTS;_WINDOWS;_USRDLL;%(PreprocessorDefinitions) - true - Use - pch.h - - - Windows - true - false - - - - - Level3 - true - true - true - WIN32;NDEBUG;CIMPLOT_EXPORTS;_WINDOWS;_USRDLL;%(PreprocessorDefinitions) - true - Use - pch.h - - - Windows - true - true - true - false - - Level3 From 371f1bfa1895eeb42db28d51536705649770b79f Mon Sep 17 00:00:00 2001 From: goat Date: Mon, 23 Dec 2024 23:17:33 +0100 Subject: [PATCH 03/11] comment out kizer hack for now, need to move to natives --- Dalamud/Interface/Internal/ImGuiDrawListFixProvider.cs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Dalamud/Interface/Internal/ImGuiDrawListFixProvider.cs b/Dalamud/Interface/Internal/ImGuiDrawListFixProvider.cs index a682ed215..6ba5a1d94 100644 --- a/Dalamud/Interface/Internal/ImGuiDrawListFixProvider.cs +++ b/Dalamud/Interface/Internal/ImGuiDrawListFixProvider.cs @@ -39,6 +39,8 @@ internal sealed unsafe class ImGuiDrawListFixProvider : IInternalDisposableServi private ImGuiDrawListFixProvider(InterfaceManager.InterfaceManagerWithScene imws) { // Force cimgui.dll to be loaded. + // TODO(goat): Apply fixes in natives + /* _ = ImGui.GetCurrentContext(); var cimgui = Process.GetCurrentProcess().Modules.Cast() .First(x => x.ModuleName == "cimgui.dll") @@ -56,6 +58,7 @@ internal sealed unsafe class ImGuiDrawListFixProvider : IInternalDisposableServi this.hookImDrawListAddPolyline.Enable(); this.hookImDrawListAddRectFilled.Enable(); this.hookImDrawListAddImageRounded.Enable(); + */ } private delegate void ImDrawListAddPolyLine( From f696f7250f1f3232ab5eefbe955a77b2667b442c Mon Sep 17 00:00:00 2001 From: goat Date: Mon, 23 Dec 2024 23:24:13 +0100 Subject: [PATCH 04/11] shoddy include in dalamud build for now --- Dalamud/Dalamud.csproj | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) diff --git a/Dalamud/Dalamud.csproj b/Dalamud/Dalamud.csproj index a6ac07227..610bd7f84 100644 --- a/Dalamud/Dalamud.csproj +++ b/Dalamud/Dalamud.csproj @@ -103,6 +103,44 @@ + + + + + + + + + %(RecursiveDir)%(FileName)%(Extension) + PreserveNewest + + + + %(RecursiveDir)%(FileName)%(Extension) + PreserveNewest + + + + %(RecursiveDir)%(FileName)%(Extension) + PreserveNewest + + + + %(RecursiveDir)%(FileName)%(Extension) + PreserveNewest + + + + %(RecursiveDir)%(FileName)%(Extension) + PreserveNewest + + + + %(RecursiveDir)%(FileName)%(Extension) + PreserveNewest + + + From 1714191711da7e07e5edfd416b505497ba363ed5 Mon Sep 17 00:00:00 2001 From: goat Date: Mon, 23 Dec 2024 23:25:21 +0100 Subject: [PATCH 05/11] attest imgui DLLs --- .github/workflows/main.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 669d6255a..930adf8ed 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -55,6 +55,7 @@ jobs: bin/Release/Dalamud.*.dll bin/Release/Dalamud.*.exe bin/Release/FFXIVClientStructs.dll + bin/Release/cim*.dll - name: Upload artifact uses: actions/upload-artifact@v4 with: From 7629cac8af3c800bf5a26f8b0c912d0526c8bac1 Mon Sep 17 00:00:00 2001 From: goat Date: Mon, 23 Dec 2024 23:29:16 +0100 Subject: [PATCH 06/11] use ImGuiScene without shipped binaries --- lib/ImGuiScene | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/ImGuiScene b/lib/ImGuiScene index b0d41471b..d336b20a8 160000 --- a/lib/ImGuiScene +++ b/lib/ImGuiScene @@ -1 +1 @@ -Subproject commit b0d41471b7ef3d69daaf6d862eb74e7e00a25651 +Subproject commit d336b20a85ea48723a98681b18bdfe14a56a3403 From 87525091c903895dba88ec72655301c7e48c5151 Mon Sep 17 00:00:00 2001 From: goat Date: Tue, 24 Dec 2024 01:52:38 +0100 Subject: [PATCH 07/11] make it work with nuke --- .nuke/build.schema.json | 8 ++++ Dalamud.sln | 5 +++ Dalamud/Dalamud.csproj | 54 +++++++------------------- build/DalamudBuild.cs | 58 +++++++++++++++++++++++++++- external/cimgui/cimgui.vcxproj | 5 ++- external/cimguizmo/cimguizmo.vcxproj | 5 ++- external/cimplot/cimplot.vcxproj | 5 ++- 7 files changed, 97 insertions(+), 43 deletions(-) diff --git a/.nuke/build.schema.json b/.nuke/build.schema.json index 497f2b89a..e7e1a446a 100644 --- a/.nuke/build.schema.json +++ b/.nuke/build.schema.json @@ -78,9 +78,13 @@ "enum": [ "Clean", "Compile", + "CompileCImGui", + "CompileCImGuizmo", + "CompileCImPlot", "CompileDalamud", "CompileDalamudBoot", "CompileDalamudCrashHandler", + "CompileImGuiNatives", "CompileInjector", "CompileInjectorBoot", "Restore", @@ -100,9 +104,13 @@ "enum": [ "Clean", "Compile", + "CompileCImGui", + "CompileCImGuizmo", + "CompileCImPlot", "CompileDalamud", "CompileDalamudBoot", "CompileDalamudCrashHandler", + "CompileImGuiNatives", "CompileInjector", "CompileInjectorBoot", "Restore", diff --git a/Dalamud.sln b/Dalamud.sln index 49fc9e011..5b6f56c6e 100644 --- a/Dalamud.sln +++ b/Dalamud.sln @@ -16,6 +16,11 @@ EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "build", "build\build.csproj", "{94E5B016-02B1-459B-97D9-E783F28764B2}" EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Dalamud", "Dalamud\Dalamud.csproj", "{B92DAB43-2279-4A2C-96E3-D9D5910EDBEA}" + ProjectSection(ProjectDependencies) = postProject + {76CAA246-C405-4A8C-B0AE-F4A0EF3D4E16} = {76CAA246-C405-4A8C-B0AE-F4A0EF3D4E16} + {8430077C-F736-4246-A052-8EA1CECE844E} = {8430077C-F736-4246-A052-8EA1CECE844E} + {F258347D-31BE-4605-98CE-40E43BDF6F9D} = {F258347D-31BE-4605-98CE-40E43BDF6F9D} + EndProjectSection EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Dalamud.Boot", "Dalamud.Boot\Dalamud.Boot.vcxproj", "{55198DC3-A03D-408E-A8EB-2077780C8576}" EndProject diff --git a/Dalamud/Dalamud.csproj b/Dalamud/Dalamud.csproj index 610bd7f84..1cd9fc336 100644 --- a/Dalamud/Dalamud.csproj +++ b/Dalamud/Dalamud.csproj @@ -3,7 +3,7 @@ net8.0-windows x64 - x64;AnyCPU + x64 12.0 True @@ -103,44 +103,6 @@ - - - - - - - - - %(RecursiveDir)%(FileName)%(Extension) - PreserveNewest - - - - %(RecursiveDir)%(FileName)%(Extension) - PreserveNewest - - - - %(RecursiveDir)%(FileName)%(Extension) - PreserveNewest - - - - %(RecursiveDir)%(FileName)%(Extension) - PreserveNewest - - - - %(RecursiveDir)%(FileName)%(Extension) - PreserveNewest - - - - %(RecursiveDir)%(FileName)%(Extension) - PreserveNewest - - - @@ -243,4 +205,18 @@ + + + + + + + + + + + + + + diff --git a/build/DalamudBuild.cs b/build/DalamudBuild.cs index d704d54e0..6340c36fa 100644 --- a/build/DalamudBuild.cs +++ b/build/DalamudBuild.cs @@ -47,6 +47,14 @@ public class DalamudBuild : NukeBuild AbsolutePath TestProjectDir => RootDirectory / "Dalamud.Test"; AbsolutePath TestProjectFile => TestProjectDir / "Dalamud.Test.csproj"; + AbsolutePath ExternalsDir => RootDirectory / "external"; + AbsolutePath CImGuiDir => ExternalsDir / "cimgui"; + AbsolutePath CImGuiProjectFile => CImGuiDir / "cimgui.vcxproj"; + AbsolutePath CImPlotDir => ExternalsDir / "cimplot"; + AbsolutePath CImPlotProjectFile => CImPlotDir / "cimplot.vcxproj"; + AbsolutePath CImGuizmoDir => ExternalsDir / "cimguizmo"; + AbsolutePath CImGuizmoProjectFile => CImGuizmoDir / "cimguizmo.vcxproj"; + AbsolutePath ArtifactsDirectory => RootDirectory / "bin" / Configuration; private static AbsolutePath LibraryDirectory => RootDirectory / "lib"; @@ -59,9 +67,42 @@ public class DalamudBuild : NukeBuild DotNetTasks.DotNetRestore(s => s .SetProjectFile(Solution)); }); - + + Target CompileCImGui => _ => _ + .Executes(() => + { + MSBuildTasks.MSBuild(s => s + .SetTargetPath(CImGuiProjectFile) + .SetConfiguration(Configuration) + .SetTargetPlatform(MSBuildTargetPlatform.x64)); + }); + + Target CompileCImPlot => _ => _ + .Executes(() => + { + MSBuildTasks.MSBuild(s => s + .SetTargetPath(CImPlotProjectFile) + .SetConfiguration(Configuration) + .SetTargetPlatform(MSBuildTargetPlatform.x64)); + }); + + Target CompileCImGuizmo => _ => _ + .Executes(() => + { + MSBuildTasks.MSBuild(s => s + .SetTargetPath(CImGuizmoProjectFile) + .SetConfiguration(Configuration) + .SetTargetPlatform(MSBuildTargetPlatform.x64)); + }); + + Target CompileImGuiNatives => _ => _ + .DependsOn(CompileCImGui) + .DependsOn(CompileCImPlot) + .DependsOn(CompileCImGuizmo); + Target CompileDalamud => _ => _ .DependsOn(Restore) + .DependsOn(CompileImGuiNatives) .Executes(() => { DotNetTasks.DotNetBuild(s => @@ -138,6 +179,21 @@ public class DalamudBuild : NukeBuild Target Clean => _ => _ .Executes(() => { + MSBuildTasks.MSBuild(s => s + .SetProjectFile(CImGuiProjectFile) + .SetConfiguration(Configuration) + .SetTargets("Clean")); + + MSBuildTasks.MSBuild(s => s + .SetProjectFile(CImPlotProjectFile) + .SetConfiguration(Configuration) + .SetTargets("Clean")); + + MSBuildTasks.MSBuild(s => s + .SetProjectFile(CImGuizmoProjectFile) + .SetConfiguration(Configuration) + .SetTargets("Clean")); + DotNetTasks.DotNetClean(s => s .SetProject(DalamudProjectFile) .SetConfiguration(Configuration)); diff --git a/external/cimgui/cimgui.vcxproj b/external/cimgui/cimgui.vcxproj index 7c75fd853..12bb376f8 100644 --- a/external/cimgui/cimgui.vcxproj +++ b/external/cimgui/cimgui.vcxproj @@ -55,6 +55,9 @@ + + ..\$(Platform)\$(Configuration)\ + Level3 @@ -64,7 +67,7 @@ NotUsing - $(SolutionDir)lib\cimgui\imgui;%(AdditionalIncludeDirectories) + ..\..\lib\cimgui\imgui;%(AdditionalIncludeDirectories) Windows diff --git a/external/cimguizmo/cimguizmo.vcxproj b/external/cimguizmo/cimguizmo.vcxproj index 11200ad72..849cbfba5 100644 --- a/external/cimguizmo/cimguizmo.vcxproj +++ b/external/cimguizmo/cimguizmo.vcxproj @@ -59,6 +59,9 @@ + + ..\$(Platform)\$(Configuration)\ + Level3 @@ -68,7 +71,7 @@ NotUsing - $(SolutionDir)lib\cimgui\imgui;$(SolutionDir)lib\cimguizmo\ImGuizmo;$(SolutionDir)lib\cimgui;%(AdditionalIncludeDirectories) + ..\..\lib\cimgui\imgui;..\..\lib\cimguizmo\ImGuizmo;..\..\lib\cimgui;%(AdditionalIncludeDirectories) Windows diff --git a/external/cimplot/cimplot.vcxproj b/external/cimplot/cimplot.vcxproj index eacebe3de..3477ab262 100644 --- a/external/cimplot/cimplot.vcxproj +++ b/external/cimplot/cimplot.vcxproj @@ -57,6 +57,9 @@ + + ..\$(Platform)\$(Configuration)\ + Level3 @@ -66,7 +69,7 @@ NotUsing - $(SolutionDir)lib\cimgui\imgui;$(SolutionDir)lib\cimplot\implot;$(SolutionDir)lib\cimgui;%(AdditionalIncludeDirectories) + ..\..\lib\cimgui\imgui;..\..\lib\cimplot\implot;..\..\lib\cimgui;%(AdditionalIncludeDirectories) Windows From 419b62b2c981e446f6949b16175b662391ec9ce4 Mon Sep 17 00:00:00 2001 From: goat Date: Tue, 24 Dec 2024 02:48:42 +0100 Subject: [PATCH 08/11] fix release build --- external/cimgui/cimgui.vcxproj | 18 ++++++++++-------- external/cimguizmo/cimguizmo.vcxproj | 16 +++++++++------- external/cimplot/cimplot.vcxproj | 16 +++++++++------- 3 files changed, 28 insertions(+), 22 deletions(-) diff --git a/external/cimgui/cimgui.vcxproj b/external/cimgui/cimgui.vcxproj index 12bb376f8..c6109a131 100644 --- a/external/cimgui/cimgui.vcxproj +++ b/external/cimgui/cimgui.vcxproj @@ -55,19 +55,23 @@ - + ..\$(Platform)\$(Configuration)\ + + + + ..\..\lib\cimgui\imgui;%(AdditionalIncludeDirectories) + NotUsing + + + Level3 true _DEBUG;CIMGUI_EXPORTS;_WINDOWS;_USRDLL;IMGUI_DISABLE_OBSOLETE_FUNCTIONS=1;%(PreprocessorDefinitions) true - NotUsing - - - ..\..\lib\cimgui\imgui;%(AdditionalIncludeDirectories) Windows @@ -81,10 +85,8 @@ true true true - NDEBUG;CIMGUI_EXPORTS;_WINDOWS;_USRDLL;%(PreprocessorDefinitions) + NDEBUG;CIMGUI_EXPORTS;_WINDOWS;_USRDLL;IMGUI_DISABLE_OBSOLETE_FUNCTIONS=1;%(PreprocessorDefinitions) true - Use - pch.h Windows diff --git a/external/cimguizmo/cimguizmo.vcxproj b/external/cimguizmo/cimguizmo.vcxproj index 849cbfba5..56c085da3 100644 --- a/external/cimguizmo/cimguizmo.vcxproj +++ b/external/cimguizmo/cimguizmo.vcxproj @@ -59,19 +59,23 @@ - + ..\$(Platform)\$(Configuration)\ + + + + ..\..\lib\cimgui\imgui;..\..\lib\cimguizmo\ImGuizmo;..\..\lib\cimgui;%(AdditionalIncludeDirectories) + NotUsing + + + Level3 true _DEBUG;CIMGUIZMO_EXPORTS;_WINDOWS;_USRDLL;%(PreprocessorDefinitions) true - NotUsing - - - ..\..\lib\cimgui\imgui;..\..\lib\cimguizmo\ImGuizmo;..\..\lib\cimgui;%(AdditionalIncludeDirectories) Windows @@ -87,8 +91,6 @@ true NDEBUG;CIMGUIZMO_EXPORTS;_WINDOWS;_USRDLL;%(PreprocessorDefinitions) true - Use - pch.h Windows diff --git a/external/cimplot/cimplot.vcxproj b/external/cimplot/cimplot.vcxproj index 3477ab262..44bcf95bb 100644 --- a/external/cimplot/cimplot.vcxproj +++ b/external/cimplot/cimplot.vcxproj @@ -57,19 +57,23 @@ - + ..\$(Platform)\$(Configuration)\ + + + + ..\..\lib\cimgui\imgui;..\..\lib\cimplot\implot;..\..\lib\cimgui;%(AdditionalIncludeDirectories) + NotUsing + + + Level3 true _DEBUG;CIMPLOT_EXPORTS;_WINDOWS;_USRDLL;%(PreprocessorDefinitions) true - NotUsing - - - ..\..\lib\cimgui\imgui;..\..\lib\cimplot\implot;..\..\lib\cimgui;%(AdditionalIncludeDirectories) Windows @@ -85,8 +89,6 @@ true NDEBUG;CIMPLOT_EXPORTS;_WINDOWS;_USRDLL;%(PreprocessorDefinitions) true - Use - pch.h Windows From c31fe0920fd1395b2e3f997471a6790646c067e4 Mon Sep 17 00:00:00 2001 From: goat Date: Tue, 24 Dec 2024 03:44:31 +0100 Subject: [PATCH 09/11] remove hackfix hooks --- .../Internal/ImGuiDrawListFixProvider.cs | 225 ------------------ lib/cimgui | 2 +- 2 files changed, 1 insertion(+), 226 deletions(-) delete mode 100644 Dalamud/Interface/Internal/ImGuiDrawListFixProvider.cs diff --git a/Dalamud/Interface/Internal/ImGuiDrawListFixProvider.cs b/Dalamud/Interface/Internal/ImGuiDrawListFixProvider.cs deleted file mode 100644 index 6ba5a1d94..000000000 --- a/Dalamud/Interface/Internal/ImGuiDrawListFixProvider.cs +++ /dev/null @@ -1,225 +0,0 @@ -using System.Diagnostics; -using System.Linq; -using System.Numerics; - -using Dalamud.Hooking; - -using ImGuiNET; - -namespace Dalamud.Interface.Internal; - -/// -/// Fixes ImDrawList not correctly dealing with the current texture for that draw list not in tune with the global -/// state. Currently, ImDrawList::AddPolyLine and ImDrawList::AddRectFilled are affected. -/// -/// * The implementation for AddRectFilled is entirely replaced with the hook below. -/// * The implementation for AddPolyLine is wrapped with Push/PopTextureID. -/// -/// TODO: -/// * imgui_draw.cpp:1433 ImDrawList::AddRectFilled -/// The if block needs a PushTextureID(_Data->TexIdCommon)/PopTextureID() block, -/// if _Data->TexIdCommon != _CmdHeader.TextureId. -/// * imgui_draw.cpp:729 ImDrawList::AddPolyLine -/// The if block always needs to call PushTextureID if the abovementioned condition is not met. -/// Change push_texture_id to only have one condition. -/// -[ServiceManager.EarlyLoadedService] -internal sealed unsafe class ImGuiDrawListFixProvider : IInternalDisposableService -{ - private const int CImGuiImDrawListAddPolyLineOffset = 0x589B0; - private const int CImGuiImDrawListAddRectFilled = 0x59FD0; - private const int CImGuiImDrawListAddImageRounded = 0x58390; - private const int CImGuiImDrawListSharedDataTexIdCommonOffset = 0; - - private readonly Hook hookImDrawListAddPolyline; - private readonly Hook hookImDrawListAddRectFilled; - private readonly Hook hookImDrawListAddImageRounded; - - [ServiceManager.ServiceConstructor] - private ImGuiDrawListFixProvider(InterfaceManager.InterfaceManagerWithScene imws) - { - // Force cimgui.dll to be loaded. - // TODO(goat): Apply fixes in natives - /* - _ = ImGui.GetCurrentContext(); - var cimgui = Process.GetCurrentProcess().Modules.Cast() - .First(x => x.ModuleName == "cimgui.dll") - .BaseAddress; - - this.hookImDrawListAddPolyline = Hook.FromAddress( - cimgui + CImGuiImDrawListAddPolyLineOffset, - this.ImDrawListAddPolylineDetour); - this.hookImDrawListAddRectFilled = Hook.FromAddress( - cimgui + CImGuiImDrawListAddRectFilled, - this.ImDrawListAddRectFilledDetour); - this.hookImDrawListAddImageRounded = Hook.FromAddress( - cimgui + CImGuiImDrawListAddImageRounded, - this.ImDrawListAddImageRoundedDetour); - this.hookImDrawListAddPolyline.Enable(); - this.hookImDrawListAddRectFilled.Enable(); - this.hookImDrawListAddImageRounded.Enable(); - */ - } - - private delegate void ImDrawListAddPolyLine( - ImDrawListPtr drawListPtr, - ref Vector2 points, - int pointsCount, - uint color, - ImDrawFlags flags, - float thickness); - - private delegate void ImDrawListAddRectFilled( - ImDrawListPtr drawListPtr, - ref Vector2 min, - ref Vector2 max, - uint col, - float rounding, - ImDrawFlags flags); - - private delegate void ImDrawListAddImageRounded( - ImDrawListPtr drawListPtr, - nint userTextureId, ref Vector2 xy0, - ref Vector2 xy1, - ref Vector2 uv0, - ref Vector2 uv1, - uint col, - float rounding, - ImDrawFlags flags); - - /// - void IInternalDisposableService.DisposeService() - { - this.hookImDrawListAddPolyline.Dispose(); - this.hookImDrawListAddRectFilled.Dispose(); - this.hookImDrawListAddImageRounded.Dispose(); - } - - private static ImDrawFlags FixRectCornerFlags(ImDrawFlags flags) - { -#if !IMGUI_DISABLE_OBSOLETE_FUNCTIONS - // Legacy Support for hard coded ~0 (used to be a suggested equivalent to ImDrawCornerFlags_All) - // ~0 --> ImDrawFlags_RoundCornersAll or 0 - if ((int)flags == ~0) - return ImDrawFlags.RoundCornersAll; - - // Legacy Support for hard coded 0x01 to 0x0F (matching 15 out of 16 old flags combinations) - // 0x01 --> ImDrawFlags_RoundCornersTopLeft (VALUE 0x01 OVERLAPS ImDrawFlags_Closed but ImDrawFlags_Closed is never valid in this path!) - // 0x02 --> ImDrawFlags_RoundCornersTopRight - // 0x03 --> ImDrawFlags_RoundCornersTopLeft | ImDrawFlags_RoundCornersTopRight - // 0x04 --> ImDrawFlags_RoundCornersBotLeft - // 0x05 --> ImDrawFlags_RoundCornersTopLeft | ImDrawFlags_RoundCornersBotLeft - // ... - // 0x0F --> ImDrawFlags_RoundCornersAll or 0 - // (See all values in ImDrawCornerFlags_) - if ((int)flags >= 0x01 && (int)flags <= 0x0F) - return (ImDrawFlags)((int)flags << 4); - - // We cannot support hard coded 0x00 with 'float rounding > 0.0f' --> replace with ImDrawFlags_RoundCornersNone or use 'float rounding = 0.0f' -#endif - - // If this triggers, please update your code replacing hardcoded values with new ImDrawFlags_RoundCorners* values. - // Note that ImDrawFlags_Closed (== 0x01) is an invalid flag for AddRect(), AddRectFilled(), PathRect() etc... - if (((int)flags & 0x0F) != 0) - throw new ArgumentException("Misuse of legacy hardcoded ImDrawCornerFlags values!"); - - if ((flags & ImDrawFlags.RoundCornersMask) == 0) - flags |= ImDrawFlags.RoundCornersAll; - - return flags; - } - - private void ImDrawListAddRectFilledDetour( - ImDrawListPtr drawListPtr, - ref Vector2 min, - ref Vector2 max, - uint col, - float rounding, - ImDrawFlags flags) - { - // Skip drawing if we're drawing something with alpha value of 0. - if ((col & 0xFF000000) == 0) - return; - - if (rounding < 0.5f || (flags & ImDrawFlags.RoundCornersMask) == ImDrawFlags.RoundCornersMask) - { - // Take the fast path of drawing two triangles if no rounded corners are required. - - var texIdCommon = *(nint*)(drawListPtr._Data + CImGuiImDrawListSharedDataTexIdCommonOffset); - var pushTextureId = texIdCommon != drawListPtr._CmdHeader.TextureId; - if (pushTextureId) - drawListPtr.PushTextureID(texIdCommon); - - drawListPtr.PrimReserve(6, 4); - drawListPtr.PrimRect(min, max, col); - - if (pushTextureId) - drawListPtr.PopTextureID(); - } - else - { - // Defer drawing rectangle with rounded corners to path drawing operations. - // Note that this may have a slightly different extent behaviors from the above if case. - // This is how it is in imgui_draw.cpp. - drawListPtr.PathRect(min, max, rounding, flags); - drawListPtr.PathFillConvex(col); - } - } - - private void ImDrawListAddPolylineDetour( - ImDrawListPtr drawListPtr, - ref Vector2 points, - int pointsCount, - uint color, - ImDrawFlags flags, - float thickness) - { - var texIdCommon = *(nint*)(drawListPtr._Data + CImGuiImDrawListSharedDataTexIdCommonOffset); - var pushTextureId = texIdCommon != drawListPtr._CmdHeader.TextureId; - if (pushTextureId) - drawListPtr.PushTextureID(texIdCommon); - - this.hookImDrawListAddPolyline.Original(drawListPtr, ref points, pointsCount, color, flags, thickness); - - if (pushTextureId) - drawListPtr.PopTextureID(); - } - - private void ImDrawListAddImageRoundedDetour(ImDrawListPtr drawListPtr, nint userTextureId, ref Vector2 xy0, ref Vector2 xy1, ref Vector2 uv0, ref Vector2 uv1, uint col, float rounding, ImDrawFlags flags) - { - // Skip drawing if we're drawing something with alpha value of 0. - if ((col & 0xFF000000) == 0) - return; - - // Handle non-rounded cases. - flags = FixRectCornerFlags(flags); - if (rounding < 0.5f || (flags & ImDrawFlags.RoundCornersMask) == ImDrawFlags.RoundCornersNone) - { - drawListPtr.AddImage(userTextureId, xy0, xy1, uv0, uv1, col); - return; - } - - // Temporary provide the requested image as the common texture ID, so that the underlying - // ImDrawList::AddConvexPolyFilled does not create a separate draw command and then revert back. - // ImDrawList::AddImageRounded will temporarily push the texture ID provided by the user if the latest draw - // command does not point to the texture we're trying to draw. Once pushed, ImDrawList::AddConvexPolyFilled - // will leave the list of draw commands alone, so that ImGui::ShadeVertsLinearUV can safely work on the latest - // draw command. - ref var texIdCommon = ref *(nint*)(drawListPtr._Data + CImGuiImDrawListSharedDataTexIdCommonOffset); - var texIdCommonPrev = texIdCommon; - texIdCommon = userTextureId; - - this.hookImDrawListAddImageRounded.Original( - drawListPtr, - texIdCommon, - ref xy0, - ref xy1, - ref uv0, - ref uv1, - col, - rounding, - flags); - - texIdCommon = texIdCommonPrev; - } -} diff --git a/lib/cimgui b/lib/cimgui index 7b4955bbd..a302ebabc 160000 --- a/lib/cimgui +++ b/lib/cimgui @@ -1 +1 @@ -Subproject commit 7b4955bbd8f7bc6c022d39503dc806fa53a6a590 +Subproject commit a302ebabcca49c2e37711ea14a0b0915d38253b0 From 2d4e4122aa77ae9e35e6cd20b8b2f37424034f6e Mon Sep 17 00:00:00 2001 From: goat Date: Tue, 24 Dec 2024 03:57:28 +0100 Subject: [PATCH 10/11] link with static CRT --- external/cimgui/cimgui.vcxproj | 1 + external/cimguizmo/cimguizmo.vcxproj | 1 + external/cimplot/cimplot.vcxproj | 1 + 3 files changed, 3 insertions(+) diff --git a/external/cimgui/cimgui.vcxproj b/external/cimgui/cimgui.vcxproj index c6109a131..9af4ce88d 100644 --- a/external/cimgui/cimgui.vcxproj +++ b/external/cimgui/cimgui.vcxproj @@ -63,6 +63,7 @@ ..\..\lib\cimgui\imgui;%(AdditionalIncludeDirectories) NotUsing + MultiThreaded diff --git a/external/cimguizmo/cimguizmo.vcxproj b/external/cimguizmo/cimguizmo.vcxproj index 56c085da3..6ff40ed36 100644 --- a/external/cimguizmo/cimguizmo.vcxproj +++ b/external/cimguizmo/cimguizmo.vcxproj @@ -67,6 +67,7 @@ ..\..\lib\cimgui\imgui;..\..\lib\cimguizmo\ImGuizmo;..\..\lib\cimgui;%(AdditionalIncludeDirectories) NotUsing + MultiThreaded diff --git a/external/cimplot/cimplot.vcxproj b/external/cimplot/cimplot.vcxproj index 44bcf95bb..3444ebd31 100644 --- a/external/cimplot/cimplot.vcxproj +++ b/external/cimplot/cimplot.vcxproj @@ -65,6 +65,7 @@ ..\..\lib\cimgui\imgui;..\..\lib\cimplot\implot;..\..\lib\cimgui;%(AdditionalIncludeDirectories) NotUsing + MultiThreaded From 8773d3b873a5eef9458d65c5bb78c4b90882d7d5 Mon Sep 17 00:00:00 2001 From: goat Date: Tue, 24 Dec 2024 16:00:09 +0100 Subject: [PATCH 11/11] fix debug build --- external/cimgui/cimgui.vcxproj | 3 ++- external/cimguizmo/cimguizmo.vcxproj | 3 ++- external/cimplot/cimplot.vcxproj | 3 ++- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/external/cimgui/cimgui.vcxproj b/external/cimgui/cimgui.vcxproj index 9af4ce88d..c8a4294dc 100644 --- a/external/cimgui/cimgui.vcxproj +++ b/external/cimgui/cimgui.vcxproj @@ -63,7 +63,6 @@ ..\..\lib\cimgui\imgui;%(AdditionalIncludeDirectories) NotUsing - MultiThreaded @@ -73,6 +72,7 @@ true _DEBUG;CIMGUI_EXPORTS;_WINDOWS;_USRDLL;IMGUI_DISABLE_OBSOLETE_FUNCTIONS=1;%(PreprocessorDefinitions) true + MultiThreadedDebug Windows @@ -88,6 +88,7 @@ true NDEBUG;CIMGUI_EXPORTS;_WINDOWS;_USRDLL;IMGUI_DISABLE_OBSOLETE_FUNCTIONS=1;%(PreprocessorDefinitions) true + MultiThreaded Windows diff --git a/external/cimguizmo/cimguizmo.vcxproj b/external/cimguizmo/cimguizmo.vcxproj index 6ff40ed36..48b432327 100644 --- a/external/cimguizmo/cimguizmo.vcxproj +++ b/external/cimguizmo/cimguizmo.vcxproj @@ -67,7 +67,6 @@ ..\..\lib\cimgui\imgui;..\..\lib\cimguizmo\ImGuizmo;..\..\lib\cimgui;%(AdditionalIncludeDirectories) NotUsing - MultiThreaded @@ -77,6 +76,7 @@ true _DEBUG;CIMGUIZMO_EXPORTS;_WINDOWS;_USRDLL;%(PreprocessorDefinitions) true + MultiThreadedDebug Windows @@ -92,6 +92,7 @@ true NDEBUG;CIMGUIZMO_EXPORTS;_WINDOWS;_USRDLL;%(PreprocessorDefinitions) true + MultiThreaded Windows diff --git a/external/cimplot/cimplot.vcxproj b/external/cimplot/cimplot.vcxproj index 3444ebd31..c7ae46a6b 100644 --- a/external/cimplot/cimplot.vcxproj +++ b/external/cimplot/cimplot.vcxproj @@ -65,7 +65,6 @@ ..\..\lib\cimgui\imgui;..\..\lib\cimplot\implot;..\..\lib\cimgui;%(AdditionalIncludeDirectories) NotUsing - MultiThreaded @@ -75,6 +74,7 @@ true _DEBUG;CIMPLOT_EXPORTS;_WINDOWS;_USRDLL;%(PreprocessorDefinitions) true + MultiThreadedDebug Windows @@ -90,6 +90,7 @@ true NDEBUG;CIMPLOT_EXPORTS;_WINDOWS;_USRDLL;%(PreprocessorDefinitions) true + MultiThreaded Windows