From b1a180b25e585d1e181035309af0ac556a3a8d6a Mon Sep 17 00:00:00 2001 From: Bill Currie Date: Mon, 19 Aug 2002 04:05:02 +0000 Subject: [PATCH] move the view model check for min_light into the model loader (checks for progs/v_*) --- libs/models/model.c | 2 ++ libs/video/renderer/gl/gl_mod_alias.c | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/libs/models/model.c b/libs/models/model.c index 332c9b01d..5976e8f87 100644 --- a/libs/models/model.c +++ b/libs/models/model.c @@ -205,6 +205,8 @@ Mod_RealLoadModel (model_t *mod, qboolean crash, cache_allocator_t allocator) } if (strequal (mod->name, "progs/player.mdl")) { mod->min_light = 8; + } else if (strnequal (mod->name, "progs/v_", 8)) { + mod->min_light = 24; } else { mod->min_light = 0; } diff --git a/libs/video/renderer/gl/gl_mod_alias.c b/libs/video/renderer/gl/gl_mod_alias.c index b1db9b8d7..1e5543993 100644 --- a/libs/video/renderer/gl/gl_mod_alias.c +++ b/libs/video/renderer/gl/gl_mod_alias.c @@ -558,7 +558,7 @@ R_DrawAliasModel (entity_t *e, qboolean cull) } // always give the gun some light shade = max (shadecolor[0], max (shadecolor[1], shadecolor[2])); - minshade = e == r_view_model ? 24/200.0 : clmodel->min_light / 200.0; + minshade = clmodel->min_light / 200.0; if (e == r_view_model && shade < minshade) { shadecolor[0] += minshade - shade; shadecolor[1] += minshade - shade;