From a035d32e710d33edea0813ca39c052fa1aee810f Mon Sep 17 00:00:00 2001 From: terminx Date: Wed, 11 Feb 2015 05:22:55 +0000 Subject: [PATCH] Smooth out the loading bar so that all percentage increments are displayed for at least a couple of frames each, and remove the "loaded x/x textures" message on Android. git-svn-id: https://svn.eduke32.com/eduke32@4999 1a8010ca-5511-0410-912e-c29ae57300e0 --- polymer/eduke32/source/premap.c | 24 +++++++++++++++++++++--- 1 file changed, 21 insertions(+), 3 deletions(-) diff --git a/polymer/eduke32/source/premap.c b/polymer/eduke32/source/premap.c index 9a14ca499..46772936d 100644 --- a/polymer/eduke32/source/premap.c +++ b/polymer/eduke32/source/premap.c @@ -372,7 +372,9 @@ static void G_DoLoadScreen(const char *statustext, int32_t percent) menutext(160,90+16+8,0,0,MapInfo[(ud.volume_number*MAXLEVELS) + ud.level_number].name); } +#ifndef EDUKE32_TOUCH_DEVICES if (statustext) gametext(160,180,statustext,0,2+8+16); +#endif if (percent != -1) { @@ -482,6 +484,8 @@ void G_CacheMapData(void) tc = totalclock; j = 0; + int lpc = -1; + for (i=0; i>3]) @@ -546,9 +550,23 @@ void G_CacheMapData(void) if (bpp > 8 && totalclock - tc > TICRATE/4) { /*Bsprintf(tempbuf,"%d resources remaining\n",g_precacheCount-pc+1);*/ - tc = min(100, tabledivide32_noinline(100 * pc, g_precacheCount)); - Bsprintf(tempbuf,"Loaded %d%% (%d/%d textures)\n",tc,pc,g_precacheCount); - G_DoLoadScreen(tempbuf, tc); + int percentage = min(100, tabledivide32_noinline(100 * pc, g_precacheCount)); + + while (percentage > lpc) + { + Bsprintf(tempbuf, "Loaded %d%% (%d/%d textures)\n", lpc, pc, g_precacheCount); + G_DoLoadScreen(tempbuf, lpc); + sampletimer(); + + if (totalclock - tc >= 1) + { + tc = totalclock; + lpc++; + } + + OSD_Printf("percentage %d lpc %d\n", percentage, lpc); + } + tc = totalclock; } }