]> git.rm.cloudns.org Git - xonotic/darkplaces.git/commitdiff
if MATERIALFLAG_CUSTOMBLEND, clear MATERIALFLAG_ADD and
authorhavoc <havoc@d7cf8633-e32d-0410-b094-e92efae38249>
Fri, 23 Sep 2011 16:43:52 +0000 (16:43 +0000)
committerhavoc <havoc@d7cf8633-e32d-0410-b094-e92efae38249>
Fri, 23 Sep 2011 16:43:52 +0000 (16:43 +0000)
MATERIALFLAG_ALPHA, to prevent bugs where code checks those flags

git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@11365 d7cf8633-e32d-0410-b094-e92efae38249

gl_rmain.c

index b4ef313ad1d4895de3c24ef3aaf04ac45d14a821..a7116cfee4fccd20be42f70c790441edde154a3c 100644 (file)
@@ -7854,6 +7854,9 @@ texture_t *R_GetCurrentTexture(texture_t *t)
                t->currentmaterialflags |= MATERIALFLAG_ADD | MATERIALFLAG_BLENDED | MATERIALFLAG_NOSHADOW;
        else if (t->currentalpha < 1)
                t->currentmaterialflags |= MATERIALFLAG_ALPHA | MATERIALFLAG_BLENDED | MATERIALFLAG_NOSHADOW;
+       // LordHavoc: prevent bugs where code checks add or alpha at higher priority than customblend by clearing these flags
+       if (t->currentmaterialflags & MATERIALFLAG_CUSTOMBLEND)
+               t->currentmaterialflags &= ~(MATERIALFLAG_ADD | MATERIALFLAG_ALPHA);
        if (rsurface.ent_flags & RENDER_DOUBLESIDED)
                t->currentmaterialflags |= MATERIALFLAG_NOSHADOW | MATERIALFLAG_NOCULLFACE;
        if (rsurface.ent_flags & (RENDER_NODEPTHTEST | RENDER_VIEWMODEL))