Cmd_AddCommand( "gecko_injecttext", cl_gecko_injecttext_f, "Injects text into a browser" );
Cmd_AddCommand( "gecko_movecursor", gl_gecko_movecursor_f, "Move the cursor to a certain position" );
- R_RegisterModule( "CL_Gecko", cl_gecko_start, cl_gecko_shutdown, cl_gecko_newmap );
+ R_RegisterModule( "CL_Gecko", cl_gecko_start, cl_gecko_shutdown, cl_gecko_newmap, NULL, NULL );
}
void CL_Gecko_NavigateToURI( clgecko_t *instance, const char *URI ) {
Cvar_RegisterVariable(&r_drawparticles_drawdistance);
Cvar_RegisterVariable(&r_drawdecals);
Cvar_RegisterVariable(&r_drawdecals_drawdistance);
- R_RegisterModule("R_Particles", r_part_start, r_part_shutdown, r_part_newmap);
+ R_RegisterModule("R_Particles", r_part_start, r_part_shutdown, r_part_newmap, NULL, NULL);
}
void R_DrawDecal_TransparentCallback(const entity_render_t *ent, const rtlight_t *rtlight, int numsurfaces, int *surfacelist)
Cvar_RegisterVariable(&cl_video_brightness);
Cvar_RegisterVariable(&cl_video_stipple);
- R_RegisterModule( "CL_Video", cl_video_start, cl_video_shutdown, cl_video_newmap );
+ R_RegisterModule( "CL_Video", cl_video_start, cl_video_shutdown, cl_video_newmap, NULL, NULL );
}
Cmd_AddCommand("gl_vbostats", GL_VBOStats_f, "prints a list of all buffer objects (vertex data and triangle elements) and total video memory used by them");
- R_RegisterModule("GL_Backend", gl_backend_start, gl_backend_shutdown, gl_backend_newmap);
+ R_RegisterModule("GL_Backend", gl_backend_start, gl_backend_shutdown, gl_backend_newmap, NULL, NULL);
}
void GL_SetMirrorState(qboolean state);
dpsnprintf(FONT_USER(i)->title, sizeof(FONT_USER(i)->title), "user%d", j++);
Cmd_AddCommand ("loadfont",LoadFont_f, "loadfont function tganame loads a font; example: loadfont console gfx/veramono; loadfont without arguments lists the available functions");
- R_RegisterModule("GL_Draw", gl_draw_start, gl_draw_shutdown, gl_draw_newmap);
+ R_RegisterModule("GL_Draw", gl_draw_start, gl_draw_shutdown, gl_draw_newmap, NULL, NULL);
}
void _DrawQ_Setup(void)
Cvar_RegisterVariable(&r_framedatasize);
if (gamemode == GAME_NEHAHRA || gamemode == GAME_TENEBRAE)
Cvar_SetValue("r_fullbrights", 0);
- R_RegisterModule("GL_Main", gl_main_start, gl_main_shutdown, gl_main_newmap);
+ R_RegisterModule("GL_Main", gl_main_start, gl_main_shutdown, gl_main_newmap, NULL, NULL);
Cvar_RegisterVariable(&r_track_sprites);
Cvar_RegisterVariable(&r_track_sprites_flags);
Cvar_RegisterVariable (&gl_texturecompression_reflectmask);
Cvar_RegisterVariable (&gl_nopartialtextureupdates);
- R_RegisterModule("R_Textures", r_textures_start, r_textures_shutdown, r_textures_newmap);
+ R_RegisterModule("R_Textures", r_textures_start, r_textures_shutdown, r_textures_newmap, NULL, NULL);
}
void R_Textures_Frame (void)
void Mod_RenderInit(void)
{
- R_RegisterModule("Models", mod_start, mod_shutdown, mod_newmap);
+ R_RegisterModule("Models", mod_start, mod_shutdown, mod_newmap, NULL, NULL);
}
void Mod_UnloadModel (dp_model_t *mod)
void Palette_Init(void)
{
- R_RegisterModule("Palette", Palette_Load, Palette_Shutdown, Palette_NewMap);
+ R_RegisterModule("Palette", Palette_Load, Palette_Shutdown, Palette_NewMap, NULL, NULL);
Cvar_RegisterVariable(&r_colormap_palette);
Palette_Load();
}
#ifdef MAX_EXPLOSIONS
Cvar_RegisterVariable(&r_drawexplosions);
- R_RegisterModule("R_Explosions", r_explosion_start, r_explosion_shutdown, r_explosion_newmap);
+ R_RegisterModule("R_Explosions", r_explosion_start, r_explosion_shutdown, r_explosion_newmap, NULL, NULL);
#endif
}
Cvar_RegisterVariable(&r_lightningbeam_color_green);
Cvar_RegisterVariable(&r_lightningbeam_color_blue);
Cvar_RegisterVariable(&r_lightningbeam_qmbtexture);
- R_RegisterModule("R_LightningBeams", r_lightningbeams_start, r_lightningbeams_shutdown, r_lightningbeams_newmap);
+ R_RegisterModule("R_LightningBeams", r_lightningbeams_start, r_lightningbeams_shutdown, r_lightningbeams_newmap, NULL, NULL);
}
void R_CalcLightningBeamPolygonVertex3f(float *v, const float *start, const float *end, const float *offset)
void(*start)(void);
void(*shutdown)(void);
void(*newmap)(void);
+ void(*devicelost)(void);
+ void(*devicerestored)(void);
}
rendermodule_t;
Cmd_AddCommand("r_restart", R_Modules_Restart, "restarts renderer");
}
-void R_RegisterModule(char *name, void(*start)(void), void(*shutdown)(void), void(*newmap)(void))
+void R_RegisterModule(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++)
rendermodule[i].start = start;
rendermodule[i].shutdown = shutdown;
rendermodule[i].newmap = newmap;
+ rendermodule[i].devicelost = devicelost;
+ rendermodule[i].devicerestored = devicerestored;
}
void R_Modules_Start(void)
R_SkinFrame_Purge();
}
+void R_Modules_DeviceLost(void)
+{
+ int i;
+ for (i = 0;i < MAXRENDERMODULES;i++)
+ {
+ if (rendermodule[i].name == NULL)
+ continue;
+ if (!rendermodule[i].active)
+ continue;
+ if (!rendermodule[i].devicelost)
+ continue;
+ rendermodule[i].devicelost();
+ }
+}
+
+
+void R_Modules_DeviceRestored(void)
+{
+ int i;
+ for (i = 0;i < MAXRENDERMODULES;i++)
+ {
+ if (rendermodule[i].name == NULL)
+ continue;
+ if (!rendermodule[i].active)
+ continue;
+ if (!rendermodule[i].devicerestored)
+ continue;
+ rendermodule[i].devicerestored();
+ }
+}
+
#define R_MODULES_H
void R_Modules_Init(void);
-void R_RegisterModule(char *name, void(*start)(void), void(*shutdown)(void), void(*newmap)(void));
+void R_RegisterModule(char *name, void(*start)(void), void(*shutdown)(void), void(*newmap)(void), void(*devicelost)(void), void(*devicerestored)(void));
void R_Modules_Start(void);
void R_Modules_Shutdown(void);
void R_Modules_NewMap(void);
void R_Modules_Restart(void);
+void R_Modules_DeviceLost(void);
+void R_Modules_DeviceRestored(void);
#endif
r_shadow_buffer_surfacesides = NULL;
r_shadow_buffer_shadowtrispvs = NULL;
r_shadow_buffer_lighttrispvs = NULL;
- R_RegisterModule("R_Shadow", r_shadow_start, r_shadow_shutdown, r_shadow_newmap);
+ R_RegisterModule("R_Shadow", r_shadow_start, r_shadow_shutdown, r_shadow_newmap, NULL, NULL);
}
matrix4x4_t matrix_attenuationxyz =
Cvar_RegisterVariable (&r_skyscroll2);
memset(&skyboxskinframe, 0, sizeof(skyboxskinframe));
skyname[0] = 0;
- R_RegisterModule("R_Sky", r_sky_start, r_sky_shutdown, r_sky_newmap);
+ R_RegisterModule("R_Sky", r_sky_start, r_sky_shutdown, r_sky_newmap, NULL, NULL);
}
Cvar_RegisterVariable(&sbar_flagstatus_pos); // this cvar makes no sense in other games
}
- R_RegisterModule("sbar", sbar_start, sbar_shutdown, sbar_newmap);
+ R_RegisterModule("sbar", sbar_start, sbar_shutdown, sbar_newmap, NULL, NULL);
}
//Cvar_RegisterVariable(&joy_sensitivityroll);
#ifdef SDL_R_RESTART
- R_RegisterModule("SDL", sdl_start, sdl_shutdown, sdl_newmap);
+ R_RegisterModule("SDL", sdl_start, sdl_shutdown, sdl_newmap, NULL, NULL);
#endif
if (SDL_Init(SDL_INIT_VIDEO) < 0)