]> de.git.xonotic.org Git - xonotic/darkplaces.git/blobdiff - view.c
lighthalf related transpoly cleanup
[xonotic/darkplaces.git] / view.c
diff --git a/view.c b/view.c
index 1780fef8820ab832967d0546fd19336109ff9172..f2daebbd8dc2e6f7ff8106681907bc789b0e5ee3 100644 (file)
--- a/view.c
+++ b/view.c
@@ -30,10 +30,6 @@ when crossing a water boudnary.
 
 */
 
-cvar_t scr_ofsx = {"scr_ofsx","0", false};
-cvar_t scr_ofsy = {"scr_ofsy","0", false};
-cvar_t scr_ofsz = {"scr_ofsz","0", false};
-
 cvar_t cl_rollspeed = {"cl_rollspeed", "200"};
 cvar_t cl_rollangle = {"cl_rollangle", "2.0"};
 
@@ -710,6 +706,7 @@ V_CalcRefdef
 
 ==================
 */
+extern qboolean intimerefresh;
 void V_CalcRefdef (void)
 {
        entity_t        *ent, *view;
@@ -729,8 +726,11 @@ void V_CalcRefdef (void)
 
 // transform the view offset by the model's matrix to get the offset from
 // model origin for the view
-       ent->angles[YAW] = cl.viewangles[YAW];  // the model should face the view dir
-       ent->angles[PITCH] = -cl.viewangles[PITCH];     // the model should face the view dir
+       if (!chase_active.value) // LordHavoc: get rid of angle problems in chase_active mode
+       {
+               ent->angles[YAW] = cl.viewangles[YAW];  // the model should face the view dir
+               ent->angles[PITCH] = -cl.viewangles[PITCH];     // the model should face the view dir
+       }
                                                                                
        
        bob = V_CalcBob ();
@@ -746,7 +746,10 @@ void V_CalcRefdef (void)
        r_refdef.vieworg[1] += 1.0/32;
        r_refdef.vieworg[2] += 1.0/32;
 
-       VectorCopy (cl.viewangles, r_refdef.viewangles);
+       if (!intimerefresh)
+       {
+               VectorCopy (cl.viewangles, r_refdef.viewangles);
+       }
        V_CalcViewRoll ();
        V_AddIdle ();
 
@@ -758,12 +761,6 @@ void V_CalcRefdef (void)
 
        AngleVectors (angles, forward, right, up);
 
-       for (i=0 ; i<3 ; i++)
-               r_refdef.vieworg[i] += scr_ofsx.value*forward[i]
-                       + scr_ofsy.value*right[i]
-                       + scr_ofsz.value*up[i];
-       
-       
        V_BoundOffsets ();
                
 // set up gun position
@@ -802,10 +799,13 @@ void V_CalcRefdef (void)
 
        view->model = cl.model_precache[cl.stats[STAT_WEAPON]];
        view->frame = cl.stats[STAT_WEAPONFRAME];
-       view->colormap = vid.colormap;
+       view->colormap = 0; //vid.colormap;
 
 // set up the refresh position
-       VectorAdd (r_refdef.viewangles, cl.punchangle, r_refdef.viewangles);
+       if (!intimerefresh)
+       {
+               VectorAdd (r_refdef.viewangles, cl.punchangle, r_refdef.viewangles);
+       }
 
 // smooth out stair step ups
 if (cl.onground && ent->origin[2] - oldz > 0)
@@ -840,21 +840,11 @@ The player's clipping box goes from (-16 -16 -24) to (16 16 32) from
 the entity origin, so any view position inside that will be valid
 ==================
 */
-extern vrect_t scr_vrect;
-
 void V_RenderView (void)
 {
        if (con_forcedup)
                return;
 
-// don't allow cheats in multiplayer
-       if (cl.maxclients > 1)
-       {
-               Cvar_Set ("scr_ofsx", "0");
-               Cvar_Set ("scr_ofsy", "0");
-               Cvar_Set ("scr_ofsz", "0");
-       }
-
        if (cl.intermission)
        {       // intermission / finale rendering
                V_CalcIntermissionRefdef ();    
@@ -865,8 +855,6 @@ void V_RenderView (void)
                        V_CalcRefdef ();
        }
 
-       R_PushDlights ();
-
        R_RenderView ();
 }
 
@@ -899,9 +887,6 @@ void V_Init (void)
        Cvar_RegisterVariable (&cl_crossy);
        Cvar_RegisterVariable (&gl_cshiftpercent);
 
-       Cvar_RegisterVariable (&scr_ofsx);
-       Cvar_RegisterVariable (&scr_ofsy);
-       Cvar_RegisterVariable (&scr_ofsz);
        Cvar_RegisterVariable (&cl_rollspeed);
        Cvar_RegisterVariable (&cl_rollangle);
        Cvar_RegisterVariable (&cl_bob);