mirror of
https://github.com/KartKrewDev/RingRacers.git
synced 2025-12-24 00:42:32 +00:00
* Add a seperate step for I_STARTUPSKINS - "Load characters" - since it takes a similar length to loading all other types of sprites.
* Adjust several loading strings, and left-align their rendering.
* Don't call HU_LoadGraphics() again (startup cached ALL FONTS twice).
* Adjust when some functions are called during loading to more effectively compartmentalise sections of loading that depend on each other.
* LOADED_ISTARTUPGRAPHICS now comes after SCR_Startup, as we can explicitly guarantee the palette has been loaded after that function.
* Make sure everything closely related to configurations (gamedata, console stuff, etc) which is not directly dependent on anything else is loaded under LOADED_CONFIG - "Load settings" (formerly LOADED_MINIT).
* The `-warp` command line parameter is now checked alongside LOADED_DCHECKNETGAME.
* Don't attempt to draw the loading bar before LOADED_ISTARTUPGRAPHICS, as the palette is not loaded, which means you're wasting cycles on a white screen.
This commit is contained in:
parent
c3c5096ca2
commit
72defa325f
7 changed files with 67 additions and 68 deletions
|
|
@ -1880,21 +1880,23 @@ void CON_Drawer(void)
|
||||||
Unlock_state();
|
Unlock_state();
|
||||||
}
|
}
|
||||||
|
|
||||||
static const char *CON_LoadingStrings[LOADED_ALLDONE] =
|
static const char *CON_LoadingStrings[LOADED_ALLDONE+1] =
|
||||||
{
|
{
|
||||||
"Init Zone Memory...", //LOADED_ZINIT
|
"Init zone memory...", //LOADED_ZINIT
|
||||||
"Init game timing...", //LOADED_ISTARTUPTIMER
|
"Init game timing...", //LOADED_ISTARTUPTIMER
|
||||||
"Loading main assets...", //LOADED_IWAD
|
"Loading main assets...", //LOADED_IWAD
|
||||||
"Loading add-ons...", //LOADED_PWAD
|
"Loading add-ons...", //LOADED_PWAD
|
||||||
"Init graphics subsystem...", //LOADED_ISTARTUPGRAPHICS
|
"Init graphics subsystem...", //LOADED_ISTARTUPGRAPHICS
|
||||||
"Cache fonts...", //LOADED_HULOADGRAPHICS
|
"Cache fonts...", //LOADED_HUINIT
|
||||||
"Init miscellaneous...", //LOADED_MINIT
|
"Load settings...", //LOADED_CONFIG
|
||||||
"Cache textures...", //LOADED_INITTEXTUREDATA
|
"Cache textures...", //LOADED_INITTEXTUREDATA
|
||||||
"Cache sprites...", //LOADED_INITSPIRTES
|
"Cache sprites...", //LOADED_INITSPIRTES
|
||||||
|
"Load characters...", //LOADED_INITSKINS
|
||||||
"Init rendering daemon...", //LOADED_RINIT
|
"Init rendering daemon...", //LOADED_RINIT
|
||||||
"Init audio subsystem...", //LOADED_SINITSFXCHANNELS
|
"Init audio subsystem...", //LOADED_SINITSFXCHANNELS
|
||||||
"Cache HUD...", //LOADED_STINIT
|
"Cache HUD...", //LOADED_STINIT
|
||||||
"Check game status...", //LOADED_DCHECKNETGAME
|
"Check game status...", //LOADED_DCHECKNETGAME
|
||||||
|
"Now starting..."
|
||||||
}; // see also con_loadprogress_t in console.h
|
}; // see also con_loadprogress_t in console.h
|
||||||
|
|
||||||
//
|
//
|
||||||
|
|
@ -1912,9 +1914,11 @@ void CON_SetLoadingProgress(con_loadprogress_t newStep)
|
||||||
|
|
||||||
con_startup_loadprogress = newStep;
|
con_startup_loadprogress = newStep;
|
||||||
|
|
||||||
if (con_startup_loadprogress < LOADED_ALLDONE)
|
if (con_startup_loadprogress <= LOADED_ALLDONE)
|
||||||
CONS_Printf("LOADING UPDATE - %s\n", CON_LoadingStrings[con_startup_loadprogress]);
|
CONS_Printf("LOADING UPDATE - %s\n", CON_LoadingStrings[con_startup_loadprogress]);
|
||||||
|
|
||||||
|
if (con_startup_loadprogress < LOADED_ISTARTUPGRAPHICS) // rendering not possible?
|
||||||
|
return;
|
||||||
CON_DrawLoadBar(); // here we display the console text
|
CON_DrawLoadBar(); // here we display the console text
|
||||||
I_FinishUpdate(); // page flip or blit buffer
|
I_FinishUpdate(); // page flip or blit buffer
|
||||||
}
|
}
|
||||||
|
|
@ -1940,8 +1944,8 @@ void CON_DrawLoadBar(void)
|
||||||
barwidth = (BASEVIDWIDTH * con_startup_loadprogress) / LOADED_ALLDONE;
|
barwidth = (BASEVIDWIDTH * con_startup_loadprogress) / LOADED_ALLDONE;
|
||||||
V_DrawFill(0, BASEVIDHEIGHT - barheight, barwidth, barheight, 0);
|
V_DrawFill(0, BASEVIDHEIGHT - barheight, barwidth, barheight, 0);
|
||||||
#ifdef DEVELOP
|
#ifdef DEVELOP
|
||||||
if (con_startup_loadprogress < LOADED_ALLDONE)
|
if (con_startup_loadprogress <= LOADED_ALLDONE)
|
||||||
V_DrawCenteredString(BASEVIDWIDTH/2, BASEVIDHEIGHT - (barheight + 8 + 4), 0, CON_LoadingStrings[con_startup_loadprogress]);
|
V_DrawString(4, BASEVIDHEIGHT - (barheight + 8 + 4), 0, CON_LoadingStrings[con_startup_loadprogress]);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
Unlock_state();
|
Unlock_state();
|
||||||
|
|
|
||||||
|
|
@ -36,10 +36,11 @@ typedef enum
|
||||||
LOADED_IWAD,
|
LOADED_IWAD,
|
||||||
LOADED_PWAD,
|
LOADED_PWAD,
|
||||||
LOADED_ISTARTUPGRAPHICS,
|
LOADED_ISTARTUPGRAPHICS,
|
||||||
LOADED_HULOADGRAPHICS,
|
LOADED_HUINIT,
|
||||||
LOADED_MINIT,
|
LOADED_CONFIG,
|
||||||
LOADED_INITTEXTUREDATA,
|
LOADED_INITTEXTUREDATA,
|
||||||
LOADED_INITSPRITES,
|
LOADED_INITSPRITES,
|
||||||
|
LOADED_INITSKINS,
|
||||||
LOADED_RINIT,
|
LOADED_RINIT,
|
||||||
LOADED_SINITSFXCHANNELS,
|
LOADED_SINITSFXCHANNELS,
|
||||||
LOADED_STINIT,
|
LOADED_STINIT,
|
||||||
|
|
|
||||||
67
src/d_main.c
67
src/d_main.c
|
|
@ -1434,7 +1434,6 @@ void D_SRB2Main(void)
|
||||||
|
|
||||||
CONS_Printf("I_StartupGraphics()...\n");
|
CONS_Printf("I_StartupGraphics()...\n");
|
||||||
I_StartupGraphics();
|
I_StartupGraphics();
|
||||||
CON_SetLoadingProgress(LOADED_ISTARTUPGRAPHICS);
|
|
||||||
|
|
||||||
#ifdef HWRENDER
|
#ifdef HWRENDER
|
||||||
// Lactozilla: Add every hardware mode CVAR and CCMD.
|
// Lactozilla: Add every hardware mode CVAR and CCMD.
|
||||||
|
|
@ -1447,10 +1446,15 @@ void D_SRB2Main(void)
|
||||||
// setup loading screen
|
// setup loading screen
|
||||||
SCR_Startup();
|
SCR_Startup();
|
||||||
|
|
||||||
|
CON_SetLoadingProgress(LOADED_ISTARTUPGRAPHICS);
|
||||||
|
|
||||||
|
CONS_Printf("HU_Init()...\n");
|
||||||
HU_Init();
|
HU_Init();
|
||||||
|
|
||||||
CON_Init();
|
CON_Init();
|
||||||
|
|
||||||
|
CON_SetLoadingProgress(LOADED_HUINIT);
|
||||||
|
|
||||||
memset(timelimits, 0, sizeof(timelimits));
|
memset(timelimits, 0, sizeof(timelimits));
|
||||||
memset(pointlimits, 0, sizeof(pointlimits));
|
memset(pointlimits, 0, sizeof(pointlimits));
|
||||||
|
|
||||||
|
|
@ -1463,14 +1467,10 @@ void D_SRB2Main(void)
|
||||||
|
|
||||||
I_RegisterSysCommands();
|
I_RegisterSysCommands();
|
||||||
|
|
||||||
CONS_Printf("HU_LoadGraphics()...\n");
|
|
||||||
HU_LoadGraphics();
|
|
||||||
CON_SetLoadingProgress(LOADED_HULOADGRAPHICS);
|
|
||||||
|
|
||||||
//--------------------------------------------------------- CONFIG.CFG
|
//--------------------------------------------------------- CONFIG.CFG
|
||||||
M_FirstLoadConfig(); // WARNING : this do a "COM_BufExecute()"
|
M_FirstLoadConfig(); // WARNING : this do a "COM_BufExecute()"
|
||||||
|
|
||||||
G_LoadGameData();
|
M_Init();
|
||||||
|
|
||||||
#if (defined (__unix__) && !defined (MSDOS)) || defined (UNIXCOMMON) || defined (HAVE_SDL)
|
#if (defined (__unix__) && !defined (MSDOS)) || defined (UNIXCOMMON) || defined (HAVE_SDL)
|
||||||
VID_PrepareModeList(); // Regenerate Modelist according to cv_fullscreen
|
VID_PrepareModeList(); // Regenerate Modelist according to cv_fullscreen
|
||||||
|
|
@ -1479,36 +1479,18 @@ void D_SRB2Main(void)
|
||||||
// set user default mode or mode set at cmdline
|
// set user default mode or mode set at cmdline
|
||||||
SCR_CheckDefaultMode();
|
SCR_CheckDefaultMode();
|
||||||
|
|
||||||
|
if (M_CheckParm("-noupload"))
|
||||||
|
COM_BufAddText("downloading 0\n");
|
||||||
|
|
||||||
|
G_LoadGameData();
|
||||||
|
|
||||||
wipegamestate = gamestate;
|
wipegamestate = gamestate;
|
||||||
|
|
||||||
savedata.lives = 0; // flag this as not-used
|
savedata.lives = 0; // flag this as not-used
|
||||||
|
|
||||||
//------------------------------------------------ COMMAND LINE PARAMS
|
CON_SetLoadingProgress(LOADED_CONFIG);
|
||||||
|
|
||||||
// this must be done after loading gamedata,
|
|
||||||
// to avoid setting off the corrupted gamedata code in G_LoadGameData if a SOC with custom gamedata is added
|
|
||||||
// -- Monster Iestyn 20/02/20
|
|
||||||
if (M_CheckParm("-warp") && M_IsNextParm())
|
|
||||||
{
|
|
||||||
const char *word = M_GetNextParm();
|
|
||||||
pstartmap = G_FindMapByNameOrCode(word, 0);
|
|
||||||
if (! pstartmap)
|
|
||||||
I_Error("Cannot find a map remotely named '%s'\n", word);
|
|
||||||
else
|
|
||||||
{
|
|
||||||
if (!M_CheckParm("-server"))
|
|
||||||
G_SetGameModified(multiplayer, true);
|
|
||||||
autostart = true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (M_CheckParm("-noupload"))
|
|
||||||
COM_BufAddText("downloading 0\n");
|
|
||||||
|
|
||||||
CONS_Printf("M_Init(): Init miscellaneous info.\n");
|
|
||||||
M_Init();
|
|
||||||
CON_SetLoadingProgress(LOADED_MINIT);
|
|
||||||
|
|
||||||
|
CONS_Printf("R_InitTextureData()...\n");
|
||||||
R_InitTextureData(); // seperated out from below because it takes ages by itself
|
R_InitTextureData(); // seperated out from below because it takes ages by itself
|
||||||
CON_SetLoadingProgress(LOADED_INITTEXTUREDATA);
|
CON_SetLoadingProgress(LOADED_INITTEXTUREDATA);
|
||||||
|
|
||||||
|
|
@ -1516,6 +1498,10 @@ void D_SRB2Main(void)
|
||||||
R_InitSprites(); // ditto
|
R_InitSprites(); // ditto
|
||||||
CON_SetLoadingProgress(LOADED_INITSPRITES);
|
CON_SetLoadingProgress(LOADED_INITSPRITES);
|
||||||
|
|
||||||
|
CONS_Printf("R_InitSkins()...\n");
|
||||||
|
R_InitSkins(); // ditto
|
||||||
|
CON_SetLoadingProgress(LOADED_INITSKINS);
|
||||||
|
|
||||||
CONS_Printf("R_Init(): Init SRB2 refresh daemon.\n");
|
CONS_Printf("R_Init(): Init SRB2 refresh daemon.\n");
|
||||||
R_Init();
|
R_Init();
|
||||||
CON_SetLoadingProgress(LOADED_RINIT);
|
CON_SetLoadingProgress(LOADED_RINIT);
|
||||||
|
|
@ -1562,6 +1548,25 @@ void D_SRB2Main(void)
|
||||||
ST_Init();
|
ST_Init();
|
||||||
CON_SetLoadingProgress(LOADED_STINIT);
|
CON_SetLoadingProgress(LOADED_STINIT);
|
||||||
|
|
||||||
|
//------------------------------------------------ COMMAND LINE PARAMS
|
||||||
|
|
||||||
|
// this must be done after loading gamedata,
|
||||||
|
// to avoid setting off the corrupted gamedata code in G_LoadGameData if a SOC with custom gamedata is added
|
||||||
|
// -- Monster Iestyn 20/02/20
|
||||||
|
if (M_CheckParm("-warp") && M_IsNextParm())
|
||||||
|
{
|
||||||
|
const char *word = M_GetNextParm();
|
||||||
|
pstartmap = G_FindMapByNameOrCode(word, 0);
|
||||||
|
if (! pstartmap)
|
||||||
|
I_Error("Cannot find a map remotely named '%s'\n", word);
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if (!M_CheckParm("-server"))
|
||||||
|
G_SetGameModified(multiplayer, true);
|
||||||
|
autostart = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Set up splitscreen players before joining!
|
// Set up splitscreen players before joining!
|
||||||
if (!dedicated && (M_CheckParm("-splitscreen") && M_IsNextParm()))
|
if (!dedicated && (M_CheckParm("-splitscreen") && M_IsNextParm()))
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -3466,8 +3466,6 @@ void M_Init(void)
|
||||||
{
|
{
|
||||||
UINT8 i;
|
UINT8 i;
|
||||||
|
|
||||||
COM_AddCommand("manual", Command_Manual_f);
|
|
||||||
|
|
||||||
CV_RegisterVar(&cv_nextmap);
|
CV_RegisterVar(&cv_nextmap);
|
||||||
CV_RegisterVar(&cv_newgametype);
|
CV_RegisterVar(&cv_newgametype);
|
||||||
CV_RegisterVar(&cv_chooseskin);
|
CV_RegisterVar(&cv_chooseskin);
|
||||||
|
|
@ -3476,6 +3474,8 @@ void M_Init(void)
|
||||||
if (dedicated)
|
if (dedicated)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
COM_AddCommand("manual", Command_Manual_f);
|
||||||
|
|
||||||
// Menu hacks
|
// Menu hacks
|
||||||
CV_RegisterVar(&cv_dummymenuplayer);
|
CV_RegisterVar(&cv_dummymenuplayer);
|
||||||
CV_RegisterVar(&cv_dummyteam);
|
CV_RegisterVar(&cv_dummyteam);
|
||||||
|
|
|
||||||
|
|
@ -133,9 +133,11 @@ static void Sk_SetDefaultValue(skin_t *skin)
|
||||||
//
|
//
|
||||||
void R_InitSkins(void)
|
void R_InitSkins(void)
|
||||||
{
|
{
|
||||||
#ifdef SKINVALUES
|
size_t i;
|
||||||
INT32 i;
|
|
||||||
|
|
||||||
|
// it can be is do before loading config for skin cvar possible value
|
||||||
|
// (... what the fuck did you just say to me? "it can be is do"?)
|
||||||
|
#ifdef SKINVALUES
|
||||||
for (i = 0; i <= MAXSKINS; i++)
|
for (i = 0; i <= MAXSKINS; i++)
|
||||||
{
|
{
|
||||||
skin_cons_t[i].value = 0;
|
skin_cons_t[i].value = 0;
|
||||||
|
|
@ -145,6 +147,14 @@ void R_InitSkins(void)
|
||||||
|
|
||||||
// no default skin!
|
// no default skin!
|
||||||
numskins = 0;
|
numskins = 0;
|
||||||
|
|
||||||
|
for (i = 0; i < numwadfiles; i++)
|
||||||
|
{
|
||||||
|
R_AddSkins((UINT16)i);
|
||||||
|
R_PatchSkins((UINT16)i);
|
||||||
|
R_LoadSpriteInfoLumps(i, wadfiles[i]->numlumps);
|
||||||
|
}
|
||||||
|
ST_ReloadSkinFaceGraphics();
|
||||||
}
|
}
|
||||||
|
|
||||||
UINT32 R_GetSkinAvailabilities(void)
|
UINT32 R_GetSkinAvailabilities(void)
|
||||||
|
|
|
||||||
|
|
@ -546,30 +546,6 @@ void R_InitSprites(void)
|
||||||
for (i = 0; i < numwadfiles; i++)
|
for (i = 0; i < numwadfiles; i++)
|
||||||
R_AddSpriteDefs((UINT16)i);
|
R_AddSpriteDefs((UINT16)i);
|
||||||
|
|
||||||
//
|
|
||||||
// now check for skins
|
|
||||||
//
|
|
||||||
|
|
||||||
// it can be is do before loading config for skin cvar possible value
|
|
||||||
// (... what the fuck did you just say to me? "it can be is do"?)
|
|
||||||
#ifdef SKINVALUES
|
|
||||||
for (i = 0; i <= MAXSKINS; i++)
|
|
||||||
{
|
|
||||||
skin_cons_t[i].value = 0;
|
|
||||||
skin_cons_t[i].strvalue = NULL;
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
numskins = 0;
|
|
||||||
|
|
||||||
for (i = 0; i < numwadfiles; i++)
|
|
||||||
{
|
|
||||||
R_AddSkins((UINT16)i);
|
|
||||||
R_PatchSkins((UINT16)i);
|
|
||||||
R_LoadSpriteInfoLumps(i, wadfiles[i]->numlumps);
|
|
||||||
}
|
|
||||||
ST_ReloadSkinFaceGraphics();
|
|
||||||
|
|
||||||
//
|
//
|
||||||
// check if all sprites have frames
|
// check if all sprites have frames
|
||||||
//
|
//
|
||||||
|
|
|
||||||
|
|
@ -131,6 +131,9 @@ static boolean InitCube(void)
|
||||||
float globalgammamul, globalgammaoffs;
|
float globalgammamul, globalgammaoffs;
|
||||||
boolean doinggamma;
|
boolean doinggamma;
|
||||||
|
|
||||||
|
if (con_startup_loadprogress < LOADED_MINIT)
|
||||||
|
return false;
|
||||||
|
|
||||||
#define diffcons(cv) (cv.value != atoi(cv.defaultvalue))
|
#define diffcons(cv) (cv.value != atoi(cv.defaultvalue))
|
||||||
|
|
||||||
doinggamma = diffcons(cv_globalgamma);
|
doinggamma = diffcons(cv_globalgamma);
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue