mirror of
https://github.com/acemod/ACE3.git
synced 2024-08-30 18:23:18 +00:00
Applied virtual time acceleration to the master ACE_time. Created ACE_tickTime macro, to provide same-frame millisecond resolution.
This commit is contained in:
parent
7fb7b04a85
commit
318b2437f9
@ -316,6 +316,7 @@ if (hasInterface) then {
|
||||
ACE_time = diag_tickTime;
|
||||
ACE_realTime = diag_tickTime;
|
||||
ACE_virtualTime = diag_tickTime;
|
||||
ACE_tickTime = diag_tickTime;
|
||||
ACE_gameTime = time;
|
||||
|
||||
PREP(timePFH);
|
||||
|
@ -7,9 +7,9 @@ _lastRealTime = ACE_realTime;
|
||||
_lastGameTime = ACE_gameTime;
|
||||
|
||||
ACE_gameTime = time;
|
||||
ACE_realTime = diag_tickTime;
|
||||
ACE_tickTime = diag_tickTime;
|
||||
|
||||
_delta = ACE_realTime - _lastRealTime;
|
||||
_delta = ACE_tickTime - _lastRealTime;
|
||||
if(ACE_gameTime <= _lastGameTime) then {
|
||||
ACE_paused = true;
|
||||
// Game is paused or not running
|
||||
@ -18,7 +18,8 @@ if(ACE_gameTime <= _lastGameTime) then {
|
||||
} else {
|
||||
ACE_paused = false;
|
||||
// Time is updating
|
||||
ACE_realTime = ACE_realTime + _delta;
|
||||
ACE_virtualTime = ACE_virtualTime + (_delta * accTime);
|
||||
ACE_time = ACE_time + _delta;
|
||||
ACE_time = ACE_virtualTime;
|
||||
};
|
||||
|
||||
|
@ -82,4 +82,8 @@
|
||||
#define HASHLIST_SET(hashList, index, value) ([hashList, index, value, __FILE__, __LINE__] call EFUNC(common,hashListSet))
|
||||
#define HASHLIST_PUSH(hashList, value) ([hashList, value, __FILE__, __LINE__] call EFUNC(common,hashListPush))
|
||||
|
||||
// Time functions for accuracy per frame
|
||||
#define ACE_tickTime (ACE_tickTime + (diag_tickTime - ACE_tickTime))
|
||||
|
||||
|
||||
#include "script_debug.hpp"
|
Loading…
Reference in New Issue
Block a user