summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/defaults.cpp1
-rw-r--r--src/graphicsmanager.cpp83
-rw-r--r--src/gui/setup_perfomance.cpp3
-rw-r--r--src/resources/image.cpp2
4 files changed, 54 insertions, 35 deletions
diff --git a/src/defaults.cpp b/src/defaults.cpp
index 22ec65dfd..fda474fb1 100644
--- a/src/defaults.cpp
+++ b/src/defaults.cpp
@@ -256,6 +256,7 @@ DefaultsData* getConfigDefaults()
AddDEF(configData, "compresstextures", false);
AddDEF(configData, "rectangulartextures", true);
AddDEF(configData, "networksleep", 0);
+ AddDEF(configData, "newtextures", true);
return configData;
}
diff --git a/src/graphicsmanager.cpp b/src/graphicsmanager.cpp
index fec1a9a6d..fbe852588 100644
--- a/src/graphicsmanager.cpp
+++ b/src/graphicsmanager.cpp
@@ -87,48 +87,63 @@ bool GraphicsManager::supportExtension(const std::string &ext)
void GraphicsManager::updateTextureFormat()
{
#ifdef USE_OPENGL
- if (!config.getBoolValue("compresstextures"))
- return;
-
- if (supportExtension("GL_ARB_texture_compression"))
+ if (config.getBoolValue("compresstextures"))
{
- if (supportExtension("GL_EXT_texture_compression_s3tc")
- || supportExtension("3DFX_texture_compression_FXT1"))
+ // using extensions if can
+ if (supportExtension("GL_ARB_texture_compression"))
{
- GLint num;
- GLint *formats = nullptr;
- glGetIntegerv(GL_NUM_COMPRESSED_TEXTURE_FORMATS, &num);
- logger->log("support %d compressed formats", num);
- formats = new GLint[num > 10 ? num : 10];
- glGetIntegerv(GL_COMPRESSED_TEXTURE_FORMATS, formats);
- for (int f = 0; f < num; f ++)
+ if (supportExtension("GL_EXT_texture_compression_s3tc")
+ || supportExtension("3DFX_texture_compression_FXT1"))
{
- if (formats[f] == GL_COMPRESSED_RGBA_S3TC_DXT5_EXT)
- {
- delete []formats;
- Image::setInternalTextureType(
- GL_COMPRESSED_RGBA_S3TC_DXT5_EXT);
- logger->log("using s3tc texture compression");
- return;
- }
- else if (formats[f] == GL_COMPRESSED_RGBA_FXT1_3DFX)
+ GLint num;
+ GLint *formats = nullptr;
+ glGetIntegerv(GL_NUM_COMPRESSED_TEXTURE_FORMATS, &num);
+ logger->log("support %d compressed formats", num);
+ formats = new GLint[num > 10 ? num : 10];
+ glGetIntegerv(GL_COMPRESSED_TEXTURE_FORMATS, formats);
+ for (int f = 0; f < num; f ++)
{
- delete []formats;
- Image::setInternalTextureType(
- GL_COMPRESSED_RGBA_FXT1_3DFX);
- logger->log("using fxt1 texture compression");
- return;
+ if (formats[f] == GL_COMPRESSED_RGBA_S3TC_DXT5_EXT)
+ {
+ delete []formats;
+ Image::setInternalTextureType(
+ GL_COMPRESSED_RGBA_S3TC_DXT5_EXT);
+ logger->log1("using s3tc texture compression");
+ return;
+ }
+ else if (formats[f] == GL_COMPRESSED_RGBA_FXT1_3DFX)
+ {
+ delete []formats;
+ Image::setInternalTextureType(
+ GL_COMPRESSED_RGBA_FXT1_3DFX);
+ logger->log1("using fxt1 texture compression");
+ return;
+ }
}
+ Image::setInternalTextureType(GL_COMPRESSED_RGBA_ARB);
+ logger->log1("using texture compression");
+ return;
+ }
+ else
+ {
+ Image::setInternalTextureType(GL_COMPRESSED_RGBA_ARB);
+ logger->log1("using texture compression");
+ return;
}
- Image::setInternalTextureType(GL_COMPRESSED_RGBA_ARB);
- logger->log("using texture compression");
- }
- else
- {
- Image::setInternalTextureType(GL_COMPRESSED_RGBA_ARB);
- logger->log("using texture compression");
}
}
+
+ // using default formats
+ if (config.getBoolValue("newtextures"))
+ {
+ Image::setInternalTextureType(GL_RGBA);
+ logger->log1("using RGBA texture format");
+ }
+ else
+ {
+ Image::setInternalTextureType(4);
+ logger->log1("using 4 texture format");
+ }
#endif
}
diff --git a/src/gui/setup_perfomance.cpp b/src/gui/setup_perfomance.cpp
index a40a400f3..8d6592315 100644
--- a/src/gui/setup_perfomance.cpp
+++ b/src/gui/setup_perfomance.cpp
@@ -99,6 +99,9 @@ Setup_Perfomance::Setup_Perfomance()
new SetupItemCheckBox(_("Enable rectangular texture extension (OpenGL)"),
"", "rectangulartextures", this, "rectangulartexturesEvent");
+ new SetupItemCheckBox(_("Use new texture internal format (OpenGL)"),
+ "", "newtextures", this, "newtexturesEvent");
+
setDimension(gcn::Rectangle(0, 0, 550, 350));
}
diff --git a/src/resources/image.cpp b/src/resources/image.cpp
index fa9f1462a..34a2e22b7 100644
--- a/src/resources/image.cpp
+++ b/src/resources/image.cpp
@@ -44,7 +44,7 @@
#ifdef USE_OPENGL
int Image::mUseOpenGL = 0;
int Image::mTextureType = 0;
-int Image::mInternalTextureType = 4;
+int Image::mInternalTextureType = GL_RGBA8;
int Image::mTextureSize = 0;
bool Image::mBlur = true;
#endif