remove some dead code

This commit is contained in:
slime
2022-10-10 14:35:12 -03:00
parent 99ad576668
commit 919ffc08f0
3 changed files with 2 additions and 18 deletions
+1 -2
View File
@@ -179,7 +179,6 @@ Texture::Texture(Graphics *gfx, const Settings &settings, const Slices *slices)
, requestedMSAA(settings.msaa > 1 ? settings.msaa : 0)
, samplerState()
, graphicsMemorySize(0)
, usingDefaultTexture(false)
{
if (slices != nullptr && slices->getMipmapCount() > 0 && slices->getSliceCount() > 0)
{
@@ -453,7 +452,7 @@ void Texture::replacePixels(love::image::ImageDataBase *d, int slice, int mipmap
throw love::Exception("replacePixels cannot be called on this Texture while it's an active render target.");
// No effect if the texture hasn't been created yet.
if (getHandle() == 0 || usingDefaultTexture)
if (getHandle() == 0)
return;
if (d->getFormat() != getPixelFormat())
-4
View File
@@ -343,10 +343,6 @@ protected:
int64 graphicsMemorySize;
// True if the texture wasn't able to be properly created and it had to fall
// back to a default texture.
bool usingDefaultTexture;
}; // Texture
} // graphics
+1 -12
View File
@@ -369,11 +369,8 @@ bool Texture::loadVolatile()
if (isReadable())
createTexture();
if (!usingDefaultTexture && framebufferStatus == GL_FRAMEBUFFER_COMPLETE
&& (!isReadable() || actualSamples > 1))
{
if (framebufferStatus == GL_FRAMEBUFFER_COMPLETE && (!isReadable() || actualSamples > 1))
framebufferStatus = newRenderbuffer(pixelWidth, pixelHeight, actualSamples, format, renderbuffer);
}
textureGLError = glGetError();
@@ -403,7 +400,6 @@ bool Texture::loadVolatile()
setGraphicsMemorySize(memsize);
usingDefaultTexture = false;
return true;
}
@@ -575,13 +571,6 @@ void Texture::setSamplerState(const SamplerState &s)
samplerState.mipmapFilter = SamplerState::MIPMAP_FILTER_NEAREST;
}
// We don't want filtering or (attempted) mipmaps on the default texture.
if (usingDefaultTexture)
{
samplerState.mipmapFilter = SamplerState::MIPMAP_FILTER_NONE;
samplerState.minFilter = samplerState.magFilter = SamplerState::FILTER_NEAREST;
}
// If we only have limited NPOT support then the wrap mode must be CLAMP.
if ((GLAD_ES_VERSION_2_0 && !(GLAD_ES_VERSION_3_0 || GLAD_OES_texture_npot))
&& (pixelWidth != nextP2(pixelWidth) || pixelHeight != nextP2(pixelHeight) || depth != nextP2(depth)))