- cleanup of the revised y-clamping feature.

This integrates better with the existing features.
This commit is contained in:
Christoph Oelckers 2021-09-21 18:23:52 +02:00
commit da806b354d
9 changed files with 32 additions and 25 deletions

View file

@ -287,7 +287,7 @@ void PolyRenderState::Apply()
PolyPushConstants constants;
constants.uFogEnabled = fogset;
constants.uTextureMode = (mTextureMode == TM_NORMAL && mTempTM == TM_OPAQUE ? TM_OPAQUE : mTextureMode);
constants.uTextureMode = GetTextureModeAndFlags(mTempTM);
constants.uLightDist = mLightParms[0];
constants.uLightFactor = mLightParms[1];
constants.uFogDensity = mLightParms[2];

View file

@ -380,11 +380,7 @@ static void ProcessMaterial(int x0, int x1, PolyTriangleThreadData* thread)
{
auto constants = thread->PushConstants;
if (constants->uTextureMode == TM_CLAMPY)
{
FuncNormal_ClampY(x0, x1, thread);
}
else switch (constants->uTextureMode & 0xff)
switch (constants->uTextureMode)
{
default:
case TM_NORMAL:
@ -393,6 +389,7 @@ static void ProcessMaterial(int x0, int x1, PolyTriangleThreadData* thread)
case TM_OPAQUE: FuncNormal_Opaque(x0, x1, thread); break;
case TM_INVERSE: FuncNormal_Inverse(x0, x1, thread); break;
case TM_ALPHATEXTURE: FuncNormal_AlphaTexture(x0, x1, thread); break;
case TM_CLAMPY: FuncNormal_ClampY(x0, x1, thread); break;
case TM_INVERTOPAQUE: FuncNormal_InvertOpaque(x0, x1, thread); break;
}