summaryrefslogtreecommitdiff
path: root/src/graphicsmanager.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2013-01-26 01:31:38 +0300
committerAndrei Karas <akaras@inbox.ru>2013-01-26 01:31:38 +0300
commit85d58aef208ae7c1f0ef5d449e17a1410a6eb04d (patch)
treed50ea0b708b9ae00432deb54e4def67e26c0796b /src/graphicsmanager.cpp
parentd1153fc8c1f226d802e82cba7d11c686998a1523 (diff)
downloadmv-85d58aef208ae7c1f0ef5d449e17a1410a6eb04d.tar.gz
mv-85d58aef208ae7c1f0ef5d449e17a1410a6eb04d.tar.bz2
mv-85d58aef208ae7c1f0ef5d449e17a1410a6eb04d.tar.xz
mv-85d58aef208ae7c1f0ef5d449e17a1410a6eb04d.zip
Add support for manual compression selection.
Diffstat (limited to 'src/graphicsmanager.cpp')
-rw-r--r--src/graphicsmanager.cpp39
1 files changed, 28 insertions, 11 deletions
diff --git a/src/graphicsmanager.cpp b/src/graphicsmanager.cpp
index ba3ca95ad..f42aca9cb 100644
--- a/src/graphicsmanager.cpp
+++ b/src/graphicsmanager.cpp
@@ -493,7 +493,8 @@ bool GraphicsManager::supportExtension(const std::string &ext)
void GraphicsManager::updateTextureFormat()
{
- if (config.getBoolValue("compresstextures"))
+ const int compressionFormat = config.getIntValue("compresstextures");
+ if (compressionFormat)
{
// using extensions if can
if (supportExtension("GL_ARB_texture_compression"))
@@ -507,8 +508,12 @@ void GraphicsManager::updateTextureFormat()
GLint *formats = new GLint[num > 10 ? num : 10];
glGetIntegerv(GL_COMPRESSED_TEXTURE_FORMATS, formats);
for (int f = 0; f < num; f ++)
+ logger->log(" 0x%x", formats[f]);
+
+ for (int f = 0; f < num; f ++)
{
- if (formats[f] == GL_COMPRESSED_RGBA_S3TC_DXT5_EXT)
+ if (formats[f] == GL_COMPRESSED_RGBA_S3TC_DXT5_EXT
+ && compressionFormat == 1)
{
delete []formats;
OpenGLImageHelper::setInternalTextureType(
@@ -516,7 +521,8 @@ void GraphicsManager::updateTextureFormat()
logger->log1("using s3tc texture compression");
return;
}
- else if (formats[f] == GL_COMPRESSED_RGBA_FXT1_3DFX)
+ else if (formats[f] == GL_COMPRESSED_RGBA_FXT1_3DFX
+ && compressionFormat == 2)
{
delete []formats;
OpenGLImageHelper::setInternalTextureType(
@@ -525,19 +531,30 @@ void GraphicsManager::updateTextureFormat()
return;
}
}
- OpenGLImageHelper::setInternalTextureType(
- GL_COMPRESSED_RGBA_ARB);
- logger->log1("using texture compression");
- return;
+ delete []formats;
+ if (compressionFormat == 3)
+ {
+ OpenGLImageHelper::setInternalTextureType(
+ GL_COMPRESSED_RGBA_ARB);
+ logger->log1("using ARB texture compression");
+ return;
+ }
}
else
{
- OpenGLImageHelper::setInternalTextureType(
- GL_COMPRESSED_RGBA_ARB);
- logger->log1("using texture compression");
- return;
+ if (compressionFormat == 3)
+ {
+ OpenGLImageHelper::setInternalTextureType(
+ GL_COMPRESSED_RGBA_ARB);
+ logger->log1("using ARB texture compression");
+ return;
+ }
}
}
+ else
+ {
+ logger->log("no correct compression format found");
+ }
}
// using default formats