summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2014-06-29 01:41:41 +0300
committerAndrei Karas <akaras@inbox.ru>2014-06-29 01:41:41 +0300
commitfdf0edf39728847b2f912c70a2a35432c8649b4b (patch)
tree69e8dd3c2918e99111e47d39b114c621a46756bf /src
parentf984b61830dfd2fff0ca2a75ec9d9ab82e3801f4 (diff)
downloadmanaplus-fdf0edf39728847b2f912c70a2a35432c8649b4b.tar.gz
manaplus-fdf0edf39728847b2f912c70a2a35432c8649b4b.tar.bz2
manaplus-fdf0edf39728847b2f912c70a2a35432c8649b4b.tar.xz
manaplus-fdf0edf39728847b2f912c70a2a35432c8649b4b.zip
Fix texture compression detection.
Diffstat (limited to 'src')
-rw-r--r--src/graphicsmanager.cpp35
1 files changed, 16 insertions, 19 deletions
diff --git a/src/graphicsmanager.cpp b/src/graphicsmanager.cpp
index f60bf1aa4..495b0ad85 100644
--- a/src/graphicsmanager.cpp
+++ b/src/graphicsmanager.cpp
@@ -627,26 +627,23 @@ bool GraphicsManager::supportExtension(const std::string &ext) const
void GraphicsManager::updateTextureFormat() const
{
const int compressionFormat = config.getIntValue("compresstextures");
- if (compressionFormat)
+ // using extensions if can
+ if (checkGLVersion(3, 1) || supportExtension("GL_ARB_texture_compression"))
{
- // using extensions if can
- if (supportExtension("GL_ARB_texture_compression"))
+ GLint num = 0;
+ glGetIntegerv(GL_NUM_COMPRESSED_TEXTURE_FORMATS, &num);
+ logger->log("support %d compressed formats", num);
+ GLint *const formats = new GLint[num > 10
+ ? static_cast<size_t>(num) : 10];
+ glGetIntegerv(GL_COMPRESSED_TEXTURE_FORMATS, formats);
+ for (int f = 0; f < num; f ++)
+ logger->log(" 0x%x", static_cast<unsigned int>(formats[f]));
+
+ if (compressionFormat)
{
if (supportExtension("GL_EXT_texture_compression_s3tc")
|| supportExtension("3DFX_texture_compression_FXT1"))
{
- GLint num = 0;
- glGetIntegerv(GL_NUM_COMPRESSED_TEXTURE_FORMATS, &num);
- logger->log("support %d compressed formats", num);
- GLint *const formats = new GLint[num > 10
- ? static_cast<size_t>(num) : 10];
- glGetIntegerv(GL_COMPRESSED_TEXTURE_FORMATS, formats);
- for (int f = 0; f < num; f ++)
- {
- logger->log(" 0x%x", static_cast<unsigned int>(
- formats[f]));
- }
-
for (int f = 0; f < num; f ++)
{
if (formats[f] == GL_COMPRESSED_RGBA_S3TC_DXT5_EXT
@@ -688,10 +685,10 @@ void GraphicsManager::updateTextureFormat() const
}
}
}
- else
- {
- logger->log1("no correct compression format found");
- }
+ }
+ else
+ {
+ logger->log1("no correct compression format found");
}
const int renderer = settings.options.renderer;