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

« back to all changes in this revision

Viewing changes to src/test/testlauncher.cpp

  • Committer: Package Import Robot
  • Author(s): Patrick Matthäi
  • Date: 2013-10-07 10:26:14 UTC
  • mfrom: (1.1.11)
  • Revision ID: package-import@ubuntu.com-20131007102614-tg2zjdz8vmtl6n7i
Tags: 1.3.9.29-1
New upstream release.

Show diffs side-by-side

added added

removed removed

Lines of Context:
23
23
#ifdef USE_OPENGL
24
24
 
25
25
#include "client.h"
26
 
#include "configuration.h"
27
26
#include "graphicsmanager.h"
28
27
#include "soundmanager.h"
29
28
 
31
30
 
32
31
#include "gui/theme.h"
33
32
 
34
 
#include "utils/gettext.h"
35
 
#include "utils/mkdir.h"
 
33
#include "utils/physfscheckutils.h"
36
34
#include "utils/physfsrwops.h"
37
35
 
38
36
#include "resources/dye.h"
135
133
    Wallpaper::loadWallpapers();
136
134
    Wallpaper::getWallpaper(800, 600);
137
135
    Image *img[5];
 
136
    const int sz = 4;
138
137
 
139
138
    img[0] = Theme::getImageFromTheme("graphics/sprites/arrow_up.png");
140
139
    img[1] = Theme::getImageFromTheme(
144
143
    img[4] = Theme::getImageFromTheme("graphics/images/login_wallpaper.png");
145
144
    int idx = 0;
146
145
 
147
 
    const int cnt = 20;
 
146
    const int cnt = 50;
148
147
 
149
148
    gettimeofday(&start, nullptr);
150
149
    for (int k = 0; k < cnt; k ++)
151
150
    {
152
 
        for (int x = 0; x < 800; x += 20)
 
151
        for (int x = 0; x < 800; x += 30)
153
152
        {
154
 
            for (int y = 0; y < 600; y += 25)
 
153
            for (int y = 0; y < 600; y += 50)
155
154
            {
156
155
                mainGraphics->drawImage(img[idx], x, y);
157
156
                idx ++;
158
 
                if (idx > 4)
 
157
                if (idx > sz)
159
158
                    idx = 0;
160
159
                mainGraphics->drawImage(img[idx], x, y);
161
160
                idx ++;
162
 
                if (idx > 4)
 
161
                if (idx > sz)
163
162
                    idx = 0;
164
163
            }
165
164
        }
236
235
 
237
236
int TestLauncher::testDye()
238
237
{
239
 
    SDL_RWops *rw = PHYSFSRWOPS_openRead(
 
238
    SDL_RWops *rw = MPHYSFSRWOPS_openRead(
240
239
        "graphics/sprites/arrow_up.png");
241
240
    Dye *d = nullptr;
242
241
 
259
258
                    client->getTempDirectory() + "/testimage2.png");
260
259
            }
261
260
 
262
 
            rw = PHYSFSRWOPS_openRead(
 
261
            rw = MPHYSFSRWOPS_openRead(
263
262
                "graphics/sprites/arrow_up.png");
264
263
            d = new Dye("S:#0000ff,00ff00,5c5cff,ff0000");
265
264
            image = d ? surfaceImageHelper->load(rw, *d)