CoreTiming: Change TimedCallback to a Common::MoveOnlyFunction.
This commit is contained in:
@@ -70,7 +70,7 @@ EventType* CoreTimingManager::RegisterEvent(const std::string& name, TimedCallba
|
|||||||
"during Init to avoid breaking save states.",
|
"during Init to avoid breaking save states.",
|
||||||
name);
|
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;
|
EventType* event_type = &info.first->second;
|
||||||
event_type->name = &info.first->first;
|
event_type->name = &info.first->first;
|
||||||
return event_type;
|
return event_type;
|
||||||
|
|||||||
@@ -23,6 +23,7 @@
|
|||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
#include "Common/CommonTypes.h"
|
#include "Common/CommonTypes.h"
|
||||||
|
#include "Common/Functional.h"
|
||||||
#include "Common/HookableEvent.h"
|
#include "Common/HookableEvent.h"
|
||||||
#include "Common/SPSCQueue.h"
|
#include "Common/SPSCQueue.h"
|
||||||
#include "Common/Timer.h"
|
#include "Common/Timer.h"
|
||||||
@@ -47,7 +48,8 @@ struct Globals
|
|||||||
float last_OC_factor_inverted = 0.0f;
|
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
|
struct EventType
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user