From 023287978fc30c4fe46ab47f7074f49c8506b15c Mon Sep 17 00:00:00 2001 From: pongo1231 Date: Wed, 2 Aug 2023 13:39:09 +0000 Subject: [PATCH] Drop imgui-cmake --- .gitmodules | 8 ++++---- CMakeLists.txt | 18 ++++++++++++++---- ScriptViewer/Components/GlobalView.cpp | 4 ++-- ScriptViewer/stdafx.h | 9 ++++----- vendor/imgui | 2 +- 5 files changed, 25 insertions(+), 16 deletions(-) diff --git a/.gitmodules b/.gitmodules index 6c10aaa..eb30d60 100644 --- a/.gitmodules +++ b/.gitmodules @@ -2,11 +2,11 @@ path = vendor/minhook url = https://github.com/TsudaKageyu/minhook.git ignore = dirty -[submodule "vendor/imgui"] - path = vendor/imgui - url = https://github.com/Pesc0/imgui-cmake.git - ignore = dirty [submodule "vendor/shv"] path = vendor/shv url = https://github.com/pongo1231/shv_no_msvc ignore = dirty +[submodule "vendor/imgui"] + path = vendor/imgui + url = https://github.com/ocornut/imgui + ignore = dirty \ No newline at end of file diff --git a/CMakeLists.txt b/CMakeLists.txt index 1023111..b0d7bfa 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 3.12) project(ScriptViewer) add_subdirectory(vendor/shv) -add_subdirectory(vendor/imgui) +#add_subdirectory(vendor/imgui) add_subdirectory(vendor/minhook) file(GLOB_RECURSE src ScriptViewer/*.cpp) @@ -11,17 +11,27 @@ add_library(ScriptViewer MODULE ${src}) set_property(TARGET ScriptViewer PROPERTY CXX_STANDARD 20) +set(IMGUI_PATH "vendor/imgui") +file(GLOB IMGUI_SOURCES ${IMGUI_PATH}/*.cpp ${IMGUI_PATH}/backends/imgui_impl_dx11.cpp ${IMGUI_PATH}/backends/imgui_impl_win32.cpp) +add_library(ImGui STATIC ${IMGUI_SOURCES}) +target_include_directories(ImGui PUBLIC ${IMGUI_PATH} ${IMGUI_PATH}/backends) + if (RELOADABLE) target_compile_definitions(ScriptViewer PRIVATE RELOADABLE) endif () -target_compile_options(ScriptViewer PRIVATE -municode -fpermissive) +if (CMAKE_CXX_COMPILER_ID MATCHES "MSVC") + target_compile_options(ScriptViewer PRIVATE -DUNICODE -D_UNICODE -DNOMINMAX /Zi) + target_link_options(ScriptViewer PRIVATE /DEBUG /OPT:REF /OPT:ICF) +else() + target_compile_options(ScriptViewer PRIVATE -municode -fpermissive) + target_link_options(ScriptViewer PRIVATE -static) +endif() target_precompile_headers(ScriptViewer PUBLIC ScriptViewer/stdafx.h) target_include_directories(ScriptViewer PUBLIC ScriptViewer) -target_link_libraries(ScriptViewer PRIVATE shv IMGUI minhook d3dcompiler dwmapi) -target_link_options(ScriptViewer PRIVATE -static) +target_link_libraries(ScriptViewer PRIVATE shv minhook d3dcompiler dwmapi ImGui) set_target_properties(ScriptViewer PROPERTIES SUFFIX ".asi") \ No newline at end of file diff --git a/ScriptViewer/Components/GlobalView.cpp b/ScriptViewer/Components/GlobalView.cpp index 0fbd350..be7da91 100644 --- a/ScriptViewer/Components/GlobalView.cpp +++ b/ScriptViewer/Components/GlobalView.cpp @@ -13,7 +13,7 @@ void GlobalView::RunImGui() if (ms_pGlobals && ms_pcwGlobals) { - ImGui::ListBoxHeader(""); + ImGui::BeginListBox(""); for (WORD wGlobalIdx = 0; wGlobalIdx < *ms_pcwGlobals; wGlobalIdx++) { @@ -26,7 +26,7 @@ void GlobalView::RunImGui() } } - ImGui::ListBoxFooter(); + ImGui::EndListBox(); } ImGui::End(); diff --git a/ScriptViewer/stdafx.h b/ScriptViewer/stdafx.h index 03655c4..2101488 100644 --- a/ScriptViewer/stdafx.h +++ b/ScriptViewer/stdafx.h @@ -29,11 +29,10 @@ typedef unsigned int DWORD_t; #include "../vendor/minhook/include/MinHook.h" -#include "../vendor/imgui/libs/imgui/backends/imgui_impl_dx11.h" -#include "../vendor/imgui/libs/imgui/backends/imgui_impl_win32.h" -#include "../vendor/imgui/libs/imgui/imgui.h" -#include "../vendor/imgui/libs/imgui/imgui_internal.h" -#include +#include "../vendor/imgui/backends/imgui_impl_dx11.h" +#include "../vendor/imgui/backends/imgui_impl_win32.h" +#include "../vendor/imgui/imgui.h" +#include "../vendor/imgui/imgui_internal.h" #define WIN32_LEAN_AND_MEAN #include diff --git a/vendor/imgui b/vendor/imgui index a855101..f7eea63 160000 --- a/vendor/imgui +++ b/vendor/imgui @@ -1 +1 @@ -Subproject commit a855101d72bdea139666cb41ac0c4be00e280ee2 +Subproject commit f7eea6387202f1174fdb7072311156d667a6826c