mirror of
https://github.com/isledecomp/isle-portable.git
synced 2025-04-24 21:34:35 -04:00
* Use strcasecmp, strncasecmp, strlwr, strupr and itoa from SDL * Use SDL_GetTicks instead of timeGetTime * Use MxDSFile::OPEN_READ instead of OF_READ * Use SDL_IOStream to read bitmaps * Use SDL_LogXXX instead of OutputDebugString * Undo mxvideoparam.h change * Revert "Undo mxvideoparam.h change" This reverts commit4a20cf6c46
. * Fix _MxTrace * Reapply "Undo mxvideoparam.h change" This reverts commitb3a09dc520
. * fix _MxTrace * Use __declspec(dllexport) for exporting symbols from dll Refactored CMake script such that all objects are passed to the lego1 library. * clang-format * fix msvc build * MSVC fixed for real now? * Forgot about d3drm_guid * Fix naming issue * Use Uint64 in LegoCarBuild::Tickle for dTime
51 lines
1,020 B
C++
51 lines
1,020 B
C++
#ifndef MXTIMER_H
|
|
#define MXTIMER_H
|
|
|
|
#include "lego1_export.h"
|
|
#include "mxcore.h"
|
|
|
|
#include <SDL3/SDL_stdinc.h>
|
|
|
|
// VTABLE: LEGO1 0x100dc0e0
|
|
// VTABLE: BETA10 0x101c1bb0
|
|
// SIZE 0x10
|
|
class MxTimer : public MxCore {
|
|
public:
|
|
MxTimer();
|
|
|
|
void Start();
|
|
void Stop();
|
|
|
|
LEGO1_EXPORT MxLong GetRealTime();
|
|
|
|
// FUNCTION: BETA10 0x1012bf50
|
|
void InitLastTimeCalculated() { g_lastTimeCalculated = m_startTime; }
|
|
|
|
// FUNCTION: BETA10 0x10017810
|
|
MxLong GetTime()
|
|
{
|
|
// Note that the BETA10 implementation differs - it only consists of the second branch of this `if` call
|
|
if (m_isRunning) {
|
|
return g_lastTimeTimerStarted;
|
|
}
|
|
else {
|
|
return g_lastTimeCalculated - m_startTime;
|
|
}
|
|
}
|
|
|
|
// SYNTHETIC: LEGO1 0x100ae0d0
|
|
// SYNTHETIC: BETA10 0x1012bf80
|
|
// MxTimer::`scalar deleting destructor'
|
|
|
|
private:
|
|
Uint64 m_startTime; // 0x08
|
|
MxBool m_isRunning; // 0x0c
|
|
|
|
static MxLong g_lastTimeCalculated;
|
|
static MxLong g_lastTimeTimerStarted;
|
|
};
|
|
|
|
// SYNTHETIC: BETA10 0x1012bfc0
|
|
// MxTimer::~MxTimer
|
|
|
|
#endif // MXTIMER_H
|