summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2014-06-14 21:51:25 +0300
committerAndrei Karas <akaras@inbox.ru>2014-06-14 21:51:25 +0300
commitf43b3c4de32e049e087b4dec3c81c99307f46c1d (patch)
treece0510f3642e0900abbceeb9c6a322c62a92b1d3
parent7b6e1592f9d969cad8cd85598250000e1628d70c (diff)
downloadmanaplus-f43b3c4de32e049e087b4dec3c81c99307f46c1d.tar.gz
manaplus-f43b3c4de32e049e087b4dec3c81c99307f46c1d.tar.bz2
manaplus-f43b3c4de32e049e087b4dec3c81c99307f46c1d.tar.xz
manaplus-f43b3c4de32e049e087b4dec3c81c99307f46c1d.zip
Add another build in fps test, unused.
-rw-r--r--src/test/testlauncher.cpp49
-rw-r--r--src/test/testlauncher.h2
2 files changed, 51 insertions, 0 deletions
diff --git a/src/test/testlauncher.cpp b/src/test/testlauncher.cpp
index c1bde0810..22a77eb0e 100644
--- a/src/test/testlauncher.cpp
+++ b/src/test/testlauncher.cpp
@@ -92,6 +92,8 @@ int TestLauncher::exec()
return testDraw();
else if (mTest == "103")
return testFps2();
+ else if (mTest == "104")
+ return testFps3();
return -1;
}
@@ -219,6 +221,53 @@ int TestLauncher::testFps2()
return 0;
}
+int TestLauncher::testFps3()
+{
+ timeval start;
+ timeval end;
+
+ Wallpaper::loadWallpapers();
+ Wallpaper::getWallpaper(800, 600);
+ Image *img[2];
+
+ img[0] = Theme::getImageFromTheme("graphics/sprites/arrow_up.png");
+ img[1] = Theme::getImageFromTheme("graphics/sprites/arrow_left.png");
+ ImageVertexes *const vert1 = new ImageVertexes;
+ vert1->image = img[0];
+ ImageVertexes *const vert2 = new ImageVertexes;
+ vert2->image = img[1];
+
+ for (int f = 0; f < 50; f ++)
+ {
+ for (int d = 0; d < 50; d ++)
+ {
+ mainGraphics->calcTileVertexes(vert1, img[0], f * 16, d * 12);
+ mainGraphics->calcTileVertexes(vert1, img[1], f * 16 + 5, d * 12);
+ }
+ }
+ mainGraphics->finalize(vert1);
+ mainGraphics->finalize(vert2);
+
+ const int cnt = 2000;
+
+ gettimeofday(&start, nullptr);
+ for (int k = 0; k < cnt; k ++)
+ {
+ mainGraphics->drawTileVertexes(vert1);
+ mainGraphics->drawTileVertexes(vert2);
+ mainGraphics->updateScreen();
+ }
+
+ gettimeofday(&end, nullptr);
+ const int tFps = calcFps(&start, &end, cnt);
+ file << mTest << std::endl;
+ file << tFps << std::endl;
+
+ printf("fps: %u\n", tFps);
+ sleep(1);
+ return 0;
+}
+
int TestLauncher::testBatches()
{
int batches = 512;
diff --git a/src/test/testlauncher.h b/src/test/testlauncher.h
index bc5d93ea8..4b044d42b 100644
--- a/src/test/testlauncher.h
+++ b/src/test/testlauncher.h
@@ -58,6 +58,8 @@ class TestLauncher final
int testFps2();
+ int testFps3();
+
int testInternal();
int testDye();