]> git.xonotic.org Git - xonotic/darkplaces.git/blobdiff - csprogs.c
added DP_ENT_GLOWMOD extension, like DP_ENT_COLORMOD but alters glow
[xonotic/darkplaces.git] / csprogs.c
index 5ed99d11026be6c6e3825b26b87f7e5b82e06fdb..58d631efc0b7e6e108246c02d07b1ae8b9cf9e17 100644 (file)
--- a/csprogs.c
+++ b/csprogs.c
@@ -180,6 +180,7 @@ qboolean CSQC_AddRenderEdict(prvm_edict_t *ed)
        if((val = PRVM_EDICTFIELDVALUE(ed, prog->fieldoffsets.alpha)) && val->_float)           entrender->alpha = val->_float;
        if((val = PRVM_EDICTFIELDVALUE(ed, prog->fieldoffsets.scale)) && val->_float)           entrender->scale = scale = val->_float;
        if((val = PRVM_EDICTFIELDVALUE(ed, prog->fieldoffsets.colormod)) && VectorLength2(val->vector)) VectorCopy(val->vector, entrender->colormod);
+       if((val = PRVM_EDICTFIELDVALUE(ed, prog->fieldoffsets.glowmod)) && VectorLength2(val->vector))  VectorCopy(val->vector, entrender->glowmod);
        if((val = PRVM_EDICTFIELDVALUE(ed, prog->fieldoffsets.effects)) && val->_float) entrender->effects |= (int)val->_float;
        if((val = PRVM_EDICTFIELDVALUE(ed, prog->fieldoffsets.tag_entity)) && val->edict)
        {
@@ -192,6 +193,10 @@ qboolean CSQC_AddRenderEdict(prvm_edict_t *ed)
        }
        else
                Matrix4x4_CreateIdentity(&tagmatrix);
+       if (!VectorLength2(entrender->colormod))
+               VectorSet(entrender->colormod, 1, 1, 1);
+       if (!VectorLength2(entrender->glowmod))
+               VectorSet(entrender->glowmod, 1, 1, 1);
 
        if (renderflags & RF_USEAXIS)
        {