[Scummvm-cvs-logs] SF.net SVN: scummvm:[38923] scummvm/trunk/engines/sword1

eriktorbjorn at users.sourceforge.net eriktorbjorn at users.sourceforge.net
Fri Feb 27 06:20:37 CET 2009


Revision: 38923
          http://scummvm.svn.sourceforge.net/scummvm/?rev=38923&view=rev
Author:   eriktorbjorn
Date:     2009-02-27 05:20:37 +0000 (Fri, 27 Feb 2009)

Log Message:
-----------
Committed a slightly updated patch #2602772 ("Patches for BS1 bug ID #1977094")
to replace some missing subtitles with hard-coded ones.

Modified Paths:
--------------
    scummvm/trunk/engines/sword1/objectman.cpp
    scummvm/trunk/engines/sword1/objectman.h

Modified: scummvm/trunk/engines/sword1/objectman.cpp
===================================================================
--- scummvm/trunk/engines/sword1/objectman.cpp	2009-02-27 02:24:29 UTC (rev 38922)
+++ scummvm/trunk/engines/sword1/objectman.cpp	2009-02-27 05:20:37 UTC (rev 38923)
@@ -108,8 +108,13 @@
 	}
 	uint32 offset = _resMan->readUint32(addr + ((textId & ITM_ID) + 1)* 4);
 	if (offset == 0) {
+		// Workaround bug for missing sentence in some langages in Syria (see bug #1977094).
+		// We use the hardcoded text in this case.
+		if (textId == 2950145)
+			return const_cast<char*>(_translationId2950145[lang]);
+
 		warning("ObjectMan::lockText(%d): text number has no text lines", textId);
-		return _errorStr;
+		return _missingSubTitleStr;
 	}
 	return addr + offset;
 }
@@ -161,6 +166,26 @@
 	memcpy(dest, _liveList, TOTAL_SECTIONS * sizeof(uint16));
 }
 
-char ObjectMan::_errorStr[] = "Error: Text not found.";
+// String displayed when a subtitle sentence is missing in the cluster file.
+// It happens with at least one sentence in Syria in some langages (see bug
+// #1977094).
+// Note: an empty string or a null pointer causes a crash.
 
+char ObjectMan::_missingSubTitleStr[] = " ";
+
+// Missing translation for textId 2950145 (see bug #1977094).
+// Currently text is missing for Portuguese languages. (It's possible that it
+// is not needed. The English version of the game does not include Portuguese
+// so I cannot check.)
+
+const char *ObjectMan::_translationId2950145[7] = {
+	"Oh?",     // English (not needed)
+	"Quoi?",   // French
+	"Oh?",     // German
+	"Eh?",     // Italian
+	"\277Eh?", // Spanish
+	"Ano?",    // Czech
+	" "        // Portuguese
+};
+
 } // End of namespace Sword1

Modified: scummvm/trunk/engines/sword1/objectman.h
===================================================================
--- scummvm/trunk/engines/sword1/objectman.h	2009-02-27 02:24:29 UTC (rev 38922)
+++ scummvm/trunk/engines/sword1/objectman.h	2009-02-27 05:20:37 UTC (rev 38923)
@@ -61,7 +61,8 @@
 	static const uint32 _textList[TOTAL_SECTIONS][7];	//a table of pointers to text files
 	uint16	_liveList[TOTAL_SECTIONS];					//which sections are active
 	uint8 *_cptData[TOTAL_SECTIONS];
-	static char _errorStr[];
+	static char _missingSubTitleStr[];
+	static const char *_translationId2950145[7];		//translation for textId 2950145 (missing from cluster file for some langages)
 };
 
 } // End of namespace Sword1


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.




More information about the Scummvm-git-logs mailing list