]> de.git.xonotic.org Git - xonotic/darkplaces.git/commitdiff
redesigned drawing of loading plaque, it's now a separate refresh function which...
authorhavoc <havoc@d7cf8633-e32d-0410-b094-e92efae38249>
Fri, 26 Nov 2004 00:57:30 +0000 (00:57 +0000)
committerhavoc <havoc@d7cf8633-e32d-0410-b094-e92efae38249>
Fri, 26 Nov 2004 00:57:30 +0000 (00:57 +0000)
git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@4796 d7cf8633-e32d-0410-b094-e92efae38249

cl_screen.c
gl_backend.c
gl_backend.h

index 2628fd7bec2984a7e42ae31205b53fd926846651..9177d0e66b2ed9d3befd6b619c0ea0adeb1beb3a 100644 (file)
@@ -38,8 +38,6 @@ float         scr_conlines;           // lines of console to display
 
 extern int     con_vislines;
 
-qboolean       scr_drawloading = false;
-
 void DrawCrosshair(int num);
 static void SCR_ScreenShot_f (void);
 static void R_Envmap_f (void);
@@ -224,19 +222,6 @@ void SCR_DrawPause (void)
 
 
 
-/*
-==============
-SCR_DrawLoading
-==============
-*/
-void SCR_DrawLoading (void)
-{
-       cachepic_t      *pic;
-
-       pic = Draw_CachePic ("gfx/loading.lmp");
-       DrawQ_Pic ((vid.conwidth - pic->width)/2, (vid.conheight - pic->height)/2, "gfx/loading.lmp", 0, 0, 1, 1, 1, 1, 0);
-}
-
 
 
 //=============================================================================
@@ -309,15 +294,8 @@ SCR_BeginLoadingPlaque
 */
 void SCR_BeginLoadingPlaque (void)
 {
-       if (scr_drawloading)
-               return;
-
        S_StopAllSounds ();
-
-       scr_drawloading = true;
-       CL_UpdateScreen ();
-       scr_drawloading = true;
-       CL_UpdateScreen ();
+       SCR_UpdateLoadingScreen();
 }
 
 //=============================================================================
@@ -1243,35 +1221,28 @@ void CL_UpdateScreen(void)
        //FIXME: force menu if nothing else to look at?
        //if (key_dest == key_game && cls.signon != SIGNONS && cls.state == ca_disconnected)
 
-       if (scr_drawloading)
+       if (cls.signon == SIGNONS)
        {
-               scr_drawloading = false;
-               SCR_DrawLoading();
+               SCR_DrawNet ();
+               SCR_DrawTurtle ();
+               SCR_DrawPause ();
+               if (!r_letterbox.value)
+                       Sbar_Draw();
+               SHOWLMP_drawall();
+               SCR_CheckDrawCenterString();
        }
-       else
+       MR_Draw();
+       UI_Callback_Draw();
+       CL_DrawVideo();
+       //ui_draw();
+       if (cls.signon == SIGNONS)
        {
-               if (cls.signon == SIGNONS)
-               {
-                       SCR_DrawNet ();
-                       SCR_DrawTurtle ();
-                       SCR_DrawPause ();
-                       if (!r_letterbox.value)
-                               Sbar_Draw();
-                       SHOWLMP_drawall();
-                       SCR_CheckDrawCenterString();
-               }
-               MR_Draw();
-               UI_Callback_Draw();
-               CL_DrawVideo();
-               //ui_draw();
-               if (cls.signon == SIGNONS)
-               {
-                       R_TimeReport("2d");
-                       R_TimeReport_End();
-                       R_TimeReport_Start();
-               }
-               R_Shadow_EditLights_DrawSelectedLightProperties();
+               R_TimeReport("2d");
+               R_TimeReport_End();
+               R_TimeReport_Start();
        }
+       R_Shadow_EditLights_DrawSelectedLightProperties();
+
        SCR_DrawConsole();
 
        SCR_UpdateScreen();
index 299e42ab8c21d953da436add9196e9c4d2f7c0e2..3d3567373bec8e0a663524ee940d3a5da9e96345 100644 (file)
@@ -1343,6 +1343,59 @@ void SCR_DrawScreen (void)
 
                R_TimeReport("meshfinish");
        }
+       r_showtrispass = 0;
+}
+
+void SCR_UpdateLoadingScreen (void)
+{
+       float x, y;
+       cachepic_t *pic;
+       rmeshstate_t m;
+       // don't do anything if not initialized yet
+       if (vid_hidden)
+               return;
+       r_showtrispass = 0;
+       VID_GetWindowSize(&vid.realx, &vid.realy, &vid.realwidth, &vid.realheight);
+       VID_UpdateGamma(false);
+       qglViewport(0, 0, vid.realwidth, vid.realheight);
+       //qglDisable(GL_SCISSOR_TEST);
+       //qglDepthMask(1);
+       qglColorMask(1,1,1,1);
+       //qglClearColor(0,0,0,0);
+       //qglClear(GL_COLOR_BUFFER_BIT);
+       //qglCullFace(GL_FRONT);
+       //qglDisable(GL_CULL_FACE);
+       //R_ClearScreen();
+       R_Textures_Frame();
+       GL_SetupView_Mode_Ortho(0, 0, vid_conwidth.integer, vid_conheight.integer, -10, 100);
+       R_Mesh_Start();
+       R_Mesh_Matrix(&r_identitymatrix);
+       // draw the loading plaque
+       pic = Draw_CachePic("gfx/loading.lmp");
+       x = (vid_conwidth.integer - pic->width)/2;
+       y = (vid_conheight.integer - pic->height)/2;
+       GL_Color(1,1,1,1);
+       GL_BlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
+       GL_DepthTest(false);
+       memset(&m, 0, sizeof(m));
+       m.pointer_vertex = varray_vertex3f;
+       m.pointer_texcoord[0] = varray_texcoord2f[0];
+       m.tex[0] = R_GetTexture(pic->tex);
+       R_Mesh_State(&m);
+       varray_vertex3f[0] = varray_vertex3f[9] = x;
+       varray_vertex3f[1] = varray_vertex3f[4] = y;
+       varray_vertex3f[3] = varray_vertex3f[6] = x + pic->width;
+       varray_vertex3f[7] = varray_vertex3f[10] = y + pic->height;
+       varray_texcoord2f[0][0] = 0;varray_texcoord2f[0][1] = 0;
+       varray_texcoord2f[0][2] = 1;varray_texcoord2f[0][3] = 0;
+       varray_texcoord2f[0][4] = 1;varray_texcoord2f[0][5] = 1;
+       varray_texcoord2f[0][6] = 0;varray_texcoord2f[0][7] = 1;
+       GL_LockArrays(0, 4);
+       R_Mesh_Draw(4, 2, polygonelements);
+       GL_LockArrays(0, 0);
+       R_Mesh_Finish();
+       // refresh
+       VID_Finish();
 }
 
 /*
@@ -1355,6 +1408,9 @@ text to the screen.
 */
 void SCR_UpdateScreen (void)
 {
+       if (vid_hidden)
+               return;
+
        if (r_textureunits.integer > gl_textureunits)
                Cvar_SetValueQuick(&r_textureunits, gl_textureunits);
        if (r_textureunits.integer < 1)
index 645aeaf6c13c40cfe0b869e97244d516dbfa01c7..69287506ca80ae53a984e0a77f9703becc810f9c 100644 (file)
@@ -85,6 +85,8 @@ qboolean SCR_ScreenShot(char *filename, qbyte *buffer1, qbyte *buffer2, qbyte *b
 void R_ClearScreen(void);
 // invoke refresh of frame
 void SCR_UpdateScreen(void);
+// invoke refresh of loading plaque (nothing else seen)
+void SCR_UpdateLoadingScreen(void);
 
 // public structure
 typedef struct rcachearrayrequest_s