isle-portable/LEGO1/omni/include/mxtimer.h
jonschz 0d385e27d0
Implement/match LegoRaceCar::VTable0x94 (#1068)
* Implement LegoRaceCar::VTable0x94

* Remove redundant inline modifiers

* Fix offsets

* Fix minor inconsistency

* Address review comments

* Address review comments, round 2

---------

Co-authored-by: jonschz <jonschz@users.noreply.github.com>
2024-07-26 10:53:09 -07:00

40 lines
743 B
C++

#ifndef MXTIMER_H
#define MXTIMER_H
#include "mxcore.h"
// VTABLE: LEGO1 0x100dc0e0
// SIZE 0x10
class MxTimer : public MxCore {
public:
MxTimer();
void Start();
void Stop();
MxLong GetRealTime();
// FUNCTION: BETA10 0x10017810
MxLong GetTime()
{
// Note that the BETA10 implementation differs - it only consists of the second branch of this `if` call
if (this->m_isRunning) {
return g_lastTimeTimerStarted;
}
else {
return g_lastTimeCalculated - this->m_startTime;
}
}
// SYNTHETIC: LEGO1 0x100ae0d0
// MxTimer::`scalar deleting destructor'
private:
MxLong m_startTime; // 0x08
MxBool m_isRunning; // 0x0c
static MxLong g_lastTimeCalculated;
static MxLong g_lastTimeTimerStarted;
};
#endif // MXTIMER_H