[Scummvm-cvs-logs] scummvm master -> cd271a0b34bc575201bf1d700069a7a3960b45de

Strangerke Strangerke at scummvm.org
Sat May 28 18:49:10 CEST 2016


This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .

Summary:
cd271a0b34 GNAP: Remove duplicate code in screenEffect


Commit: cd271a0b34bc575201bf1d700069a7a3960b45de
    https://github.com/scummvm/scummvm/commit/cd271a0b34bc575201bf1d700069a7a3960b45de
Author: Strangerke (strangerke at scummvm.org)
Date: 2016-05-28T18:40:22+02:00

Commit Message:
GNAP: Remove duplicate code in screenEffect

Changed paths:
    engines/gnap/gnap.cpp



diff --git a/engines/gnap/gnap.cpp b/engines/gnap/gnap.cpp
index 98f2c01..ed2d25f 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);
 	}
 }
 






More information about the Scummvm-git-logs mailing list