]> de.git.xonotic.org Git - xonotic/darkplaces.git/blobdiff - gl_rmain.c
this patch adds a number of stereo viewing modes (shutter glasses and video glasses...
[xonotic/darkplaces.git] / gl_rmain.c
index fad13e4ce3bc53f32dfb42e906160cc0f75c3ae2..36a3905184af985e23b51c2316576b01965b63b5 100644 (file)
@@ -50,8 +50,10 @@ vec3_t r_viewright;
 vec3_t r_viewup;
 int r_view_x;
 int r_view_y;
+int r_view_z;
 int r_view_width;
 int r_view_height;
+int r_view_depth;
 float r_view_fov_x;
 float r_view_fov_y;
 matrix4x4_t r_view_matrix;
@@ -590,7 +592,7 @@ void R_UpdateWorld(void)
        }
 
        // don't allow cheats in multiplayer
-       if (!cl.islocalgame)
+       if (!cl.islocalgame && cl.worldmodel)
        {
                if (r_fullbright.integer != 0)
                        Cvar_Set ("r_fullbright", "0");
@@ -617,16 +619,20 @@ void R_RenderView(void)
        
        r_view_width = bound(0, r_refdef.width, vid.realwidth);
        r_view_height = bound(0, r_refdef.height, vid.realheight);
+       r_view_depth = 1;
        r_view_x = bound(0, r_refdef.x, vid.realwidth - r_refdef.width);
        r_view_y = bound(0, r_refdef.y, vid.realheight - r_refdef.height);
+       r_view_z = 0;
        r_view_fov_x = bound(1, r_refdef.fov_x, 170);
        r_view_fov_y = bound(1, r_refdef.fov_y, 170);
        r_view_matrix = r_refdef.viewentitymatrix;
+       GL_ColorMask(r_refdef.colormask[0], r_refdef.colormask[1], r_refdef.colormask[2], 1);
 
        // GL is weird because it's bottom to top, r_view_y is top to bottom
        qglViewport(r_view_x, vid.realheight - (r_view_y + r_view_height), r_view_width, r_view_height);
        GL_Scissor(r_view_x, r_view_y, r_view_width, r_view_height);
        GL_ScissorTest(true);
+       GL_DepthMask(true);
        R_ClearScreen();
        R_TimeReport("setup");
 
@@ -662,7 +668,7 @@ void R_RenderScene(void)
        R_SetFrustum();
 
        r_farclip = R_FarClip(r_vieworigin, r_viewforward, 768.0f) + 256.0f;
-       if (gl_stencil && ((r_shadow_realtime_world.integer && r_shadow_worldshadows.integer) || ((r_shadow_realtime_world.integer || r_shadow_realtime_dlight.integer) && r_shadow_dlightshadows.integer)))
+       if (gl_stencil && (r_shadow_realtime_world.integer || (r_shadow_realtime_dlight.integer && r_shadow_realtime_dlight_shadows.integer)))
                GL_SetupView_Mode_PerspectiveInfiniteFarClip(r_view_fov_x, r_view_fov_y, 1.0f);
        else
                GL_SetupView_Mode_Perspective(r_view_fov_x, r_view_fov_y, 1.0f, r_farclip);