13 m_frequencyMS = p_frequencyMS;
21 MxS32 lastTickled = -m_frequencyMS;
26 if (currentTime < lastTickled) {
27 lastTickled = -m_frequencyMS;
30 MxS32 timeRemainingMS = (m_frequencyMS - currentTime) + lastTickled;
31 if (timeRemainingMS <= 0) {
34 lastTickled = currentTime;
37 Sleep(timeRemainingMS);
[AI] Base virtual class for all Mindscape engine (Mx) objects.
virtual MxResult Tickle()
[AI] Called by tickle managers to allow the object to update itself.
MxCore * m_target
[AI] Pointer to the target object (optional, typically the object being processed by the thread)....
virtual MxResult Run()
[AI] Virtual function executed when the thread runs.
void Sleep(MxS32 p_milliseconds)
[AI] Sleeps the current thread for the given duration in milliseconds.
MxBool IsRunning()
[AI] Returns whether the thread is currently running.
MxTickleThread periodically calls Tickle() on a target MxCore object in a separate thread.
MxResult Run() override
[AI] Thread entry point.
Timer class for measuring elapsed time or frame time.
MxLong GetTime()
Returns the current timer value in ms, depending on running state.
#define DECOMP_SIZE_ASSERT(T, S)
MxTimer * Timer()
[AI] Returns the global simulation timer.