- 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

@ -310,7 +310,7 @@ void OpenGLFrameBuffer::PrecacheMaterial(FMaterial *mat, int translation)
{
if (mat->Source()->GetUseType() == ETextureType::SWCanvas) return;
int flags = mat->isExpanded() ? CTF_Expand : 0;
int flags = mat->GetScaleFlags();
int numLayers = mat->GetLayers();
FTexture* layer;
auto base = static_cast<FHardwareTexture*>(mat->GetLayer(0, translation, &layer));
@ -320,7 +320,7 @@ void OpenGLFrameBuffer::PrecacheMaterial(FMaterial *mat, int translation)
for (int i = 1; i < numLayers; i++)
{
auto systex = static_cast<FHardwareTexture*>(mat->GetLayer(i, 0, &layer));
systex->BindOrCreate(layer, i, CLAMP_NONE, 0, mat->isExpanded() ? CTF_Expand : 0);
systex->BindOrCreate(layer, i, CLAMP_NONE, 0, flags);
}
}
// unbind everything.