[Scummvm-cvs-logs] scummvm master -> ac76994781fedecbfa74cd43d0983dcd7b06f12c

criezy criezy at scummvm.org
Tue Jun 5 23:44:43 CEST 2012


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:
d2c6525d88 SWORD1: Fix crash in demo when using French subtitles
ac76994781 SWORD1: Use _missingSubTitleStr when asking for an out of bound textId


Commit: d2c6525d881f5c391b0c94bcb2c10c328aa5492f
    https://github.com/scummvm/scummvm/commit/d2c6525d881f5c391b0c94bcb2c10c328aa5492f
Author: Thierry Crozat (criezy at scummvm.org)
Date: 2012-06-05T14:35:36-07:00

Commit Message:
SWORD1: Fix crash in demo when using French subtitles

Changed paths:
    engines/sword1/text.cpp



diff --git a/engines/sword1/text.cpp b/engines/sword1/text.cpp
index 3bd2fdb..f23ac5f 100644
--- a/engines/sword1/text.cpp
+++ b/engines/sword1/text.cpp
@@ -156,6 +156,8 @@ uint16 Text::analyzeSentence(const uint8 *text, uint16 maxWidth, LineInfo *line)
 }
 
 uint16 Text::copyChar(uint8 ch, uint8 *sprPtr, uint16 sprWidth, uint8 pen) {
+	if (ch < SPACE)
+		ch = 64;
 	FrameHeader *chFrame = _resMan->fetchFrame(_font, ch - SPACE);
 	uint8 *chData = ((uint8 *)chFrame) + sizeof(FrameHeader);
 	uint8 *dest = sprPtr;


Commit: ac76994781fedecbfa74cd43d0983dcd7b06f12c
    https://github.com/scummvm/scummvm/commit/ac76994781fedecbfa74cd43d0983dcd7b06f12c
Author: Thierry Crozat (criezy at scummvm.org)
Date: 2012-06-05T14:35:36-07:00

Commit Message:
SWORD1: Use _missingSubTitleStr when asking for an out of bound textId

It was using textId 0, which is not the subtitle we want anyway. So
instead of using the wrong subtitle, it is probably better to not display
a subtitle at all. A test case for this is with the demo when using
non-english language as several subtitles are missing toward the end.

Changed paths:
    engines/sword1/objectman.cpp



diff --git a/engines/sword1/objectman.cpp b/engines/sword1/objectman.cpp
index ed994a9..d080359 100644
--- a/engines/sword1/objectman.cpp
+++ b/engines/sword1/objectman.cpp
@@ -105,7 +105,7 @@ char *ObjectMan::lockText(uint32 textId) {
 	addr += sizeof(Header);
 	if ((textId & ITM_ID) >= _resMan->readUint32(addr)) {
 		warning("ObjectMan::lockText(%d): only %d texts in file", textId & ITM_ID, _resMan->readUint32(addr));
-		textId = 0; // get first line instead
+		return _missingSubTitleStr;
 	}
 	uint32 offset = _resMan->readUint32(addr + ((textId & ITM_ID) + 1) * 4);
 	if (offset == 0) {






More information about the Scummvm-git-logs mailing list