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

thebluegr at users.sourceforge.net thebluegr at users.sourceforge.net
Mon Jun 8 13:42:13 CEST 2009


Revision: 41367
          http://scummvm.svn.sourceforge.net/scummvm/?rev=41367&view=rev
Author:   thebluegr
Date:     2009-06-08 11:42:13 +0000 (Mon, 08 Jun 2009)

Log Message:
-----------
Replaced GFXWARN with warning and GFXDEBUG with debugC

Modified Paths:
--------------
    scummvm/trunk/engines/sci/engine/kgraphics.cpp
    scummvm/trunk/engines/sci/gfx/font.cpp
    scummvm/trunk/engines/sci/gfx/gfx_resmgr.cpp
    scummvm/trunk/engines/sci/gfx/gfx_system.h
    scummvm/trunk/engines/sci/gfx/gfx_tools.cpp
    scummvm/trunk/engines/sci/gfx/gfx_widgets.cpp
    scummvm/trunk/engines/sci/gfx/operations.cpp
    scummvm/trunk/engines/sci/gfx/res_pic.cpp
    scummvm/trunk/engines/sci/gfx/res_view.cpp

Modified: scummvm/trunk/engines/sci/engine/kgraphics.cpp
===================================================================
--- scummvm/trunk/engines/sci/engine/kgraphics.cpp	2009-06-08 09:10:12 UTC (rev 41366)
+++ scummvm/trunk/engines/sci/engine/kgraphics.cpp	2009-06-08 11:42:13 UTC (rev 41367)
@@ -876,7 +876,7 @@
 	res = s->gfx_state->gfxResMan->getView(view, &loop, &cel, 0);
 
 	if (!res) {
-		GFXWARN("Attempt to get cel parameters for invalid view %d\n", view);
+		warning("[GFX] Attempt to get cel parameters for invalid view %d", view);
 		return make_reg(0, -1);
 	}
 

Modified: scummvm/trunk/engines/sci/gfx/font.cpp
===================================================================
--- scummvm/trunk/engines/sci/gfx/font.cpp	2009-06-08 09:10:12 UTC (rev 41366)
+++ scummvm/trunk/engines/sci/gfx/font.cpp	2009-06-08 11:42:13 UTC (rev 41367)
@@ -104,7 +104,7 @@
 				}
 
 				if (last_breakpoint == 0) {
-					GFXWARN("Warning: maxsize %d too small for '%s'\n", max_width, text);
+					warning("[GFX] maxsize %d too small for '%s'", max_width, text);
 				}
 
 				if (last_breakpoint > maxwidth)
@@ -197,7 +197,7 @@
 
 	int colors_nr = !!fg0 + !!fg1 + !!bg;
 	if (colors_nr == 0) {
-		GFXWARN("Pixmap would have zero colors, resetting!\n");
+		warning("[GFX] Pixmap would have zero colors, resetting");
 		colors_nr = 3;
 		hack = 1;
 		fg0 = fg1 = bg = &dummy;

Modified: scummvm/trunk/engines/sci/gfx/gfx_resmgr.cpp
===================================================================
--- scummvm/trunk/engines/sci/gfx/gfx_resmgr.cpp	2009-06-08 09:10:12 UTC (rev 41366)
+++ scummvm/trunk/engines/sci/gfx/gfx_resmgr.cpp	2009-06-08 11:42:13 UTC (rev 41367)
@@ -59,10 +59,10 @@
 	if (_version < SCI_VERSION_01_VGA || !_isVGA) {
 		_staticPalette = gfx_sci0_pic_colors->getref();
 	} else if (_version == SCI_VERSION_1_1) {
-		GFXDEBUG("Palettes are not yet supported in this SCI version\n");
+		debugC(2, kDebugLevelGraphics, "Palettes are not yet supported in this SCI version\n");
 #ifdef ENABLE_SCI32
 	} else if (_version == SCI_VERSION_32) {
-		GFXDEBUG("Palettes are not yet supported in this SCI version\n");
+		debugC(2, kDebugLevelGraphics, "Palettes are not yet supported in this SCI version\n");
 #endif
 	} else {
 		Resource *res = resManager->findResource(ResourceId(kResourceTypePalette, 999), 0);
@@ -201,7 +201,7 @@
 		break;
 
 	default:
-		GFXWARN("Attempt to free invalid resource type %d\n", type);
+		warning("[GFX] Attempt to free invalid resource type %d", type);
 	}
 
 	free(resource);
@@ -473,7 +473,7 @@
 		res = resMap.contains(old_nr) ? resMap[old_nr] : NULL;
 
 		if (!res) {
-			GFXWARN("Attempt to add pic %d to non-existing pic %d\n", new_nr, old_nr);
+			warning("[GFX] Attempt to add pic %d to non-existing pic %d", new_nr, old_nr);
 			return NULL;
 		}
 	}
@@ -578,26 +578,26 @@
 	*loop = CLIP<int>(*loop, 0, view->loops_nr - 1);
 
 	if (*loop < 0) {
-		GFXWARN("View %d has no loops\n", nr);
+		warning("[GFX] View %d has no loops", nr);
 		return NULL;
 	}
 
 	loop_data = view->loops + (*loop);
 	if (loop_data == NULL) {
-		GFXWARN("Trying to load invalid loop %d of view %d\n", *loop, nr);
+		warning("[GFX] Trying to load invalid loop %d of view %d", *loop, nr);
 		return NULL;
 	}
 
 	*cel = CLIP<int>(*cel, 0, loop_data->cels_nr - 1);
 
 	if (*cel < 0) {
-		GFXWARN("View %d loop %d has no cels\n", nr, *loop);
+		warning("[GFX] View %d loop %d has no cels", nr, *loop);
 		return NULL;
 	}
 
 	cel_data = loop_data->cels[*cel];
 	if (loop_data == NULL) {
-		GFXWARN("Trying to load invalid view/loop/cel %d/%d/%d\n", nr, *loop, *cel);
+		warning("[GFX] Trying to load invalid view/loop/cel %d/%d/%d", nr, *loop, *cel);
 		return NULL;
 	}
 
@@ -663,7 +663,7 @@
 			return NULL;
 
 		if (_version >= SCI_VERSION_1_1) {
-			GFXWARN("Attempt to retrieve cursor in SCI1.1 or later\n");
+			warning("[GFX] Attempt to retrieve cursor in SCI1.1 or later");
 			return NULL;
 		}
 

Modified: scummvm/trunk/engines/sci/gfx/gfx_system.h
===================================================================
--- scummvm/trunk/engines/sci/gfx/gfx_system.h	2009-06-08 09:10:12 UTC (rev 41366)
+++ scummvm/trunk/engines/sci/gfx/gfx_system.h	2009-06-08 11:42:13 UTC (rev 41367)
@@ -37,12 +37,6 @@
 
 /* General output macros */
 #  define GFXERROR sciprintf("GFX Error: %s, L%d:", __FILE__, __LINE__); error
-#  define GFXWARN sciprintf("GFX Warning: %s, L%d:", __FILE__, __LINE__); warning
-#  ifdef GFX_DEBUG
-#    define GFXDEBUG sciprintf("GFX-debug: %s, L%d:", __FILE__, __LINE__); sciprintf
-#  else /* !GFX_DEBUG */
-#    define GFXDEBUG if (0) printf
-#  endif /* !GFX_DEBUG */
 
 /***********************/
 /*** Data structures ***/

Modified: scummvm/trunk/engines/sci/gfx/gfx_tools.cpp
===================================================================
--- scummvm/trunk/engines/sci/gfx/gfx_tools.cpp	2009-06-08 09:10:12 UTC (rev 41366)
+++ scummvm/trunk/engines/sci/gfx/gfx_tools.cpp	2009-06-08 11:42:13 UTC (rev 41367)
@@ -162,7 +162,7 @@
 	int size;
 
 	if (pixmap->index_data) {
-		GFXWARN("Attempt to allocate pixmap index data twice!\n");
+		warning("[GFX] Attempt to allocate pixmap index data twice");
 		return pixmap;
 	}
 
@@ -179,7 +179,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!\n");
+		warning("[GFX] Attempt to free pixmap index data twice");
 		return pixmap;
 	}
 
@@ -192,7 +192,7 @@
 	int size;
 
 	if (pixmap->data) {
-		GFXWARN("Attempt to allocate pixmap data twice!\n");
+		warning("[GFX] Attempt to allocate pixmap data twice");
 		return pixmap;
 	}
 
@@ -214,7 +214,7 @@
 
 gfx_pixmap_t *gfx_pixmap_free_data(gfx_pixmap_t *pixmap) {
 	if (!pixmap->data) {
-		GFXWARN("Attempt to free pixmap data twice!\n");
+		warning("[GFX] Attempt to free pixmap data twice");
 		return pixmap;
 	}
 

Modified: scummvm/trunk/engines/sci/gfx/gfx_widgets.cpp
===================================================================
--- scummvm/trunk/engines/sci/gfx/gfx_widgets.cpp	2009-06-08 09:10:12 UTC (rev 41366)
+++ scummvm/trunk/engines/sci/gfx/gfx_widgets.cpp	2009-06-08 11:42:13 UTC (rev 41367)
@@ -1270,7 +1270,7 @@
 		return 0;
 
 	if (!GFXW_IS_LIST(widget)) {
-		GFXWARN("_gfxwop_list_equals(): Method called on non-list!\n");
+		warning("[GFX] _gfxwop_list_equals(): Method called on non-list");
 		widget->print(0);
 		sciprintf("\n");
 		return 0;
@@ -1508,7 +1508,7 @@
 		}
 
 		if (_visual->_portRefs[_ID] != this) {
-			GFXWARN("While freeing port %d: Port is at %p, but port list indicates %p", _ID, (void *)this, (void *)_visual->_portRefs[_ID]);
+			warning("[GFX] While freeing port %d: Port is at %p, but port list indicates %p", _ID, (void *)this, (void *)_visual->_portRefs[_ID]);
 		} else
 			_visual->_portRefs[_ID] = NULL;
 
@@ -1542,7 +1542,7 @@
 
 	if (_decorations)
 		if (_decorations->setVisual(visual)) {
-			GFXWARN("Setting the visual for decorations failed for port ");
+			warning("[GFX] Setting the visual for decorations failed for port ");
 			this->print(1);
 			return 1;
 		}
@@ -1631,7 +1631,7 @@
 	VERIFY_WIDGET(port);
 
 	if (!visual->_contents) {
-		GFXWARN("Attempt to remove port from empty visual\n");
+		warning("[GFX] Attempt to remove port from empty visual");
 		return NULL;
 	}
 

Modified: scummvm/trunk/engines/sci/gfx/operations.cpp
===================================================================
--- scummvm/trunk/engines/sci/gfx/operations.cpp	2009-06-08 09:10:12 UTC (rev 41366)
+++ scummvm/trunk/engines/sci/gfx/operations.cpp	2009-06-08 11:42:13 UTC (rev 41367)
@@ -281,13 +281,13 @@
 		return NULL;
 
 	if (*loop >= view->loops_nr || *loop < 0) {
-		GFXWARN("Attempt to get cel from loop %d/%d inside view %d\n", *loop, view->loops_nr, nr);
+		warning("[GFX] Attempt to get cel from loop %d/%d inside view %d", *loop, view->loops_nr, nr);
 		return NULL;
 	}
 	indexed_loop = view->loops + *loop;
 
 	if (*cel >= indexed_loop->cels_nr || *cel < 0) {
-		GFXWARN("Attempt to get cel %d/%d from view %d/%d\n", *cel, indexed_loop->cels_nr, nr, *loop);
+		warning("[GFX] Attempt to get cel %d/%d from view %d/%d", *cel, indexed_loop->cels_nr, nr, *loop);
 		return NULL;
 	}
 
@@ -806,7 +806,7 @@
 
 	if (line_style == GFX_LINE_STYLE_STIPPLED) {
 		if (start.x != end.x && start.y != end.y) {
-			GFXWARN("Attempt to draw stippled line which is neither an hbar nor a vbar: (%d,%d) -- (%d,%d)\n", start.x, start.y, end.x, end.y);
+			warning("[GFX] Attempt to draw stippled line which is neither an hbar nor a vbar: (%d,%d) -- (%d,%d)", start.x, start.y, end.x, end.y);
 			return GFX_ERROR;
 		}
 		return simulate_stippled_line_draw(state->driver, skipone, start, end, color, line_mode);
@@ -928,7 +928,7 @@
 		return GFX_OK;
 
 	if (box.width <= 1 || box.height <= 1) {
-		GFXDEBUG("Attempt to draw box with size %dx%d\n", box.width, box.height);
+		debugC(2, kDebugLevelGraphics, "Attempt to draw box with size %dx%d", box.width, box.height);
 		return GFX_OK;
 	}
 
@@ -976,7 +976,7 @@
 		return drv->drawFilledRect(new_box, color1, color1, GFX_SHADE_FLAT);
 	} else {
 		if (PALETTE_MODE) {
-			GFXWARN("Attempting to draw shaded box in palette mode!\n");
+			warning("[GFX] Attempting to draw shaded box in palette mode");
 			return GFX_ERROR;
 		}
 
@@ -1181,7 +1181,7 @@
 	gfx_pixmap_t *new_pointer = state->gfxResMan->getCursor(nr);
 
 	if (!new_pointer) {
-		GFXWARN("Attempt to set invalid pointer #%d\n", nr);
+		warning("[GFX] Attempt to set invalid pointer #%d\n", nr);
 		return GFX_ERROR;
 	}
 
@@ -1198,12 +1198,12 @@
 	gfx_pixmap_t *new_pointer = _gfxr_get_cel(state, nr, &real_loop, &real_cel, 0);
 
 	if (!new_pointer) {
-		GFXWARN("Attempt to set invalid pointer #%d\n", nr);
+		warning("[GFX] Attempt to set invalid pointer #%d", nr);
 		return GFX_ERROR;
 	}
 
 	if (real_loop != loop || real_cel != cel) {
-		GFXDEBUG("Changed loop/cel from %d/%d to %d/%d in view %d\n", loop, cel, real_loop, real_cel, nr);
+		debugC(2, kDebugLevelGraphics, "Changed loop/cel from %d/%d to %d/%d in view %d\n", loop, cel, real_loop, real_cel, nr);
 	}
 
 	// Eco Quest 1 uses a 1x1 transparent cursor to hide the cursor from the user. Some scalers don't seem to support this.
@@ -1225,7 +1225,7 @@
 	state->pointer_pos = pos;
 
 	if (pos.x > 320 || pos.y > 200) {
-		GFXWARN("Attempt to place pointer at invalid coordinates (%d, %d)\n", pos.x, pos.y);
+		warning("[GFX] Attempt to place pointer at invalid coordinates (%d, %d)", pos.x, pos.y);
 		return 0; // Not fatal
 	}
 
@@ -1618,7 +1618,7 @@
 	view = state->gfxResMan->getView(nr, &loop, &cel, 0);
 
 	if (!view) {
-		GFXWARN("Attempt to retrieve number of loops from invalid view %d\n", nr);
+		warning("[GFX] Attempt to retrieve number of loops from invalid view %d", nr);
 		return 0;
 	}
 
@@ -1634,10 +1634,10 @@
 	view = state->gfxResMan->getView(nr, &real_loop, &cel, 0);
 
 	if (!view) {
-		GFXWARN("Attempt to retrieve number of cels from invalid/broken view %d\n", nr);
+		warning("[GFX] Attempt to retrieve number of cels from invalid/broken view %d", nr);
 		return 0;
 	} else if (real_loop != loop) {
-		GFXWARN("Loop number was corrected from %d to %d in view %d\n", loop, real_loop, nr);
+		warning("[GFX] Loop number was corrected from %d to %d in view %d", loop, real_loop, nr);
 	}
 
 	return view->loops[real_loop].cels_nr;
@@ -1649,7 +1649,7 @@
 	gfxr_view_t *testView = state->gfxResMan->getView(nr, loop, cel, 0);
 
 	if (!testView) {
-		GFXWARN("Attempt to verify loop/cel values for invalid view %d\n", nr);
+		warning("[GFX] Attempt to verify loop/cel values for invalid view %d", nr);
 		return GFX_ERROR;
 	}
 
@@ -1664,7 +1664,7 @@
 	gfxr_view_t *testView = state->gfxResMan->getView(nr, &loop_v, &cel_v, 0);
 
 	if (!testView) {
-		GFXWARN("Attempt to verify loop/cel values for invalid view %d\n", nr);
+		warning("[GFX] Attempt to verify loop/cel values for invalid view %d", nr);
 		return GFX_ERROR;
 	}
 
@@ -1686,7 +1686,7 @@
 	view = state->gfxResMan->getView(nr, &loop, &cel, 0);
 
 	if (!view) {
-		GFXWARN("Attempt to get cel parameters for invalid view %d\n", nr);
+		warning("[GFX] Attempt to get cel parameters for invalid view %d", nr);
 		return GFX_ERROR;
 	}
 
@@ -1710,7 +1710,7 @@
 	view = state->gfxResMan->getView(nr, &loop, &cel, palette);
 
 	if (!view) {
-		GFXWARN("Attempt to draw loop/cel %d/%d in invalid view %d\n", loop, cel, nr);
+		warning("[GFX] Attempt to draw loop/cel %d/%d in invalid view %d\n", loop, cel, nr);
 		return GFX_ERROR;
 	}
 	pxm = view->loops[loop].cels[cel];
@@ -1991,7 +1991,7 @@
 	}
 
 	if (handle->lines.empty()) {
-		GFXDEBUG("Skipping draw_text operation because number of lines is zero\n");
+		debugC(2, kDebugLevelGraphics, "Skipping draw_text operation because number of lines is zero\n");
 		return GFX_OK;
 	}
 

Modified: scummvm/trunk/engines/sci/gfx/res_pic.cpp
===================================================================
--- scummvm/trunk/engines/sci/gfx/res_pic.cpp	2009-06-08 09:10:12 UTC (rev 41366)
+++ scummvm/trunk/engines/sci/gfx/res_pic.cpp	2009-06-08 11:42:13 UTC (rev 41367)
@@ -798,7 +798,7 @@
 	line.height = ey - y;
 
 	if (x > 319 || y > 199 || x < 0 || y < 0 || ex > 319 || ey > 199 || ex < 0 || ey < 0) {
-		GFXWARN("While building pic: Attempt to draw line (%d,%d) to (%d,%d): cmd was %d\n", x, y, ex, ey, cmd);
+		warning("[GFX] While building pic: Attempt to draw line (%d,%d) to (%d,%d): cmd was %d", x, y, ex, ey, cmd);
 		return;
 	}
 
@@ -1088,7 +1088,7 @@
 	assert(src->mode->yfact == 1);
 
 	if (bound_x == 1 && bound_y == 1) {
-		GFXWARN("attempt to remove artifacts from unscaled pic!\n");
+		warning("[GFX] attempt to remove artifacts from unscaled pic");
 		return;
 	}
 
@@ -1431,7 +1431,7 @@
 			switch (opx) {
 
 			case PIC_SCI1_OPX_SET_PALETTE_ENTRIES:
-				GFXWARN("SCI1 Set palette entried not implemented\n");
+				warning("[GFX] SCI1 Set palette entried not implemented");
 				goto end_op_loop;
 
 			case PIC_SCI0_OPX_SET_PALETTE_ENTRIES:
@@ -1580,7 +1580,7 @@
 					pic->priorityTable = (int*)malloc(16 * sizeof(int));
 				} else {
 					// This occurs in the title screen of Longbow, perhaps with the animated Robin sprite
-					GFXWARN("pic->priorityTable is not NULL (%p); this only occurs with overlaid pics, otherwise it's a bug", (void *)pic->priorityTable);
+					warning("[GFX] pic->priorityTable is not NULL (%p); this only occurs with overlaid pics, otherwise it's a bug", (void *)pic->priorityTable);
 				}
 
 				pri_table = pic->priorityTable;
@@ -1626,13 +1626,13 @@
 			return;
 
 		default:
-			GFXWARN("Unknown op %02x\n", op);
+			warning("[GFX] Unknown op %02x", op);
 			return;
 		}
 end_op_loop: {}
 	}
 
-	GFXWARN("Reached end of pic resource %04x\n", resid);
+	warning("[GFX] Reached end of pic resource %04x", resid);
 }
 
 void gfxr_draw_pic11(gfxr_pic_t *pic, int flags, int default_palette, int size, byte *resource,
@@ -1674,7 +1674,7 @@
 		                      view->index_height,
 		                      1);
 	} else {
-		GFXWARN("No view was contained in SCI1.1 pic resource");
+		warning("[GFX] No view was contained in SCI1.1 pic resource");
 	}
 
 	gfxr_draw_pic01(pic, flags, default_palette, size - vector_data_ptr, resource + vector_data_ptr, style, resid, 1, static_pal, portBounds);

Modified: scummvm/trunk/engines/sci/gfx/res_view.cpp
===================================================================
--- scummvm/trunk/engines/sci/gfx/res_view.cpp	2009-06-08 09:10:12 UTC (rev 41366)
+++ scummvm/trunk/engines/sci/gfx/res_view.cpp	2009-06-08 11:42:13 UTC (rev 41367)
@@ -232,7 +232,7 @@
 
 		/*
 		if (writepos - bytes < 0) {
-			GFXWARN("View %02x:(%d/%d) describes more bytes than needed: %d/%d bytes at rel. offset 0x%04x\n",
+			warning("[GFX] View %02x:(%d/%d) describes more bytes than needed: %d/%d bytes at rel. offset 0x%04x",
 					id, loop, cel, writepos - bytes, pixmap_size, pos - 1);
 			bytes = pixmap_size - writepos;
 		}
@@ -246,7 +246,7 @@
 		assert(op || literal_pos + bytes <= size);
 
 		if (!mirrored && (writepos + bytes > pixmap_size)) {
-			GFXWARN("Writing out of bounds: %d bytes at %d > size %d\n", bytes, writepos, pixmap_size);
+			warning("[GFX] Writing out of bounds: %d bytes at %d > size %d", bytes, writepos, pixmap_size);
 		}
 
 		if (mirrored) {
@@ -302,14 +302,14 @@
 					writepos += 2 * xl;
 
 					if (writepos >= pixmap_size && bytes) {
-						GFXWARN("View %02x:(%d/%d) writing out of bounds\n", id, loop, cel);
+						warning("[GFX] View %02x:(%d/%d) writing out of bounds", id, loop, cel);
 						break;
 					}
 				}
 			}
 		} else {
 			if (writepos + bytes > pixmap_size) {
-				GFXWARN("View %02x:(%d/%d) describes more bytes than needed: %d/%d bytes at rel. offset 0x%04x\n",
+				warning("[GFX] View %02x:(%d/%d) describes more bytes than needed: %d/%d bytes at rel. offset 0x%04x",
 				        id, loop, cel, writepos - bytes, pixmap_size, pos - 1);
 				bytes = pixmap_size - writepos;
 			}
@@ -319,7 +319,7 @@
 	}
 
 	if (writepos < pixmap_size) {
-		GFXWARN("View %02x:(%d/%d) not enough pixel data in view\n", id, loop, cel);
+		warning("[GFX] View %02x:(%d/%d) not enough pixel data in view", id, loop, cel);
 		return 1;
 	}
 


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