summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2012-05-19 21:34:11 +0300
committerAndrei Karas <akaras@inbox.ru>2012-05-19 21:45:37 +0300
commitf0a7d551bad15085c1f72df38b6a216c8bf3127d (patch)
tree46812143c8d811c8cf43897d4fa1898d3c83ad5e
parentcc7e9dc6e6f7a006db7417fd9b7d93d587e27529 (diff)
downloadmv-f0a7d551bad15085c1f72df38b6a216c8bf3127d.tar.gz
mv-f0a7d551bad15085c1f72df38b6a216c8bf3127d.tar.bz2
mv-f0a7d551bad15085c1f72df38b6a216c8bf3127d.tar.xz
mv-f0a7d551bad15085c1f72df38b6a216c8bf3127d.zip
Auto detect better video mode at first start.
-rw-r--r--src/client.cpp9
-rw-r--r--src/defaults.cpp1
-rw-r--r--src/graphicsmanager.cpp4
3 files changed, 14 insertions, 0 deletions
diff --git a/src/client.cpp b/src/client.cpp
index 383a40da1..e7083f943 100644
--- a/src/client.cpp
+++ b/src/client.cpp
@@ -508,6 +508,15 @@ void Client::gameInit()
}
#endif
+#ifdef WIN32
+ if (mOptions.test.empty() && !config.getBoolValue("videodetected"))
+ {
+ int val = graphicsManager.startDetection();
+ if (val >= 0 && val <= 2)
+ config.setValue("opengl", val);
+ config.setValue("videodetected", true);
+ }
+#endif
graphicsManager.initGraphics(mOptions.noOpenGL);
runCounters = config.getBoolValue("packetcounters");
diff --git a/src/defaults.cpp b/src/defaults.cpp
index fda474fb1..4d760441a 100644
--- a/src/defaults.cpp
+++ b/src/defaults.cpp
@@ -257,6 +257,7 @@ DefaultsData* getConfigDefaults()
AddDEF(configData, "rectangulartextures", true);
AddDEF(configData, "networksleep", 0);
AddDEF(configData, "newtextures", true);
+ AddDEF(configData, "videodetected", false);
return configData;
}
diff --git a/src/graphicsmanager.cpp b/src/graphicsmanager.cpp
index f1e13b74b..36ccdc045 100644
--- a/src/graphicsmanager.cpp
+++ b/src/graphicsmanager.cpp
@@ -48,9 +48,13 @@ GraphicsManager::~GraphicsManager()
bool GraphicsManager::startDetection()
{
+#ifdef USE_OPENGL
TestMain *test = new TestMain();
test->exec(false);
return test->getConfig().getValueInt("opengl", -1);
+#else
+ return 0;
+#endif
}
bool GraphicsManager::detectGraphics()