X-Git-Url: http://de.git.xonotic.org/?a=blobdiff_plain;f=r_modules.c;h=df260db6780f1de6006ebd44c4877e12a9948c34;hb=9b86a6e8c23d2c0b8a2b15cefc52e0d8d5902c3b;hp=f9ce9508d018376c41d89b0c4a1d741e7252dcfc;hpb=d57be67cb00229acb8564b92c8b7c58eeed8a0cb;p=xonotic%2Fdarkplaces.git diff --git a/r_modules.c b/r_modules.c index f9ce9508..df260db6 100644 --- a/r_modules.c +++ b/r_modules.c @@ -17,10 +17,7 @@ rendermodule_t rendermodule[MAXRENDERMODULES]; void R_Modules_Init(void) { - int i; - Cmd_AddCommand("r_restart", R_Modules_Restart); - for (i = 0;i < MAXRENDERMODULES;i++) - rendermodule[i].name = NULL; + Cmd_AddCommand("r_restart", R_Modules_Restart, "restarts renderer"); } void R_RegisterModule(char *name, void(*start)(void), void(*shutdown)(void), void(*newmap)(void)) @@ -31,10 +28,13 @@ void R_RegisterModule(char *name, void(*start)(void), void(*shutdown)(void), voi if (rendermodule[i].name == NULL) break; if (!strcmp(name, rendermodule[i].name)) - Sys_Error("R_RegisterModule: module \"%s\" registered twice\n", name); + { + Con_Printf("R_RegisterModule: module \"%s\" registered twice\n", name); + return; + } } if (i >= MAXRENDERMODULES) - Sys_Error("R_RegisterModule: ran out of renderer module slots (%i)\n", MAXRENDERMODULES); + Sys_Error("R_RegisterModule: ran out of renderer module slots (%i)", MAXRENDERMODULES); rendermodule[i].active = 0; rendermodule[i].name = name; rendermodule[i].start = start; @@ -50,7 +50,10 @@ void R_Modules_Start(void) if (rendermodule[i].name == NULL) continue; if (rendermodule[i].active) - Sys_Error("R_StartModules: module \"%s\" already active\n", rendermodule[i].name); + { + Con_Printf ("R_StartModules: module \"%s\" already active\n", rendermodule[i].name); + continue; + } rendermodule[i].active = 1; rendermodule[i].start(); } @@ -73,7 +76,8 @@ void R_Modules_Shutdown(void) void R_Modules_Restart(void) { - Con_Printf("restarting renderer\n"); + Host_StartVideo(); + Con_Print("restarting renderer\n"); R_Modules_Shutdown(); R_Modules_Start(); } @@ -90,3 +94,4 @@ void R_Modules_NewMap(void) rendermodule[i].newmap(); } } +