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

thebluegr at users.sourceforge.net thebluegr at users.sourceforge.net
Fri Feb 20 21:11:13 CET 2009


Revision: 38617
          http://scummvm.svn.sourceforge.net/scummvm/?rev=38617&view=rev
Author:   thebluegr
Date:     2009-02-20 20:11:12 +0000 (Fri, 20 Feb 2009)

Log Message:
-----------
Started conversion of debug messages and debug levels to the ScummVM equivalents. Removed the "stubs" and "warnings" debug levels and replaced such kinds of messages with normal warnings

Modified Paths:
--------------
    scummvm/trunk/engines/sci/engine/kernel.cpp
    scummvm/trunk/engines/sci/engine/kevent.cpp
    scummvm/trunk/engines/sci/engine/kfile.cpp
    scummvm/trunk/engines/sci/engine/kgraphics.cpp
    scummvm/trunk/engines/sci/engine/klists.cpp
    scummvm/trunk/engines/sci/engine/kmath.cpp
    scummvm/trunk/engines/sci/engine/kmovement.cpp
    scummvm/trunk/engines/sci/engine/kpathing.cpp
    scummvm/trunk/engines/sci/engine/kscripts.cpp
    scummvm/trunk/engines/sci/engine/ksound.cpp
    scummvm/trunk/engines/sci/engine/kstring.cpp
    scummvm/trunk/engines/sci/engine/scriptdebug.cpp
    scummvm/trunk/engines/sci/engine/vm.cpp
    scummvm/trunk/engines/sci/gfx/resource/sci_pic_0.cpp
    scummvm/trunk/engines/sci/include/kdebug.h
    scummvm/trunk/engines/sci/include/kernel.h
    scummvm/trunk/engines/sci/include/resource.h
    scummvm/trunk/engines/sci/sci.cpp
    scummvm/trunk/engines/sci/sci.h

Modified: scummvm/trunk/engines/sci/engine/kernel.cpp
===================================================================
--- scummvm/trunk/engines/sci/engine/kernel.cpp	2009-02-20 20:01:31 UTC (rev 38616)
+++ scummvm/trunk/engines/sci/engine/kernel.cpp	2009-02-20 20:11:12 UTC (rev 38617)
@@ -449,7 +449,7 @@
 		return make_reg(0, 0x7fff); // Must not be 0xffff, or some memory calculations will overflow
 
 	default:
-		SCIkwarn(SCIkWARNING, "Unknown MemoryInfo operation: %04x\n", argv[0].offset);
+		warning("Unknown MemoryInfo operation: %04x", argv[0].offset);
 	}
 
 	return NULL_REG;
@@ -457,7 +457,7 @@
 
 reg_t k_Unknown(state_t *s, int funct_nr, int argc, reg_t *argv) {
 	if (funct_nr >= SCI_MAPPED_UNKNOWN_KFUNCTIONS_NR) {
-		SCIkwarn(SCIkSTUB, "Unhandled Unknown function %04x\n", funct_nr);
+		warning("Unhandled Unknown function %04x", funct_nr);
 		return NULL_REG;
 	} else {
 		switch (kfunct_mappers[funct_nr].type) {
@@ -465,7 +465,7 @@
 			return kfunct_mappers[funct_nr].sig_pair.fun(s, funct_nr, argc, argv);
 		case KF_NONE:
 		default:
-			SCIkwarn(SCIkSTUB, "Unhandled Unknown function %04x\n", funct_nr);
+			warning("Unhandled Unknown function %04x", funct_nr);
 			return NULL_REG;
 		}
 	}
@@ -557,7 +557,7 @@
 			break;
 		}
 		default: {
-			SCIkdebug(SCIkWARNING, "Attempt to use unknown GetTime mode %d\n", mode);
+			warning("Attempt to use unknown GetTime mode %d\n", mode);
 			break;
 		}
 		}
@@ -598,12 +598,12 @@
 		if (dest && src)
 			memcpy(dest, src, size);
 		else {
-			SCIkdebug(SCIkWARNING, "Warning: Could not execute kMemory:memcpy of %d bytes:\n", size);
+			warning("Warning: Could not execute kMemory:memcpy of %d bytes:", size);
 			if (!dest) {
-				SCIkdebug(SCIkWARNING, "  dest ptr ("PREG") invalid/memory region too small\n", PRINT_REG(argv[1]));
+				warning("  dest ptr ("PREG") invalid/memory region too small", PRINT_REG(argv[1]));
 			}
 			if (!src) {
-				SCIkdebug(SCIkWARNING, "  src ptr ("PREG") invalid/memory region too small\n", PRINT_REG(argv[2]));
+				warning("  src ptr ("PREG") invalid/memory region too small", PRINT_REG(argv[2]));
 			}
 		}
 		break;
@@ -649,7 +649,7 @@
 reg_t kstub(state_t *s, int funct_nr, int argc, reg_t *argv) {
 	int i;
 
-	SCIkwarn(SCIkWARNING, "Unimplemented syscall: %s[%x](", s->kernel_names[funct_nr], funct_nr);
+	warning("Unimplemented syscall: %s[%x](", s->kernel_names[funct_nr], funct_nr);
 
 	for (i = 0; i < argc; i++) {
 		sciprintf(PREG, PRINT_REG(argv[i]));
@@ -663,7 +663,7 @@
 reg_t kNOP(state_t *s, int funct_nr, int argc, reg_t *argv) {
 	const char *problem = (const char*)(s->kfunct_table[funct_nr].orig_name ? "unmapped" : "NOP");
 
-	SCIkwarn(SCIkWARNING, "Warning: Kernel function 0x%02x invoked: %s", funct_nr, problem);
+	warning("Warning: Kernel function 0x%02x invoked: %s", funct_nr, problem);
 
 	if (s->kfunct_table[funct_nr].orig_name && strcmp(s->kfunct_table[funct_nr].orig_name, SCRIPT_UNKNOWN_FUNCTION_STRING)) {
 		sciprintf(" (but its name is known to be %s)", s->kfunct_table[funct_nr].orig_name);

Modified: scummvm/trunk/engines/sci/engine/kevent.cpp
===================================================================
--- scummvm/trunk/engines/sci/engine/kevent.cpp	2009-02-20 20:01:31 UTC (rev 38616)
+++ scummvm/trunk/engines/sci/engine/kevent.cpp	2009-02-20 20:11:12 UTC (rev 38617)
@@ -219,6 +219,6 @@
 }
 
 reg_t kJoystick(state_t *s, int funct_nr, int argc, reg_t *argv) {
-	SCIkdebug(SCIkSTUB, "Unimplemented syscall 'Joystick()'\n", funct_nr);
+	warning("Unimplemented syscall 'Joystick()");
 	return NULL_REG;
 }

Modified: scummvm/trunk/engines/sci/engine/kfile.cpp
===================================================================
--- scummvm/trunk/engines/sci/engine/kfile.cpp	2009-02-20 20:01:31 UTC (rev 38616)
+++ scummvm/trunk/engines/sci/engine/kfile.cpp	2009-02-20 20:11:12 UTC (rev 38617)
@@ -511,7 +511,7 @@
 	while (IS_VALID_FD(fd = open(testpath, O_RDONLY))) {
 		close(fd);
 		if (testpath[pathlen - 2] == 'z') { // Failed.
-			SCIkwarn(SCIkWARNING, "Failed to find non-existing file for free space test\n");
+			warning("Failed to find non-existing file for free space test");
 			free(testpath);
 			return NULL_REG;
 		}
@@ -530,8 +530,8 @@
 	fd = creat(testpath, 0600);
 
 	if (!IS_VALID_FD(fd)) {
-		SCIkwarn(SCIkWARNING, "Could not test for disk space: %s\n", strerror(errno));
-		SCIkwarn(SCIkWARNING, "Test path was '%s'\n", testpath);
+		warning("Could not test for disk space: %s", strerror(errno));
+		warning("Test path was '%s'", testpath);
 		free(testpath);
 		return NULL_REG;
 	}
@@ -674,7 +674,7 @@
 
 		strcpy(game_id_file_name, game_id);
 		strcat(game_id_file_name, FREESCI_ID_SUFFIX);
-		SCIkwarn(SCIkWARNING, "Savegame index list not initialized!\n");
+		warning("Savegame index list not initialized");
 		update_savegame_indices(game_id_file_name);
 	}
 
@@ -832,7 +832,7 @@
 
 		strcpy(game_id_file_name, game_id);
 		strcat(game_id_file_name, FREESCI_ID_SUFFIX);
-		SCIkwarn(SCIkWARNING, "Savegame index list not initialized!\n");
+		warning("Savegame index list not initialized");
 		update_savegame_indices(game_id_file_name);
 	}
 

Modified: scummvm/trunk/engines/sci/engine/kgraphics.cpp
===================================================================
--- scummvm/trunk/engines/sci/engine/kgraphics.cpp	2009-02-20 20:01:31 UTC (rev 38616)
+++ scummvm/trunk/engines/sci/engine/kgraphics.cpp	2009-02-20 20:11:12 UTC (rev 38617)
@@ -88,7 +88,7 @@
 	int val = !!(x); \
 	if (val) { \
 		if (val == GFX_ERROR) \
-			SCIkwarn(SCIkWARNING, "GFX subsystem returned error on \"" #x "\"!\n"); \
+			warning("GFX subsystem returned error on \"" #x "\""); \
 		else {\
 			SCIkwarn(SCIkERROR, "GFX subsystem fatal error condition on \"" #x "\"!\n"); \
 			vm_handle_fatal_error(s, __LINE__, __FILE__); \
@@ -164,13 +164,13 @@
 		if (nr == 15)
 			return 0xffff;
 		else {
-			SCIkwarn(SCIkWARNING, "Attempt to get priority band %d\n", nr);
+			warning("Attempt to get priority band %d", nr);
 		}
 		return 0;
 	}
 
 	if (s->version < SCI_VERSION_FTU_PRIORITY_14_ZONES && (nr < 0 || nr > 15)) {
-		SCIkwarn(SCIkWARNING, "Attempt to get priority band %d\n", nr);
+		warning("Attempt to get priority band %d", nr);
 		return 0;
 	}
 
@@ -204,14 +204,14 @@
 	int port_nr = s->port->ID;
 
 	if (!handle.segment) {
-		SCIkwarn(SCIkWARNING, "Attempt to restore box with zero handle\n");
+		warning("Attempt to restore box with zero handle");
 		return;
 	}
 
 	ptr = (gfxw_snapshot_t **) kmem(s, handle);
 
 	if (!ptr) {
-		SCIkwarn(SCIkWARNING, "Attempt to restore invalid handle %04x\n", handle);
+		warning("Attempt to restore invalid handle %04x", handle);
 		return;
 	}
 
@@ -418,7 +418,7 @@
 		break;
 
 	default:
-		SCIkwarn(SCIkWARNING, "Show(%x) selects unknown map\n", s->pic_visible_map);
+		warning("Show(%x) selects unknown map", s->pic_visible_map);
 
 	}
 
@@ -599,7 +599,7 @@
 
 	default:
 
-		SCIkdebug(SCIkSTUB, "Unhandled Graph() operation %04x\n", SKPV(0));
+		warning("Unhandled Graph() operation %04x", SKPV(0));
 
 	}
 
@@ -846,7 +846,7 @@
 			SCIkdebug(SCIkBRESEN, "  comparing against "PREG"\n", PRINT_REG(other_obj));
 
 			if (!is_object(s, other_obj)) {
-				SCIkdebug(SCIkWARNING, "CanBeHere() cliplist contains non-object %04x\n", other_obj);
+				warning("CanBeHere() cliplist contains non-object %04x", other_obj);
 			} else if (!REG_EQ(other_obj, obj)) { // Clipping against yourself is not recommended
 
 				if (collides_with(s, abs_zone, other_obj, 0, GASEOUS_VIEW_MASK_PASSIVE, funct_nr, argc, argv)) {
@@ -897,7 +897,7 @@
 	Common::Point offset;
 
 	if (argc != 3) {
-		SCIkwarn(SCIkWARNING, "CelHigh called with %d parameters!\n", argc);
+		warning("CelHigh called with %d parameters", argc);
 	}
 
 	if (gfxop_get_cel_parameters(s->gfx_state, view, loop, cel, &width, &height, &offset)) {
@@ -915,7 +915,7 @@
 	Common::Point offset;
 
 	if (argc != 3) {
-		SCIkwarn(SCIkWARNING, "CelHigh called with %d parameters!\n", argc);
+		warning("CelHigh called with %d parameters", argc);
 	}
 
 	if (gfxop_get_cel_parameters(s->gfx_state, view, loop, cel, &width, &height, &offset)) {
@@ -1296,7 +1296,7 @@
 	case 6 :
 		break;
 	default :
-		SCIkdebug(SCIkWARNING, "Unimplemented subfunction: %d\n", UKPV(0));
+		warning("Unimplemented subfunction: %d", UKPV(0));
 	}
 
 	return s->r_acc;
@@ -1380,7 +1380,7 @@
 				int textlen;
 
 				if (!text) {
-					SCIkdebug(SCIkWARNING, "Could not draw control: "PREG" does not reference text!\n", PRINT_REG(text_pos));
+					warning("Could not draw control: "PREG" does not reference text", PRINT_REG(text_pos));
 					return s->r_acc;
 				}
 
@@ -1527,7 +1527,7 @@
 		break;
 
 		default:
-			SCIkwarn(SCIkWARNING, "Attempt to edit control type %d\n", ct_type);
+			warning("Attempt to edit control type %d", ct_type);
 		}
 	}
 
@@ -1643,7 +1643,7 @@
 		break;
 
 	default:
-		SCIkwarn(SCIkWARNING, "Unknown control type: %d at "PREG", at (%d, %d) size %d x %d\n",
+		warning("Unknown control type: %d at "PREG", at (%d, %d) size %d x %d",
 		         type, PRINT_REG(obj), x, y, xl, yl);
 	}
 
@@ -1673,7 +1673,7 @@
 	reg_t obj = make_reg(view->ID, view->subID);
 
 	if (!is_object(s, obj))
-		SCIkwarn(SCIkWARNING, "View %d does not contain valid object reference "PREG"\n", view->ID, PRINT_REG(obj));
+		warning("View %d does not contain valid object reference "PREG"", view->ID, PRINT_REG(obj));
 
 	if (!(view->signalp && (((reg_t *)view->signalp)->offset & _K_VIEW_SIG_FLAG_IGNORE_ACTOR))) {
 		abs_rect_t abs_zone = get_nsrect(s, make_reg(view->ID, view->subID), 1);
@@ -1793,7 +1793,7 @@
 							if (!kfree(s, mem_handle)) {
 								*((reg_t*)(widget->under_bitsp)) = make_reg(0, widget->under_bits = 0);
 							} else {
-								SCIkwarn(SCIkWARNING, "Treating viewobj "PREG" as no longer present\n", PRINT_REG(obj));
+								warning("Treating viewobj "PREG" as no longer present", PRINT_REG(obj));
 								obj = NULL_REG;
 							}
 						}
@@ -1801,9 +1801,9 @@
 
 				if (is_object(s, obj)) {
 					if (invoke_selector(INV_SEL(obj, delete_, 1), 0))
-						SCIkwarn(SCIkWARNING, "Object at "PREG" requested deletion, but does not have a delete funcselector\n", PRINT_REG(obj));
+						warning("Object at "PREG" requested deletion, but does not have a delete funcselector", PRINT_REG(obj));
 					if (_k_animate_ran) {
-						SCIkwarn(SCIkWARNING, "Object at "PREG" invoked kAnimate() during deletion!\n", PRINT_REG(obj));
+						warning("Object at "PREG" invoked kAnimate() during deletion", PRINT_REG(obj));
 						return dropped;
 					}
 
@@ -1923,7 +1923,7 @@
 
 		return widget;
 	} else {
-		SCIkwarn(SCIkWARNING, "Could not generate dynview widget for %d/%d/%d\n", view_nr, loop, cel);
+		warning("Could not generate dynview widget for %d/%d/%d", view_nr, loop, cel);
 		return NULL;
 	}
 }
@@ -2278,7 +2278,7 @@
 		list_t *list;
 
 		if (!list_ref.segment) {
-			SCIkdebug(SCIkWARNING, "Attempt to AddToPic single non-list: "PREG"\n", PRINT_REG(list_ref));
+			warning("Attempt to AddToPic single non-list: "PREG"", PRINT_REG(list_ref));
 			return s->r_acc;
 		}
 
@@ -2923,7 +2923,7 @@
 
 	default:
 		if (s->pic_animate != K_ANIMATE_OPEN_SIMPLE)
-			SCIkwarn(SCIkWARNING, "Unknown opening animation 0x%02x\n", s->pic_animate);
+			warning("Unknown opening animation 0x%02x", s->pic_animate);
 		GRAPH_UPDATE_BOX(s, 0, 10, 320, 190);
 
 	}
@@ -3155,7 +3155,7 @@
 					if (temp == -1)
 						color0 = transparent;
 					else
-						SCIkwarn(SCIkWARNING, "Display: Attempt to set invalid fg color %d\n", temp);
+						warning("Display: Attempt to set invalid fg color %d", temp);
 			break;
 
 		case K_DISPLAY_SET_BGCOLOR:
@@ -3172,7 +3172,7 @@
 					if (temp == -1)
 						bg_color = transparent;
 					else
-						SCIkwarn(SCIkWARNING, "Display: Attempt to set invalid fg color %d\n", temp);
+						warning("Display: Attempt to set invalid fg color %d", temp);
 			break;
 
 		case K_DISPLAY_SET_GRAYTEXT:

Modified: scummvm/trunk/engines/sci/engine/klists.cpp
===================================================================
--- scummvm/trunk/engines/sci/engine/klists.cpp	2009-02-20 20:01:31 UTC (rev 38616)
+++ scummvm/trunk/engines/sci/engine/klists.cpp	2009-02-20 20:11:12 UTC (rev 38617)
@@ -346,7 +346,7 @@
 	}
 
 	if (argc != 3) {
-		SCIkdebug(SCIkWARNING, "Aborting.\n");
+		warning("kAddAfter: Haven't got 3 arguments, aborting");
 		return NULL_REG;
 	}
 

Modified: scummvm/trunk/engines/sci/engine/kmath.cpp
===================================================================
--- scummvm/trunk/engines/sci/engine/kmath.cpp	2009-02-20 20:01:31 UTC (rev 38616)
+++ scummvm/trunk/engines/sci/engine/kmath.cpp	2009-02-20 20:11:12 UTC (rev 38617)
@@ -124,7 +124,7 @@
 	double cosval = cos(angle * PI / 180.0);
 
 	if ((cosval < 0.0001) && (cosval > 0.0001)) {
-		SCIkwarn(SCIkWARNING, "Attepted division by zero\n");
+		warning("Attepted division by zero");
 		return make_reg(0, (gint16)0x8000);
 	} else
 		return make_reg(0, (gint16)(value / cosval));
@@ -136,7 +136,7 @@
 	double sinval = sin(angle * PI / 180.0);
 
 	if ((sinval < 0.0001) && (sinval > 0.0001)) {
-		SCIkwarn(SCIkWARNING, "Attepted division by zero\n");
+		warning("Attepted division by zero");
 		return make_reg(0, (gint16)0x8000);
 	} else
 		return make_reg(0, (gint16)(value / sinval));
@@ -148,7 +148,7 @@
 
 	param -= 90;
 	if ((param % 90) == 0) {
-		SCIkwarn(SCIkWARNING, "Attempted tan(pi/2)");
+		warning("Attempted tan(pi/2)");
 		return make_reg(0, (gint16)0x8000);
 	} else
 		return make_reg(0, (gint16) - (tan(param * PI / 180.0) * scale));
@@ -159,7 +159,7 @@
 	int scale = SKPV_OR_ALT(1, 1);
 
 	if ((param % 90) == 0) {
-		SCIkwarn(SCIkWARNING, "Attempted tan(pi/2)");
+		warning("Attempted tan(pi/2)");
 		return make_reg(0, (gint16)0x8000);
 	} else
 		return make_reg(0, (gint16)(tan(param * PI / 180.0) * scale));

Modified: scummvm/trunk/engines/sci/engine/kmovement.cpp
===================================================================
--- scummvm/trunk/engines/sci/engine/kmovement.cpp	2009-02-20 20:01:31 UTC (rev 38616)
+++ scummvm/trunk/engines/sci/engine/kmovement.cpp	2009-02-20 20:11:12 UTC (rev 38617)
@@ -257,13 +257,13 @@
 		byte *buf;
 
 		if (obj == NULL) {
-			SCIkwarn(SCIkWARNING, "bresenham_autodetect failed!");
+			warning("bresenham_autodetect failed");
 			handle_movecnt = INCREMENT_MOVECNT; // Most games do this, so best guess
 			return;
 		}
 
 		if (lookup_selector(s, motion_class, s->selector_map.doit, NULL, &fptr) != SELECTOR_METHOD) {
-			SCIkwarn(SCIkWARNING, "bresenham_autodetect failed!");
+			warning("bresenham_autodetect failed");
 			handle_movecnt = INCREMENT_MOVECNT; // Most games do this, so best guess
 			return;
 		}
@@ -272,7 +272,7 @@
 		handle_movecnt = (SCI_VERSION_MAJOR(s->version) == 0 || checksum_bytes(buf, 8) == 0x216) ? INCREMENT_MOVECNT : IGNORE_MOVECNT;
 		sciprintf("b-moveCnt action based on checksum: %s\n", handle_movecnt == IGNORE_MOVECNT ? "ignore" : "increment");
 	} else {
-		SCIkwarn(SCIkWARNING, "bresenham_autodetect failed!");
+		warning("bresenham_autodetect failed");
 		handle_movecnt = INCREMENT_MOVECNT; // Most games do this, so best guess
 	}
 }
@@ -396,14 +396,14 @@
 	s->r_acc = make_reg(0, -1);
 
 	if (!is_heap_object(s, avoider)) {
-		SCIkwarn(SCIkWARNING, "DoAvoider() where avoider "PREG" is not an object\n", PRINT_REG(avoider));
+		warning("DoAvoider() where avoider "PREG" is not an object", PRINT_REG(avoider));
 		return NULL_REG;
 	}
 
 	client = GET_SEL32(avoider, client);
 
 	if (!is_heap_object(s, client)) {
-		SCIkwarn(SCIkWARNING, "DoAvoider() where client "PREG" is not an object\n", PRINT_REG(client));
+		warning("DoAvoider() where client "PREG" is not an object", PRINT_REG(client));
 		return NULL_REG;
 	}
 
@@ -412,7 +412,7 @@
 
 	if (!is_heap_object(s, mover)) {
 		if (mover.segment) {
-			SCIkwarn(SCIkWARNING, "DoAvoider() where mover "PREG" is not an object\n", PRINT_REG(mover));
+			warning("DoAvoider() where mover "PREG" is not an object", PRINT_REG(mover));
 		}
 		return s->r_acc;
 	}
@@ -484,7 +484,7 @@
 				angle -= 360;
 		}
 
-		SCIkwarn(SCIkWARNING, "DoAvoider failed for avoider "PREG"\n", PRINT_REG(avoider));
+		warning("DoAvoider failed for avoider "PREG"", PRINT_REG(avoider));
 	} else {
 		int heading = GET_SEL32V(client, heading);
 

Modified: scummvm/trunk/engines/sci/engine/kpathing.cpp
===================================================================
--- scummvm/trunk/engines/sci/engine/kpathing.cpp	2009-02-20 20:01:31 UTC (rev 38616)
+++ scummvm/trunk/engines/sci/engine/kpathing.cpp	2009-02-20 20:11:12 UTC (rev 38617)
@@ -252,7 +252,7 @@
 	list = LOOKUP_LIST(poly_list);
 
 	if (!list) {
-		SCIkwarn(SCIkWARNING, "Could not obtain polygon list\n");
+		warning("Could not obtain polygon list");
 		return;
 	}
 
@@ -298,7 +298,7 @@
 	list = LOOKUP_LIST(poly_list);
 
 	if (!list) {
-		SCIkwarn(SCIkWARNING, "Could not obtain polygon list\n");
+		warning("Could not obtain polygon list");
 		return;
 	}
 
@@ -1522,7 +1522,7 @@
 	}
 
 	default:
-		SCIkwarn(SCIkWARNING, "Unknown AvoidPath subfunction %d\n",
+		warning("Unknown AvoidPath subfunction %d",
 		         argc);
 		return NULL_REG;
 		break;

Modified: scummvm/trunk/engines/sci/engine/kscripts.cpp
===================================================================
--- scummvm/trunk/engines/sci/engine/kscripts.cpp	2009-02-20 20:01:31 UTC (rev 38616)
+++ scummvm/trunk/engines/sci/engine/kscripts.cpp	2009-02-20 20:11:12 UTC (rev 38617)
@@ -40,14 +40,14 @@
 	reg_t *address;
 
 	if ((selector_id < 0) || (selector_id > s->selector_names_nr)) {
-		SCIkwarn(SCIkWARNING, "Attempt to write to invalid selector %d of"
-		         " object at "PREG" (%s L%d).\n", selector_id, PRINT_REG(object), fname, line);
+		warning("Attempt to write to invalid selector %d of"
+		         " object at "PREG" (%s L%d).", selector_id, PRINT_REG(object), fname, line);
 		return;
 	}
 
 	if (lookup_selector(s, object, selector_id, &address, NULL) != SELECTOR_VARIABLE)
-		SCIkwarn(SCIkWARNING, "Selector '%s' of object at %04x could not be"
-		         " written to (%s L%d)\n", s->selector_names[selector_id], object, fname, line);
+		warning("Selector '%s' of object at %04x could not be"
+		         " written to (%s L%d)", s->selector_names[selector_id], object, fname, line);
 	else
 		*address = value;
 }
@@ -209,7 +209,7 @@
 
 	underBits = GET_SEL32V(victim_addr, underBits);
 	if (underBits) {
-		SCIkwarn(SCIkWARNING, "Clone "PREG" was cleared with underBits set\n", PRINT_REG(victim_addr));
+		warning("Clone "PREG" was cleared with underBits set", PRINT_REG(victim_addr));
 	}
 #if 0
 	if (s->dyn_views) {  // Free any widget associated with the clone

Modified: scummvm/trunk/engines/sci/engine/ksound.cpp
===================================================================
--- scummvm/trunk/engines/sci/engine/ksound.cpp	2009-02-20 20:01:31 UTC (rev 38616)
+++ scummvm/trunk/engines/sci/engine/ksound.cpp	2009-02-20 20:11:12 UTC (rev 38617)
@@ -98,7 +98,7 @@
 		if (song->data[0] == 0xf0)
 			priority = song->data[1];
 		else
-			SCIkdebug(SCIkWARNING, "Attempt to unset song priority when there is no built-in value!\n");
+			warning("Attempt to unset song priority when there is no built-in value");
 
 		flags &= ~SCI1_SOUND_FLAG_SCRIPTED_PRI;
 	} else flags |= SCI1_SOUND_FLAG_SCRIPTED_PRI;
@@ -131,7 +131,7 @@
 	while ((result = sfx_poll(&s->sound, &handle, &cue))) {
 		reg_t obj = DEFROBNICATE_HANDLE(handle);
 		if (!is_object(s, obj)) {
-			SCIkdebug(SCIkWARNING, "Non-object "PREG" received sound signal (%d/%d)\n", PRINT_REG(obj), result, cue);
+			warning("Non-object "PREG" received sound signal (%d/%d)", PRINT_REG(obj), result, cue);
 			return;
 		}
 
@@ -351,7 +351,7 @@
 		break;
 
 	default:
-		SCIkwarn(SCIkWARNING, "Unhandled DoSound command: %x\n", command);
+		warning("Unhandled DoSound command: %x", command);
 
 	}
 	//	process_sound_events(s); /* Take care of incoming events */

Modified: scummvm/trunk/engines/sci/engine/kstring.cpp
===================================================================
--- scummvm/trunk/engines/sci/engine/kstring.cpp	2009-02-20 20:01:31 UTC (rev 38616)
+++ scummvm/trunk/engines/sci/engine/kstring.cpp	2009-02-20 20:11:12 UTC (rev 38617)
@@ -124,7 +124,7 @@
 	said_block = (byte *) kernel_dereference_bulk_pointer(s, heap_said_block, 0);
 
 	if (!said_block) {
-		SCIkdebug(SCIkWARNING, "Said on non-string, pointer "PREG"\n", PRINT_REG(heap_said_block));
+		warning("Said on non-string, pointer "PREG"", PRINT_REG(heap_said_block));
 		return NULL_REG;
 	}
 
@@ -235,7 +235,7 @@
 
 						synpos++;
 					}
-			} else SCIkwarn(SCIkWARNING, "Synonyms of script.%03d were requested, but script is not available\n");
+			} else warning("Synonyms of script.%03d were requested, but script is not available");
 
 		}
 
@@ -379,12 +379,12 @@
 	char *src = (char *) kernel_dereference_bulk_pointer(s, argv[1], 0);
 
 	if (!dest) {
-		SCIkdebug(SCIkWARNING, "Attempt to strcpy TO invalid pointer "PREG"!\n",
+		warning("Attempt to strcpy TO invalid pointer "PREG"",
 		          PRINT_REG(argv[0]));
 		return NULL_REG;
 	}
 	if (!src) {
-		SCIkdebug(SCIkWARNING, "Attempt to strcpy FROM invalid pointer "PREG"!\n",
+		warning("Attempt to strcpy FROM invalid pointer "PREG"",
 		          PRINT_REG(argv[1]));
 		return NULL_REG;
 	}
@@ -399,7 +399,7 @@
 				reg_t *srcp = (reg_t *) src;
 
 				int i;
-				SCIkdebug(SCIkWARNING, "Performing reg_t to raw conversion for AvoidPath\n");
+				warning("Performing reg_t to raw conversion for AvoidPath");
 				for (i = 0; i < -length / 2; i++) {
 					dest[2 * i] = srcp->offset & 0xff;
 					dest[2 * i + 1] = srcp->offset >> 8;
@@ -421,7 +421,7 @@
 	reg_t *dest2;
 
 	if (!dest) {
-		SCIkdebug(SCIkWARNING, "Attempt to StrAt at invalid pointer "PREG"!\n",
+		warning("Attempt to StrAt at invalid pointer "PREG"",
 		          PRINT_REG(argv[0]));
 		return NULL_REG;
 	}

Modified: scummvm/trunk/engines/sci/engine/scriptdebug.cpp
===================================================================
--- scummvm/trunk/engines/sci/engine/scriptdebug.cpp	2009-02-20 20:01:31 UTC (rev 38616)
+++ scummvm/trunk/engines/sci/engine/scriptdebug.cpp	2009-02-20 20:11:12 UTC (rev 38617)
@@ -2525,7 +2525,6 @@
 }
 
 const generic_config_flag_t SCIk_Debug_Names[SCIk_DEBUG_MODES] = {
-	{"Stubs", 'u', (1 << SCIkSTUB_NR)},
 	{"Lists and nodes", 'l', (1 << 1)},
 	{"Graphics", 'g', (1 << 2)},
 	{"Character handling", 'c', (1 << 3)},

Modified: scummvm/trunk/engines/sci/engine/vm.cpp
===================================================================
--- scummvm/trunk/engines/sci/engine/vm.cpp	2009-02-20 20:01:31 UTC (rev 38616)
+++ scummvm/trunk/engines/sci/engine/vm.cpp	2009-02-20 20:11:12 UTC (rev 38617)
@@ -23,6 +23,7 @@
  *
  */
 
+#include "common/debug.h"
 
 #include "sci/include/sciresource.h"
 #include "sci/include/engine.h"
@@ -739,7 +740,7 @@
 			scr = script_locate_by_segment(s, xs->addr.pc.segment);
 			if (!scr) {
 				/* No script? Implicit return via fake instruction buffer */
-				SCIkdebug(SCIkWARNING, "Running on non-existant script in segment %x!\n", xs->addr.pc.segment);
+				warning("Running on non-existant script in segment %x!\n", xs->addr.pc.segment);
 				code_buf = _fake_return_buffer;
 #ifndef DISABLE_VALIDATIONS
 				code_buf_size = 2;
@@ -760,7 +761,7 @@
 
 				local_script = script_locate_by_segment(s, xs->local_segment);
 				if (!local_script) {
-					SCIkdebug(SCIkWARNING, "Could not find local script from segment %x!\n", xs->local_segment);
+					warning("Could not find local script from segment %x", xs->local_segment);
 					local_script = NULL;
 					variables_base[VAR_LOCAL] = variables[VAR_LOCAL] = NULL;
 #ifndef DISABLE_VALIDATIONS

Modified: scummvm/trunk/engines/sci/gfx/resource/sci_pic_0.cpp
===================================================================
--- scummvm/trunk/engines/sci/gfx/resource/sci_pic_0.cpp	2009-02-20 20:01:31 UTC (rev 38616)
+++ scummvm/trunk/engines/sci/gfx/resource/sci_pic_0.cpp	2009-02-20 20:11:12 UTC (rev 38617)
@@ -132,7 +132,7 @@
 			gfx_sci0_pic_colors[i].b = INTERCOL(gfx_sci0_image_colors[sci0_palette][i & 0xf].b,
 			                                    gfx_sci0_image_colors[sci0_palette][i >> 4].b);
 		}
-		//WARNING("Uncomment me after fixing sci0_palette changes to reset me");
+		//warning("Uncomment me after fixing sci0_palette changes to reset me");
 		/*  _gfxr_pic0_colors_initialized = 1; */
 	}
 }
@@ -1873,7 +1873,7 @@
 
 		case PIC_OP_TERMINATE:
 			p0printf("Terminator\n");
-			/* WARNING( "ARTIFACT REMOVAL CODE is commented out!") */
+			/* warning( "ARTIFACT REMOVAL CODE is commented out!") */
 			/* _gfxr_vismap_remove_artifacts(); */
 			return;
 

Modified: scummvm/trunk/engines/sci/include/kdebug.h
===================================================================
--- scummvm/trunk/engines/sci/include/kdebug.h	2009-02-20 20:01:31 UTC (rev 38616)
+++ scummvm/trunk/engines/sci/include/kdebug.h	2009-02-20 20:11:12 UTC (rev 38617)
@@ -29,11 +29,10 @@
 #define _SCI_KDEBUG_H_
 
 struct _state;
-#define SCIk_DEBUG_MODES 18
+#define SCIk_DEBUG_MODES 17
 
 #define SCIkERROR_NR -2
 #define SCIkWARNING_NR -1
-#define SCIkSTUB_NR 0
 #define SCIkFUNCCHK_NR 5
 #define SCIkSOUNDCHK_NR 7
 #define SCIkGFXDRIVER_NR 8
@@ -42,8 +41,6 @@
 #define SCIkAVOIDPATH_NR 17
 
 #define SCIkERROR      s, __FILE__, __LINE__, SCIkERROR_NR
-#define SCIkWARNING    s, __FILE__, __LINE__, SCIkWARNING_NR
-#define SCIkSTUB       s, __FILE__, __LINE__, SCIkSTUB_NR
 #define SCIkNODES      s, __FILE__, __LINE__, 1
 #define SCIkGRAPHICS   s, __FILE__, __LINE__, 2
 #define SCIkSTRINGS    s, __FILE__, __LINE__, 3

Modified: scummvm/trunk/engines/sci/include/kernel.h
===================================================================
--- scummvm/trunk/engines/sci/include/kernel.h	2009-02-20 20:01:31 UTC (rev 38616)
+++ scummvm/trunk/engines/sci/include/kernel.h	2009-02-20 20:11:12 UTC (rev 38617)
@@ -27,6 +27,7 @@
 #define _SCI_KERNEL_H_
 
 #include "common/scummsys.h"
+#include "common/debug.h"
 
 #include "sci/include/kdebug.h"
 #include "sci/include/uinput.h"
@@ -113,12 +114,6 @@
 /******************** Debug functionality ********************/
 #define KERNEL_OOPS(reason) kernel_oops(s, __FILE__, __LINE__, reason)
 
-/* Non-fatal assertion */
-#define SCIkASSERT(a) if (!(a)) { \
-  SCIkwarn(SCIkERROR, "Assertion " #a " failed in " __FILE__ " line %d\n", __LINE__); \
-  return; \
-}
-
 #ifdef SCI_KERNEL_DEBUG
 
 #define CHECK_THIS_KERNEL_FUNCTION if (s->debug_mode & (1 << SCIkFUNCCHK_NR)) {\

Modified: scummvm/trunk/engines/sci/include/resource.h
===================================================================
--- scummvm/trunk/engines/sci/include/resource.h	2009-02-20 20:01:31 UTC (rev 38616)
+++ scummvm/trunk/engines/sci/include/resource.h	2009-02-20 20:11:12 UTC (rev 38617)
@@ -298,6 +298,4 @@
 #  define BREAKPOINT() { fprintf(stderr, "Missed breakpoint in %s, line %d\n", __FILE__, __LINE__); *((int *) NULL) = 42; }
 #endif  /* !BREAKPOINT() */
 
-#define WARNING(foo) {char i; i = 500;}
-
 #endif

Modified: scummvm/trunk/engines/sci/sci.cpp
===================================================================
--- scummvm/trunk/engines/sci/sci.cpp	2009-02-20 20:01:31 UTC (rev 38616)
+++ scummvm/trunk/engines/sci/sci.cpp	2009-02-20 20:11:12 UTC (rev 38617)
@@ -139,7 +139,24 @@
 	//printf("%s\n", _gameDataPath.c_str());
 
 	// Set up the engine specific debug levels
-	//Common::addSpecialDebugLevel(SCI_DEBUG_RESOURCES, "resources", "Debug the resources loading");
+	Common::addDebugChannel(kDebugLevelError, "Error", "Script error debugging");
+	Common::addDebugChannel(kDebugLevelNodes, "Lists", "Lists and nodes debugging");
+	Common::addDebugChannel(kDebugLevelGraphics, "Graphics", "Graphics debugging");
+	Common::addDebugChannel(kDebugLevelStrings, "Strings", "Strings debugging");
+	Common::addDebugChannel(kDebugLevelMem, "Memory", "Memory debugging");
+	Common::addDebugChannel(kDebugLevelFuncCheck, "Func", "Function parameter debugging");
+	Common::addDebugChannel(kDebugLevelBresen, "Bresenham", "Bresenham algorithms debugging");
+	Common::addDebugChannel(kDebugLevelSound, "Sound", "Sound debugging");
+	Common::addDebugChannel(kDebugLevelGfxDriver, "Gfxdriver", "Gfx driver debugging");
+	Common::addDebugChannel(kDebugLevelBaseSetter, "Base", "Base Setter debugging");
+	Common::addDebugChannel(kDebugLevelParser, "Parser", "Parser debugging");
+	Common::addDebugChannel(kDebugLevelMenu, "Menu", "Menu handling debugging");
+	Common::addDebugChannel(kDebugLevelSaid, "Said", "Said specs debugging");
+	Common::addDebugChannel(kDebugLevelFile, "File", "File I/O debugging");
+	Common::addDebugChannel(kDebugLevelTime, "Time", "Time debugging");
+	Common::addDebugChannel(kDebugLevelRoom, "Room", "Room number debugging");
+	Common::addDebugChannel(kDebugLevelEmu, "Emu", "Alternate emulation debugging");
+	Common::addDebugChannel(kDebugLevelAvoidPath, "Pathfinding", "Pathfinding debugging");
 
 	printf("SciEngine::SciEngine\n");
 }

Modified: scummvm/trunk/engines/sci/sci.h
===================================================================
--- scummvm/trunk/engines/sci/sci.h	2009-02-20 20:01:31 UTC (rev 38616)
+++ scummvm/trunk/engines/sci/sci.h	2009-02-20 20:11:12 UTC (rev 38617)
@@ -32,9 +32,25 @@
 namespace Sci {
 
 // our engine debug levels
-enum {
-	SCI_DEBUG_RESOURCES = 1 << 0,
-	SCI_DEBUG_todo = 1 << 1
+enum kDebugLevels {
+	kDebugLevelError      = 1 << 0,
+	kDebugLevelNodes      = 1 << 1,
+	kDebugLevelGraphics   = 1 << 2,
+	kDebugLevelStrings    = 1 << 3,
+	kDebugLevelMem        = 1 << 4,
+	kDebugLevelFuncCheck  = 1 << 5,
+	kDebugLevelBresen     = 1 << 6,
+	kDebugLevelSound      = 1 << 7,
+	kDebugLevelGfxDriver  = 1 << 8,
+	kDebugLevelBaseSetter = 1 << 9,
+	kDebugLevelParser     = 1 << 10,
+	kDebugLevelMenu       = 1 << 11,
+	kDebugLevelSaid       = 1 << 12,
+	kDebugLevelFile       = 1 << 13,
+	kDebugLevelTime       = 1 << 14,
+	kDebugLevelRoom       = 1 << 15,
+	kDebugLevelEmu        = 1 << 16,
+	kDebugLevelAvoidPath  = 1 << 17
 };
 
 struct GameFlags {


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