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

wjpalenstijn at users.sourceforge.net wjpalenstijn at users.sourceforge.net
Sat Feb 21 15:11:41 CET 2009


Revision: 38696
          http://scummvm.svn.sourceforge.net/scummvm/?rev=38696&view=rev
Author:   wjpalenstijn
Date:     2009-02-21 14:11:41 +0000 (Sat, 21 Feb 2009)

Log Message:
-----------
revert large parts of r38621. error() is for fatal errors and does not return. warning() is not for debugging status messages.

Modified Paths:
--------------
    scummvm/trunk/engines/sci/engine/game.cpp
    scummvm/trunk/engines/sci/engine/gc.cpp
    scummvm/trunk/engines/sci/engine/heap.cpp
    scummvm/trunk/engines/sci/engine/kernel.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/kmovement.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/scriptconsole.cpp
    scummvm/trunk/engines/sci/engine/scriptdebug.cpp
    scummvm/trunk/engines/sci/engine/seg_manager.cpp
    scummvm/trunk/engines/sci/engine/sys_strings.cpp
    scummvm/trunk/engines/sci/engine/vm.cpp
    scummvm/trunk/engines/sci/gfx/font.cpp
    scummvm/trunk/engines/sci/gfx/gfx_driver.cpp
    scummvm/trunk/engines/sci/gfx/gfx_res_options.cpp
    scummvm/trunk/engines/sci/gfx/gfx_resource.cpp
    scummvm/trunk/engines/sci/gfx/gfx_support.cpp
    scummvm/trunk/engines/sci/gfx/gfx_tools.cpp
    scummvm/trunk/engines/sci/gfx/operations.cpp
    scummvm/trunk/engines/sci/gfx/resmgr.cpp
    scummvm/trunk/engines/sci/gfx/resource/sci_pic_0.cpp
    scummvm/trunk/engines/sci/gfx/resource/sci_view_1.cpp
    scummvm/trunk/engines/sci/gfx/sbtree.cpp
    scummvm/trunk/engines/sci/gfx/sci_widgets.cpp
    scummvm/trunk/engines/sci/gfx/widgets.cpp
    scummvm/trunk/engines/sci/include/heapmgr.h
    scummvm/trunk/engines/sci/include/kdebug.h
    scummvm/trunk/engines/sci/include/resource.h
    scummvm/trunk/engines/sci/sci.cpp
    scummvm/trunk/engines/sci/scicore/console.cpp
    scummvm/trunk/engines/sci/scicore/decompress0.cpp
    scummvm/trunk/engines/sci/scicore/decompress01.cpp
    scummvm/trunk/engines/sci/scicore/decompress1.cpp
    scummvm/trunk/engines/sci/scicore/decompress11.cpp
    scummvm/trunk/engines/sci/scicore/resource.cpp
    scummvm/trunk/engines/sci/scicore/resource_map.cpp
    scummvm/trunk/engines/sci/scicore/sci_memory.cpp
    scummvm/trunk/engines/sci/scicore/script.cpp
    scummvm/trunk/engines/sci/scicore/tools.cpp
    scummvm/trunk/engines/sci/scicore/vocab.cpp
    scummvm/trunk/engines/sci/scicore/vocab_debug.cpp
    scummvm/trunk/engines/sci/sfx/core.cpp
    scummvm/trunk/engines/sci/sfx/device/devices.cpp
    scummvm/trunk/engines/sci/sfx/iterator.cpp
    scummvm/trunk/engines/sci/sfx/mixer/soft.cpp
    scummvm/trunk/engines/sci/sfx/player/polled.cpp
    scummvm/trunk/engines/sci/sfx/player/realtime.cpp
    scummvm/trunk/engines/sci/sfx/softseq/SN76496.cpp
    scummvm/trunk/engines/sci/sfx/softseq/opl2.cpp
    scummvm/trunk/engines/sci/sfx/softseq/pcspeaker.cpp
    scummvm/trunk/engines/sci/sfx/time.cpp

Property Changed:
----------------
    scummvm/trunk/engines/sci/sfx/pcm_device.cpp
    scummvm/trunk/engines/sci/sfx/timer.cpp

Modified: scummvm/trunk/engines/sci/engine/game.cpp
===================================================================
--- scummvm/trunk/engines/sci/engine/game.cpp	2009-02-21 13:19:44 UTC (rev 38695)
+++ scummvm/trunk/engines/sci/engine/game.cpp	2009-02-21 14:11:41 UTC (rev 38696)
@@ -55,7 +55,7 @@
 	s->opcodes = vocabulary_get_opcodes(s->resmgr);
 
 	if (!(s->selector_names = vocabulary_get_snames(s->resmgr, NULL, s->version))) {
-		sciprintf("_init_vocabulary(): Could not retrieve selector names (vocab.997)");
+		sciprintf("_init_vocabulary(): Could not retrieve selector names (vocab.997)!\n");
 		return 1;
 	}
 
@@ -152,7 +152,7 @@
 				_sci1_alloc_system_colors(s);
 				scir_unlock_resource(s->resmgr, resource, sci_palette, 999);
 			} else {
-				sciprintf("Couldn't find the default palette");
+				sciprintf("Couldn't find the default palette!\n");
 			}
 		}
 	}
@@ -330,7 +330,7 @@
 					classnr = getUInt16((byte*)seeker_ptr + 10);
 					if (classnr >= s->classtable_size) {
 						if (classnr >= SCRIPT_MAX_CLASSTABLE_SIZE) {
-							error("Invalid class number 0x%x in script.%d(0x%x), offset %04x",
+							fprintf(stderr, "Invalid class number 0x%x in script.%d(0x%x), offset %04x\n",
 							        classnr, scriptnr, scriptnr, seeker_offset);
 							return 1;
 						}
@@ -404,7 +404,7 @@
 					if (classnr >= s->classtable_size) {
 
 						if (classnr >= SCRIPT_MAX_CLASSTABLE_SIZE) {
-							error("Invalid class number 0x%x in script.%d(0x%x), offset %04x",
+							fprintf(stderr, "Invalid class number 0x%x in script.%d(0x%x), offset %04x\n",
 							        classnr, scriptnr, scriptnr, seeker);
 							return 1;
 						}

Modified: scummvm/trunk/engines/sci/engine/gc.cpp
===================================================================
--- scummvm/trunk/engines/sci/engine/gc.cpp	2009-02-21 13:19:44 UTC (rev 38695)
+++ scummvm/trunk/engines/sci/engine/gc.cpp	2009-02-21 14:11:41 UTC (rev 38696)
@@ -79,7 +79,7 @@
 	reg_t retval;
 
 	if (!wl || !wl->used) {
-		error("Attempt to pop from empty worklist");
+		fprintf(stderr, "Attempt to pop from empty worklist");
 		exit(1);
 	}
 

Modified: scummvm/trunk/engines/sci/engine/heap.cpp
===================================================================
--- scummvm/trunk/engines/sci/engine/heap.cpp	2009-02-21 13:19:44 UTC (rev 38695)
+++ scummvm/trunk/engines/sci/engine/heap.cpp	2009-02-21 14:11:41 UTC (rev 38696)
@@ -118,7 +118,7 @@
 	unsigned int current = previous;
 
 	if (!size) {
-		error("Warning: heap_alloc'd zero bytes");
+		fprintf(stderr, "Warning: heap_alloc'd zero bytes!\n");
 		size += 2;
 	}
 

Modified: scummvm/trunk/engines/sci/engine/kernel.cpp
===================================================================
--- scummvm/trunk/engines/sci/engine/kernel.cpp	2009-02-21 13:19:44 UTC (rev 38695)
+++ scummvm/trunk/engines/sci/engine/kernel.cpp	2009-02-21 14:11:41 UTC (rev 38696)
@@ -356,7 +356,7 @@
 
 int kernel_oops(EngineState *s, const char *file, int line, const char *reason) {
 	sciprintf("Kernel Oops in file %s, line %d: %s\n", file, line, reason);
-	error("Kernel Oops in file %s, line %d: %s", file, line, reason);
+	fprintf(stderr, "Kernel Oops in file %s, line %d: %s\n", file, line, reason);
 	script_debug_flag = script_error_flag = 1;
 	return 0;
 }
@@ -389,7 +389,7 @@
 	hunk_table_t *ht = &(mobj->data.hunks);
 
 	if (!mobj || !ENTRY_IS_VALID(ht, handle.offset)) {
-		error("Error: kmem() with invalid handle");
+		SCIkwarn(SCIkERROR, "Error: kmem() with invalid handle\n");
 		return NULL;
 	}
 
@@ -508,7 +508,7 @@
 
 #ifdef WIN32
 	if (TIMERR_NOERROR != timeBeginPeriod(1)) {
-		error("timeBeginPeriod(1) failed in kGetTime");
+		fprintf(stderr, "timeBeginPeriod(1) failed in kGetTime!\n");
 	}
 #endif // WIN32
 
@@ -517,7 +517,7 @@
 
 #ifdef WIN32
 	if (TIMERR_NOERROR != timeEndPeriod(1)) {
-		error("timeEndPeriod(1) failed in kGetTime");
+		fprintf(stderr, "timeEndPeriod(1) failed in kGetTime!\n");
 	}
 #endif // WIN32
 
@@ -587,7 +587,7 @@
 	switch (UKPV(0)) {
 	case K_MEMORY_ALLOCATE_CRITICAL :
 		if (!sm_alloc_dynmem(&s->seg_manager, UKPV(1), "kMemory() critical", &s->r_acc)) {
-			error("Critical heap allocation failed");
+			SCIkwarn(SCIkERROR, "Critical heap allocation failed\n");
 			script_error_flag = script_debug_flag = 1;
 		}
 		return s->r_acc;
@@ -597,7 +597,7 @@
 		break;
 	case K_MEMORY_FREE :
 		if (sm_free_dynmem(&s->seg_manager, argv[1])) {
-			error("Attempt to kMemory::free() non-dynmem pointer "PREG"", PRINT_REG(argv[1]));
+			SCIkwarn(SCIkERROR, "Attempt to kMemory::free() non-dynmem pointer "PREG"!\n", PRINT_REG(argv[1]));
 		}
 		break;
 	case K_MEMORY_MEMCPY : {
@@ -622,7 +622,7 @@
 		byte *ref = kernel_dereference_bulk_pointer(s, argv[1], 2);
 
 		if (!ref) {
-			error("Attempt to poke invalid memory at "PREG"", PRINT_REG(argv[1]));
+			SCIkdebug(SCIkERROR, "Attempt to poke invalid memory at "PREG"!\n", PRINT_REG(argv[1]));
 			return s->r_acc;
 		}
 		if (s->seg_manager.heap[argv[1].segment]->type == MEM_OBJ_LOCALS)
@@ -635,7 +635,7 @@
 		byte *ref = kernel_dereference_bulk_pointer(s, argv[1], 2);
 
 		if (!ref) {
-			error("Attempt to poke invalid memory at "PREG"", PRINT_REG(argv[1]));
+			SCIkdebug(SCIkERROR, "Attempt to poke invalid memory at "PREG"!\n", PRINT_REG(argv[1]));
 			return s->r_acc;
 		}
 
@@ -643,7 +643,7 @@
 			*((reg_t *) ref) = argv[2];
 		else {
 			if (argv[2].segment) {
-				error("Attempt to poke memory reference "PREG" to "PREG"", PRINT_REG(argv[2]), PRINT_REG(argv[1]));
+				SCIkdebug(SCIkERROR, "Attempt to poke memory reference "PREG" to "PREG"!\n", PRINT_REG(argv[2]), PRINT_REG(argv[1]));
 				return s->r_acc;
 				putInt16(ref, argv[2].offset); // ???
 			}
@@ -960,12 +960,12 @@
 	void *retval = sm_dereference(&s->seg_manager, pointer, &maxsize);
 
 	if (pointer.offset & (align - 1)) {
-		error("Unaligned pointer read: "PREG" expected with %d alignment", PRINT_REG(pointer), align);
+		SCIkdebug(SCIkERROR, "Unaligned pointer read: "PREG" expected with %d alignment!\n", PRINT_REG(pointer), align);
 		return NULL;
 	}
 
 	if (entries > maxsize) {
-		error("Trying to dereference pointer "PREG" beyond end of segment", PRINT_REG(pointer));
+		SCIkdebug(SCIkERROR, "Trying to dereference pointer "PREG" beyond end of segment!\n", PRINT_REG(pointer));
 		return NULL;
 	}
 	return retval;

Modified: scummvm/trunk/engines/sci/engine/kfile.cpp
===================================================================
--- scummvm/trunk/engines/sci/engine/kfile.cpp	2009-02-21 13:19:44 UTC (rev 38695)
+++ scummvm/trunk/engines/sci/engine/kfile.cpp	2009-02-21 14:11:41 UTC (rev 38696)
@@ -149,7 +149,7 @@
 			SCIkdebug(SCIkFILE, "Failed. Attempting to copy from resource dir...\n");
 			file = f_open_mirrored(s, filename);
 			if (file)
-				SCIkdebug(SCIkFILE, "Success");
+				SCIkdebug(SCIkFILE, "Success!\n");
 			else
 				SCIkdebug(SCIkFILE, "Not found.\n");
 		}
@@ -186,12 +186,12 @@
 
 static FILE *getFileFromHandle(EngineState *s, int handle) {
 	if (handle == 0) {
-		error("Attempt to use file handle 0");
+		SCIkwarn(SCIkERROR, "Attempt to use file handle 0\n");
 		return 0;
 	}
 
 	if ((handle >= s->file_handles_nr) || (s->file_handles[handle] == NULL)) {
-		error("Attempt to use invalid/unused file handle %d", handle);
+		SCIkwarn(SCIkERROR, "Attempt to use invalid/unused file handle %d\n", handle);
 		return 0;
 	}
 	
@@ -380,7 +380,7 @@
 	}
 	break;
 	default: {
-		error("Unknown DeviceInfo() sub-command: %d", mode);
+		SCIkwarn(SCIkERROR, "Unknown DeviceInfo() sub-command: %d\n", mode);
 	}
 	}
 	return s->r_acc;
@@ -442,7 +442,7 @@
 	}
 	break;
 	default: {
-		error("Unknown DeviceInfo() sub-command: %d", mode);
+		SCIkwarn(SCIkERROR, "Unknown DeviceInfo() sub-command: %d\n", mode);
 	}
 	}
 
@@ -670,13 +670,13 @@
 			} else ++i;
 		}
 		if (savedir_id >= MAX_SAVEGAME_NR) {
-			sciprintf("Internal error: Free savegame ID is %d, shouldn't happen", savedir_id);
+			sciprintf("Internal error: Free savegame ID is %d, shouldn't happen!\n", savedir_id);
 			return NULL_REG;
 		}
 
 		// This loop terminates when savedir_id is not in [x | ex. n. _savegame_indices[n].id = x]
 	} else {
-		sciprintf("Savegame ID %d is not allowed", savedir_nr);
+		sciprintf("Savegame ID %d is not allowed!\n", savedir_nr);
 		return NULL_REG;
 	}
 
@@ -791,7 +791,7 @@
 
 void first_file(EngineState *s, const char *dir, char *mask, reg_t buffer) {
 	if (!buffer.segment) {
-		sciprintf("Warning: first_file(state,\"%s\",\"%s\", 0) invoked", dir, mask);
+		sciprintf("Warning: first_file(state,\"%s\",\"%s\", 0) invoked!\n", dir, mask);
 		s->r_acc = NULL_REG;
 		return;
 	}
@@ -901,7 +901,7 @@
 		break;
 	}
 	default :
-		error("Unknown FileIO() sub-command: %d", func_nr);
+		SCIkwarn(SCIkERROR, "Unknown FileIO() sub-command: %d\n", func_nr);
 	}
 
 	return s->r_acc;

Modified: scummvm/trunk/engines/sci/engine/kgraphics.cpp
===================================================================
--- scummvm/trunk/engines/sci/engine/kgraphics.cpp	2009-02-21 13:19:44 UTC (rev 38695)
+++ scummvm/trunk/engines/sci/engine/kgraphics.cpp	2009-02-21 14:11:41 UTC (rev 38696)
@@ -92,7 +92,7 @@
 		if (val == GFX_ERROR) \
 			warning("GFX subsystem returned error on \"" #x "\""); \
 		else {\
-			error("GFX subsystem fatal error condition on \"" #x "\""); \
+			SCIkwarn(SCIkERROR, "GFX subsystem fatal error condition on \"" #x "\"!\n"); \
 			vm_handle_fatal_error(s, __LINE__, __FILE__); \
 		} \
 	}\
@@ -101,7 +101,7 @@
 #define ASSERT(x) { \
 	int val = !!(x); \
 	if (!val) { \
-		error("Fatal error condition on \"" #x "\""); \
+		SCIkwarn(SCIkERROR, "Fatal error condition on \"" #x "\"!\n"); \
 		BREAKPOINT(); \
 		vm_handle_fatal_error(s, __LINE__, __FILE__); \
 	} \
@@ -220,7 +220,7 @@
 	while (port_nr > 2 && !(s->port->flags & GFXW_FLAG_IMMUNE_TO_SNAPSHOTS) && (gfxw_widget_matches_snapshot(*ptr, GFXW(s->port)))) {
 		// This shouldn't ever happen, actually, since windows (ports w/ ID > 2) should all be immune
 		gfxw_port_t *newport = gfxw_find_port(s->visual, port_nr);
-		error("Port %d is not immune against snapshots", s->port->ID);
+		SCIkwarn(SCIkERROR, "Port %d is not immune against snapshots!\n", s->port->ID);
 		port_nr--;
 		if (newport)
 			s->port = newport;
@@ -234,7 +234,7 @@
 		} while (parent && (gfxw_widget_matches_snapshot(*ptr, GFXW(parent))));
 
 		if (!parent) {
-			error("Attempted widget mass destruction by a snapshot");
+			SCIkwarn(SCIkERROR, "Attempted widget mass destruction by a snapshot\n");
 			BREAKPOINT();
 		}
 
@@ -243,7 +243,7 @@
 
 
 	if (!ptr) {
-		error("Attempt to restore invalid snaphot with handle "PREG, PRINT_REG(handle));
+		SCIkwarn(SCIkERROR, "Attempt to restore invalid snaphot with handle %04x!\n", handle);
 		return;
 	}
 
@@ -273,7 +273,7 @@
 	else if (color < KERNEL_COLORS_NR)
 		return &(KERNEL_COLOR_PALETTE[color]);
 	else {
-		error("Color index %d out of bounds for pic %d (%d max)", color, s->gfx_state->pic_nr, KERNEL_COLORS_NR);
+		SCIkwarn(SCIkERROR, "Color index %d out of bounds for pic %d (%d max)", color, s->gfx_state->pic_nr, KERNEL_COLORS_NR);
 		BREAKPOINT();
 		return NULL;
 	}
@@ -334,7 +334,7 @@
 		break;
 	}
 	default :
-		error("kSetCursor: Unhandled case: %d arguments given", argc);
+		SCIkwarn(SCIkERROR, "kSetCursor: Unhandled case: %d arguments given!\n", argc);
 		break;
 	}
 	return s->r_acc;
@@ -437,7 +437,7 @@
 }
 
 void _k_redraw_box(EngineState *s, int x1, int y1, int x2, int y2) {
-	sciprintf("_k_redraw_box(): Unimplemented");
+	sciprintf("_k_redraw_box(): Unimplemented!\n");
 #if 0
 	int i;
 	view_object_t *list = s->dyn_views;
@@ -712,7 +712,7 @@
 	maxloops = gfxop_lookup_view_get_loops(s->gfx_state, view);
 
 	if (maxloops == GFX_ERROR) {
-		error("Invalid view.%03d", view);
+		SCIkwarn(SCIkERROR, "Invalid view.%03d\n", view);
 		return;
 	} else if ((loop > 1) && (maxloops < 4))
 		return;
@@ -903,7 +903,7 @@
 	}
 
 	if (gfxop_get_cel_parameters(s->gfx_state, view, loop, cel, &width, &height, &offset)) {
-		error("Invalid loop (%d) or cel (%d) in view.%d (0x%x), or view invalid", loop, cel, view, view);
+		SCIkwarn(SCIkERROR, "Invalid loop (%d) or cel (%d) in view.%d (0x%x), or view invalid\n", loop, cel, view, view);
 		return NULL_REG;
 	} else
 		return make_reg(0, height);
@@ -921,7 +921,7 @@
 	}
 
 	if (gfxop_get_cel_parameters(s->gfx_state, view, loop, cel, &width, &height, &offset)) {
-		error("Invalid loop (%d) or cel (%d) in view.%d (0x%x), or view invalid", loop, cel, view, view);
+		SCIkwarn(SCIkERROR, "Invalid loop (%d) or cel (%d) in view.%d (0x%x), or view invalid\n", loop, cel, view, view);
 		return NULL_REG;
 	} else
 		return make_reg(0, width);
@@ -933,7 +933,7 @@
 	int loops_nr = gfxop_lookup_view_get_loops(s->gfx_state, view);
 
 	if (loops_nr < 0) {
-		error("view.%d (0x%x) not found", view, view);
+		SCIkwarn(SCIkERROR, "view.%d (0x%x) not found\n", view, view);
 		return NULL_REG;
 	}
 
@@ -952,7 +952,7 @@
 	if (gfxop_check_cel(s->gfx_state, view, &loop, &cel)) { 
 		// OK, this is a hack and there's a
 		// real function to calculate cel numbers...
-		error("view.%d (0x%x) not found", view, view);
+		SCIkwarn(SCIkERROR, "view.%d (0x%x) not found\n", view, view);
 		return NULL_REG;
 	}
 
@@ -1056,11 +1056,10 @@
 	if (sci01_priority_table_flags & 0x2) {
 		if (s->pic_priority_table) {
 			int i;
-			printf("---------------------------\nPriority table:\n");
+			fprintf(stderr, "---------------------------\nPriority table:\n");
 			for (i = 0; i < 16; i++)
-				printf("\t%d:\t%d\n", i, s->pic_priority_table[i]);
-			printf("---------------------------\n");
-			error("Error");
+				fprintf(stderr, "\t%d:\t%d\n", i, s->pic_priority_table[i]);
+			fprintf(stderr, "---------------------------\n");
 		}
 	}
 	if (sci01_priority_table_flags & 0x1)
@@ -1118,7 +1117,7 @@
 		if (loop != oldloop) {
 			loop = 0;
 			PUT_SEL32V(object, loop, 0);
-			SCIkdebug(SCIkGRAPHICS, "Resetting loop for "PREG"", PRINT_REG(object));
+			SCIkdebug(SCIkGRAPHICS, "Resetting loop for "PREG"!\n", PRINT_REG(object));
 		}
 
 		if (cel != oldcel) {
@@ -1722,19 +1721,19 @@
 				temp = GET_SEL32V(obj, nsBottom);
 				PUT_SEL32V(obj, lsBottom, temp);
 #ifdef DEBUG_LSRECT
-				error("lsRected "PREG"", PRINT_REG(obj));
+				fprintf(stderr, "lsRected "PREG"\n", PRINT_REG(obj));
 #endif
 			}
 #ifdef DEBUG_LSRECT
 			else 
-				error("Not lsRecting "PREG" because %d", PRINT_REG(obj), lookup_selector(s, obj, s->selector_map.nsBottom, NULL, NULL));
+				fprintf(stderr, "Not lsRecting "PREG" because %d\n", PRINT_REG(obj), lookup_selector(s, obj, s->selector_map.nsBottom, NULL, NULL));
 #endif
 
 			if (widget->signal & _K_VIEW_SIG_FLAG_HIDDEN)
 				widget->signal |= _K_VIEW_SIG_FLAG_REMOVE;
 		}
 #ifdef DEBUG_LSRECT
-		error("obj "PREG" has pflags %x", PRINT_REG(obj), (widget->signal & (_K_VIEW_SIG_FLAG_REMOVE | _K_VIEW_SIG_FLAG_NO_UPDATE)));
+		fprintf(stderr, "obj "PREG" has pflags %x\n", PRINT_REG(obj), (widget->signal & (_K_VIEW_SIG_FLAG_REMOVE | _K_VIEW_SIG_FLAG_NO_UPDATE)));
 #endif
 
 		if (widget->signalp) {
@@ -1786,7 +1785,7 @@
 				reg_t under_bits = NULL_REG;
 
 				if (!is_object(s, obj)) {
-					error("Non-object "PREG" present in view list during delete time", PRINT_REG(obj));
+					SCIkwarn(SCIkERROR, "Non-object "PREG" present in view list during delete time\n", PRINT_REG(obj));
 					obj = NULL_REG;
 				} else
 					if (widget->under_bitsp) { // Is there a bg picture left to clean?
@@ -1823,7 +1822,7 @@
 					if (!(signal & _K_VIEW_SIG_FLAG_HIDDEN)) {
 						SCIkdebug(SCIkGRAPHICS, "Adding view at "PREG" to background\n", PRINT_REG(obj));
 						if (!(gfxw_remove_id(widget->parent, widget->ID, widget->subID) == GFXW(widget))) {
-							error("Attempt to remove view with ID %x:%x from list failed", widget->ID, widget->subID);
+							SCIkwarn(SCIkERROR, "Attempt to remove view with ID %x:%x from list failed!\n", widget->ID, widget->subID);
 							BREAKPOINT();
 						}
 
@@ -1941,7 +1940,7 @@
 	gfxw_dyn_view_t *widget;
 
 	if (!*widget_list) {
-		error("make_view_list with widget_list == ()");
+		SCIkwarn(SCIkERROR, "make_view_list with widget_list == ()\n");
 		BREAKPOINT();
 	};
 
@@ -1950,7 +1949,7 @@
 	// Yes, this _does_ happen!
 
 	if (!list) { // list sanity check
-		error("Attempt to make list from non-list");
+		SCIkwarn(SCIkERROR, "Attempt to make list from non-list!\n");
 		BREAKPOINT();
 	}
 
@@ -2069,7 +2068,7 @@
 		// Never happens
 /*		if (view->signal & 0) {
 			view->signal &= ~_K_VIEW_SIG_FLAG_FREESCI_STOPUPD;
-			error("Unsetting magic StopUpd for view "PREG"", PRINT_REG(obj));
+			fprintf(stderr, "Unsetting magic StopUpd for view "PREG"\n", PRINT_REG(obj));
 		} */
 
 		view = (gfxw_dyn_view_t *) view->next;
@@ -2268,7 +2267,7 @@
 		                                priority, -1 /* No priority */ , ALIGN_CENTER, ALIGN_BOTTOM, 0));
 
 		if (!widget) {
-			error("Attempt to single-add invalid picview (%d/%d/%d)", view, loop, cel);
+			SCIkwarn(SCIkERROR, "Attempt to single-add invalid picview (%d/%d/%d)\n", view, loop, cel);
 		} else {
 			widget->ID = -1;
 			if (control >= 0) {
@@ -2332,7 +2331,7 @@
 		new_port = gfxw_find_port(s->visual, port_nr);
 
 		if (!new_port) {
-			error("Invalid port %04x requested", port_nr);
+			SCIkwarn(SCIkERROR, "Invalid port %04x requested\n", port_nr);
 			return NULL_REG;
 		}
 
@@ -2360,7 +2359,7 @@
 		break;
 	}
 	default :
-		error("SetPort was called with %d parameters", argc);
+		SCIkwarn(SCIkERROR, "SetPort was called with %d parameters\n", argc);
 		break;
 	}
 
@@ -2389,13 +2388,13 @@
 
 /*
 	if (!view) {
-		error("Attempt to draw non-existing view.%03d", view);
+		SCIkwarn(SCIkERROR, "Attempt to draw non-existing view.%03d\n", view);
 		return;
 	}
 */
 
 	if (gfxop_check_cel(s->gfx_state, view, &loop, &cel)) {
-		error("Attempt to draw non-existing view.%03d", view);
+		SCIkwarn(SCIkERROR, "Attempt to draw non-existing view.%03d\n", view);
 		return s->r_acc;
 	}
 
@@ -2423,7 +2422,7 @@
 	gfxw_widget_kill_chrono(s->visual, goner_nr);
 	goner = gfxw_find_port(s->visual, goner_nr);
 	if ((goner_nr < 3) || (goner == NULL)) {
-		error("Removal of invalid window %04x requested", goner_nr);
+		SCIkwarn(SCIkERROR, "Removal of invalid window %04x requested\n", goner_nr);
 		return s->r_acc;
 	}
 
@@ -2572,7 +2571,7 @@
 	gfxop_set_clip_zone(s->gfx_state, gfx_rect_fullscreen);
 
 	if (!newscreen) {
-		error("Failed to allocate 'newscreen'");
+		SCIkwarn(SCIkERROR, "Failed to allocate 'newscreen'!\n");
 		return;
 	}
 
@@ -3124,7 +3123,7 @@
 	}
 
 	if (!text) {
-		error("Display with invalid reference "PREG"", PRINT_REG(textp));
+		SCIkdebug(SCIkERROR, "Display with invalid reference "PREG"!\n", PRINT_REG(textp));
 		return NULL_REG;
 	}
 
@@ -3250,7 +3249,7 @@
 	text_handle = gfxw_new_text(s->gfx_state, area, font_nr, text, halign, ALIGN_TOP, color0, *color1, bg_color, 0);
 
 	if (!text_handle) {
-		error("Display: Failed to create text widget");
+		SCIkwarn(SCIkERROR, "Display: Failed to create text widget!\n");
 		return NULL_REG;
 	}
 

Modified: scummvm/trunk/engines/sci/engine/klists.cpp
===================================================================
--- scummvm/trunk/engines/sci/engine/klists.cpp	2009-02-21 13:19:44 UTC (rev 38695)
+++ scummvm/trunk/engines/sci/engine/klists.cpp	2009-02-21 14:11:41 UTC (rev 38696)
@@ -170,12 +170,12 @@
 	list_t *l = LOOKUP_LIST(argv[0]);
 
 	if (!l) {
-		error("Attempt to dispose non-list at "PREG"", PRINT_REG(argv[0]));
+		SCIkwarn(SCIkERROR, "Attempt to dispose non-list at "PREG"!\n", PRINT_REG(argv[0]));
 		return NULL_REG;
 	}
 
 	if (!sane_listp(s, argv[0]))
-		error("List at "PREG" is not sane anymore", PRINT_REG(argv[0]));
+		SCIkwarn(SCIkERROR, "List at "PREG" is not sane anymore!\n", PRINT_REG(argv[0]));
 
 /*	if (!IS_NULL_REG(l->first)) {
 		reg_t n_addr = l->first;
@@ -220,7 +220,7 @@
 	list_t *l = LOOKUP_NULL_LIST(argv[0]);
 
 	if (l && !sane_listp(s, argv[0]))
-		error("List at "PREG" is not sane anymore", PRINT_REG(argv[0]));
+		SCIkwarn(SCIkERROR, "List at "PREG" is not sane anymore!\n", PRINT_REG(argv[0]));
 
 	if (l)
 		return l->first;
@@ -232,7 +232,7 @@
 	list_t *l = LOOKUP_LIST(argv[0]);
 
 	if (l && !sane_listp(s, argv[0]))
-		error("List at "PREG" is not sane anymore", PRINT_REG(argv[0]));
+		SCIkwarn(SCIkERROR, "List at "PREG" is not sane anymore!\n", PRINT_REG(argv[0]));
 
 	if (l)
 		return l->last;
@@ -244,7 +244,7 @@
 	list_t *l = LOOKUP_LIST(argv[0]);
 
 	if (!l || !sane_listp(s, argv[0]))
-		error("List at "PREG" is invalid or not sane anymore", PRINT_REG(argv[0]));
+		SCIkwarn(SCIkERROR, "List at "PREG" is invalid or not sane anymore!\n", PRINT_REG(argv[0]));
 
 	return make_reg(0, ((l) ? IS_NULL_REG(l->first) : 0));
 }
@@ -256,9 +256,9 @@
 	SCIkdebug(SCIkNODES, "Adding node "PREG" to end of list "PREG"\n", PRINT_REG(nodebase), PRINT_REG(listbase));
 
 	if (!new_n)
-		error("Attempt to add non-node ("PREG") to list at "PREG"", PRINT_REG(nodebase), PRINT_REG(listbase));
+		SCIkwarn(SCIkERROR, "Attempt to add non-node ("PREG") to list at "PREG"\n", PRINT_REG(nodebase), PRINT_REG(listbase));
 	if (!l || !sane_listp(s, listbase))
-		error("List at "PREG" is not sane anymore", PRINT_REG(listbase));
+		SCIkwarn(SCIkERROR, "List at "PREG" is not sane anymore!\n", PRINT_REG(listbase));
 
 	new_n->succ = l->first;
 	new_n->pred = NULL_REG;
@@ -279,9 +279,9 @@
 	SCIkdebug(SCIkNODES, "Adding node "PREG" to end of list "PREG"\n", PRINT_REG(nodebase), PRINT_REG(listbase));
 
 	if (!new_n)
-		error("Attempt to add non-node ("PREG") to list at "PREG"", PRINT_REG(nodebase), PRINT_REG(listbase));
+		SCIkwarn(SCIkERROR, "Attempt to add non-node ("PREG") to list at "PREG"\n", PRINT_REG(nodebase), PRINT_REG(listbase));
 	if (!l || !sane_listp(s, listbase))
-		error("List at "PREG" is not sane anymore", PRINT_REG(listbase));
+		SCIkwarn(SCIkERROR, "List at "PREG" is not sane anymore!\n", PRINT_REG(listbase));
 
 	new_n->succ = NULL_REG;
 	new_n->pred = l->last;
@@ -298,7 +298,7 @@
 reg_t kNextNode(EngineState *s, int funct_nr, int argc, reg_t *argv) {
 	node_t *n = LOOKUP_NODE(argv[0]);
 	if (!sane_nodep(s, argv[0])) {
-		error("List node at "PREG" is not sane anymore", PRINT_REG(argv[0]));
+		SCIkwarn(SCIkERROR, "List node at "PREG" is not sane anymore!\n", PRINT_REG(argv[0]));
 		script_error_flag = script_debug_flag = 0;
 		return NULL_REG;
 	}
@@ -309,7 +309,7 @@
 reg_t kPrevNode(EngineState *s, int funct_nr, int argc, reg_t *argv) {
 	node_t *n = LOOKUP_NODE(argv[0]);
 	if (!sane_nodep(s, argv[0]))
-		error("List node at "PREG" is not sane anymore", PRINT_REG(argv[0]));
+		SCIkwarn(SCIkERROR, "List node at "PREG" is not sane anymore!\n", PRINT_REG(argv[0]));
 
 	return n->pred;
 }
@@ -317,7 +317,7 @@
 reg_t kNodeValue(EngineState *s, int funct_nr, int argc, reg_t *argv) {
 	node_t *n = LOOKUP_NODE(argv[0]);
 	if (!sane_nodep(s, argv[0])) {
-		error("List node at "PREG" is not sane", PRINT_REG(argv[0]));
+		SCIkwarn(SCIkERROR, "List node at "PREG" is not sane!\n", PRINT_REG(argv[0]));
 		script_debug_flag = script_error_flag = 0;
 		return NULL_REG;
 	}
@@ -336,10 +336,10 @@
 	node_t *newnode = LOOKUP_NODE(argv[2]);
 
 	if (!l || !sane_listp(s, argv[0]))
-		error("List at "PREG" is not sane anymore", PRINT_REG(argv[0]));
+		SCIkwarn(SCIkERROR, "List at "PREG" is not sane anymore!\n", PRINT_REG(argv[0]));
 
 	if (!newnode) {
-		error("New 'node' "PREG" is not a node", PRINT_REG(argv[2]));
+		SCIkwarn(SCIkERROR, "New 'node' "PREG" is not a node!\n", argv[1], argv[2]);
 		return NULL_REG;
 	}
 
@@ -382,7 +382,7 @@
 	SCIkdebug(SCIkNODES, "Looking for key "PREG" in list "PREG"\n", PRINT_REG(key), PRINT_REG(list_pos));
 
 	if (!sane_listp(s, list_pos))
-		error("List at "PREG" is not sane anymore", PRINT_REG(list_pos));
+		SCIkwarn(SCIkERROR, "List at "PREG" is not sane anymore!\n", PRINT_REG(list_pos));
 
 	node_pos = LOOKUP_LIST(list_pos)->first;
 

Modified: scummvm/trunk/engines/sci/engine/kmovement.cpp
===================================================================
--- scummvm/trunk/engines/sci/engine/kmovement.cpp	2009-02-21 13:19:44 UTC (rev 38695)
+++ scummvm/trunk/engines/sci/engine/kmovement.cpp	2009-02-21 14:11:41 UTC (rev 38696)
@@ -425,7 +425,7 @@
 	SCIkdebug(SCIkBRESEN, "Doing avoider %04x (dest=%d,%d)\n", avoider, destx, desty);
 
 	if (invoke_selector(INV_SEL(mover, doit, 1) , 0)) {
-		error("Mover "PREG" of avoider "PREG" doesn't have a doit() funcselector\n", PRINT_REG(mover), PRINT_REG(avoider));
+		SCIkwarn(SCIkERROR, "Mover "PREG" of avoider "PREG" doesn't have a doit() funcselector\n", PRINT_REG(mover), PRINT_REG(avoider));
 		return NULL_REG;
 	}
 
@@ -434,7 +434,7 @@
 		return s->r_acc; // Return gracefully.
 
 	if (invoke_selector(INV_SEL(client, isBlocked, 1) , 0)) {
-		error("Client "PREG" of avoider "PREG" doesn't"
+		SCIkwarn(SCIkERROR, "Client "PREG" of avoider "PREG" doesn't"
 		         " have an isBlocked() funcselector", PRINT_REG(client), PRINT_REG(avoider));
 		return NULL_REG;
 	}
@@ -465,7 +465,7 @@
 			SCIkdebug(SCIkBRESEN, "Pos (%d,%d): Trying angle %d; delta=(%d,%d)\n", oldx, oldy, angle, move_x, move_y);
 
 			if (invoke_selector(INV_SEL(client, canBeHere, 1) , 0)) {
-				error("Client "PREG" of avoider "PREG" doesn't"
+				SCIkwarn(SCIkERROR, "Client "PREG" of avoider "PREG" doesn't"
 				         " have a canBeHere() funcselector", PRINT_REG(client), PRINT_REG(avoider));
 				return NULL_REG;
 			}
@@ -499,7 +499,7 @@
 
 		if (looper.segment) {
 			if (invoke_selector(INV_SEL(looper, doit, 1), 2, angle, client)) {
-				error("Looper "PREG" of avoider "PREG" doesn't"
+				SCIkwarn(SCIkERROR, "Looper "PREG" of avoider "PREG" doesn't"
 				         " have a doit() funcselector", PRINT_REG(looper), PRINT_REG(avoider));
 			} else
 				return s->r_acc;

Modified: scummvm/trunk/engines/sci/engine/kscripts.cpp
===================================================================
--- scummvm/trunk/engines/sci/engine/kscripts.cpp	2009-02-21 13:19:44 UTC (rev 38695)
+++ scummvm/trunk/engines/sci/engine/kscripts.cpp	2009-02-21 14:11:41 UTC (rev 38696)
@@ -71,7 +71,7 @@
 	slc_type = lookup_selector(s, object, selector_id, NULL, &address);
 
 	if (slc_type == SELECTOR_NONE) {
-		error("Selector '%s' of object at "PREG" could not be invoked (%s L%d)",
+		SCIkwarn(SCIkERROR, "Selector '%s' of object at "PREG" could not be invoked (%s L%d)\n",
 		         s->selector_names[selector_id], PRINT_REG(object), fname, line);
 		if (noinvalid == 0)
 			KERNEL_OOPS("Not recoverable: VM was halted\n");
@@ -160,7 +160,7 @@
 	int varblock_size;
 
 	if (!parent_obj) {
-		error("Attempt to clone non-object/class at "PREG" failed", PRINT_REG(parent_addr));
+		SCIkwarn(SCIkERROR, "Attempt to clone non-object/class at "PREG" failed", PRINT_REG(parent_addr));
 		return NULL_REG;
 	}
 
@@ -169,7 +169,7 @@
 	clone_obj = sm_alloc_clone(&s->seg_manager, &clone_addr);
 
 	if (!clone_obj) {
-		error("Cloning "PREG" failed-- internal error", PRINT_REG(parent_addr));
+		SCIkwarn(SCIkERROR, "Cloning "PREG" failed-- internal error!\n", PRINT_REG(parent_addr));
 		return NULL_REG;
 	}
 
@@ -198,7 +198,7 @@
 	word underBits;
 
 	if (!victim_obj) {
-		error("Attempt to dispose non-class/object at "PREG"",
+		SCIkwarn(SCIkERROR, "Attempt to dispose non-class/object at "PREG"\n",
 		         PRINT_REG(victim_addr));
 		return s->r_acc;
 	}
@@ -246,12 +246,12 @@
 	scr = &(s->seg_manager.heap[scriptid]->data.script);
 
 	if (!scr->exports_nr) {
-		error("Script 0x%x does not have a dispatch table", script);
+		SCIkdebug(SCIkERROR, "Script 0x%x does not have a dispatch table\n", script);
 		return NULL_REG;
 	}
 
 	if (index > scr->exports_nr) {
-		error("Dispatch index too big: %d > %d", index, scr->exports_nr);
+		SCIkwarn(SCIkERROR, "Dispatch index too big: %d > %d\n", index, scr->exports_nr);
 		return NULL_REG;
 	}
 

Modified: scummvm/trunk/engines/sci/engine/ksound.cpp
===================================================================
--- scummvm/trunk/engines/sci/engine/ksound.cpp	2009-02-21 13:19:44 UTC (rev 38695)
+++ scummvm/trunk/engines/sci/engine/ksound.cpp	2009-02-21 14:11:41 UTC (rev 38696)
@@ -940,14 +940,14 @@
 
 		case SI_ABSOLUTE_CUE:
 			signal = cue;
-			warning("[CUE] "PREG" Absolute Cue: %d",
+			fprintf(stderr, "[CUE] "PREG" Absolute Cue: %d\n",
 			        PRINT_REG(obj), signal);
 
 			PUT_SEL32V(obj, signal, signal);
 			break;
 
 		case SI_RELATIVE_CUE:
-			error("[CUE] "PREG" Relative Cue: %d",
+			fprintf(stderr, "[CUE] "PREG" Relative Cue: %d\n",
 			        PRINT_REG(obj), cue);
 
 			PUT_SEL32V(obj, dataInc, cue);

Modified: scummvm/trunk/engines/sci/engine/kstring.cpp
===================================================================
--- scummvm/trunk/engines/sci/engine/kstring.cpp	2009-02-21 13:19:44 UTC (rev 38695)
+++ scummvm/trunk/engines/sci/engine/kstring.cpp	2009-02-21 14:11:41 UTC (rev 38696)
@@ -33,7 +33,7 @@
 
 #define CHECK_OVERFLOW1(pt, size, rv) \
 	if (((pt) - (str_base)) + (size) > maxsize) { \
-		error("String expansion exceeded heap boundaries"); \
+		SCIkwarn(SCIkERROR, "String expansion exceeded heap boundaries\n"); \
 		return rv;\
 	}
 
@@ -50,7 +50,7 @@
 		textres = scir_find_resource(s->resmgr, sci_text, address.offset, 0);
 
 		if (!textres) {
-			error("text.%03d not found", address.offset);
+			SCIkwarn(SCIkERROR, "text.%03d not found\n", address);
 			return NULL; /* Will probably segfault */
 		}
 
@@ -64,7 +64,7 @@
 		if (textlen)
 			return seeker;
 		else {
-			error("Index %d out of bounds in text.%03d", _index, address.offset);
+			SCIkwarn(SCIkERROR, "Index %d out of bounds in text.%03d\n", _index, address);
 			return 0;
 		}
 
@@ -222,7 +222,7 @@
 				          synonyms_nr, script);
 
 				if (synonyms_nr > 16384) {
-					error("Segtable corruption: script.%03d has %d synonyms",
+					SCIkwarn(SCIkERROR, "Segtable corruption: script.%03d has %d synonyms!\n",
 					         script, synonyms_nr);
 					/* We used to reset the corrupted value here. I really don't think it's appropriate.
 					 * Lars */
@@ -697,7 +697,7 @@
 
 
 	if (!textres) {
-		error("text.%d does not exist", UKPV(0));
+		SCIkwarn(SCIkERROR, "text.%d does not exist\n", UKPV(0));
 		return NULL_REG;
 	}
 

Modified: scummvm/trunk/engines/sci/engine/scriptconsole.cpp
===================================================================
--- scummvm/trunk/engines/sci/engine/scriptconsole.cpp	2009-02-21 13:19:44 UTC (rev 38695)
+++ scummvm/trunk/engines/sci/engine/scriptconsole.cpp	2009-02-21 14:11:41 UTC (rev 38696)
@@ -544,7 +544,7 @@
 							break;
 
 						default:
-							error("Internal error: Heap corruption or prior assertion failed:\n"
+							fprintf(stderr, "Internal error: Heap corruption or prior assertion failed:\n"
 							        "Unknown parameter type '%c' for funtion\n", paramtype);
 
 						}
@@ -552,8 +552,7 @@
 
 					if (do_execute) {
 						command_todo->command(s);
-					} else
-						error("Skipping command...\n");
+					} else fprintf(stderr, "Skipping command...\n");
 				}
 			}
 		}
@@ -836,7 +835,7 @@
 				cmd_mm[mm_found].print((cmd_mm_entry_t *)(((byte *)cmd_mm[mm_found].data) + i * cmd_mm[mm_found].size_per_entry), 0);
 		else {
 			if (!s) {
-				sciprintf("You need a state to do that");
+				sciprintf("You need a state to do that!\n");
 				return 1;
 			}
 
@@ -963,14 +962,14 @@
 	char *dot = strchr(cmd_params[0].str, '.');
 
 	if (NULL == s) {
-		error("console.c: c_hexgrep(): NULL passed for s\r\n");
+		fprintf(stderr, "console.c: c_hexgrep(): NULL passed for s\r\n");
 		return(-1);
 	}
 
 	seekstr = (unsigned char *)sci_malloc(seeklen = (cmd_paramlength - 1));
 
 	if (NULL == seekstr) {
-		error("console.c: c_hexgrep(): malloc failed for seekstr\r\n");
+		fprintf(stderr, "console.c: c_hexgrep(): malloc failed for seekstr\r\n");
 		return(-1);
 	}
 
@@ -1039,7 +1038,7 @@
 	snames = vocabulary_get_snames(s->resmgr, &namectr, s ? s->version : 0);
 
 	if (!snames) {
-		sciprintf("No selector name table found");
+		sciprintf("No selector name table found!\n");
 		return 1;
 	}
 
@@ -1064,7 +1063,7 @@
 	}
 
 	if (!knames) {
-		sciprintf("No kernel name table found");
+		sciprintf("No kernel name table found!\n");
 		return 1;
 	}
 

Modified: scummvm/trunk/engines/sci/engine/scriptdebug.cpp
===================================================================
--- scummvm/trunk/engines/sci/engine/scriptdebug.cpp	2009-02-21 13:19:44 UTC (rev 38695)
+++ scummvm/trunk/engines/sci/engine/scriptdebug.cpp	2009-02-21 14:11:41 UTC (rev 38696)
@@ -38,10 +38,10 @@
 			Sleep(0); \
 		} else { \
 			if (timeBeginPeriod(1) != TIMERR_NOERROR) \
-				error("timeBeginPeriod(1) failed\n"); \
+				fprintf(stderr, "timeBeginPeriod(1) failed\n"); \
 			Sleep(x); \
 			if (timeEndPeriod(1) != TIMERR_NOERROR) \
-				error("timeEndPeriod(1) failed\n"); \
+				fprintf(stderr, "timeEndPeriod(1) failed\n"); \
 		} \
 	} while (0);
 #endif
@@ -152,21 +152,24 @@
 		int blanks = 0;
 
 		offset += offset_mod;
-		error("  [%04x] %d\t", old_offset + notational_offset, time);
+		fprintf(stderr, "  [%04x] %d\t",
+		        old_offset + notational_offset, time);
 
 		cmd = data[offset];
 		if (!(cmd & 0x80)) {
 			cmd = prev;
 			if (prev < 0x80) {
-				error("Track broken at %x after offset mod of %d\n", offset + notational_offset, offset_mod);
+				fprintf(stderr, "Track broken at %x after"
+				        " offset mod of %d\n",
+				        offset + notational_offset, offset_mod);
 				sci_hexdump(data, size, notational_offset);
 				return;
 			}
-			error("(rs %02x) ", cmd);
+			fprintf(stderr, "(rs %02x) ", cmd);
 			blanks += 8;
 		} else {
 			++offset;
-			error("%02x ", cmd);
+			fprintf(stderr, "%02x ", cmd);
 			blanks += 3;
 		}
 		prev = cmd;
@@ -178,37 +181,38 @@
 		for (i = 0; i < pleft; i++) {
 			if (i == 0)
 				firstarg = data[offset];
-			error("%02x ", data[offset++]);
+			fprintf(stderr, "%02x ", data[offset++]);
 			blanks += 3;
 		}
 
 		while (blanks < 16) {
 			blanks += 4;
-			error("    ");
+			fprintf(stderr, "    ");
 		}
 
 		while (blanks < 20) {
 			++blanks;
-			error(" ");
+			fprintf(stderr, " ");
 		}
 
 		if (cmd == SCI_MIDI_EOT)
-			error(";; EOT");
+			fprintf(stderr, ";; EOT");
 		else if (cmd == SCI_MIDI_SET_SIGNAL) {
 			if (firstarg == SCI_MIDI_SET_SIGNAL_LOOP)
-				error(";; LOOP point");
+				fprintf(stderr, ";; LOOP point");
 			else
-				error(";; CUE (%d)", firstarg);
+				fprintf(stderr, ";; CUE (%d)", firstarg);
 		} else if (SCI_MIDI_CONTROLLER(cmd)) {
 			if (firstarg == SCI_MIDI_CUMULATIVE_CUE)
-				error(";; CUE (cumulative)");
+				fprintf(stderr, ";; CUE (cumulative)");
 			else if (firstarg == SCI_MIDI_RESET_ON_SUSPEND)
-				error(";; RESET-ON-SUSPEND flag");
+				fprintf(stderr, ";; RESET-ON-SUSPEND flag");
 		}
-		error("\n");
+		fprintf(stderr, "\n");
 
 		if (old_offset >= offset) {
-			error("-- Not moving forward anymore, aborting (%x/%x)\n", offset, old_offset);
+			fprintf(stderr, "-- Not moving forward anymore,"
+			        " aborting (%x/%x)\n", offset, old_offset);
 			return;
 		}
 	}
@@ -370,7 +374,8 @@
 		mem_obj_t *mobj = GET_SEGMENT(s->seg_manager, pos.segment, MEM_OBJ_NODES);
 
 		if (!mobj || !ENTRY_IS_VALID(&(mobj->data.nodes), pos.offset)) {
-			sciprintf("   WARNING: "PREG": Doesn't contain list node", PRINT_REG(pos));
+			sciprintf("   WARNING: "PREG": Doesn't contain list node!\n",
+			          PRINT_REG(pos));
 			return;
 		}
 
@@ -379,14 +384,16 @@
 		sciprintf("\t"PREG"  : "PREG" -> "PREG"\n", PRINT_REG(pos), PRINT_REG(node->key), PRINT_REG(node->value));
 
 		if (!REG_EQ(my_prev, node->pred))
-			sciprintf("   WARNING: current node gives "PREG" as predecessor", PRINT_REG(node->pred));
+			sciprintf("   WARNING: current node gives "PREG" as predecessor!\n",
+			          PRINT_REG(node->pred));
 
 		my_prev = pos;
 		pos = node->succ;
 	}
 
 	if (!REG_EQ(my_prev, l->last))
-		sciprintf("   WARNING: Last node was expected to be "PREG", was "PREG"", PRINT_REG(l->last), PRINT_REG(my_prev));
+		sciprintf("   WARNING: Last node was expected to be "PREG", was "PREG"!\n",
+		          PRINT_REG(l->last), PRINT_REG(my_prev));
 	sciprintf("\t>\n");
 }
 
@@ -1862,7 +1869,7 @@
 	int palette = cmd_params[3].val;
 
 	if (!s) {
-		sciprintf("Not in debug state");
+		sciprintf("Not in debug state!\n");
 		return 1;
 	}
 
@@ -1877,7 +1884,7 @@
 	int col = cmd_params[0].val;
 
 	if (!s) {
-		sciprintf("Not in debug state");
+		sciprintf("Not in debug state!\n");
 		return 1;
 	}
 
@@ -1895,7 +1902,7 @@
 	int col = cmd_params[4].val;
 
 	if (!s) {
-		sciprintf("Not in debug state");
+		sciprintf("Not in debug state!\n");
 		return 1;
 	}
 
@@ -1914,7 +1921,7 @@
 	rect_t rect;
 
 	if (!s) {
-		sciprintf("Not in debug state");
+		sciprintf("Not in debug state!\n");
 		return 1;
 	}
 
@@ -1955,7 +1962,7 @@
 	int brLeft, brRight, brBottom, brTop;
 
 	if (!s) {
-		sciprintf("Not in debug state");
+		sciprintf("Not in debug state!\n");
 		return 1;
 	}
 

Modified: scummvm/trunk/engines/sci/engine/seg_manager.cpp
===================================================================
--- scummvm/trunk/engines/sci/engine/seg_manager.cpp	2009-02-21 13:19:44 UTC (rev 38695)
+++ scummvm/trunk/engines/sci/engine/seg_manager.cpp	2009-02-21 14:11:41 UTC (rev 38696)
@@ -203,7 +203,7 @@
 			sciprintf("Script and heap sizes combined exceed 64K.\n"
 			          "This means a fundamental design bug was made in FreeSCI\n"
 			          "regarding SCI1.1 games.\nPlease report this so it can be"
-			          "fixed in the next major version");
+			          "fixed in the next major version!\n");
 			return;
 		}
 	}
@@ -308,7 +308,8 @@
 		free(mobj->data.reserved);
 		break;
 	default:
-		error("Deallocating segment type %d not supported", mobj->type);
+		fprintf(stderr, "Deallocating segment type %d not supported!\n",
+		        mobj->type);
 		BREAKPOINT();
 	}
 
@@ -1320,8 +1321,9 @@
 	int count;
 
 	if (!pointer.segment || (pointer.segment >= self->heap_size) || !self->heap[pointer.segment]) {
-		sciprintf("Error: Attempt to dereference invalid pointer "PREG"", PRINT_REG(pointer));
-		return NULL; // Invalid
+		sciprintf("Error: Attempt to dereference invalid pointer "PREG"!\n",
+		          PRINT_REG(pointer));
+		return NULL; /* Invalid */
 	}
 
 	mobj = self->heap[pointer.segment];
@@ -1359,17 +1361,22 @@
 		if (pointer.offset < SYS_STRINGS_MAX && mobj->data.sys_strings.strings[pointer.offset].name)
 			return (byte *)(mobj->data.sys_strings.strings[pointer.offset].value);
 		else {
-			sciprintf("Error: Attempt to dereference invalid pointer "PREG"", PRINT_REG(pointer));
+			sciprintf("Error: Attempt to dereference invalid pointer "PREG"!\n",
+			          PRINT_REG(pointer));
 			return NULL;
 		}
 
 	case MEM_OBJ_RESERVED:
-		sciprintf("Error: Trying to dereference pointer "PREG" to reserved segment `%s'", PRINT_REG(pointer), mobj->data.reserved);
+		sciprintf("Error: Trying to dereference pointer "PREG" to reserved segment `%s'!\n",
+		          PRINT_REG(pointer),
+		          mobj->data.reserved);
 		return NULL;
 		break;
 
 	default:
-		sciprintf("Error: Trying to dereference pointer "PREG" to inappropriate segment", PRINT_REG(pointer));
+		sciprintf("Error: Trying to dereference pointer "PREG" to inappropriate"
+		          " segment!\n",
+		          PRINT_REG(pointer));
 		return NULL;
 	}
 
@@ -1484,11 +1491,11 @@
 			for (i = 0; i < obj->variables_nr; i++)
 				(*note)(param, obj->variables[i]);
 		} else {
-			error("Request for outgoing script-object reference at "PREG" yielded invalid index %d", PRINT_REG(addr), idx);
+			fprintf(stderr, "Request for outgoing script-object reference at "PREG" yielded invalid index %d\n", PRINT_REG(addr), idx);
 		}
 	} else {
-		//error("Unexpected request for outgoing script-object references at "PREG"", PRINT_REG(addr));
-		// Happens e.g. when we're looking into strings
+		/*		fprintf(stderr, "Unexpected request for outgoing script-object references at "PREG"\n", PRINT_REG(addr));*/
+		/* Happens e.g. when we're looking into strings */
 	}
 }
 
@@ -1529,7 +1536,7 @@
 	assert(addr.segment == self->seg_id);
 
 	if (!(ENTRY_IS_VALID(clone_table, addr.offset))) {
-		error("Unexpected request for outgoing references from clone at "PREG"", PRINT_REG(addr));
+		fprintf(stderr, "Unexpected request for outgoing references from clone at "PREG"\n", PRINT_REG(addr));
 //		BREAKPOINT();
 		return;
 	}
@@ -1619,12 +1626,10 @@
 
 static void list_all_outgoing_references_stack(seg_interface_t *self, EngineState *s, reg_t addr, void *param, void (*note)(void*param, reg_t addr)) {
 	int i;
-
-	printf("Emitting %d stack entries\n", self->mobj->data.stack.nr);
+	fprintf(stderr, "Emitting %d stack entries\n", self->mobj->data.stack.nr);
 	for (i = 0; i < self->mobj->data.stack.nr; i++)
 		(*note)(param, self->mobj->data.stack.entries[i]);
-
-	error("DONE");
+	fprintf(stderr, "DONE");
 }
 
 //-------------------- stack --------------------
@@ -1665,7 +1670,7 @@
 	list_t *list = &(table->table[addr.offset].entry);
 
 	if (!ENTRY_IS_VALID(table, addr.offset)) {
-		error("Invalid list referenced for outgoing references: "PREG"", PRINT_REG(addr));
+		fprintf(stderr, "Invalid list referenced for outgoing references: "PREG"\n", PRINT_REG(addr));
 		return;
 	}
 
@@ -1702,7 +1707,7 @@
 	node_t *node = &(table->table[addr.offset].entry);
 
 	if (!ENTRY_IS_VALID(table, addr.offset)) {
-		error("Invalid node referenced for outgoing references: "PREG"", PRINT_REG(addr));
+		fprintf(stderr, "Invalid node referenced for outgoing references: "PREG"\n", PRINT_REG(addr));
 		return;
 	}
 
@@ -1803,7 +1808,7 @@
 	memcpy(retval, seg_interfaces[mobj->type - 1], sizeof(seg_interface_t));
 
 	if (mobj->type != retval->type_id) {
-		error("Improper segment interface for %d", mobj->type);
+		fprintf(stderr, "Improper segment interface for %d", mobj->type);
 		exit(1);
 	}
 

Modified: scummvm/trunk/engines/sci/engine/sys_strings.cpp
===================================================================
--- scummvm/trunk/engines/sci/engine/sys_strings.cpp	2009-02-21 13:19:44 UTC (rev 38695)
+++ scummvm/trunk/engines/sci/engine/sys_strings.cpp	2009-02-21 14:11:41 UTC (rev 38696)
@@ -23,7 +23,6 @@
  *
  */
 
-#include "common/util.h"
 #include "sci/include/sys_strings.h"
 #include "sci/include/sci_memory.h"
 
@@ -33,12 +32,17 @@
 	sys_string_t *str = strings->strings + index;
 
 	if (index < 0 || index >= SYS_STRINGS_MAX) {
-		error("[SYSSTR] Error: Attempt to acquire string #%d", index);
+		fprintf(stderr, "[SYSSTR] Error: Attempt to acquire string #%d\n",
+		        index);
 		BREAKPOINT();
 	}
 
-	if (str->name && (strcmp(name, str->name) || (str->max_size != max_len))) {
-		error("[SYSSTR] Error: Attempt to re-acquire existing string #%d; was '%s', tried to claim as '%s'", index, str->name, name);
+	if (str->name
+	        && (strcmp(name, str->name)
+	            || (str->max_size != max_len))) {
+		fprintf(stderr, "[SYSSTR] Error: Attempt to re-acquire existing string #%d;"
+		        "was '%s', tried to claim as '%s'\n",
+		        index, str->name, name);
 		BREAKPOINT();
 	}
 
@@ -52,7 +56,8 @@
 	sys_string_t *str = strings->strings + index;
 
 	if (index < 0 || index >= SYS_STRINGS_MAX || !str->name) {
-		error("[SYSSTR] Error: Attempt to write to invalid/unused string #%d", index);
+		fprintf(stderr, "[SYSSTR] Error: Attempt to write to invalid/unused string #%d\n",
+		        index);
 		BREAKPOINT();
 		return 1;
 	}

Modified: scummvm/trunk/engines/sci/engine/vm.cpp
===================================================================
--- scummvm/trunk/engines/sci/engine/vm.cpp	2009-02-21 13:19:44 UTC (rev 38695)
+++ scummvm/trunk/engines/sci/engine/vm.cpp	2009-02-21 14:11:41 UTC (rev 38696)
@@ -75,14 +75,15 @@
 static inline reg_t *validate_property(object_t *obj, int index) {
 	if (!obj) {
 		if (sci_debug_flags & 4)
-			sciprintf("[VM] Sending to disposed object");
+			sciprintf("[VM] Sending to disposed object!\n");
 		_dummy_register = NULL_REG;
 		return &_dummy_register;
 	}
 
 	if (index < 0 || index >= obj->variables_nr) {
 		if (sci_debug_flags & 4)
-			sciprintf("[VM] Invalid property #%d (out of [0..%d]) requested", index, obj->variables_nr);
+			sciprintf("[VM] Invalid property #%d (out of [0..%d]) requested!\n", index,
+			          obj->variables_nr);
 
 		_dummy_register = NULL_REG;
 		return &_dummy_register;
@@ -534,12 +535,12 @@
 #endif
 
 void vm_handle_fatal_error(EngineState *s, int line, const char *file) {
-	error("Fatal VM error in %s, L%d; aborting...\n", file, line);
+	fprintf(stderr, "Fatal VM error in %s, L%d; aborting...\n", file, line);
 #ifdef HAVE_SETJMP_H
 	if (jump_initialized)
 		longjmp(vm_error_address, 0);
 #endif
-	error("Could not recover, exitting...\n");
+	fprintf(stderr, "Could not recover, exitting...\n");
 	exit(1);
 }
 
@@ -672,7 +673,7 @@
 			scr = script_locate_by_segment(s, xs->addr.pc.segment);
 			if (!scr) {
 				// No script? Implicit return via fake instruction buffer
-				warning("Running on non-existant script in segment %x", 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;
@@ -814,7 +815,8 @@
 				// Pointer arithmetics!
 				if (s->r_acc.segment) {
 					if (r_temp.segment) {
-						sciprintf("Error: Attempt to add two pointers, stack="PREG" and acc="PREG"", PRINT_REG(r_temp), PRINT_REG(s->r_acc));
+						sciprintf("Error: Attempt to add two pointers, stack="PREG" and acc="PREG"!\n",
+						          PRINT_REG(r_temp), PRINT_REG(s->r_acc));
 						script_debug_flag = script_error_flag = 1;
 						offset = 0;
 					} else {
@@ -840,7 +842,8 @@
 				// Pointer arithmetics!
 				if (s->r_acc.segment) {
 					if (r_temp.segment) {
-						sciprintf("Error: Attempt to subtract two pointers, stack="PREG" and acc="PREG"", PRINT_REG(r_temp), PRINT_REG(s->r_acc));
+						sciprintf("Error: Attempt to subtract two pointers, stack="PREG" and acc="PREG"!\n",
+						          PRINT_REG(r_temp), PRINT_REG(s->r_acc));
 						script_debug_flag = script_error_flag = 1;
 						offset = 0;
 					} else {

Modified: scummvm/trunk/engines/sci/gfx/font.cpp
===================================================================
--- scummvm/trunk/engines/sci/gfx/font.cpp	2009-02-21 13:19:44 UTC (rev 38695)
+++ scummvm/trunk/engines/sci/gfx/font.cpp	2009-02-21 14:11:41 UTC (rev 38696)
@@ -120,7 +120,7 @@
 }
 
 gfx_bitmap_font_t *gfxr_scale_font(gfx_bitmap_font_t *orig_font, gfx_mode_t *mode, gfxr_font_scale_filter_t filter) {
-	GFXWARN("This function hasn't been tested yet");
+	GFXWARN("This function hasn't been tested yet!\n");
 
 	switch (filter) {
 
@@ -128,7 +128,7 @@
 		return gfxr_scale_font_unfiltered(orig_font, mode);
 
 	default:
-		GFXERROR("Invalid font filter mode %d", filter);
+		GFXERROR("Invalid font filter mode %d!\n", filter);
 		return NULL;
 	}
 }
@@ -297,7 +297,7 @@
 		int ch = (int) text[i];
 
 		if (ch >= font->chars_nr) {
-			GFXERROR("Invalid character 0x%02x encountered", text[i]);
+			GFXERROR("Invalid character 0x%02x encountered!\n", text[i]);
 			return NULL;
 		}
 
@@ -308,7 +308,7 @@
 
 	pxm->colors_nr = !!fg0 + !!fg1 + !!bg;
 	if (pxm->colors_nr == 0) {
-		GFXWARN("Pixmap would have zero colors, resetting");
+		GFXWARN("Pixmap would have zero colors, resetting!\n");
 		pxm->colors_nr = 3;
 		hack = 1;
 		fg0 = fg1 = bg = &dummy;

Modified: scummvm/trunk/engines/sci/gfx/gfx_driver.cpp
===================================================================
--- scummvm/trunk/engines/sci/gfx/gfx_driver.cpp	2009-02-21 13:19:44 UTC (rev 38695)
+++ scummvm/trunk/engines/sci/gfx/gfx_driver.cpp	2009-02-21 14:11:41 UTC (rev 38696)
@@ -234,7 +234,7 @@
 		break;
 
 	case GFX_MASK_PRIORITY:
-		printf("FIXME: priority map grab not implemented yet");
+		printf("FIXME: priority map grab not implemented yet!\n");
 		break;
 
 	default:
@@ -282,7 +282,7 @@
 		S->update_screen = true;
 		break;
 	default:
-		GFXERROR("Invalid buffer %d in update", buffer);
+		GFXERROR("Invalid buffer %d in update!\n", buffer);
 		return GFX_ERROR;
 	}
 

Modified: scummvm/trunk/engines/sci/gfx/gfx_res_options.cpp
===================================================================
--- scummvm/trunk/engines/sci/gfx/gfx_res_options.cpp	2009-02-21 13:19:44 UTC (rev 38695)
+++ scummvm/trunk/engines/sci/gfx/gfx_res_options.cpp	2009-02-21 14:11:41 UTC (rev 38696)
@@ -46,7 +46,8 @@
 
 #ifdef DEBUG
 static void print_pattern(gfx_res_pattern_t *pat) {
-	error("[%d..%d]", pat->min, pat->max);
+	fprintf(stderr, "[%d..%d]",
+	        pat->min, pat->max);
 }
 #endif
 
@@ -54,24 +55,24 @@
 	int loc;
 #ifdef DEBUG
 	int i;
-
-	error("[DEBUG:gfx-res] Trying to match against %d/%d/%d choices\n", conf->patterns_nr, conf->loops_nr, conf->cels_nr);
+	fprintf(stderr, "[DEBUG:gfx-res] Trying to match against %d/%d/%d choices\n",
+	        conf->patterns_nr, conf->loops_nr, conf->cels_nr);
 	for (i = 0; i < conf->patterns_nr; i++) {
-		error("[DEBUG:gfx-res] Pat #%d: ", i);
+		fprintf(stderr, "[DEBUG:gfx-res] Pat #%d: ", i);
 		print_pattern(conf->patterns + i);
-		error("\n");
+		fprintf(stderr, "\n");
 	}
 	loc = conf->patterns_nr;
 	for (i = 0; i < conf->loops_nr; i++) {
-		error("[DEBUG:gfx-res] Loop #%d: ", i);
+		fprintf(stderr, "[DEBUG:gfx-res] Loop #%d: ", i);
 		print_pattern(conf->patterns + i + loc);
-		error("\n");
+		fprintf(stderr, "\n");
 	}
 	loc += conf->loops_nr;
 	for (i = 0; i < conf->cels_nr; i++) {
-		error("[DEBUG:gfx-res] Cel #%d: ", i);
+		fprintf(stderr, "[DEBUG:gfx-res] Cel #%d: ", i);
 		print_pattern(conf->patterns + i + loc);
-		error("\n");
+		fprintf(stderr, "\n");
 	}
 #endif
 	if (conf->patterns_nr && !matches_patternlist(conf->patterns, conf->patterns_nr, nr))
@@ -104,7 +105,7 @@
 	while (conflist) {
 		if (resource_matches_patternlists(conflist, type, nr, loop, cel)) {
 #ifdef DEBUG
-			error("[DEBUG:gfx-res] Found match");
+			fprintf(stderr, "[DEBUG:gfx-res] Found match!\n");
 #endif
 			return conflist;
 		}
@@ -175,7 +176,8 @@
 	gfx_res_conf_t *conf;
 
 #ifdef DEBUG
-	error("[DEBUG:gfx-res] Trying to conf %d/%d/%d/%d (ID=%d)\n", restype, nr, loop, cel, pxm->ID);
+	fprintf(stderr, "[DEBUG:gfx-res] Trying to conf %d/%d/%d/%d (ID=%d)\n",
+	        restype, nr, loop, cel, pxm->ID);
 #endif
 
 	if (pxm->ID < 0 || restype < 0 || restype >= GFX_RESOURCE_TYPES_NR)

Modified: scummvm/trunk/engines/sci/gfx/gfx_resource.cpp
===================================================================
--- scummvm/trunk/engines/sci/gfx/gfx_resource.cpp	2009-02-21 13:19:44 UTC (rev 38695)
+++ scummvm/trunk/engines/sci/gfx/gfx_resource.cpp	2009-02-21 14:11:41 UTC (rev 38696)
@@ -195,7 +195,7 @@
 		break;
 
 	default:
-		error("gfxr_endianness_adjust(): Cannot adjust endianness for %d bytespp", bytespp);
+		fprintf(stderr, "gfxr_endianness_adjust(): Cannot adjust endianness for %d bytespp!\n", bytespp);
 		return NULL;
 	}
 
@@ -357,7 +357,7 @@
 
 		for (i = 0; i < pxm->colors_nr; i++) {
 			if (gfx_alloc_color(mode->palette, pxm->colors + i) < 0) {
-				GFXWARN("Failed to allocate color %d/%d in pixmap (color %02x/%02x/%02x)",
+				GFXWARN("Failed to allocate color %d/%d in pixmap (color %02x/%02x/%02x)!\n",
 				        i, pxm->colors_nr, pxm->colors[i].r, pxm->colors[i].g, pxm->colors[i].b);
 				pxm->colors[i].global_index = 0;
 			}

Modified: scummvm/trunk/engines/sci/gfx/gfx_support.cpp
===================================================================
--- scummvm/trunk/engines/sci/gfx/gfx_support.cpp	2009-02-21 13:19:44 UTC (rev 38695)
+++ scummvm/trunk/engines/sci/gfx/gfx_support.cpp	2009-02-21 14:11:41 UTC (rev 38696)
@@ -78,7 +78,7 @@
 		return;
 
 	default:
-		GFXERROR("pixelwidth=%d not supported", pixelwidth);
+		GFXERROR("pixelwidth=%d not supported!\n", pixelwidth);
 		return;
 
 	}
@@ -350,7 +350,7 @@
 
 		alpha_mask = mode->alpha_mask;
 		if (!alpha_mask && pxm->alpha_map) {
-			GFXERROR("Invalid alpha mode: both pxm->alpha_map and alpha_mask are white");
+			GFXERROR("Invalid alpha mode: both pxm->alpha_map and alpha_mask are white!\n");
 			return GFX_ERROR;
 		}
 

Modified: scummvm/trunk/engines/sci/gfx/gfx_tools.cpp
===================================================================
--- scummvm/trunk/engines/sci/gfx/gfx_tools.cpp	2009-02-21 13:19:44 UTC (rev 38695)
+++ scummvm/trunk/engines/sci/gfx/gfx_tools.cpp	2009-02-21 14:11:41 UTC (rev 38696)
@@ -183,7 +183,7 @@
 	int size;
 
 	if (pixmap->index_data) {
-		GFXWARN("Attempt to allocate pixmap index data twice");
+		GFXWARN("Attempt to allocate pixmap index data twice!\n");
 		return pixmap;
 	}
 
@@ -200,7 +200,7 @@
 
 gfx_pixmap_t *gfx_pixmap_free_index_data(gfx_pixmap_t *pixmap) {
 	if (!pixmap->index_data) {
-		GFXWARN("Attempt to free pixmap index data twice");
+		GFXWARN("Attempt to free pixmap index data twice!\n");
 		return pixmap;
 	}
 
@@ -213,7 +213,7 @@
 	int size;
 
 	if (pixmap->data) {
-		GFXWARN("Attempt to allocate pixmap data twice");
+		GFXWARN("Attempt to allocate pixmap data twice!\n");
 		return pixmap;
 	}
 
@@ -235,7 +235,7 @@
 
 gfx_pixmap_t *gfx_pixmap_free_data(gfx_pixmap_t *pixmap) {
 	if (!pixmap->data) {
-		GFXWARN("Attempt to free pixmap data twice");
+		GFXWARN("Attempt to free pixmap data twice!\n");
 		return pixmap;
 	}
 
@@ -256,14 +256,14 @@
 		return GFX_OK;
 
 	if (pal->max_colors_nr <= 0) {
-		GFXERROR("Palette has zero or less color entries");
+		GFXERROR("Palette has zero or less color entries!\n");
 		return GFX_ERROR;
 	}
 
 
 	if (color->global_index != GFX_COLOR_INDEX_UNMAPPED) {
 #if 0
-		GFXDEBUG("Attempt to allocate color twice: index 0x%d (%02x/%02x/%02x)",
+		GFXDEBUG("Attempt to allocate color twice: index 0x%d (%02x/%02x/%02x)!\n",
 		         color->global_index, color->r, color->g, color->b);
 #endif
 		return GFX_OK;
@@ -317,7 +317,7 @@
 		return GFX_OK;
 
 	if (color->global_index == GFX_COLOR_INDEX_UNMAPPED) {
-		GFXWARN("Attempt to free unmapped color %02x/%02x/%02x", color->r, color->g, color->b);
+		GFXWARN("Attempt to free unmapped color %02x/%02x/%02x!\n", color->r, color->g, color->b);
 		BREAKPOINT();
 		return GFX_ERROR;
 	}
@@ -361,7 +361,7 @@
 	old_data = pixmap->index_data;
 
 	if (!old_data) {
-		GFXERROR("Attempt to scale index data without index data");
+		GFXERROR("Attempt to scale index data without index data!\n");
 		return pixmap;
 	}
 

Modified: scummvm/trunk/engines/sci/gfx/operations.cpp
===================================================================
--- scummvm/trunk/engines/sci/gfx/operations.cpp	2009-02-21 13:19:44 UTC (rev 38695)
+++ scummvm/trunk/engines/sci/gfx/operations.cpp	2009-02-21 14:11:41 UTC (rev 38696)
@@ -38,7 +38,7 @@
 // Enable to debug stuff relevant for dirty rectsin widget management
 
 #ifdef GFXW_DEBUG_DIRTY
-#  define DDIRTY error("%s:%5d| ", __FILE__, __LINE__); fprintf
+#  define DDIRTY fprintf(stderr, "%s:%5d| ", __FILE__, __LINE__); fprintf
 #else
 #  define DDIRTY if (0) fprintf
 #endif
@@ -61,19 +61,19 @@
 // Performs basic checks that apply to most functions
 #define BASIC_CHECKS(error_retval) \
 if (!state) { \
-	GFXERROR("Null state"); \
+	GFXERROR("Null state!\n"); \
 	return error_retval; \
 } \
 if (!state->driver) { \
-	GFXERROR("GFX driver invalid"); \
+	GFXERROR("GFX driver invalid!\n"); \
 	return error_retval; \
 }
 
 // How to determine whether colors have to be allocated
 #define PALETTE_MODE state->driver->mode->palette
 
-#define DRAW_POINTER { int __x = _gfxop_draw_pointer(state); if (__x) { GFXERROR("Drawing the mouse pointer failed"); return __x;} }
-#define REMOVE_POINTER { int __x = _gfxop_remove_pointer(state); if (__x) { GFXERROR("Removing the mouse pointer failed"); return __x;} }
+#define DRAW_POINTER { int __x = _gfxop_draw_pointer(state); if (__x) { GFXERROR("Drawing the mouse pointer failed!\n"); return __x;} }
+#define REMOVE_POINTER { int __x = _gfxop_remove_pointer(state); if (__x) { GFXERROR("Removing the mouse pointer failed!\n"); return __x;} }
 
 //#define GFXOP_DEBUG_DIRTY
 
@@ -235,7 +235,7 @@
 			if ((error = driver->set_palette(driver, pxm->colors[i].global_index, pxm->colors[i].r,
 			                                 pxm->colors[i].g, pxm->colors[i].b))) {
 
-				GFXWARN("driver->set_palette(%d, %02x/%02x/%02x) failed",
+				GFXWARN("driver->set_palette(%d, %02x/%02x/%02x) failed!\n",
 				        pxm->colors[i].global_index, pxm->colors[i].r, pxm->colors[i].g, pxm->colors[i].b);
 
 				if (error == GFX_FATAL)
@@ -283,7 +283,7 @@
 	error = driver->draw_pixmap(driver, pxm, priority, src, clipped_dest, static_buf ? GFX_BUFFER_STATIC : GFX_BUFFER_BACK);
 
 	if (error) {
-		GFXERROR("driver->draw_pixmap() returned error");
+		GFXERROR("driver->draw_pixmap() returned error!\n");
 		return error;
 	}
 
@@ -432,7 +432,8 @@
 		box.yl = - box.yl;
 	}
 #ifdef GFXOP_DEBUG_DIRTY
-	error("Adding new dirty (%d %d %d %d)\n", GFX_PRINT_RECT(box));
+	fprintf(stderr, "Adding new dirty (%d %d %d %d)\n",
+	        GFX_PRINT_RECT(box));
 #endif
 	if (_gfxop_clip(&box, gfx_rect(0, 0, 320, 200)))
 		return base;
@@ -500,7 +501,8 @@
 		return GFX_OK;
 
 #ifdef GFXOP_DEBUG_DIRTY
-	error("\tClearing dirty (%d %d %d %d)\n", GFX_PRINT_RECT(rect->rect));
+	fprintf(stderr, "\tClearing dirty (%d %d %d %d)\n",
+	        GFX_PRINT_RECT(rect->rect));
 #endif
 	if (!state->fullscreen_override)
 		retval = _gfxop_update_box(state, rect->rect);
@@ -526,7 +528,7 @@
 	state->options = options;
 
 	if (!((state->resstate = gfxr_new_resource_manager(state->version, state->options, state->driver, misc_payload)))) {
-		GFXERROR("Failed to initialize resource manager");
+		GFXERROR("Failed to initialize resource manager!\n");
 		return GFX_FATAL;
 	}
 
@@ -1169,7 +1171,7 @@
 		return drv->draw_filled_rect(drv, new_box, color1, color1, GFX_SHADE_FLAT);
 	else {
 		if (PALETTE_MODE) {
-			GFXWARN("Attempting to draw shaded box in palette mode");
+			GFXWARN("Attempting to draw shaded box in palette mode!\n");
 			return GFX_ERROR;
 		}
 
@@ -1261,7 +1263,7 @@
 		break;
 
 	default:
-		error("Invalid display map %d selected", visible_map);
+		fprintf(stderr, "Invalid display map %d selected!\n", visible_map);
 		return GFX_ERROR;
 	}
 
@@ -1289,7 +1291,7 @@
 	}
 
 	if (retval) {
-		GFXERROR("Clearing the dirty rectangles failed");
+		GFXERROR("Clearing the dirty rectangles failed!\n");
 	}
 
 	if (state->tag_mode) {
@@ -1335,7 +1337,7 @@
 #define MILLION 1000000
 // Sure, this may seem silly, but it's too easy to miss a zero...)
 
-#define GFXOP_FULL_POINTER_REFRESH if (_gfxop_full_pointer_refresh(state)) { GFXERROR("Failed to do full pointer refresh"); return GFX_ERROR; }
+#define GFXOP_FULL_POINTER_REFRESH if (_gfxop_full_pointer_refresh(state)) { GFXERROR("Failed to do full pointer refresh!\n"); return GFX_ERROR; }
 
 static int _gfxop_full_pointer_refresh(gfx_state_t *state) {
 	rect_t pointer_bounds;
@@ -1630,7 +1632,7 @@
 
 	BASIC_CHECKS(error_event);
 	if (_gfxop_remove_pointer(state)) {
-		GFXERROR("Failed to remove pointer before processing event");
+		GFXERROR("Failed to remove pointer before processing event!\n");
 	}
 
 	while (*seekerp && !((*seekerp)->event.type & mask))
@@ -1663,7 +1665,7 @@
 	}
 
 	if (_gfxop_full_pointer_refresh(state)) {
-		GFXERROR("Failed to update the mouse pointer");
+		GFXERROR("Failed to update the mouse pointer!\n");
 		return error_event;
 	}
 
@@ -1857,13 +1859,13 @@
 		state->pic_unscaled = gfxr_get_pic(state->resstate, nr, GFX_MASK_VISUAL, flags, default_palette, 0);
 
 	if (!state->pic || !state->pic_unscaled) {
-		GFXERROR("Could not retrieve background pic %d", nr);
+		GFXERROR("Could not retrieve background pic %d!\n", nr);
 		if (state->pic) {
-			GFXERROR("  -- Inconsistency: scaled pic _was_ retrieved");
+			GFXERROR("  -- Inconsistency: scaled pic _was_ retrieved!\n");
 		}
 
 		if (state->pic_unscaled) {
-			GFXERROR("  -- Inconsistency: unscaled pic _was_ retrieved");
+			GFXERROR("  -- Inconsistency: unscaled pic _was_ retrieved!\n");
 		}
 
 		state->pic = state->pic_unscaled = NULL;
@@ -1879,12 +1881,12 @@
 	BASIC_CHECKS(GFX_FATAL);
 
 	if (!state->pic) {
-		GFXERROR("Attempt to add to pic with no pic active");
+		GFXERROR("Attempt to add to pic with no pic active!\n");
 		return GFX_ERROR;
 	}
 
 	if (!(state->pic = gfxr_add_to_pic(state->resstate, state->pic_nr, nr, GFX_MASK_VISUAL, flags, state->palette_nr, default_palette, 1))) {
-		GFXERROR("Could not add pic #%d to pic #%d", state->pic_nr, nr);
+		GFXERROR("Could not add pic #%d to pic #%d!\n", state->pic_nr, nr);
 		return GFX_ERROR;
 	}
 	state->pic_unscaled = gfxr_add_to_pic(state->resstate, state->pic_nr, nr, GFX_MASK_VISUAL, flags,
@@ -2052,7 +2054,7 @@
 	REMOVE_POINTER;
 
 	if (!handle) {
-		GFXERROR("Attempt to draw text with NULL handle");
+		GFXERROR("Attempt to draw text with NULL handle!\n");
 		return GFX_ERROR;
 	}
 
@@ -2081,7 +2083,7 @@
 		break;
 
 	default:
-		GFXERROR("Invalid vertical alignment %d", handle->valign);
+		GFXERROR("Invalid vertical alignment %d!\n", handle->valign);
 		return GFX_FATAL; // Internal error...
 	}
 
@@ -2114,7 +2116,7 @@
 			break;
 
 		default:
-			GFXERROR("Invalid vertical alignment %d", handle->valign);
+			GFXERROR("Invalid vertical alignment %d!\n", handle->valign);
 			return GFX_FATAL; // Internal error...
 		}
 
@@ -2137,7 +2139,7 @@
 	rect_t resultzone; // Ignored for this application
 	BASIC_CHECKS(NULL);
 	if (_gfxop_remove_pointer(state)) {
-		GFXERROR("Could not remove pointer");
+		GFXERROR("Could not remove pointer!\n");
 		return NULL;
 	}
 
@@ -2155,7 +2157,7 @@
 	BASIC_CHECKS(GFX_ERROR);
 
 	if (!pxm) {
-		GFXERROR("Attempt to draw NULL pixmap");
+		GFXERROR("Attempt to draw NULL pixmap!\n");
 		return GFX_ERROR;
 	}
 

Modified: scummvm/trunk/engines/sci/gfx/resmgr.cpp
===================================================================
--- scummvm/trunk/engines/sci/gfx/resmgr.cpp	2009-02-21 13:19:44 UTC (rev 38695)
+++ scummvm/trunk/engines/sci/gfx/resmgr.cpp	2009-02-21 14:11:41 UTC (rev 38696)
@@ -68,7 +68,7 @@
 		else {
 			tree = sbtree_new(entries_nr, resources);
 			if (!tree) {
-				GFXWARN("Failed to allocate tree for %d entries of resource type %d", entries_nr, i);
+				GFXWARN("Failed to allocate tree for %d entries of resource type %d!\n", entries_nr, i);
 			}
 			state->resource_trees[i] = tree;
 			free(resources);
@@ -274,7 +274,7 @@
 			pic = gfxr_interpreter_init_pic(state->version, state->driver->mode, GFXR_RES_ID(restype, nr), state->misc_payload);
 
 		if (!pic) {
-			GFXERROR("Failed to allocate scaled pic");
+			GFXERROR("Failed to allocate scaled pic!\n");
 			return NULL;
 		}
 
@@ -284,7 +284,7 @@
 			unscaled_pic = gfxr_interpreter_init_pic(state->version, &mode_1x1_color_index, GFXR_RES_ID(restype, nr),
 													state->misc_payload);
 			if (!unscaled_pic) {
-				GFXERROR("Failed to allocate unscaled pic");
+				GFXERROR("Failed to allocate unscaled pic!\n");
 				return NULL;
 			}
 			gfxr_interpreter_clear_pic(state->version, unscaled_pic, state->misc_payload);

Modified: scummvm/trunk/engines/sci/gfx/resource/sci_pic_0.cpp
===================================================================
--- scummvm/trunk/engines/sci/gfx/resource/sci_pic_0.cpp	2009-02-21 13:19:44 UTC (rev 38695)
+++ scummvm/trunk/engines/sci/gfx/resource/sci_pic_0.cpp	2009-02-21 14:11:41 UTC (rev 38696)
@@ -362,11 +362,11 @@
 
 #ifdef FILL_RECURSIVE_DEBUG
 	if (!fillmagc) {
-		error("------------------------------------------------\n");
-		error("LineID:   ");
+		fprintf(stderr, "------------------------------------------------\n");
+		fprintf(stderr, "LineID:   ");
 		for (i = 0; i < 5; i++)
-			error("  %d       ", i);
-		error("\n");
+			fprintf(stderr, "  %d       ", i);
+		fprintf(stderr, "\n");
 	}
 #endif
 
@@ -466,10 +466,10 @@
 
 #ifdef FILL_RECURSIVE_DEBUG
 		if (!fillmagc && intervals_nr) {
-			error("AI L#%03d:", y);
+			fprintf(stderr, "AI L#%03d:", y);
 			for (int j = 0; j < intervals_nr; j++)
-				error("%c[%03d,%03d]", intervals[ivi][j].tag ? ' ' : '-', intervals[ivi][j].xl, intervals[ivi][j].xr);
-			error("\n");
+				fprintf(stderr, "%c[%03d,%03d]", intervals[ivi][j].tag ? ' ' : '-', intervals[ivi][j].xl, intervals[ivi][j].xr);
+			fprintf(stderr, "\n");
 		}
 #endif
 
@@ -614,7 +614,7 @@
 				break;
 
 			default:
-				error("%s L%d: Invalid ellipse fill mode", __FILE__, __LINE__);
+				fprintf(stderr, "%s L%d: Invalid ellipse fill mode!\n", __FILE__, __LINE__);
 				return;
 
 			}
@@ -916,7 +916,8 @@
 	end.y = ey;
 
 	if (ex >= pic->visual_map->index_xl || ey >= pic->visual_map->index_yl || x < 0 || y < 0) {
-		error("While drawing pic0: INVALID LINE %d,%d,%d,%d\n", start.x, start.y, end.x, end.y);
+		fprintf(stderr, "While drawing pic0: INVALID LINE %d,%d,%d,%d\n",
+		        start.x, start.y, end.x, end.y);
 		return;
 	}
 
@@ -1233,7 +1234,7 @@
 	assert(src->mode->yfact == 1);
 
 	if (bound_x == 1 && bound_y == 1) {
-		GFXWARN("attempt to remove artifacts from unscaled pic");
+		GFXWARN("attempt to remove artifacts from unscaled pic!\n");
 		return;
 	}
 
@@ -1406,12 +1407,12 @@
 			GET_ABS_COORDS(oldx, oldy);
 			while (*(resource + pos) < PIC_OP_FIRST) {
 #if 0
-				error("Medium-line: [%04x] from %d,%d, data %02x %02x (dx=%d)", pos, oldx, oldy,
+				fprintf(stderr, "Medium-line: [%04x] from %d,%d, data %02x %02x (dx=%d)", pos, oldx, oldy,
 				        0xff & resource[pos], 0xff & resource[pos+1], *((signed char *) resource + pos + 1));
 #endif
 				GET_MEDREL_COORDS(oldx, oldy);
 #if 0
-				error(" to %d,%d\n", x, y);
+				fprintf(stderr, " to %d,%d\n", x, y);
 #endif
 				_gfxr_draw_line(pic, oldx, oldy, x, y, color, priority, control, drawenable, line_mode,
 				                PIC_OP_MEDIUM_LINES, sci_titlebar_size);
@@ -1675,7 +1676,7 @@
 				// *if it's not for some reason, we should die
 				
 				if (!(view->flags & GFX_PIXMAP_FLAG_EXTERNAL_PALETTE) && !sci1) {
-					sciprintf("gfx_draw_pic0(): can't set a non-static palette for an embedded view");
+					sciprintf("gfx_draw_pic0(): can't set a non-static palette for an embedded view!\n");
 				}
 
 				// For SCI0, use special color mapping to copy the low
@@ -1858,7 +1859,7 @@
 				break;
 
 			default:
-				GFXERROR("Invalid dither mode %d", dmode);
+				GFXERROR("Invalid dither mode %d!\n", dmode);
 				return;
 			}
 

Modified: scummvm/trunk/engines/sci/gfx/resource/sci_view_1.cpp
===================================================================
--- scummvm/trunk/engines/sci/gfx/resource/sci_view_1.cpp	2009-02-21 13:19:44 UTC (rev 38695)
+++ scummvm/trunk/engines/sci/gfx/resource/sci_view_1.cpp	2009-02-21 14:11:41 UTC (rev 38696)
@@ -341,7 +341,7 @@
 		return NULL;
 	}
 
-	//error("View flags are 0x%02x\n", resource[3]);
+	/*	fprintf(stderr, "View flags are 0x%02x\n", resource[3]);*/
 
 	/*
 		for (i = 0; i < V1_MAGICS_NR; i++)

Modified: scummvm/trunk/engines/sci/gfx/sbtree.cpp
===================================================================
--- scummvm/trunk/engines/sci/gfx/sbtree.cpp	2009-02-21 13:19:44 UTC (rev 38695)
+++ scummvm/trunk/engines/sci/gfx/sbtree.cpp	2009-02-21 14:11:41 UTC (rev 38696)
@@ -25,7 +25,7 @@
 
 // Static binary lookup tree lookup
 
-#include "common/util.h"
+
 #include "sci/include/sci_memory.h"
 #include "sci/include/sbtree.h"
 #include <stdlib.h>
@@ -82,14 +82,14 @@
 		table[i].key = NOT_A_KEY;
 
 	if (!table) {
-		error("SBTree: Out of memory: Could not allocate %d cells\n", table_size);
+		fprintf(stderr, "SBTree: Out of memory: Could not allocate %d cells\n", table_size);
 		return NULL;
 	}
 
 	tree = (sbtree_t *)sci_malloc(sizeof(sbtree_t));
 
 	if (!tree) {
-		error("SBTree: Could not allocate tree structure\n");
+		fprintf(stderr, "SBTree: Could not allocate tree structure\n");
 		free(table);
 		return NULL;
 	}
@@ -101,7 +101,7 @@
 	tree->levels = levels;
 	tree->entries_nr = size;
 	if ((tree->min_entry = keys[0]) < 0) {
-		error("SBTree: Error: Using negative keys\n");
+		fprintf(stderr, "SBTree: Error: Using negative keys\n");
 		free(table);
 		free(tree);
 		return NULL;
@@ -114,7 +114,7 @@
 
 void sbtree_free(sbtree_t *tree) {
 	if (!tree) {
-		error("SBTree: Attempt to free NULL sbtree\n");
+		fprintf(stderr, "SBTree: Attempt to free NULL sbtree\n");
 		return;
 	}
 
@@ -174,24 +174,24 @@
 	int l, i;
 	sbcell_t *cells = (sbcell_t *)tree->data;
 
-	error("\tTree:\n");
+	fprintf(stderr, "\tTree:\n");
 	for (l = 0; l <= tree->levels; l++) {
-		error("\t  ");
+		fprintf(stderr, "\t  ");
 		for (i = 0; i < (1 << l); i++) {
 			if (cells->key == NOT_A_KEY)
-				error("-- ");
+				fprintf(stderr, "-- ");
 			else {
 				if (cells->value)
-					error("%d+ ", cells->key);
+					fprintf(stderr, "%d+ ", cells->key);
 				else
-					error("%d  ", cells->key);
+					fprintf(stderr, "%d  ", cells->key);
 			}
 
 			cells = cells + 1;
 		}
-		error("\n");
+		fprintf(stderr, "\n");
 	}
-	error("\n");
+	fprintf(stderr, "\n");
 }
 #endif
 
@@ -206,7 +206,7 @@
 	int *real_value = (int *) value;
 
 	if (!real_value)
-		error("foreach_double_func(): key %d mapped to non-value", key);
+		fprintf(stderr, "foreach_double_func(): key %d mapped to non-value!\n", key);
 	else
 		*real_value *= 2;
 
@@ -248,7 +248,7 @@
 
 	for (i = 0; i < nr; i++)
 		if (sbtree_set(tree, data[i], (void *)(data + i))) {
-			error("While inserting: %d incorrectly deemed invalid\n", data[i]);
+			fprintf(stderr, "While inserting: %d incorrectly deemed invalid\n", data[i]);
 			any_error = 1;
 		}
 }
@@ -275,18 +275,18 @@
 				found = 1;
 
 		if (found && !value) {
-			error("!%d ", key);
+			fprintf(stderr, "!%d ", key);
 			++failed;
 		} else if (!found && found) {
-			error("?[%d]=%d ", key, *value);
+			fprintf(stderr, "?[%d]=%d ", key, *value);
 			++failed;
 		}
 	}
 
 	if (failed)
-		error("(%d/%d errors)\n", any_error = failed, times);
+		fprintf(stderr, "(%d/%d errors)\n", any_error = failed, times);
 	else
-		error("OK\n");
+		fprintf(stderr, "OK\n");
 }
 
 void test_boundary(sbtree_t *tree, int max, int random) {
@@ -297,23 +297,23 @@
 	int failure = (value_too_low || value_too_high || (!random && (!value_low || !value_high)));
 
 	if (!failure)
-		error("OK\n");
+		fprintf(stderr, "OK\n");
 	else {
 		any_error = 1;
 
-		error("Errors: ");
+		fprintf(stderr, "Errors: ");
 		if (value_too_low)
-			error("too-low=%d ", *value_too_low);
+			fprintf(stderr, "too-low=%d ", *value_too_low);
 		if (value_too_high)
-			error("too-high=%d ", *value_too_high);
+			fprintf(stderr, "too-high=%d ", *value_too_high);
 
 		if (!random) {
 			if (!value_low)
-				error("!low ");
+				fprintf(stderr, "!low ");
 			if (!value_high)
-				error("!high ");
+				fprintf(stderr, "!high ");
 		}
-		error("\n");
+		fprintf(stderr, "\n");
 	}
 }
 
@@ -326,15 +326,15 @@
 		int *value;
 
 		if ((value = (int *) sbtree_get(tree, key))) {
-			error("?[%d]=%d\n", key, *value);
+			fprintf(stderr, "?[%d]=%d\n", key, *value);
 			++errors;
 		}
 	}
 
 	if (errors)
-		error(" (%d/%d errors)\n", any_error = errors, count);
+		fprintf(stderr, " (%d/%d errors)\n", any_error = errors, count);
 	else
-		error("OK\n");
+		fprintf(stderr, "OK\n");
 }
 
 void run_test(sbtree_t *tree, int entries, int *data, int random, int max_value) {
@@ -343,23 +343,23 @@
 
 	any_error = 0;
 
-	error("\tEmpty test: \t\t\t");
+	fprintf(stderr, "\tEmpty test: \t\t\t");
 	test_empty(tree, entries * 2, entries + 1);
 	insert_values(tree, entries, data);
-	error("\tBoundary test: \t\t\t");
+	fprintf(stderr, "\tBoundary test: \t\t\t");
 	test_boundary(tree, max_value, random);
 
 	for (i = 0; i < 3; i++) {
-		error(tests[i]);
+		fprintf(stderr, tests[i]);
 		test_value(tree, entries * 2, entries * 2, entries, data, i);
 	}
 
 	if (!random) {
 		i = data[0];
 		sbtree_foreach(tree, NULL, foreach_double_func);
-		error("\tForeach test: \t\t\t");
+		fprintf(stderr, "\tForeach test: \t\t\t");
 		if (i * 2 != data[0]) {
-			error("Error: No effect: %d * 2 != %d\n", i, data[0]);
+			fprintf(stderr, "Error: No effect: %d * 2 != %d\n", i, data[0]);
 			any_error = 1;
 		} else
 			test_value(tree, entries * 2, entries * 2, entries, data, MODE_LINEAR_DOUBLE);
@@ -378,47 +378,46 @@
 	int tests_nr = TESTS_NR;
 	int test_sizes[TESTS_NR] = {1, 2, 3, 7, 8, 9, 1000, 16383, 16384, 16385, 1000000};
 	int i;
-
-	error("sbtree.c Copyright (C) 2000 Christoph Reichenbach <jameson at linuxgames.com>\n"
+	fprintf(stderr, "sbtree.c Copyright (C) 2000 Christoph Reichenbach <jameson at linuxgames.com>\n"
 	        "This program is provided WITHOUT WARRANTY of any kind\n"
 	        "Please refer to the file COPYING that should have come with this program\n");
-	error("Static Binary Tree testing facility\n");
+	fprintf(stderr, "Static Binary Tree testing facility\n");
 
 	free(malloc(42)); // Make sure libefence's Copyright message is print here if we're using it
 
-	error("\nsbtree.c: Running %d tests.\n", tests_nr);
+	fprintf(stderr, "\nsbtree.c: Running %d tests.\n", tests_nr);
 
 	for (i = 0; i < tests_nr; i++) {
 		int entries = test_sizes[i];
 		sbtree_t *tree;
 		int *data;
 
-		error("Test #%d: %d entries\n", i + 1, entries);
+		fprintf(stderr, "Test #%d: %d entries\n", i + 1, entries);
 
-		error("\t%da: Linear values\n", i + 1);
+		fprintf(stderr, "\t%da: Linear values\n", i + 1);
 		data = generate_linear_forward(entries);
 		tree = sbtree_new(entries, data);
 		run_test(tree, entries, data, 0, entries);
 
-		error("\t%db: Reverse linear values\n", i + 1);
+		fprintf(stderr, "\t%db: Reverse linear values\n", i + 1);
 		data = generate_linear_backward(entries);
 		tree = sbtree_new(entries, data);
 		run_test(tree, entries, data, 0, entries);
 
-		error("\t%dc: Dense random values\n", i + 1);
+		fprintf(stderr, "\t%dc: Dense random values\n", i + 1);
 		data = generate_random(entries, 1 + (entries >> 2));
 		tree = sbtree_new(entries, data);
 		run_test(tree, entries, data, 1, 1 + (entries >> 2));
 
-		error("\t%dc: Sparse random values\n", i + 1);
+		fprintf(stderr, "\t%dc: Sparse random values\n", i + 1);
 		data = generate_random(entries, (entries << 2));
 		tree = sbtree_new(entries, data);
 		run_test(tree, entries, data, 1, entries << 2);
 
-		error("Test #%d completed.\n\n", i + 1);
+		fprintf(stderr, "Test #%d completed.\n\n", i + 1);
 	}
 
-	error("Test suite completed.\n");
+	fprintf(stderr, "Test suite completed.\n");
 	return 0;
 }
 

Modified: scummvm/trunk/engines/sci/gfx/sci_widgets.cpp
===================================================================
--- scummvm/trunk/engines/sci/gfx/sci_widgets.cpp	2009-02-21 13:19:44 UTC (rev 38695)
+++ scummvm/trunk/engines/sci/gfx/sci_widgets.cpp	2009-02-21 14:11:41 UTC (rev 38696)
@@ -76,14 +76,14 @@
 	gfx_color_t black = s->ega_colors[0];
 
 	if (!status_bar->visual) {
-		GFXERROR("Attempt to change title bar without visual");
+		GFXERROR("Attempt to change title bar without visual!\n");
 		return;
 	}
 
 	state = status_bar->visual->gfx_state;
 
 	if (!state) {
-		GFXERROR("Attempt to change title bar with stateless visual");
+		GFXERROR("Attempt to change title bar with stateless visual!\n");
 		return;
 	}
 
@@ -211,7 +211,7 @@
 
 		if (!(flags & WINDOW_FLAG_NO_DROP_SHADOW)) {
 			if (gfxop_set_color(state, &black, 0, 0, 0, 0x80, bgcolor.priority, -1)) {
-				GFXERROR("Could not get black/semitrans color entry");
+				GFXERROR("Could not get black/semitrans color entry!\n");
 				return NULL;
 			}
 
@@ -227,7 +227,7 @@
 		// Draw frame
 
 		if (gfxop_set_color(state, &black, 0, 0, 0, 0, bgcolor.priority, -1)) {
-			GFXERROR("Could not get black color entry");
+			GFXERROR("Could not get black color entry!\n");
 			return NULL;
 		}
 
@@ -416,7 +416,7 @@
 	gfxw_set_id(GFXW(list), ID.segment, ID.offset);
 
 	if (!port->visual) {
-		GFXERROR("Attempting to create icon control for virtual port");
+		GFXERROR("Attempting to create icon control for virtual port!\n");
 		return NULL;
 	}
 

Modified: scummvm/trunk/engines/sci/gfx/widgets.cpp
===================================================================
--- scummvm/trunk/engines/sci/gfx/widgets.cpp	2009-02-21 13:19:44 UTC (rev 38695)
+++ scummvm/trunk/engines/sci/gfx/widgets.cpp	2009-02-21 14:11:41 UTC (rev 38696)
@@ -31,7 +31,7 @@
 #undef GFXW_DEBUG_DIRTY // Enable to debug dirty rectangle propagation (writes to stderr)
 
 #ifdef GFXW_DEBUG_DIRTY
-#  define DDIRTY error("%s:%5d| ", __FILE__, __LINE__); fprintf
+#  define DDIRTY fprintf(stderr, "%s:%5d| ", __FILE__, __LINE__); fprintf
 #else
 #  define DDIRTY if (0) fprintf
 #endif
@@ -48,7 +48,7 @@
 
 static void _gfxw_debug_add_widget(gfxw_widget_t *widget) {
 	if (debug_widget_pos == GFXW_DEBUG_WIDGETS) {
-		GFXERROR("WIDGET DEBUG: Allocated the maximum number of %d widgets- Aborting", GFXW_DEBUG_WIDGETS);
+		GFXERROR("WIDGET DEBUG: Allocated the maximum number of %d widgets- Aborting!\n", GFXW_DEBUG_WIDGETS);
 		BREAKPOINT();
 	}
 	debug_widgets[debug_widget_pos++] = widget;
@@ -66,12 +66,12 @@
 	}
 
 	if (found > 1) {
-		GFXERROR("While removing widget: Found it %d times", found);
+		GFXERROR("While removing widget: Found it %d times!\n", found);
 		BREAKPOINT();
 	}
 
 	if (found == 0) {
-		GFXERROR("Attempted removal of unregistered widget");
+		GFXERROR("Attempted removal of unregistered widget!\n");
 		BREAKPOINT();
 	}
 }
@@ -190,7 +190,7 @@
 
 		if (text->text_handle) {
 			if (!state) {
-				GFXERROR("Attempt to free text without supplying mode to free it from");
+				GFXERROR("Attempt to free text without supplying mode to free it from!\n");
 				BREAKPOINT();
 			} else {
 				gfxop_free_text(state, text->text_handle);
@@ -208,7 +208,7 @@
   { \
 	  int retval = (_x); \
 	  if (retval == GFX_ERROR) { \
-		  GFXERROR("Error occured while drawing widget"); \
+		  GFXERROR("Error occured while drawing widget!\n"); \
 		  return 1; \
 	  } else if (retval == GFX_FATAL) { \
 		  GFXERROR("Fatal error occured while drawing widget!\nGraphics state invalid; aborting program..."); \
@@ -299,7 +299,7 @@
 	gfxw_widget_t **seekerp;
 
 	if (!container) {
-		GFXERROR("Attempt to remove widget from NULL container");
+		GFXERROR("Attempt to remove widget from NULL container!\n");
 		BREAKPOINT();
 	}
 
@@ -317,7 +317,7 @@
 		seekerp = &((*seekerp)->next);
 
 	if (!*seekerp) {
-		GFXERROR("Internal error: Attempt to remove widget from container it was not contained in");
+		GFXERROR("Internal error: Attempt to remove widget from container it was not contained in!\n");
 		sciprintf("Widget:");
 		widget->print(GFXW(widget), 1);
 		sciprintf("Container:");
@@ -614,7 +614,7 @@
 	Common::Point offset;
 
 	if (!state) {
-		GFXERROR("Attempt to create view widget with NULL state");
+		GFXERROR("Attempt to create view widget with NULL state!\n");
 		return NULL;
 	}
 
@@ -849,7 +849,7 @@
 	Common::Point offset;
 
 	if (!state) {
-		GFXERROR("Attempt to create view widget with NULL state");
+		GFXERROR("Attempt to create view widget with NULL state!\n");
 		return NULL;
 	}
 
@@ -1434,7 +1434,7 @@
 		return 0;
 
 	if (!GFXW_IS_LIST(widget)) {
-		GFXWARN("_gfxwop_list_equals(): Method called on non-list");
+		GFXWARN("_gfxwop_list_equals(): Method called on non-list!\n");
 		widget->print(widget, 0);
 		sciprintf("\n");
 		return 0;
@@ -1622,9 +1622,9 @@
 
 static int _gfxwop_visual_set_visual(gfxw_widget_t *self, gfxw_visual_t *visual) {
 	if (self != GFXW(visual)) {
-		GFXWARN("Attempt to set a visual's parent visual to something else");
+		GFXWARN("Attempt to set a visual's parent visual to something else!\n");
 	} else {
-		GFXWARN("Attempt to set a visual's parent visual");
+		GFXWARN("Attempt to set a visual's parent visual!\n");
 	}
 
 	return 1;
@@ -1709,7 +1709,7 @@
 		int ID = port->ID;
 
 		if (ID < 0 || ID >= visual->port_refs_nr) {
-			GFXWARN("Attempt to free port #%d; allowed: [0..%d]", ID, visual->port_refs_nr);
+			GFXWARN("Attempt to free port #%d; allowed: [0..%d]!\n", ID, visual->port_refs_nr);
 			return GFX_ERROR;
 		}
 
@@ -1783,7 +1783,7 @@
 		if (self->port_bg->superarea_of(self->port_bg, &foo)) {
 			gfxw_container_t *parent = self->parent;
 			while (parent) {
-				error("Dirtifying parent id %d\n", parent->ID);
+				fprintf(stderr, "Dirtifying parent id %d\n", parent->ID);
 				parent->flags |= GFXW_FLAG_DIRTY;
 				parent = parent->parent;
 			}

Modified: scummvm/trunk/engines/sci/include/heapmgr.h
===================================================================
--- scummvm/trunk/engines/sci/include/heapmgr.h	2009-02-21 13:19:44 UTC (rev 38695)
+++ scummvm/trunk/engines/sci/include/heapmgr.h	2009-02-21 14:11:41 UTC (rev 38696)
@@ -80,8 +80,8 @@
 	ENTRY##_entry_t *e = table->table + index;				\
 										\
 	if (index < 0 || index >= table->max_entry) {				\
-		error("heapmgr: Attempt to release"			\
-			" invalid table index %d", index);			\
+		fprintf(stderr, "heapmgr: Attempt to release"			\
+			" invalid table index %d!\n", index);			\
 		BREAKPOINT();							\
 	}									\
 	CLEANUP_FN(&(e->entry));						\

Modified: scummvm/trunk/engines/sci/include/kdebug.h
===================================================================
--- scummvm/trunk/engines/sci/include/kdebug.h	2009-02-21 13:19:44 UTC (rev 38695)
+++ scummvm/trunk/engines/sci/include/kdebug.h	2009-02-21 14:11:41 UTC (rev 38696)
@@ -41,6 +41,7 @@
 #define SCIkPARSER_NR 10
 #define SCIkAVOIDPATH_NR 17
 
+#define SCIkERROR      s, __FILE__, __LINE__, SCIkERROR_NR
 #define SCIkNODES      s, __FILE__, __LINE__, 1
 #define SCIkGRAPHICS   s, __FILE__, __LINE__, 2
 #define SCIkSTRINGS    s, __FILE__, __LINE__, 3
@@ -77,8 +78,18 @@
 #endif /* !SCI_KERNEL_DEBUG */
 
 
+#ifdef __GNUC__XXX
 
-/* Internal functions */
+#define SCIkwarn(arguments...) _SCIGNUkdebug(__PRETTY_FUNCTION__, ## arguments)
+
+#else /* !__GNUC__ */
+
+#define SCIkwarn _SCIkwarn
+
+#endif /* !__GNUC__ */
+
+ /* Internal functions */
+void _SCIkwarn(EngineState *s, const char *file, int line, int area, const char *format, ...);
 void _SCIkdebug(EngineState *s, const char *file, int line, int area, const char *format, ...);
 void _SCIGNUkdebug(const char *funcname, EngineState *s, const char *file, int line, int area, const char *format, ...);
 

Modified: scummvm/trunk/engines/sci/include/resource.h
===================================================================
--- scummvm/trunk/engines/sci/include/resource.h	2009-02-21 13:19:44 UTC (rev 38695)
+++ scummvm/trunk/engines/sci/include/resource.h	2009-02-21 14:11:41 UTC (rev 38696)
@@ -292,7 +292,7 @@
 #  endif /* !__i386__ && !__alpha__ */
 #endif
 #ifndef BREAKPOINT
-#  define BREAKPOINT() { error("Missed breakpoint in %s, line %d\n", __FILE__, __LINE__); *((int *) NULL) = 42; }
+#  define BREAKPOINT() { fprintf(stderr, "Missed breakpoint in %s, line %d\n", __FILE__, __LINE__); *((int *) NULL) = 42; }
 #endif  /* !BREAKPOINT() */
 
 } // End of namespace Sci

Modified: scummvm/trunk/engines/sci/sci.cpp
===================================================================
--- scummvm/trunk/engines/sci/sci.cpp	2009-02-21 13:19:44 UTC (rev 38695)
+++ scummvm/trunk/engines/sci/sci.cpp	2009-02-21 14:11:41 UTC (rev 38696)
@@ -122,7 +122,7 @@
 		}
 
 		if (!recovered) {
-			error("Script initialization failed. Aborting...\n");
+			fprintf(stderr, "Script initialization failed. Aborting...\n");
 			return 1;
 		}
 	}
@@ -246,7 +246,7 @@
 
 
 	if (game_init(gamestate)) { /* Initialize */
-		error("Game initialization failed: Aborting...\n");
+		fprintf(stderr, "Game initialization failed: Aborting...\n");
 		// TODO: Add an "init failed" error?
 		return Common::kUnknownError;
 	}
@@ -292,17 +292,17 @@
 	/**** Default config ends */
 
 	if (gfxop_init_default(&gfx_state, &gfx_options, resmgr)) {
-		error("Graphics initialization failed. Aborting...\n");
+		fprintf(stderr, "Graphics initialization failed. Aborting...\n");
 		return Common::kUnknownError;
 	}
 
 	if (game_init_graphics(gamestate)) { /* Init interpreter graphics */
-		error("Game initialization failed: Error in GFX subsystem. Aborting...\n");
+		fprintf(stderr, "Game initialization failed: Error in GFX subsystem. Aborting...\n");
 		return Common::kUnknownError;
 	}
 
 	if (game_init_sound(gamestate, 0)) {
-		error("Game initialization failed: Error in sound subsystem. Aborting...\n");
+		fprintf(stderr, "Game initialization failed: Error in sound subsystem. Aborting...\n");
 		return Common::kUnknownError;
 	}
 

Modified: scummvm/trunk/engines/sci/scicore/console.cpp
===================================================================
--- scummvm/trunk/engines/sci/scicore/console.cpp	2009-02-21 13:19:44 UTC (rev 38695)
+++ scummvm/trunk/engines/sci/scicore/console.cpp	2009-02-21 14:11:41 UTC (rev 38696)
@@ -46,12 +46,12 @@
 	char *buf = (char *)sci_malloc(bufsize);
 
 	if (NULL == fmt) {
-		error("console.c: sciprintf(): NULL passed for parameter fmt\n");
+		fprintf(stderr, "console.c: sciprintf(): NULL passed for parameter fmt\n");
 		return -1;
 	}
 
 	if (NULL == buf) {
-		error("console.c: sciprintf(): malloc failed for buf\n");
+		fprintf(stderr, "console.c: sciprintf(): malloc failed for buf\n");
 		return -1;
 	}
 
@@ -104,7 +104,7 @@
 		fclose(con_file);
 
 	if (NULL == filename) {
-		error("console.c: open_console_file(): NULL passed for parameter filename\r\n");
+		fprintf(stderr, "console.c: open_console_file(): NULL passed for parameter filename\r\n");
 	}
 #ifdef WIN32
 	con_file = fopen(filename, "wt");
@@ -113,7 +113,7 @@
 #endif
 
 	if (NULL == con_file)
-		error("console.c: open_console_file(): Could not open output file %s\n", filename);
+		fprintf(stderr, "console.c: open_console_file(): Could not open output file %s\n", filename);
 }
 
 void close_console_file() {

Modified: scummvm/trunk/engines/sci/scicore/decompress0.cpp
===================================================================
--- scummvm/trunk/engines/sci/scicore/decompress0.cpp	2009-02-21 13:19:44 UTC (rev 38695)
+++ scummvm/trunk/engines/sci/scicore/decompress0.cpp	2009-02-21 14:11:41 UTC (rev 38696)
@@ -27,7 +27,6 @@
 ** This is for SCI version 0 style compression.
 */
 
-#include "common/util.h"
 #include "sci/include/sci_memory.h"
 #include "sci/include/sciresource.h"
 
@@ -100,7 +99,7 @@
 				if (token > 0xff) {
 					if (token >= tokenctr) {
 #ifdef _SCI_DECOMPRESS_DEBUG
-						error("decrypt1: Bad token %x", token);
+						fprintf(stderr, "decrypt1: Bad token %x!\n", token);
 #endif
 						// Well this is really bad
 						// May be it should throw something like SCI_ERROR_DECOMPRESSION_INSANE
@@ -109,7 +108,7 @@
 						if (destctr + tokenlastlength > length) {
 #ifdef _SCI_DECOMPRESS_DEBUG
 							// For me this seems a normal situation, It's necessary to handle it
-							printf("decrypt1: Trying to write beyond the end of array(len=%d, destctr=%d, tok_len=%d)",
+							printf("decrypt1: Trying to write beyond the end of array(len=%d, destctr=%d, tok_len=%d)!\n",
 							       length, destctr, tokenlastlength);
 #endif
 							i = 0;
@@ -126,7 +125,7 @@
 					tokenlastlength = 1;
 					if (destctr >= length) {
 #ifdef _SCI_DECOMPRESS_DEBUG
-						printf("decrypt1: Try to write single byte beyond end of array");
+						printf("decrypt1: Try to write single byte beyond end of array!\n");
 #endif
 					} else
 						dest[destctr++] = (byte)token;
@@ -289,9 +288,13 @@
 
 
 #ifdef _SCI_DECOMPRESS_DEBUG
-	error("Resource %s.%03hi encrypted with method %hi at %.2f%% ratio\n", sci_resource_types[result->type],
-			result->number, compressionMethod, (result->size == 0) ? -1.0 : (100.0 * compressedLength / result->size));
-	error("  compressedLength = 0x%hx, actualLength=0x%hx\n", compressedLength, result->size);
+	fprintf(stderr, "Resource %s.%03hi encrypted with method %hi at %.2f%%"
+	        " ratio\n",
+	        sci_resource_types[result->type], result->number, compressionMethod,
+	        (result->size == 0) ? -1.0 :
+	        (100.0 * compressedLength / result->size));
+	fprintf(stderr, "  compressedLength = 0x%hx, actualLength=0x%hx\n",
+	        compressedLength, result->size);
 #endif
 
 	switch (compressionMethod) {
@@ -330,8 +333,9 @@
 		break;
 
 	default:
-		error("Resource %s.%03hi: Compression method %hi not supported", sci_resource_types[result->type],
-				result->number, compressionMethod);
+		fprintf(stderr, "Resource %s.%03hi: Compression method %hi not "
+		        "supported!\n", sci_resource_types[result->type], result->number,
+		        compressionMethod);
 		free(result->data);
 		result->data = 0; // So that we know that it didn't work
 		result->status = SCI_STATUS_NOMALLOC;

Modified: scummvm/trunk/engines/sci/scicore/decompress01.cpp
===================================================================
--- scummvm/trunk/engines/sci/scicore/decompress01.cpp	2009-02-21 13:19:44 UTC (rev 38695)
+++ scummvm/trunk/engines/sci/scicore/decompress01.cpp	2009-02-21 14:11:41 UTC (rev 38696)
@@ -25,7 +25,6 @@
 
 // Reads data from a resource file and stores the result in memory
 
-#include "common/util.h"
 #include "sci/include/sci_memory.h"
 #include "sci/include/sciresource.h"
 
@@ -425,7 +424,7 @@
 	for (l = 0;l < loopheaders;l++) {
 		if (lh_mask & lb) { // The loop is _not_ present
 			if (lh_last == -1) {
-				error("Error: While reordering view: Loop not present, but can't re-use last loop");
+				fprintf(stderr, "Error: While reordering view: Loop not present, but can't re-use last loop!\n");
 				lh_last = 0;
 			}
 			putInt16(lh_ptr, lh_last);
@@ -459,7 +458,7 @@
 	}
 
 	if (celindex < cel_total) {
-		error("View decompression generated too few (%d / %d) headers", celindex, cel_total);
+		fprintf(stderr, "View decompression generated too few (%d / %d) headers!\n", celindex, cel_total);
 		return NULL;
 	}
 
@@ -542,9 +541,13 @@
 
 
 #ifdef _SCI_DECOMPRESS_DEBUG
-	error("Resource %s.%03hi encrypted with method SCI01/%hi at %.2f%% ratio\n", sci_resource_types[result->type],
-			result->number, compressionMethod, (result->size == 0) ? -1.0 : (100.0 * compressedLength / result->size));
-	error("  compressedLength = 0x%hx, actualLength=0x%hx\n", compressedLength, result->size);
+	fprintf(stderr, "Resource %s.%03hi encrypted with method SCI01/%hi at %.2f%%"
+	        " ratio\n",
+	        sci_resource_types[result->type], result->number, compressionMethod,
+	        (result->size == 0) ? -1.0 :
+	        (100.0 * compressedLength / result->size));
+	fprintf(stderr, "  compressedLength = 0x%hx, actualLength=0x%hx\n",
+	        compressedLength, result->size);
 #endif
 
 	switch (compressionMethod) {
@@ -611,8 +614,9 @@
 		break;
 
 	default:
-		error("Resource %s.%03hi: Compression method SCI1/%hi not supported", sci_resource_types[result->type],
-				result->number, compressionMethod);
+		fprintf(stderr, "Resource %s.%03hi: Compression method SCI1/%hi not "
+		        "supported!\n", sci_resource_types[result->type], result->number,
+		        compressionMethod);
 		free(result->data);
 		result->data = 0; // So that we know that it didn't work
 		result->status = SCI_STATUS_NOMALLOC;

Modified: scummvm/trunk/engines/sci/scicore/decompress1.cpp
===================================================================
--- scummvm/trunk/engines/sci/scicore/decompress1.cpp	2009-02-21 13:19:44 UTC (rev 38695)
+++ scummvm/trunk/engines/sci/scicore/decompress1.cpp	2009-02-21 14:11:41 UTC (rev 38696)
@@ -71,7 +71,8 @@
 	int i;
 
 	if (inp->bytepos + morebytes >= inp->length) {
-		error("read out-of-bounds with bytepos %d + morebytes %d >= length %d\n", inp->bytepos, morebytes, inp->length);
+		fprintf(stderr, "read out-of-bounds with bytepos %d + morebytes %d >= length %d\n",
+		        inp->bytepos, morebytes, inp->length);
 		return -SCI_ERROR_DECOMPRESSION_OVERFLOW;
 	}
 
@@ -95,7 +96,8 @@
 	int i;
 
 	if (inp->bytepos + morebytes >= inp->length) {
-		error("read out-of-bounds with bytepos %d + morebytes %d >= length %d\n", inp->bytepos, morebytes, inp->length);
+		fprintf(stderr, "read out-of-bounds with bytepos %d + morebytes %d >= length %d\n",
+		        inp->bytepos, morebytes, inp->length);
 		return -SCI_ERROR_DECOMPRESSION_OVERFLOW;
 	}
 
@@ -109,7 +111,7 @@
 	inp->bytepos += morebytes;
 
 	if (DEBUG_DCL_INFLATE)
-		error("(%d:%04x)", bits, result);
+		fprintf(stderr, "(%d:%04x)", bits, result);
 
 	return result;
 }
@@ -121,14 +123,14 @@
 	while (!(tree[pos] & HUFFMAN_LEAF)) {
 		CALLC(bit = getbits(inp, 1));
 		if (DEBUG_DCL_INFLATE)
-			error("[%d]:%d->", pos, bit);
+			fprintf(stderr, "[%d]:%d->", pos, bit);
 		if (bit)
 			pos = tree[pos] & ~(~0 << BRANCH_SHIFT);
 		else
 			pos = tree[pos] >> BRANCH_SHIFT;
 	}
 	if (DEBUG_DCL_INFLATE)
-		error("=%02x\n", tree[pos] & 0xffff);
+		fprintf(stderr, "=%02x\n", tree[pos] & 0xffff);
 	return tree[pos] & 0xffff;
 }
 
@@ -147,7 +149,7 @@
 		warning("DCL-INFLATE: Warning: Decompressing ASCII mode (untested)");
 		//DEBUG_DCL_INFLATE = 1;
 	} else if (mode) {
-		error("DCL-INFLATE: Error: Encountered mode %02x, expected 00 or 01\n", mode);
+		fprintf(stderr, "DCL-INFLATE: Error: Encountered mode %02x, expected 00 or 01\n", mode);
 		return 1;
 	}
 
@@ -155,18 +157,18 @@
 		int i;
 
 		for (i = 0; i < reader->length; i++) {
-			error("%02x ", reader->data[i]);
+			fprintf(stderr, "%02x ", reader->data[i]);
 			if (!((i + 1) & 0x1f))
-				error("\n");
+				fprintf(stderr, "\n");
 		}
 
 
-		error("\n---\n");
+		fprintf(stderr, "\n---\n");
 	}
 
 
 	if (length_param < 3 || length_param > 6)
-		error("Warning: Unexpected length_param value %d (expected in [3,6])\n", length_param);
+		fprintf(stderr, "Warning: Unexpected length_param value %d (expected in [3,6])\n", length_param);
 
 	while (write_pos < length) {
 		CALLC(value = getbits(reader, 1));
@@ -185,7 +187,7 @@
 			}
 
 			if (DEBUG_DCL_INFLATE)
-				error(" | ");
+				fprintf(stderr, " | ");
 
 			CALLC(value = huffman_lookup(reader, distance_tree));
 
@@ -203,15 +205,15 @@
 			++val_distance;
 
 			if (DEBUG_DCL_INFLATE)
-				error("\nCOPY(%d from %d)\n", val_length, val_distance);
+				fprintf(stderr, "\nCOPY(%d from %d)\n", val_length, val_distance);
 
 			if (val_length + write_pos > length) {
-				error("DCL-INFLATE Error: Write out of bounds while copying %d bytes\n", val_length);
+				fprintf(stderr, "DCL-INFLATE Error: Write out of bounds while copying %d bytes\n", val_length);
 				return -SCI_ERROR_DECOMPRESSION_OVERFLOW;
 			}
 
 			if (write_pos < val_distance) {
-				error("DCL-INFLATE Error: Attempt to copy from before beginning of input stream\n");
+				fprintf(stderr, "DCL-INFLATE Error: Attempt to copy from before beginning of input stream\n");
 				return -SCI_ERROR_DECOMPRESSION_INSANE;
 			}
 
@@ -223,8 +225,8 @@
 				if (DEBUG_DCL_INFLATE) {
 					int i;
 					for (i = 0; i < copy_length; i++)
-						error("\33[32;31m%02x\33[37;37m ", dest[write_pos + i]);
-					error("\n");
+						fprintf(stderr, "\33[32;31m%02x\33[37;37m ", dest[write_pos + i]);
+					fprintf(stderr, "\n");
 				}
 
 				val_length -= copy_length;
@@ -242,7 +244,7 @@
 			dest[write_pos++] = value;
 
 			if (DEBUG_DCL_INFLATE)
-				error("\33[32;31m%02x \33[37;37m", value);
+				fprintf(stderr, "\33[32;31m%02x \33[37;37m", value);
 		}
 	}
 
@@ -331,10 +333,15 @@
 
 
 #ifdef _SCI_DECOMPRESS_DEBUG
-	error("Resource %i.%s encrypted with method SCI1%c/%hi at %.2f%% ratio\n", result->number,
-			sci_resource_type_suffixes[result->type], early ? 'e' : 'l', compressionMethod,
-			(result->size == 0) ? -1.0 : (100.0 * compressedLength / result->size));
-	error("  compressedLength = 0x%hx, actualLength=0x%hx\n", compressedLength, result->size);
+	fprintf(stderr, "Resource %i.%s encrypted with method SCI1%c/%hi at %.2f%%"
+	        " ratio\n",
+	        result->number, sci_resource_type_suffixes[result->type],
+	        early ? 'e' : 'l',
+	        compressionMethod,
+	        (result->size == 0) ? -1.0 :
+	        (100.0 * compressedLength / result->size));
+	fprintf(stderr, "  compressedLength = 0x%hx, actualLength=0x%hx\n",
+	        compressedLength, result->size);
 #endif
 
 	switch (compressionMethod) {
@@ -400,8 +407,9 @@
 		break;
 
 	default:
-		error("Resource %s.%03hi: Compression method SCI1/%hi not supported", sci_resource_types[result->type],
-				result->number, compressionMethod);
+		fprintf(stderr, "Resource %s.%03hi: Compression method SCI1/%hi not "
+		        "supported!\n", sci_resource_types[result->type], result->number,
+		        compressionMethod);
 		free(result->data);
 		result->data = 0; // So that we know that it didn't work
 		result->status = SCI_STATUS_NOMALLOC;

Modified: scummvm/trunk/engines/sci/scicore/decompress11.cpp
===================================================================
--- scummvm/trunk/engines/sci/scicore/decompress11.cpp	2009-02-21 13:19:44 UTC (rev 38695)
+++ scummvm/trunk/engines/sci/scicore/decompress11.cpp	2009-02-21 14:11:41 UTC (rev 38696)
@@ -25,7 +25,6 @@
 
 // Reads data from a resource file and stores the result in memory
 
-#include "common/util.h"
 #include "sci/include/sci_memory.h"
 #include "sci/include/sciresource.h"
 
@@ -99,10 +98,14 @@
 	}
 
 #ifdef _SCI_DECOMPRESS_DEBUG
-	error("Resource %i.%s encrypted with method SCI1.1/%hi at %.2f%% ratio\n", result->number,
-			sci_resource_type_suffixes[result->type], compressionMethod, (result->size == 0) ? -1.0 :
-			(100.0 * compressedLength / result->size));
-	error("  compressedLength = 0x%hx, actualLength=0x%hx\n", compressedLength, result->size);
+	fprintf(stderr, "Resource %i.%s encrypted with method SCI1.1/%hi at %.2f%%"
+	        " ratio\n",
+	        result->number, sci_resource_type_suffixes[result->type],
+	        compressionMethod,
+	        (result->size == 0) ? -1.0 :
+	        (100.0 * compressedLength / result->size));
+	fprintf(stderr, "  compressedLength = 0x%hx, actualLength=0x%hx\n",
+	        compressedLength, result->size);
 #endif
 
 	DDEBUG("/%d[%d]", compressionMethod, result->size);
@@ -135,7 +138,7 @@
 
 	case 3:
 	case 4: // NYI
-		error("Resource %d.%s: Warning: compression type #%d not yet implemented\n",
+		fprintf(stderr, "Resource %d.%s: Warning: compression type #%d not yet implemented\n",
 		        result->number, sci_resource_type_suffixes[result->type], compressionMethod);
 		free(result->data);
 		result->data = NULL;
@@ -143,8 +146,9 @@
 		break;
 
 	default:
-		error("Resource %d.%s: Compression method SCI1/%hi not supported", result->number,
-				sci_resource_type_suffixes[result->type], compressionMethod);
+		fprintf(stderr, "Resource %d.%s: Compression method SCI1/%hi not "
+		        "supported!\n", result->number, sci_resource_type_suffixes[result->type],
+		        compressionMethod);
 		free(result->data);
 		result->data = NULL; // So that we know that it didn't work
 		result->status = SCI_STATUS_NOMALLOC;

Modified: scummvm/trunk/engines/sci/scicore/resource.cpp
===================================================================
--- scummvm/trunk/engines/sci/scicore/resource.cpp	2009-02-21 13:19:44 UTC (rev 38695)
+++ scummvm/trunk/engines/sci/scicore/resource.cpp	2009-02-21 14:11:41 UTC (rev 38696)
@@ -481,7 +481,7 @@
 			free(_resources);
 			_resources = NULL;
 		}
-		sciprintf("Resmgr: Could not retrieve a resource list");
+		sciprintf("Resmgr: Could not retrieve a resource list!\n");
 		_scir_free_resource_sources(mgr->_sources);
 		error("FIXME: Move this code to an init() method so that we can perform error handling");
 //		return NULL;
@@ -623,8 +623,9 @@
 
 	mgr->memory_lru += res->size;
 #if (SCI_VERBOSE_RESMGR > 1)
-	error("Adding %s.%03d (%d bytes) to lru control: %d bytes total\n", sci_resource_types[res->type],
-			res->number, res->size, mgr->memory_lru);
+	fprintf(stderr, "Adding %s.%03d (%d bytes) to lru control: %d bytes total\n",
+	        sci_resource_types[res->type], res->number, res->size,
+	        mgr->memory_lru);
 
 #endif
 
@@ -637,22 +638,25 @@
 	resource_t *res = mgr->lru_first;
 
 	while (res) {
-		error("\t%s.%03d: %d bytes\n", sci_resource_types[res->type], res->number, res->size);
+		fprintf(stderr, "\t%s.%03d: %d bytes\n",
+		        sci_resource_types[res->type], res->number,
+		        res->size);
 		mem += res->size;
 		++entries;
 		res = res->next;
 	}
 
-	error("Total: %d entries, %d bytes (mgr says %d)\n", entries, mem, mgr->memory_lru);
+	fprintf(stderr, "Total: %d entries, %d bytes (mgr says %d)\n",
+	        entries, mem, mgr->memory_lru);
 }
 
 static void _scir_free_old_resources(ResourceManager *mgr, int last_invulnerable) {
 	while (mgr->_maxMemory < mgr->memory_lru && (!last_invulnerable || mgr->lru_first != mgr->lru_last)) {
 		resource_t *goner = mgr->lru_last;
 		if (!goner) {
-			error("Internal error: mgr->lru_last is NULL");
-			error("LRU-mem= %d\n", mgr->memory_lru);
-			error("lru_first = %p\n", (void *)mgr->lru_first);
+			fprintf(stderr, "Internal error: mgr->lru_last is NULL!\n");
+			fprintf(stderr, "LRU-mem= %d\n", mgr->memory_lru);
+			fprintf(stderr, "lru_first = %p\n", (void *)mgr->lru_first);
 			_scir_print_lru_list(mgr);
 		}
 
@@ -714,9 +718,9 @@
 void scir_unlock_resource(ResourceManager *mgr, resource_t *res, int resnum, int restype) {
 	if (!res) {
 		if (restype >= ARRAYSIZE(sci_resource_types))
-			sciprintf("Resmgr: Warning: Attempt to unlock non-existant resource %03d.%03d", restype, resnum);
+			sciprintf("Resmgr: Warning: Attempt to unlock non-existant resource %03d.%03d!\n", restype, resnum);
 		else
-			sciprintf("Resmgr: Warning: Attempt to unlock non-existant resource %s.%03d", sci_resource_types[restype], resnum);
+			sciprintf("Resmgr: Warning: Attempt to unlock non-existant resource %s.%03d!\n", sci_resource_types[restype], resnum);
 		return;
 	}
 

Modified: scummvm/trunk/engines/sci/scicore/resource_map.cpp
===================================================================
--- scummvm/trunk/engines/sci/scicore/resource_map.cpp	2009-02-21 13:19:44 UTC (rev 38695)
+++ scummvm/trunk/engines/sci/scicore/resource_map.cpp	2009-02-21 14:11:41 UTC (rev 38696)
@@ -147,8 +147,10 @@
 	}
 
 #if 0
-	error("Read [%04x] %6d.%s\tresource.%03d, %08x\n", res->id, res->number,
-	        sci_resource_type_suffixes[res->type], res->file, res->file_offset);
+	fprintf(stderr, "Read [%04x] %6d.%s\tresource.%03d, %08x\n",
+	        res->id, res->number,
+	        sci_resource_type_suffixes[res->type],
+	        res->file, res->file_offset);
 #endif
 
 	if (res->source == NULL)
@@ -307,7 +309,7 @@
 	file.close();
 
 	if (!resource_index) {
-		sciprintf("resource.map was empty");
+		sciprintf("resource.map was empty!\n");
 		_scir_free_resources(resources, resource_nr);
 		return SCI_ERROR_RESMAP_NOT_FOUND;
 	}
@@ -339,7 +341,7 @@
 	return 0;
 }
 
-#define TEST error("OK in line %d\n", __LINE__);
+#define TEST fprintf(stderr, "OK in line %d\n", __LINE__);
 
 static int sci10_or_11(int *types) {
 	int this_restype = 0;
@@ -464,7 +466,9 @@
 			}
 
 #if 0
-		error("Read [%04x] %6d.%s\tresource.%03d, %08x ==> %d\n", res->id, res->number, sci_resource_type_suffixes[res->type],
+		fprintf(stderr, "Read [%04x] %6d.%s\tresource.%03d, %08x ==> %d\n",
+		        res->id, res->number,
+		        sci_resource_type_suffixes[res->type],

@@ Diff output truncated at 100000 characters. @@

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