2023-04-27 22:19:39 -04:00
|
|
|
#ifndef MXTIMER_H
|
|
|
|
#define MXTIMER_H
|
|
|
|
|
2023-06-13 20:22:42 -04:00
|
|
|
#include "mxcore.h"
|
|
|
|
|
2023-12-06 07:10:45 -05:00
|
|
|
// VTABLE: LEGO1 0x100dc0e0
|
2023-06-29 04:10:08 -04:00
|
|
|
// SIZE 0x10
|
2023-10-24 19:38:27 -04:00
|
|
|
class MxTimer : public MxCore {
|
2023-04-27 22:19:39 -04:00
|
|
|
public:
|
2023-10-24 19:38:27 -04:00
|
|
|
MxTimer();
|
2023-06-13 20:22:42 -04:00
|
|
|
|
2023-10-24 19:38:27 -04:00
|
|
|
void Start();
|
|
|
|
void Stop();
|
2023-06-13 20:22:42 -04:00
|
|
|
|
2024-01-24 21:16:29 -05:00
|
|
|
MxLong GetRealTime();
|
2023-06-13 20:22:42 -04:00
|
|
|
|
2023-10-24 19:38:27 -04:00
|
|
|
inline MxLong GetTime()
|
|
|
|
{
|
2024-02-01 15:42:10 -05:00
|
|
|
if (this->m_isRunning) {
|
2023-12-13 05:48:14 -05:00
|
|
|
return g_lastTimeTimerStarted;
|
2024-02-01 15:42:10 -05:00
|
|
|
}
|
|
|
|
else {
|
2023-12-13 05:48:14 -05:00
|
|
|
return g_lastTimeCalculated - this->m_startTime;
|
2024-02-01 15:42:10 -05:00
|
|
|
}
|
2023-10-24 19:38:27 -04:00
|
|
|
}
|
2023-06-13 20:22:42 -04:00
|
|
|
|
2024-01-18 08:34:14 -05:00
|
|
|
// SYNTHETIC: LEGO1 0x100ae0d0
|
|
|
|
// MxTimer::`scalar deleting destructor'
|
|
|
|
|
2023-06-13 20:22:42 -04:00
|
|
|
private:
|
2024-02-27 11:49:31 -05:00
|
|
|
MxLong m_startTime; // 0x08
|
|
|
|
MxBool m_isRunning; // 0x0c
|
|
|
|
|
2023-12-13 05:48:14 -05:00
|
|
|
static MxLong g_lastTimeCalculated;
|
|
|
|
static MxLong g_lastTimeTimerStarted;
|
2023-04-27 22:19:39 -04:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif // MXTIMER_H
|