From fd76f437b39a337879c7fdcfd6a7570002bc5a80 Mon Sep 17 00:00:00 2001 From: Connor McLaughlin Date: Sat, 26 Mar 2022 23:09:28 +1000 Subject: [PATCH] Core: Purge WITH_IMGUI define --- src/core/CMakeLists.txt | 1 - src/core/cdrom.cpp | 6 +----- src/core/core.props | 3 +-- src/core/dma.cpp | 6 +----- src/core/gpu.cpp | 6 +----- src/core/gpu_hw.cpp | 6 +----- src/core/host_display.h | 2 -- src/core/mdec.cpp | 6 +----- src/core/spu.cpp | 6 +----- src/core/timers.cpp | 6 +----- 10 files changed, 8 insertions(+), 40 deletions(-) diff --git a/src/core/CMakeLists.txt b/src/core/CMakeLists.txt index b9a0e04fcb..0ed5647aa4 100644 --- a/src/core/CMakeLists.txt +++ b/src/core/CMakeLists.txt @@ -118,7 +118,6 @@ target_include_directories(core PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}/..") target_include_directories(core PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}/..") target_link_libraries(core PUBLIC Threads::Threads common zlib vulkan-loader) target_link_libraries(core PRIVATE glad stb xxhash imgui) -target_compile_definitions(core PUBLIC "-DWITH_IMGUI=1") if(WIN32) target_sources(core PRIVATE diff --git a/src/core/cdrom.cpp b/src/core/cdrom.cpp index 90bdead6ed..ac25062525 100644 --- a/src/core/cdrom.cpp +++ b/src/core/cdrom.cpp @@ -5,14 +5,12 @@ #include "common/platform.h" #include "common/state_wrapper.h" #include "dma.h" +#include "imgui.h" #include "interrupt_controller.h" #include "settings.h" #include "spu.h" #include "system.h" #include -#ifdef WITH_IMGUI -#include "imgui.h" -#endif Log_SetChannel(CDROM); #if defined(CPU_X64) @@ -2722,7 +2720,6 @@ void CDROM::ClearSectorBuffers() void CDROM::DrawDebugWindow() { -#ifdef WITH_IMGUI static const ImVec4 active_color{1.0f, 1.0f, 1.0f, 1.0f}; static const ImVec4 inactive_color{0.4f, 0.4f, 0.4f, 1.0f}; const float framebuffer_scale = ImGui::GetIO().DisplayFramebufferScale.x; @@ -2919,5 +2916,4 @@ void CDROM::DrawDebugWindow() } ImGui::End(); -#endif } diff --git a/src/core/core.props b/src/core/core.props index fc0f99b71c..8ea6c12a33 100644 --- a/src/core/core.props +++ b/src/core/core.props @@ -4,7 +4,6 @@ - WITH_IMGUI=1;%(PreprocessorDefinitions) WITH_RECOMPILER=1;%(PreprocessorDefinitions) WITH_MMAP_FASTMEM=1;%(PreprocessorDefinitions) @@ -21,4 +20,4 @@ $(RootBuildDir)vixl\vixl.lib;%(AdditionalDependencies) - \ No newline at end of file + diff --git a/src/core/dma.cpp b/src/core/dma.cpp index 7aa1cd9105..c43966a95b 100644 --- a/src/core/dma.cpp +++ b/src/core/dma.cpp @@ -7,14 +7,12 @@ #include "cpu_code_cache.h" #include "cpu_core.h" #include "gpu.h" +#include "imgui.h" #include "interrupt_controller.h" #include "mdec.h" #include "pad.h" #include "spu.h" #include "system.h" -#ifdef WITH_IMGUI -#include "imgui.h" -#endif Log_SetChannel(DMA); static u32 GetAddressMask() @@ -621,7 +619,6 @@ TickCount DMA::TransferDeviceToMemory(Channel channel, u32 address, u32 incremen void DMA::DrawDebugStateWindow() { -#ifdef WITH_IMGUI static constexpr u32 NUM_COLUMNS = 10; static constexpr std::array column_names = { {"#", "Req", "Direction", "Chopping", "Mode", "Busy", "Enable", "Priority", "IRQ", "Flag"}}; @@ -697,5 +694,4 @@ void DMA::DrawDebugStateWindow() ImGui::Columns(1); ImGui::End(); -#endif } diff --git a/src/core/gpu.cpp b/src/core/gpu.cpp index 2fd7974563..a99d076a76 100644 --- a/src/core/gpu.cpp +++ b/src/core/gpu.cpp @@ -7,15 +7,13 @@ #include "dma.h" #include "host_display.h" #include "host_interface.h" +#include "imgui.h" #include "interrupt_controller.h" #include "settings.h" #include "stb_image_write.h" #include "system.h" #include "timers.h" #include -#ifdef WITH_IMGUI -#include "imgui.h" -#endif Log_SetChannel(GPU); std::unique_ptr g_gpu; @@ -1553,7 +1551,6 @@ bool GPU::DumpVRAMToFile(const char* filename, u32 width, u32 height, u32 stride void GPU::DrawDebugStateWindow() { -#ifdef WITH_IMGUI const float framebuffer_scale = ImGui::GetIO().DisplayFramebufferScale.x; ImGui::SetNextWindowSize(ImVec2(450.0f * framebuffer_scale, 550.0f * framebuffer_scale), ImGuiCond_FirstUseEver); @@ -1671,7 +1668,6 @@ void GPU::DrawDebugStateWindow() } ImGui::End(); -#endif } void GPU::DrawRendererStats(bool is_idle_frame) {} diff --git a/src/core/gpu_hw.cpp b/src/core/gpu_hw.cpp index ddb8fa89d8..423af4245f 100644 --- a/src/core/gpu_hw.cpp +++ b/src/core/gpu_hw.cpp @@ -5,15 +5,13 @@ #include "common/state_wrapper.h" #include "cpu_core.h" #include "gpu_sw_backend.h" +#include "imgui.h" #include "pgxp.h" #include "settings.h" #include "system.h" #include #include #include -#ifdef WITH_IMGUI -#include "imgui.h" -#endif Log_SetChannel(GPU_HW); template @@ -1403,7 +1401,6 @@ void GPU_HW::DrawRendererStats(bool is_idle_frame) m_renderer_stats = {}; } -#ifdef WITH_IMGUI if (ImGui::CollapsingHeader("Renderer Statistics", ImGuiTreeNodeFlags_DefaultOpen)) { static const ImVec4 active_color{1.0f, 1.0f, 1.0f, 1.0f}; @@ -1472,7 +1469,6 @@ void GPU_HW::DrawRendererStats(bool is_idle_frame) ImGui::Columns(1); } -#endif } GPU_HW::ShaderCompileProgressTracker::ShaderCompileProgressTracker(std::string title, u32 total) diff --git a/src/core/host_display.h b/src/core/host_display.h index ea01f846d1..17dac6a809 100644 --- a/src/core/host_display.h +++ b/src/core/host_display.h @@ -123,12 +123,10 @@ class HostDisplay virtual void SetVSync(bool enabled) = 0; -#ifdef WITH_IMGUI /// ImGui context management, usually called by derived classes. virtual bool CreateImGuiContext() = 0; virtual void DestroyImGuiContext() = 0; virtual bool UpdateImGuiFontTexture() = 0; -#endif const void* GetDisplayTextureHandle() const { return m_display_texture_handle; } const s32 GetDisplayTopMargin() const { return m_display_top_margin; } diff --git a/src/core/mdec.cpp b/src/core/mdec.cpp index 6b31171c00..3bbb507260 100644 --- a/src/core/mdec.cpp +++ b/src/core/mdec.cpp @@ -3,11 +3,9 @@ #include "common/state_wrapper.h" #include "cpu_core.h" #include "dma.h" +#include "imgui.h" #include "interrupt_controller.h" #include "system.h" -#ifdef WITH_IMGUI -#include "imgui.h" -#endif Log_SetChannel(MDEC); MDEC g_mdec; @@ -724,7 +722,6 @@ void MDEC::HandleSetScaleCommand() void MDEC::DrawDebugStateWindow() { -#ifdef WITH_IMGUI const float framebuffer_scale = ImGui::GetIO().DisplayFramebufferScale.x; ImGui::SetNextWindowSize(ImVec2(300.0f * framebuffer_scale, 350.0f * framebuffer_scale), ImGuiCond_FirstUseEver); @@ -762,5 +759,4 @@ void MDEC::DrawDebugStateWindow() } ImGui::End(); -#endif } diff --git a/src/core/spu.cpp b/src/core/spu.cpp index e1413fd0a0..aab05bc533 100644 --- a/src/core/spu.cpp +++ b/src/core/spu.cpp @@ -7,11 +7,9 @@ #include "common/wav_writer.h" #include "dma.h" #include "host_interface.h" +#include "imgui.h" #include "interrupt_controller.h" #include "system.h" -#ifdef WITH_IMGUI -#include "imgui.h" -#endif Log_SetChannel(SPU); SPU g_spu; @@ -1921,7 +1919,6 @@ void SPU::UpdateEventInterval() void SPU::DrawDebugStateWindow() { -#ifdef WITH_IMGUI static const ImVec4 active_color{1.0f, 1.0f, 1.0f, 1.0f}; static const ImVec4 inactive_color{0.4f, 0.4f, 0.4f, 1.0f}; const float framebuffer_scale = ImGui::GetIO().DisplayFramebufferScale.x; @@ -2102,5 +2099,4 @@ void SPU::DrawDebugStateWindow() } ImGui::End(); -#endif } diff --git a/src/core/timers.cpp b/src/core/timers.cpp index 9ebc2f1b25..6c86caea33 100644 --- a/src/core/timers.cpp +++ b/src/core/timers.cpp @@ -2,11 +2,9 @@ #include "common/log.h" #include "common/state_wrapper.h" #include "gpu.h" +#include "imgui.h" #include "interrupt_controller.h" #include "system.h" -#ifdef WITH_IMGUI -#include "imgui.h" -#endif Log_SetChannel(Timers); Timers g_timers; @@ -394,7 +392,6 @@ void Timers::UpdateSysClkEvent() void Timers::DrawDebugStateWindow() { -#ifdef WITH_IMGUI static constexpr u32 NUM_COLUMNS = 10; static constexpr std::array column_names = { {"#", "Value", "Target", "Sync", "Reset", "IRQ", "IRQRepeat", "IRQToggle", "Clock Source", "Reached"}}; @@ -463,5 +460,4 @@ void Timers::DrawDebugStateWindow() ImGui::Columns(1); ImGui::End(); -#endif }