Skip to content

Commit

Permalink
Fix holodeck doors fade out
Browse files Browse the repository at this point in the history
Using the GL1 statebits in GL2 causes the doors to not fade not. Period.
In GL1 the items 'pop' into view after doors fade out completely.
Fix them both to fade out and blend over items.
  • Loading branch information
zturtleman committed Oct 29, 2014
1 parent 7e663b7 commit 475e145
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions code/renderergl1/tr_shade.c
Expand Up @@ -1172,8 +1172,8 @@ static void RB_IterateStagesGeneric( shaderCommands_t *input )
#ifdef ELITEFORCE
if(overridealpha && backEnd.currentEntity->e.shaderRGBA[3] < 0xFF && !(pStage->stateBits & GLS_ATEST_BITS))
{
GL_State((pStage->stateBits & ~(GLS_SRCBLEND_BITS | GLS_DSTBLEND_BITS | GLS_ATEST_BITS)) // remove the shader set values.
| GLS_SRCBLEND_SRC_ALPHA | GLS_DSTBLEND_ONE_MINUS_SRC_ALPHA | GLS_ATEST_GT_0); // Now add the default values.
// set bits for blendfunc blend
GL_State( GLS_SRCBLEND_SRC_ALPHA | GLS_DSTBLEND_ONE_MINUS_SRC_ALPHA );
}
else
#endif
Expand Down
10 changes: 5 additions & 5 deletions code/renderergl2/tr_shade.c
Expand Up @@ -1099,11 +1099,11 @@ static void RB_IterateStagesGeneric( shaderCommands_t *input )
oldStateBits = pStage->stateBits;
pStage->alphaGen = AGEN_ENTITY;

// set bits for blendfunc blend
pStage->stateBits = GLS_SRCBLEND_SRC_ALPHA | GLS_DSTBLEND_ONE_MINUS_SRC_ALPHA;

// keep the original alphafunc, if any
pStage->stateBits |= ( oldStateBits & GLS_ATEST_BITS );
if(backEnd.currentEntity->e.shaderRGBA[3] < 0xFF && !(pStage->stateBits & GLS_ATEST_BITS))
{
// set bits for blendfunc blend
pStage->stateBits = GLS_SRCBLEND_SRC_ALPHA | GLS_DSTBLEND_ONE_MINUS_SRC_ALPHA;
}
}
else
{
Expand Down

0 comments on commit 475e145

Please sign in to comment.