mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-22 22:00:39 -06:00
Core: Change CoreTiming event key from int to EventType*
Replace 'int' keys with something that carries type information. Performance is neutral.
This commit is contained in:
@ -43,9 +43,11 @@ u64 GetIdleTicks();
|
||||
|
||||
void DoState(PointerWrap& p);
|
||||
|
||||
struct EventType;
|
||||
|
||||
// Returns the event_type identifier. if name is not unique, an existing event_type will be
|
||||
// discarded.
|
||||
int RegisterEvent(const std::string& name, TimedCallback callback);
|
||||
EventType* RegisterEvent(const std::string& name, TimedCallback callback);
|
||||
void UnregisterAllEvents();
|
||||
|
||||
enum class FromThread
|
||||
@ -58,12 +60,12 @@ enum class FromThread
|
||||
};
|
||||
|
||||
// userdata MAY NOT CONTAIN POINTERS. userdata might get written and reloaded from savestates.
|
||||
void ScheduleEvent(s64 cycles_into_future, int event_type, u64 userdata = 0,
|
||||
void ScheduleEvent(s64 cycles_into_future, EventType* event_type, u64 userdata = 0,
|
||||
FromThread from = FromThread::CPU);
|
||||
|
||||
// We only permit one event of each type in the queue at a time.
|
||||
void RemoveEvent(int event_type);
|
||||
void RemoveAllEvents(int event_type);
|
||||
void RemoveEvent(EventType* event_type);
|
||||
void RemoveAllEvents(EventType* event_type);
|
||||
void Advance();
|
||||
void MoveEvents();
|
||||
|
||||
|
Reference in New Issue
Block a user