CoreTiming: Change TimedCallback to a Common::MoveOnlyFunction.

This commit is contained in:
Jordan Woyak
2026-03-26 19:29:25 -05:00
parent d95445727b
commit 670a5df7ce
2 changed files with 4 additions and 2 deletions

View File

@@ -70,7 +70,7 @@ EventType* CoreTimingManager::RegisterEvent(const std::string& name, TimedCallba
"during Init to avoid breaking save states.",
name);
auto info = m_event_types.emplace(name, EventType{callback, nullptr});
auto info = m_event_types.emplace(name, EventType{std::move(callback), nullptr});
EventType* event_type = &info.first->second;
event_type->name = &info.first->first;
return event_type;

View File

@@ -23,6 +23,7 @@
#include <vector>
#include "Common/CommonTypes.h"
#include "Common/Functional.h"
#include "Common/HookableEvent.h"
#include "Common/SPSCQueue.h"
#include "Common/Timer.h"
@@ -47,7 +48,8 @@ struct Globals
float last_OC_factor_inverted = 0.0f;
};
typedef void (*TimedCallback)(Core::System& system, u64 userdata, s64 cyclesLate);
using TimedCallback =
Common::MoveOnlyFunction<void(Core::System& system, u64 userdata, s64 cyclesLate)>;
struct EventType
{