aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorTravis Howell2006-06-16 13:14:55 +0000
committerTravis Howell2006-06-16 13:14:55 +0000
commit40bfc71de8102c0391f08ddb5de6009d924f07f7 (patch)
tree0177ee3a2863dd1e9402933dc2899baa152bc852 /engines
parentf4d7226334bb09683e932df58ae80eddc1c11528 (diff)
downloadscummvm-rg350-40bfc71de8102c0391f08ddb5de6009d924f07f7.tar.gz
scummvm-rg350-40bfc71de8102c0391f08ddb5de6009d924f07f7.tar.bz2
scummvm-rg350-40bfc71de8102c0391f08ddb5de6009d924f07f7.zip
Fix rects in HE games, when positions are set by scripts
svn-id: r23146
Diffstat (limited to 'engines')
-rw-r--r--engines/scumm/he/intern_he.h1
-rw-r--r--engines/scumm/he/script_v100he.cpp3
-rw-r--r--engines/scumm/he/script_v70he.cpp10
-rw-r--r--engines/scumm/he/script_v72he.cpp2
-rw-r--r--engines/scumm/he/script_v90he.cpp6
-rw-r--r--engines/scumm/he/sprite_he.cpp1
6 files changed, 21 insertions, 2 deletions
diff --git a/engines/scumm/he/intern_he.h b/engines/scumm/he/intern_he.h
index a58271d636..377a87c9aa 100644
--- a/engines/scumm/he/intern_he.h
+++ b/engines/scumm/he/intern_he.h
@@ -158,6 +158,7 @@ protected:
int getStringCharWidth(byte chr);
virtual int setupStringArray(int size);
void appendSubstring(int dst, int src, int len2, int len);
+ void adjustRect(Common::Rect &rect);
virtual void setCursorFromImg(uint img, uint room, uint imgindex);
virtual void setDefaultCursor();
diff --git a/engines/scumm/he/script_v100he.cpp b/engines/scumm/he/script_v100he.cpp
index 4dc2f1842f..b7191a90ec 100644
--- a/engines/scumm/he/script_v100he.cpp
+++ b/engines/scumm/he/script_v100he.cpp
@@ -427,6 +427,7 @@ void ScummEngine_v100he::o100_actorOps() {
a->_clipOverride.right = pop();
a->_clipOverride.top = pop();
a->_clipOverride.left = pop();
+ adjustRect(a->_clipOverride);
break;
case 22:
k = getStackList(args, ARRAYSIZE(args));
@@ -508,6 +509,7 @@ void ScummEngine_v100he::o100_actorOps() {
_actorClipOverride.right = pop();
_actorClipOverride.top = pop();
_actorClipOverride.left = pop();
+ adjustRect(_actorClipOverride);
break;
case 130: // SO_SOUND
k = getStackList(args, ARRAYSIZE(args));
@@ -1198,6 +1200,7 @@ void ScummEngine_v100he::o100_wizImageOps() {
_wizParams.box.top = pop();
_wizParams.box.left = pop();
_wizParams.compType = pop();
+ adjustRect(_wizParams.box);
break;
case 18:
_wizParams.processFlags |= kWPFClipBox;
diff --git a/engines/scumm/he/script_v70he.cpp b/engines/scumm/he/script_v70he.cpp
index bbbc218fde..71a43c1a42 100644
--- a/engines/scumm/he/script_v70he.cpp
+++ b/engines/scumm/he/script_v70he.cpp
@@ -425,6 +425,15 @@ void ScummEngine_v70he::appendSubstring(int dst, int src, int srcOffs, int len)
writeArray(0, 0, dstOffs + i, 0);
}
+void ScummEngine_v70he::adjustRect(Common::Rect &rect) {
+ // Scripts can set all rect positions to -1
+ if (rect.right != -1)
+ rect.right += 1;
+
+ if (rect.bottom != -1)
+ rect.bottom += 1;
+}
+
void ScummEngine_v70he::o70_startSound() {
int var, value;
@@ -803,6 +812,7 @@ void ScummEngine_v70he::o70_kernelSetFunctions() {
_wiz->_rectOverride.top = args[2];
_wiz->_rectOverride.right = args[3];
_wiz->_rectOverride.bottom = args[4];
+ adjustRect(_wiz->_rectOverride);
break;
case 43:
_wiz->_rectOverrideEnabled = false;
diff --git a/engines/scumm/he/script_v72he.cpp b/engines/scumm/he/script_v72he.cpp
index fe91e82ccd..1e7386556f 100644
--- a/engines/scumm/he/script_v72he.cpp
+++ b/engines/scumm/he/script_v72he.cpp
@@ -1111,12 +1111,14 @@ void ScummEngine_v72he::o72_actorOps() {
_actorClipOverride.right = pop();
_actorClipOverride.top = pop();
_actorClipOverride.left = pop();
+ adjustRect(_actorClipOverride);
break;
case 67: // HE 99+
a->_clipOverride.bottom = pop();
a->_clipOverride.right = pop();
a->_clipOverride.top = pop();
a->_clipOverride.left = pop();
+ adjustRect(a->_clipOverride);
break;
case 65: // HE 98+
j = pop();
diff --git a/engines/scumm/he/script_v90he.cpp b/engines/scumm/he/script_v90he.cpp
index eae252098d..b911844f22 100644
--- a/engines/scumm/he/script_v90he.cpp
+++ b/engines/scumm/he/script_v90he.cpp
@@ -636,11 +636,12 @@ void ScummEngine_v90he::o90_wizImageOps() {
case 5:
_wizParams.processFlags |= kWPFClipBox | 0x100;
_wizParams.processMode = 2;
- _wizParams.box.bottom = pop() + 1;
- _wizParams.box.right = pop() + 1;
+ _wizParams.box.bottom = pop();
+ _wizParams.box.right = pop();
_wizParams.box.top = pop();
_wizParams.box.left = pop();
_wizParams.compType = pop();
+ adjustRect(_wizParams.box);
break;
case 6:
_wizParams.processFlags |= kWPFNewState;
@@ -2613,6 +2614,7 @@ void ScummEngine_v90he::o90_kernelSetFunctions() {
_wiz->_rectOverride.top = args[2];
_wiz->_rectOverride.right = args[3];
_wiz->_rectOverride.bottom = args[4];
+ adjustRect(_wiz->_rectOverride);
break;
case 43:
_wiz->_rectOverrideEnabled = false;
diff --git a/engines/scumm/he/sprite_he.cpp b/engines/scumm/he/sprite_he.cpp
index 8f17a89215..6983dc147a 100644
--- a/engines/scumm/he/sprite_he.cpp
+++ b/engines/scumm/he/sprite_he.cpp
@@ -927,6 +927,7 @@ void Sprite::setGroupBounds(int spriteGroupId, int x1, int y1, int x2, int y2) {
_spriteGroups[spriteGroupId].bbox.top = y1;
_spriteGroups[spriteGroupId].bbox.right = x2;
_spriteGroups[spriteGroupId].bbox.bottom = y2;
+ _vm->adjustRect(_spriteGroups[spriteGroupId].bbox);
redrawSpriteGroup(spriteGroupId);
}