From 22aa88109f5a5964e1b66d31221647cafab7f0f5 Mon Sep 17 00:00:00 2001 From: JosJuice Date: Tue, 4 Jun 2024 16:20:20 +0200 Subject: Use a stub AchivementManager when USE_RETRO_ACHIEVEMENTS isn't defined This lets us reduce the number of USE_RETRO_ACHIEVEMENTS ifdefs in the code base, reducing visual clutter. In particular, needing an ifdef for each call to IsHardcodeModeActive was annoying to me. This also reduces the risk that someone writes code that accidentally fails to compile with USE_RETRO_ACHIEVEMENTS disabled. We could cut down on ifdefs even further by making HardcodeWarningWidget always exist, but that would result in non-trivial code ending up in the binary even with USE_RETRO_ACHIEVEMENTS disabled, so I'm leaving it out of this PR. It's not a lot of code though, so I might end up revisiting it at some point. --- Source/Core/DiscIO/RiivolutionPatcher.cpp | 2 -- 1 file changed, 2 deletions(-) (limited to 'Source/Core/DiscIO/RiivolutionPatcher.cpp') diff --git a/Source/Core/DiscIO/RiivolutionPatcher.cpp b/Source/Core/DiscIO/RiivolutionPatcher.cpp index 7dc245d27b..8c54968c35 100644 --- a/Source/Core/DiscIO/RiivolutionPatcher.cpp +++ b/Source/Core/DiscIO/RiivolutionPatcher.cpp @@ -524,10 +524,8 @@ static bool MemoryMatchesAt(const Core::CPUThreadGuard& guard, u32 offset, static void ApplyMemoryPatch(const Core::CPUThreadGuard& guard, u32 offset, std::span value, std::span original) { -#ifdef USE_RETRO_ACHIEVEMENTS if (AchievementManager::GetInstance().IsHardcoreModeActive()) return; -#endif // USE_RETRO_ACHIEVEMENTS if (value.empty()) return; -- cgit v1.2.3