diff options
Diffstat (limited to 'engines/testbed')
-rw-r--r-- | engines/testbed/graphics.cpp | 53 |
1 files changed, 39 insertions, 14 deletions
diff --git a/engines/testbed/graphics.cpp b/engines/testbed/graphics.cpp index 1eac3a8ffb..9fa06de9b6 100644 --- a/engines/testbed/graphics.cpp +++ b/engines/testbed/graphics.cpp @@ -977,23 +977,48 @@ TestExitStatus GFXtests::shakingEffect() { return kTestSkipped; } + // test vertical, horizontal, and diagonal Common::Point pt(0, 100); - Testsuite::writeOnScreen("If Shaking Effect works, this should shake!", pt); - int times = 15; - while (times--) { - g_system->setShakePos(25, 25); - g_system->delayMillis(50); - g_system->updateScreen(); - g_system->setShakePos(0, 0); - g_system->delayMillis(50); - g_system->updateScreen(); - } - g_system->delayMillis(1500); + for (int i = 0; i < 3; ++i) { + Common::String direction; + int shakeXOffset; + int shakeYOffset; + switch (i) { + case 0: + direction = "vertical"; + shakeXOffset = 0; + shakeYOffset = 25; + break; + case 1: + direction = "horizontal"; + shakeXOffset = 25; + shakeYOffset = 0; + break; + default: + direction = "diagonal"; + shakeXOffset = 25; + shakeYOffset = 25; + break; + } - if (Testsuite::handleInteractiveInput("Did the Shaking test worked as you were expecting?", "Yes", "No", kOptionRight)) { - Testsuite::logDetailedPrintf("Shaking Effect didn't worked"); - return kTestFailed; + Testsuite::writeOnScreen(Common::String::format("If Shaking Effect works, this should shake %s", direction.c_str()), pt); + int times = 15; + while (times--) { + g_system->setShakePos(shakeXOffset, shakeYOffset); + g_system->delayMillis(50); + g_system->updateScreen(); + g_system->setShakePos(0, 0); + g_system->delayMillis(50); + g_system->updateScreen(); + } + g_system->delayMillis(1500); + + if (Testsuite::handleInteractiveInput("Did the Shaking test work as you were expecting?", "Yes", "No", kOptionRight)) { + Testsuite::logDetailedPrintf("Shaking Effect didn't work"); + return kTestFailed; + } } + return kTestPassed; } |