Isle
Loading...
Searching...
No Matches
mxtimer.h
Go to the documentation of this file.
1#ifndef MXTIMER_H
2#define MXTIMER_H
3
4#include "mxcore.h"
5
6// VTABLE: LEGO1 0x100dc0e0
7// VTABLE: BETA10 0x101c1bb0
8// SIZE 0x10
9
14class MxTimer : public MxCore {
15public:
20 MxTimer();
21
26 void Start();
27
32 void Stop();
33
39
44 void InitLastTimeCalculated() { g_lastTimeCalculated = m_startTime; }
45
51 {
52 // Note that the BETA10 implementation differs - it only consists of the second branch of this `if` call
53 if (m_isRunning) {
54 return g_lastTimeTimerStarted;
55 }
56 else {
57 return g_lastTimeCalculated - m_startTime;
58 }
59 }
60
61 // SYNTHETIC: LEGO1 0x100ae0d0
62 // SYNTHETIC: BETA10 0x1012bf80
63 // MxTimer::`scalar deleting destructor'
64
65private:
66 MxLong m_startTime;
67 MxBool m_isRunning;
68
69 static MxLong g_lastTimeCalculated;
70 static MxLong g_lastTimeTimerStarted;
71};
72
73// SYNTHETIC: BETA10 0x1012bfc0
74// MxTimer::~MxTimer
75
76#endif // MXTIMER_H
[AI] Base virtual class for all Mindscape engine (Mx) objects.
Definition: mxcore.h:15
Timer class for measuring elapsed time or frame time.
Definition: mxtimer.h:14
void InitLastTimeCalculated()
Initializes the static 'last time calculated' field to the timer's start time.
Definition: mxtimer.h:44
MxTimer()
Constructs and initializes the timer to the current tick count, and resets static globals.
Definition: mxtimer.cpp:14
MxLong GetTime()
Returns the current timer value in ms, depending on running state.
Definition: mxtimer.h:50
MxLong GetRealTime()
Retrieves the elapsed real time (in ms) since timer construction or last reset.
Definition: mxtimer.cpp:23
void Start()
Starts the timer and records the real time when started.
Definition: mxtimer.cpp:30
void Stop()
Stops the timer, updating internal counters to reflect elapsed time until now.
Definition: mxtimer.cpp:37
MxU8 MxBool
[AI]
Definition: mxtypes.h:124
int MxLong
[AI]
Definition: mxtypes.h:83