- fixed some of the issues with palette emulation

* the palette shader was not bound.
* the palette textures were not bound.
* palette mode still used regular lighting on top of the palette emulation

This works a lot better than before but is still not complete.
This commit is contained in:
Christoph Oelckers 2020-09-12 21:23:14 +02:00
parent 9187577719
commit 9e81fa89a8
7 changed files with 26 additions and 16 deletions

View file

@ -329,12 +329,24 @@ void FGLRenderState::ApplyMaterial(FMaterial *mat, int clampmode, int translatio
if (base->BindOrCreate(tex->GetTexture(), 0, clampmode, translation, layer->scaleFlags))
{
for (int i = 1; i<numLayers; i++)
if (!(layer->scaleFlags & CTF_Indexed))
{
auto systex = static_cast<FHardwareTexture*>(mat->GetLayer(i, 0, &layer));
// fixme: Upscale flags must be disabled for certain layers.
systex->BindOrCreate(layer->layerTexture, i, clampmode, 0, layer->scaleFlags);
maxbound = i;
for (int i = 1; i < numLayers; i++)
{
auto systex = static_cast<FHardwareTexture*>(mat->GetLayer(i, 0, &layer));
// fixme: Upscale flags must be disabled for certain layers.
systex->BindOrCreate(layer->layerTexture, i, clampmode, 0, layer->scaleFlags);
maxbound = i;
}
}
else
{
for (int i = 1; i < 3; i++)
{
auto systex = static_cast<FHardwareTexture*>(mat->GetLayer(i, 0, &layer));
systex->Bind(i, false);
maxbound = i;
}
}
}
// unbind everything from the last texture that's still active