more cleanup

svn-id: r5752
This commit is contained in:
Max Horn 2002-11-29 18:27:35 +00:00
parent 50e2752ba1
commit a730f7f6df
6 changed files with 29 additions and 24 deletions

View File

@ -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;

View File

@ -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;

View File

@ -174,7 +174,7 @@ struct CharsetRenderer {
Scumm *_vm;
int _top;
int _drawTop;
int _left, _left2;
int _left, _startLeft;
byte _center;
int _right;
byte _color;

View File

@ -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

View File

@ -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;
}

View File

@ -23,6 +23,11 @@
#include "scummsys.h"
enum {
kTextVerbType = 0,
kImageVerbType = 1
};
struct VerbSlot {
int16 x, y;
int16 right, bottom;