mirror of
https://github.com/DrBeef/Raze.git
synced 2025-01-18 15:11:51 +00:00
Fix a bug where having two or more lighting passes on a multi-surface mdsprite would leak some GL state and disable blending for all but the first surface.
git-svn-id: https://svn.eduke32.com/eduke32@1735 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
parent
efc0f2ec75
commit
e043431060
1 changed files with 5 additions and 2 deletions
|
@ -4250,7 +4250,10 @@ static int32_t polymer_bindmaterial(_prmaterial material, int16_t* lights,
|
|||
// PR_BIT_LIGHTING_PASS
|
||||
if (programbits & prprogrambits[PR_BIT_LIGHTING_PASS].bit)
|
||||
{
|
||||
bglEnable(GL_BLEND);
|
||||
// Careful with that, it works only if we respect the wrapping order
|
||||
// or make sure GL_BLEND is the only ENABLE we mess with here.
|
||||
bglPushAttrib(GL_ENABLE_BIT);
|
||||
bglEnable(GL_BLEND);
|
||||
bglBlendFunc(GL_ONE, GL_ONE);
|
||||
}
|
||||
|
||||
|
@ -4514,7 +4517,7 @@ static void polymer_unbindmaterial(int32_t programbits)
|
|||
// PR_BIT_LIGHTING_PASS
|
||||
if (programbits & prprogrambits[PR_BIT_LIGHTING_PASS].bit)
|
||||
{
|
||||
bglDisable(GL_BLEND);
|
||||
bglPopAttrib();
|
||||
bglBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue