From 52cc7c59964c72240874dc5e9c9178523df81404 Mon Sep 17 00:00:00 2001 From: Exzap <13877693+Exzap@users.noreply.github.com> Date: Tue, 11 Oct 2022 01:43:15 +0200 Subject: [PATCH] Follow imgui recommendation and streamline build dependencies (#355) --- .gitmodules | 3 +++ CMakeLists.txt | 1 - dependencies/imgui | 1 + src/Cafe/CMakeLists.txt | 1 - .../HW/Latte/Renderer/Vulkan/RendererShaderVk.cpp | 14 -------------- src/imgui/CMakeLists.txt | 11 ++++++++++- src/imgui/imgui_extension.cpp | 4 ++-- vcpkg.json | 1 - 8 files changed, 16 insertions(+), 20 deletions(-) create mode 160000 dependencies/imgui diff --git a/.gitmodules b/.gitmodules index dd32088b..f352d478 100644 --- a/.gitmodules +++ b/.gitmodules @@ -13,3 +13,6 @@ [submodule "dependencies/Vulkan-Headers"] path = dependencies/Vulkan-Headers url = https://github.com/KhronosGroup/Vulkan-Headers +[submodule "dependencies/imgui"] + path = dependencies/imgui + url = https://github.com/ocornut/imgui diff --git a/CMakeLists.txt b/CMakeLists.txt index e5ddc6fd..76dcd33a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -83,7 +83,6 @@ find_package(Threads REQUIRED) find_package(SDL2 REQUIRED) find_package(CURL REQUIRED) find_package(pugixml REQUIRED) -find_package(imgui REQUIRED) find_package(RapidJSON REQUIRED) find_package(Boost COMPONENTS program_options filesystem nowide REQUIRED) find_package(libzip REQUIRED) diff --git a/dependencies/imgui b/dependencies/imgui new file mode 160000 index 00000000..8a44c31c --- /dev/null +++ b/dependencies/imgui @@ -0,0 +1 @@ +Subproject commit 8a44c31c95c8e0217f6e1fc814cbbbcca4981f14 diff --git a/src/Cafe/CMakeLists.txt b/src/Cafe/CMakeLists.txt index 6657bc9c..c4f9ce30 100644 --- a/src/Cafe/CMakeLists.txt +++ b/src/Cafe/CMakeLists.txt @@ -491,7 +491,6 @@ target_link_libraries(CemuCafe PRIVATE fmt::fmt glslang::SPIRV ih264d - imgui::imgui OpenSSL::Crypto OpenSSL::SSL PNG::PNG diff --git a/src/Cafe/HW/Latte/Renderer/Vulkan/RendererShaderVk.cpp b/src/Cafe/HW/Latte/Renderer/Vulkan/RendererShaderVk.cpp index 7af5204b..e6677576 100644 --- a/src/Cafe/HW/Latte/Renderer/Vulkan/RendererShaderVk.cpp +++ b/src/Cafe/HW/Latte/Renderer/Vulkan/RendererShaderVk.cpp @@ -1,25 +1,11 @@ #include "Cafe/HW/Latte/Renderer/Vulkan/RendererShaderVk.h" -#if __has_include() -#include -#else -#define GLSLANG_VERSION_LESS_OR_EQUAL_TO (false) -#endif - #include -#if GLSLANG_VERSION_LESS_OR_EQUAL_TO(11, 0, 0) #include -#else -#include -#include -#endif - #include "Cafe/HW/Latte/Renderer/Vulkan/VulkanAPI.h" #include "Cafe/HW/Latte/Renderer/Vulkan/VulkanRenderer.h" -#include - #include "config/ActiveSettings.h" #include "config/CemuConfig.h" #include "util/helpers/ConcurrentQueue.h" diff --git a/src/imgui/CMakeLists.txt b/src/imgui/CMakeLists.txt index 97b56455..db7686bd 100644 --- a/src/imgui/CMakeLists.txt +++ b/src/imgui/CMakeLists.txt @@ -11,6 +11,16 @@ set_property(TARGET imguiImpl PROPERTY MSVC_RUNTIME_LIBRARY "MultiThreaded$<$second; - ImGuiKey mapped_key = current_key + ImGuiKey_NamedKey_BEGIN; - current_key = (current_key + 1) % ImGuiKey_NamedKey_COUNT ; + ImGuiKey mapped_key = (ImGuiKey)((uint32)current_key + ImGuiKey_NamedKey_BEGIN); + current_key = (current_key + 1) % (uint32)ImGuiKey_NamedKey_COUNT; keyboard_mapping[key_code] = mapped_key; return mapped_key; }; diff --git a/vcpkg.json b/vcpkg.json index 519a5618..33587607 100644 --- a/vcpkg.json +++ b/vcpkg.json @@ -3,7 +3,6 @@ "version-string": "1.0", "builtin-baseline": "1b0252ca70ca2244a711535462c7f981eb439e83", "dependencies": [ - "imgui", "pugixml", "zlib", "libpng",