[Scummvm-git-logs] scummvm master -> 05b42faab40211b4414bfba874d3445820213bef
antoniou79
a.antoniou79 at gmail.com
Sun Dec 20 20:37:55 UTC 2020
This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .
Summary:
05b42faab4 BLADERUNNER: Additional subtitles fix for accented characters
Commit: 05b42faab40211b4414bfba874d3445820213bef
https://github.com/scummvm/scummvm/commit/05b42faab40211b4414bfba874d3445820213bef
Author: antoniou79 (a.antoniou79 at gmail.com)
Date: 2020-12-20T22:36:36+02:00
Commit Message:
BLADERUNNER: Additional subtitles fix for accented characters
Changed paths:
engines/bladerunner/subtitles.cpp
diff --git a/engines/bladerunner/subtitles.cpp b/engines/bladerunner/subtitles.cpp
index c6ca22f279..66b3375f32 100644
--- a/engines/bladerunner/subtitles.cpp
+++ b/engines/bladerunner/subtitles.cpp
@@ -242,6 +242,8 @@ void Subtitles::loadInGameSubsText(int actorId, int speech_id) {
// Search in the first TextResource of the _vqaSubsTextResourceEntries table, which is the TextResource for in-game dialogue (i.e. not VQA dialogue)
const char *text = _vqaSubsTextResourceEntries[0]->getText((uint32)id);
+ // Use of Common::kWindows1252 codepage to fix bug whereby accented characters
+ // would not show for subtitles.
// TODO maybe the codepage here should be determined based on some subtitles property per language
// especially for non-latin languages that still use a FON font rather than a TTF font (eg. Greek would need Common::kWindows1253)
_currentText = _useUTF8 ? Common::convertUtf8ToUtf32(text) : Common::U32String(text, Common::kWindows1252);
@@ -264,7 +266,11 @@ void Subtitles::loadOuttakeSubsText(const Common::String &outtakesName, int fram
// Search in the requested TextResource at the fileIdx index of the _vqaSubsTextResourceEntries table for a quote that corresponds to the specified video frame
// debug("Number of resource quotes to search: %d, requested frame: %u", _vqaSubsTextResourceEntries[fileIdx]->getCount(), (uint32)frame );
const char *text = _vqaSubsTextResourceEntries[fileIdx]->getOuttakeTextByFrame((uint32)frame);
- _currentText = _useUTF8 ? Common::convertUtf8ToUtf32(text) : Common::U32String(text);
+ // Use of Common::kWindows1252 codepage to fix bug whereby accented characters
+ // would not show for subtitles.
+ // TODO maybe the codepage here should be determined based on some subtitles property per language
+ // especially for non-latin languages that still use a FON font rather than a TTF font (eg. Greek would need Common::kWindows1253)
+ _currentText = _useUTF8 ? Common::convertUtf8ToUtf32(text) : Common::U32String(text, Common::kWindows1252);
}
/**
@@ -272,7 +278,8 @@ void Subtitles::loadOuttakeSubsText(const Common::String &outtakesName, int fram
* Used for debug purposes mainly.
*/
void Subtitles::setGameSubsText(Common::String dbgQuote, bool forceShowWhenNoSpeech) {
- _currentText = _useUTF8 ? Common::convertUtf8ToUtf32(dbgQuote) : Common::U32String(dbgQuote);
+ // TODO is Common::kWindows1252 correct here?
+ _currentText = _useUTF8 ? Common::convertUtf8ToUtf32(dbgQuote) : Common::U32String(dbgQuote, Common::kWindows1252);
_forceShowWhenNoSpeech = forceShowWhenNoSpeech; // overrides not showing subtitles when no one is speaking
}
More information about the Scummvm-git-logs
mailing list