mirror of
https://github.com/melonDS-emu/melonDS.git
synced 2025-06-28 09:59:41 -06:00
better, less hacky, more OOP-friendly scheduler design
This commit is contained in:
14
src/NDS.h
14
src/NDS.h
@ -20,6 +20,7 @@
|
||||
#define NDS_H
|
||||
|
||||
#include <string>
|
||||
#include <functional>
|
||||
|
||||
#include "Platform.h"
|
||||
#include "Savestate.h"
|
||||
@ -57,12 +58,8 @@ enum
|
||||
Event_MAX
|
||||
};
|
||||
|
||||
struct SchedEvent
|
||||
{
|
||||
void (*Func)(u32 param);
|
||||
u64 Timestamp;
|
||||
u32 Param;
|
||||
};
|
||||
typedef std::function<void(u32)> EventFunc;
|
||||
#define MemberEventFunc(cls,func) std::bind(&cls::func,this,std::placeholders::_1)
|
||||
|
||||
enum
|
||||
{
|
||||
@ -297,8 +294,9 @@ void SetLidClosed(bool closed);
|
||||
void CamInputFrame(int cam, u32* data, int width, int height, bool rgb);
|
||||
void MicInputFrame(s16* data, int samples);
|
||||
|
||||
void ScheduleEvent(u32 id, bool periodic, s32 delay, void (*func)(u32), u32 param);
|
||||
void ScheduleEvent(u32 id, u64 timestamp, void (*func)(u32), u32 param);
|
||||
void RegisterEventFunc(u32 id, u32 funcid, EventFunc func);
|
||||
void UnregisterEventFunc(u32 id, u32 funcid);
|
||||
void ScheduleEvent(u32 id, bool periodic, s32 delay, u32 funcid, u32 param);
|
||||
void CancelEvent(u32 id);
|
||||
|
||||
void debug(u32 p);
|
||||
|
Reference in New Issue
Block a user