[Scummvm-cvs-logs] SF.net SVN: scummvm: [23147] scummvm/branches/branch-0-9-0/engines/scumm/he
kirben at users.sourceforge.net
kirben at users.sourceforge.net
Fri Jun 16 15:16:19 CEST 2006
Revision: 23147
Author: kirben
Date: 2006-06-16 06:16:11 -0700 (Fri, 16 Jun 2006)
ViewCVS: http://svn.sourceforge.net/scummvm/?rev=23147&view=rev
Log Message:
-----------
Fix rects in HE games, when positions are set by scripts
Modified Paths:
--------------
scummvm/branches/branch-0-9-0/engines/scumm/he/intern_he.h
scummvm/branches/branch-0-9-0/engines/scumm/he/script_v100he.cpp
scummvm/branches/branch-0-9-0/engines/scumm/he/script_v70he.cpp
scummvm/branches/branch-0-9-0/engines/scumm/he/script_v72he.cpp
scummvm/branches/branch-0-9-0/engines/scumm/he/script_v90he.cpp
scummvm/branches/branch-0-9-0/engines/scumm/he/sprite_he.cpp
Modified: scummvm/branches/branch-0-9-0/engines/scumm/he/intern_he.h
===================================================================
--- scummvm/branches/branch-0-9-0/engines/scumm/he/intern_he.h 2006-06-16 13:14:55 UTC (rev 23146)
+++ scummvm/branches/branch-0-9-0/engines/scumm/he/intern_he.h 2006-06-16 13:16:11 UTC (rev 23147)
@@ -158,6 +158,7 @@
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();
Modified: scummvm/branches/branch-0-9-0/engines/scumm/he/script_v100he.cpp
===================================================================
--- scummvm/branches/branch-0-9-0/engines/scumm/he/script_v100he.cpp 2006-06-16 13:14:55 UTC (rev 23146)
+++ scummvm/branches/branch-0-9-0/engines/scumm/he/script_v100he.cpp 2006-06-16 13:16:11 UTC (rev 23147)
@@ -427,6 +427,7 @@
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 @@
_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 @@
_wizParams.box.top = pop();
_wizParams.box.left = pop();
_wizParams.compType = pop();
+ adjustRect(_wizParams.box);
break;
case 18:
_wizParams.processFlags |= kWPFClipBox;
Modified: scummvm/branches/branch-0-9-0/engines/scumm/he/script_v70he.cpp
===================================================================
--- scummvm/branches/branch-0-9-0/engines/scumm/he/script_v70he.cpp 2006-06-16 13:14:55 UTC (rev 23146)
+++ scummvm/branches/branch-0-9-0/engines/scumm/he/script_v70he.cpp 2006-06-16 13:16:11 UTC (rev 23147)
@@ -425,6 +425,15 @@
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 @@
_wiz->_rectOverride.top = args[2];
_wiz->_rectOverride.right = args[3];
_wiz->_rectOverride.bottom = args[4];
+ adjustRect(_wiz->_rectOverride);
break;
case 43:
_wiz->_rectOverrideEnabled = false;
Modified: scummvm/branches/branch-0-9-0/engines/scumm/he/script_v72he.cpp
===================================================================
--- scummvm/branches/branch-0-9-0/engines/scumm/he/script_v72he.cpp 2006-06-16 13:14:55 UTC (rev 23146)
+++ scummvm/branches/branch-0-9-0/engines/scumm/he/script_v72he.cpp 2006-06-16 13:16:11 UTC (rev 23147)
@@ -1111,12 +1111,14 @@
_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();
Modified: scummvm/branches/branch-0-9-0/engines/scumm/he/script_v90he.cpp
===================================================================
--- scummvm/branches/branch-0-9-0/engines/scumm/he/script_v90he.cpp 2006-06-16 13:14:55 UTC (rev 23146)
+++ scummvm/branches/branch-0-9-0/engines/scumm/he/script_v90he.cpp 2006-06-16 13:16:11 UTC (rev 23147)
@@ -636,11 +636,12 @@
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 @@
_wiz->_rectOverride.top = args[2];
_wiz->_rectOverride.right = args[3];
_wiz->_rectOverride.bottom = args[4];
+ adjustRect(_wiz->_rectOverride);
break;
case 43:
_wiz->_rectOverrideEnabled = false;
Modified: scummvm/branches/branch-0-9-0/engines/scumm/he/sprite_he.cpp
===================================================================
--- scummvm/branches/branch-0-9-0/engines/scumm/he/sprite_he.cpp 2006-06-16 13:14:55 UTC (rev 23146)
+++ scummvm/branches/branch-0-9-0/engines/scumm/he/sprite_he.cpp 2006-06-16 13:16:11 UTC (rev 23147)
@@ -927,6 +927,7 @@
_spriteGroups[spriteGroupId].bbox.top = y1;
_spriteGroups[spriteGroupId].bbox.right = x2;
_spriteGroups[spriteGroupId].bbox.bottom = y2;
+ _vm->adjustRect(_spriteGroups[spriteGroupId].bbox);
redrawSpriteGroup(spriteGroupId);
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
More information about the Scummvm-git-logs
mailing list