- major refactor of texture upscaling control.

All decisions were done deep inside the texture creation code, leaving zero options to the higher level code for controlling the feature.
Changed this so that the option to upscale must be passed as a parameter to FRenderState::SetMaterial and extended all needed variables to manage the added texture variants.
Still not solved: Material layers need explicit control, not only for scaling but also for filtering.
This commit is contained in:
Christoph Oelckers 2020-04-16 23:37:22 +02:00
commit 8505c7ee7d
27 changed files with 144 additions and 129 deletions

View file

@ -323,7 +323,7 @@ void FGLRenderState::ApplyMaterial(FMaterial *mat, int clampmode, int translatio
int usebright = false;
int maxbound = 0;
int flags = mat->isExpanded() ? CTF_Expand : 0;
int flags = mat->GetScaleFlags();
int numLayers = mat->GetLayers();
auto base = static_cast<FHardwareTexture*>(mat->GetLayer(0, translation));
@ -333,7 +333,8 @@ void FGLRenderState::ApplyMaterial(FMaterial *mat, int clampmode, int translatio
{
FTexture *layer;
auto systex = static_cast<FHardwareTexture*>(mat->GetLayer(i, 0, &layer));
systex->BindOrCreate(layer, i, clampmode, 0, mat->isExpanded() ? CTF_Expand : 0);
// fixme: Upscale flags must be disabled for certain layers.
systex->BindOrCreate(layer, i, clampmode, 0, flags);
maxbound = i;
}
}