X-Git-Url: http://git.xonotic.org/?a=blobdiff_plain;f=r_modules.c;h=96e33e2f4761fe5908e85aa9257bf37b4242f19d;hb=refs%2Fmerge-requests%2F130%2Fhead;hp=541ef0439ea11ef6b811d0017c1c754b7a40c1d6;hpb=ac26fe8251232ec2eb02c89b9df3d07444063211;p=xonotic%2Fdarkplaces.git diff --git a/r_modules.c b/r_modules.c index 541ef043..96e33e2f 100644 --- a/r_modules.c +++ b/r_modules.c @@ -6,7 +6,7 @@ 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); @@ -19,10 +19,10 @@ 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(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++) @@ -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(); }