- continued work on texture management.

This commit is contained in:
Christoph Oelckers 2018-12-12 18:39:38 +01:00
commit c5447f0cdd
18 changed files with 79 additions and 140 deletions

View file

@ -332,14 +332,14 @@ void FGLRenderState::ApplyMaterial(FMaterial *mat, int clampmode, int translatio
// Textures that are already scaled in the texture lump will not get replaced by hires textures.
int flags = mat->isExpanded() ? CTF_Expand : (gl_texture_usehires && !tex->isScaled() && clampmode <= CLAMP_XY) ? CTF_CheckHires : 0;
int numLayers = mat->GetLayers();
auto base = static_cast<FHardwareTexture*>(mat->GetLayer(0));
auto base = static_cast<FHardwareTexture*>(mat->GetLayer(0, translation));
if (base->BindOrCreate(tex, 0, clampmode, translation, flags))
{
for (int i = 1; i<numLayers; i++)
{
FTexture *layer;
auto systex = static_cast<FHardwareTexture*>(mat->GetLayer(i, &layer));
auto systex = static_cast<FHardwareTexture*>(mat->GetLayer(i, 0, &layer));
systex->BindOrCreate(layer, i, clampmode, 0, mat->isExpanded() ? CTF_Expand : 0);
maxbound = i;
}