Skip to content

Commit

Permalink
GNAP: Remove duplicate code in screenEffect
Browse files Browse the repository at this point in the history
  • Loading branch information
Strangerke committed May 28, 2016
1 parent fe7ae60 commit cd271a0
Showing 1 changed file with 9 additions and 14 deletions.
23 changes: 9 additions & 14 deletions engines/gnap/gnap.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}

Expand Down

0 comments on commit cd271a0

Please sign in to comment.