From 48ccfb68d06fc2f6565ab6c34a0b17fae5393563 Mon Sep 17 00:00:00 2001 From: havoc Date: Fri, 23 Sep 2011 16:43:52 +0000 Subject: [PATCH] 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 --- gl_rmain.c | 3 +++ 1 file changed, 3 insertions(+) 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)) -- 2.39.2