CL_Video_Init();
host.hook.ConnectLocal = CL_EstablishConnection_Local;
-
- #ifdef CONFIG_MENU
- Cbuf_InsertText(&cmd_client,"menu_start\n");
- #endif
}
}
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)
{
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 <demoname> 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");
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");
}
MR_SetRouting (true);
else
MR_SetRouting (false);
- menu_active = true;
}
return mod;
}
+extern qbool vid_opened;
+
/*
==================
Mod_ForName
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);