]> git.xonotic.org Git - xonotic/darkplaces.git/blobdiff - cl_screen.c
Use SDL_GameController instead of SDL_Joystick where possible
[xonotic/darkplaces.git] / cl_screen.c
index 7a77ca5976b0309336744193c7916627cc5f80f6..94d6ed102a740297d74d100495a591d692627dba 100644 (file)
@@ -38,7 +38,7 @@ cvar_t scr_showturtle = {CVAR_CLIENT | CVAR_SAVE, "showturtle","0", "show turtle
 cvar_t scr_showpause = {CVAR_CLIENT | CVAR_SAVE, "showpause","1", "show pause icon when game is paused"};
 cvar_t scr_showbrand = {CVAR_CLIENT, "showbrand","0", "shows gfx/brand.tga in a corner of the screen (different values select different positions, including centered)"};
 cvar_t scr_printspeed = {CVAR_CLIENT, "scr_printspeed","0", "speed of intermission printing (episode end texts), a value of 0 disables the slow printing"};
-cvar_t scr_loadingscreen_background = {CVAR_CLIENT, "scr_loadingscreen_background","1", "show the last visible background during loading screen (costs one screenful of video memory)"};
+cvar_t scr_loadingscreen_background = {CVAR_CLIENT, "scr_loadingscreen_background","0", "show the last visible background during loading screen (costs one screenful of video memory)"};
 cvar_t scr_loadingscreen_scale = {CVAR_CLIENT, "scr_loadingscreen_scale","1", "scale factor of the background"};
 cvar_t scr_loadingscreen_scale_base = {CVAR_CLIENT, "scr_loadingscreen_scale_base","0", "0 = console pixels, 1 = video pixels"};
 cvar_t scr_loadingscreen_scale_limit = {CVAR_CLIENT, "scr_loadingscreen_scale_limit","0", "0 = no limit, 1 = until first edge hits screen edge, 2 = until last edge hits screen edge, 3 = until width hits screen width, 4 = until height hits screen height"};
@@ -690,7 +690,9 @@ static void SCR_SetUpToDrawConsole (void)
                framecounter = 0;
 #endif
 
-       if (scr_conforcewhiledisconnected.integer && key_dest == key_game && cls.signon != SIGNONS)
+       if (scr_conforcewhiledisconnected.integer >= 2 && key_dest == key_game && cls.signon != SIGNONS)
+               key_consoleactive |= KEY_CONSOLEACTIVE_FORCED;
+       else if (scr_conforcewhiledisconnected.integer >= 1 && key_dest == key_game && cls.signon != SIGNONS && !sv.active)
                key_consoleactive |= KEY_CONSOLEACTIVE_FORCED;
        else
                key_consoleactive &= ~KEY_CONSOLEACTIVE_FORCED;
@@ -2061,6 +2063,7 @@ int r_stereo_side;
 extern cvar_t v_isometric;
 extern cvar_t v_isometric_verticalfov;
 
+static void SCR_DrawLoadingScreen(qboolean clear);
 static void SCR_DrawScreen (void)
 {
        Draw_Frame();
@@ -2154,6 +2157,19 @@ static void SCR_DrawScreen (void)
                        R_RenderView(0, NULL, NULL, r_refdef.view.x, r_refdef.view.y, r_refdef.view.width, r_refdef.view.height);
                }
        }
+       else if (key_dest == key_game && key_consoleactive == 0 && (cls.state == ca_connected || cls.connect_trying))
+       {
+               // draw the loading screen for a while if we're still connecting and not forcing the console or menu to show up
+               char temp[64];
+               if (cls.signon > 0)
+                       SCR_PushLoadingScreen(false, va(temp, sizeof(temp), "Connect: Signon stage %i of %i", cls.signon, SIGNONS), 1.0);
+               else if (cls.connect_remainingtries > 0)
+                       SCR_PushLoadingScreen(false, va(temp, sizeof(temp), "Connect: Trying...  %i", cls.connect_remainingtries), 1.0);
+               else
+                       SCR_PushLoadingScreen(false, va(temp, sizeof(temp), "Connect: Waiting %i seconds for reply", 10 + cls.connect_remainingtries), 1.0);
+               SCR_DrawLoadingScreen(true);
+               SCR_PopLoadingScreen(false);
+       }
 
        // Don't apply debugging stuff like r_showsurfaces to the UI
        r_refdef.view.showdebug = false;