diff --git a/Quake/gl_screen.c b/Quake/gl_screen.c index c48e08d7..ce4a6653 100644 --- a/Quake/gl_screen.c +++ b/Quake/gl_screen.c @@ -1162,6 +1162,8 @@ void SCR_UpdateScreen (void) if (qcvm->extglobals.cltime) *qcvm->extglobals.cltime = realtime; + if (qcvm->extglobals.clframetime) + *qcvm->extglobals.clframetime = host_frametime; if (qcvm->extglobals.player_localentnum) *qcvm->extglobals.player_localentnum = cl.viewentity; if (qcvm->extglobals.intermission) diff --git a/Quake/pr_ext.c b/Quake/pr_ext.c index 23f1034b..f1c60e19 100644 --- a/Quake/pr_ext.c +++ b/Quake/pr_ext.c @@ -7718,10 +7718,12 @@ void PR_EnableExtensions(ddef_t *pr_globaldefs) #define QCEXTGLOBAL_FLOAT(n) qcvm->extglobals.n = PR_FindExtGlobal(ev_float, #n); +#define QCEXTGLOBAL_VECTOR(n) qcvm->extglobals.n = PR_FindExtGlobal(ev_vector, #n); QCEXTGLOBALS_COMMON QCEXTGLOBALS_GAME QCEXTGLOBALS_CSQC #undef QCEXTGLOBAL_FLOAT +#undef QCEXTGLOBAL_VECTOR //any #0 functions are remapped to their builtins here, so we don't have to tweak the VM in an obscure potentially-breaking way. for (i = 0; i < (unsigned int)qcvm->progs->numfunctions; i++) @@ -7964,6 +7966,7 @@ void PR_DumpPlatform_f(void) #undef QCEXTFUNC #define QCEXTGLOBAL_FLOAT(n) fprintf(f, "float " #n ";\n"); +#define QCEXTGLOBAL_VECTOR(n) fprintf(f, "vector " #n ";\n"); QCEXTGLOBALS_COMMON if (targs & (CS|SS)) { @@ -7973,7 +7976,8 @@ void PR_DumpPlatform_f(void) { QCEXTGLOBALS_CSQC } -#undef QCEXTGLOBAL +#undef QCEXTGLOBAL_FLOAT +#undef QCEXTGLOBAL_VECTOR fprintf(f, "const float FALSE = 0;\n"); fprintf(f, "const float TRUE = 1;\n"); diff --git a/Quake/progs.h b/Quake/progs.h index 65df43eb..9315abd9 100644 --- a/Quake/progs.h +++ b/Quake/progs.h @@ -219,28 +219,31 @@ struct pr_extglobals_s //end #define QCEXTGLOBALS_GAME \ QCEXTGLOBAL_FLOAT(input_timelength)\ - QCEXTGLOBAL_FLOAT(input_movevalues)\ - QCEXTGLOBAL_FLOAT(input_angles)\ + QCEXTGLOBAL_VECTOR(input_movevalues)\ + QCEXTGLOBAL_VECTOR(input_angles)\ QCEXTGLOBAL_FLOAT(input_buttons)\ QCEXTGLOBAL_FLOAT(input_impulse)\ QCEXTGLOBAL_FLOAT(physics_mode)\ //end #define QCEXTGLOBALS_CSQC \ QCEXTGLOBAL_FLOAT(cltime)\ + QCEXTGLOBAL_FLOAT(clframetime)\ QCEXTGLOBAL_FLOAT(maxclients)\ QCEXTGLOBAL_FLOAT(intermission)\ QCEXTGLOBAL_FLOAT(intermission_time)\ QCEXTGLOBAL_FLOAT(player_localnum)\ QCEXTGLOBAL_FLOAT(player_localentnum)\ - QCEXTGLOBAL_FLOAT(view_angles)\ + QCEXTGLOBAL_VECTOR(view_angles)\ QCEXTGLOBAL_FLOAT(clientcommandframe)\ QCEXTGLOBAL_FLOAT(servercommandframe)\ //end #define QCEXTGLOBAL_FLOAT(n) float *n; +#define QCEXTGLOBAL_VECTOR(n) float *n; QCEXTGLOBALS_COMMON QCEXTGLOBALS_GAME QCEXTGLOBALS_CSQC #undef QCEXTGLOBAL_FLOAT +#undef QCEXTGLOBAL_VECTOR }; struct pr_extfields_s diff --git a/Quake/sbar.c b/Quake/sbar.c index 5528c032..0a25246e 100644 --- a/Quake/sbar.c +++ b/Quake/sbar.c @@ -1023,6 +1023,8 @@ void Sbar_Draw (void) pr_global_struct->frametime = host_frametime; if (qcvm->extglobals.cltime) *qcvm->extglobals.cltime = realtime; + if (qcvm->extglobals.clframetime) + *qcvm->extglobals.clframetime = host_frametime; if (qcvm->extglobals.player_localentnum) *qcvm->extglobals.player_localentnum = cl.viewentity; pr_global_struct->time = cl.time; @@ -1418,6 +1420,8 @@ void Sbar_IntermissionOverlay (void) PR_SwitchQCVM(&cl.qcvm); if (qcvm->extglobals.cltime) *qcvm->extglobals.cltime = realtime; + if (qcvm->extglobals.clframetime) + *qcvm->extglobals.clframetime = host_frametime; if (qcvm->extglobals.player_localentnum) *qcvm->extglobals.player_localentnum = cl.viewentity; if (qcvm->extglobals.intermission) @@ -1425,6 +1429,7 @@ void Sbar_IntermissionOverlay (void) if (qcvm->extglobals.intermission_time) *qcvm->extglobals.intermission_time = cl.completed_time; pr_global_struct->time = cl.time; + pr_global_struct->frametime = host_frametime; Sbar_SortFrags (); G_VECTORSET(OFS_PARM0, vid.width/s, vid.height/s, 0); G_FLOAT(OFS_PARM1) = sb_showscores;