- fixed a few warnings and changed the return type of FGLTexture::Bind, because no caller needs the hardware texture.

This commit is contained in:
Christoph Oelckers 2018-04-14 12:24:04 +02:00
commit 59a08ce0df
3 changed files with 12 additions and 13 deletions

View file

@ -157,7 +157,7 @@ FHardwareTexture *FGLTexture::CreateHwTexture()
//
//===========================================================================
const FHardwareTexture *FGLTexture::Bind(int texunit, int clampmode, int translation, int flags)
bool FGLTexture::Bind(int texunit, int clampmode, int translation, int flags)
{
int usebright = false;
@ -216,7 +216,7 @@ const FHardwareTexture *FGLTexture::Bind(int texunit, int clampmode, int transla
{
// could not create texture
delete[] buffer;
return NULL;
return false;
}
delete[] buffer;
}
@ -225,9 +225,9 @@ const FHardwareTexture *FGLTexture::Bind(int texunit, int clampmode, int transla
if (lastSampler != clampmode)
lastSampler = GLRenderer->mSamplerManager->Bind(texunit, clampmode, lastSampler);
lastTranslation = translation;
return hwtex;
return true;
}
return NULL;
return false;
}
//===========================================================================
@ -636,8 +636,7 @@ void FMaterial::Bind(int clampmode, int translation)
// Textures that are already scaled in the texture lump will not get replaced by hires textures.
int flags = mExpanded? CTF_Expand : (gl_texture_usehires && tex->Scale.X == 1 && tex->Scale.Y == 1 && clampmode <= CLAMP_XY)? CTF_CheckHires : 0;
const FHardwareTexture *gltexture = mBaseLayer->Bind(0, clampmode, translation, flags);
if (gltexture != NULL)
if (mBaseLayer->Bind(0, clampmode, translation, flags))
{
for(unsigned i=0;i<mTextureLayers.Size();i++)
{