diff options
author | Lioncash <mathew1800@gmail.com> | 2020-07-16 01:14:21 +0200 |
---|---|---|
committer | Lioncash <mathew1800@gmail.com> | 2020-07-16 01:41:22 +0200 |
commit | bef1844a51a37c1c8dc531e67069ef00821ffa9c (patch) | |
tree | 2e46f404c3f0baf1b854e1bea916c19469fe424a /src/core/memory/cheat_engine.cpp | |
parent | core_timing: Make use of std::chrono with ScheduleEvent (diff) | |
download | yuzu-bef1844a51a37c1c8dc531e67069ef00821ffa9c.tar yuzu-bef1844a51a37c1c8dc531e67069ef00821ffa9c.tar.gz yuzu-bef1844a51a37c1c8dc531e67069ef00821ffa9c.tar.bz2 yuzu-bef1844a51a37c1c8dc531e67069ef00821ffa9c.tar.lz yuzu-bef1844a51a37c1c8dc531e67069ef00821ffa9c.tar.xz yuzu-bef1844a51a37c1c8dc531e67069ef00821ffa9c.tar.zst yuzu-bef1844a51a37c1c8dc531e67069ef00821ffa9c.zip |
Diffstat (limited to 'src/core/memory/cheat_engine.cpp')
-rw-r--r-- | src/core/memory/cheat_engine.cpp | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/src/core/memory/cheat_engine.cpp b/src/core/memory/cheat_engine.cpp index 09bf8c5cf..ced41b1fe 100644 --- a/src/core/memory/cheat_engine.cpp +++ b/src/core/memory/cheat_engine.cpp @@ -188,9 +188,11 @@ CheatEngine::~CheatEngine() { } void CheatEngine::Initialize() { - event = Core::Timing::CreateEvent( - "CheatEngine::FrameCallback::" + Common::HexToString(metadata.main_nso_build_id), - [this](u64 userdata, s64 ns_late) { FrameCallback(userdata, ns_late); }); + event = Core::Timing::CreateEvent("CheatEngine::FrameCallback::" + + Common::HexToString(metadata.main_nso_build_id), + [this](u64 userdata, std::chrono::nanoseconds ns_late) { + FrameCallback(userdata, ns_late); + }); core_timing.ScheduleEvent(CHEAT_ENGINE_NS, event); metadata.process_id = system.CurrentProcess()->GetProcessID(); @@ -217,7 +219,7 @@ void CheatEngine::Reload(std::vector<CheatEntry> cheats) { MICROPROFILE_DEFINE(Cheat_Engine, "Add-Ons", "Cheat Engine", MP_RGB(70, 200, 70)); -void CheatEngine::FrameCallback(u64 userdata, s64 ns_late) { +void CheatEngine::FrameCallback(u64, std::chrono::nanoseconds ns_late) { if (is_pending_reload.exchange(false)) { vm.LoadProgram(cheats); } @@ -230,8 +232,7 @@ void CheatEngine::FrameCallback(u64 userdata, s64 ns_late) { vm.Execute(metadata); - const auto future_ns = CHEAT_ENGINE_NS - std::chrono::nanoseconds{ns_late}; - core_timing.ScheduleEvent(future_ns, event); + core_timing.ScheduleEvent(CHEAT_ENGINE_NS - ns_late, event); } } // namespace Core::Memory |