mirror of
https://github.com/Shpoike/Quakespasm.git
synced 2025-02-02 22:11:22 +00:00
Fix csqc's view_angles global.
This commit is contained in:
parent
521bc5aab4
commit
43bf160e0c
4 changed files with 18 additions and 4 deletions
|
@ -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)
|
||||
|
|
|
@ -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");
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue