From: cloudwalk Date: Thu, 17 Sep 2020 05:18:04 +0000 (+0000) Subject: Restore old video init behavior, pending better solution. Fixes Steel Storm crash... X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=acdd55a695050845def0dce89ea84b06cb990b0a;p=xonotic%2Fdarkplaces.git Restore old video init behavior, pending better solution. Fixes Steel Storm crash and broken texture overrides in Quake Epsilon. git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@12929 d7cf8633-e32d-0410-b094-e92efae38249 --- diff --git a/cl_main.c b/cl_main.c index 6ded3684..b7f26af0 100644 --- a/cl_main.c +++ b/cl_main.c @@ -3056,9 +3056,5 @@ void CL_Init (void) CL_Video_Init(); host.hook.ConnectLocal = CL_EstablishConnection_Local; - - #ifdef CONFIG_MENU - Cbuf_InsertText(&cmd_client,"menu_start\n"); - #endif } } diff --git a/cmd.c b/cmd.c index a6d76726..3b3fdfd1 100644 --- a/cmd.c +++ b/cmd.c @@ -524,10 +524,6 @@ static void Cmd_StuffCmds_f (cmd_state_t *cmd) int i, j, l; // this is for all commandline options combined (and is bounds checked) char build[MAX_INPUTLINE]; - - // come back later so we don't crash - if(host.state == host_init) - return; if (Cmd_Argc (cmd) != 1) { diff --git a/host.c b/host.c index fbab532d..65c22bc8 100644 --- a/host.c +++ b/host.c @@ -721,28 +721,27 @@ static void Host_Init (void) return; } - Host_StartVideo(); - Host_AddConfigText(cmd); // if quake.rc is missing, use default if (!FS_FileExists("quake.rc")) { - Cbuf_InsertText(cmd, "exec default.cfg\nexec " CONFIGFILENAME "\nexec autoexec.cfg\n"); + Cbuf_AddText(cmd, "exec default.cfg\nexec " CONFIGFILENAME "\nexec autoexec.cfg\n"); Cbuf_Execute(cmd->cbuf); } host.state = host_active; - // run stuffcmds now, deferred previously because it can crash if a server starts that early - Cbuf_AddText(cmd,"stuffcmds\n"); - Cbuf_Execute(cmd->cbuf); + Host_StartVideo(); Log_Start(); // put up the loading image so the user doesn't stare at a black screen... SCR_BeginLoadingPlaque(true); - +#ifdef CONFIG_MENU + if (cls.state != ca_dedicated) + MR_Init(); +#endif // check for special benchmark mode // COMMANDLINEOPTION: Client: -benchmark runs a timedemo and quits, results of any timedemo can be found in gamedir/benchmark.log (for example id1/benchmark.log) i = Sys_CheckParm("-benchmark"); diff --git a/menu.c b/menu.c index 33e01caa..481be878 100644 --- a/menu.c +++ b/menu.c @@ -5472,23 +5472,12 @@ static void Call_MR_ToggleMenu_f(cmd_state_t *cmd) MR_ToggleMenu(m); } -static qbool menu_active; - -static void MR_Start_f(cmd_state_t *cmd) -{ - if(menu_active || cls.state == ca_dedicated) - return; - MR_Init(); - -} - void MR_Init_Commands(void) { // set router console commands Cvar_RegisterVariable (&forceqmenu); Cvar_RegisterVariable (&menu_options_colorcontrol_correctionvalue); Cvar_RegisterVariable (&menu_progs); - Cmd_AddCommand(CF_CLIENT, "menu_start", MR_Start_f, "initialize the menu system"); Cmd_AddCommand(CF_CLIENT, "menu_restart", MR_Restart_f, "restart menu system (reloads menu.dat)"); Cmd_AddCommand(CF_CLIENT, "togglemenu", Call_MR_ToggleMenu_f, "opens or closes menu"); } @@ -5629,5 +5618,4 @@ void MR_Init(void) MR_SetRouting (true); else MR_SetRouting (false); - menu_active = true; } diff --git a/model_shared.c b/model_shared.c index 4c66d78e..91ba91e0 100644 --- a/model_shared.c +++ b/model_shared.c @@ -626,6 +626,8 @@ dp_model_t *Mod_FindName(const char *name, const char *parentname) return mod; } +extern qbool vid_opened; + /* ================== Mod_ForName @@ -636,6 +638,11 @@ Loads in a model for the given name dp_model_t *Mod_ForName(const char *name, qbool crash, qbool checkdisk, const char *parentname) { dp_model_t *model; + + // FIXME: So we don't crash if a server is started early. + if(!vid_opened) + Host_StartVideo(); + model = Mod_FindName(name, parentname); if (!model->loaded || checkdisk) Mod_LoadModel(model, crash, checkdisk);