]> de.git.xonotic.org Git - xonotic/darkplaces.git/blobdiff - cl_screen.c
some const fixes and type fixes found by gcc -combine
[xonotic/darkplaces.git] / cl_screen.c
index d3794fb6dfe6f09fccddad52e14ba5d1cbb6f764..52d93d4564ffb6d0ad339be4a4c88c9f65a9e9ac 100644 (file)
@@ -90,7 +90,7 @@ Called for important messages that should stay in the center of the screen
 for a few moments
 ==============
 */
-void SCR_CenterPrint(char *str)
+void SCR_CenterPrint(const char *str)
 {
        strlcpy (scr_centerstring, str, sizeof (scr_centerstring));
        scr_centertime_off = scr_centertime.value;
@@ -2037,6 +2037,9 @@ void SCR_UpdateLoadingScreen (qboolean clear)
        // don't do anything if not initialized yet
        if (vid_hidden || !scr_refresh.integer)
                return;
+       // release mouse grab while loading
+       if (!vid.fullscreen)
+               VID_SetMouse(false, false, false);
        CHECKGLERROR
        qglViewport(0, 0, vid.width, vid.height);CHECKGLERROR
        //qglDisable(GL_SCISSOR_TEST);CHECKGLERROR
@@ -2081,19 +2084,19 @@ void SCR_UpdateLoadingScreen (qboolean clear)
        if (vid.stereobuffer)
        {
                qglDrawBuffer(GL_FRONT_LEFT);
-               R_Mesh_Draw(0, 4, 2, polygonelements, 0, 0);
+               R_Mesh_Draw(0, 4, 0, 2, NULL, polygonelements, 0, 0);
                qglDrawBuffer(GL_FRONT_RIGHT);
-               R_Mesh_Draw(0, 4, 2, polygonelements, 0, 0);
+               R_Mesh_Draw(0, 4, 0, 2, NULL, polygonelements, 0, 0);
        }
        else
        {
                qglDrawBuffer(GL_FRONT);
-               R_Mesh_Draw(0, 4, 2, polygonelements, 0, 0);
+               R_Mesh_Draw(0, 4, 0, 2, NULL, polygonelements, 0, 0);
        }
        R_Mesh_Finish();
        // refresh
        // not necessary when rendering to GL_FRONT buffers
-       //VID_Finish(false);
+       //VID_Finish();
        // however this IS necessary on Windows Vista
        qglFinish();
 }
@@ -2111,6 +2114,9 @@ void CL_UpdateScreen(void)
        double rendertime1;
        float conwidth, conheight;
 
+       if (!scr_initialized || !con_initialized)
+               return;                         // not initialized yet
+
        if(gamemode == GAME_NEXUIZ)
        {
                // play a bit with the palette (experimental)
@@ -2127,9 +2133,6 @@ void CL_UpdateScreen(void)
        if (vid_hidden || !scr_refresh.integer)
                return;
 
-       if (!scr_initialized || !con_initialized)
-               return;                         // not initialized yet
-
        rendertime1 = Sys_DoubleTime();
 
        conwidth = bound(320, vid_conwidth.value, 2048);
@@ -2269,7 +2272,18 @@ void CL_UpdateScreen(void)
        else
                cl_updatescreen_quality = 1;
 
-       VID_Finish(true);
+       if (!vid_activewindow)
+               VID_SetMouse(false, false, false);
+       else if (key_consoleactive)
+               VID_SetMouse(vid.fullscreen, false, false);
+       else if (key_dest == key_menu_grabbed)
+               VID_SetMouse(true, !in_client_mouse, true);
+       else if (key_dest == key_menu)
+               VID_SetMouse(vid.fullscreen, !in_client_mouse, true);
+       else
+               VID_SetMouse(vid.fullscreen, vid_mouse.integer && !cls.demoplayback && !cl.csqc_wantsmousemove, true);
+
+       VID_Finish();
 }
 
 void CL_Screen_NewMap(void)