remove some r_render checks, and added an r_render check to vid_sdl.c VID_Finish
authorhavoc <havoc@d7cf8633-e32d-0410-b094-e92efae38249>
Tue, 23 May 2006 22:54:30 +0000 (22:54 +0000)
committerhavoc <havoc@d7cf8633-e32d-0410-b094-e92efae38249>
Tue, 23 May 2006 22:54:30 +0000 (22:54 +0000)
git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@6372 d7cf8633-e32d-0410-b094-e92efae38249

cl_screen.c
gl_backend.c
gl_draw.c
vid_sdl.c

index 63a8e52..56fb1ff 100644 (file)
@@ -1114,37 +1114,35 @@ qboolean SCR_ScreenShot(char *filename, unsigned char *buffer1, unsigned char *b
 
 void R_ClearScreen(void)
 {
-       if (r_render.integer)
+       // clear to black
+       CHECKGLERROR
+       if (r_refdef.fogenabled)
        {
-               // clear to black
-               CHECKGLERROR
-               if (r_refdef.fogenabled)
-               {
-                       qglClearColor(r_refdef.fogcolor[0],r_refdef.fogcolor[1],r_refdef.fogcolor[2],0);CHECKGLERROR
-               }
-               else
-               {
-                       qglClearColor(0,0,0,0);CHECKGLERROR
-               }
-               qglClearDepth(1);CHECKGLERROR
-               if (gl_stencil)
-               {
-                       // LordHavoc: we use a stencil centered around 128 instead of 0,
-                       // to avoid clamping interfering with strange shadow volume
-                       // drawing orders
-                       qglClearStencil(128);CHECKGLERROR
-               }
-               // clear the screen
+               qglClearColor(r_refdef.fogcolor[0],r_refdef.fogcolor[1],r_refdef.fogcolor[2],0);CHECKGLERROR
+       }
+       else
+       {
+               qglClearColor(0,0,0,0);CHECKGLERROR
+       }
+       qglClearDepth(1);CHECKGLERROR
+       if (gl_stencil)
+       {
+               // LordHavoc: we use a stencil centered around 128 instead of 0,
+               // to avoid clamping interfering with strange shadow volume
+               // drawing orders
+               qglClearStencil(128);CHECKGLERROR
+       }
+       // clear the screen
+       if (r_render.integer)
                GL_Clear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT | (gl_stencil ? GL_STENCIL_BUFFER_BIT : 0));
-               // set dithering mode
-               if (gl_dither.integer)
-               {
-                       qglEnable(GL_DITHER);CHECKGLERROR
-               }
-               else
-               {
-                       qglDisable(GL_DITHER);CHECKGLERROR
-               }
+       // set dithering mode
+       if (gl_dither.integer)
+       {
+               qglEnable(GL_DITHER);CHECKGLERROR
+       }
+       else
+       {
+               qglDisable(GL_DITHER);CHECKGLERROR
        }
 }
 
index 4bea75d..26b6084 100644 (file)
@@ -263,9 +263,6 @@ void GL_SetupView_Mode_Perspective (double frustumx, double frustumy, double zNe
 {
        double m[16];
 
-       if (!r_render.integer)
-               return;
-
        // set up viewpoint
        CHECKGLERROR
        qglMatrixMode(GL_PROJECTION);CHECKGLERROR
@@ -298,9 +295,6 @@ void GL_SetupView_Mode_PerspectiveInfiniteFarClip (double frustumx, double frust
 {
        double nudge, m[16];
 
-       if (!r_render.integer)
-               return;
-
        // set up viewpoint
        CHECKGLERROR
        qglMatrixMode(GL_PROJECTION);CHECKGLERROR
@@ -349,9 +343,6 @@ void GL_SetupView_Mode_Ortho (double x1, double y1, double x2, double y2, double
 {
        double m[16];
 
-       if (!r_render.integer)
-               return;
-
        // set up viewpoint
        CHECKGLERROR
        qglMatrixMode(GL_PROJECTION);CHECKGLERROR
index 95f9e7b..2db1c74 100644 (file)
--- a/gl_draw.c
+++ b/gl_draw.c
@@ -545,9 +545,6 @@ void DrawQ_String_Real(float x, float y, const char *string, int maxlen, float w
                return;
        }
 
-       if (!r_render.integer)
-               return;
-
        if (alpha < (1.0f / 255.0f))
                return;
 
@@ -742,9 +739,6 @@ void DrawQ_SuperPic(float x, float y, cachepic_t *pic, float width, float height
                return;
        }
 
-       if (!r_render.integer)
-               return;
-
        _DrawQ_ProcessDrawFlag(flags);
 
        R_Mesh_VertexPointer(floats);
@@ -785,9 +779,6 @@ void DrawQ_Mesh (drawqueuemesh_t *mesh, int flags)
                return;
        }
 
-       if (!r_render.integer)
-               return;
-
        _DrawQ_ProcessDrawFlag(flags);
 
        R_Mesh_VertexPointer(mesh->data_vertex3f);
@@ -811,9 +802,6 @@ void DrawQ_LineLoop (drawqueuemesh_t *mesh, int flags)
                return;
        }
 
-       if (!r_render.integer)
-               return;
-
        _DrawQ_ProcessDrawFlag(flags);
 
        GL_Color(1,1,1,1);
@@ -850,9 +838,6 @@ void DrawQ_Line (float width, float x1, float y1, float x2, float y2, float r, f
                return;
        }
 
-       if (!r_render.integer)
-               return;
-
        CHECKGLERROR
        if(width > 0)
                DrawQ_LineWidth(width);
index fe09e99..6032202 100644 (file)
--- a/vid_sdl.c
+++ b/vid_sdl.c
@@ -488,13 +488,6 @@ void VID_Finish (qboolean allowmousegrab)
        Uint8 appstate;
        qboolean vid_usemouse;
 
-       CHECKGLERROR
-       if (r_speeds.integer || gl_finish.integer)
-       {
-               qglFinish();CHECKGLERROR
-       }
-       SDL_GL_SwapBuffers();
-
        //react on appstate changes
        appstate = SDL_GetAppState();
 
@@ -516,4 +509,14 @@ void VID_Finish (qboolean allowmousegrab)
        IN_Activate(vid_usemouse);
 
        VID_UpdateGamma(false, 256);
+
+       if (r_render.integer && !vid_hidden)
+       {
+               CHECKGLERROR
+               if (r_speeds.integer || gl_finish.integer)
+               {
+                       qglFinish();CHECKGLERROR
+               }
+               SDL_GL_SwapBuffers();
+       }
 }