[Scummvm-cvs-logs] CVS: scummvm actor.cpp,1.55,1.56 akos.cpp,1.16,1.17 gfx.cpp,1.79,1.80 gfx.h,1.7,1.8 object.cpp,1.64,1.65 resource.cpp,1.70,1.71 script.cpp,1.51,1.52 scumm.h,1.138,1.139 scummvm.cpp,1.124,1.125 string.cpp,1.38,1.39 vars.cpp,1.9,1.10

James Brown ender at users.sourceforge.net
Tue Apr 23 21:27:03 CEST 2002


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

Modified Files:
	actor.cpp akos.cpp gfx.cpp gfx.h object.cpp resource.cpp 
	script.cpp scumm.h scummvm.cpp string.cpp vars.cpp 
Log Message:
Fix Indy4/MI2 crash due to VirtScroll code.
Cleanup \N's - For gods sake fix your CVS client :)



Index: actor.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/actor.cpp,v
retrieving revision 1.55
retrieving revision 1.56
diff -C2 -d -r1.55 -r1.56
*** actor.cpp	22 Apr 2002 22:18:24 -0000	1.55
--- actor.cpp	24 Apr 2002 04:26:08 -0000	1.56
***************
*** 496,503 ****
  }
  
! AdjustBoxResult Scumm::adjustXYToBeInBox(Actor * a, int x, int y,
! 																				 int pathfrom)
  {
- 	// Yazoo: need to recheck with Loom for the class data flags (0x400000)
  	AdjustBoxResult abr, tmp;
  	uint threshold;
--- 496,501 ----
  }
  
! AdjustBoxResult Scumm::adjustXYToBeInBox(Actor * a, int x, int y, int pathfrom)
  {
  	AdjustBoxResult abr, tmp;
  	uint threshold;
***************
*** 754,758 ****
  }
  
- 
  void Scumm::walkActor(Actor * a)
  {
--- 752,755 ----
***************
*** 918,925 ****
  			a->mask = 0;
  		else if (g_scumm->getClass(a->number, 21))
! 			a->forceClip = 1;
! 		
! 		if (_gameId==GID_SAMNMAX && getState(995)) // FIXME: ugly fix for samnmax inventory
! 			return;
  
  		a->needRedraw = false;
--- 915,926 ----
  			a->mask = 0;
  		else if (g_scumm->getClass(a->number, 21))
! 			a->forceClip = 1;
! 
! 		
! 
! 		if (_gameId==GID_SAMNMAX && getState(995)) // FIXME: ugly fix for samnmax inventory
! 
! 			return;
! 
  
  		a->needRedraw = false;

Index: akos.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/akos.cpp,v
retrieving revision 1.16
retrieving revision 1.17
diff -C2 -d -r1.16 -r1.17
*** akos.cpp	23 Apr 2002 14:58:53 -0000	1.16
--- akos.cpp	24 Apr 2002 04:26:08 -0000	1.17
***************
*** 54,58 ****
  		--temp;
  		--direction;
- 
  	} while (temp);
  
--- 54,57 ----
***************
*** 222,228 ****
  		off = ar->akof + (code & 0xFFF);
  
! 		assert((code & 0xFFF) * 6 <
! 					 READ_BE_UINT32_UNALIGNED((byte *)ar->akof - 4) - 8);
! 
  		assert((code & 0x7000) == 0);
  
--- 221,225 ----
  		off = ar->akof + (code & 0xFFF);
  
! 		assert((code & 0xFFF) * 6 < READ_BE_UINT32_UNALIGNED((byte *)ar->akof - 4) - 8);
  		assert((code & 0x7000) == 0);
  
***************
*** 581,595 ****
  	bool charsetmask;
  	bool masking;
! 	int step;
  
! 	/* implement custom scale table */
! 
! 	if(isGlobInMemory(rtString,_vars[VAR_CUSTOMSCALETABLE]))
! 	{
! 		ar->v1.scaletable = getStringAddressVar(VAR_CUSTOMSCALETABLE);
! 	}
! 	else
! 	{
! 		ar->v1.scaletable = default_scale_table;
  	}
  
--- 578,592 ----
  	bool charsetmask;
  	bool masking;
! 	int step;
  
! 
! 	/* implement custom scale table */
! 
! 
! 
! 	if(isGlobInMemory(rtString,_vars[VAR_CUSTOMSCALETABLE])) {
! 		ar->v1.scaletable = getStringAddressVar(VAR_CUSTOMSCALETABLE);
! 	} else {
! 		ar->v1.scaletable = default_scale_table;
  	}
  
***************
*** 658,662 ****
  					tmp_x = j;
  					skip++;
- 
  				}
  				if (ar->v1.scaletable[j--] < ar->scale_x)
--- 655,658 ----
***************
*** 897,962 ****
  
  void Scumm::akos_codec5(AkosRenderer * ar)
! {
  	VirtScreen *vs;
! 	BompDrawData bdd;
! 	
! 	int mirror;
! 	int moveX;
! 	int moveY;
! 	int left;
! 	int var_20;
! 	int max_width;
! 	int right;
! 	int top;
! 	int bottom;
! 
! 	vs = &virtscr[0];
! 
! 	//setBlastObjectMode(ar->shadow_mode); // not implemented yet
! 
! 	mirror = ar->mirror;
! 
! 	moveX=ar->move_x_cur;
! 	moveY=ar->move_y_cur;
! 
! 	if (!mirror)
! 	{
! 		left = (ar->x - moveX - ar->width) + 1;
! 	}
! 	else
! 	{
! 		left = ar->x + moveX -1;
! 	}
! 
! 	var_20=0;
! 	max_width = ar->outwidth;
! 
! 	right = left + ar->width - 1;
! 	top = ar->y + moveY;
! 	bottom = top + ar->height;
! 
! 	if(left < 0)
! 		left = 0;
! 
! 	if(left > max_width)
! 		left -= left - max_width;
! 
! 	ar->draw_top = 0;
! 	ar->draw_bottom = 200;
! 
! 	updateDirtyRect(0, left, right+1, top, bottom+1, 1 << ar->dirty_id);
! 
! 	bdd.dataptr = ar->srcptr;
! 	bdd.out = vs->screenPtr;
! 	bdd.outheight = ar->outheight;
! 	bdd.outwidth = ar->outwidth;
! 	bdd.scale_x = 0xFF;
! 	bdd.scale_y = 0xFF;
! 	bdd.srcheight = ar->height;
! 	bdd.srcwidth = ar->width;
! 	bdd.x = left+1;
! 	bdd.y = top;
! 
! 	drawBomp(&bdd,0,bdd.dataptr,0,0);
  }
  
--- 893,953 ----
  
  void Scumm::akos_codec5(AkosRenderer * ar)
! {
! 
  	VirtScreen *vs;
! 	BompDrawData bdd;
! 
! 	int mirror;
! 	int moveX;
! 	int moveY;
! 	int left;
! 	int var_20;
! 	int max_width;
! 
! 	int right;
! 	int top;
! 	int bottom;
! 
! 	vs = &virtscr[0];
! 	//setBlastObjectMode(ar->shadow_mode); // not implemented yet
! 	mirror = ar->mirror;
! 	moveX=ar->move_x_cur;
! 	moveY=ar->move_y_cur;
! 
! 	if (!mirror) {
! 		left = (ar->x - moveX - ar->width) + 1;
! 	} else {
! 		left = ar->x + moveX -1;
! 	}
! 
! 	var_20=0;
! 	max_width = ar->outwidth;
! 
! 	right = left + ar->width - 1;
! 	top = ar->y + moveY;
! 	bottom = top + ar->height;
! 
! 	if(left < 0)
! 		left = 0;
! 	if(left > max_width)
! 		left -= left - max_width;
! 
! 	ar->draw_top = 0;
! 	ar->draw_bottom = 200;
! 
! 	updateDirtyRect(0, left, right+1, top, bottom+1, 1 << ar->dirty_id);
! 
! 	bdd.dataptr = ar->srcptr;
! 	bdd.out = vs->screenPtr;
! 	bdd.outheight = ar->outheight;
! 	bdd.outwidth = ar->outwidth;
! 	bdd.scale_x = 0xFF;
! 	bdd.scale_y = 0xFF;
! 	bdd.srcheight = ar->height;
! 	bdd.srcwidth = ar->width;
! 	bdd.x = left+1;
! 	bdd.y = top;
! 
! 	drawBomp(&bdd,0,bdd.dataptr,0,0);
  }
  
***************
*** 1096,1105 ****
  		switch (code) {
  		case AKC_StartAnimInActor:
! 			akos_queCommand(4,
! 											derefActorSafe(getAnimVar(a, GB(2)),
! 																		 "akos_increaseAnim:29"), getAnimVar(a,
! 																																				 GB
! 																																				 (3)),
! 											0);
  			continue;
  
--- 1087,1092 ----
  		switch (code) {
  		case AKC_StartAnimInActor:
! 			akos_queCommand(4, derefActorSafe(getAnimVar(a, GB(2)),
! 							"akos_increaseAnim:29"), getAnimVar(a, GB(3)), 0);
  			continue;
  

Index: gfx.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/gfx.cpp,v
retrieving revision 1.79
retrieving revision 1.80
diff -C2 -d -r1.79 -r1.80
*** gfx.cpp	23 Apr 2002 23:58:30 -0000	1.79
--- gfx.cpp	24 Apr 2002 04:26:08 -0000	1.80
***************
*** 93,99 ****
  	if (vs->scrollable)
  		size += 320 * 4;
- 
- 	createResource(rtBuffer, slot+1, size);
  
  	vs->screenPtr = getResourceAddress(rtBuffer, slot+1);
  
--- 93,98 ----
  	if (vs->scrollable)
  		size += 320 * 4;
  
+ 	createResource(rtBuffer, slot+1, size);
  	vs->screenPtr = getResourceAddress(rtBuffer, slot+1);
  
***************
*** 131,135 ****
  {
  	int i;
! 	VirtScreen *vs;
  	byte * src;
  
--- 130,134 ----
  {
  	int i;
! 	VirtScreen *vs;
  	byte * src;
  
***************
*** 143,151 ****
  		updateDirtyScreen(0);
  	} else {
! 		vs = &virtscr[0];
! 		
! 		src = vs->screenPtr + _screenStartStrip * 8 + camera._cur.y - 100;
! 		
! 		_system->copy_rect(src , 320, 0, vs->topline, 320, vs->height);
  
  		for (i = 0; i < 40; i++) {
--- 142,149 ----
  		updateDirtyScreen(0);
  	} else {
! 		vs = &virtscr[0];
! 
! 		src = vs->screenPtr + _screenStartStrip * 8 + camera._cur.y - 100;
! 		_system->copy_rect(src , 320, 0, vs->topline, 320, vs->height);
  
  		for (i = 0; i < 40; i++) {
***************
*** 183,189 ****
  
  	for (i = 0; i < 40; i++) {
! 		bottom = vs->bdirty[i];
! 		if (_vm->camera._cur.y != _vm->camera._last.y)
! 			drawStripToScreen(vs, start, w, 0, vs->height);
  		else
  		if (bottom) {
--- 181,190 ----
  
  	for (i = 0; i < 40; i++) {
! 		bottom = vs->bdirty[i];
! 
! 		if (_vm->camera._cur.y != _vm->camera._last.y)
! 
! 			drawStripToScreen(vs, start, w, 0, vs->height);
! 
  		else
  		if (bottom) {
***************
*** 196,200 ****
  				continue;
  			}
! 		//	drawStripToScreen(vs, start, w, top, bottom);
  			drawStripToScreen(vs, start, w, 0, vs->height);
  			w = 8;
--- 197,202 ----
  				continue;
  			}
! 		//	drawStripToScreen(vs, start, w, top, bottom);
! 
  			drawStripToScreen(vs, start, w, 0, vs->height);
  			w = 8;
***************
*** 206,218 ****
  void Gdi::drawStripToScreen(VirtScreen * vs, int x, int w, int t, int b)
  {
! 	byte *ptr;
! 	int scrollY;
! 	int width = w;
  	int height;
! 
! 	height = b - t;
! 
! 	if(height > 200)
! 		height = 200;
  
  	if (b <= t)
--- 208,220 ----
  void Gdi::drawStripToScreen(VirtScreen * vs, int x, int w, int t, int b)
  {
! 	byte *ptr;
! 	int scrollY;
! 	int width = w;
  	int height;
! 
! 	height = b - t;
! 
! 	if(height > 200)
! 		height = 200;
  
  	if (b <= t)
***************
*** 223,241 ****
  
  	if (b > vs->height)
! 		b = vs->height;
! 
! 	scrollY = _vm->camera._cur.y - 100;
! 	if(scrollY == -100)
! 		scrollY = 0;
  
  	ptr = vs->screenPtr + (t * 40 + x) * 8 + _readOffs + scrollY * 320;
! 	
! 	_vm->_system->copy_rect(
! 		ptr, 320, x * 8, vs->topline + t , w, height);
  }
  
  void blit(byte *dst, byte *src, int w, int h)
  {
! 	assert(h > 0);
  
  	do {
--- 225,242 ----
  
  	if (b > vs->height)
! 		b = vs->height;
! 
! 	scrollY = _vm->camera._cur.y - 100;
! 	if(scrollY == -100)
! 		scrollY = 0;
  
  	ptr = vs->screenPtr + (t * 40 + x) * 8 + _readOffs + scrollY * 320;
! 		_vm->_system->copy_rect(ptr, 320, x * 8, vs->topline + t , w, height);
  }
  
  void blit(byte *dst, byte *src, int w, int h)
  {
! 	assert(h > 0);
! 
  
  	do {
***************
*** 358,370 ****
  	int size, itemsize, i;
  	byte *room;
! 
! 	if (_features & GF_AFTER_V7)
! 	{
! 		initVirtScreen(0, 0, virtscr[0].topline, 200, height, 1, 1);
! 	}
  
  	room = getResourceAddress(rtRoom, _roomResource);
  	if (_features & GF_SMALL_HEADER) {
! 		gdi._numZBuffer = 2; // ENDER
  	} else {
  		ptr = findResource(MKID('RMIH'), findResource(MKID('RMIM'), room));
--- 359,370 ----
  	int size, itemsize, i;
  	byte *room;
! 
! 	if (_features & GF_AFTER_V7) {
! 		initVirtScreen(0, 0, virtscr[0].topline, 200, height, 1, 1);
! 	}
  
  	room = getResourceAddress(rtRoom, _roomResource);
  	if (_features & GF_SMALL_HEADER) {
! 		gdi._numZBuffer = 2;
  	} else {
  		ptr = findResource(MKID('RMIH'), findResource(MKID('RMIM'), room));
***************
*** 373,380 ****
  	assert(gdi._numZBuffer >= 1 && gdi._numZBuffer <= 5);
  
! //	itemsize = (_scrHeight + 4) * 40;
! 	itemsize = (virtscr[0].height +4) * 40;
! 	size = itemsize * gdi._numZBuffer;
  
  	createResource(rtBuffer, 9, size);
  
--- 373,383 ----
  	assert(gdi._numZBuffer >= 1 && gdi._numZBuffer <= 5);
  
! 	if (_features & GF_AFTER_V7)
! 		itemsize = (virtscr[0].height +4) * 40;
! 	else
! 		itemsize = (_scrHeight + 4) * 40;
! 
  
+ 	size = itemsize * gdi._numZBuffer;
  	createResource(rtBuffer, 9, size);
  
***************
*** 663,671 ****
  	byte *smap_ptr, *where_draw_ptr;
  	int i;
! 	byte *zplane_list[4];
  	int bottom;
  	byte twobufs;
  	int numzbuf;
! 	int sx;
  
  	CHECK_HEAP;
--- 666,676 ----
  	byte *smap_ptr, *where_draw_ptr;
  	int i;
! 	byte *zplane_list[4];
! 
  	int bottom;
  	byte twobufs;
  	int numzbuf;
! 	int sx;
! 
  
  	CHECK_HEAP;
***************
*** 694,699 ****
  			zplane_list[i] = findResource(zplane_tags[i], ptr);
  		}
! 	}
! 
  	bottom = y + h;
  	if (bottom > vs->height) {
--- 699,706 ----
  			zplane_list[i] = findResource(zplane_tags[i], ptr);
  		}
! 	}
! 
! 
! 
  	bottom = y + h;
  	if (bottom > vs->height) {
***************
*** 1928,1935 ****
  		if (cd->_cur.x != old.x || cd->_cur.y != old.y) {
  			_vars[VAR_CAMERA_POS_X] = cd->_cur.x;
! 			_vars[VAR_CAMERA_POS_Y] = cd->_cur.y;
! 			_vars[VAR_CAMERA_DEST_X] = cd->_dest.x;
! 			_vars[VAR_CAMERA_DEST_Y] = cd->_dest.y;
! 			_vars[VAR_CAMERA_FOLLOWED_ACTOR] = cd ->_follows;
  			if(_vars[VAR_SCROLL_SCRIPT])
  				runScript(_vars[VAR_SCROLL_SCRIPT], 0, 0, 0);
--- 1935,1946 ----
  		if (cd->_cur.x != old.x || cd->_cur.y != old.y) {
  			_vars[VAR_CAMERA_POS_X] = cd->_cur.x;
! 			_vars[VAR_CAMERA_POS_Y] = cd->_cur.y;
! 
! 			_vars[VAR_CAMERA_DEST_X] = cd->_dest.x;
! 
! 			_vars[VAR_CAMERA_DEST_Y] = cd->_dest.y;
! 
! 			_vars[VAR_CAMERA_FOLLOWED_ACTOR] = cd ->_follows;
! 
  			if(_vars[VAR_SCROLL_SCRIPT])
  				runScript(_vars[VAR_SCROLL_SCRIPT], 0, 0, 0);
***************
*** 2203,2207 ****
  		while (onlyActorFlags) {
  			if (onlyActorFlags & 1 && a->top != 0xFF && a->needBgReset) {
! 				gfxUsageBits[_screenStartStrip + i] ^= bitpos;
  				if((a->bottom - a->top) >=0)
  					gdi.resetBackground(a->top, a->bottom, i);
--- 2214,2219 ----
  		while (onlyActorFlags) {
  			if (onlyActorFlags & 1 && a->top != 0xFF && a->needBgReset) {
! 				gfxUsageBits[_screenStartStrip + i] ^= bitpos;
! 
  				if((a->bottom - a->top) >=0)
  					gdi.resetBackground(a->top, a->bottom, i);
***************
*** 2575,2581 ****
  	return bestitem;
  }
! 
! // param3= clipping
! // param2= mirror
  // param1= never used ?
  void Scumm::drawBomp(BompDrawData *bd, int param1, byte* dataPtr, int param2, int param3)
--- 2587,2596 ----
  	return bestitem;
  }
! 
! 
! // param3= clipping
! 
! // param2= mirror
! 
  // param1= never used ?
  void Scumm::drawBomp(BompDrawData *bd, int param1, byte* dataPtr, int param2, int param3)
***************
*** 2684,2693 ****
  	byte *searchPtr;
  
- 
- 
  	byte readComp1;
- 
  	byte readComp2;
- 
  	byte readComp3;
  
--- 2699,2704 ----
***************
*** 2715,2730 ****
  	curPtr = palPtr + colorMin*3;
  
! 	for(i=colorMin;i<colorMax;i++)
! 	{
! 
  		readComp1=*(curPtr++);
- 
  		readComp2=*(curPtr++);
- 
  		readComp3=*(curPtr++);
  
- 
- 
- 
  		colorComp1=((readComp1)*c)>>8;
  		colorComp2=((readComp2)*d)>>8;
--- 2726,2734 ----
  	curPtr = palPtr + colorMin*3;
  
! 	for(i=colorMin;i<colorMax;i++) {
  		readComp1=*(curPtr++);
  		readComp2=*(curPtr++);
  		readComp3=*(curPtr++);
  
  		colorComp1=((readComp1)*c)>>8;
  		colorComp2=((readComp2)*d)>>8;
***************
*** 2735,2740 ****
  		currentIndex = 0;
  
! 		for(j=a;j<b;j++)
! 		{
  			searchComp1 = (*searchPtr++);
  			searchComp2 = (*searchPtr++);
--- 2739,2743 ----
  		currentIndex = 0;
  
! 		for(j=a;j<b;j++) {
  			searchComp1 = (*searchPtr++);
  			searchComp2 = (*searchPtr++);
***************
*** 2743,2755 ****
  			currentResult = abs(searchComp1-colorComp1) + abs(searchComp2-colorComp2) + abs(searchComp3-colorComp3);
  
! 			if(currentResult<bestResult)
! 			{
  				_proc_special_palette[i]=currentIndex;
  				bestResult=currentResult;
  			}
- 
  			currentIndex++;
  		}
  	}
! 
! }
\ No newline at end of file
--- 2746,2755 ----
  			currentResult = abs(searchComp1-colorComp1) + abs(searchComp2-colorComp2) + abs(searchComp3-colorComp3);
  
! 			if(currentResult<bestResult) {
  				_proc_special_palette[i]=currentIndex;
  				bestResult=currentResult;
  			}
  			currentIndex++;
  		}
  	}
! }

Index: gfx.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/gfx.h,v
retrieving revision 1.7
retrieving revision 1.8
diff -C2 -d -r1.7 -r1.8
*** gfx.h	23 Apr 2002 23:58:31 -0000	1.7
--- gfx.h	24 Apr 2002 04:26:08 -0000	1.8
***************
*** 78,82 ****
  	int16 posX,posY;
  	uint16 width,height;
! 	uint16 unk3,unk4,image;
  	uint16 mode;
  };
--- 78,83 ----
  	int16 posX,posY;
  	uint16 width,height;
! 	uint16 unk3,unk4,image;
! 
  	uint16 mode;
  };

Index: object.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/object.cpp,v
retrieving revision 1.64
retrieving revision 1.65
diff -C2 -d -r1.64 -r1.65
*** object.cpp	23 Apr 2002 23:58:31 -0000	1.64
--- object.cpp	24 Apr 2002 04:26:08 -0000	1.65
***************
*** 336,340 ****
  
  	xpos = od->x_pos >> 3;
! 	ypos = od->y_pos;
  	width = od->width >> 3;
  	height = od->height &= 0xF8;	// Ender
--- 336,341 ----
  
  	xpos = od->x_pos >> 3;
! 	ypos = od->y_pos;
! 
  	width = od->width >> 3;
  	height = od->height &= 0xF8;	// Ender
***************
*** 522,526 ****
  	}
  
! CHECK_HEAP}
  
  void Scumm::setupRoomObject(ObjectData *od, byte *room)
--- 523,528 ----
  	}
  
! 	CHECK_HEAP
! }
  
  void Scumm::setupRoomObject(ObjectData *od, byte *room)
***************
*** 559,564 ****
  	}
  
! 	cdhd =
! 		(CodeHeader *)findResourceData(MKID('CDHD'),
  																	 room + od->offs_obcd_to_room);
  	if (_features & GF_AFTER_V7)
--- 561,565 ----
  	}
  
! 	cdhd = (CodeHeader *)findResourceData(MKID('CDHD'),
  																	 room + od->offs_obcd_to_room);
  	if (_features & GF_AFTER_V7)
***************
*** 654,657 ****
--- 655,659 ----
  		return;
  	}
+ 
  	for (i = 1; i < _maxInventoryItems; i++) {
  		if (_inventory[i] == obj) {
***************
*** 1184,1188 ****
  	eo->unk3 = f;
  	eo->unk4 = g;
! 	eo->image = image;
  	eo->mode = mode;
  }
--- 1186,1191 ----
  	eo->unk3 = f;
  	eo->unk4 = g;
! 	eo->image = image;
! 
  	eo->mode = mode;
  }
***************
*** 1203,1211 ****
  {
  	VirtScreen *vs;
! 	byte *roomptr, *bomp;
! 	byte *ptr;
! 	byte *img;
  	int idx;
- 
  	BompDrawData bdd;
  
--- 1206,1211 ----
  {
  	VirtScreen *vs;
! 	byte *bomp, *ptr, *img;
  	int idx;
  	BompDrawData bdd;
  
***************
*** 1213,1244 ****
  
  	_lastXstart = vs->xstart;
! 
! 	checkRange(_numGlobalObjects - 1, 30, eo->number, "Illegal Blast object %d");	
! 
! 	idx = _objs[getObjectIndex(eo->number)].fl_object_index;
! 
! 	if(idx)
! 	{
! 		ptr = getResourceAddress(rtFlObject, idx);
! 		ptr = findResource(MKID('OBIM'), ptr);
! 	} else {
! 		idx = getObjectIndex(eo->number);
! 		assert(idx != -1);
! 		ptr = getResourceAddress(1, _roomResource) + _objs[idx].offs_obim_to_room;
! 	}
! 
! 	if(!ptr)
  		error("BlastObject object %d image not found",eo->number);
  
! 	img = findResource(IMxx_tags[eo->image], ptr);
! 	if(!img)
  		img = findResource(IMxx_tags[1], ptr); // Backward compatibility with samnmax blast objects
! 
! 	if(!img)
! 		error("blast-object %d invalid image %d (1-x)",eo->number,eo->image);
  
! 	bomp = findResourceData(MKID('BOMP'), img);
! 
! 	if(!bomp)
  		error("object %d is not a blast object",eo->number);
  
--- 1213,1240 ----
  
  	_lastXstart = vs->xstart;
! 
! 	checkRange(_numGlobalObjects - 1, 30, eo->number, "Illegal Blast object %d");	
! 
! 	idx = _objs[getObjectIndex(eo->number)].fl_object_index;
! 
! 	if(idx) {
! 		ptr = getResourceAddress(rtFlObject, idx);
! 		ptr = findResource(MKID('OBIM'), ptr);
! 	} else {
! 		idx = getObjectIndex(eo->number);
! 		assert(idx != -1);
! 		ptr = getResourceAddress(1, _roomResource) + _objs[idx].offs_obim_to_room;
! 	}
! 	if(!ptr)
  		error("BlastObject object %d image not found",eo->number);
  
! 	img = findResource(IMxx_tags[eo->image], ptr);
! 	if(!img)
  		img = findResource(IMxx_tags[1], ptr); // Backward compatibility with samnmax blast objects
! 	if(!img)
! 		error("blast-object %d invalid image %d (1-x)",eo->number,eo->image);
  
! 	bomp = findResourceData(MKID('BOMP'), img);
! 	if(!bomp)
  		error("object %d is not a blast object",eo->number);
  
***************
*** 1256,1264 ****
  
  	drawBomp(&bdd, 0, bdd.dataptr, 1, 0);
! 
! 
! 	updateDirtyRect(vs->number, bdd.x, bdd.x + bdd.srcwidth, bdd.y,
! 								bdd.y + bdd.srcheight, 0);
! 
  }
  
--- 1252,1257 ----
  
  	drawBomp(&bdd, 0, bdd.dataptr, 1, 0);
! 	updateDirtyRect(vs->number, bdd.x, bdd.x + bdd.srcwidth, bdd.y,
! 								bdd.y + bdd.srcheight, 0);
  }
  

Index: resource.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/resource.cpp,v
retrieving revision 1.70
retrieving revision 1.71
diff -C2 -d -r1.70 -r1.71
*** resource.cpp	23 Apr 2002 23:58:31 -0000	1.70
--- resource.cpp	24 Apr 2002 04:26:09 -0000	1.71
***************
*** 651,670 ****
  		return ((ArrayHeader *)b)->data;
  	return b;
! }
! 
! byte *Scumm::getStringAddressVar(int i)
! {
! 	byte *addr;
! 
! 	addr=getResourceAddress(rtString,_vars[i]);
! 
! 	if(addr==NULL)
! 		error("NULL string var %d slot %d",i,_vars[i]);
! 
! 	if (_features & GF_NEW_OPCODES)
! 			return ((ArrayHeader *)addr)->data;
! 
! 	return(addr);
! 
  }
  
--- 651,669 ----
  		return ((ArrayHeader *)b)->data;
  	return b;
! }
! 
! 
! 
! byte *Scumm::getStringAddressVar(int i) {
! 	byte *addr;
! 
! 	addr=getResourceAddress(rtString,_vars[i]);
! 	if(addr==NULL)
! 		error("NULL string var %d slot %d",i,_vars[i]);
! 
! 	if (_features & GF_NEW_OPCODES)
! 			return ((ArrayHeader *)addr)->data;
! 
! 	return(addr);
  }
  
***************
*** 1162,1176 ****
  	allocResTypeData(rtMatrix, MKID('NONE'), 10, "boxes", 0);
  }
! 
! 
! uint32 Scumm::isGlobInMemory(int type, int index)
! {
! 	validateResource("isGlobInMemory",type,index);
! 	
! 	if(res.address[type][index]==NULL)
! 		return(0);
! 
! 	return(1);
! }
  
  uint16 newTag2Old(uint32 oldTag)
--- 1161,1186 ----
  	allocResTypeData(rtMatrix, MKID('NONE'), 10, "boxes", 0);
  }
! 
! 
! 
! 
! uint32 Scumm::isGlobInMemory(int type, int index)
! 
! {
! 
! 	validateResource("isGlobInMemory",type,index);
! 
! 	
! 
! 	if(res.address[type][index]==NULL)
! 
! 		return(0);
! 
! 
! 
! 	return(1);
! 
! }
! 
  
  uint16 newTag2Old(uint32 oldTag)
***************
*** 1213,1216 ****
  		return (0);
  	}
! }
  
--- 1223,1227 ----
  		return (0);
  	}
! }
! 
  

Index: script.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/script.cpp,v
retrieving revision 1.51
retrieving revision 1.52
diff -C2 -d -r1.51 -r1.52
*** script.cpp	23 Apr 2002 23:58:31 -0000	1.51
--- script.cpp	24 Apr 2002 04:26:09 -0000	1.52
***************
*** 32,36 ****
  	int slot;
  	ScriptSlot *s;
! 
  	if (script == 0)
  		return;
--- 32,37 ----
  	int slot;
  	ScriptSlot *s;
! 
! 
  	if (script == 0)
  		return;
***************
*** 267,271 ****
  /* Execute a script - Read opcode, and execute it from the table */
  void Scumm::executeScript()
! {
  	OpcodeProc op;
  	while (_currentScript != 0xFF) {
--- 268,273 ----
  /* Execute a script - Read opcode, and execute it from the table */
  void Scumm::executeScript()
! {
! 
  	OpcodeProc op;
  	while (_currentScript != 0xFF) {
***************
*** 967,974 ****
  	idx = vm.cutSceneStackPointer;
  	ptr = &vm.cutScenePtr[idx];
! /*	if (!*ptr) {		// ENDER - FIXME - We don't need this?
! 		vm.slot[_currentScript].cutsceneOverride++;
! 	} 
! */
  	*ptr = _scriptPointer - _scriptOrgPointer;
  	vm.cutSceneScript[idx] = _currentScript;
--- 969,973 ----
  	idx = vm.cutSceneStackPointer;
  	ptr = &vm.cutScenePtr[idx];
! 
  	*ptr = _scriptPointer - _scriptOrgPointer;
  	vm.cutSceneScript[idx] = _currentScript;
***************
*** 986,993 ****
  	idx = vm.cutSceneStackPointer;
  	ptr = &vm.cutScenePtr[idx];
! /*	if (!*ptr) {		// ENDER - FIXME - We don't need this?
! 		// vm.slot[_currentScript].cutsceneOverride--;
! 		//printf("ending override: %d on script %d\n", vm.slot[_currentScript].cutsceneOverride, _currentScript);
! 	} */
  	*ptr = 0;
  	vm.cutSceneScript[idx] = 0;
--- 985,989 ----
  	idx = vm.cutSceneStackPointer;
  	ptr = &vm.cutScenePtr[idx];
! 
  	*ptr = 0;
  	vm.cutSceneScript[idx] = 0;

Index: scumm.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm.h,v
retrieving revision 1.138
retrieving revision 1.139
diff -C2 -d -r1.138 -r1.139
*** scumm.h	23 Apr 2002 23:58:31 -0000	1.138
--- scumm.h	24 Apr 2002 04:26:09 -0000	1.139
***************
*** 1692,1698 ****
  	byte VAR_CAMERA_SPEED_Y;
  	byte VAR_CAMERA_ACCEL_X;
! 	byte VAR_CAMERA_ACCEL_Y;
! 	byte VAR_CAMERA_DEST_X;
! 	byte VAR_CAMERA_DEST_Y;
  	byte VAR_CAMERA_FOLLOWED_ACTOR;
  
--- 1692,1701 ----
  	byte VAR_CAMERA_SPEED_Y;
  	byte VAR_CAMERA_ACCEL_X;
! 	byte VAR_CAMERA_ACCEL_Y;
! 
! 	byte VAR_CAMERA_DEST_X;
! 
! 	byte VAR_CAMERA_DEST_Y;
! 
  	byte VAR_CAMERA_FOLLOWED_ACTOR;
  

Index: scummvm.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scummvm.cpp,v
retrieving revision 1.124
retrieving revision 1.125
diff -C2 -d -r1.124 -r1.125
*** scummvm.cpp	23 Apr 2002 23:58:31 -0000	1.124
--- scummvm.cpp	24 Apr 2002 04:26:09 -0000	1.125
***************
*** 54,61 ****
  	Actor *a;
  
- 
  	tempMusic=0;
- 
- 
  	debug(9, "scummInit");
  
--- 54,58 ----
***************
*** 209,219 ****
  
  #ifndef _WIN32_WCE
- 
- 
  	if (_debugger)
  		_debugger->on_frame();
- 
- 
- 
  #endif
  
--- 206,211 ----
***************
*** 260,280 ****
  	{
  
! 		if(tempMusic == 3)
! 
! 		{
! 
  			tempMusic = 0;
  			_vars[VAR_MUSIC_FLAG]++;
! 
! 		}
! 
! 		else
! 
! 		{
! 
  			tempMusic ++;
- 
  		}
- 
  	}
  
--- 252,261 ----
  	{
  
! 		if(tempMusic == 3) {
  			tempMusic = 0;
  			_vars[VAR_MUSIC_FLAG]++;
! 		} else {
  			tempMusic ++;
  		}
  	}
  
***************
*** 328,332 ****
  			if (camera._cur.x != camera._last.x || camera._cur.y != camera._last.y
  					|| _BgNeedsRedraw || _fullRedraw) {
! 				redrawBGAreas();
  				_videoBuffer = virtscr[0].screenPtr + (camera._cur.y - 100) * 328;
  			}
--- 309,314 ----
  			if (camera._cur.x != camera._last.x || camera._cur.y != camera._last.y
  					|| _BgNeedsRedraw || _fullRedraw) {
! 				redrawBGAreas();
! 
  				_videoBuffer = virtscr[0].screenPtr + (camera._cur.y - 100) * 328;
  			}
***************
*** 432,436 ****
  	_currentRoom = room;
  	_vars[VAR_ROOM] = room;
! 	// printf("startscene with room 0x%x\n", room);
  	if (room >= 0x80)
  		_roomResource = _resourceMapper[room & 0x7F];
--- 414,418 ----
  	_currentRoom = room;
  	_vars[VAR_ROOM] = room;
! 
  	if (room >= 0x80)
  		_roomResource = _resourceMapper[room & 0x7F];
***************
*** 457,461 ****
  	if (!(_features & GF_AFTER_V7)) {
  		camera._mode = CM_NORMAL;
! 		camera._cur.x = camera._dest.x = 160;
  		camera._cur.y = camera._dest.y = 100;
  	}
--- 439,444 ----
  	if (!(_features & GF_AFTER_V7)) {
  		camera._mode = CM_NORMAL;
! 		camera._cur.x = camera._dest.x = 160;
! 
  		camera._cur.y = camera._dest.y = 100;
  	}
***************
*** 711,716 ****
  
  	initBGBuffers(_scrHeight);
! 
! 	_videoBuffer = virtscr[0].screenPtr;
  
  	memset(_extraBoxFlags, 0, sizeof(_extraBoxFlags));
--- 694,701 ----
  
  	initBGBuffers(_scrHeight);
! 
! 
! 	_videoBuffer = virtscr[0].screenPtr;
! 
  
  	memset(_extraBoxFlags, 0, sizeof(_extraBoxFlags));
***************
*** 821,829 ****
  	getKeyInput(0);
  
! 	_virtual_mouse_x = mouse.x + virtscr[0].xstart;
! 
  	if(_features & GF_AFTER_V7)
! 		_virtual_mouse_y = mouse.y + camera._cur.y-100;
! 	else
  		_virtual_mouse_y = mouse.y;
  
--- 806,818 ----
  	getKeyInput(0);
  
! 	_virtual_mouse_x = mouse.x + virtscr[0].xstart;
! 
! 
! 
  	if(_features & GF_AFTER_V7)
! 		_virtual_mouse_y = mouse.y + camera._cur.y-100;
! 
! 	else
! 
  		_virtual_mouse_y = mouse.y;
  

Index: string.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/string.cpp,v
retrieving revision 1.38
retrieving revision 1.39
diff -C2 -d -r1.38 -r1.39
*** string.cpp	23 Apr 2002 23:58:31 -0000	1.38
--- string.cpp	24 Apr 2002 04:26:09 -0000	1.39
***************
*** 237,242 ****
  			string[0].ypos = ((a->new_1 - s) >> 1) + s - a->elevation + a->y;
  			if (string[0].ypos < 1)
! 				string[0].ypos = 1;
! 			if (string[0].ypos < camera._cur.y - 100)
  				string[0].ypos = camera._cur.y - 100;
  
--- 237,244 ----
  			string[0].ypos = ((a->new_1 - s) >> 1) + s - a->elevation + a->y;
  			if (string[0].ypos < 1)
! 				string[0].ypos = 1;
! 
! 			if (string[0].ypos < camera._cur.y - 100)
! 
  				string[0].ypos = camera._cur.y - 100;
  
***************
*** 533,537 ****
  			}
  		} else {
! 			if (a == 1 && (_features & GF_AFTER_V6))
  				if(string[a].no_talk_anim==0)
  					charset._blitAlso = true;
--- 535,540 ----
  			}
  		} else {
! 			if (a == 1 && (_features & GF_AFTER_V6))
! 
  				if(string[a].no_talk_anim==0)
  					charset._blitAlso = true;

Index: vars.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/vars.cpp,v
retrieving revision 1.9
retrieving revision 1.10
diff -C2 -d -r1.9 -r1.10
*** vars.cpp	23 Apr 2002 23:58:31 -0000	1.9
--- vars.cpp	24 Apr 2002 04:26:09 -0000	1.10
***************
*** 140,147 ****
  	VAR_NEW_ROOM = 35;
  	VAR_WALKTO_OBJ = 36;
! 
! 	VAR_CAMERA_DEST_X = 38;
! 	VAR_CAMERA_DEST_Y = 39;
! 	VAR_CAMERA_FOLLOWED_ACTOR = 40;
  
  	VAR_SCROLL_SCRIPT = 50;
--- 140,151 ----
  	VAR_NEW_ROOM = 35;
  	VAR_WALKTO_OBJ = 36;
! 
! 
! 	VAR_CAMERA_DEST_X = 38;
! 
! 	VAR_CAMERA_DEST_Y = 39;
! 
! 	VAR_CAMERA_FOLLOWED_ACTOR = 40;
! 
  
  	VAR_SCROLL_SCRIPT = 50;
***************
*** 188,195 ****
  	VAR_DEBUGMODE = 116;
  
! 	VAR_CHARSET_MASK = 119;
! 
! 	VAR_VIDEONAME = 0xF6/2;
! 
  	VAR_CUSTOMSCALETABLE = 131;
  
--- 192,197 ----
  	VAR_DEBUGMODE = 116;
  
! 	VAR_CHARSET_MASK = 119;
! 	VAR_VIDEONAME = 0xF6/2;
  	VAR_CUSTOMSCALETABLE = 131;
  
***************
*** 202,206 ****
  
  	VAR_V6_EMSSPACE = 76;
- 
  	VAR_STRING2DRAW = 130;
  }
--- 204,207 ----





More information about the Scummvm-git-logs mailing list