diff --git a/CMakeLists.txt b/CMakeLists.txt index 27e3fad7c..dfc6528df 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -310,8 +310,6 @@ set(COMMON src/common/logging/backend.cpp src/common/enum.h src/common/io_file.cpp src/common/io_file.h - src/qt_gui/memory_patcher.cpp - src/qt_gui/memory_patcher.h src/common/error.cpp src/common/error.h src/common/scope_exit.h @@ -567,6 +565,8 @@ set(QT_GUI src/qt_gui/about_dialog.cpp src/qt_gui/about_dialog.ui src/qt_gui/cheats_patches.cpp src/qt_gui/cheats_patches.h + src/qt_gui/memory_patcher.cpp + src/qt_gui/memory_patcher.h src/qt_gui/main_window_ui.h src/qt_gui/main_window.cpp src/qt_gui/main_window.h diff --git a/src/qt_gui/memory_patcher.cpp b/src/qt_gui/memory_patcher.cpp index b77bfa0b7..d5ffa1c99 100644 --- a/src/qt_gui/memory_patcher.cpp +++ b/src/qt_gui/memory_patcher.cpp @@ -1,7 +1,6 @@ // SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later -#ifdef ENABLE_QT_GUI #include #include #include @@ -144,12 +143,11 @@ void OnGameLoaded() { bool insideMetadata = false; bool isEnabled = false; - + std::string currentPatchName; while (!xmlReader.atEnd()) { xmlReader.readNext(); if (xmlReader.isStartElement()) { - std::string currentPatchName; QJsonArray patchLines; if (xmlReader.name() == QStringLiteral("Metadata")) { insideMetadata = true; @@ -297,8 +295,8 @@ void PatchMemory(std::string modNameStr, std::string offsetStr, std::string valu std::memcpy(cheatAddress, bytePatch.data(), bytePatch.size()); - LOG_INFO(Loader, "Applied patch:{}, Offset:{}, Value:{}", modNameStr, (uintptr_t)cheatAddress, - valueStr); + LOG_INFO(Loader, "Applied patch: {}, Offset: {}, Value: {}", modNameStr, + (uintptr_t)cheatAddress, valueStr); } static std::vector PatternToByte(const std::string& pattern) { @@ -346,6 +344,4 @@ uintptr_t PatternScan(const std::string& signature) { return 0; } -} // namespace MemoryPatcher - -#endif \ No newline at end of file +} // namespace MemoryPatcher \ No newline at end of file diff --git a/src/qt_gui/memory_patcher.h b/src/qt_gui/memory_patcher.h index e61a8a921..821184ade 100644 --- a/src/qt_gui/memory_patcher.h +++ b/src/qt_gui/memory_patcher.h @@ -5,9 +5,7 @@ #include #include #include -#ifdef ENABLE_QT_GUI #include -#endif namespace MemoryPatcher { @@ -34,9 +32,7 @@ struct patchInfo { extern std::vector pending_patches; -#ifdef ENABLE_QT_GUI QString convertValueToHex(const QString& type, const QString& valueStr); -#endif void OnGameLoaded(); void AddPatchToQueue(patchInfo patchToAdd);