[Scummvm-cvs-logs] CVS: scummvm object.cpp,1.30,1.31 scumm.h,1.59,1.60 verbs.cpp,1.18,1.19

Vincent Hamm yazoo at users.sourceforge.net
Tue Mar 5 13:09:01 CET 2002


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

Modified Files:
	object.cpp scumm.h verbs.cpp 
Log Message:
Fixed struct ImageHeader for v7 implementation

Index: object.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/object.cpp,v
retrieving revision 1.30
retrieving revision 1.31
diff -C2 -d -r1.30 -r1.31
*** object.cpp	5 Mar 2002 20:43:26 -0000	1.30
--- object.cpp	5 Mar 2002 21:03:31 -0000	1.31
***************
*** 150,155 ****
                          assert(ptr);
                          imhd = (ImageHeader*)findResourceData(MKID('IMHD'), ptr);
!                         x = od->x_pos + (int16)READ_LE_UINT16(&imhd->hotspot[state].x);
!                         y = od->y_pos + (int16)READ_LE_UINT16(&imhd->hotspot[state].y);
                  } else {
                          x = (int16)READ_LE_UINT16(&od->walk_x);
--- 150,160 ----
                          assert(ptr);
                          imhd = (ImageHeader*)findResourceData(MKID('IMHD'), ptr);
! 			if( _features & GF_AFTER_V7) {
! 			        x = od->x_pos + (int16)READ_LE_UINT16(&imhd->v7.hotspot[state].x);
! 				y = od->y_pos + (int16)READ_LE_UINT16(&imhd->v7.hotspot[state].y);
! 			} else {
!                         	x = od->x_pos + (int16)READ_LE_UINT16(&imhd->old.hotspot[state].x);
! 	                        y = od->y_pos + (int16)READ_LE_UINT16(&imhd->old.hotspot[state].y);
! 			}
                  } else {
                          x = (int16)READ_LE_UINT16(&od->walk_x);
***************
*** 401,405 ****
  
  		imhd = (ImageHeader*)findResourceData(MKID('IMHD'), ptr);
! 		obim_id = READ_LE_UINT16(&imhd->obj_id);
  
  		for(j=1; j<=_numObjectsInRoom; j++) {
--- 406,413 ----
  
  		imhd = (ImageHeader*)findResourceData(MKID('IMHD'), ptr);
! 		if (_features & GF_AFTER_V7)
! 			obim_id = READ_LE_UINT16(&imhd->v7.obj_id);
! 		else
! 			obim_id = READ_LE_UINT16(&imhd->old.obj_id);
  
  		for(j=1; j<=_numObjectsInRoom; j++) {
***************
*** 753,756 ****
--- 761,765 ----
  	ImageHeader *imhd;
  	int id2;
+ 	int id3;
  	
  	if (findWhat&foCheckAlreadyLoaded && getObjectIndex(id) != -1) {
***************
*** 830,834 ****
                                  }
                          } else {
!                                 if (READ_LE_UINT16(&imhd->obj_id) == (uint16)id) {
                                          fo->obim = obimptr;
                                          fo->imhd = imhd;
--- 839,847 ----
                                  }
                          } else {
! 				if(_features & GF_AFTER_V7)
! 					id3 = READ_LE_UINT16(&imhd->v7.obj_id);
! 				else
! 					id3 = READ_LE_UINT16(&imhd->old.obj_id);
!                                 if (id3 == (uint16)id) {
                                          fo->obim = obimptr;
                                          fo->imhd = imhd;
***************
*** 1023,1029 ****
  	findObjectInRoom(&foir, foCodeHeader | foImageHeader | foCheckAlreadyLoaded, img, room);
  
! 	setCursorHotspot2(
! 		READ_LE_UINT16(&foir.imhd->hotspot[0].x),
! 		READ_LE_UINT16(&foir.imhd->hotspot[0].y));
  
  #if !defined(FULL_THROTTLE)
--- 1036,1048 ----
  	findObjectInRoom(&foir, foCodeHeader | foImageHeader | foCheckAlreadyLoaded, img, room);
  
! 	if(_features & GF_AFTER_V7)
! 		setCursorHotspot2(
! 			READ_LE_UINT16(&foir.imhd->v7.hotspot[0].x),
! 			READ_LE_UINT16(&foir.imhd->v7.hotspot[0].y));
! 	else
! 		setCursorHotspot2(
! 			READ_LE_UINT16(&foir.imhd->old.hotspot[0].x),
! 			READ_LE_UINT16(&foir.imhd->old.hotspot[0].y));
! 	
  
  #if !defined(FULL_THROTTLE)

Index: scumm.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm.h,v
retrieving revision 1.59
retrieving revision 1.60
diff -C2 -d -r1.59 -r1.60
*** scumm.h	5 Mar 2002 20:43:26 -0000	1.59
--- scumm.h	5 Mar 2002 21:03:32 -0000	1.60
***************
*** 146,175 ****
  } GCC_PACK;
  
- #if defined(FULL_THROTTLE)
  struct ImageHeader { /* file format */
! 	uint32 version;
! 	uint16 obj_id;
! 	uint16 unk[1];
! 	int16 x_pos,y_pos;
! 	uint16 width,height;
! 	byte unk2[3];
! 	byte actordir;
! 	uint16 unk_2;
! 	struct {
! 		int16 x,y;
! 	} hotspot[15];
! } GCC_PACK;
! #else
! struct ImageHeader { /* file format */
! 	uint16 obj_id;
! 	uint16 unk[5];
! 	uint16 width;
! 	uint16 height;
! 	uint16 unk_2;
! 	struct {
! 		int16 x,y;
! 	} hotspot[15];
  } GCC_PACK;
- #endif
  #pragma END_PACK_STRUCTS
  
--- 146,177 ----
  } GCC_PACK;
  
  struct ImageHeader { /* file format */
! 	union {
! 		struct {
! 			uint16 obj_id;
! 			uint16 unk[5];
! 			uint16 width;
! 			uint16 height;
! 			uint16 unk_2;
! 			struct {
! 				int16 x,y;
! 			} hotspot[15];
! 		} old;
! 
! 		struct {
! 			uint32 version;
! 			uint16 obj_id;
! 			uint16 unk[1];
! 			int16 x_pos,y_pos;
! 			uint16 width,height;
! 			byte unk2[3];
! 			byte actordir;
! 			uint16 unk_2;
! 			struct {
! 				int16 x,y;
! 			} hotspot[15];
! 		} v7;
! 	};
  } GCC_PACK;
  #pragma END_PACK_STRUCTS
  

Index: verbs.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/verbs.cpp,v
retrieving revision 1.18
retrieving revision 1.19
diff -C2 -d -r1.18 -r1.19
*** verbs.cpp	24 Feb 2002 17:25:02 -0000	1.18
--- verbs.cpp	5 Mar 2002 21:03:32 -0000	1.19
***************
*** 195,200 ****
          } else {
                  imhd = (ImageHeader*)findResourceData(MKID('IMHD'), obim);
!                 imgw = READ_LE_UINT16(&imhd->width) >> 3;
!                 imgh = READ_LE_UINT16(&imhd->height) >> 3;
  	
                  imptr = findResource(MKID('IM01'), obim);
--- 195,205 ----
          } else {
                  imhd = (ImageHeader*)findResourceData(MKID('IMHD'), obim);
! 		if (_features & GF_AFTER_V7) {
! 			imgw = READ_LE_UINT16(&imhd->v7.width) >> 3;
! 			imgh = READ_LE_UINT16(&imhd->v7.height) >> 3;
! 		} else {
!                 	imgw = READ_LE_UINT16(&imhd->old.width) >> 3;
! 	                imgh = READ_LE_UINT16(&imhd->old.height) >> 3;
! 		}
  	
                  imptr = findResource(MKID('IM01'), obim);





More information about the Scummvm-git-logs mailing list