aboutsummaryrefslogtreecommitdiff
path: root/scumm
diff options
context:
space:
mode:
authorMax Horn2002-11-29 18:27:35 +0000
committerMax Horn2002-11-29 18:27:35 +0000
commita730f7f6df8ff29c807a5dc57b70ce9b5efde30f (patch)
treea77496b48df4a9382900b35a6082d6b753f17cbb /scumm
parent50e2752ba183a5d77a92d5949404079eda63e253 (diff)
downloadscummvm-rg350-a730f7f6df8ff29c807a5dc57b70ce9b5efde30f.tar.gz
scummvm-rg350-a730f7f6df8ff29c807a5dc57b70ce9b5efde30f.tar.bz2
scummvm-rg350-a730f7f6df8ff29c807a5dc57b70ce9b5efde30f.zip
more cleanup
svn-id: r5752
Diffstat (limited to 'scumm')
-rw-r--r--scumm/script_v1.cpp10
-rw-r--r--scumm/script_v2.cpp10
-rw-r--r--scumm/scumm.h2
-rw-r--r--scumm/string.cpp20
-rw-r--r--scumm/verbs.cpp6
-rw-r--r--scumm/verbs.h5
6 files changed, 29 insertions, 24 deletions
diff --git a/scumm/script_v1.cpp b/scumm/script_v1.cpp
index 6a6146d9cb..d39f963121 100644
--- a/scumm/script_v1.cpp
+++ b/scumm/script_v1.cpp
@@ -2155,14 +2155,14 @@ void Scumm::o5_verbOps()
a = getVarOrDirectWord(0x80);
if (slot) {
setVerbObject(_roomResource, a, slot);
- vs->type = 1;
+ vs->type = kImageVerbType;
}
break;
case 2: /* load from code */
loadPtrToResource(rtVerb, slot, NULL);
if (slot == 0)
nukeResource(rtVerb, slot);
- vs->type = 0;
+ vs->type = kTextVerbType;
vs->imgindex = 0;
break;
case 3: /* color */
@@ -2224,7 +2224,7 @@ void Scumm::o5_verbOps()
vs->color = 2;
vs->hicolor = 0;
vs->dimcolor = 8;
- vs->type = 0;
+ vs->type = kTextVerbType;
vs->charset_nr = _string[0].t_charset;
vs->curmode = 0;
vs->saveid = 0;
@@ -2254,7 +2254,7 @@ void Scumm::o5_verbOps()
}
if (slot == 0)
nukeResource(rtVerb, slot);
- vs->type = 0;
+ vs->type = kTextVerbType;
vs->imgindex = 0;
break;
case 22: /* assign object */
@@ -2262,7 +2262,7 @@ void Scumm::o5_verbOps()
b = getVarOrDirectByte(0x40);
if (slot && vs->imgindex != a) {
setVerbObject(b, a, slot);
- vs->type = 1;
+ vs->type = kImageVerbType;
vs->imgindex = a;
}
break;
diff --git a/scumm/script_v2.cpp b/scumm/script_v2.cpp
index 9f53e85386..40647f7527 100644
--- a/scumm/script_v2.cpp
+++ b/scumm/script_v2.cpp
@@ -1784,12 +1784,12 @@ void Scumm::o6_verbOps()
a = pop();
if (_curVerbSlot) {
setVerbObject(_roomResource, a, slot);
- vs->type = 1;
+ vs->type = kImageVerbType;
}
break;
case 125:
loadPtrToResource(rtVerb, slot, NULL);
- vs->type = 0;
+ vs->type = kTextVerbType;
vs->imgindex = 0;
break;
case 126:
@@ -1827,7 +1827,7 @@ void Scumm::o6_verbOps()
vs->color = 2;
vs->hicolor = 0;
vs->dimcolor = 8;
- vs->type = 0;
+ vs->type = kTextVerbType;
vs->charset_nr = _string[0].t_charset;
vs->curmode = 0;
vs->saveid = 0;
@@ -1855,7 +1855,7 @@ void Scumm::o6_verbOps()
ptr = getStringAddress(a);
}
loadPtrToResource(rtVerb, slot, ptr);
- vs->type = 0;
+ vs->type = kTextVerbType;
vs->imgindex = 0;
break;
case 139:
@@ -1863,7 +1863,7 @@ void Scumm::o6_verbOps()
a = pop();
if (slot && a != vs->imgindex) {
setVerbObject(b, a, slot);
- vs->type = 1;
+ vs->type = kImageVerbType;
vs->imgindex = a;
}
break;
diff --git a/scumm/scumm.h b/scumm/scumm.h
index 620e398f78..50247319ce 100644
--- a/scumm/scumm.h
+++ b/scumm/scumm.h
@@ -174,7 +174,7 @@ struct CharsetRenderer {
Scumm *_vm;
int _top;
int _drawTop;
- int _left, _left2;
+ int _left, _startLeft;
byte _center;
int _right;
byte _color;
diff --git a/scumm/string.cpp b/scumm/string.cpp
index 89dd4b9721..e98b067717 100644
--- a/scumm/string.cpp
+++ b/scumm/string.cpp
@@ -242,7 +242,7 @@ void Scumm::CHARSET_1()
charset._top = _string[0].ypos;
charset._left = _string[0].xpos;
- charset._left2 = _string[0].xpos;
+ charset._startLeft = _string[0].xpos;
charset._curId = _string[0].charset;
if (a && a->charset)
@@ -475,7 +475,7 @@ void Scumm::description()
charset._top = _string[0].ypos;
charset._left = _string[0].xpos;
- charset._left2 = _string[0].xpos;
+ charset._startLeft = _string[0].xpos;
charset._right = _realWidth - 1;
charset._xpos2 = _string[0].xpos;
charset._ypos2 = _string[0].ypos;
@@ -523,7 +523,7 @@ void Scumm::drawDescString(byte *msg)
charset._bufPos = 0;
charset._top = _string[0].ypos;
charset._left = _string[0].xpos;
- charset._left2 = _string[0].xpos;
+ charset._startLeft = _string[0].xpos;
charset._right = _realWidth - 1;
charset._xpos2 = _string[0].xpos;
charset._ypos2 = _string[0].ypos;
@@ -568,13 +568,13 @@ void Scumm::drawString(int a)
byte buf[256];
byte *charsetptr, *space;
int i;
- byte byte1 = 0, chr;
+ byte fontHeight = 0, chr;
uint color;
_msgPtrToAdd = buf;
_messagePtr = addMessageToStack(_messagePtr);
- charset._left2 = charset._left = _string[a].xpos;
+ charset._startLeft = charset._left = _string[a].xpos;
charset._top = _string[a].ypos;
charset._curId = _string[a].charset;
charset._center = _string[a].center;
@@ -595,7 +595,7 @@ void Scumm::drawString(int a)
else
charset._colorMap[i] = _charsetData[charset._curId][i];
- byte1 = charsetptr[1];
+ fontHeight = charsetptr[1];
}
_msgPtrToAdd = buf;
@@ -648,11 +648,11 @@ void Scumm::drawString(int a)
case 1:
case 8:
if (charset._center) {
- charset._left = charset._left2 - charset.getStringWidth(a, buf, i); // FIXME - shouldn't this be getStringWidth() / 2 ?!?
+ charset._left = charset._startLeft - charset.getStringWidth(a, buf, i);
} else {
- charset._left = charset._left2;
+ charset._left = charset._startLeft;
}
- charset._top += byte1;
+ charset._top += fontHeight;
break;
case 12:
color = buf[i] + (buf[i + 1] << 8);
@@ -872,7 +872,7 @@ void Scumm::initCharset(int charsetno)
_string[0].t_charset = charsetno;
_string[1].t_charset = charsetno;
- for (i = 0; i < 0x10; i++)
+ for (i = 0; i < 16; i++)
if (_features & GF_SMALL_HEADER)
charset._colorMap[i] = _charsetData[charset._curId][i - 12]; // FIXME - do we really want to access index -12 to -9 ?
else
diff --git a/scumm/verbs.cpp b/scumm/verbs.cpp
index b00f57b707..7d75677ac1 100644
--- a/scumm/verbs.cpp
+++ b/scumm/verbs.cpp
@@ -82,12 +82,12 @@ void Scumm::verbMouseOver(int verb)
if (_verbMouseOver == verb)
return;
- if (_verbs[_verbMouseOver].type != 1) {
+ if (_verbs[_verbMouseOver].type != kImageVerbType) {
drawVerb(_verbMouseOver, 0);
_verbMouseOver = verb;
}
- if (_verbs[verb].type != 1 && _verbs[verb].hicolor) {
+ if (_verbs[verb].type != kImageVerbType && _verbs[verb].hicolor) {
drawVerb(verb, 1);
_verbMouseOver = verb;
}
@@ -126,7 +126,7 @@ void Scumm::drawVerb(int vrb, int mode)
vs = &_verbs[vrb];
if (!vs->saveid && vs->curmode && vs->verbid) {
- if (vs->type == 1) {
+ if (vs->type == kImageVerbType) {
drawVerbBitmap(vrb, vs->x, vs->y);
return;
}
diff --git a/scumm/verbs.h b/scumm/verbs.h
index 50570ffd73..3fadefca61 100644
--- a/scumm/verbs.h
+++ b/scumm/verbs.h
@@ -23,6 +23,11 @@
#include "scummsys.h"
+enum {
+ kTextVerbType = 0,
+ kImageVerbType = 1
+};
+
struct VerbSlot {
int16 x, y;
int16 right, bottom;