- fixed texture layer management so that each material layer can decide for itself if it wants to allow upscaling.

- rewrote the hardware texture precacher to use the new texture management to properly track the data to delete.
This commit is contained in:
Christoph Oelckers 2020-04-19 10:08:24 +02:00
commit b2281c38e1
20 changed files with 190 additions and 135 deletions

View file

@ -323,18 +323,17 @@ void FGLRenderState::ApplyMaterial(FMaterial *mat, int clampmode, int translatio
int usebright = false;
int maxbound = 0;
int flags = mat->GetScaleFlags();
int numLayers = mat->GetLayers();
int numLayers = mat->NumLayers();
MaterialLayerInfo* layer;
auto base = static_cast<FHardwareTexture*>(mat->GetLayer(0, translation));
if (base->BindOrCreate(tex->GetTexture(), 0, clampmode, translation, flags))
if (base->BindOrCreate(tex->GetTexture(), 0, clampmode, translation, layer->scaleFlags))
{
for (int i = 1; i<numLayers; i++)
{
FTexture *layer;
auto systex = static_cast<FHardwareTexture*>(mat->GetLayer(i, 0, &layer));
// fixme: Upscale flags must be disabled for certain layers.
systex->BindOrCreate(layer, i, clampmode, 0, flags);
systex->BindOrCreate(layer->layerTexture, i, clampmode, 0, layer->scaleFlags);
maxbound = i;
}
}