[Scummvm-cvs-logs] CVS: scummvm actor.cpp,1.37,1.38 boxes.cpp,1.18,1.19 costume.cpp,1.18,1.19 resource.cpp,1.55,1.56 script_v1.cpp,1.53,1.54 scumm.h,1.89,1.90

Vincent Hamm yazoo at users.sourceforge.net
Mon Mar 18 14:49:24 CET 2002


Update of /cvsroot/scummvm/scummvm
In directory usw-pr-cvs1:/tmp/cvs-serv807

Modified Files:
	actor.cpp boxes.cpp costume.cpp resource.cpp script_v1.cpp 
	scumm.h 
Log Message:
Fixed boxes but 1 bug remain. Broke a little indy3 while fixing object flags

Index: actor.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/actor.cpp,v
retrieving revision 1.37
retrieving revision 1.38
diff -C2 -d -r1.37 -r1.38
*** actor.cpp	11 Mar 2002 13:15:06 -0000	1.37
--- actor.cpp	18 Mar 2002 22:48:57 -0000	1.38
***************
*** 647,650 ****
--- 647,653 ----
  		a = derefActor(i);
  		if (a->room==_currentRoom)
+ 		if(_features & GF_OLD256)
+ 			walkActorOld(a);
+ 		else
  			walkActor(a);
  	}
***************
*** 754,757 ****
--- 757,761 ----
  
  	a->walkdata.curbox = j;
+ 	
  	if (findPathTowards(a, a->walkbox, j, a->walkdata.destbox)) {
  		a->moving |= 8;
***************
*** 778,785 ****
  		}
  		a->walkdata.curbox = j;
! 		if (findPathTowards(a, a->walkbox, j, a->walkdata.destbox))
! 			break;
! 		if (calcMovementFactor(a, _foundPathX, _foundPathY))
! 			return;
  
  		setActorBox(a, a->walkdata.curbox);
--- 782,812 ----
  		}
  		a->walkdata.curbox = j;
! 		if(_features & GF_OLD256)
! 		{
! 			findPathTowardsOld(a, a->walkbox, j, a->walkdata.destbox);
! 		        if (p[2].x == 32000 && p[3].x == 32000)
! 			{
! 				a->moving |= 8;
! 				calcMovementFactor(a, a->walkdata.destx, a->walkdata.desty);
! 				return;
! 			}
! 		
! 			if (p[2].x != 32000) {
! 				if (calcMovementFactor(a, p[2].x, p[2].y)){
! 					a->walkdata.destx = p[3].x;
! 					a->walkdata.desty = p[3].y;
! 					return;													
! 				}
! 			}
! 
! 			if (calcMovementFactor(a, p[3].x, p[3].y))
! 				return;
! 			
! 		} else {
! 			if (findPathTowards(a, a->walkbox, j, a->walkdata.destbox))
! 				break;
! 			if (calcMovementFactor(a, _foundPathX, _foundPathY))
! 				return;
! 		}
  
  		setActorBox(a, a->walkdata.curbox);
***************
*** 1079,1082 ****
--- 1106,1111 ----
  	a->walkdata.destdir = dir;
  	a->moving = (a->moving&2)|1;
+ 	a->walkdata.point3x = 32000;
+ 	
  	a->walkdata.curbox = a->walkbox;
  }
***************
*** 1180,1182 ****
--- 1209,1317 ----
  		curpal+=3;
  	} while (--num);
+ }
+ 
+ void Scumm::walkActorOld(Actor *a) {
+ 	int new_dir,next_box,goto_x,goto_y;
+ 
+ 	if(!a->moving)
+ 		return;
+ 
+ 	if(a->moving&1)
+ 	{
+ restart:
+ 		a->moving &= ~1;
+ 
+ 		if (a->walkbox==0xFF)
+ 		{
+ 			a->walkbox = a->walkdata.destbox;
+ 			a->walkdata.curbox = a->walkdata.destbox;
+ 			a->moving |=8;
+ 			calcMovementFactor(a, a->walkdata.destx, a->walkdata.desty);
+ 			return;
+ 		}
+ 
+ 		if (a->walkbox==a->walkdata.destbox)
+ 		{
+ 			a->moving |=8;
+ 			calcMovementFactor(a, a->walkdata.destx, a->walkdata.desty);
+ 			return;
+ 		}
+ 
+ 		next_box = getPathToDestBox(a->walkbox,a->walkdata.destbox);
+ 
+ 		if( next_box == -1)
+ 		{
+ 			a->moving |=8;
+ 			return;
+ 		}
+ 
+ 		a->walkdata.curbox = next_box;
+ 
+ 		findPathTowardsOld(a, a->walkbox, next_box, a->walkdata.destbox);
+ 		if(p[2].x == 32000 && p[3].x == 32000)
+ 		{
+ 			a->moving |=8;
+ 			calcMovementFactor(a, a->walkdata.destx, a->walkdata.desty);
+ 			return;
+ 		}
+ 
+ 		if(p[2].x != 32000)
+ 		{
+ 			if(calcMovementFactor(a, p[2].x, p[2].y))
+ 			{
+ 				actor->walkdata.point3x=p[3].x;
+ 				actor->walkdata.point3y=p[3].y;
+ 				return;
+ 			}
+ 		}
+ 
+ 		if(calcMovementFactor(a,p[3].x,p[3].y))
+ 			return;
+ 		
+ 		a->walkbox = a->walkdata.destbox;
+ 		a->mask = getMaskFromBox(a->walkbox);
+ 		goto restart;
+ 
+ 	}
+ 
+ 	if(a->moving & 2)
+ 	{
+ 		if(actorWalkStep(a))
+ 			return;
+ 	}
+ 
+ 	if(a->moving & 8)
+ 	{
+ 		a->moving = 0;
+ 		startWalkAnim(a, 3, a->walkdata.destdir);
+ 		return;
+ 	}
+ 
+ 	if(a->moving & 4)
+ 	{
+ 		new_dir = updateActorDirection(a);
+ 		if (a->facing != new_dir)
+ 		{
+ 			fixActorDirection(a,new_dir);
+ 			return;
+ 		}
+ 		a->moving=0;
+ 		return;
+ 	}
+ 
+ 	if(a->walkdata.point3x != 32000)
+ 	{
+ 		if(calcMovementFactor(a,a->walkdata.point3x,a->walkdata.point3y))
+ 		{
+ 			a->walkdata.point3x=32000;
+ 			return;
+ 		}
+ 		a->walkdata.point3x=32000;
+ 	}
+ 
+ 	a->walkbox = a->walkdata.curbox;
+ 	a->mask = getMaskFromBox(a->walkbox);
+ 	a->moving &= 2;
+ 	a->moving |= 1;
+ goto restart;
  }

Index: boxes.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/boxes.cpp,v
retrieving revision 1.18
retrieving revision 1.19
diff -C2 -d -r1.18 -r1.19
*** boxes.cpp	11 Mar 2002 13:15:06 -0000	1.18
--- boxes.cpp	18 Mar 2002 22:48:57 -0000	1.19
***************
*** 22,25 ****
--- 22,26 ----
  #include "stdafx.h"
  #include "scumm.h"
+ #include "math.h"
  
  byte Scumm::getMaskFromBox(int box) {
***************
*** 122,129 ****
  	box->ur.x = (int16)FROM_LE_16(bp->urx);
  	box->ur.y = (int16)FROM_LE_16(bp->ury);
! 	box->ll.x = (int16)FROM_LE_16(bp->llx);
! 	box->ll.y = (int16)FROM_LE_16(bp->lly);
! 	box->lr.x = (int16)FROM_LE_16(bp->lrx);
! 	box->lr.y = (int16)FROM_LE_16(bp->lry);
  }
  
--- 123,142 ----
  	box->ur.x = (int16)FROM_LE_16(bp->urx);
  	box->ur.y = (int16)FROM_LE_16(bp->ury);
! 
! 	if(_features & GF_OLD256)
! 	{
! 		box->ll.x = (int16)FROM_LE_16(bp->lrx);
! 		box->ll.y = (int16)FROM_LE_16(bp->lry);
! 		box->lr.x = (int16)FROM_LE_16(bp->llx);
! 		box->lr.y = (int16)FROM_LE_16(bp->lly);
! 	}
! 	else
! 	{
! 		box->ll.x = (int16)FROM_LE_16(bp->llx);
! 		box->ll.y = (int16)FROM_LE_16(bp->lly);
! 		box->lr.x = (int16)FROM_LE_16(bp->lrx);
! 		box->lr.y = (int16)FROM_LE_16(bp->lry);
! 	}
! 	
  }
  
***************
*** 466,471 ****
  		box2.lr = tmp;
  	}
- 	warning("findPathTowards: default"); // FIXME: ZAK256
- 	findPathTowardsOld(a, box1nr, box2nr, box3nr);
  	return 0;
  }
--- 479,482 ----
***************
*** 805,952 ****
  	_boxMatrixPtr4 = getResourceAddress(rtMatrix, 4);
  	_boxPathVertexHeapIndex = 0;
  	return (PathVertex*)addToBoxVertexHeap(sizeof(PathVertex));
  }
  
! int Scumm::findPathTowardsOld(Actor *a, byte box1nr, byte box2nr, byte box3nr) {
!         BoxCoords box1;
!         BoxCoords box2;
!         ScummPoint tmp;
!         int i,j;
!         int flag;
!         int q,pos;
! 	int threshold=1;
  
!         getBoxCoordinates(box1nr,&box1);
!         getBoxCoordinates(box2nr,&box2);
  
! 	do{
!         for(i=0; i<4; i++) {
!                 for(j=0; j<4; j++) {
!                         if (abs(box1.ul.x-box1.ur.x)<threshold &&
!                                         abs(box1.ul.x-box2.ul.x)<threshold &&
!                                         abs(box1.ul.x-box2.ur.x)<threshold ) {
!                                 flag = 0;
!                                 if (box1.ul.y > box1.ur.y) {
!                                         SWAP(box1.ul.y, box1.ur.y);
!                                         flag |= 1;
!                                 }
  
!                                 if (box2.ul.y > box2.ur.y) {
!                                         SWAP(box2.ul.y, box2.ur.y);
!                                         flag |= 2;
!                                 }
  
!                                 if (box1.ul.y > box2.ur.y || box2.ul.y > box1.ur.y ||
!                                                 (box1.ur.y==box2.ul.y || box2.ur.y==box1.ul.y) &&
!                                                 box1.ul.y!=box1.ur.y && box2.ul.y!=box2.ur.y) {
!                                         if (flag&1)
!                                                 SWAP(box1.ul.y, box1.ur.y);
!                                         if (flag&2)
!                                                 SWAP(box2.ul.y, box2.ur.y);
!                                 } else {
!                                         if (box2nr == box3nr) {
!                                                 int diffX = a->walkdata.destx - a->x;
!                                                 int diffY = a->walkdata.desty - a->y;
!                                                 int boxDiffX = box1.ul.x - a->x;
  
!                                                 if (diffX!=0) {
!                                                         int t;
  
!                                                         diffY *= boxDiffX;
!                                                         t = diffY / diffX;
!                                                         if (t==0 && (diffY<=0 || diffX<=0) && (diffY>=0 || diffX>=0))
!                                                                 t = -1;
!                                                         pos = a->y + t;
!                                                 } else {
!                                                         pos = a->y;
!                                                 }
!                                         } else {
!                                                 pos = a->y;
!                                         }
  
!                                         q = pos;
!                                         if (q < box2.ul.y)
!                                         q = box2.ul.y;
!                                         if (q > box2.ur.y)
!                                                 q = box2.ur.y;
!                                         if (q < box1.ul.y)
!                                                 q = box1.ul.y;
!                                         if (q > box1.ur.y)
!                                                 q = box1.ur.y;
!                                         if (q==pos && box2nr==box3nr)
!                                                 return 1;
!                                         _foundPathY = q;
!                                         _foundPathX = box1.ul.x;
!                                         return 0;
!                                 }
!                         }
  
!                         if (abs(box1.ul.y-box1.ur.y)<threshold &&
!                                         abs(box1.ul.y-box2.ul.y)<threshold &&
!                                         abs(box1.ul.y-box2.ur.y)<threshold ){
!                                 flag = 0;
!                                 if (box1.ul.x > box1.ur.x) {
!                                         SWAP(box1.ul.x, box1.ur.x);
!                                         flag |= 1;
!                                 }
  
!                                 if (box2.ul.x > box2.ur.x) {
!                                         SWAP(box2.ul.x, box2.ur.x);
!                                         flag |= 2;
!                                 }
  
-                                 if (box1.ul.x > box2.ur.x || box2.ul.x > box1.ur.x ||
-                                                 (box1.ur.x==box2.ul.x || box2.ur.x==box1.ul.x) &&
-                                                 box1.ul.x!=box1.ur.x && box2.ul.x!=box2.ur.x) {
-                                         if (flag&1)
-                                                 SWAP(box1.ul.x, box1.ur.x);
-                                         if (flag&2)
-                                                 SWAP(box2.ul.x, box2.ur.x);
-                                 } else {
  
!                                         if (box2nr == box3nr) {
!                                                 int diffX = a->walkdata.destx - a->x;
!                                                 int diffY = a->walkdata.desty - a->y;
!                                                 int boxDiffY = box1.ul.y - a->y;
  
!                                                 pos = a->x;
!                                                 if (diffY!=0) {
!                                                         pos += diffX * boxDiffY / diffY;
!                                                 }
!                                         } else {
!                                                 pos = a->x;
!                                         }
  
!                                         q = pos;
!                                         if (q < box2.ul.x)
!                                                 q = box2.ul.x;
!                                         if (q > box2.ur.x)
!                                                 q = box2.ur.x;
!                                         if (q < box1.ul.x)
!                                                 q = box1.ul.x;
!                                         if (q > box1.ur.x)
!                                                 q = box1.ur.x;
!                                         if (q==pos && box2nr==box3nr)
!                                                 return 1;
!                                         _foundPathX = q;
!                                         _foundPathY = box1.ul.y;
!                                         return 0;
!                                 }
!                         }
!                         tmp = box1.ul;
!                         box1.ul = box1.ur;
!                         box1.ur = box1.ll;
!                         box1.ll = box1.lr;
!                         box1.lr = tmp;
                  }
-                 tmp = box2.ul;
-                 box2.ul = box2.ur;
-                 box2.ur = box2.ll;
-                 box2.ll = box2.lr;
-                 box2.lr = tmp;
          }
! 	threshold++;
! 	}while(threshold<10);
!         error("findPathTowardsOld: default"); // FIXME: ZAK256
!         return 0;
  }
--- 816,995 ----
  	_boxMatrixPtr4 = getResourceAddress(rtMatrix, 4);
  	_boxPathVertexHeapIndex = 0;
+ 
  	return (PathVertex*)addToBoxVertexHeap(sizeof(PathVertex));
  }
  
! int Scumm::findPathTowardsOld(Actor *a, byte trap1, byte trap2, byte final_trap)
! {
!         GetGates(trap1,trap2);
! 	ScummPoint pt;
  
!         p[1].x = actor->x;
!         p[1].y = actor->y;
!         p[2].x = 32000;
!         p[3].x = 32000;
!         p[4].x = 32000;
  
!         if (trap2 == final_trap) {                                                              /* next = final box? */
!                 p[4].x = actor->walkdata.destx;
!                 p[4].y = actor->walkdata.desty;
  
!                 if (getMaskFromBox(trap1) == getMaskFromBox(trap2) || 1) {
!                         if (CompareSlope(p[1].x,p[1].y,p[4].x,p[4].y, gate1ax,gate1ay) !=
!                                  CompareSlope(p[1].x,p[1].y,p[4].x,p[4].y, gate1bx,gate1by) &&
!                                  CompareSlope(p[1].x,p[1].y,p[4].x,p[4].y, gate2ax,gate2ay) !=
!                                  CompareSlope(p[1].x,p[1].y,p[4].x,p[4].y, gate2bx,gate2by)) {
!                                 return 0;         /* same zplane and between both gates? */
!                         }
!                 }
!         }
  
!        	pt=closestPtOnLine(gate2ax,gate2ay,gate2bx,gate2by,p[1].x,p[1].y);
!         p[3].x = pt.x;
!         p[3].y = pt.y;
  
!         if (CompareSlope(p[1].x,p[1].y,p[3].x,p[3].y, gate1ax,gate1ay) ==
!                  CompareSlope(p[1].x,p[1].y,p[3].x,p[3].y, gate1bx,gate1by)) {
!                 closestPtOnLine(gate1ax,gate1ay,gate1bx,gate1by,p[1].x,p[1].y);
!                 p[2].x = pt.x;                       /* if point 2 between gates, ignore! */
!                 p[2].y = pt.y;
!         }
  
!         return 0;
! }
  
! void Scumm::GetGates(int trap1,int trap2) {
! int   i;
! int    Closest1,Closest2,Closest3;
! int    Dist[8];
! int Dist1,Dist2,Dist3;
! int Box1,Box2,Box3;
! BoxCoords box;
! int polyx[8];
! int polyy[8];
! AdjustBoxResult pt;
  
!         getBoxCoordinates(trap1,&box);
!         polyx[0] = box.ul.x;
!         polyy[0] = box.ul.y;
!         polyx[1] = box.ur.x;
!         polyy[1] = box.ur.y;
!         polyx[2] = box.ll.x;
!         polyy[2] = box.ll.y;
!         polyx[3] = box.lr.x;
!         polyy[3] = box.lr.y;
!         for (i = 0 ; i < 4 ; i++) { 
! 		pt = getClosestPtOnBox(trap2,polyx[i],polyy[i]);
! 		Dist[i] = pt.dist;
!                 CloX[i] = pt.x;
!                 CloY[i] = pt.y;
!         }
  
!         getBoxCoordinates(trap2,&box);
!         polyx[4] = box.ul.x;
!         polyy[4] = box.ul.y;
!         polyx[5] = box.ur.x;
!         polyy[5] = box.ur.y;
!         polyx[6] = box.ll.x;
!         polyy[6] = box.ll.y;
!         polyx[7] = box.lr.x;
!         polyy[7] = box.lr.y;
!         for (i = 4 ; i < 8 ; i++) {
!                 pt = getClosestPtOnBox(trap1,polyx[i],polyy[i]);
!                 Dist[i] = pt.dist;
!                 CloX[i] = pt.x;
!                 CloY[i] = pt.y;
!         }
  
  
!         Dist1 = 0xFFFF;
!         for (i = 0 ; i < 8 ; i++) {
!                 if (Dist[i] < Dist1) {
!                         Dist1 = Dist[i];
!                         Closest1 = i;
!                 }
!         }
!         Dist[Closest1] = 0xFFFF;
  
!         Dist2 = 0xFFFF;
!         for (i = 0 ; i < 8 ; i++) {
!                 if (Dist[i] < Dist2) {
!                         Dist2 = Dist[i];
!                         Closest2 = i;
!                 }
!         }
!         Dist[Closest2] = 0xFFFF;
  
!         Dist3 = 0xFFFF;
!         for (i = 0 ; i < 8 ; i++) {
!                 if (Dist[i] < Dist3) {
!                         Dist3 = Dist[i];
!                         Closest3 = i;
                  }
          }
! 
!         Box1 = (Closest1 > 3);
!         Box2 = (Closest2 > 3);
!         Box3 = (Closest3 > 3);
! 
!         Dist1 = (int)sqrt(Dist1);
!         Dist2 = (int)sqrt(Dist2);
!         Dist3 = (int)sqrt(Dist3);
!         
! 	if (Box1 == Box2 && abs(Dist1-Dist2) < 4) {
!                 SetGate(Closest1,Closest2,polyx,polyy);
! 
!         } else if (Box1 == Box2 && Dist1 == Dist2) {                            /* parallel */
!                 SetGate(Closest1,Closest2,polyx,polyy);
!         } else if (Box1 == Box3 && Dist1 == Dist3) {                            /* parallel */
!                 SetGate(Closest1,Closest3,polyx,polyy);
!         } else if (Box2 == Box3 && Dist2 == Dist3) {                            /* parallel */
!                 SetGate(Closest2,Closest3,polyx,polyy);
! 
! 
!         } else if (Box1 == Box3 && abs(Dist1-Dist3) < 4) {
!                 SetGate(Closest1,Closest3,polyx,polyy);
!         } else if (abs(Dist1-Dist3) < 4) {  /* if 1 close to 3 then use 2-3 */
!                 SetGate(Closest2,Closest3,polyx,polyy);
!         } else if (abs(Dist1-Dist2) < 4) {
!                 SetGate(Closest1,Closest2,polyx,polyy);
!         } else {
!                 SetGate(Closest1,Closest1,polyx,polyy);
!         }
! }
! 
! int Scumm::CompareSlope(int X1,int Y1,int X2,int Y2,int X3,int Y3)
! {
!         if ((Y2 - Y1) * (X3 - X1) > (Y3 - Y1) * (X2 - X1)) return(0);
!         return(1);
! }
! 
! void Scumm::SetGate(int line1,int line2, int polyx[8], int polyy[8])
! {
! 
!         if (line1 < 4) {                                                                /* from box 1 to box 2 */
!                 gate1ax = polyx[line1];
!                 gate1ay = polyy[line1];
!                 gate2ax = CloX[line1];
!                 gate2ay = CloY[line1];
! 
!         } else {
!                 gate2ax = polyx[line1];
!                 gate2ay = polyy[line1];
!                 gate1ax = CloX[line1];
!                 gate1ay = CloY[line1];
!         }
! 
!         if (line2 < 4) {                                                                /* from box */
!                 gate1bx = polyx[line2];
!                 gate1by = polyy[line2];
!                 gate2bx = CloX[line2];
!                 gate2by = CloY[line2];
! 
!         } else {
!                 gate2bx = polyx[line2];
!                 gate2by = polyy[line2];
!                 gate1bx = CloX[line2];
!                 gate1by = CloY[line2];
!         }
  }

Index: costume.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/costume.cpp,v
retrieving revision 1.18
retrieving revision 1.19
diff -C2 -d -r1.18 -r1.19
*** costume.cpp	5 Mar 2002 23:05:55 -0000	1.18
--- costume.cpp	18 Mar 2002 22:48:57 -0000	1.19
***************
*** 728,733 ****
  
  		if (code != 0x7B) {
! 			if ( !(_vm->_features & GF_OLD256) || code <0x79)
! 				return mainRoutine(a, slot, code);
  		}
  	}
--- 728,733 ----
  
  		if (code != 0x7B) {
! 			if(_vm->_features & GF_OLD256 && code < 0x78)
! 			return mainRoutine(a, slot, code);
  		}
  	}

Index: resource.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/resource.cpp,v
retrieving revision 1.55
retrieving revision 1.56
diff -C2 -d -r1.55 -r1.56
*** resource.cpp	16 Mar 2002 18:58:51 -0000	1.55
--- resource.cpp	18 Mar 2002 22:48:57 -0000	1.56
***************
*** 327,330 ****
--- 327,331 ----
         int numblock = 0;
         int num, i;
+        byte* _oldClass;
  
         debug(9, "readIndexFile()");
***************
*** 421,428 ****
                         assert(num == _numGlobalObjects);
                         for (i=0; i<num; i++) { /* not too sure about all that */
!                                _classData[i] = fileReadByte() + 256*fileReadByte()+ 256*256*fileReadByte();
!                      //          fileReadByte();
!                                _objectOwnerTable[i] = fileReadByte();
!                                _objectStateTable[i] = _objectOwnerTable[i]>>OF_STATE_SHL;
                                 _objectOwnerTable[i] &= OF_OWNER_MASK;
                         }
--- 422,431 ----
                         assert(num == _numGlobalObjects);
                         for (i=0; i<num; i++) { /* not too sure about all that */
! 				_oldClass=(byte*)&_classData[i];			       
! 				_oldClass[0]=fileReadByte();
! 				_oldClass[1]=fileReadByte();
! 				_oldClass[2]=fileReadByte();
! 				_objectOwnerTable[i] = fileReadByte();
!                             //   _objectStateTable[i] = fileReadByte();
                                 _objectOwnerTable[i] &= OF_OWNER_MASK;
                         }

Index: script_v1.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/script_v1.cpp,v
retrieving revision 1.53
retrieving revision 1.54
diff -C2 -d -r1.53 -r1.54
*** script_v1.cpp	18 Mar 2002 14:45:57 -0000	1.53
--- script_v1.cpp	18 Mar 2002 22:48:57 -0000	1.54
***************
*** 805,811 ****
--- 805,816 ----
  }
  
+ const short int bit_table[16] =
+ {1,2,4,8,0x10,0x20,0x40,0x80,0x100,0x200,0x400,0x800,0x1000,0x2000,0x4000,0x8000};
+ 
+ 
  void Scumm::o5_actorSetClass() {
  	int act = getVarOrDirectWord(0x80);
  	int newClass;
+ 	byte *oldClassData;
  
  	while ( (_opcode=fetchScriptByte()) != 0xFF) {
***************
*** 815,822 ****
  			continue;
  		}
! 		if (newClass&0x80)
! 			putClass(act, newClass, 1);
! 		else
! 			putClass(act, newClass, 0);
  	}
  }
--- 820,835 ----
  			continue;
  		}
! 		if(_features & GF_SMALL_HEADER) {
! 			oldClassData=(byte*)&_classData[act];
! 			if (newClass&0x80)
! 				oldClassData[((newClass-1)&0x7f)/8] |= bit_table[((newClass-1)&0x07)];
! 			else
! 				oldClassData[((newClass-1)&0x7f)/8] &= bit_table[((newClass-1)&0x07)]^0xff;
! 		} else {
! 			if (newClass&0x80)
! 				putClass(act, newClass, 1);
! 			else
! 				putClass(act, newClass, 0);
! 		}
  	}
  }
***************
*** 1332,1340 ****
  	int act,cls;
  	bool cond = true, b;
  
  	act = getVarOrDirectWord(0x80);
  	while ( (_opcode = fetchScriptByte()) != 0xFF) {
  		cls = getVarOrDirectWord(0x80);
! 		b = getClass(act, cls);
  
  		if (cls&0x80 && !b || !(cls&0x80) && b)
--- 1345,1358 ----
  	int act,cls;
  	bool cond = true, b;
+ 	byte *oldClass;
  
  	act = getVarOrDirectWord(0x80);
  	while ( (_opcode = fetchScriptByte()) != 0xFF) {
  		cls = getVarOrDirectWord(0x80);
! 		oldClass = (byte*)&_classData[act];
! 		if(_features & GF_SMALL_HEADER)
! 			b = oldClass[((cls-1)&0x7f)/8] & bit_table[((cls-1)&0x07)];
! 		else
! 			b = getClass(act, cls);
  
  		if (cls&0x80 && !b || !(cls&0x80) && b)

Index: scumm.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm.h,v
retrieving revision 1.89
retrieving revision 1.90
diff -C2 -d -r1.89 -r1.90
*** scumm.h	17 Mar 2002 13:00:10 -0000	1.89
--- scumm.h	18 Mar 2002 22:48:57 -0000	1.90
***************
*** 38,41 ****
--- 38,47 ----
  struct Actor;
  
+ struct gate_location
+ {
+ 	int     x;
+ 	int     y;
+ };
+ 
  #include "smush.h"
  
***************
*** 330,333 ****
--- 336,340 ----
  	int32 XYFactor, YXFactor;
  	uint16 xfrac,yfrac;
+ 	int point3x, point3y;
  };
  
***************
*** 2156,2159 ****
--- 2163,2168 ----
  	byte VAR_UNK_SCRIPT;
  	byte VAR_UNK_SCRIPT_2;
+ 
+ 	void GetGates(int trap1,int trap2);
  	
  	byte VAR_DEFAULT_TALK_DELAY;
***************
*** 2163,2166 ****
--- 2172,2190 ----
  
  	byte _videoPath[50];
+ 
+ 	gate_location p[5];
+ 
+ 	int CompareSlope(int X1,int Y1,int X2,int Y2,int X3,int Y3);
+ 	void SetGate(int line1,int line2, int polyx[8], int polyy[8]);
+ 
+ 	int gate1ax, gate1ay;
+ 	int gate1bx, gate1by;
+ 	int gate2ax, gate2ay;
+ 	int gate2bx, gate2by;
+ 
+ 	int CloX[8];
+ 	int CloY[8];
+ 
+ 	void walkActorOld(Actor *a);
  };
  





More information about the Scummvm-git-logs mailing list