~ubuntu-branches/ubuntu/trusty/manaplus/trusty-proposed

« back to all changes in this revision

Viewing changes to src/test/testmain.cpp

  • Committer: Package Import Robot
  • Author(s): Patrick Matthäi
  • Date: 2013-09-17 10:35:51 UTC
  • mfrom: (1.1.10)
  • Revision ID: package-import@ubuntu.com-20130917103551-az7p3nz9jgxwqjfn
Tags: 1.3.9.15-1
New upstream release.

Show diffs side-by-side

added added

removed removed

Lines of Context:
82
82
    int fastOpenGLFps = 0;
83
83
    int safeOpenGLFps = 0;
84
84
 
85
 
    int openGLMode = 0;
 
85
    RenderType openGLMode = RENDER_SOFTWARE;
86
86
    int detectMode = 0;
87
87
    rescaleTest[0] = -1;
88
88
    rescaleTest[1] = -1;
182
182
    int maxFps = softFps;
183
183
    if (maxFps < fastOpenGLFps)
184
184
    {
185
 
        openGLMode = 1;
 
185
        openGLMode = RENDER_NORMAL_OPENGL;
186
186
        maxFps = fastOpenGLFps;
187
187
    }
188
188
    if (maxFps < safeOpenGLFps)
189
189
    {
190
 
        openGLMode = 2;
 
190
        openGLMode = RENDER_SAFE_OPENGL;
191
191
        maxFps = safeOpenGLFps;
192
192
    }
193
193
 
194
194
    int batchSize = 256;
195
195
/*
196
196
    // if OpenGL mode is fast mode we can try detect max batch sizes
197
 
    if (openGLMode == 1)
 
197
    if (openGLMode == RENDER_NORMAL_OPENGL)
198
198
    {
199
199
        if (!invokeFastOpenBatchTest("11"))
200
200
            batchSize = readValue2(11);
205
205
 
206
206
    // if OpenGL implimentation is not good, disable it.
207
207
    if (!(detectMode & 15))
208
 
        openGLMode = 0;
 
208
        openGLMode = RENDER_SOFTWARE;
209
209
 
210
210
    writeConfig(openGLMode, rescaleTest[openGLMode],
211
211
        soundTest, info, batchSize, detectMode);
212
212
    return 0;
213
213
}
214
214
 
215
 
void TestMain::writeConfig(const int openGLMode, const int rescale,
 
215
void TestMain::writeConfig(const RenderType openGLMode, const int rescale,
216
216
                           const int sound, const std::string &info,
217
217
                           const int batchSize A_UNUSED, const int detectMode)
218
218
{
219
219
    mConfig.init(client->getConfigDirectory() + "/config.xml");
220
220
 
221
 
    log->log("set mode to %d", openGLMode);
 
221
    log->log("set mode to %d", static_cast<int>(openGLMode));
222
222
 
223
223
    // searched values
224
 
    mConfig.setValue("opengl", openGLMode);
 
224
    mConfig.setValue("opengl", static_cast<int>(openGLMode));
225
225
    mConfig.setValue("showBackground", !rescale);
226
226
    mConfig.setValue("sound", !sound);
227
227