]> git.xonotic.org Git - xonotic/darkplaces.git/blobdiff - cl_parse.c
Merge branch 'master' into Mario/wrath-darkplaces_extra
[xonotic/darkplaces.git] / cl_parse.c
index 98c415ab1cfff6b225a6b61abc119d5def358ffd..7f9c2b5f0e67ea19c660ddb98c70f5c8b9cbed42 100644 (file)
@@ -330,7 +330,7 @@ void CL_KeepaliveMessage (qbool readmessages)
        {
                if(cls.state != ca_dedicated)
                {
-                       if(countdownupdate <= 0) // check if time stepped backwards
+                       if(countdownupdate <= 0 || gamemode == GAME_WRATH) // check if time stepped backwards
                        {
                                SCR_UpdateLoadingScreenIfShown();
                                countdownupdate = 2;
@@ -484,6 +484,7 @@ static void CL_SetupWorldModel(void)
                strlcpy(cl.worldname, cl.worldmodel->name, sizeof(cl.worldname));
                FS_StripExtension(cl.worldname, cl.worldnamenoextension, sizeof(cl.worldnamenoextension));
                strlcpy(cl.worldbasename, !strncmp(cl.worldnamenoextension, "maps/", 5) ? cl.worldnamenoextension + 5 : cl.worldnamenoextension, sizeof(cl.worldbasename));
+               SCR_SetLoadingSplash(cl.worldbasename); // set the loading splash once we know the map name for sure
                Cvar_SetQuick(&cl_worldmessage, cl.worldmessage);
                Cvar_SetQuick(&cl_worldname, cl.worldname);
                Cvar_SetQuick(&cl_worldnamenoextension, cl.worldnamenoextension);
@@ -500,7 +501,7 @@ static void CL_SetupWorldModel(void)
        World_Start(&cl.world);
 
        // load or reload .loc file for team chat messages
-       CL_Locs_Reload_f(cmd_client);
+       CL_Locs_Reload_f(cmd_local);
 
        // make sure we send enough keepalives
        CL_KeepaliveMessage(false);
@@ -940,7 +941,7 @@ void QW_CL_StartUpload(unsigned char *data, int size)
                return;
 
        // abort existing upload if in progress
-       QW_CL_StopUpload_f(cmd_client);
+       QW_CL_StopUpload_f(cmd_local);
 
        Con_DPrintf("Starting upload of %d bytes...\n", size);
 
@@ -949,7 +950,7 @@ void QW_CL_StartUpload(unsigned char *data, int size)
        cls.qw_uploadsize = size;
        cls.qw_uploadpos = 0;
 
-       QW_CL_NextUpload_f(cmd_client);
+       QW_CL_NextUpload_f(cmd_local);
 }
 
 #if 0
@@ -1349,7 +1350,8 @@ static void CL_BeginDownloads(qbool aborteddownload)
                // finished loading sounds
        }
 
-       SCR_PopLoadingScreen(false);
+       if (gamemode != GAME_WRATH) // this will be done after the "press any key" screen
+               SCR_ClearLoadingScreen(false);
 
        if (!cl.loadfinished)
        {
@@ -1619,7 +1621,7 @@ static void CL_SignonReply (void)
                        // execute cl_begindownloads next frame
                        // (after any commands added by svc_stufftext have been executed)
                        // when done with downloads the "prespawn" will be sent
-                       Cbuf_AddText(cmd_client, "\ncl_begindownloads\n");
+                       Cbuf_AddText(cmd_local, "\ncl_begindownloads\n");
 
                        //MSG_WriteByte (&cls.netcon->message, clc_stringcmd);
                        //MSG_WriteString (&cls.netcon->message, "prespawn");
@@ -1660,6 +1662,17 @@ static void CL_SignonReply (void)
                Con_ClearNotify();
                if (Sys_CheckParm("-profilegameonly"))
                        Sys_AllowProfiling(true);
+               
+               if (gamemode == GAME_WRATH)
+               {
+                       // HACK: pause the game and display "loading ended, press any key" screen
+                       SCR_ClearLoadingScreen(false);
+                       if (cl.islocalgame)
+                       {
+                               SCR_PushLoadingScreen("$", 1);
+                               sv.paused = true;
+                       }
+               }
                break;
        }
 }
@@ -1686,6 +1699,7 @@ static void CL_ParseServerInfo (void)
        // if server is active, we already began a loading plaque
        if (!sv.active)
        {
+               SCR_SetLoadingSplash(NULL);     
                SCR_BeginLoadingPlaque(false);
                S_StopAllSounds();
                // free q3 shaders so that any newly downloaded shaders will be active
@@ -1920,7 +1934,7 @@ static void CL_ParseServerInfo (void)
                        if (cls.demorecording)
                        {
                                // finish the previous level's demo file
-                               CL_Stop_f(cmd_client);
+                               CL_Stop_f(cmd_local);
                        }
 
                        // start a new demo file
@@ -3293,7 +3307,7 @@ static void CL_NetworkTimeReceived(double newtime)
        }
        else if (cls.protocol != PROTOCOL_QUAKEWORLD)
        {
-               double timehigh;
+               double timehigh = 0; // hush compiler warning
                cl.mtime[1] = max(cl.mtime[1], cl.mtime[0] - 0.1);
 
                if (developer_extra.integer && vid_activewindow)
@@ -3529,11 +3543,8 @@ void CL_ParseServerMessage(void)
                                if (cls.demonum != -1)
                                        CL_NextDemo();
                                else
-                               {
-                                       Con_Printf("Server disconnected\n");
                                        CL_Disconnect();
-                               }
-                               return;
+                               break;
 
                        case qw_svc_print:
                                i = MSG_ReadByte(&cl_message);
@@ -3695,7 +3706,7 @@ void CL_ParseServerMessage(void)
                                break;
 
                        case qw_svc_sellscreen:
-                               Cmd_ExecuteString(cmd_client, "help", src_local, true);
+                               Cmd_ExecuteString(cmd_local, "help", src_local, true);
                                break;
 
                        case qw_svc_smallkick:
@@ -3910,12 +3921,9 @@ void CL_ParseServerMessage(void)
 
                        case svc_disconnect:
                                if (cls.demonum != -1)
-                                       CL_NextDemo ();
+                                       CL_NextDemo();
                                else
-                               {
-                                       Con_Printf ("Server disconnected\n");
-                                       CL_Disconnect ();
-                               }
+                                       CL_Disconnect();
                                break;
 
                        case svc_print:
@@ -4204,7 +4212,7 @@ void CL_ParseServerMessage(void)
                                break;
 
                        case svc_sellscreen:
-                               Cmd_ExecuteString(cmd_client, "help", src_local, true);
+                               Cmd_ExecuteString(cmd_local, "help", src_local, true);
                                break;
                        case svc_hidelmp:
                                if (gamemode == GAME_TENEBRAE)
@@ -4307,7 +4315,7 @@ void CL_Parse_DumpPacket(void)
 void CL_Parse_ErrorCleanUp(void)
 {
        CL_StopDownload(0, 0);
-       QW_CL_StopUpload_f(cmd_client);
+       QW_CL_StopUpload_f(cmd_local);
 }
 
 void CL_Parse_Init(void)