- removed the conversion helper code and fixed a few places where FMaterial was only used to access the hardware textures in the FTexture class.

This commit is contained in:
Christoph Oelckers 2020-04-16 00:21:13 +02:00
commit 662fa6e667
18 changed files with 68 additions and 56 deletions

View file

@ -146,21 +146,12 @@ FMaterial::~FMaterial()
//
//===========================================================================
IHardwareTexture *FMaterial::GetLayer(int i, int translation, FTexture **pLayer)
IHardwareTexture *FMaterial::GetLayer(int i, int translation, FTexture **pLayer) const
{
FTexture *layer = i == 0 ? imgtex : mTextureLayers[i - 1];
if (pLayer) *pLayer = layer;
if (layer && layer->UseType!=ETextureType::Null)
{
IHardwareTexture *hwtex = layer->SystemTextures.GetHardwareTexture(translation, mExpanded);
if (hwtex == nullptr)
{
hwtex = CreateHardwareTexture();
layer->SystemTextures.AddHardwareTexture(translation, mExpanded, hwtex);
}
return hwtex;
}
if (layer) return layer->GetHardwareTexture(translation, mExpanded);
return nullptr;
}