Isle
Loading...
Searching...
No Matches
mxtimer.cpp
Go to the documentation of this file.
1#include "mxtimer.h"
2
3#include <windows.h>
4
5// GLOBAL: LEGO1 0x10101414
6// GLOBAL: BETA10 0x10201f84
7MxLong MxTimer::g_lastTimeCalculated = 0;
8
9// GLOBAL: LEGO1 0x10101418
10MxLong MxTimer::g_lastTimeTimerStarted = 0;
11
12// FUNCTION: LEGO1 0x100ae060
13// FUNCTION: BETA10 0x1012bea0
15{
16 m_isRunning = FALSE;
17 m_startTime = timeGetTime();
19}
20
21// FUNCTION: LEGO1 0x100ae140
22// FUNCTION: BETA10 0x1012bf23
24{
25 MxTimer::g_lastTimeCalculated = timeGetTime();
26 return MxTimer::g_lastTimeCalculated - m_startTime;
27}
28
29// FUNCTION: LEGO1 0x100ae160
31{
32 g_lastTimeTimerStarted = GetRealTime();
33 m_isRunning = TRUE;
34}
35
36// FUNCTION: LEGO1 0x100ae180
38{
39 MxLong elapsed = GetRealTime();
40 MxLong startTime = elapsed - MxTimer::g_lastTimeTimerStarted;
41 m_isRunning = FALSE;
42 // this feels very stupid but it's what the assembly does
43 m_startTime = m_startTime + startTime - 5;
44}
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 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
#define TRUE
Definition: d3drmdef.h:28
#define FALSE
Definition: d3drmdef.h:27
int MxLong
[AI]
Definition: mxtypes.h:83