[Scummvm-git-logs] scummvm master -> 2a8e624bfe56375f96837b95fe3ccf5bb5f49d76

bluegr bluegr at gmail.com
Sun Nov 19 19:50:36 CET 2017


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

Summary:
33cb29d558 DRASCULA: Document several updateVisible() calls
2a8e624bfe DRASCULA: Clean up logic in enterRoom()


Commit: 33cb29d5587af609bb747d1cef68dfffc60c6127
    https://github.com/scummvm/scummvm/commit/33cb29d5587af609bb747d1cef68dfffc60c6127
Author: Filippos Karapetis (bluegr at gmail.com)
Date: 2017-11-19T20:50:12+02:00

Commit Message:
DRASCULA: Document several updateVisible() calls

Changed paths:
    engines/drascula/animation.cpp
    engines/drascula/rooms.cpp


diff --git a/engines/drascula/animation.cpp b/engines/drascula/animation.cpp
index c89e5ff..d9ff907 100644
--- a/engines/drascula/animation.cpp
+++ b/engines/drascula/animation.cpp
@@ -1293,7 +1293,7 @@ void DrasculaEngine::animation_5_5(){
 	}
 
 	flags[6] = 1;
-	updateVisible();
+	updateVisible();	// sets visible[1] to 1 and visible[2] to 0
 	pause(12);
 
 	loadPic(96, frontSurface);
diff --git a/engines/drascula/rooms.cpp b/engines/drascula/rooms.cpp
index f99f00c..e1a0bdd 100644
--- a/engines/drascula/rooms.cpp
+++ b/engines/drascula/rooms.cpp
@@ -618,7 +618,7 @@ bool DrasculaEngine::room_22(int fl) {
 		finishSound();
 		selectVerb(kVerbNone);
 		removeObject(22);
-		updateVisible();
+		updateVisible();	// sets visible[2] to 0 and visible[1] to 1
 		trackProtagonist = 3;
 		talk(499);
 		talk(500);
@@ -825,7 +825,7 @@ bool DrasculaEngine::room_35(int fl) {
 		visible[1] = 0;
 		flags[15] = 1;
 		flags[17] = 1;
-		updateVisible();
+		updateVisible();	// sets visible[1] to 0 and visible[3] to 1
 	} else if (pickedObject == kVerbPick && fl == 149) {
 		pickObject(13);
 		visible[3] = 0;
@@ -872,7 +872,7 @@ bool DrasculaEngine::room_53(int fl) {
 	} else if (pickedObject == 16 && fl == 121) {
 		flags[2] = 1;
 		selectVerb(kVerbNone);
-		updateVisible();
+		updateVisible();	// sets visible[3] to 0
 		pickedObject = kVerbMove;
 	} else if (pickedObject == 16) {
 		// Wall plug in chapter 5
@@ -906,7 +906,7 @@ bool DrasculaEngine::room_54(int fl) {
 		pickObject(8);
 		flags[13] = 1;
 		talk_mus(10);
-		updateVisible();
+		updateVisible();	// sets visible[3] to 0
 	} else if (pickedObject == 10 && fl == 119) {
 		pause(4);
 		talk(436);
@@ -922,7 +922,7 @@ bool DrasculaEngine::room_55(int fl) {
 	if (pickedObject == kVerbPick && fl == 122) {
 		pickObject(12);
 		flags[8] = 1;
-		updateVisible();
+		updateVisible();	// sets visible[1] to 0
 	} else if (fl == 206) {
 		playSound(11);
 		animate("det.bin", 17);
@@ -947,7 +947,7 @@ bool DrasculaEngine::room_56(int fl) {
 bool DrasculaEngine::room_58(int fl) {
 	if (pickedObject == kVerbMove && fl == 103) {
 		flags[8] = 1;
-		updateVisible();
+		updateVisible();	// sets isDoor[1] to 1
 	} else {
 		hasAnswer = 0;
 	}


Commit: 2a8e624bfe56375f96837b95fe3ccf5bb5f49d76
    https://github.com/scummvm/scummvm/commit/2a8e624bfe56375f96837b95fe3ccf5bb5f49d76
Author: Filippos Karapetis (bluegr at gmail.com)
Date: 2017-11-19T20:50:13+02:00

Commit Message:
DRASCULA: Clean up logic in enterRoom()

Changed paths:
    engines/drascula/rooms.cpp


diff --git a/engines/drascula/rooms.cpp b/engines/drascula/rooms.cpp
index e1a0bdd..8263483 100644
--- a/engines/drascula/rooms.cpp
+++ b/engines/drascula/rooms.cpp
@@ -1665,9 +1665,9 @@ void DrasculaEngine::enterRoom(int roomIndex) {
 
 	char fileName[20];
 	sprintf(fileName, "%d.ald", roomIndex);
-	int soc, l, martin = 0, objIsExit = 0;
+	int soc, l, overridenWidth = 0, objIsExit = 0;
 	float chiquez = 0, pequegnez = 0;
-	char pant1[20], pant2[20], pant3[20], pant4[20];
+	char surfaceName[20];
 	int palLevel = 0;
 
 	_hasName = false;
@@ -1685,22 +1685,42 @@ void DrasculaEngine::enterRoom(int roomIndex) {
 	p.parseString(roomDisk);
 	p.parseInt(palLevel);
 
-	if (currentChapter == 2)
-		p.parseInt(martin);
+	if (currentChapter == 2) {
+		p.parseInt(overridenWidth);
+
+		if (overridenWidth != 0) {
+			curWidth = overridenWidth;
+			p.parseInt(curHeight);
+			p.parseInt(feetHeight);
+			p.parseInt(stepX);
+			p.parseInt(stepY);
+
+			p.parseString(surfaceName);
+			loadPic(surfaceName, frontSurface);
+
+			p.parseString(surfaceName);
+			loadPic(surfaceName, extraSurface);
 
-	if (currentChapter == 2 && martin != 0) {
-		curWidth = martin;
-		p.parseInt(curHeight);
-		p.parseInt(feetHeight);
-		p.parseInt(stepX);
-		p.parseInt(stepY);
+			p.parseString(surfaceName);
+			// unused
 
-		p.parseString(pant1);
-		p.parseString(pant2);
-		p.parseString(pant3);
-		p.parseString(pant4);
+			p.parseString(surfaceName);
+			loadPic(surfaceName, backSurface);
 
-		strcpy(menuBackground, pant4);
+			strcpy(menuBackground, surfaceName);
+		} else {
+			curWidth = CHARACTER_WIDTH;
+			curHeight = CHARACTER_HEIGHT;
+			feetHeight = FEET_HEIGHT;
+			stepX = STEP_X;
+			stepY = STEP_Y;
+
+			loadPic(97, extraSurface);
+			loadPic(96, frontSurface);
+			loadPic(99, backSurface);
+
+			strcpy(menuBackground, "99.alg");
+		}
 	}
 
 	p.parseInt(numRoomObjs);
@@ -1745,27 +1765,6 @@ void DrasculaEngine::enterRoom(int roomIndex) {
 	// no need to delete the stream, since TextResourceParser takes ownership
 	// delete stream;
 
-	if (currentChapter == 2 && martin != 0) {
-		loadPic(pant2, extraSurface);
-		loadPic(pant1, frontSurface);
-		loadPic(pant4, backSurface);
-	}
-
-	if (currentChapter == 2) {
-		if (martin == 0) {
-			stepX = STEP_X;
-			stepY = STEP_Y;
-			curHeight = CHARACTER_HEIGHT;
-			curWidth = CHARACTER_WIDTH;
-			feetHeight = FEET_HEIGHT;
-			loadPic(97, extraSurface);
-			loadPic(96, frontSurface);
-			loadPic(99, backSurface);
-
-			strcpy(menuBackground, "99.alg");
-		}
-	}
-
 	for (l = 0; l < numRoomObjs; l++) {
 		if (objectNum[l] == objExit)
 			objIsExit = l;





More information about the Scummvm-git-logs mailing list