From 85b4a02f202ad8a75c0e21b6f83f5ea9dde3e717 Mon Sep 17 00:00:00 2001 From: Connor McLaughlin Date: Sun, 31 Jan 2021 17:28:30 +1000 Subject: [PATCH] Fix Android build --- android/app/src/cpp/android_host_interface.cpp | 7 +++++++ android/app/src/cpp/android_host_interface.h | 3 ++- src/CMakeLists.txt | 2 -- src/core/CMakeLists.txt | 1 + src/frontend-common/common_host_interface.h | 2 +- src/frontend-common/imgui_fullscreen.h | 1 + 6 files changed, 12 insertions(+), 4 deletions(-) diff --git a/android/app/src/cpp/android_host_interface.cpp b/android/app/src/cpp/android_host_interface.cpp index 2b952fb52..336cbf5de 100644 --- a/android/app/src/cpp/android_host_interface.cpp +++ b/android/app/src/cpp/android_host_interface.cpp @@ -350,6 +350,13 @@ void AndroidHostInterface::RunOnEmulationThread(std::function function, m_mutex.unlock(); } +void AndroidHostInterface::RunLater(std::function func) +{ + std::unique_lock lock(m_mutex); + m_callback_queue.push_back(std::move(func)); + m_callbacks_outstanding.store(true); +} + void AndroidHostInterface::EmulationThreadEntryPoint(JNIEnv* env, jobject emulation_activity, SystemBootParameters boot_params, bool resume_state) { diff --git a/android/app/src/cpp/android_host_interface.h b/android/app/src/cpp/android_host_interface.h index 038959b81..4bb520772 100644 --- a/android/app/src/cpp/android_host_interface.h +++ b/android/app/src/cpp/android_host_interface.h @@ -31,6 +31,7 @@ public: const char* GetFrontendName() const override; void RequestExit() override; + void RunLater(std::function func) override; void ReportError(const char* message) override; void ReportMessage(const char* message) override; @@ -63,7 +64,7 @@ public: void SetFastForwardEnabled(bool enabled); void RefreshGameList(bool invalidate_cache, bool invalidate_database, ProgressCallback* progress_callback); - void ApplySettings(bool display_osd_messages); + void ApplySettings(bool display_osd_messages) override; bool ImportPatchCodesFromString(const std::string& str); diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index df5b643b0..fa17b5214 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -1,5 +1,3 @@ -add_definitions("-DWITH_IMGUI=1") - add_subdirectory(common) add_subdirectory(core) add_subdirectory(scmversion) diff --git a/src/core/CMakeLists.txt b/src/core/CMakeLists.txt index 59fc21613..a1b5a083a 100644 --- a/src/core/CMakeLists.txt +++ b/src/core/CMakeLists.txt @@ -116,6 +116,7 @@ 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/frontend-common/common_host_interface.h b/src/frontend-common/common_host_interface.h index c950d7eaa..96953fe2e 100644 --- a/src/frontend-common/common_host_interface.h +++ b/src/frontend-common/common_host_interface.h @@ -290,7 +290,7 @@ protected: virtual void UpdateControllerInterface(); virtual void OnSystemCreated() override; - virtual void OnSystemPaused(bool paused); + virtual void OnSystemPaused(bool paused) override; virtual void OnSystemDestroyed() override; virtual void OnRunningGameChanged() override; virtual void OnControllerTypeChanged(u32 slot) override; diff --git a/src/frontend-common/imgui_fullscreen.h b/src/frontend-common/imgui_fullscreen.h index 486e03e03..f26960267 100644 --- a/src/frontend-common/imgui_fullscreen.h +++ b/src/frontend-common/imgui_fullscreen.h @@ -3,6 +3,7 @@ #include "imgui.h" #include #include +#include namespace ImGuiFullscreen { #define HEX_TO_IMVEC4(hex, alpha) \