- simplify colormap selection to a single function

This commit is contained in:
Magnus Norddahl 2018-12-28 00:55:44 +01:00
commit 4d3d4ea746
13 changed files with 139 additions and 143 deletions

View file

@ -256,7 +256,7 @@ namespace swrenderer
}
// Prepare lighting
usecolormap = light.basecolormap;
usecolormap = light.GetBaseColormap();
// Decals that are added to the scene must fade to black.
if (decal->RenderStyle == LegacyRenderStyles[STYLE_Add] && usecolormap->Fade != 0)
@ -287,7 +287,7 @@ namespace swrenderer
int x = x1;
ColormapLight cmlight;
cmlight.SetColormap(thread, MINZ, light.lightlevel, light.foggy, usecolormap, decal->RenderFlags & RF_FULLBRIGHT, false, false, false, false);
cmlight.SetColormap(thread, MINZ, light.GetLightLevel(), light.GetFoggy(), usecolormap, decal->RenderFlags & RF_FULLBRIGHT, false, false, false, false);
SpriteDrawerArgs drawerargs;
bool visible = drawerargs.SetStyle(thread->Viewport.get(), decal->RenderStyle, (float)decal->Alpha, decal->Translation, decal->AlphaColor, cmlight);
@ -300,7 +300,7 @@ namespace swrenderer
{
if (calclighting)
{ // calculate lighting
drawerargs.SetLight(lightpos, light.lightlevel, light.foggy, thread->Viewport.get());
drawerargs.SetLight(lightpos, light.GetLightLevel(), light.GetFoggy(), thread->Viewport.get());
}
DrawColumn(thread, drawerargs, x, WallSpriteTile, walltexcoords, texturemid, maskedScaleY, sprflipvert, mfloorclip, mceilingclip, decal->RenderStyle);
lightpos += light.GetLightStep();