diff options
author | David Corrales | 2007-08-05 19:34:20 +0000 |
---|---|---|
committer | David Corrales | 2007-08-05 19:34:20 +0000 |
commit | 6856535010bd2fa4449bcfde1c88dc06cd46e26f (patch) | |
tree | b81a2234c2beff0312c93e039d6cafda4babeca6 /engines/gob/draw_v2.cpp | |
parent | 1400d28bfb37fc94f3c44dec0a4d0cef65fb8fb7 (diff) | |
parent | ec1803f838d5efc7decf75c05a1fb4a9633751e5 (diff) | |
download | scummvm-rg350-6856535010bd2fa4449bcfde1c88dc06cd46e26f.tar.gz scummvm-rg350-6856535010bd2fa4449bcfde1c88dc06cd46e26f.tar.bz2 scummvm-rg350-6856535010bd2fa4449bcfde1c88dc06cd46e26f.zip |
Merged fsnode with trunk: r27971:28460
svn-id: r28462
Diffstat (limited to 'engines/gob/draw_v2.cpp')
-rw-r--r-- | engines/gob/draw_v2.cpp | 39 |
1 files changed, 34 insertions, 5 deletions
diff --git a/engines/gob/draw_v2.cpp b/engines/gob/draw_v2.cpp index c45bd0de27..55585f5619 100644 --- a/engines/gob/draw_v2.cpp +++ b/engines/gob/draw_v2.cpp @@ -197,7 +197,12 @@ void Draw_v2::printTotText(int16 id) { int16 rectLeft, rectTop, rectRight, rectBottom; int16 size; - if (!_vm->_game->_totTextData || !_vm->_game->_totTextData->dataPtr) + id &= 0xFFF; + + if (!_vm->_game->_totTextData || !_vm->_game->_totTextData->dataPtr || + (id >= _vm->_game->_totTextData->itemsCount) || + (_vm->_game->_totTextData->items[id].offset == -1) || + (_vm->_game->_totTextData->items[id].size == 0)) return; _vm->validateLanguage(); @@ -210,10 +215,34 @@ void Draw_v2::printTotText(int16 id) { if ((_renderFlags & RENDERFLAG_SKIPOPTIONALTEXT) && (ptr[1] & 0x80)) return; - destX = READ_LE_UINT16(ptr) & 0x7FFF; - destY = READ_LE_UINT16(ptr + 2); - spriteRight = READ_LE_UINT16(ptr + 4); - spriteBottom = READ_LE_UINT16(ptr + 6); + if (_renderFlags & RENDERFLAG_DOUBLECOORDS) { + destX = (READ_LE_UINT16(ptr) & 0x7FFF) * 2; + spriteRight = READ_LE_UINT16(ptr + 4) * 2 + 1; + } else { + destX = READ_LE_UINT16(ptr) & 0x7FFF; + spriteRight = READ_LE_UINT16(ptr + 4); + } + + if (_renderFlags & RENDERFLAG_FROMSPLIT) { + destY = _vm->_video->_splitHeight1; + spriteBottom = READ_LE_UINT16(ptr + 6) - READ_LE_UINT16(ptr + 2); + if (_renderFlags & RENDERFLAG_DOUBLECOORDS) + spriteBottom *= 3; + spriteBottom += _vm->_video->_splitHeight1; + if (_renderFlags & RENDERFLAG_DOUBLECOORDS) { + spriteBottom += _backDeltaX; + destY += _backDeltaX; + } + } else { + if (_renderFlags & RENDERFLAG_DOUBLECOORDS) { + destY = READ_LE_UINT16(ptr + 2) * 2; + spriteBottom = READ_LE_UINT16(ptr + 6) * 2; + } else { + destY = READ_LE_UINT16(ptr + 2); + spriteBottom = READ_LE_UINT16(ptr + 6); + } + } + ptr += 8; if (_renderFlags & RENDERFLAG_CAPTUREPUSH) { |