[Scummvm-cvs-logs] SF.net SVN: scummvm:[44042] scummvm/trunk/engines/sci/engine

thebluegr at users.sourceforge.net thebluegr at users.sourceforge.net
Sat Sep 12 19:42:05 CEST 2009


Revision: 44042
          http://scummvm.svn.sourceforge.net/scummvm/?rev=44042&view=rev
Author:   thebluegr
Date:     2009-09-12 17:42:04 +0000 (Sat, 12 Sep 2009)

Log Message:
-----------
Made is_object() a method of the segment manager

Modified Paths:
--------------
    scummvm/trunk/engines/sci/engine/kernel.h
    scummvm/trunk/engines/sci/engine/kgraphics.cpp
    scummvm/trunk/engines/sci/engine/kscripts.cpp
    scummvm/trunk/engines/sci/engine/ksound.cpp
    scummvm/trunk/engines/sci/engine/seg_manager.h

Modified: scummvm/trunk/engines/sci/engine/kernel.h
===================================================================
--- scummvm/trunk/engines/sci/engine/kernel.h	2009-09-12 17:31:29 UTC (rev 44041)
+++ scummvm/trunk/engines/sci/engine/kernel.h	2009-09-12 17:42:04 UTC (rev 44042)
@@ -224,16 +224,6 @@
  */
 char *kernel_lookup_text(EngineState *s, reg_t address, int index);
 
-
-/******************** Debug functionality ********************/
-/**
- * Checks whether a heap address contains an object
- * @param s The current state
- * @parm obj The address to check
- * @return True if it is an object, false otherwise
- */
-bool is_object(SegManager *segMan, reg_t obj);
-
 /******************** Kernel function parameter macros ********************/
 
 /* Returns the parameter value or (alt) if not enough parameters were supplied */

Modified: scummvm/trunk/engines/sci/engine/kgraphics.cpp
===================================================================
--- scummvm/trunk/engines/sci/engine/kgraphics.cpp	2009-09-12 17:31:29 UTC (rev 44041)
+++ scummvm/trunk/engines/sci/engine/kgraphics.cpp	2009-09-12 17:42:04 UTC (rev 44042)
@@ -805,7 +805,7 @@
 		while (widget) {
 			if (widget->_ID && (widget->signal & _K_VIEW_SIG_FLAG_STOPUPD)
 			        && ((widget->_ID != obj.segment) || (widget->_subID != obj.offset))
-			        && is_object(s->segMan, make_reg(widget->_ID, widget->_subID)))
+			        && s->segMan->isObject(make_reg(widget->_ID, widget->_subID)))
 				if (collides_with(s, abs_zone, make_reg(widget->_ID, widget->_subID), 1, GASEOUS_VIEW_MASK_ACTIVE, argc, argv))
 					return not_register(s, NULL_REG);
 
@@ -831,7 +831,7 @@
 			reg_t other_obj = node->value;
 			debugC(2, kDebugLevelBresen, "  comparing against %04x:%04x\n", PRINT_REG(other_obj));
 
-			if (!is_object(s->segMan, other_obj)) {
+			if (!s->segMan->isObject(other_obj)) {
 				warning("CanBeHere() cliplist contains non-object %04x:%04x", PRINT_REG(other_obj));
 			} else if (other_obj != obj) { // Clipping against yourself is not recommended
 
@@ -1674,7 +1674,7 @@
 static void draw_obj_to_control_map(EngineState *s, GfxDynView *view) {
 	reg_t obj = make_reg(view->_ID, view->_subID);
 
-	if (!is_object(s->segMan, obj))
+	if (!s->segMan->isObject(obj))
 		warning("View %d does not contain valid object reference %04x:%04x", view->_ID, PRINT_REG(obj));
 
 	reg_t* sp = view->signalp.getPointer(s->segMan);
@@ -1780,7 +1780,7 @@
 				reg_t obj = make_reg(widget->_ID, widget->_subID);
 				reg_t under_bits = NULL_REG;
 
-				if (!is_object(s->segMan, obj)) {
+				if (!s->segMan->isObject(obj)) {
 					error("Non-object %04x:%04x present in view list during delete time", PRINT_REG(obj));
 					obj = NULL_REG;
 				} else {
@@ -1798,7 +1798,7 @@
 						}
 					}
 				}
-				if (is_object(segMan, obj)) {
+				if (segMan->isObject(obj)) {
 					if (invoke_selector(INV_SEL(obj, delete_, kContinueOnInvalidSelector), 0))
 						warning("Object at %04x:%04x requested deletion, but does not have a delete funcselector", PRINT_REG(obj));
 					if (_k_animate_ran) {

Modified: scummvm/trunk/engines/sci/engine/kscripts.cpp
===================================================================
--- scummvm/trunk/engines/sci/engine/kscripts.cpp	2009-09-12 17:31:29 UTC (rev 44041)
+++ scummvm/trunk/engines/sci/engine/kscripts.cpp	2009-09-12 17:42:04 UTC (rev 44042)
@@ -107,10 +107,6 @@
 	return 0;
 }
 
-bool is_object(SegManager *segMan, reg_t object) {
-	return segMan->getObject(object) != NULL;
-}
-
 // Loads arbitrary resources of type 'restype' with resource numbers 'resnrs'
 // This implementation ignores all resource numbers except the first one.
 reg_t kLoad(EngineState *s, int, int argc, reg_t *argv) {

Modified: scummvm/trunk/engines/sci/engine/ksound.cpp
===================================================================
--- scummvm/trunk/engines/sci/engine/ksound.cpp	2009-09-12 17:31:29 UTC (rev 44041)
+++ scummvm/trunk/engines/sci/engine/ksound.cpp	2009-09-12 17:42:04 UTC (rev 44042)
@@ -165,7 +165,7 @@
 
 	while ((result = s->_sound.sfx_poll(&handle, &cue))) {
 		reg_t obj = DEFROBNICATE_HANDLE(handle);
-		if (!is_object(s->segMan, obj)) {
+		if (!s->segMan->isObject(obj)) {
 			warning("Non-object %04x:%04x received sound signal (%d/%d)", PRINT_REG(obj), result, cue);
 			return;
 		}

Modified: scummvm/trunk/engines/sci/engine/seg_manager.h
===================================================================
--- scummvm/trunk/engines/sci/engine/seg_manager.h	2009-09-12 17:31:29 UTC (rev 44041)
+++ scummvm/trunk/engines/sci/engine/seg_manager.h	2009-09-12 17:42:04 UTC (rev 44042)
@@ -353,6 +353,13 @@
 	Object *getObject(reg_t pos);
 
 	/**
+	 * Checks whether a heap address contains an object
+	 * @parm obj The address to check
+	 * @return True if it is an object, false otherwise
+	 */
+	bool isObject(reg_t obj) { return getObject(obj) != NULL; }
+
+	/**
 	 * Determines the name of an object
 	 * @param[in] pos	Location (segment, offset) of the object
 	 * @return			A name for that object, or a string describing an error


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.




More information about the Scummvm-git-logs mailing list