Optimize model rendering a hair. WildCode spotted that minimum shade was only being applied to the view model (why do we set it up for other stuff if it's not going to be used?). While looking at that, I noticed we could do the divide by 200 in model setup.

This commit is contained in:
Ragnvald Maartmann-Moe IV 2002-09-01 23:45:22 +00:00
parent 2e3d4a603f
commit 92db391e7c
2 changed files with 5 additions and 6 deletions

View file

@ -201,11 +201,11 @@ Mod_RealLoadModel (model_t *mod, qboolean crash, cache_allocator_t allocator)
}
if (strequal (mod->name, "progs/player.mdl")) {
mod->min_light = 8;
mod->min_light = 0.04;
} else if (strnequal (mod->name, "progs/v_", 8)) {
mod->min_light = 24;
mod->min_light = 0.12;
} else {
mod->min_light = 0;
mod->min_light = 0.0;
}
// call the apropriate loader

View file

@ -522,7 +522,6 @@ R_DrawAliasModel (entity_t *e)
radius = model->radius;
if (e->scale != 1.0)
radius *= e->scale;
if (R_CullSphere (e->origin, radius))
return;
@ -561,8 +560,8 @@ R_DrawAliasModel (entity_t *e)
}
// always give the gun some light
shade = max (shadecolor[0], max (shadecolor[1], shadecolor[2]));
minshade = model->min_light / 200.0;
if (e == r_view_model && shade < minshade) {
minshade = model->min_light;
if (shade < minshade) {
shadecolor[0] += minshade - shade;
shadecolor[1] += minshade - shade;
shadecolor[2] += minshade - shade;