Remove automatic mipmap mode, as it duplicates the default mode
parent
7228d408e0
commit
f46a00f4f1
|
@ -98,8 +98,6 @@ Texture* TextureInfo::load(const fs::path& name)
|
||||||
|
|
||||||
if (flags & NoMipMaps)
|
if (flags & NoMipMaps)
|
||||||
mipMode = Texture::NoMipMaps;
|
mipMode = Texture::NoMipMaps;
|
||||||
else if (flags & AutoMipMaps)
|
|
||||||
mipMode = Texture::AutoMipMaps;
|
|
||||||
|
|
||||||
if (bumpHeight == 0.0f)
|
if (bumpHeight == 0.0f)
|
||||||
{
|
{
|
||||||
|
|
|
@ -411,13 +411,7 @@ ImageTexture::ImageTexture(Image& img,
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifndef GL_ES
|
|
||||||
if (mipMapMode == AutoMipMaps)
|
|
||||||
glTexParameteri(GL_TEXTURE_2D, GL_GENERATE_MIPMAP, GL_TRUE);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
bool genMipmaps = mipmap && !precomputedMipMaps;
|
bool genMipmaps = mipmap && !precomputedMipMaps;
|
||||||
|
|
||||||
#if !defined(GL_ES)
|
#if !defined(GL_ES)
|
||||||
if (genMipmaps && !FramebufferObject::isSupported())
|
if (genMipmaps && !FramebufferObject::isSupported())
|
||||||
glTexParameteri(GL_TEXTURE_2D, GL_GENERATE_MIPMAP, GL_TRUE);
|
glTexParameteri(GL_TEXTURE_2D, GL_GENERATE_MIPMAP, GL_TRUE);
|
||||||
|
@ -426,18 +420,9 @@ ImageTexture::ImageTexture(Image& img,
|
||||||
if (mipmap)
|
if (mipmap)
|
||||||
{
|
{
|
||||||
if (precomputedMipMaps)
|
if (precomputedMipMaps)
|
||||||
{
|
|
||||||
LoadMipmapSet(img, GL_TEXTURE_2D);
|
LoadMipmapSet(img, GL_TEXTURE_2D);
|
||||||
}
|
|
||||||
else if (mipMapMode == DefaultMipMaps)
|
else if (mipMapMode == DefaultMipMaps)
|
||||||
{
|
|
||||||
LoadMiplessTexture(img, GL_TEXTURE_2D);
|
LoadMiplessTexture(img, GL_TEXTURE_2D);
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
assert(mipMapMode == AutoMipMaps);
|
|
||||||
LoadMiplessTexture(img, GL_TEXTURE_2D);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -932,13 +917,6 @@ static Texture* CreateTextureFromImage(Image& img,
|
||||||
Texture::AddressMode addressMode,
|
Texture::AddressMode addressMode,
|
||||||
Texture::MipMapMode mipMode)
|
Texture::MipMapMode mipMode)
|
||||||
{
|
{
|
||||||
// If non power of two textures are supported switch mipmap generation to
|
|
||||||
// automatic. gluBuildMipMaps may rescale the texture to a power of two
|
|
||||||
// on some drivers even when the hardware supports non power of two textures,
|
|
||||||
// whereas auto mipmap generation will properly deal with the dimensions.
|
|
||||||
if (mipMode == Texture::DefaultMipMaps)
|
|
||||||
mipMode = Texture::AutoMipMaps;
|
|
||||||
|
|
||||||
Texture* tex = nullptr;
|
Texture* tex = nullptr;
|
||||||
|
|
||||||
const int maxDim = gl::maxTextureSize;
|
const int maxDim = gl::maxTextureSize;
|
||||||
|
|
|
@ -94,7 +94,6 @@ class Texture
|
||||||
{
|
{
|
||||||
DefaultMipMaps = 0,
|
DefaultMipMaps = 0,
|
||||||
NoMipMaps = 1,
|
NoMipMaps = 1,
|
||||||
AutoMipMaps = 2,
|
|
||||||
};
|
};
|
||||||
|
|
||||||
// Format option flags
|
// Format option flags
|
||||||
|
|
Loading…
Reference in New Issue