From 370cb1fa897604e5d7bf9543881afad80f45f3ba Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Mon, 2 Sep 2013 21:02:34 +0300 Subject: dehardcode some mode render mode constans usage. --- src/test/testmain.cpp | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'src/test/testmain.cpp') 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(openGLMode)); // searched values - mConfig.setValue("opengl", openGLMode); + mConfig.setValue("opengl", static_cast(openGLMode)); mConfig.setValue("showBackground", !rescale); mConfig.setValue("sound", !sound); -- cgit v1.2.3-60-g2f50