[Scummvm-cvs-logs] CVS: scummvm/saga actor.cpp,1.148,1.149 sprite.cpp,1.52,1.53

Torbjörn Andersson eriktorbjorn at users.sourceforge.net
Mon Jul 4 23:14:11 CEST 2005


Update of /cvsroot/scummvm/scummvm/saga
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7194

Modified Files:
	actor.cpp sprite.cpp 
Log Message:
Clip actors and objects to the scene (which may be an inset), and only
allow interaction with actors and objects inside this same area. Other hit
zones may - indeed must - still exist outside the inset, and they are not
affected by this patch.

This fixes some glitches at the glass makers's house in ITE.


Index: actor.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/saga/actor.cpp,v
retrieving revision 1.148
retrieving revision 1.149
diff -u -d -r1.148 -r1.149
--- actor.cpp	3 Jul 2005 15:22:59 -0000	1.148
+++ actor.cpp	5 Jul 2005 06:12:40 -0000	1.149
@@ -1256,11 +1256,33 @@
 }
 
 uint16 Actor::hitTest(const Point &testPoint, bool skipProtagonist) {
+	// We can only interact with objects or actors that are inside the
+	// scene area. While this is usually the upper part of the screen, it
+	// could also be an inset. Note that other kinds of hit areas may be
+	// outside the inset, and that those are still perfectly fine to
+	// interact with. For example, the door entrance at the glass makers
+	// in ITE's ferret village.
+
+	SCENE_BGINFO bg_info;
+	Common::Rect sceneRect;
+
+	_vm->_scene->getBGInfo(&bg_info);
+
+	sceneRect.left = bg_info.bg_x;
+	sceneRect.top = bg_info.bg_y;
+	sceneRect.right = bg_info.bg_x + bg_info.bg_w;
+	sceneRect.bottom = bg_info.bg_y + bg_info.bg_h;
+
+	if (!sceneRect.contains(testPoint))
+		return ID_NOTHING;
+
 	CommonObjectOrderList::iterator drawOrderIterator;
 	CommonObjectDataPointer drawObject;
 	int frameNumber;
 	SpriteList *spriteList;
+
 	createDrawOrderList();
+
 	for (drawOrderIterator = _drawOrderList.begin(); drawOrderIterator != _drawOrderList.end(); ++drawOrderIterator) {
 		drawObject = drawOrderIterator.operator*();
 		if (skipProtagonist && (drawObject == _protagonist)) {

Index: sprite.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/saga/sprite.cpp,v
retrieving revision 1.52
retrieving revision 1.53
diff -u -d -r1.52 -r1.53
--- sprite.cpp	2 Jun 2005 22:34:55 -0000	1.52
+++ sprite.cpp	5 Jul 2005 06:12:40 -0000	1.53
@@ -338,10 +338,14 @@
 	spriteSourceRect.right = width;
 	spriteSourceRect.bottom = height;
 
-	spriteDestRect.left = 0;
-	spriteDestRect.top = 0;
-	spriteDestRect.right = ds->clip_rect.right;
-	spriteDestRect.bottom = MIN(ds->clip_rect.bottom, (int16)maskHeight);
+	SCENE_BGINFO bg_info;
+
+	_vm->_scene->getBGInfo(&bg_info);
+
+	spriteDestRect.left = bg_info.bg_x;
+	spriteDestRect.top = bg_info.bg_y;
+	spriteDestRect.right = bg_info.bg_x + bg_info.bg_w;
+	spriteDestRect.bottom = bg_info.bg_y + bg_info.bg_h;
 	
 	ci.dst_rect = &spriteDestRect;
 	ci.src_rect = &spriteSourceRect;
@@ -353,7 +357,6 @@
 		return SUCCESS;
 	}
 
-
 	// Finally, draw the occluded sprite
 	src_row_p = spriteBuffer + ci.src_draw_x + (ci.src_draw_y * width);
 





More information about the Scummvm-git-logs mailing list