Apply r10805
"qt branch: Remove superfluous pie_SetTranslucencyMode()" git-svn-id: https://warzone2100.svn.sourceforge.net/svnroot/warzone2100/branches/qt-trunk@10819 4a71c877-e1ca-e34f-864e-861f7616d084master
parent
7f5030dcc3
commit
732e212cfb
|
@ -37,7 +37,6 @@ void pie_SetDefaultStates(void)//Sets all states
|
|||
//depth Buffer on
|
||||
pie_SetDepthBufferStatus(DEPTH_CMP_LEQ_WRT_ON);
|
||||
|
||||
rendStates.transMode = TRANS_ALPHA;//to force reset to DECAL
|
||||
rendStates.rendMode = REND_ALPHA;//to force reset to OPAQUE
|
||||
pie_SetRendMode(REND_OPAQUE);
|
||||
|
||||
|
|
|
@ -436,37 +436,6 @@ void pie_SetAlphaTest(BOOL keyingOn)
|
|||
}
|
||||
}
|
||||
|
||||
static void pie_SetTranslucencyMode(TRANSLUCENCY_MODE transMode)
|
||||
{
|
||||
if (transMode != rendStates.transMode)
|
||||
{
|
||||
rendStates.transMode = transMode;
|
||||
switch (transMode) {
|
||||
case TRANS_ALPHA:
|
||||
glEnable(GL_BLEND);
|
||||
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
|
||||
break;
|
||||
case TRANS_ADDITIVE:
|
||||
glEnable(GL_BLEND);
|
||||
glBlendFunc(GL_SRC_ALPHA, GL_ONE);
|
||||
break;
|
||||
case TRANS_MULTIPLICATIVE:
|
||||
glEnable(GL_BLEND);
|
||||
glBlendFunc(GL_ZERO, GL_SRC_COLOR);
|
||||
break;
|
||||
case TRANS_DECAL:
|
||||
glDisable(GL_BLEND);
|
||||
break;
|
||||
case TRANS_FILTER:
|
||||
glEnable(GL_BLEND);
|
||||
glBlendFunc(GL_ONE, GL_ONE);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void pie_SetRendMode(REND_MODE rendMode)
|
||||
{
|
||||
if (rendMode != rendStates.rendMode)
|
||||
|
@ -475,18 +444,22 @@ void pie_SetRendMode(REND_MODE rendMode)
|
|||
switch (rendMode)
|
||||
{
|
||||
case REND_OPAQUE:
|
||||
pie_SetTranslucencyMode(TRANS_DECAL);
|
||||
rendStates.transMode = TRANS_DECAL;
|
||||
glDisable(GL_BLEND);
|
||||
break;
|
||||
|
||||
case REND_ALPHA:
|
||||
pie_SetTranslucencyMode(TRANS_ALPHA);
|
||||
glEnable(GL_BLEND);
|
||||
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
|
||||
break;
|
||||
|
||||
case REND_ADDITIVE:
|
||||
pie_SetTranslucencyMode(TRANS_ADDITIVE);
|
||||
glEnable(GL_BLEND);
|
||||
glBlendFunc(GL_SRC_ALPHA, GL_ONE);
|
||||
break;
|
||||
|
||||
default:
|
||||
ASSERT(false, "Bad render state");
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue