[Scummvm-git-logs] scummvm master -> 180ba42020f37c9a991df6f8417a25fe0260b4a0

sev- noreply at scummvm.org
Thu Sep 29 18:47:00 UTC 2022


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:
11ec68fda5 SCUMM: HE: support BiDi in hebrew fan translations
180ba42020 SCUMM: HE: opt out BiDi for official translations


Commit: 11ec68fda5675d7914c4c983ccfba1676ceada21
    https://github.com/scummvm/scummvm/commit/11ec68fda5675d7914c4c983ccfba1676ceada21
Author: BLooperZ (blooperz at users.noreply.github.com)
Date: 2022-09-29T20:46:55+02:00

Commit Message:
SCUMM: HE: support BiDi in hebrew fan translations

Changed paths:
    engines/scumm/he/intern_he.h
    engines/scumm/scumm.cpp
    engines/scumm/scumm.h
    engines/scumm/string.cpp


diff --git a/engines/scumm/he/intern_he.h b/engines/scumm/he/intern_he.h
index ee40545da62..34452ecbd36 100644
--- a/engines/scumm/he/intern_he.h
+++ b/engines/scumm/he/intern_he.h
@@ -326,6 +326,7 @@ protected:
 
 	bool handleNextCharsetCode(Actor *a, int *c) override;
 	int convertMessageToString(const byte *msg, byte *dst, int dstSize) override;
+	void fakeBidiString(byte *ltext, bool ignoreVerb) const override;
 
 	void debugInput(byte *string);
 
diff --git a/engines/scumm/scumm.cpp b/engines/scumm/scumm.cpp
index 1f82b3f85b8..26ec1b9d2ba 100644
--- a/engines/scumm/scumm.cpp
+++ b/engines/scumm/scumm.cpp
@@ -359,7 +359,7 @@ ScummEngine::ScummEngine(OSystem *syst, const DetectorResult &dr)
 
 	setV1ColorTable(_renderMode);
 
-	_isRTL = (_language == Common::HE_ISR && _game.heversion == 0)
+	_isRTL = (_language == Common::HE_ISR && (_game.heversion == 0 || _game.heversion >= 72)) 
 			&& (_game.id == GID_MANIAC || (_game.version >= 4 && _game.version < 7));
 #ifndef DISABLE_HELP
 	// Create custom GMM dialog providing a help subdialog
diff --git a/engines/scumm/scumm.h b/engines/scumm/scumm.h
index 4b114680d4d..c2789d28ef9 100644
--- a/engines/scumm/scumm.h
+++ b/engines/scumm/scumm.h
@@ -1480,7 +1480,7 @@ protected:
 	virtual void CHARSET_1();
 	bool newLine();
 	void drawString(int a, const byte *msg);
-	void fakeBidiString(byte *ltext, bool ignoreVerb) const;
+	virtual void fakeBidiString(byte *ltext, bool ignoreVerb) const;
 	void debugMessage(const byte *msg);
 	virtual void showMessageDialog(const byte *msg);
 
diff --git a/engines/scumm/string.cpp b/engines/scumm/string.cpp
index d23398ecdd7..be80b1ac795 100644
--- a/engines/scumm/string.cpp
+++ b/engines/scumm/string.cpp
@@ -22,6 +22,7 @@
 
 
 #include "common/config-manager.h"
+#include "common/unicode-bidi.h"
 #include "audio/mixer.h"
 
 #include "scumm/actor.h"
@@ -547,7 +548,7 @@ bool ScummEngine::newLine() {
 			// the original code it seems that setting _nextLeft to 0 is the right thing to do here.
 			_nextLeft = /*_game.version >= 6 ? _string[0].xpos :*/ 0;
 	} else if (_isRTL) {
-		if (_game.id == GID_MANIAC || ((_game.id == GID_MONKEY || _game.id == GID_MONKEY2) && _charset->getCurID() == 4)) {
+		if (_game.id == GID_MANIAC || _game.heversion >= 72 || ((_game.id == GID_MONKEY || _game.id == GID_MONKEY2) && _charset->getCurID() == 4)) {
 			_nextLeft = _screenWidth - _charset->getStringWidth(0, _charsetBuffer + _charsetBufPos) - _nextLeft;
 		} else if (_game.id == GID_MONKEY2 && _charset->getCurID() == 5) {
 			_nextLeft += _screenWidth - 210 - _charset->getStringWidth(0, _charsetBuffer + _charsetBufPos);
@@ -572,6 +573,31 @@ bool ScummEngine::newLine() {
 	return true;
 }
 
+#ifdef ENABLE_HE
+void ScummEngine_v72he::fakeBidiString(byte *ltext, bool ignoreVerb) const {
+	if (*ltext == 0x7F) {
+		ltext++;
+		while (*(ltext++) != 0x7F);
+	}
+	byte *loc = ltext;
+	byte tmp = 0;
+	while (1) {
+		while (*loc && *loc != 13) {
+			loc++;
+		}
+		tmp = *loc;
+		*loc = 0;
+		strcpy((char *)ltext, Common::convertBiDiString((const char *)ltext, Common::kWindows1255).c_str());
+		*loc = tmp;
+		loc++;
+		ltext = loc;
+		if (!tmp) {
+			return;
+		}
+	}
+}
+#endif
+
 void ScummEngine::fakeBidiString(byte *ltext, bool ignoreVerb) const {
 	// Provides custom made BiDi mechanism.
 	// Reverses texts on each line marked by control characters (considering different control characters used in verbs panel)
@@ -812,7 +838,7 @@ void ScummEngine::CHARSET_1() {
 		if (_nextLeft < 0)
 			_nextLeft = _game.version >= 6 ? _string[0].xpos : 0;
 	} else if (_isRTL) {
-		if (_game.id == GID_MANIAC || ((_game.id == GID_MONKEY || _game.id == GID_MONKEY2) && _charset->getCurID() == 4)) {
+		if (_game.id == GID_MANIAC || _game.heversion >= 72 || ((_game.id == GID_MONKEY || _game.id == GID_MONKEY2) && _charset->getCurID() == 4)) {
 			_nextLeft = _screenWidth - _charset->getStringWidth(0, _charsetBuffer + _charsetBufPos) - _nextLeft;
 		} else if (_game.id == GID_MONKEY2 && _charset->getCurID() == 5) {
 			_nextLeft += _screenWidth - 210 - _charset->getStringWidth(0, _charsetBuffer + _charsetBufPos);


Commit: 180ba42020f37c9a991df6f8417a25fe0260b4a0
    https://github.com/scummvm/scummvm/commit/180ba42020f37c9a991df6f8417a25fe0260b4a0
Author: BLooperZ (blooperz at users.noreply.github.com)
Date: 2022-09-29T20:46:55+02:00

Commit Message:
SCUMM: HE: opt out BiDi for official translations

Changed paths:
    devtools/scumm-md5.txt
    engines/scumm/detection.h
    engines/scumm/detection_tables.h
    engines/scumm/scumm-md5.h
    engines/scumm/scumm.cpp


diff --git a/devtools/scumm-md5.txt b/devtools/scumm-md5.txt
index 429aafe3f74..50f470c4b99 100644
--- a/devtools/scumm-md5.txt
+++ b/devtools/scumm-md5.txt
@@ -809,7 +809,7 @@ puttcircus	Putt-Putt Joins the Circus
 	db74136c20557eca6ed3411bff39f7a1	36655	gb	Windows	-	-	-	Reckless
 	d0ad929def3e9cfe39dea55bd12098d4	36655	fr	Windows	-	-	-	gist974
 	febf4a983ea5faea1c9dd6c710ebb09c	36655	de	Windows	-	-	-	andy482
-	c8253da0f4626d2236b5291b99e33408	-1	he	Windows	HE 99	-	-	Matan Bareket
+	c8253da0f4626d2236b5291b99e33408	-1	he	Windows	-	-	-	Matan Bareket
 
 	a7cacad9c40c4dc9e1812abf6c8af9d5	-1	us	All	-	Demo	-	Kirben, sev
 	1387d16aa620dc1c2d1fd87f8a9e7a09	-1	fr	Windows	-	Demo	-	Mevi
diff --git a/engines/scumm/detection.h b/engines/scumm/detection.h
index 2f19047a5ee..9c1c3c2586b 100644
--- a/engines/scumm/detection.h
+++ b/engines/scumm/detection.h
@@ -185,7 +185,14 @@ enum GameFeatures {
 	 * SCUMM v5-v7 Mac games stored in a container file
 	 * Used to differentiate between m68k and PPC versions of Indy4
 	 */
-	GF_MAC_CONTAINER = 1 << 16
+	GF_MAC_CONTAINER = 1 << 16,
+
+	/**
+	 * SCUMM HE Official Hebrew translations were audio only
+	 * but used reversed string for credits etc.
+	 * Used to disable BiDi in those games.
+	 */
+	GF_HE_NO_BIDI = 1 << 17
 };
 
 enum ScummGameId {
diff --git a/engines/scumm/detection_tables.h b/engines/scumm/detection_tables.h
index 57eaf07aaf8..eeade59d195 100644
--- a/engines/scumm/detection_tables.h
+++ b/engines/scumm/detection_tables.h
@@ -227,20 +227,20 @@ static const GameSettings gameVariantsTable[] = {
 
 	// Humongous Entertainment Scumm Version 6
 	{"activity", "", 0, GID_HEGAME, 6, 62, MDT_ADLIB | MDT_MIDI, GF_USE_KEY, UNK, GUIO2(GUIO_NOLAUNCHLOAD, GUIO_AUDIO_OVERRIDE)},
-	{"funpack",  0, 0, GID_FUNPACK, 6, 62, MDT_ADLIB | MDT_MIDI, GF_USE_KEY, UNK, GUIO2(GUIO_NOLAUNCHLOAD, GUIO_AUDIO_OVERRIDE)},
-	{"fbpack",   0, 0, GID_HEGAME,  6, 62, MDT_ADLIB | MDT_MIDI, GF_USE_KEY, UNK, GUIO2(GUIO_NOLAUNCHLOAD, GUIO_AUDIO_OVERRIDE)},
+	{"funpack",  0, 0, GID_FUNPACK, 6, 62, MDT_ADLIB | MDT_MIDI, GF_USE_KEY | GF_HE_NO_BIDI, UNK, GUIO2(GUIO_NOLAUNCHLOAD, GUIO_AUDIO_OVERRIDE)},
+	{"fbpack",   0, 0, GID_HEGAME,  6, 62, MDT_ADLIB | MDT_MIDI, GF_USE_KEY | GF_HE_NO_BIDI, UNK, GUIO2(GUIO_NOLAUNCHLOAD, GUIO_AUDIO_OVERRIDE)},
 
 	{"brstorm", 0, 0, GID_FBEAR, 6, 62, MDT_ADLIB | MDT_MIDI, GF_USE_KEY, UNK, GUIO2(GUIO_NOLAUNCHLOAD, GUIO_AUDIO_OVERRIDE)},
-	{"fbear", "HE 62", 0, GID_FBEAR, 6, 62, MDT_ADLIB | MDT_MIDI, GF_USE_KEY, UNK, GUIO2(GUIO_NOLAUNCHLOAD, GUIO_AUDIO_OVERRIDE)},
+	{"fbear", "HE 62", 0, GID_FBEAR, 6, 62, MDT_ADLIB | MDT_MIDI, GF_USE_KEY | GF_HE_NO_BIDI, UNK, GUIO2(GUIO_NOLAUNCHLOAD, GUIO_AUDIO_OVERRIDE)},
 	{"fbear", "HE 70", 0, GID_FBEAR, 6, 70, MDT_NONE,             GF_USE_KEY, Common::kPlatformWindows, GUIO3(GUIO_NOLAUNCHLOAD, GUIO_NOMIDI, GUIO_AUDIO_OVERRIDE)},
 
-	{"puttmoon", "", 0, GID_PUTTMOON, 6, 62, MDT_ADLIB | MDT_MIDI, GF_USE_KEY, UNK, GUIO2(GUIO_NOLAUNCHLOAD, GUIO_AUDIO_OVERRIDE)},
+	{"puttmoon", "", 0, GID_PUTTMOON, 6, 62, MDT_ADLIB | MDT_MIDI, GF_USE_KEY | GF_HE_NO_BIDI, UNK, GUIO2(GUIO_NOLAUNCHLOAD, GUIO_AUDIO_OVERRIDE)},
 	{"puttmoon", "Demo", 0, GID_HEGAME, 6, 62, MDT_ADLIB | MDT_MIDI, GF_USE_KEY, UNK, GUIO2(GUIO_NOLAUNCHLOAD, GUIO_AUDIO_OVERRIDE)},
 	{"puttmoon", "HE 70", 0, GID_PUTTMOON, 6, 70, MDT_NONE,             GF_USE_KEY, Common::kPlatformWindows, GUIO3(GUIO_NOLAUNCHLOAD, GUIO_NOMIDI, GUIO_AUDIO_OVERRIDE)},
 
 	{"puttputt", "HE 60", 0, GID_HEGAME,   6, 60, MDT_ADLIB | MDT_MIDI, GF_USE_KEY, UNK, GUIO2(GUIO_NOLAUNCHLOAD, GUIO_AUDIO_OVERRIDE)},
 	{"puttputt", "HE 61", 0, GID_HEGAME,   6, 61, MDT_ADLIB | MDT_MIDI, GF_USE_KEY, UNK, GUIO2(GUIO_NOLAUNCHLOAD, GUIO_AUDIO_OVERRIDE)},
-	{"puttputt", "HE 62", 0, GID_HEGAME,   6, 62, MDT_ADLIB | MDT_MIDI, GF_USE_KEY, UNK, GUIO2(GUIO_NOLAUNCHLOAD, GUIO_AUDIO_OVERRIDE)},
+	{"puttputt", "HE 62", 0, GID_HEGAME,   6, 62, MDT_ADLIB | MDT_MIDI, GF_USE_KEY | GF_HE_NO_BIDI, UNK, GUIO2(GUIO_NOLAUNCHLOAD, GUIO_AUDIO_OVERRIDE)},
 	{"puttputt", "Demo",  0, GID_PUTTDEMO, 6, 60, MDT_ADLIB | MDT_MIDI, GF_USE_KEY, UNK, GUIO2(GUIO_NOLAUNCHLOAD, GUIO_AUDIO_OVERRIDE)},
 
 	// The following are meant to be generic HE game variants and as such do
@@ -258,7 +258,7 @@ static const GameSettings gameVariantsTable[] = {
 	{"farm", "", 0, GID_HEGAME, 6, 71, MDT_NONE, GF_USE_KEY, UNK, GUIO4(GUIO_NOLAUNCHLOAD, GUIO_NOMIDI, GUIO_NOASPECT, GUIO_AUDIO_OVERRIDE)},
 	{"freddi", "", 0, GID_HEGAME, 6, 71, MDT_NONE, GF_USE_KEY, UNK, GUIO4(GUIO_NOLAUNCHLOAD, GUIO_NOMIDI, GUIO_NOASPECT, GUIO_AUDIO_OVERRIDE)},
 	{"freddi", "HE 71",   0, GID_FREDDI, 6,  71, MDT_NONE, GF_USE_KEY, UNK, GUIO4(GUIO_NOLAUNCHLOAD, GUIO_NOMIDI, GUIO_NOASPECT, GUIO_AUDIO_OVERRIDE)},
-	{"freddi", "HE 73",   0, GID_FREDDI, 6,  73, MDT_NONE, GF_USE_KEY, UNK, GUIO4(GUIO_NOLAUNCHLOAD, GUIO_NOMIDI, GUIO_NOASPECT, GUIO_AUDIO_OVERRIDE)},
+	{"freddi", "HE 73",   0, GID_FREDDI, 6,  73, MDT_NONE, GF_USE_KEY | GF_HE_NO_BIDI, UNK, GUIO4(GUIO_NOLAUNCHLOAD, GUIO_NOMIDI, GUIO_NOASPECT, GUIO_AUDIO_OVERRIDE)},
 
 	// Humongous Entertainment Scumm Version 7.2
 	{"airport", "", 0, GID_HEGAME, 6, 72, MDT_NONE, GF_USE_KEY, UNK, GUIO4(GUIO_NOLAUNCHLOAD, GUIO_NOMIDI, GUIO_NOASPECT, GUIO_AUDIO_OVERRIDE)},
@@ -294,10 +294,11 @@ static const GameSettings gameVariantsTable[] = {
 	{"spyfox", "", 0, GID_HEGAME, 6, 90, MDT_NONE, GF_USE_KEY, UNK, GUIO4(GUIO_NOLAUNCHLOAD, GUIO_NOMIDI, GUIO_NOASPECT, GUIO_AUDIO_OVERRIDE)},
 
 	{"freddi3", "", 0, GID_FREDDI3, 6, 90, MDT_NONE, GF_USE_KEY, UNK, GUIO4(GUIO_NOLAUNCHLOAD, GUIO_NOMIDI, GUIO_NOASPECT, GUIO_AUDIO_OVERRIDE)},
-	{"freddi3", "HE 99", 0, GID_FREDDI3, 6, 99, MDT_NONE, GF_USE_KEY, UNK, GUIO4(GUIO_NOLAUNCHLOAD, GUIO_NOMIDI, GUIO_NOASPECT, GUIO_AUDIO_OVERRIDE)},
+	{"freddi3", "HE 99", 0, GID_FREDDI3, 6, 99, MDT_NONE, GF_USE_KEY | GF_HE_NO_BIDI, UNK, GUIO4(GUIO_NOLAUNCHLOAD, GUIO_NOMIDI, GUIO_NOASPECT, GUIO_AUDIO_OVERRIDE)},
 
 	// Humongous Entertainment Scumm Version 9.5 ?  Scummsys.95
 	{"pajama2", "", 0, GID_HEGAME, 6, 95, MDT_NONE, GF_USE_KEY, UNK, GUIO4(GUIO_NOLAUNCHLOAD, GUIO_NOMIDI, GUIO_NOASPECT, GUIO_AUDIO_OVERRIDE)},
+	{"pajama2", "HE 99", 0, GID_HEGAME, 6, 99, MDT_NONE, GF_USE_KEY | GF_HE_NO_BIDI, UNK, GUIO4(GUIO_NOLAUNCHLOAD, GUIO_NOMIDI, GUIO_NOASPECT, GUIO_AUDIO_OVERRIDE)},
 	{"chase", "", 0, GID_HEGAME, 6, 95, MDT_NONE, GF_USE_KEY, UNK, GUIO4(GUIO_NOLAUNCHLOAD, GUIO_NOMIDI, GUIO_NOASPECT, GUIO_AUDIO_OVERRIDE)},
 
 	// Humongous Entertainment Scumm Version 9.8 ?  Scummsys.98
@@ -323,7 +324,7 @@ static const GameSettings gameVariantsTable[] = {
 	// Humongous Entertainment Scumm Version 9.9 ?  Scummsys.99
 	{"football", 0, 0, GID_FOOTBALL, 6, 99, MDT_NONE, GF_USE_KEY, UNK, GUIO4(GUIO_NOLAUNCHLOAD, GUIO_NOMIDI, GUIO_NOASPECT, GUIO_AUDIO_OVERRIDE)},
 	{"pajama3", 0, 0, GID_HEGAME, 6, 99, MDT_NONE, GF_USE_KEY | GF_HE_LOCALIZED, UNK, GUIO4(GUIO_NOLAUNCHLOAD, GUIO_NOMIDI, GUIO_NOASPECT, GUIO_AUDIO_OVERRIDE)},
-	{"puttcircus", 0, 0, GID_HEGAME, 6, 99, MDT_NONE, GF_USE_KEY | GF_HE_LOCALIZED, UNK, GUIO4(GUIO_NOLAUNCHLOAD, GUIO_NOMIDI, GUIO_NOASPECT, GUIO_AUDIO_OVERRIDE)},
+	{"puttcircus", 0, 0, GID_HEGAME, 6, 99, MDT_NONE, GF_USE_KEY | GF_HE_LOCALIZED | GF_HE_NO_BIDI, UNK, GUIO4(GUIO_NOLAUNCHLOAD, GUIO_NOMIDI, GUIO_NOASPECT, GUIO_AUDIO_OVERRIDE)},
 	{"spyfox2", 0, 0, GID_HEGAME, 6, 99, MDT_NONE, GF_USE_KEY | GF_HE_LOCALIZED, UNK, GUIO4(GUIO_NOLAUNCHLOAD, GUIO_NOMIDI, GUIO_NOASPECT, GUIO_AUDIO_OVERRIDE)},
 	{"mustard", 0, 0, GID_HEGAME, 6, 99, MDT_NONE, GF_USE_KEY | GF_HE_LOCALIZED, UNK, GUIO4(GUIO_NOLAUNCHLOAD, GUIO_NOMIDI, GUIO_NOASPECT, GUIO_AUDIO_OVERRIDE)},
 
diff --git a/engines/scumm/scumm-md5.h b/engines/scumm/scumm-md5.h
index 8a5a9cff12b..b26c1d967cf 100644
--- a/engines/scumm/scumm-md5.h
+++ b/engines/scumm/scumm-md5.h
@@ -1,5 +1,5 @@
 /*
-  This file was generated by the md5table tool on Thu Sep 15 22:10:44 2022
+  This file was generated by the md5table tool on Wed Sep 21 16:53:44 2022
   DO NOT EDIT MANUALLY!
  */
 
@@ -593,7 +593,7 @@ static const MD5Table md5table[] = {
 	{ "c7890e038806df2bb5c0c8c6f1986ea2", "monkey", "VGA", "VGA", -1, Common::EN_ANY, Common::kPlatformDOS },
 	{ "c7be10f775404fd9785a8b92a06d240c", "atlantis", "FM-TOWNS", "", 12030, Common::EN_ANY, Common::kPlatformFMTowns },
 	{ "c7c492a107ec520d7a7943037d0ca54a", "freddi", "HE 71", "Demo", 9779, Common::NL_NLD, Common::kPlatformWindows },
-	{ "c8253da0f4626d2236b5291b99e33408", "puttcircus", "HE 99", "", -1, Common::HE_ISR, Common::kPlatformWindows },
+	{ "c8253da0f4626d2236b5291b99e33408", "puttcircus", "", "", -1, Common::HE_ISR, Common::kPlatformWindows },
 	{ "c83079157ec765a28de445aec9768d60", "tentacle", "", "Demo", 7477, Common::EN_ANY, Common::kPlatformUnknown },
 	{ "c8575e0b973ff1723aba6cd92c642db2", "puttrace", "HE 99", "Demo", -1, Common::FR_FRA, Common::kPlatformWindows },
 	{ "c8aac5e3e701874e2fa4117896f9e1b1", "freddi", "HE 73", "Demo", -1, Common::EN_ANY, Common::kPlatformMacintosh },
diff --git a/engines/scumm/scumm.cpp b/engines/scumm/scumm.cpp
index 26ec1b9d2ba..85dc936d714 100644
--- a/engines/scumm/scumm.cpp
+++ b/engines/scumm/scumm.cpp
@@ -360,7 +360,7 @@ ScummEngine::ScummEngine(OSystem *syst, const DetectorResult &dr)
 	setV1ColorTable(_renderMode);
 
 	_isRTL = (_language == Common::HE_ISR && (_game.heversion == 0 || _game.heversion >= 72)) 
-			&& (_game.id == GID_MANIAC || (_game.version >= 4 && _game.version < 7));
+			&& (_game.id == GID_MANIAC || (_game.version >= 4 && _game.version < 7)) && !(_game.features & GF_HE_NO_BIDI);
 #ifndef DISABLE_HELP
 	// Create custom GMM dialog providing a help subdialog
 	assert(!_mainMenuDialog);




More information about the Scummvm-git-logs mailing list