aboutsummaryrefslogtreecommitdiff
path: root/engines/testbed
diff options
context:
space:
mode:
authorsluicebox2019-11-17 15:01:29 -0800
committerEugene Sandulenko2019-11-19 00:20:40 +0100
commit79d636ba8a34a3dd5942cd61933940bbc4c87541 (patch)
treea87bdbcc475d24b00110f417cd645f3c0ba1168d /engines/testbed
parent8057cfa38f247c8a46bf563da706b541837e5ded (diff)
downloadscummvm-rg350-79d636ba8a34a3dd5942cd61933940bbc4c87541.tar.gz
scummvm-rg350-79d636ba8a34a3dd5942cd61933940bbc4c87541.tar.bz2
scummvm-rg350-79d636ba8a34a3dd5942cd61933940bbc4c87541.zip
TESTBED: Add horizontal/diagonal shake tests
Diffstat (limited to 'engines/testbed')
-rw-r--r--engines/testbed/graphics.cpp53
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;
}