From b2cc7259b12fd4e405c4b353e60d0ea848bc6dd6 Mon Sep 17 00:00:00 2001 From: havoc Date: Mon, 20 Dec 2004 20:50:41 +0000 Subject: [PATCH] colormod now works git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@4874 d7cf8633-e32d-0410-b094-e92efae38249 --- sv_main.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/sv_main.c b/sv_main.c index d4b6b2d5..ae0a38bc 100644 --- a/sv_main.c +++ b/sv_main.c @@ -452,6 +452,7 @@ void SV_PrepareEntitiesForSending(void) int e, i; float f; edict_t *ent; + eval_t *val; entity_state_t cs; // send all entities that touch the pvs numsendentities = 0; @@ -483,6 +484,16 @@ void SV_PrepareEntitiesForSending(void) if (GETEDICTFIELDVALUE(ent, eval_glow_trail)->_float) cs.flags |= RENDER_GLOWTRAIL; + // don't need to init cs.colormod because the defaultstate did that for us + //cs.colormod[0] = cs.colormod[1] = cs.colormod[2] = 32; + val = GETEDICTFIELDVALUE(ent, eval_colormod); + if (val->vector[0] || val->vector[1] || val->vector[2]) + { + i = val->vector[0] * 32.0f;cs.colormod[0] = bound(0, i, 255); + i = val->vector[1] * 32.0f;cs.colormod[1] = bound(0, i, 255); + i = val->vector[2] * 32.0f;cs.colormod[2] = bound(0, i, 255); + } + cs.modelindex = 0; i = (int)ent->v->modelindex; if (i >= 1 && i < MAX_MODELS && *PR_GetString(ent->v->model)) -- 2.39.2