]> de.git.xonotic.org Git - xonotic/darkplaces.git/blobdiff - vid_shared.c
reworked the entire config loading system for the gamedir command
[xonotic/darkplaces.git] / vid_shared.c
index 05c5bea5b0e0b3eb784e95708ed2a7dad3f5209c..8335b14dc92e9591ff0e8a9611b87bd896db4f4e 100644 (file)
@@ -1279,6 +1279,7 @@ static void VID_CloseSystems(void)
 }
 
 qboolean vid_commandlinecheck = true;
+extern qboolean vid_opened;
 
 void VID_Restart_f(void)
 {
@@ -1286,6 +1287,12 @@ void VID_Restart_f(void)
        if (vid_commandlinecheck)
                return;
 
+       if (!vid_opened)
+       {
+               SCR_BeginLoadingPlaque();
+               return;
+       }
+
        Con_Printf("VID_Restart: changing from %s %dx%dx%dbpp%s%s, to %s %dx%dx%dbpp%s%s.\n",
                vid.mode.fullscreen ? "fullscreen" : "window", vid.mode.width, vid.mode.height, vid.mode.bitsperpixel, vid.mode.fullscreen && vid.mode.userefreshrate ? va("x%.2fhz", vid.mode.refreshrate) : "", vid.mode.samples > 1 ? va(" (%ix AA)", vid.mode.samples) : "",
                vid_fullscreen.integer ? "fullscreen" : "window", vid_width.integer, vid_height.integer, vid_bitsperpixel.integer, vid_fullscreen.integer && vid_userefreshrate.integer ? va("x%.2fhz", vid_refreshrate.value) : "", vid_samples.integer > 1 ? va(" (%ix AA)", vid_samples.integer) : "");
@@ -1311,7 +1318,7 @@ const char *vidfallbacks[][2] =
        {NULL, NULL}
 };
 
-// this is only called once by Host_StartVideo
+// this is only called once by Host_StartVideo and again on each FS_GameDir_f
 void VID_Start(void)
 {
        int i, width, height, success;
@@ -1361,6 +1368,12 @@ void VID_Start(void)
        VID_OpenSystems();
 }
 
+void VID_Stop(void)
+{
+       VID_CloseSystems();
+       VID_Shutdown();
+}
+
 int VID_SortModes_Compare(const void *a_, const void *b_)
 {
        vid_mode_t *a = (vid_mode_t *) a_;