]> de.git.xonotic.org Git - xonotic/darkplaces.git/commitdiff
colormod now works
authorhavoc <havoc@d7cf8633-e32d-0410-b094-e92efae38249>
Mon, 20 Dec 2004 20:50:41 +0000 (20:50 +0000)
committerhavoc <havoc@d7cf8633-e32d-0410-b094-e92efae38249>
Mon, 20 Dec 2004 20:50:41 +0000 (20:50 +0000)
git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@4874 d7cf8633-e32d-0410-b094-e92efae38249

sv_main.c

index d4b6b2d50552436570e197a2c597ee6beb5b40cf..ae0a38bc43c4b2188b5b266d521d88f95818a60b 100644 (file)
--- 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))