[Scummvm-git-logs] scummvm master -> f5247457740142385e2d5de229dbe7d1bb57f02b

bluegr bluegr at gmail.com
Sun Jul 8 23:42:04 CEST 2018


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:
fc5261b0c4 DREAMWEB: Fix speech during the monk cutscene in non-English versions
f524745774 DREAMWEB: Simplify the character kerning checks


Commit: fc5261b0c4216885b3f4bb8db2df3fba3fcd8433
    https://github.com/scummvm/scummvm/commit/fc5261b0c4216885b3f4bb8db2df3fba3fcd8433
Author: Filippos Karapetis (bluegr at gmail.com)
Date: 2018-07-09T00:41:04+03:00

Commit Message:
DREAMWEB: Fix speech during the monk cutscene in non-English versions

Fixes bugs #6288 and #6417

Changed paths:
    engines/dreamweb/dreamweb.h
    engines/dreamweb/people.cpp
    engines/dreamweb/sprite.cpp


diff --git a/engines/dreamweb/dreamweb.h b/engines/dreamweb/dreamweb.h
index f4a3c00..0231f14 100644
--- a/engines/dreamweb/dreamweb.h
+++ b/engines/dreamweb/dreamweb.h
@@ -724,6 +724,7 @@ public:
 	void intro3Text(uint16 nextReelPointer);
 
 	void monks2text();
+	void monks2ShowText(uint8 textIndex, uint8 x, uint8 y);
 	void textForEnd();
 	void textForMonkHelper(uint8 textIndex, uint8 voiceIndex, uint8 x, uint8 y, uint16 countToTimed, uint16 timeCount);
 	void textForMonk();
diff --git a/engines/dreamweb/people.cpp b/engines/dreamweb/people.cpp
index 6e47513..026f6d1 100644
--- a/engines/dreamweb/people.cpp
+++ b/engines/dreamweb/people.cpp
@@ -523,9 +523,10 @@ void DreamWebEngine::candles(ReelRoutine &routine) {
 void DreamWebEngine::gates(ReelRoutine &routine) {
 	if (checkSpeed(routine)) {
 		uint16 nextReelPointer = routine.reelPointer() + 1;
+		uint16 checkIntro3ReelPointer = (getLanguage() != Common::ES_ESP) ? 110 : 111;
 		if (nextReelPointer == 116)
 			_sound->playChannel1(17);
-		if (nextReelPointer >= 110)
+		if (nextReelPointer >= checkIntro3ReelPointer)
 			routine.period = 2;
 		if (nextReelPointer == 120) {
 			_getBack = 1;
@@ -743,10 +744,12 @@ void DreamWebEngine::introMonks2(ReelRoutine &routine) {
 		}
 
 		if (nextReelPointer == 110) {
+			int introCountCheck = (getLanguage() != Common::DE_DEU && getLanguage() != Common::ES_ESP) ? 35 : 40;
+
 			_introCount++;
 			monks2text();
 
-			if (_introCount == 35)
+			if (_introCount == introCountCheck)
 				nextReelPointer = 111;
 			else
 				nextReelPointer = 98;
diff --git a/engines/dreamweb/sprite.cpp b/engines/dreamweb/sprite.cpp
index 633db73..c5b4a2c 100644
--- a/engines/dreamweb/sprite.cpp
+++ b/engines/dreamweb/sprite.cpp
@@ -532,41 +532,112 @@ void DreamWebEngine::intro3Text(uint16 nextReelPointer) {
 		setupTimedTemp(46, 82, 36, 56, 100, 1);
 }
 
-void DreamWebEngine::monks2text() {
-	bool isGermanCD = hasSpeech() && getLanguage() == Common::DE_DEU;
+void DreamWebEngine::monks2ShowText(uint8 textIndex, uint8 x = 36, uint8 y = 160) {
+	setupTimedTemp(textIndex, 82, x, y, 120, 1);
+}
 
-	if (_introCount == 1)
-		setupTimedTemp(8, 82, 36, 160, 120, 1);
-	else if (_introCount == (isGermanCD ? 5 : 4))
-		setupTimedTemp(9, 82, 36, 160, 120, 1);
-	else if (_introCount == (isGermanCD ? 9 : 7))
-		setupTimedTemp(10, 82, 36, 160, 120, 1);
-	else if (_introCount == 10 && !isGermanCD) {
-		if (hasSpeech())
-			_introCount = 12;
-		setupTimedTemp(11, 82, 0, 105, 120, 1);
-	} else if (_introCount == 13 && isGermanCD) {
-		_introCount = 14;
-		setupTimedTemp(11, 82, 0, 105, 120, 1);
-	} else if (_introCount == 13 && !isGermanCD) {
-		if (hasSpeech())
-			_introCount = 17;
-		else
-			setupTimedTemp(12, 82, 0, 120, 120, 1);
-	} else if (_introCount == 16 && !isGermanCD)
-		setupTimedTemp(13, 82, 0, 135, 120, 1);
-	else if (_introCount == 19)
-		setupTimedTemp(14, 82, 36, 160, 100, 1);
-	else if (_introCount == (isGermanCD ? 23 : 22))
-		setupTimedTemp(15, 82, 36, 160, 120, 1);
-	else if (_introCount == (isGermanCD ? 27 : 25))
-		setupTimedTemp(16, 82, 36, 160, 120, 1);
-	else if (_introCount == (hasSpeech() ? 27 : 28) && !isGermanCD)
-		setupTimedTemp(17, 82, 36, 160, 120, 1);
-	else if (_introCount == 30 && isGermanCD)
-		setupTimedTemp(17, 82, 36, 160, 120, 1);
-	else if (_introCount == (isGermanCD ? 35 : 31))
-		setupTimedTemp(18, 82, 36, 160, 120, 1);
+void DreamWebEngine::monks2text() {
+	if (getLanguage() != Common::DE_DEU && getLanguage() != Common::ES_ESP) {
+		switch (_introCount) {
+		case 1:
+			monks2ShowText(8);	// Keepers. The web of dreams is slowly unwinding
+			break;
+		case 4:
+			monks2ShowText(9);	// The seven evil powers on earth are joining forces
+			break;
+		case 7:
+			monks2ShowText(10);	// If they become too strong the Dreamweb will be destroyed
+			break;
+		case 10:
+			if (hasSpeech())
+				_introCount = 12;
+			monks2ShowText(11, 0, 105);	// Who will be the deliverer? (monk 1)
+			break;
+		case 13:
+			if (hasSpeech())
+				_introCount = 17;	// Skip the speech of the third monk in the CD version
+			monks2ShowText(12, 0, 120);	// When will it be? (monk 2)
+			break;
+		case 16:
+			monks2ShowText(13, 0, 135);	// We must not let the web be broken (monk 3) (floppy version only)
+			break;
+		case 19:
+			monks2ShowText(14);	// SILENCE! The chosen ones are becoming aware
+			break;
+		case 22:
+			monks2ShowText(15);	// If they discover their powers they will become too strong
+			break;
+		case 25:
+			monks2ShowText(16);	// Has the seed been planted?
+			break;
+		case 27:	// CD
+		case 28:	// Floppy
+			if ((_introCount == 27 && hasSpeech()) || (_introCount == 28 && !hasSpeech()))
+				monks2ShowText(17);	// Yes, it has grown strong and he is stirring
+			break;
+		case 31:
+			monks2ShowText(18);	// The time has come and I shall awaken him
+			break;
+		default:
+			break;
+		}
+	} else {
+		switch (_introCount) {
+		case 1:
+			monks2ShowText(8);	// WÅchter! Das Netz der TrÅume fÅngt an sich aufzulÖsen
+			break;
+		case 4:	// Floppy
+		case 5:	// CD
+			if ((_introCount == 4 && !hasSpeech()) || (_introCount == 5 && hasSpeech()))
+				monks2ShowText(9);	// Die sieben bÖsen MÅchte der Erde fangen an sich zu sammeln
+			break;
+		case 7:	// Floppy
+		case 9:	// CD
+			if ((_introCount == 7 && !hasSpeech()) || (_introCount == 9 && hasSpeech()))
+				monks2ShowText(10);	// Wenn sie zu mÅchtig werden, wird das Dreamweb zerstÖrt
+			break;
+		case 10:	// Floppy
+		case 13:	// CD and floppy
+			if (_introCount == 10 && !hasSpeech()) {
+				monks2ShowText(11, 0, 105);	// Wer wird der Bote sein?
+			} else if (_introCount == 13 && hasSpeech()) {
+				_introCount = 14;
+				monks2ShowText(11, 0, 105);	// Wer wird der Bote sein?
+			} else if (_introCount == 13 && !hasSpeech()) {
+				monks2ShowText(12, 0, 120);
+			}
+			break;
+		case 16:
+			if (!hasSpeech())
+				monks2ShowText(13, 0, 135);
+			break;
+		case 19:
+			monks2ShowText(14);	// SCHWEIGT! Die AuserwÅhlten sammeln sich
+			break;
+		case 22:	// Floppy
+		case 23:	// CD
+			if ((_introCount == 22 && !hasSpeech()) || (_introCount == 23 && hasSpeech()))
+				monks2ShowText(15);	// Wenn sie ihre KrÅfte entdecken, werden sie zu mÅchtig sein
+			break;
+		case 25:	// Floppy
+		case 27:	// CD
+			if ((_introCount == 25 && !hasSpeech()) || (_introCount == 27 && hasSpeech()))
+				monks2ShowText(16);	// Ist die Saat gepflanzt?
+			break;
+		case 28:	// Floppy
+		case 30:	// CD
+			if ((_introCount == 28 && !hasSpeech()) || (_introCount == 30 && hasSpeech()))
+				monks2ShowText(17);	// Ja. Sie ist zu einem groÜen und stattlichen Man herangewachsen
+			break;
+		case 31:	// Floppy
+		case 35:	// CD
+			if ((_introCount == 31 && !hasSpeech()) || (_introCount == 35 && hasSpeech()))
+				monks2ShowText(18);	// Sein Name ist Ryan. Die Zeit ist gekommen, ihn zu erwecken
+			break;
+		default:
+			break;
+		}
+	}
 }
 
 void DreamWebEngine::textForEnd() {


Commit: f5247457740142385e2d5de229dbe7d1bb57f02b
    https://github.com/scummvm/scummvm/commit/f5247457740142385e2d5de229dbe7d1bb57f02b
Author: Filippos Karapetis (bluegr at gmail.com)
Date: 2018-07-09T00:41:04+03:00

Commit Message:
DREAMWEB: Simplify the character kerning checks

Changed paths:
    engines/dreamweb/dreamweb.cpp
    engines/dreamweb/dreamweb.h
    engines/dreamweb/keypad.cpp
    engines/dreamweb/print.cpp


diff --git a/engines/dreamweb/dreamweb.cpp b/engines/dreamweb/dreamweb.cpp
index a10403c..665e5b4 100644
--- a/engines/dreamweb/dreamweb.cpp
+++ b/engines/dreamweb/dreamweb.cpp
@@ -91,7 +91,6 @@ DreamWebEngine::DreamWebEngine(OSystem *syst, const DreamWebGameDescription *gam
 	// misc variables
 	_speechCount = 0;
 	_charShift = 0;
-	_kerning = 0;
 	_brightPalette = false;
 	_roomLoaded = 0;
 	_didZoom = 0;
diff --git a/engines/dreamweb/dreamweb.h b/engines/dreamweb/dreamweb.h
index 0231f14..d34af40 100644
--- a/engines/dreamweb/dreamweb.h
+++ b/engines/dreamweb/dreamweb.h
@@ -316,7 +316,6 @@ public:
 	// misc variables
 	uint8 _speechCount;
 	uint16 _charShift;
-	uint8 _kerning;
 	bool _brightPalette;
 	bool _copyProtection;
 	uint8 _roomLoaded;
@@ -647,10 +646,10 @@ public:
 
 	// from print.cpp
 	uint8 getNextWord(const GraphicsFile &charSet, const uint8 *string, uint8 *totalWidth, uint8 *charCount);
-	void printChar(const GraphicsFile &charSet, uint16 *x, uint16 y, uint8 c, uint8 nextChar, uint8 *width, uint8 *height);
+	void printChar(const GraphicsFile &charSet, uint16 *x, uint16 y, uint8 c, uint8 nextChar, uint8 *width, uint8 *height, bool kerning = false);
 	void printChar(const GraphicsFile &charSet, uint16 x, uint16 y, uint8 c, uint8 nextChar, uint8 *width, uint8 *height);
 	void printBoth(const GraphicsFile &charSet, uint16 *x, uint16 y, uint8 c, uint8 nextChar);
-	uint8 printDirect(const uint8** string, uint16 x, uint16 *y, uint8 maxWidth, bool centered);
+	uint8 printDirect(const uint8** string, uint16 x, uint16 *y, uint8 maxWidth, bool centered, bool kerning = false);
 	uint8 printDirect(const uint8* string, uint16 x, uint16 y, uint8 maxWidth, bool centered);
 	uint8 getNumber(const GraphicsFile &charSet, const uint8 *string, uint16 maxWidth, bool centered, uint16 *offset);
 	uint8 kernChars(uint8 firstChar, uint8 secondChar, uint8 width);
diff --git a/engines/dreamweb/keypad.cpp b/engines/dreamweb/keypad.cpp
index 50e452e..476e9b5 100644
--- a/engines/dreamweb/keypad.cpp
+++ b/engines/dreamweb/keypad.cpp
@@ -440,18 +440,16 @@ void DreamWebEngine::showLeftPage() {
 	showFrame(_folderGraphics2, 0, y, 5, 0);
 	_lineSpacing = 8;
 	_charShift = 91;
-	_kerning = 1;
 	uint8 pageIndex = _folderPage - 2;
 	const uint8 *string = getTextInFile1(pageIndex * 2);
 	y = 48;
 	for (uint i = 0; i < 2; ++i) {
 		uint8 lastChar;
 		do {
-			lastChar = printDirect(&string, 2, &y, 140, false);
+			lastChar = printDirect(&string, 2, &y, 140, false, true);
 			y += _lineSpacing;
 		} while (lastChar != '\0');
 	}
-	_kerning = 0;
 	_charShift = 0;
 	_lineSpacing = 10;
 	uint8 *bufferToSwap = workspace() + (48*kScreenwidth)+2;
@@ -473,18 +471,16 @@ void DreamWebEngine::showRightPage() {
 
 	showFrame(_folderGraphics2, 143, y, 2, 0);
 	_lineSpacing = 8;
-	_kerning = 1;
 	uint8 pageIndex = _folderPage - 1;
 	const uint8 *string = getTextInFile1(pageIndex * 2);
 	y = 48;
 	for (uint i = 0; i < 2; ++i) {
 		uint8 lastChar;
 		do {
-			lastChar = printDirect(&string, 152, &y, 140, false);
+			lastChar = printDirect(&string, 152, &y, 140, false, true);
 			y += _lineSpacing;
 		} while (lastChar != '\0');
 	}
-	_kerning = 0;
 	_lineSpacing = 10;
 }
 
@@ -848,17 +844,15 @@ void DreamWebEngine::diaryKeyN() {
 
 void DreamWebEngine::showDiaryPage() {
 	showFrame(_diaryGraphics, kDiaryx, kDiaryy, 0, 0);
-	_kerning = 1;
 	useTempCharset(&_diaryCharset);
 	_charShift = 91+91;
 	const uint8 *string = getTextInFile1(_diaryPage);
 	uint16 y = kDiaryy + 16;
-	printDirect(&string, kDiaryx + 48, &y, 240, 240 & 1);
+	printDirect(&string, kDiaryx + 48, &y, 240, 240 & 1, true);
 	y = kDiaryy + 16;
-	printDirect(&string, kDiaryx + 129, &y, 240, 240 & 1);
+	printDirect(&string, kDiaryx + 129, &y, 240, 240 & 1, true);
 	y = kDiaryy + 23;
-	printDirect(&string, kDiaryx + 48, &y, 240, 240 & 1);
-	_kerning = 0;
+	printDirect(&string, kDiaryx + 48, &y, 240, 240 & 1, true);
 	_charShift = 0;
 	useCharset1();
 }
diff --git a/engines/dreamweb/print.cpp b/engines/dreamweb/print.cpp
index c119f28..b98d5dd 100644
--- a/engines/dreamweb/print.cpp
+++ b/engines/dreamweb/print.cpp
@@ -60,7 +60,7 @@ uint8 DreamWebEngine::getNextWord(const GraphicsFile &charSet, const uint8 *stri
 	}
 }
 
-void DreamWebEngine::printChar(const GraphicsFile &charSet, uint16* x, uint16 y, uint8 c, uint8 nextChar, uint8 *width, uint8 *height) {
+void DreamWebEngine::printChar(const GraphicsFile &charSet, uint16* x, uint16 y, uint8 c, uint8 nextChar, uint8 *width, uint8 *height, bool kerning) {
 	// WORKAROUND: Some texts contain leftover tab characters, which will cause
 	// OOB memory access when showing a character, as all the printable ones are
 	// from 32 onwards. We compensate for that here by ignoring all the invalid
@@ -77,7 +77,7 @@ void DreamWebEngine::printChar(const GraphicsFile &charSet, uint16* x, uint16 y,
 		y -= 3;
 	uint16 tmp = c - 32 + _charShift;
 	showFrame(charSet, *x, y, tmp & 0x1ff, (tmp >> 8) & 0xfe, width, height);
-	if (_kerning == 0)
+	if (!kerning)
 		*width = kernChars(c, nextChar, *width);
 	(*x) += *width;
 }
@@ -130,7 +130,7 @@ uint8 DreamWebEngine::printDirect(const uint8* string, uint16 x, uint16 y, uint8
 	return printDirect(&string, x, &y, maxWidth, centered);
 }
 
-uint8 DreamWebEngine::printDirect(const uint8** string, uint16 x, uint16 *y, uint8 maxWidth, bool centered) {
+uint8 DreamWebEngine::printDirect(const uint8** string, uint16 x, uint16 *y, uint8 maxWidth, bool centered, bool kerning) {
 	_lastXPos = x;
 	const GraphicsFile &charSet = *_currentCharset;
 	while (true) {
@@ -211,7 +211,6 @@ uint16 DreamWebEngine::waitFrames() {
 }
 
 const char *DreamWebEngine::monPrint(const char *string) {
-	_kerning = 1;
 	uint16 x = _monAdX;
 	const char *iterator = string;
 	bool done = false;
@@ -233,7 +232,7 @@ const char *DreamWebEngine::monPrint(const char *string) {
 				break;
 			}
 			c = modifyChar(c);
-			printChar(_monitorCharset, &x, _monAdY, c, 0, NULL, NULL);
+			printChar(_monitorCharset, &x, _monAdY, c, 0, NULL, NULL, true);
 			_cursLocX = x;
 			_cursLocY = _monAdY;
 			_mainTimer = 1;
@@ -248,7 +247,6 @@ const char *DreamWebEngine::monPrint(const char *string) {
 		_cursLocX = _monAdX;
 	}
 
-	_kerning = 0;
 	return iterator;
 }
 





More information about the Scummvm-git-logs mailing list