]> git.rm.cloudns.org Git - xonotic/darkplaces.git/commitdiff
Fix missing loading screen text. A redraw must always occur when pushing.
authorcloudwalk <cloudwalk@d7cf8633-e32d-0410-b094-e92efae38249>
Thu, 21 May 2020 18:57:50 +0000 (18:57 +0000)
committercloudwalk <cloudwalk@d7cf8633-e32d-0410-b094-e92efae38249>
Thu, 21 May 2020 18:57:50 +0000 (18:57 +0000)
A DrawQ_Finish call is also required. For loading text to work early in startup, Mod_Mesh_Create must be called early as well.

git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@12552 d7cf8633-e32d-0410-b094-e92efae38249

cl_main.c
cl_parse.c
cl_screen.c
model_shared.c
screen.h
snd_mem.c

index b0c913d054fa1e0092262e219ba89f46c56b8664..4256fc2d64f90a6f2478caab85651051f420abba 100644 (file)
--- a/cl_main.c
+++ b/cl_main.c
@@ -2395,6 +2395,7 @@ static void CL_MeshEntities_Init(void)
                ent = cl_meshentities + i;
                ent->state_current.active = true;
                ent->render.model = cl_meshentitymodels + i;
+               Mod_Mesh_Create(ent->render.model, cl_meshentitynames[i]);      
                ent->render.alpha = 0.999999f; // not quite 1 so that MATERIALFLAG_ALPHA is always set.
                ent->render.flags = RENDER_SHADOW | RENDER_LIGHT;
                ent->render.framegroupblend[0].lerp = 1;
index d0af710c43e5cf19be9276f7f18c531dd94d7edc..7f2cdff4cde1ee61f0203f0e0be48edf97f02ee6 100644 (file)
@@ -1095,7 +1095,7 @@ static void CL_BeginDownloads(qboolean aborteddownload)
        // if we got here...
        // curl is done, so let's start with the business
        if(!cl.loadbegun)
-               SCR_PushLoadingScreen(false, "Loading precaches", 1);
+               SCR_PushLoadingScreen("Loading precaches", 1);
        cl.loadbegun = true;
 
        // if already downloading something from the previous level, don't stop it
@@ -1130,7 +1130,7 @@ static void CL_BeginDownloads(qboolean aborteddownload)
                if(cl.loadmodel_current == 1)
                {
                        // worldmodel counts as 16 models (15 + world model setup), for better progress bar
-                       SCR_PushLoadingScreen(false, "Loading precached models",
+                       SCR_PushLoadingScreen("Loading precached models",
                                (
                                        (cl.loadmodel_total - 1) * LOADPROGRESSWEIGHT_MODEL
                                +       LOADPROGRESSWEIGHT_WORLDMODEL
@@ -1142,11 +1142,10 @@ static void CL_BeginDownloads(qboolean aborteddownload)
                                +       cl.loadsound_total * LOADPROGRESSWEIGHT_SOUND
                                )
                        );
-                       SCR_BeginLoadingPlaque(false);
                }
                for (;cl.loadmodel_current < cl.loadmodel_total;cl.loadmodel_current++)
                {
-                       SCR_PushLoadingScreen(false, cl.model_name[cl.loadmodel_current],
+                       SCR_PushLoadingScreen(cl.model_name[cl.loadmodel_current],
                                (
                                        (cl.loadmodel_current == 1) ? LOADPROGRESSWEIGHT_WORLDMODEL : LOADPROGRESSWEIGHT_MODEL
                                ) / (
@@ -1160,7 +1159,7 @@ static void CL_BeginDownloads(qboolean aborteddownload)
                                SCR_PopLoadingScreen(false);
                                if(cl.loadmodel_current == 1)
                                {
-                                       SCR_PushLoadingScreen(false, cl.model_name[cl.loadmodel_current], 1.0 / cl.loadmodel_total);
+                                       SCR_PushLoadingScreen(cl.model_name[cl.loadmodel_current], 1.0 / cl.loadmodel_total);
                                        SCR_PopLoadingScreen(false);
                                }
                                continue;
@@ -1183,7 +1182,7 @@ static void CL_BeginDownloads(qboolean aborteddownload)
                        if (cl.model_precache[cl.loadmodel_current] && cl.model_precache[cl.loadmodel_current]->Draw && cl.loadmodel_current == 1)
                        {
                                // we now have the worldmodel so we can set up the game world
-                               SCR_PushLoadingScreen(true, "world model setup",
+                               SCR_PushLoadingScreen("world model setup",
                                        (
                                                LOADPROGRESSWEIGHT_WORLDMODEL_INIT
                                        ) / (
@@ -1211,7 +1210,7 @@ static void CL_BeginDownloads(qboolean aborteddownload)
        {
                // loading sounds
                if(cl.loadsound_current == 1)
-                       SCR_PushLoadingScreen(false, "Loading precached sounds",
+                       SCR_PushLoadingScreen("Loading precached sounds",
                                (
                                        cl.loadsound_total * LOADPROGRESSWEIGHT_SOUND
                                ) / (
@@ -1223,7 +1222,7 @@ static void CL_BeginDownloads(qboolean aborteddownload)
                        );
                for (;cl.loadsound_current < cl.loadsound_total;cl.loadsound_current++)
                {
-                       SCR_PushLoadingScreen(false, cl.sound_name[cl.loadsound_current], 1.0 / cl.loadsound_total);
+                       SCR_PushLoadingScreen(cl.sound_name[cl.loadsound_current], 1.0 / cl.loadsound_total);
                        if (cl.sound_precache[cl.loadsound_current] && S_IsSoundPrecached(cl.sound_precache[cl.loadsound_current]))
                        {
                                SCR_PopLoadingScreen(false);
index 94d6ed102a740297d74d100495a591d692627dba..33963221cf21d48ed9d7b1bafb269d64719834c7 100644 (file)
@@ -2162,11 +2162,11 @@ static void SCR_DrawScreen (void)
                // 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);
+                       SCR_PushLoadingScreen(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);
+                       SCR_PushLoadingScreen(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_PushLoadingScreen(va(temp, sizeof(temp), "Connect: Waiting %i seconds for reply", 10 + cls.connect_remainingtries), 1.0);
                SCR_DrawLoadingScreen(true);
                SCR_PopLoadingScreen(false);
        }
@@ -2313,11 +2313,10 @@ static void SCR_SetLoadingScreenTexture(void)
 
 void SCR_UpdateLoadingScreenIfShown(void)
 {
-       if(loadingscreendone)
                SCR_UpdateLoadingScreen(loadingscreencleared, false);
 }
 
-void SCR_PushLoadingScreen (qboolean redraw, const char *msg, float len_in_parent)
+void SCR_PushLoadingScreen (const char *msg, float len_in_parent)
 {
        loadingscreenstack_t *s = (loadingscreenstack_t *) Z_Malloc(sizeof(loadingscreenstack_t));
        s->prev = loadingscreenstack;
@@ -2339,7 +2338,6 @@ void SCR_PushLoadingScreen (qboolean redraw, const char *msg, float len_in_paren
                s->absolute_loading_amount_len = 1;
        }
 
-       if(redraw)
                SCR_UpdateLoadingScreenIfShown();
 }
 
@@ -2545,13 +2543,6 @@ static void SCR_DrawLoadingScreen (qboolean clear)
        SCR_DrawLoadingStack();
 }
 
-static void SCR_DrawLoadingScreen_SharedFinish (qboolean clear)
-{
-       R_Mesh_Finish();
-       // refresh
-       VID_Finish();
-}
-
 static double loadingscreen_lastupdate;
 
 static void SCR_UpdateVars(void);
@@ -2574,10 +2565,7 @@ void SCR_UpdateLoadingScreen (qboolean clear, qboolean startup)
                loadingscreen_lastupdate = t;
        }
 
-       SCR_UpdateVars();
-
        // set up the r_texture_gammaramps texture which we need for rendering the loadingscreenpic
-       VID_UpdateGamma();
        R_UpdateVariables();
 
        if(!scr_loadingscreen_background.integer)
@@ -2630,7 +2618,11 @@ void SCR_UpdateLoadingScreen (qboolean clear, qboolean startup)
                SCR_DrawLoadingScreen(clear);
        }
 #endif
-       SCR_DrawLoadingScreen_SharedFinish(clear);
+
+       R_Mesh_Finish();
+       DrawQ_Finish();
+       // refresh
+       VID_Finish();
 
        // this goes into the event loop, and should prevent unresponsive cursor on vista
        old_key_dest = key_dest;
index 1e546719f171558f8ea726bc7f5b4535a9cb2738..811b26cb794e68cfa8f32dc5fe397ee125215052 100644 (file)
@@ -65,7 +65,7 @@ static void mod_start(void)
        int nummodels = (int)Mem_ExpandableArray_IndexRange(&models);
        dp_model_t *mod;
 
-       SCR_PushLoadingScreen(false, "Loading models", 1.0);
+       SCR_PushLoadingScreen("Loading models", 1.0);
        count = 0;
        for (i = 0;i < nummodels;i++)
                if ((mod = (dp_model_t*) Mem_ExpandableArray_RecordAtIndex(&models, i)) && mod->name[0] && mod->name[0] != '*')
@@ -75,7 +75,7 @@ static void mod_start(void)
                if ((mod = (dp_model_t*) Mem_ExpandableArray_RecordAtIndex(&models, i)) && mod->name[0] && mod->name[0] != '*')
                        if (mod->used)
                        {
-                               SCR_PushLoadingScreen(true, mod->name, 1.0 / count);
+                               SCR_PushLoadingScreen(mod->name, 1.0 / count);
                                Mod_LoadModel(mod, true, false);
                                SCR_PopLoadingScreen(false);
                        }
@@ -458,7 +458,7 @@ dp_model_t *Mod_LoadModel(dp_model_t *mod, qboolean crash, qboolean checkdisk)
        if (developer_loading.integer)
                Con_Printf("loading model %s\n", mod->name);
        
-       SCR_PushLoadingScreen(true, mod->name, 1);
+       SCR_PushLoadingScreen(mod->name, 1);
 
        // LadyHavoc: unload the existing model in this slot (if there is one)
        if (mod->loaded || mod->mempool)
@@ -638,7 +638,7 @@ void Mod_Reload(void)
        int nummodels = (int)Mem_ExpandableArray_IndexRange(&models);
        dp_model_t *mod;
 
-       SCR_PushLoadingScreen(false, "Reloading models", 1.0);
+       SCR_PushLoadingScreen("Reloading models", 1.0);
        count = 0;
        for (i = 0;i < nummodels;i++)
                if ((mod = (dp_model_t *) Mem_ExpandableArray_RecordAtIndex(&models, i)) && mod->name[0] && mod->name[0] != '*' && mod->used)
@@ -646,7 +646,7 @@ void Mod_Reload(void)
        for (i = 0;i < nummodels;i++)
                if ((mod = (dp_model_t *) Mem_ExpandableArray_RecordAtIndex(&models, i)) && mod->name[0] && mod->name[0] != '*' && mod->used)
                {
-                       SCR_PushLoadingScreen(true, mod->name, 1.0 / count);
+                       SCR_PushLoadingScreen(mod->name, 1.0 / count);
                        Mod_LoadModel(mod, true, true);
                        SCR_PopLoadingScreen(false);
                }
index 4d473244db46f261e0cc80843c3a4487e5ac5e03..02321150e5d09d8a2582dcccd1618be12610adc6 100644 (file)
--- a/screen.h
+++ b/screen.h
@@ -33,7 +33,7 @@ void SCR_UpdateLoadingScreen(qboolean clear, qboolean startup);
 void SCR_UpdateLoadingScreenIfShown(void);
 
 // pushes an item on the loading screen
-void SCR_PushLoadingScreen (qboolean redraw, const char *msg, float len_in_parent);
+void SCR_PushLoadingScreen (const char *msg, float len_in_parent);
 void SCR_PopLoadingScreen (qboolean redraw);
 void SCR_ClearLoadingScreen (qboolean redraw);
 
index 3991356c1be7f87f599cef2c98d45950b32fae4a..5588c64295b94f8cc263e6fd12651d55aa67ce0b 100644 (file)
--- a/snd_mem.c
+++ b/snd_mem.c
@@ -102,7 +102,7 @@ qboolean S_LoadSound (sfx_t *sfx, qboolean complain)
        if (developer_loading.integer)
                Con_Printf("loading sound %s\n", sfx->name);
 
-       SCR_PushLoadingScreen(true, sfx->name, 1);
+       SCR_PushLoadingScreen(sfx->name, 1);
 
        // LadyHavoc: if the sound filename does not begin with sound/, try adding it
        if (strncasecmp(sfx->name, "sound/", 6))