aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorStrangerke2016-05-28 18:37:22 +0200
committerStrangerke2016-05-28 18:40:22 +0200
commitcd271a0b34bc575201bf1d700069a7a3960b45de (patch)
tree4cbd12ab24597af5d7c91c5f292602c5e20eabfd /engines
parentfe7ae6087ad2b6773488d4a29849865d7fd70712 (diff)
downloadscummvm-rg350-cd271a0b34bc575201bf1d700069a7a3960b45de.tar.gz
scummvm-rg350-cd271a0b34bc575201bf1d700069a7a3960b45de.tar.bz2
scummvm-rg350-cd271a0b34bc575201bf1d700069a7a3960b45de.zip
GNAP: Remove duplicate code in screenEffect
Diffstat (limited to 'engines')
-rw-r--r--engines/gnap/gnap.cpp23
1 files changed, 9 insertions, 14 deletions
diff --git a/engines/gnap/gnap.cpp b/engines/gnap/gnap.cpp
index 98f2c01cac..ed2d25f3de 100644
--- a/engines/gnap/gnap.cpp
+++ b/engines/gnap/gnap.cpp
@@ -946,20 +946,15 @@ void GnapEngine::updateIdleTimer() {
}
void GnapEngine::screenEffect(int dir, byte r, byte g, byte b) {
- if (dir == 1) {
- for (int y = 300; y < 600 && !_gameDone; y += 50) {
- _gameSys->fillSurface(nullptr, 0, y, 800, 50, r, g, b);
- _gameSys->fillSurface(nullptr, 0, 549 - y + 1, 800, 50, r, g, b);
- gameUpdateTick();
- _system->delayMillis(50);
- }
- } else {
- for (int y = 0; y < 300 && !_gameDone; y += 50) {
- _gameSys->fillSurface(nullptr, 0, y, 800, 50, r, g, b);
- _gameSys->fillSurface(nullptr, 0, 549 - y + 1, 800, 50, r, g, b);
- gameUpdateTick();
- _system->delayMillis(50);
- }
+ int startVal = 0;
+ if (dir == 1)
+ startVal = 300;
+
+ for (int y = startVal; y < startVal + 300 && !_gameDone; y += 50) {
+ _gameSys->fillSurface(nullptr, 0, y, 800, 50, r, g, b);
+ _gameSys->fillSurface(nullptr, 0, 549 - y + 1, 800, 50, r, g, b);
+ gameUpdateTick();
+ _system->delayMillis(50);
}
}