[Scummvm-cvs-logs] SF.net SVN: scummvm:[54729] scummvm/trunk/engines/scumm
fingolfin at users.sourceforge.net
fingolfin at users.sourceforge.net
Thu Dec 2 01:27:27 CET 2010
Revision: 54729
http://scummvm.svn.sourceforge.net/scummvm/?rev=54729&view=rev
Author: fingolfin
Date: 2010-12-02 00:27:26 +0000 (Thu, 02 Dec 2010)
Log Message:
-----------
SCUMM: Fix bug in V12 games causing chars to be lost when wrapping talk text
Modified Paths:
--------------
scummvm/trunk/engines/scumm/scumm.h
scummvm/trunk/engines/scumm/string.cpp
Modified: scummvm/trunk/engines/scumm/scumm.h
===================================================================
--- scummvm/trunk/engines/scumm/scumm.h 2010-12-01 23:59:57 UTC (rev 54728)
+++ scummvm/trunk/engines/scumm/scumm.h 2010-12-02 00:27:26 UTC (rev 54729)
@@ -1246,6 +1246,7 @@
virtual bool handleNextCharsetCode(Actor *a, int *c);
virtual void CHARSET_1();
+ bool newLine();
void drawString(int a, const byte *msg);
void debugMessage(const byte *msg);
void showMessageDialog(const byte *msg);
Modified: scummvm/trunk/engines/scumm/string.cpp
===================================================================
--- scummvm/trunk/engines/scumm/string.cpp 2010-12-01 23:59:57 UTC (rev 54728)
+++ scummvm/trunk/engines/scumm/string.cpp 2010-12-02 00:27:26 UTC (rev 54729)
@@ -426,6 +426,33 @@
}
#endif
+bool ScummEngine::newLine() {
+ _nextLeft = _string[0].xpos;
+ if (_charset->_center) {
+ _nextLeft -= _charset->getStringWidth(0, _charsetBuffer + _charsetBufPos) / 2;
+ if (_nextLeft < 0)
+ _nextLeft = _game.version >= 6 ? _string[0].xpos : 0;
+ }
+
+ if (_game.version == 0) {
+ return false;
+ } else if (!(_game.platform == Common::kPlatformFMTowns) && _string[0].height) {
+ _nextTop += _string[0].height;
+ } else {
+ bool useCJK = _useCJKMode;
+ // SCUMM5 FM-Towns doesn't use the height of the ROM font here.
+ if (_game.platform == Common::kPlatformFMTowns && _game.version == 5)
+ _useCJKMode = false;
+ _nextTop += _charset->getFontHeight();
+ _useCJKMode = useCJK;
+ }
+ if (_game.version > 3) {
+ // FIXME: is this really needed?
+ _charset->_disableOffsX = true;
+ }
+ return true;
+}
+
void ScummEngine::CHARSET_1() {
Actor *a;
#ifdef ENABLE_SCUMM_7_8
@@ -579,36 +606,14 @@
}
if (c == 13) {
- newLine:;
- _nextLeft = _string[0].xpos;
#ifdef ENABLE_SCUMM_7_8
if (_game.version >= 7 && subtitleLine != subtitleBuffer) {
((ScummEngine_v7 *)this)->addSubtitleToQueue(subtitleBuffer, subtitlePos, _charsetColor, _charset->getCurID());
subtitleLine = subtitleBuffer;
}
#endif
- if (_charset->_center) {
- _nextLeft -= _charset->getStringWidth(0, _charsetBuffer + _charsetBufPos) / 2;
- if (_nextLeft < 0)
- _nextLeft = _game.version >= 6 ? _string[0].xpos : 0;
- }
-
- if (_game.version == 0) {
+ if (!newLine())
break;
- } else if (!(_game.platform == Common::kPlatformFMTowns) && _string[0].height) {
- _nextTop += _string[0].height;
- } else {
- bool useCJK = _useCJKMode;
- // SCUMM5 FM-Towns doesn't use the height of the ROM font here.
- if (_game.platform == Common::kPlatformFMTowns && _game.version == 5)
- _useCJKMode = false;
- _nextTop += _charset->getFontHeight();
- _useCJKMode = useCJK;
- }
- if (_game.version > 3) {
- // FIXME: is this really needed?
- _charset->_disableOffsX = true;
- }
continue;
}
@@ -618,7 +623,8 @@
}
// Handle line breaks for V1-V2
if (_game.version <= 2 && _nextLeft >= _screenWidth) {
- goto newLine;
+ if (!newLine())
+ break; // FIXME: Is this necessary? Only would be relevant for v0 games
}
_charset->_left = _nextLeft;
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