diff options
author | Strangerke | 2013-09-08 14:49:34 +0200 |
---|---|---|
committer | Strangerke | 2013-09-08 14:49:34 +0200 |
commit | 599d2eeb06c937a4479cc751f4f9f5e94795c43b (patch) | |
tree | 6efd0f887d7a1fd5082209a585d609983031c92d /engines/testbed/graphics.cpp | |
parent | 7df4c94aeb6c1408d26d6ada58d728b6eac17717 (diff) | |
parent | 03bf56ea82c0b89f4e61e5e0787a36473f999efa (diff) | |
download | scummvm-rg350-599d2eeb06c937a4479cc751f4f9f5e94795c43b.tar.gz scummvm-rg350-599d2eeb06c937a4479cc751f4f9f5e94795c43b.tar.bz2 scummvm-rg350-599d2eeb06c937a4479cc751f4f9f5e94795c43b.zip |
Merge branch 'master' into avalanche
Diffstat (limited to 'engines/testbed/graphics.cpp')
-rw-r--r-- | engines/testbed/graphics.cpp | 22 |
1 files changed, 17 insertions, 5 deletions
diff --git a/engines/testbed/graphics.cpp b/engines/testbed/graphics.cpp index 590e6c6d81..26e073d407 100644 --- a/engines/testbed/graphics.cpp +++ b/engines/testbed/graphics.cpp @@ -927,17 +927,29 @@ TestExitStatus GFXtests::overlayGraphics() { Graphics::PixelFormat pf = g_system->getOverlayFormat(); - OverlayColor buffer[50 * 100]; - OverlayColor value = pf.RGBToColor(0, 255, 0); + byte *buffer = new byte[50 * 100 * pf.bytesPerPixel]; + const uint32 value = pf.RGBToColor(0, 255, 0); - for (int i = 0; i < 50 * 100; i++) { - buffer[i] = value; + if (pf.bytesPerPixel == 2) { + uint16 *dst = (uint16 *)buffer; + for (int i = 50 * 100; i > 0; --i) { + *dst++ = value; + } + } else if (pf.bytesPerPixel == 4) { + uint32 *dst = (uint32 *)buffer; + for (int i = 50 * 100; i > 0; --i) { + *dst++ = value; + } + } else { + error("GFXtests::overlayGraphics: Unsupported color depth: %d", pf.bytesPerPixel); } g_system->showOverlay(); - g_system->copyRectToOverlay(buffer, 200, 270, 175, 100, 50); + g_system->copyRectToOverlay(buffer, 100 * pf.bytesPerPixel, 270, 175, 100, 50); g_system->updateScreen(); + delete[] buffer; + g_system->delayMillis(1000); g_system->hideOverlay(); |