diff --git a/dpdefs/csprogsdefs.qc b/dpdefs/csprogsdefs.qc index b5c057462..2d9177911 100644 --- a/dpdefs/csprogsdefs.qc +++ b/dpdefs/csprogsdefs.qc @@ -1008,10 +1008,10 @@ string(string format, ...) sprintf = #627; //idea: tZork //darkplaces implementation: tZork, divVerent //constant definitions: -float GETTIME_FRAMESTART = 0; // time of start of frame +float GETTIME_FRAMESTART = 0; // time of start of frame relative to an arbitrary point in time (time of worldspawn) float GETTIME_REALTIME = 1; // current time (may be OS specific) -float GETTIME_HIRES = 2; // like REALTIME, but may reset between QC invocations and thus can be higher precision -float GETTIME_UPTIME = 3; // time since start of the engine +float GETTIME_HIRES = 2; // like REALTIME, but relative to time at start of frame (thus can be higher precision) +float GETTIME_UPTIME = 3; // time of start of frame relative to start of the engine //builtin definitions: float(float tmr) gettime = #519; //description: diff --git a/dpdefs/dpextensions.qc b/dpdefs/dpextensions.qc index d72666dcb..084555172 100644 --- a/dpdefs/dpextensions.qc +++ b/dpdefs/dpextensions.qc @@ -896,10 +896,10 @@ vector gettaginfo_up; //idea: tZork //darkplaces implementation: tZork, divVerent //constant definitions: -float GETTIME_FRAMESTART = 0; // time of start of frame relative to an arbitrary point in time +float GETTIME_FRAMESTART = 0; // time of start of frame relative to an arbitrary point in time (time of worldspawn) float GETTIME_REALTIME = 1; // current absolute time (OS specific) -float GETTIME_HIRES = 2; // like REALTIME, but may reset between QC invocations and thus can be higher precision -float GETTIME_UPTIME = 3; // time of start of frame since start of the engine +float GETTIME_HIRES = 2; // like REALTIME, but relative to time at start of frame (thus can be higher precision) +float GETTIME_UPTIME = 3; // time of start of frame relative to start of the engine //builtin definitions: float(float tmr) gettime = #519; //description: diff --git a/prvm_cmds.c b/prvm_cmds.c index 03eb39a8f..e540e8517 100644 --- a/prvm_cmds.c +++ b/prvm_cmds.c @@ -2961,7 +2961,7 @@ void VM_gettime(prvm_prog_t *prog) switch(timer_index) { case 0: // GETTIME_FRAMESTART - PRVM_G_FLOAT(OFS_RETURN) = host.realtime; + PRVM_G_FLOAT(OFS_RETURN) = host.realtime - prog->starttime; break; case 1: // GETTIME_REALTIME PRVM_G_FLOAT(OFS_RETURN) = Sys_DirtyTime();