From: black Date: Sun, 27 Jan 2008 18:49:34 +0000 (+0000) Subject: R_SetView now supports VF_CLEARSCREEN which decides whether to clear the screen or... X-Git-Tag: xonotic-v0.1.0preview~2488 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=d8c070909c9525c027065995333c6a173413a956;p=xonotic%2Fdarkplaces.git R_SetView now supports VF_CLEARSCREEN which decides whether to clear the screen or not when rendering the view (this is of particular interest for rendering view in views or for the menu). git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@8026 d7cf8633-e32d-0410-b094-e92efae38249 --- diff --git a/clvm_cmds.c b/clvm_cmds.c index 5283ffb6..b566f052 100644 --- a/clvm_cmds.c +++ b/clvm_cmds.c @@ -683,6 +683,7 @@ void VM_CL_R_ClearScene (void) r_refdef.view.frustum_y *= r_refdef.frustumscale_y; r_refdef.view.ortho_x = scr_fov.value * (3.0 / 4.0) * (float)r_refdef.view.width / (float)r_refdef.view.height / vid_pixelheight.value; r_refdef.view.ortho_y = scr_fov.value * (3.0 / 4.0); + r_refdef.view.clear = true; // FIXME: restore cl.csqc_origin // FIXME: restore cl.csqc_angles cl.csqc_vidvars.drawworld = true; @@ -836,6 +837,9 @@ void VM_CL_R_SetView (void) case VF_PERSPECTIVE: r_refdef.view.useperspective = k != 0; break; + case VF_CLEARSCREEN: + r_refdef.view.clear = k ? true : false; + break; default: PRVM_G_FLOAT(OFS_RETURN) = 0; VM_Warning("VM_CL_R_SetView : unknown parm %i\n", c); diff --git a/csprogs.h b/csprogs.h index 964f1214..4605a7e6 100644 --- a/csprogs.h +++ b/csprogs.h @@ -39,6 +39,7 @@ #define VF_CL_VIEWANGLES_Z 36 //(float) #define VF_PERSPECTIVE 200 //(float) +#define VF_CLEARSCREEN 201 //(float) #define RF_VIEWMODEL 1 // The entity is never drawn in mirrors. In engines with realtime lighting, it casts no shadows. #define RF_EXTERNALMODEL 2 // The entity is appears in mirrors but not in the normal view. It does still cast shadows in engines with realtime lighting.