[Scummvm-cvs-logs] scummvm master -> 143363d5b6baef14898ee0f41e3735de2048761a

wjp wjp at usecode.org
Sun Feb 12 23:58:19 CET 2012


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

Summary:
3abb3ad757 DREAMWEB: Fix duplicate line in monk end sequence
3fc8b7227b DREAMWEB: Fix missing subtitle lines in speech+subtitle mode
143363d5b6 DREAMWEB: Improve subtitle durations in madman scene


Commit: 3abb3ad757848d2899308b52bf642211c201d154
    https://github.com/scummvm/scummvm/commit/3abb3ad757848d2899308b52bf642211c201d154
Author: Willem Jan Palenstijn (wjp at usecode.org)
Date: 2012-02-12T14:56:37-08:00

Commit Message:
DREAMWEB: Fix duplicate line in monk end sequence

Changed paths:
    engines/dreamweb/titles.cpp



diff --git a/engines/dreamweb/titles.cpp b/engines/dreamweb/titles.cpp
index aa0f3bd..96dabc9 100644
--- a/engines/dreamweb/titles.cpp
+++ b/engines/dreamweb/titles.cpp
@@ -52,7 +52,7 @@ void DreamWebEngine::monkSpeaking() {
 	hangOn(300);
 
 	if (hasSpeech()) {
-		for (int i = 40; i <= 48; i++) {
+		for (int i = 40; i < 48; i++) {
 			loadSpeech('T', 83, 'T', i);
 
 			playChannel1(50 + 12);


Commit: 3fc8b7227b05203a9c60a91c4db361da9181fba5
    https://github.com/scummvm/scummvm/commit/3fc8b7227b05203a9c60a91c4db361da9181fba5
Author: Willem Jan Palenstijn (wjp at usecode.org)
Date: 2012-02-12T14:57:09-08:00

Commit Message:
DREAMWEB: Fix missing subtitle lines in speech+subtitle mode

This is done by adding a (very ugly) way to force the previous timed-temp
line off screen, so the next one can be shown.

Changed paths:
    engines/dreamweb/dreamweb.cpp
    engines/dreamweb/dreamweb.h
    engines/dreamweb/structs.h
    engines/dreamweb/stubs.cpp



diff --git a/engines/dreamweb/dreamweb.cpp b/engines/dreamweb/dreamweb.cpp
index 79c5e0d..0a5deb4 100644
--- a/engines/dreamweb/dreamweb.cpp
+++ b/engines/dreamweb/dreamweb.cpp
@@ -190,9 +190,6 @@ DreamWebEngine::DreamWebEngine(OSystem *syst, const DreamWebGameDescription *gam
 	_monAdX = 0;
 	_monAdY = 0;
 	_timeCount = 0;
-	_countToTimed = 0;
-	_timedY = 0;
-	_timedX = 0;
 	_needToDumpTimed = 0;
 	_loadingOrSave = 0;
 	_saveLoadPage = 0;
diff --git a/engines/dreamweb/dreamweb.h b/engines/dreamweb/dreamweb.h
index 8eeb006..38016e5 100644
--- a/engines/dreamweb/dreamweb.h
+++ b/engines/dreamweb/dreamweb.h
@@ -186,7 +186,6 @@ private:
 	uint8 _channel0, _channel1;
 
 protected:
-	const char *_timedString;
 	GameVars _vars; // saved variables
 
 	// from backdrop.cpp
@@ -416,10 +415,9 @@ public:
 	uint16 _monAdX;
 	uint16 _monAdY;
 	uint16 _timeCount;
-	uint16 _countToTimed;
-	uint8 _timedY;
-	uint8 _timedX;
 	uint8 _needToDumpTimed;
+	TimedTemp _previousTimedTemp;
+	TimedTemp _timedTemp;
 	uint8 _loadingOrSave;
 	uint8 _saveLoadPage;
 	uint8 _currentSlot;
diff --git a/engines/dreamweb/structs.h b/engines/dreamweb/structs.h
index ddc0271..cedf2b6 100644
--- a/engines/dreamweb/structs.h
+++ b/engines/dreamweb/structs.h
@@ -418,6 +418,18 @@ struct GameVars {
 	uint8 _shakeCounter;
 };
 
+struct TimedTemp {
+	TimedTemp() : _timeCount(0), _string(0) { }
+
+	uint8 _x;
+	uint8 _y;
+
+	uint16 _timeCount;
+	uint16 _countToTimed;
+
+	const char *_string;
+};
+
 } // End of namespace DreamWeb
 
 #endif
diff --git a/engines/dreamweb/stubs.cpp b/engines/dreamweb/stubs.cpp
index 5f05f29..d93add6 100644
--- a/engines/dreamweb/stubs.cpp
+++ b/engines/dreamweb/stubs.cpp
@@ -864,16 +864,16 @@ void DreamWebEngine::dumpTextLine() {
 
 void DreamWebEngine::getUnderTimed() {
 	if (_foreignRelease)
-		multiGet(_underTimedText, _timedX, _timedY - 3, 240, kUnderTimedTextSizeY_f);
+		multiGet(_underTimedText, _timedTemp._x, _timedTemp._y - 3, 240, kUnderTimedTextSizeY_f);
 	else
-		multiGet(_underTimedText, _timedX, _timedY, 240, kUnderTimedTextSizeY);
+		multiGet(_underTimedText, _timedTemp._x, _timedTemp._y, 240, kUnderTimedTextSizeY);
 }
 
 void DreamWebEngine::putUnderTimed() {
 	if (_foreignRelease)
-		multiPut(_underTimedText, _timedX, _timedY - 3, 240, kUnderTimedTextSizeY_f);
+		multiPut(_underTimedText, _timedTemp._x, _timedTemp._y - 3, 240, kUnderTimedTextSizeY_f);
 	else
-		multiPut(_underTimedText, _timedX, _timedY, 240, kUnderTimedTextSizeY);
+		multiPut(_underTimedText, _timedTemp._x, _timedTemp._y, 240, kUnderTimedTextSizeY);
 }
 
 void DreamWebEngine::triggerMessage(uint16 index) {
@@ -903,6 +903,23 @@ void DreamWebEngine::processTrigger() {
 }
 
 void DreamWebEngine::useTimedText() {
+	if (_previousTimedTemp._string) {
+		// TODO: It might be nice to make subtitles wait for the speech
+		// to finish (_channel1Playing) when we're in speech+subtitles mode,
+		// instead of waiting the pre-specified amount of time.
+
+
+		// Ugly... (Maybe make this an argument to putUnderTimed()?)
+		TimedTemp t = _timedTemp;
+		_timedTemp = _previousTimedTemp;
+
+		// Force-reset the previous string to make room for the next one
+		putUnderTimed();
+
+		_timedTemp = t;
+		return;
+	}
+
 	if (_timeCount == 0)
 		return;
 	--_timeCount;
@@ -912,49 +929,65 @@ void DreamWebEngine::useTimedText() {
 		return;
 	}
 
-	if (_timeCount == _countToTimed)
+	if (_timeCount == _timedTemp._countToTimed)
 		getUnderTimed();
-	else if (_timeCount > _countToTimed)
+	else if (_timeCount > _timedTemp._countToTimed)
 		return;
 
-	const uint8 *string = (const uint8 *)_timedString;
-	printDirect(string, _timedX, _timedY, 237, true);
+	const uint8 *string = (const uint8 *)_timedTemp._string;
+	printDirect(string, _timedTemp._x, _timedTemp._y, 237, true);
 	_needToDumpTimed = 1;
 }
 
 void DreamWebEngine::setupTimedTemp(uint8 textIndex, uint8 voiceIndex, uint8 x, uint8 y, uint16 countToTimed, uint16 timeCount) {
+
 	if (hasSpeech() && voiceIndex != 0) {
 		if (loadSpeech('T', voiceIndex, 'T', textIndex)) {
 			playChannel1(50+12);
 		}
 
-		// FIXME: This fallthrough does not properly support subtitles+speech
-		// mode. The parameters to setuptimedtemp() are sometimes different
-		// for speech and for subtitles. See e.g., madmantext()
 		if (_speechLoaded && !_subtitles)
 			return;
+
+		if (_timeCount != 0) {
+			// store previous TimedTemp for deletion
+			_previousTimedTemp = _timedTemp;
+			_timeCount = 0;
+		}
 	}
 
 	if (_timeCount != 0)
 		return;
-	_timedY = y;
-	_timedX = x;
-	_countToTimed = countToTimed;
-	_timeCount = timeCount + countToTimed;
-	_timedString = _textFile1.getString(textIndex);
-	debug(1, "setupTimedTemp: (%d, %d) => '%s'", textIndex, voiceIndex, _timedString);
+
+	_timedTemp._y = y;
+	_timedTemp._x = x;
+	_timedTemp._countToTimed = countToTimed;
+	_timeCount = _timedTemp._timeCount = timeCount + countToTimed;
+	_timedTemp._string = _textFile1.getString(textIndex);
+	debug(1, "setupTimedTemp: (%d, %d) => '%s'", textIndex, voiceIndex, _timedTemp._string);
 }
 
 void DreamWebEngine::dumpTimedText() {
-	const uint16 kUndertimedysize = 30;
-	if (_needToDumpTimed != 1)
+	const TimedTemp *tt;
+	if (_previousTimedTemp._string) {
+		assert(!_needToDumpTimed);
+
+		tt = &_previousTimedTemp;
+		_previousTimedTemp._string = 0;
+		_previousTimedTemp._timeCount = 0;
+	} else if (_needToDumpTimed != 1) {
 		return;
-	uint8 y = _timedY;
+	} else {
+		tt = &_timedTemp;
+		_needToDumpTimed = 0;
+	}
+
+	const uint16 kUndertimedysize = 30;
+	uint8 y = tt->_y;
 	if (_foreignRelease)
 		y -= 3;
 
-	multiDump(_timedX, y, 240, kUndertimedysize);
-	_needToDumpTimed = 0;
+	multiDump(tt->_x, y, 240, kUndertimedysize);
 }
 
 void DreamWebEngine::getTime() {
@@ -2822,12 +2855,12 @@ void DreamWebEngine::setupTimedUse(uint16 textIndex, uint16 countToTimed, uint16
 	if (_timeCount != 0)
 		return; // can't setup
 
-	_timedY = y;
-	_timedX = x;
-	_countToTimed = countToTimed;
-	_timeCount = timeCount + countToTimed;
-	_timedString = _puzzleText.getString(textIndex);
-	debug(1, "setupTimedUse: %d => '%s'", textIndex, _timedString);
+	_timedTemp._y = y;
+	_timedTemp._x = x;
+	_timedTemp._countToTimed = countToTimed;
+	_timeCount = _timedTemp._timeCount = timeCount + countToTimed;
+	_timedTemp._string = _puzzleText.getString(textIndex);
+	debug(1, "setupTimedUse: %d => '%s'", textIndex, _timedTemp._string);
 }
 
 void DreamWebEngine::entryTexts() {


Commit: 143363d5b6baef14898ee0f41e3735de2048761a
    https://github.com/scummvm/scummvm/commit/143363d5b6baef14898ee0f41e3735de2048761a
Author: Willem Jan Palenstijn (wjp at usecode.org)
Date: 2012-02-12T14:57:25-08:00

Commit Message:
DREAMWEB: Improve subtitle durations in madman scene

Changed paths:
    engines/dreamweb/people.cpp
    engines/dreamweb/titles.cpp



diff --git a/engines/dreamweb/people.cpp b/engines/dreamweb/people.cpp
index 0f51add..1b8ee1b 100644
--- a/engines/dreamweb/people.cpp
+++ b/engines/dreamweb/people.cpp
@@ -145,13 +145,19 @@ void DreamWebEngine::updatePeople() {
 void DreamWebEngine::madmanText() {
 	byte origCount;
 
+	uint16 length = 90;
 	if (hasSpeech()) {
-		if (_speechCount >= 63)
+		if (_speechCount > 15)
 			return;
 		if (_channel1Playing != 255)
 			return;
 		origCount = _speechCount;
 		++_speechCount;
+
+		if (origCount != 15)
+			length = 32000; // Set subtitle time very high to make it
+			                // always wait for the next line, except for the
+			                // last one, when there is no next line.
 	} else {
 		if (_vars._combatCount >= 61)
 			return;
@@ -159,7 +165,7 @@ void DreamWebEngine::madmanText() {
 			return;
 		origCount = _vars._combatCount / 4;
 	}
-	setupTimedTemp(47 + origCount, 82, 72, 80, 90, 1);
+	setupTimedTemp(47 + origCount, 82, 72, 80, length, 1);
 }
 
 void DreamWebEngine::madman(ReelRoutine &routine) {
diff --git a/engines/dreamweb/titles.cpp b/engines/dreamweb/titles.cpp
index 96dabc9..8ca5aa7 100644
--- a/engines/dreamweb/titles.cpp
+++ b/engines/dreamweb/titles.cpp
@@ -51,6 +51,7 @@ void DreamWebEngine::monkSpeaking() {
 	fadeScreenUps();
 	hangOn(300);
 
+	// TODO: Subtitles+speech mode
 	if (hasSpeech()) {
 		for (int i = 40; i < 48; i++) {
 			loadSpeech('T', 83, 'T', i);






More information about the Scummvm-git-logs mailing list