+ // if stuffcmds wasn't run, then quake.rc is probably missing, use default
+ if (!host_stuffcmdsrun)
+ {
+ Cbuf_AddText("exec default.cfg\nexec config.cfg\nexec autoexec.cfg\nstuffcmds\n");
+ Cbuf_Execute();
+ }
+
+ // put up the loading image so the user doesn't stare at a black screen...
+ SCR_BeginLoadingPlaque();
+
+ // FIXME: put this into some neat design, but the menu should be allowed to crash
+ // without crashing the whole game, so this should just be a short-time solution
+
+ // here comes the not so critical stuff
+ if (setjmp(host_abortframe)) {
+ return;
+ }
+
+ if (cls.state != ca_dedicated)
+ {
+ MR_Init();
+ }
+
+ // 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 = COM_CheckParm("-benchmark");
+ if (i && i + 1 < com_argc)
+ if (!sv.active && !cls.demoplayback && !cls.connect_trying)
+ {
+ Cbuf_AddText(va("timedemo %s\n", com_argv[i + 1]));
+ Cbuf_Execute();
+ }
+
+ // check for special demo mode
+// COMMANDLINEOPTION: Client: -demo <demoname> runs a playdemo and quits
+ i = COM_CheckParm("-demo");
+ if (i && i + 1 < com_argc)
+ if (!sv.active && !cls.demoplayback && !cls.connect_trying)
+ {
+ Cbuf_AddText(va("playdemo %s\n", com_argv[i + 1]));
+ Cbuf_Execute();
+ }
+
+ // check for special demolooponly mode
+// COMMANDLINEOPTION: Client: -demolooponly <demoname> runs a playdemo and quits
+ i = COM_CheckParm("-demolooponly");
+ if (i && i + 1 < com_argc)
+ if (!sv.active && !cls.demoplayback && !cls.connect_trying)
+ {
+ Cbuf_AddText(va("playdemo %s\n", com_argv[i + 1]));
+ Cbuf_Execute();
+ }
+
+ if (cls.state == ca_dedicated || COM_CheckParm("-listen"))
+ if (!sv.active && !cls.demoplayback && !cls.connect_trying)
+ {
+ Cbuf_AddText("startmap_dm\n");
+ Cbuf_Execute();
+ }
+
+ if (!sv.active && !cls.demoplayback && !cls.connect_trying)
+ {
+ if (gamemode == GAME_NEXUIZ)
+ Cbuf_AddText("togglemenu\nplayvideo logo\ncd loop 1\n");
+ else
+ Cbuf_AddText("togglemenu\n");
+ Cbuf_Execute();