]> de.git.xonotic.org Git - xonotic/darkplaces.git/commitdiff
validate r_shadow_frontsidecasting each frame and correct it to a valid
authorhavoc <havoc@d7cf8633-e32d-0410-b094-e92efae38249>
Sun, 20 May 2007 22:28:18 +0000 (22:28 +0000)
committerhavoc <havoc@d7cf8633-e32d-0410-b094-e92efae38249>
Sun, 20 May 2007 22:28:18 +0000 (22:28 +0000)
value if invalid

git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@7325 d7cf8633-e32d-0410-b094-e92efae38249

gl_rmain.c

index 2a2bb92974febb5dca3496356d06d071b6684396..72831d8775a9dfb1e43c10a4fdd11e9cbbd86767 100644 (file)
@@ -2453,6 +2453,8 @@ void R_UpdateVariables(void)
                r_refdef.farclip += VectorDistance(r_refdef.worldmodel->normalmins, r_refdef.worldmodel->normalmaxs);
        r_refdef.nearclip = bound (0.001f, r_nearclip.value, r_refdef.farclip - 1.0f);
 
+       if (r_shadow_frontsidecasting.integer < 0 || r_shadow_frontsidecasting.integer > 1)
+               Cvar_SetValueQuick(&r_shadow_frontsidecasting, 1);
        r_refdef.polygonfactor = 0;
        r_refdef.polygonoffset = 0;
        r_refdef.shadowpolygonfactor = r_refdef.polygonfactor + r_shadow_shadow_polygonfactor.value * (r_shadow_frontsidecasting.integer ? 1 : -1);