[Scummvm-git-logs] scummvm master -> 65a12ec93c0b7720bb2ad6a8788e6a9a391689b2

dreammaster dreammaster at scummvm.org
Sat Jan 28 23:09:16 CET 2017


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:
65a12ec93c TITANIC: Clarify code for giving glass to Barbot


Commit: 65a12ec93c0b7720bb2ad6a8788e6a9a391689b2
    https://github.com/scummvm/scummvm/commit/65a12ec93c0b7720bb2ad6a8788e6a9a391689b2
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2017-01-28T17:08:21-05:00

Commit Message:
TITANIC: Clarify code for giving glass to Barbot

Changed paths:
    engines/titanic/npcs/barbot.cpp
    engines/titanic/npcs/barbot.h


diff --git a/engines/titanic/npcs/barbot.cpp b/engines/titanic/npcs/barbot.cpp
index 2a0955c..e0d533f 100644
--- a/engines/titanic/npcs/barbot.cpp
+++ b/engines/titanic/npcs/barbot.cpp
@@ -79,7 +79,7 @@ CBarbot::CBarbot() : CTrueTalkNPC() {
 	_field14C = 0;
 	_field150 = 0;
 	_field154 = 0;
-	_field158 = -1;
+	_glassContent = GG_DEFAULT;
 	_field15C = 0;
 	_field160 = 0;
 }
@@ -108,7 +108,7 @@ void CBarbot::save(SimpleFile *file, int indent) {
 	file->writeNumberLine(_field14C, indent);
 	file->writeNumberLine(_field150, indent);
 	file->writeNumberLine(_field154, indent);
-	file->writeNumberLine(_field158, indent);
+	file->writeNumberLine(_glassContent, indent);
 	file->writeNumberLine(_field15C, indent);
 	file->writeNumberLine(_field160, indent);
 
@@ -139,7 +139,7 @@ void CBarbot::load(SimpleFile *file) {
 	_field14C = file->readNumber();
 	_field150 = file->readNumber();
 	_field154 = file->readNumber();
-	_field158 = file->readNumber();
+	_glassContent = (GlassGiven)file->readNumber();
 	_field15C = file->readNumber();
 	_field160 = file->readNumber();
 
@@ -178,7 +178,7 @@ bool CBarbot::ActMsg(CActMsg *msg) {
 		CStatusChangeMsg statusMsg;
 		statusMsg._newStatus = 2;
 		statusMsg.execute("PickUpGlass");
-		_field158 = 3;
+		_glassContent = GG_BIRD;
 
 		playRange(_frames[32], MOVIE_NOTIFY_OBJECT);
 		movieEvent();
@@ -196,7 +196,7 @@ bool CBarbot::ActMsg(CActMsg *msg) {
 		CStatusChangeMsg statusMsg;
 		statusMsg._newStatus = 2;
 		statusMsg.execute("PickUpGlass");
-		_field158 = 0;
+		_glassContent = GG_EMPTY;
 
 		playRange(_frames[55], MOVIE_NOTIFY_OBJECT);
 		movieEvent();
@@ -206,7 +206,7 @@ bool CBarbot::ActMsg(CActMsg *msg) {
 		CStatusChangeMsg statusMsg;
 		statusMsg._newStatus = 2;
 		statusMsg.execute("PickUpGlass");
-		_field158 = 1;
+		_glassContent = GG_CONDIMENT;
 
 		playRange(_frames[55], MOVIE_NOTIFY_OBJECT);
 		movieEvent();
@@ -476,8 +476,7 @@ bool CBarbot::MovieEndMsg(CMovieEndMsg *msg) {
 	}
 	else if (msg->_endFrame == _frames[35]._endFrame) {
 		playSound("c#8.wav", _volume);
-	}
-	else if (msg->_endFrame == _frames[33]._endFrame) {
+	} else if (msg->_endFrame == _frames[33]._endFrame) {
 		playSound("c#4.wav", _volume);
 	} else if (msg->_endFrame == _frames[32]._endFrame) {
 		startTalking(this, 145);
@@ -698,18 +697,21 @@ bool CBarbot::MovieFrameMsg(CMovieFrameMsg *msg) {
 
 	} else if (msg->_frameNumber == _frames[55]._startFrame
 			|| msg->_frameNumber == _frames[32]._startFrame) {
+		// Finished giving the Barbot a glass
 		CStatusChangeMsg statusMsg;
 		statusMsg._newStatus = 0;
 		statusMsg.execute("PickUpGlass");
 
-		if (_field158 == 0) {
+		if (_glassContent == GG_EMPTY) {
+			// I'd rather see that full of Starling Puret
 			startTalking(this, 250574);
-		} else if (_field158 > 0 && _field158 <= 3) {
+		} else if (_glassContent > GG_EMPTY) {
+			// What's this?
 			startTalking(this, 250580);
 			petSetArea(PET_CONVERSATION);
 		}
 
-		_field158 = -1;
+		_glassContent = GG_DEFAULT;
 
 	} else if (msg->_frameNumber == _frames[36]._startFrame) {
 		CVisibleMsg visibleMsg(false);
diff --git a/engines/titanic/npcs/barbot.h b/engines/titanic/npcs/barbot.h
index cc183be..2583211 100644
--- a/engines/titanic/npcs/barbot.h
+++ b/engines/titanic/npcs/barbot.h
@@ -28,6 +28,8 @@
 
 namespace Titanic {
 
+enum GlassGiven { GG_DEFAULT = -1, GG_EMPTY = 0, GG_CONDIMENT = 1, GG_BIRD = 3 };
+
 class CBarbot : public CTrueTalkNPC {
 	struct FrameRange {
 		int _startFrame;
@@ -79,7 +81,7 @@ private:
 	int _field14C;
 	int _field150;
 	int _field154;
-	int _field158;
+	GlassGiven _glassContent;
 	int _field15C;
 	int _field160;
 private:





More information about the Scummvm-git-logs mailing list