summaryrefslogtreecommitdiff
path: root/src/test
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2014-05-26 01:13:49 +0300
committerAndrei Karas <akaras@inbox.ru>2014-05-26 02:26:55 +0300
commite82ae5648c5c7fa47146c63e08728e53bf9c3a1c (patch)
treefc00be576e8c784385b75842a2ac5aeb8698091b /src/test
parentfb7c6d3e40a25b68b4947a30ef4678fefc086593 (diff)
downloadmv-e82ae5648c5c7fa47146c63e08728e53bf9c3a1c.tar.gz
mv-e82ae5648c5c7fa47146c63e08728e53bf9c3a1c.tar.bz2
mv-e82ae5648c5c7fa47146c63e08728e53bf9c3a1c.tar.xz
mv-e82ae5648c5c7fa47146c63e08728e53bf9c3a1c.zip
Fix max texture size detection.
Diffstat (limited to 'src/test')
-rw-r--r--src/test/testlauncher.cpp17
1 files changed, 9 insertions, 8 deletions
diff --git a/src/test/testlauncher.cpp b/src/test/testlauncher.cpp
index 0ba6ab97b..1a435d280 100644
--- a/src/test/testlauncher.cpp
+++ b/src/test/testlauncher.cpp
@@ -187,8 +187,8 @@ int TestLauncher::testBatches()
int TestLauncher::testTextures()
{
- int maxSize = 1024;
- int nextSize = 1024;
+ int maxSize = 512;
+ int nextSize = 512;
int sz = OpenGLImageHelper::getTextureSize() + 1;
if (sz > 16500)
sz = 16500;
@@ -201,8 +201,8 @@ int TestLauncher::testTextures()
const uint32_t bytes2[] =
{
- 0x00FF0000U, 0xFFFFFFFFU, 0x0000FF00U, 0xFF000000U,
- 0x0000FF00U, 0x00000000U
+ 0xFF0000FFU, 0xFF00FFFFU, 0xFFFFFF00U, 0xFFFF0000U,
+ 0xFF000000U, 0xFFFF00FFU
};
for (nextSize = 512; nextSize < sz; nextSize *= 2)
@@ -237,12 +237,13 @@ int TestLauncher::testTextures()
mainGraphics->updateScreen();
mainGraphics->drawImage(subImage, 0, 0);
delete subImage;
- SDL_Surface *const screen = mainGraphics->getScreenshot();
- pixels = static_cast<uint32_t*>(screen->pixels);
+ SDL_Surface *const screen1 = mainGraphics->getScreenshot();
+ SDL_Surface *const screen2 = imageHelper->convertTo32Bit(screen1);
+ SDL_FreeSurface(screen1);
+ pixels = static_cast<uint32_t*>(screen2->pixels);
bool fail(false);
for (int f = 0; f < 6; f ++)
{
-// printf("diff: %d, %x and %x\n", f, pixels[f], bytes2[f]);
if (pixels[f] != bytes2[f])
{
fail = true;
@@ -250,7 +251,7 @@ int TestLauncher::testTextures()
}
}
- SDL_FreeSurface(screen);
+ SDL_FreeSurface(screen2);
if (fail)
break;