- removed all code that mixes together the different lighting methods. Now everything goes through the 3 different light parameters in the render state.

- removed cm parameter from many functions.
This commit is contained in:
Christoph Oelckers 2014-05-11 21:47:54 +02:00
commit 978ace241c
31 changed files with 154 additions and 507 deletions

View file

@ -333,13 +333,13 @@ void FGLRenderer::DrawTexture(FTexture *img, DCanvas::DrawParms &parms)
GLTranslationPalette * pal = static_cast<GLTranslationPalette*>(parms.remap->GetNative());
if (pal) translation = -pal->GetIndex();
}
gltex->BindPatch(CM_DEFAULT, translation);
gltex->BindPatch(translation);
}
else
{
// This is an alpha texture
gl_RenderState.SetTextureMode(TM_REDTOALPHA);
gltex->BindPatch(CM_SHADE, 0);
gltex->BindPatch(0);
}
u1 = gltex->GetUL();
@ -349,7 +349,7 @@ void FGLRenderer::DrawTexture(FTexture *img, DCanvas::DrawParms &parms)
}
else
{
gltex->Bind(CM_DEFAULT, 0, 0);
gltex->Bind(0, 0);
u2=1.f;
v2=-1.f;
u1 = v1 = 0.f;
@ -519,7 +519,7 @@ void FGLRenderer::FlatFill (int left, int top, int right, int bottom, FTexture *
if (!gltexture) return;
gltexture->Bind(CM_DEFAULT, 0, 0);
gltexture->Bind(0, 0);
// scaling is not used here.
if (!local_origin)
@ -613,7 +613,7 @@ void FGLRenderer::FillSimplePoly(FTexture *texture, FVector2 *points, int npoint
PalEntry pe = gl_CalcLightColor(lightlevel, cm.LightColor, cm.blendfactor, true);
glColor3ub(pe.r, pe.g, pe.b);
gltexture->Bind(cm.colormap);
gltexture->Bind();
int i;
float rot = float(rotation * M_PI / float(1u << 31));