mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2026-08-17 07:47:23 -05:00
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.",
|
||||
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;
|
||||
|
||||
@@ -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
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user