summaryrefslogtreecommitdiff
path: root/src/test/testmain.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2012-05-11 21:55:28 +0300
committerAndrei Karas <akaras@inbox.ru>2012-05-18 01:37:32 +0300
commitf35d6cd35d92ad16a55bf49f61f19153949497c0 (patch)
treeb962c63304767edb38433ae9f1956377c8638f90 /src/test/testmain.cpp
parenta736a01786b9ad6df5dba9955fcac96300c537a2 (diff)
downloadplus-f35d6cd35d92ad16a55bf49f61f19153949497c0.tar.gz
plus-f35d6cd35d92ad16a55bf49f61f19153949497c0.tar.bz2
plus-f35d6cd35d92ad16a55bf49f61f19153949497c0.tar.xz
plus-f35d6cd35d92ad16a55bf49f61f19153949497c0.zip
Improve auto detection for best graphics mode.
Diffstat (limited to 'src/test/testmain.cpp')
-rw-r--r--src/test/testmain.cpp20
1 files changed, 17 insertions, 3 deletions
diff --git a/src/test/testmain.cpp b/src/test/testmain.cpp
index eb24a2c75..8ec48e6e2 100644
--- a/src/test/testmain.cpp
+++ b/src/test/testmain.cpp
@@ -78,9 +78,10 @@ int TestMain::exec()
{
initConfig();
int softwareTest = invokeSoftwareRenderTest("1");
- int fastOpenGLTest = invokeFastOpenGLRenderTest("2");
- int safeOpenGLTest = invokeSafeOpenGLRenderTest("3");
- int soundTest = invokeTest4();
+ int fastOpenGLTest = -1;
+ int safeOpenGLTest = -1;
+ int videoDetectTest = -1;
+ int soundTest = -1;
int rescaleTest[3];
int softFps = 0;
int fastOpenGLFps = 0;
@@ -88,11 +89,20 @@ int TestMain::exec()
int openGLMode = 0;
int maxFps = 0;
+ int detectMode = 0;
rescaleTest[0] = -1;
rescaleTest[1] = -1;
rescaleTest[2] = -1;
std::string info;
+ videoDetectTest = invokeTest("99");
+ if (!videoDetectTest)
+ detectMode = readValue(99);
+
+ fastOpenGLTest = invokeFastOpenGLRenderTest("2");
+ safeOpenGLTest = invokeSafeOpenGLRenderTest("3");
+ soundTest = invokeTest4();
+
info += strprintf("%d.%d,%d,%d.", soundTest, softwareTest,
fastOpenGLTest, safeOpenGLTest);
@@ -184,6 +194,10 @@ int TestMain::exec()
maxFps = safeOpenGLFps;
}
+ // if OpenGL implimentation is not good, disable it.
+ if (!detectMode)
+ openGLMode = 0;
+
writeConfig(openGLMode, rescaleTest[openGLMode], soundTest, info);
return 0;
}