aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaweł Kołodziejski2003-04-07 14:38:26 +0000
committerPaweł Kołodziejski2003-04-07 14:38:26 +0000
commit0a46882beab65286f5ac3ec3dbb8f6759c13abee (patch)
treec90eaf12d1ea01e8a1f128e1784b2f0c121f027a
parent7e62d9a1197cec12a6eda047cff638946d829529 (diff)
downloadscummvm-rg350-0a46882beab65286f5ac3ec3dbb8f6759c13abee.tar.gz
scummvm-rg350-0a46882beab65286f5ac3ec3dbb8f6759c13abee.tar.bz2
scummvm-rg350-0a46882beab65286f5ac3ec3dbb8f6759c13abee.zip
added charset support for all V3 games, and fix for cleaning all 16 variables not only 15
svn-id: r6928
-rw-r--r--scumm/charset.cpp10
-rw-r--r--scumm/charset.h1
-rw-r--r--scumm/script_v5.cpp2
3 files changed, 9 insertions, 4 deletions
diff --git a/scumm/charset.cpp b/scumm/charset.cpp
index 9072b40e01..13dab3db08 100644
--- a/scumm/charset.cpp
+++ b/scumm/charset.cpp
@@ -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);
diff --git a/scumm/charset.h b/scumm/charset.h
index e2e342b642..e61d46bcef 100644
--- a/scumm/charset.h
+++ b/scumm/charset.h
@@ -35,6 +35,7 @@ public:
int _top;
int _left, _startLeft;
int _right;
+ int _nbChars;
byte _color;
diff --git a/scumm/script_v5.cpp b/scumm/script_v5.cpp
index da46e1dee4..f046713fb4 100644
--- a/scumm/script_v5.cpp
+++ b/scumm/script_v5.cpp
@@ -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;