[Scummvm-cvs-logs] scummvm master -> 2623ae5cd8fce41ab8eac0a961b05fd94dec6491

dreammaster dreammaster at scummvm.org
Tue Jul 30 04:26:50 CEST 2013


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:
2623ae5cd8 TSAGE: Fixes for R2R extended conversations


Commit: 2623ae5cd8fce41ab8eac0a961b05fd94dec6491
    https://github.com/scummvm/scummvm/commit/2623ae5cd8fce41ab8eac0a961b05fd94dec6491
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2013-07-29T19:24:25-07:00

Commit Message:
TSAGE: Fixes for R2R extended conversations

Changed paths:
    engines/tsage/converse.cpp
    engines/tsage/converse.h
    engines/tsage/ringworld2/ringworld2_speakers.cpp



diff --git a/engines/tsage/converse.cpp b/engines/tsage/converse.cpp
index 82feb31..7e6c1b3 100644
--- a/engines/tsage/converse.cpp
+++ b/engines/tsage/converse.cpp
@@ -724,14 +724,24 @@ void StripManager::synchronize(Serializer &s) {
 }
 
 void StripManager::remove() {
+	if (g_vm->getGameID() == GType_Ringworld2) { 
+		for (int i = 0; i < _speakerList.size(); ++i) {
+			if (_activeSpeaker != _speakerList[i])
+				_speakerList[i]->proc16();
+		}
+	}
+
 	if (_textShown) {
 		if (_activeSpeaker)
 			_activeSpeaker->removeText();
 		_textShown = false;
 	}
 
-	if (_activeSpeaker)
+	if (_activeSpeaker) {
+		if (g_vm->getGameID() == GType_Ringworld2) 
+			static_cast<Ringworld2::VisualSpeaker *>(_activeSpeaker)->_speakerMode = 0xff;
 		_activeSpeaker->remove();
+	}
 
 	if (_sceneNumber != g_globals->_sceneManager._scene->_screenNumber) {
 		g_globals->_sceneManager._scene->_sceneBounds = _sceneBounds;
@@ -776,9 +786,7 @@ void StripManager::signal() {
 
 	Obj44 &obj44 = _obj44List[_obj44Index];
 
-	if (g_vm->getGameID() != GType_Ringworld2) {
-		_field2E8 = obj44._id;
-	} else {
+	if (g_vm->getGameID() == GType_Ringworld2) {
 		// Return to Ringworld specific handling
 		if (obj44._field6)
 			_field2E8 = obj44._field6;
@@ -797,22 +805,27 @@ void StripManager::signal() {
 			break;
 		}
 	}
-
+	
+	_field2E8 = obj44._id;
 	Common::StringArray choiceList;
 
 	// Build up a list of script entries
 	int idx;
+	bool delayFlag = false;
 
 	if ((g_vm->getGameID() == GType_Ringworld2) && obj44._field16[0]) {
 		// Special loading mode used in Return to Ringworld
 		for (idx = 0; idx < OBJ44_LIST_SIZE; ++idx) {
 			int f16Index = _lookupList[obj44._field16[0] - 1];
-			Obj0A &entry = obj44._list[obj44._field16[f16Index]]; 
-			if (!entry._id)
-				break;
+			int entryId = obj44._field16[f16Index];
 
-			// Get the next one
-			choiceList.push_back((const char *)&_script[0] + entry._scriptOffset);
+			Obj0A &entry = obj44._list[idx]; 
+			if (entry._id == entryId) {
+				// Get the next one
+				choiceList.push_back((const char *)&_script[0] + entry._scriptOffset);
+				delayFlag = true;
+				break;
+			}
 		}
 	} else {
 		// Standard choices loading
@@ -853,8 +866,6 @@ void StripManager::signal() {
 								if (!obj44._list[listIdx + 1]._id)
 									obj44._list[listIdx]._id = 0;
 							}
-
-							continue;
 						}
 					}
 				}
@@ -870,7 +881,7 @@ void StripManager::signal() {
 		// Get the user to select a conversation option
 		strIndex = _choiceDialog.execute(choiceList);
 
-	if ((choiceList.size() != 1) && !_field2E6)
+	if ((delayFlag || choiceList.size() != 1) && !_field2E6)
 		_delayFrames = 1;
 	else {
 		Speaker *speakerP = getSpeaker((const char *)&_script[0] + obj44._speakerOffset);
@@ -904,7 +915,7 @@ void StripManager::signal() {
 			
 			if (speaker) {
 				speaker->_speakerMode = obj44._speakerMode;
-				if (choiceList[strIndex].empty())
+				if (!choiceList[strIndex].empty())
 					speaker->proc15();
 			}
 
diff --git a/engines/tsage/converse.h b/engines/tsage/converse.h
index af0b3b8..00c1f44 100644
--- a/engines/tsage/converse.h
+++ b/engines/tsage/converse.h
@@ -94,6 +94,7 @@ public:
 	virtual void proc12(Action *action);
 	virtual void setText(const Common::String &msg);
 	virtual void removeText();
+	virtual void proc16() {}
 
 	void setTextPos(const Common::Point &pt) { _textPos = pt; }
 };
diff --git a/engines/tsage/ringworld2/ringworld2_speakers.cpp b/engines/tsage/ringworld2/ringworld2_speakers.cpp
index bff61ba..b8d593b 100644
--- a/engines/tsage/ringworld2/ringworld2_speakers.cpp
+++ b/engines/tsage/ringworld2/ringworld2_speakers.cpp
@@ -252,8 +252,8 @@ void VisualSpeaker::proc16() {
 	_speakerMode = 0;
 	_object1.remove();
 
-	assert(_object2);
-	_object2->show();
+	if (_object2)
+		_object2->show();
 	_object2 = NULL;
 	_fieldF8 = 0;
 }
@@ -1948,7 +1948,7 @@ void SpeakerSeeker300::proc15() {
 	int v = _speakerMode;
 
 	if (!_object2) {
-		if (R2_GLOBALS._player._characterIndex == 3) {
+		if (R2_GLOBALS._player._characterIndex == 2) {
 			_object2 = &R2_GLOBALS._player;
 		} else {
 			Scene300 *scene = (Scene300 *)R2_GLOBALS._sceneManager._scene;






More information about the Scummvm-git-logs mailing list