From 0ca949db2af91c3a070e2dc95e46ba6161e6c594 Mon Sep 17 00:00:00 2001 From: Eugene Sandulenko Date: Mon, 28 Apr 2008 15:21:36 +0000 Subject: Fix Kanji text positioning in DIG. Constants based on disassembly, but it can bring some regressions to subtitles. svn-id: r31757 --- engines/scumm/string.cpp | 23 ++++++++++++++++------- 1 file changed, 16 insertions(+), 7 deletions(-) (limited to 'engines/scumm/string.cpp') diff --git a/engines/scumm/string.cpp b/engines/scumm/string.cpp index 61a960b3ed..834896d021 100644 --- a/engines/scumm/string.cpp +++ b/engines/scumm/string.cpp @@ -279,6 +279,12 @@ bool ScummEngine::handleNextCharsetCode(Actor *a, int *code) { break; } c = *buffer++; + + if (c == _newLineCharacter) { + c = 13; + break; + } + switch (c) { case 1: c = 13; // new line @@ -479,13 +485,14 @@ void ScummEngine::CHARSET_1() { _string[0].ypos = _screenHeight - 40; } - if (_string[0].ypos < 1) - _string[0].ypos = 1; + if (_string[0].ypos < 10) + _string[0].ypos = 10; + + if (_string[0].xpos < 5) + _string[0].xpos = 5; + if (_string[0].xpos > _screenWidth - 10) + _string[0].xpos = _screenWidth - 10; - if (_string[0].xpos < 80) - _string[0].xpos = 80; - if (_string[0].xpos > _screenWidth - 80) - _string[0].xpos = _screenWidth - 80; } _charset->_top = _string[0].ypos + _screenTop; @@ -551,7 +558,7 @@ void ScummEngine::CHARSET_1() { if (_charset->_center) { _nextLeft -= _charset->getStringWidth(0, _charsetBuffer + _charsetBufPos) / 2; if (_nextLeft < 0) - _nextLeft = 0; + _nextLeft = _string[0].xpos; } _charset->_disableOffsX = _charset->_firstChar = !_keepText; @@ -576,6 +583,8 @@ void ScummEngine::CHARSET_1() { #endif if (_charset->_center) { _nextLeft -= _charset->getStringWidth(0, _charsetBuffer + _charsetBufPos) / 2; + if (_nextLeft < 0) + _nextLeft = _string[0].xpos; } if (_game.version == 0) { -- cgit v1.2.3