added charset support for all V3 games, and fix for cleaning all 16 variables not only 15

svn-id: r6928
This commit is contained in:
Paweł Kołodziejski 2003-04-07 14:38:26 +00:00
parent 7e62d9a119
commit 0a46882bea
3 changed files with 9 additions and 4 deletions

View File

@ -30,7 +30,10 @@ void CharsetRendererCommon::setCurID(byte id) {
_fontPtr = _vm->getResourceAddress(rtCharset, id);
assert(_fontPtr);
if (_vm->_features & GF_SMALL_HEADER)
if (_vm->_features & GF_AFTER_V3) {
_nbChars = _fontPtr[4];
_fontPtr += 6 + _nbChars;
} else if (_vm->_features & GF_AFTER_V4)
_fontPtr += 17;
else
_fontPtr += 29;
@ -56,7 +59,7 @@ int CharsetRendererClassic::getCharWidth(byte chr) {
int CharsetRendererOld256::getCharWidth(byte chr) {
int spacing = 0;
spacing = *(_fontPtr - 11 + chr);
spacing = *(_fontPtr - _nbChars + chr);
// FIXME - this fixes the inventory icons in Zak256/Indy3
// see bug #613109.
@ -193,7 +196,8 @@ void CharsetRendererOld256::printChar(int chr) {
_strBottom = _top;
_firstChar = false;
}
char_ptr = _fontPtr + 207 + (chr + 1) * 8;
char_ptr = _fontPtr + chr * 8;
dest_ptr = vs->screenPtr + vs->xstart + (_top - vs->topline) * _vm->_realWidth + _left;
_vm->updateDirtyRect(vs->number, _left, _left + 8, _top - vs->topline, _top - vs->topline + 8, 0);

View File

@ -35,6 +35,7 @@ public:
int _top;
int _left, _startLeft;
int _right;
int _nbChars;
byte _color;

View File

@ -2346,7 +2346,7 @@ void Scumm_v5::o5_walkActorToObject() {
int Scumm_v5::getWordVararg(int *ptr) {
int i;
for (i = 0; i < 15; i++)
for (i = 0; i < 16; i++)
ptr[i] = 0;
i = 0;