typedef struct rendermodule_s
{
int active; // set by start, cleared by shutdown
- char *name;
+ const char *name;
void(*start)(void);
void(*shutdown)(void);
void(*newmap)(void);
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(char *name, void(*start)(void), void(*shutdown)(void), void(*newmap)(void), void(*devicelost)(void), void(*devicerestored)(void))
+void R_RegisterModule(const char *name, void(*start)(void), void(*shutdown)(void), void(*newmap)(void), void(*devicelost)(void), void(*devicerestored)(void))
{
int i;
for (i = 0;i < MAXRENDERMODULES;i++)
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();
}
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");
+ SCR_BeginLoadingPlaque(false);
R_Modules_Shutdown();
R_Modules_Start();
}