[Scummvm-cvs-logs] scummvm master -> 8320a556d4f2d90aede5a8a8a4ae13bd213927dd

dreammaster dreammaster at scummvm.org
Sun Jul 28 16:36:57 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:
8320a556d4 TSAGE: Added R2R conversation dialog text and removal code


Commit: 8320a556d4f2d90aede5a8a8a4ae13bd213927dd
    https://github.com/scummvm/scummvm/commit/8320a556d4f2d90aede5a8a8a4ae13bd213927dd
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2013-07-28T07:35:56-07:00

Commit Message:
TSAGE: Added R2R conversation dialog text and removal code

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



diff --git a/engines/tsage/converse.cpp b/engines/tsage/converse.cpp
index 8fc25f9..76ccb704 100644
--- a/engines/tsage/converse.cpp
+++ b/engines/tsage/converse.cpp
@@ -429,10 +429,12 @@ int ConversationChoiceDialog::execute(const Common::StringArray &choiceList) {
 
 	// Set up the list of choices
 	int yp = 0;
+	int xp = (g_vm->getGameID() == GType_Ringworld2) ? 40 : 25;
+
 	for (uint idx = 0; idx < choiceList.size(); ++idx) {
 		Rect tempRect;
 		_gfxManager._font.getStringBounds(choiceList[idx].c_str(), tempRect, 265);
-		tempRect.moveTo(25, yp + 10);
+		tempRect.moveTo(xp, yp + 10);
 
 		_choiceList.push_back(ChoiceEntry(choiceList[idx], tempRect));
 		yp += tempRect.height() + 5;
@@ -537,6 +539,18 @@ void ConversationChoiceDialog::draw() {
 	_gfxManager.deactivate();
 }
 
+void ConversationChoiceDialog::remove() {
+	if (_savedArea) {
+		// Restore the area the dialog covered
+		Rect tempRect = _bounds;
+		tempRect.collapse(-10, -10);
+		g_globals->_gfxManagerInstance.copyFrom(*_savedArea, tempRect.left, tempRect.top);
+
+		delete _savedArea;
+		_savedArea = NULL;
+	}
+}
+
 /*--------------------------------------------------------------------------*/
 
 void Obj44::load(const byte *dataP) {
@@ -891,13 +905,26 @@ void StripManager::signal() {
 
 		if (g_vm->getGameID() == GType_Ringworld2) {
 			Ringworld2::VisualSpeaker *speaker = static_cast<Ringworld2::VisualSpeaker *>(_activeSpeaker);
-			speaker->_speakerMode = obj44._speakerMode;
-			if (_obj44List.size() > 0)
+			
+			if (speaker) {
+				speaker->_speakerMode = obj44._speakerMode;
+				if (choiceList[strIndex].empty())
+					speaker->proc15();
+			}
+
+			if (!choiceList[strIndex].empty()) {
+				_textShown = true;
+				_activeSpeaker->setText(choiceList[strIndex]);
+			} else if (!obj44._speakerMode) {
+				_delayFrames = 1;
+			} else {
+				_delayFrames = 0;
 				speaker->proc15();
+			}
+		} else {
+			_textShown = true;
+			_activeSpeaker->setText(choiceList[strIndex]);
 		}
-
-		_textShown = true;
-		_activeSpeaker->setText(choiceList[strIndex]);
 	}
 
 	_obj44Index = getNewIndex(obj44._list[strIndex]._id);
@@ -965,6 +992,8 @@ Speaker *StripManager::getSpeaker(const char *speakerName) {
 int StripManager::getNewIndex(int id) {
 	if (id == 10000)
 		return id;
+	if ((g_vm->getGameID() == GType_Ringworld2) && (id < 0))
+		return id;
 
 	for (uint idx = 0; idx < _obj44List.size(); ++idx) {
 		if (_obj44List[idx]._id == id) {
diff --git a/engines/tsage/converse.h b/engines/tsage/converse.h
index 66e9982..7f30e96 100644
--- a/engines/tsage/converse.h
+++ b/engines/tsage/converse.h
@@ -164,6 +164,7 @@ public:
 	int execute(const Common::StringArray &choiceList);
 
 	virtual void draw();
+	virtual void remove();
 };
 
 class Obj0A : public Serialisable {






More information about the Scummvm-git-logs mailing list