From: havoc Date: Fri, 23 Sep 2011 16:43:52 +0000 (+0000) Subject: if MATERIALFLAG_CUSTOMBLEND, clear MATERIALFLAG_ADD and X-Git-Tag: xonotic-v0.6.0~163^2~187 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=48ccfb68d06fc2f6565ab6c34a0b17fae5393563;p=xonotic%2Fdarkplaces.git if MATERIALFLAG_CUSTOMBLEND, clear MATERIALFLAG_ADD and 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 --- diff --git a/gl_rmain.c b/gl_rmain.c index b4ef313a..a7116cfe 100644 --- a/gl_rmain.c +++ b/gl_rmain.c @@ -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))