diff options
author | Andrei Karas <akaras@inbox.ru> | 2013-09-02 21:02:34 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2013-09-02 21:02:34 +0300 |
commit | 370cb1fa897604e5d7bf9543881afad80f45f3ba (patch) | |
tree | 66ea88a44010ebeb13ec6258b37b9a93e04c909d /src/test | |
parent | 1d843dd814f92004efbb4574be0d898d4edf6359 (diff) | |
download | manaplus-370cb1fa897604e5d7bf9543881afad80f45f3ba.tar.gz manaplus-370cb1fa897604e5d7bf9543881afad80f45f3ba.tar.bz2 manaplus-370cb1fa897604e5d7bf9543881afad80f45f3ba.tar.xz manaplus-370cb1fa897604e5d7bf9543881afad80f45f3ba.zip |
dehardcode some mode render mode constans usage.
Diffstat (limited to 'src/test')
-rw-r--r-- | src/test/testmain.cpp | 16 | ||||
-rw-r--r-- | src/test/testmain.h | 4 |
2 files changed, 11 insertions, 9 deletions
diff --git a/src/test/testmain.cpp b/src/test/testmain.cpp index 3d4bdd33d..51747b60c 100644 --- a/src/test/testmain.cpp +++ b/src/test/testmain.cpp @@ -82,7 +82,7 @@ int TestMain::exec(const bool testAudio) int fastOpenGLFps = 0; int safeOpenGLFps = 0; - int openGLMode = 0; + RenderType openGLMode = RENDER_SOFTWARE; int detectMode = 0; rescaleTest[0] = -1; rescaleTest[1] = -1; @@ -182,19 +182,19 @@ int TestMain::exec(const bool testAudio) int maxFps = softFps; if (maxFps < fastOpenGLFps) { - openGLMode = 1; + openGLMode = RENDER_NORMAL_OPENGL; maxFps = fastOpenGLFps; } if (maxFps < safeOpenGLFps) { - openGLMode = 2; + openGLMode = RENDER_SAFE_OPENGL; maxFps = safeOpenGLFps; } int batchSize = 256; /* // if OpenGL mode is fast mode we can try detect max batch sizes - if (openGLMode == 1) + if (openGLMode == RENDER_NORMAL_OPENGL) { if (!invokeFastOpenBatchTest("11")) batchSize = readValue2(11); @@ -205,23 +205,23 @@ int TestMain::exec(const bool testAudio) // if OpenGL implimentation is not good, disable it. if (!(detectMode & 15)) - openGLMode = 0; + openGLMode = RENDER_SOFTWARE; writeConfig(openGLMode, rescaleTest[openGLMode], soundTest, info, batchSize, detectMode); return 0; } -void TestMain::writeConfig(const int openGLMode, const int rescale, +void TestMain::writeConfig(const RenderType openGLMode, const int rescale, const int sound, const std::string &info, const int batchSize A_UNUSED, const int detectMode) { mConfig.init(client->getConfigDirectory() + "/config.xml"); - log->log("set mode to %d", openGLMode); + log->log("set mode to %d", static_cast<int>(openGLMode)); // searched values - mConfig.setValue("opengl", openGLMode); + mConfig.setValue("opengl", static_cast<int>(openGLMode)); mConfig.setValue("showBackground", !rescale); mConfig.setValue("sound", !sound); diff --git a/src/test/testmain.h b/src/test/testmain.h index b0ad82e95..bcac222c0 100644 --- a/src/test/testmain.h +++ b/src/test/testmain.h @@ -25,6 +25,8 @@ #include "logger.h" #include "main.h" +#include "render/renderers.h" + #ifdef USE_OPENGL #include <string> @@ -66,7 +68,7 @@ class TestMain void testsMain(); - void writeConfig(const int openGLMode, const int rescale, + void writeConfig(const RenderType openGLMode, const int rescale, const int sound, const std::string &info, const int batchSize, const int detectMode); |