SpaceCadetPinball/SpaceCadetPinball/timer.h
Muzychenko Andrey c1c74878df Multiball part 1: control and component changes from FT.
The result is 3DPB/FT hybrid, with control closer to 3DPB and components closer to FT.
2022-08-25 17:09:17 +03:00

30 lines
569 B
C++

#pragma once
struct 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 kill(void (*callback)(int, void*));
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;
};