]> git.xonotic.org Git - xonotic/darkplaces.git/blobdiff - r_modules.c
Add cvar snd_cdautopause: optional CD track pause during game pause
[xonotic/darkplaces.git] / r_modules.c
index 818637e8467d67100f0e75e6291d403403a40c8e..96e33e2f4761fe5908e85aa9257bf37b4242f19d 100644 (file)
@@ -19,7 +19,7 @@ rendermodule_t rendermodule[MAXRENDERMODULES];
 
 void R_Modules_Init(void)
 {
-       Cmd_AddCommand("r_restart", R_Modules_Restart, "restarts renderer");
+       Cmd_AddCommand(CF_CLIENT, "r_restart", R_Modules_Restart_f, "restarts renderer");
 }
 
 void R_RegisterModule(const char *name, void(*start)(void), void(*shutdown)(void), void(*newmap)(void), void(*devicelost)(void), void(*devicerestored)(void))
@@ -55,9 +55,10 @@ void R_Modules_Start(void)
                        continue;
                if (rendermodule[i].active)
                {
-                       Con_Printf ("R_StartModules: module \"%s\" already active\n", rendermodule[i].name);
+                       Con_Printf ("R_Modules_Start: module \"%s\" already active\n", rendermodule[i].name);
                        continue;
                }
+               Con_DPrintf("Starting render module \"%s\"\n", rendermodule[i].name);
                rendermodule[i].active = 1;
                rendermodule[i].start();
        }
@@ -73,15 +74,16 @@ void R_Modules_Shutdown(void)
                        continue;
                if (!rendermodule[i].active)
                        continue;
+               Con_DPrintf("Stopping render module \"%s\"\n", rendermodule[i].name);
                rendermodule[i].active = 0;
                rendermodule[i].shutdown();
        }
 }
 
-void R_Modules_Restart(void)
+void R_Modules_Restart_f(cmd_state_t *cmd)
 {
-       Host_StartVideo();
-       Con_Print("restarting renderer\n");
+       CL_StartVideo();
+       Con_Print("Restarting renderer\n");
        R_Modules_Shutdown();
        R_Modules_Start();
 }