Add string height override for loom

svn-id: r17178
This commit is contained in:
Travis Howell 2005-03-18 15:04:37 +00:00
parent 749cf8a083
commit 47e9cc1b3a
4 changed files with 13 additions and 8 deletions

View File

@ -2641,9 +2641,10 @@ void ScummEngine_v5::decodeParseString() {
break;
case 3: // SO_ERASE
{
int a = getVarOrDirectWord(PARAM_1);
int b = getVarOrDirectWord(PARAM_2);
warning("ScummEngine_v5::decodeParseString: Unhandled case 3: %d, %d", a, b);
int w = getVarOrDirectWord(PARAM_1);
int h = getVarOrDirectWord(PARAM_2);
// restoreCharsetBg(xpos, xpos + w, ypos, ypos + h)
error("ScummEngine_v5::decodeParseString: Unhandled case 3: %d, %d", w, h);
}
break;
case 4: // SO_CENTER
@ -2652,10 +2653,7 @@ void ScummEngine_v5::decodeParseString() {
break;
case 6: // SO_LEFT
if (_version == 3) {
// FIXME: this value seems to be some kind of override
// for text spacing?!?
/* int a = */ getVarOrDirectWord(PARAM_1);
_string[textSlot].height = getVarOrDirectWord(PARAM_1);
} else {
_string[textSlot].center = false;
_string[textSlot].overhead = false;
@ -2715,6 +2713,7 @@ void ScummEngine_v5::decodeParseString() {
if (_version <= 3) {
_string[textSlot]._default.xpos = _string[textSlot].xpos;
_string[textSlot]._default.ypos = _string[textSlot].ypos;
_string[textSlot]._default.height = _string[textSlot].height;
_string[textSlot]._default.color = _string[textSlot].color;
}
return;

View File

@ -1516,6 +1516,7 @@ void ScummEngine::scummInit() {
_string[i]._default.ypos = 5;
}
_string[i]._default.right = _screenWidth - 1;
_string[i]._default.height = 0;
_string[i]._default.color = 0xF;
_string[i]._default.center = 0;
_string[i]._default.charset = 0;

View File

@ -249,6 +249,7 @@ struct StringSlot {
int16 xpos;
int16 ypos;
int16 right;
int16 height;
byte color;
byte charset;
bool center;

View File

@ -234,7 +234,11 @@ void ScummEngine::CHARSET_1() {
if (_charset->_center) {
_charset->_nextLeft -= _charset->getStringWidth(0, buffer) / 2;
}
_charset->_nextTop += _charset->getFontHeight();
if (_string[0].height) {
_charset->_nextTop += _string[0].height;
} else {
_charset->_nextTop += _charset->getFontHeight();
}
if (_version > 3) {
// FIXME - is this really needed?
_charset->_disableOffsX = true;