1
0
Fork 0
mirror of https://github.com/k4zmu2a/SpaceCadetPinball.git synced 2024-11-17 23:20:19 +01:00
SpaceCadetPinball/SpaceCadetPinball/timer.h
2020-12-06 16:21:56 +03:00

28 lines
542 B
C++

#pragma once
struct __declspec(align(4)) timer_struct
{
int TargetTime;
void* Caller;
void (* Callback)(int, void*);
timer_struct* NextTimer;
int TimerId;
};
class timer
{
public:
static int init(int count);
static void uninit();
static int kill(int timerId);
static int set(float time, void* caller, void (* callback)(int, void*));
static int check();
private:
static int SetCount;
static timer_struct* ActiveList;
static int MaxCount;
static int Count;
static timer_struct* FreeList;
static timer_struct* TimerBuffer;
};