[Scummvm-cvs-logs] CVS: scummvm actor.cpp,1.35,1.36 boxes.cpp,1.16,1.17 scummvm.cpp,1.74,1.75
Vincent Hamm
yazoo at users.sourceforge.net
Mon Mar 11 00:35:02 CET 2002
Update of /cvsroot/scummvm/scummvm
In directory usw-pr-cvs1:/tmp/cvs-serv10027
Modified Files:
actor.cpp boxes.cpp scummvm.cpp
Log Message:
Fixed boxes in Zak and Indy. Bugs may remain.
Index: actor.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/actor.cpp,v
retrieving revision 1.35
retrieving revision 1.36
diff -C2 -d -r1.35 -r1.36
*** actor.cpp 10 Mar 2002 17:33:02 -0000 1.35
--- actor.cpp 11 Mar 2002 08:34:12 -0000 1.36
***************
*** 467,472 ****
--- 467,478 ----
uint best;
int box, iterations = 0; /* Use inerations for those odd times we get stuck in the loop */
+ int firstValidBox,j;
byte flags, b;
+ if(_features & GF_OLD256)
+ firstValidBox=0;
+ else
+ firstValidBox=1;
+
abr.x = x;
abr.y = y;
***************
*** 487,509 ****
if(((_features & GF_SMALL_HEADER) && box) || !(_features & GF_SMALL_HEADER))
! do {
! flags = getBoxFlags(box);
if (flags&0x80 && (!(flags&0x20) || getClass(a->number, 0x1F)) )
continue;
! if (pathfrom && !getPathToDestBox(pathfrom, box))
continue;
! if (!inBoxQuickReject(box, x, y, threshold))
continue;
! if (checkXYInBoxBounds(box, x, y)) {
abr.x = x;
abr.y = y;
! abr.dist = box;
return abr;
}
! tmp = getClosestPtOnBox(box, x, y);
if (tmp.dist >= best)
--- 493,515 ----
if(((_features & GF_SMALL_HEADER) && box) || !(_features & GF_SMALL_HEADER))
! for (j=box;j>=firstValidBox;j--) {
! flags = getBoxFlags(j);
if (flags&0x80 && (!(flags&0x20) || getClass(a->number, 0x1F)) )
continue;
! if (pathfrom && (getPathToDestBox(pathfrom, j)==-1))
continue;
! if (!inBoxQuickReject(j, x, y, threshold))
continue;
! if (checkXYInBoxBounds(j, x, y)) {
abr.x = x;
abr.y = y;
! abr.dist = j;
return abr;
}
! tmp = getClosestPtOnBox(j, x, y);
if (tmp.dist >= best)
***************
*** 514,523 ****
if (tmp.dist==0) {
! abr.dist = box;
return abr;
}
best = tmp.dist;
! b = box;
! } while (--box);
if (threshold==0 || threshold * threshold >= best) {
--- 520,529 ----
if (tmp.dist==0) {
! abr.dist = j;
return abr;
}
best = tmp.dist;
! b = j;
! }
if (threshold==0 || threshold * threshold >= best) {
***************
*** 743,747 ****
}
j = getPathToDestBox(a->walkbox,a->walkdata.destbox);
! if (j==0) {
error("walkActor: no path found between %d and %d", a->walkbox, a->walkdata.destbox);
}
--- 749,753 ----
}
j = getPathToDestBox(a->walkbox,a->walkdata.destbox);
! if (j==-1) {
error("walkActor: no path found between %d and %d", a->walkbox, a->walkdata.destbox);
}
***************
*** 758,762 ****
do {
a->moving&=~1;
! if (!a->walkbox) {
setActorBox(a, a->walkdata.destbox);
a->walkdata.curbox = a->walkdata.destbox;
--- 764,768 ----
do {
a->moving&=~1;
! if ((!a->walkbox && (!(_features & GF_OLD256))) || a->walkbox !=-1 ) {
setActorBox(a, a->walkdata.destbox);
a->walkdata.curbox = a->walkdata.destbox;
***************
*** 766,770 ****
break;
j = getPathToDestBox(a->walkbox,a->walkdata.destbox);
! if (j==0) {
a->walkdata.destbox = a->walkbox;
a->moving |= 8;
--- 772,776 ----
break;
j = getPathToDestBox(a->walkbox,a->walkdata.destbox);
! if (j==-1) {
a->walkdata.destbox = a->walkbox;
a->moving |= 8;
Index: boxes.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/boxes.cpp,v
retrieving revision 1.16
retrieving revision 1.17
diff -C2 -d -r1.16 -r1.17
*** boxes.cpp 8 Mar 2002 17:04:16 -0000 1.16
--- boxes.cpp 11 Mar 2002 08:34:12 -0000 1.17
***************
*** 60,64 ****
BoxCoords box;
! if (b==0)
return 0;
--- 60,64 ----
BoxCoords box;
! if (b==0 && (!(_features & GF_OLD256)))
return 0;
***************
*** 327,331 ****
boxm+=3;
}
! return 0;
}
--- 327,331 ----
boxm+=3;
}
! return -1;
}
Index: scummvm.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scummvm.cpp,v
retrieving revision 1.74
retrieving revision 1.75
diff -C2 -d -r1.74 -r1.75
*** scummvm.cpp 10 Mar 2002 17:33:03 -0000 1.74
--- scummvm.cpp 11 Mar 2002 08:34:12 -0000 1.75
***************
*** 809,815 ****
size = getResourceDataSize(ptr-size-6) - size;
! if (_features & GF_OLD256) { // FIXME: Total hack.
! createBoxMatrix(); // This function shouldn't
! } else if(size>=0) { // do this :)
createResource(rtMatrix, 1, size);
memcpy(getResourceAddress(rtMatrix, 1), ptr, size);
--- 809,813 ----
size = getResourceDataSize(ptr-size-6) - size;
! if(size>=0) { // do this :)
createResource(rtMatrix, 1, size);
memcpy(getResourceAddress(rtMatrix, 1), ptr, size);
More information about the Scummvm-git-logs
mailing list