mirror of
https://github.com/blawar/GLideN64.git
synced 2024-07-07 03:13:49 +00:00
Code cleanup: remove unused _setBlendMode() from RiceVideo.
This commit is contained in:
parent
33da1e1800
commit
130315f1ae
151
OpenGL.cpp
151
OpenGL.cpp
|
@ -308,156 +308,6 @@ void OGLRender::addTriangle(int _v0, int _v1, int _v2)
|
|||
}
|
||||
}
|
||||
|
||||
#define ORKIN_BLENDMODE
|
||||
#ifdef RICE_BLENDMODE
|
||||
//copied from RICE VIDEO
|
||||
void OGLVideo::_setBlendMode() const
|
||||
{
|
||||
#define BLEND_NOOP 0x0000
|
||||
#define BLEND_NOOP5 0xcc48 // Fog * 0 + Mem * 1
|
||||
#define BLEND_NOOP4 0xcc08 // Fog * 0 + In * 1
|
||||
#define BLEND_FOG_ASHADE 0xc800
|
||||
#define BLEND_FOG_3 0xc000 // Fog * AIn + In * 1-A
|
||||
#define BLEND_FOG_MEM 0xc440 // Fog * AFog + Mem * 1-A
|
||||
#define BLEND_FOG_APRIM 0xc400 // Fog * AFog + In * 1-A
|
||||
#define BLEND_BLENDCOLOR 0x8c88
|
||||
#define BLEND_BI_AFOG 0x8400 // Bl * AFog + In * 1-A
|
||||
#define BLEND_BI_AIN 0x8040 // Bl * AIn + Mem * 1-A
|
||||
#define BLEND_MEM 0x4c40 // Mem*0 + Mem*(1-0)?!
|
||||
#define BLEND_FOG_MEM_3 0x44c0 // Mem * AFog + Fog * 1-A
|
||||
#define BLEND_NOOP3 0x0c48 // In * 0 + Mem * 1
|
||||
#define BLEND_PASS 0x0c08 // In * 0 + In * 1
|
||||
#define BLEND_FOG_MEM_IN_MEM 0x0440 // In * AFog + Mem * 1-A
|
||||
#define BLEND_FOG_MEM_FOG_MEM 0x04c0 // In * AFog + Fog * 1-A
|
||||
#define BLEND_OPA 0x0044 // In * AIn + Mem * AMem
|
||||
#define BLEND_XLU 0x0040
|
||||
#define BLEND_MEM_ALPHA_IN 0x4044 // Mem * AIn + Mem * AMem
|
||||
|
||||
u32 blender = gDP.otherMode.l >> 16;
|
||||
u32 blendmode_1 = blender&0xcccc;
|
||||
u32 blendmode_2 = blender&0x3333;
|
||||
|
||||
glEnable(GL_BLEND);
|
||||
switch(gDP.otherMode.cycleType)
|
||||
{
|
||||
case G_CYC_FILL:
|
||||
glDisable(GL_BLEND);
|
||||
break;
|
||||
|
||||
case G_CYC_COPY:
|
||||
glBlendFunc(GL_ONE, GL_ZERO);
|
||||
break;
|
||||
|
||||
case G_CYC_2CYCLE:
|
||||
if (gDP.otherMode.forceBlender && gDP.otherMode.depthCompare)
|
||||
{
|
||||
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
|
||||
break;
|
||||
}
|
||||
|
||||
switch(blendmode_1+blendmode_2)
|
||||
{
|
||||
case BLEND_PASS+(BLEND_PASS>>2): // In * 0 + In * 1
|
||||
case BLEND_FOG_APRIM+(BLEND_PASS>>2):
|
||||
case BLEND_FOG_MEM_FOG_MEM + (BLEND_OPA>>2):
|
||||
case BLEND_FOG_APRIM + (BLEND_OPA>>2):
|
||||
case BLEND_FOG_ASHADE + (BLEND_OPA>>2):
|
||||
case BLEND_BI_AFOG + (BLEND_OPA>>2):
|
||||
case BLEND_FOG_ASHADE + (BLEND_NOOP>>2):
|
||||
case BLEND_NOOP + (BLEND_OPA>>2):
|
||||
case BLEND_NOOP4 + (BLEND_NOOP>>2):
|
||||
case BLEND_FOG_ASHADE+(BLEND_PASS>>2):
|
||||
case BLEND_FOG_3+(BLEND_PASS>>2):
|
||||
glDisable(GL_BLEND);
|
||||
break;
|
||||
|
||||
case BLEND_PASS+(BLEND_OPA>>2):
|
||||
if (gDP.otherMode.cvgXAlpha && gDP.otherMode.alphaCvgSel)
|
||||
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
|
||||
else
|
||||
glDisable(GL_BLEND);
|
||||
break;
|
||||
|
||||
case BLEND_PASS + (BLEND_XLU>>2):
|
||||
case BLEND_FOG_ASHADE + (BLEND_XLU>>2):
|
||||
case BLEND_FOG_APRIM + (BLEND_XLU>>2):
|
||||
case BLEND_FOG_MEM_FOG_MEM + (BLEND_PASS>>2):
|
||||
case BLEND_XLU + (BLEND_XLU>>2):
|
||||
case BLEND_BI_AFOG + (BLEND_XLU>>2):
|
||||
case BLEND_XLU + (BLEND_FOG_MEM_IN_MEM>>2):
|
||||
case BLEND_PASS + (BLEND_FOG_MEM_IN_MEM>>2):
|
||||
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
|
||||
break;
|
||||
|
||||
case BLEND_FOG_ASHADE+0x0301:
|
||||
glBlendFunc(GL_SRC_ALPHA, GL_ZERO);
|
||||
break;
|
||||
|
||||
case 0x0c08+0x1111:
|
||||
glBlendFunc(GL_ZERO, GL_DST_ALPHA);
|
||||
break;
|
||||
|
||||
default:
|
||||
if (blendmode_2 == (BLEND_PASS>>2))
|
||||
glDisable(GL_BLEND);
|
||||
else
|
||||
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
|
||||
break;
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
|
||||
if (gDP.otherMode.forceBlender && gDP.otherMode.depthCompare && blendmode_1 != BLEND_FOG_ASHADE )
|
||||
{
|
||||
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
|
||||
break;
|
||||
}
|
||||
|
||||
switch (blendmode_1)
|
||||
{
|
||||
case BLEND_XLU:
|
||||
case BLEND_BI_AIN:
|
||||
case BLEND_FOG_MEM:
|
||||
case BLEND_FOG_MEM_IN_MEM:
|
||||
case BLEND_BLENDCOLOR:
|
||||
case 0x00c0:
|
||||
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
|
||||
break;
|
||||
|
||||
case BLEND_MEM_ALPHA_IN:
|
||||
glBlendFunc(GL_ZERO, GL_DST_ALPHA);
|
||||
break;
|
||||
|
||||
case BLEND_OPA:
|
||||
glDisable(GL_BLEND);
|
||||
break;
|
||||
|
||||
case BLEND_PASS:
|
||||
case BLEND_NOOP:
|
||||
case BLEND_FOG_ASHADE:
|
||||
case BLEND_FOG_MEM_3:
|
||||
case BLEND_BI_AFOG:
|
||||
glDisable(GL_BLEND);
|
||||
break;
|
||||
|
||||
case BLEND_FOG_APRIM:
|
||||
glBlendFunc(GL_ONE_MINUS_SRC_ALPHA, GL_ZERO);
|
||||
break;
|
||||
|
||||
case BLEND_NOOP3:
|
||||
case BLEND_NOOP5:
|
||||
case BLEND_MEM:
|
||||
glBlendFunc(GL_ZERO, GL_ONE);
|
||||
break;
|
||||
|
||||
default:
|
||||
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
#else
|
||||
void OGLRender::_setBlendMode() const
|
||||
{
|
||||
const u32 blendmode = gDP.otherMode.l >> 16;
|
||||
|
@ -573,7 +423,6 @@ void OGLRender::_setBlendMode() const
|
|||
glDisable( GL_BLEND );
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
void OGLRender::_updateCullFace() const
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue
Block a user