Fix intermission camera angles during demo playback

(see https://github.com/sezero/quakespasm/issues/18)
This commit is contained in:
Andrei Drexler 2022-02-27 21:36:47 +02:00 committed by Ozkan Sezer
parent ec49ef2441
commit 14b7338946
3 changed files with 18 additions and 0 deletions

View file

@ -1188,6 +1188,7 @@ void CL_ParseServerMessage (void)
cl.intermission = 1;
cl.completed_time = cl.time;
vid.recalc_refdef = true; // go to full screen
V_RestoreAngles ();
break;
case svc_finale:
@ -1199,6 +1200,7 @@ void CL_ParseServerMessage (void)
SCR_CenterPrint (str);
Con_LogCenterPrint (str);
//johnfitz
V_RestoreAngles ();
break;
case svc_cutscene:
@ -1210,6 +1212,7 @@ void CL_ParseServerMessage (void)
SCR_CenterPrint (str);
Con_LogCenterPrint (str);
//johnfitz
V_RestoreAngles ();
break;
case svc_sellscreen:

View file

@ -870,6 +870,20 @@ void V_CalcRefdef (void)
Chase_UpdateForDrawing (); //johnfitz
}
/*
==================
V_RestoreAngles
Resets the viewentity angles to the last values received from the server
(undoing the manual adjustments performed by V_CalcRefdef)
==================
*/
void V_RestoreAngles (void)
{
entity_t *ent = &cl_entities[cl.viewentity];
VectorCopy (ent->msg_angles[0], ent->angles);
}
/*
==================
V_RenderView

View file

@ -33,6 +33,7 @@ void V_RenderView (void);
void V_CalcBlend (void);
void V_UpdateBlend (void);
float V_CalcRoll (vec3_t angles, vec3_t velocity);
void V_RestoreAngles (void);
//void V_UpdatePalette (void); //johnfitz
#endif /* _QUAKE_VIEW_H */