isle/LEGO1/mxtimer.h
Joshua Peisach 33048db81a
Define WIN32_LEAN_AND_MEAN when importing windows.h
This way, when preprocessing, only the relevant windows API structures
will be generated.
2023-09-08 14:18:44 -04:00

38 lines
607 B
C++

#ifndef MXTIMER_H
#define MXTIMER_H
#ifndef WIN32_LEAN_AND_MEAN
#define WIN32_LEAN_AND_MEAN
#endif
#include "mxcore.h"
// VTABLE 0x100dc0e0
// SIZE 0x10
class MxTimer : public MxCore
{
public:
MxTimer();
void Start();
void Stop();
__declspec(dllexport) MxLong GetRealTime();
inline MxLong GetTime()
{
if (this->m_isRunning)
return s_LastTimeTimerStarted;
else
return s_LastTimeCalculated - this->m_startTime;
}
private:
MxLong m_startTime;
MxBool m_isRunning;
static MxLong s_LastTimeCalculated;
static MxLong s_LastTimeTimerStarted;
};
#endif // MXTIMER_H