diff options
Diffstat (limited to 'engines/illusions/time.cpp')
-rw-r--r-- | engines/illusions/time.cpp | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/engines/illusions/time.cpp b/engines/illusions/time.cpp index f190035b10..34ceaf4b37 100644 --- a/engines/illusions/time.cpp +++ b/engines/illusions/time.cpp @@ -26,7 +26,7 @@ namespace Illusions { uint32 getCurrentTime() { - return g_system->getMillis() / 60; + return g_system->getMillis() / 16; } bool isTimerExpired(uint32 startTime, uint32 endTime) { @@ -36,4 +36,15 @@ bool isTimerExpired(uint32 startTime, uint32 endTime) { (startTime < endTime && currTime <= endTime && currTime >= startTime)); } +uint32 getDurationElapsed(uint32 startTime, uint32 endTime) { + uint32 currTime = getCurrentTime(); + uint32 elapsed = endTime - startTime; + if (isTimerExpired(startTime, endTime)) + return elapsed; + else if (startTime < endTime || currTime > startTime) + return currTime - startTime; + else + return currTime + elapsed - endTime; +} + } // End of namespace Illusions |