From 349fce7454cf621b4481577d3d11b947d7239339 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Torbj=C3=B6rn=20Andersson?= Date: Fri, 27 Feb 2009 05:20:37 +0000 Subject: [PATCH] Committed a slightly updated patch #2602772 ("Patches for BS1 bug ID #1977094") to replace some missing subtitles with hard-coded ones. svn-id: r38923 --- engines/sword1/objectman.cpp | 29 +++++++++++++++++++++++++++-- engines/sword1/objectman.h | 3 ++- 2 files changed, 29 insertions(+), 3 deletions(-) diff --git a/engines/sword1/objectman.cpp b/engines/sword1/objectman.cpp index 0fff84b6cdd..31b13d0e149 100644 --- a/engines/sword1/objectman.cpp +++ b/engines/sword1/objectman.cpp @@ -108,8 +108,13 @@ char *ObjectMan::lockText(uint32 textId) { } 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(_translationId2950145[lang]); + warning("ObjectMan::lockText(%d): text number has no text lines", textId); - return _errorStr; + return _missingSubTitleStr; } return addr + offset; } @@ -161,6 +166,26 @@ void ObjectMan::saveLiveList(uint16 *dest) { 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 diff --git a/engines/sword1/objectman.h b/engines/sword1/objectman.h index f0a5f3eb55c..fdb26e2e680 100644 --- a/engines/sword1/objectman.h +++ b/engines/sword1/objectman.h @@ -61,7 +61,8 @@ private: 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