cvar_t cl_explosions_lifetime = {CVAR_SAVE, "cl_explosions_lifetime", "0.5"};
cvar_t cl_stainmaps = {CVAR_SAVE, "cl_stainmaps", "1"};
+cvar_t cl_stainmapsclearonload = {CVAR_SAVE, "cl_stainmapsclearonload", "0"};
cvar_t cl_beams_polygons = {CVAR_SAVE, "cl_beams_polygons", "1"};
cvar_t cl_beams_relative = {CVAR_SAVE, "cl_beams_relative", "1"};
Cvar_RegisterVariable(&cl_explosions_size_end);
Cvar_RegisterVariable(&cl_explosions_lifetime);
Cvar_RegisterVariable(&cl_stainmaps);
+ Cvar_RegisterVariable(&cl_stainmapsclearonload);
Cvar_RegisterVariable(&cl_beams_polygons);
Cvar_RegisterVariable(&cl_beams_relative);
Cvar_RegisterVariable(&cl_beams_lightatend);
extern cvar_t cl_explosions_size_end;
extern cvar_t cl_explosions_lifetime;
extern cvar_t cl_stainmaps;
+extern cvar_t cl_stainmapsclearonload;
// these are updated by CL_ClearState
extern int cl_num_entities;
}
}
-#define OPTIONS_EFFECTS_ITEMS 33
+#define OPTIONS_EFFECTS_ITEMS 34
int options_effects_cursor;
extern cvar_t r_detailtextures;
extern cvar_t cl_particles;
extern cvar_t cl_stainmaps;
+extern cvar_t cl_stainmapsclearonload;
extern cvar_t cl_decals;
extern cvar_t r_explosionclip;
extern cvar_t r_modellights;
else if (options_effects_cursor == optnum++) Cvar_SetValueQuick (&cl_particles_explosions_shell, !cl_particles_explosions_shell.integer);
else if (options_effects_cursor == optnum++) Cvar_SetValueQuick (&r_explosionclip, !r_explosionclip.integer);
else if (options_effects_cursor == optnum++) Cvar_SetValueQuick (&cl_stainmaps, !cl_stainmaps.integer);
+ else if (options_effects_cursor == optnum++) Cvar_SetValueQuick (&cl_stainmapsclearonload, !cl_stainmapsclearonload.integer);
else if (options_effects_cursor == optnum++) Cvar_SetValueQuick (&cl_decals, !cl_decals.integer);
else if (options_effects_cursor == optnum++) Cvar_SetValueQuick (&r_detailtextures, !r_detailtextures.integer);
else if (options_effects_cursor == optnum++) Cvar_SetValueQuick (&cl_particles_bulletimpacts, !cl_particles_bulletimpacts.integer);
M_Options_PrintCheckbox(" Explosion Shell", true, cl_particles_explosions_shell.integer);
M_Options_PrintCheckbox(" Explosion Shell Clip", true, r_explosionclip.integer);
M_Options_PrintCheckbox(" Stainmaps", true, cl_stainmaps.integer);
+ M_Options_PrintCheckbox("Onload Clear Stainmaps", true, cl_stainmapsclearonload.integer);
M_Options_PrintCheckbox(" Decals", true, cl_decals.integer);
M_Options_PrintCheckbox(" Detail Texturing", true, r_detailtextures.integer);
M_Options_PrintCheckbox(" Bullet Impacts", true, cl_particles_bulletimpacts.integer);
static void mod_newmap(void)
{
+ msurface_t *surf;
+ int i, surfnum, ssize, tsize;
+
+ if (!cl_stainmapsclearonload.integer)
+ return;
+
+ for (i=0; i<MAX_MOD_KNOWN; i++)
+ {
+ if (mod_known[i].name[0] && mod_known[i].type == mod_brush)
+ {
+ for (surfnum=0, surf=mod_known[i].brushq1.surfaces; surfnum<mod_known[i].brushq1.numsurfaces;surfnum++, surf++)
+ {
+ if (surf->texinfo->texture->flags & SURF_LIGHTMAP)
+ {
+ ssize = (surf->extents[0] >> 4) + 1;
+ tsize = (surf->extents[1] >> 4) + 1;
+
+ if (ssize > 256 || tsize > 256)
+ Host_Error("Bad surface extents");
+
+ if (surf->stainsamples)
+ memset(surf->stainsamples, 255, ssize * tsize * 3);
+
+ surf->cached_dlight = true;
+ }
+ }
+ }
+ }
}
/*