Merge branch 'ogl-model-blend-flags-fix' into 'next'

Fix frame blend flags not working with 3D models

See merge request STJr/SRB2!1778
This commit is contained in:
sphere 2022-04-09 14:39:59 +00:00
commit d9799540c6

View file

@ -1346,12 +1346,18 @@ boolean HWR_DrawModel(gl_vissprite_t *spr)
//if (tics > durs)
//durs = tics;
INT32 blendmode;
if (spr->mobj->frame & FF_BLENDMASK)
blendmode = ((spr->mobj->frame & FF_BLENDMASK) >> FF_BLENDSHIFT) + 1;
else
blendmode = spr->mobj->blendmode;
if (spr->mobj->frame & FF_TRANSMASK)
Surf.PolyFlags = HWR_SurfaceBlend(spr->mobj->blendmode, (spr->mobj->frame & FF_TRANSMASK)>>FF_TRANSSHIFT, &Surf);
Surf.PolyFlags = HWR_SurfaceBlend(blendmode, (spr->mobj->frame & FF_TRANSMASK)>>FF_TRANSSHIFT, &Surf);
else
{
Surf.PolyColor.s.alpha = (spr->mobj->flags2 & MF2_SHADOW) ? 0x40 : 0xff;
Surf.PolyFlags = HWR_GetBlendModeFlag(spr->mobj->blendmode);
Surf.PolyFlags = HWR_GetBlendModeFlag(blendmode);
}
// don't forget to enable the depth test because we can't do this