[Scummvm-git-logs] scummvm master -> f1e8958fc2c7037e2d00fdfb66647e38917e736c

OMGPizzaGuy noreply at scummvm.org
Sat Dec 31 22:25:57 UTC 2022


This automated email contains information about 2 new commits which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .

Summary:
91927665be ULTIMA8: add debug channels for objects
f1e8958fc2 ULTIMA8: Use object debug channel for more events


Commit: 91927665be138ba33de42fdda52dd994ccf6a518
    https://github.com/scummvm/scummvm/commit/91927665be138ba33de42fdda52dd994ccf6a518
Author: Matthew Jimenez (matthew.jimenez at outlook.com)
Date: 2022-12-31T15:42:02-06:00

Commit Message:
ULTIMA8: add debug channels for objects

Changed paths:
    engines/ultima/detection.cpp
    engines/ultima/ultima.h
    engines/ultima/ultima8/gumps/container_gump.cpp
    engines/ultima/ultima8/gumps/game_map_gump.cpp
    engines/ultima/ultima8/gumps/target_gump.cpp
    engines/ultima/ultima8/kernel/mouse.cpp
    engines/ultima/ultima8/world/actors/u8_avatar_mover_process.cpp
    engines/ultima/ultima8/world/item_sorter.cpp
    engines/ultima/ultima8/world/map.cpp
    engines/ultima/ultima8/world/split_item_process.cpp


diff --git a/engines/ultima/detection.cpp b/engines/ultima/detection.cpp
index e6035a88055..164bef79465 100644
--- a/engines/ultima/detection.cpp
+++ b/engines/ultima/detection.cpp
@@ -55,6 +55,7 @@ const DebugChannelDef UltimaMetaEngineDetection::debugFlagList[] = {
 	{Ultima::kDebugGraphics, "Graphics", "Graphics debug level"},
 	{Ultima::kDebugVideo, "Video", "Video playback debug level"},
 	{Ultima::kDebugActor, "Actor", "Actor debug level"},
+	{Ultima::kDebugObject, "Object", "Object debug level"},
 	DEBUG_CHANNEL_END
 };
 
diff --git a/engines/ultima/ultima.h b/engines/ultima/ultima.h
index fa9751aef39..c40175497b8 100644
--- a/engines/ultima/ultima.h
+++ b/engines/ultima/ultima.h
@@ -28,7 +28,8 @@ enum UltimaDebugChannels {
 	kDebugPath = 1 << 0,
 	kDebugGraphics = 1 << 1,
 	kDebugVideo = 1 << 2,
-	kDebugActor = 1 << 3
+	kDebugActor = 1 << 3,
+	kDebugObject = 1 << 4
 };
 
 } // End of namespace Ultima
diff --git a/engines/ultima/ultima8/gumps/container_gump.cpp b/engines/ultima/ultima8/gumps/container_gump.cpp
index 8a0874c10ae..33a2000341f 100644
--- a/engines/ultima/ultima8/gumps/container_gump.cpp
+++ b/engines/ultima/ultima8/gumps/container_gump.cpp
@@ -19,6 +19,7 @@
  *
  */
 
+#include "ultima/ultima.h"
 #include "ultima/ultima8/gumps/container_gump.h"
 
 #include "ultima/ultima8/graphics/shape.h"
@@ -313,10 +314,10 @@ void ContainerGump::onMouseClick(int button, int32 mx, int32 my) {
 
 		Item *item = getItem(objID);
 		if (item) {
-			pout << item->dumpInfo() << Std::endl;
+			debugC(kDebugObject, "%s", item->dumpInfo().c_str());
 
 			if (Ultima8Engine::get_instance()->isAvatarInStasis()) {
-				pout << "Can't look: avatarInStasis" << Std::endl;
+				debugC(kDebugObject, "Can't look: avatarInStasis");
 			} else {
 				item->callUsecodeEvent_look();
 			}
@@ -334,10 +335,10 @@ void ContainerGump::onMouseDouble(int button, int32 mx, int32 my) {
 
 		Item *item = getItem(objID);
 		if (item) {
-			pout << item->dumpInfo() << Std::endl;
+			debugC(kDebugObject, "%s", item->dumpInfo().c_str());
 
 			if (Ultima8Engine::get_instance()->isAvatarInStasis()) {
-				pout << "Can't use: avatarInStasis" << Std::endl;
+				debugC(kDebugObject, "Can't use: avatarInStasis");
 				return;
 			}
 
diff --git a/engines/ultima/ultima8/gumps/game_map_gump.cpp b/engines/ultima/ultima8/gumps/game_map_gump.cpp
index 66312b62574..667cdd48a51 100644
--- a/engines/ultima/ultima8/gumps/game_map_gump.cpp
+++ b/engines/ultima/ultima8/gumps/game_map_gump.cpp
@@ -19,6 +19,7 @@
  *
  */
 
+#include "ultima/ultima.h"
 #include "ultima/ultima8/gumps/game_map_gump.h"
 #include "ultima/ultima8/kernel/kernel.h"
 #include "ultima/ultima8/world/world.h"
@@ -303,10 +304,10 @@ void GameMapGump::onMouseClick(int button, int32 mx, int32 my) {
 		if (item) {
 			int32 xv, yv, zv;
 			item->getLocation(xv, yv, zv);
-			pout << item->dumpInfo() << Std::endl;
+			debugC(kDebugObject, "%s", item->dumpInfo().c_str());
 
 			if (Ultima8Engine::get_instance()->isAvatarInStasis()) {
-				pout << "Can't look: avatarInStasis" << Std::endl;
+				debugC(kDebugObject, "Can't look: avatarInStasis");
 			} else {
 				item->callUsecodeEvent_look();
 			}
@@ -319,7 +320,7 @@ void GameMapGump::onMouseClick(int button, int32 mx, int32 my) {
 		if (item) {
 			int32 xv, yv, zv;
 			item->getLocation(xv, yv, zv);
-			pout << item->dumpInfo() << Std::endl;
+			debugC(kDebugObject, "%s", item->dumpInfo().c_str());
 
 #if 1
 			Actor *avatarControlled = getControlledActor();
@@ -368,7 +369,7 @@ void GameMapGump::onMouseDouble(int button, int32 mx, int32 my) {
 		if (item) {
 			int32 xv, yv, zv;
 			item->getLocation(xv, yv, zv);
-			pout << item->dumpInfo() << Std::endl;
+			debugC(kDebugObject, "%s", item->dumpInfo().c_str());
 
 			int range = 128; // CONSTANT!
 			if (GAME_IS_CRUSADER) {
@@ -376,7 +377,7 @@ void GameMapGump::onMouseDouble(int button, int32 mx, int32 my) {
 			}
 
 			if (Ultima8Engine::get_instance()->isAvatarInStasis()) {
-				pout << "Can't use: avatarInStasis" << Std::endl;
+				debugC(kDebugObject, "Can't use: avatarInStasis");
 				break;
 			}
 
@@ -497,7 +498,7 @@ void GameMapGump::DropItem(Item *item, int mx, int my) {
 		ObjId bp = avatar->getEquip(7); // !! constant
 		Container *backpack = getContainer(bp);
 		if (backpack && item->moveToContainer(backpack)) {
-			pout << "Dropped item in backpack" << Std::endl;
+			debugC(kDebugObject, "Dropped item in backpack");
 			item->randomGumpLocation();
 			return;
 		}
@@ -506,8 +507,8 @@ void GameMapGump::DropItem(Item *item, int mx, int my) {
 	if (!avatar->canReach(item, 128, // CONSTANT!
 	                      _draggingPos[0], _draggingPos[1], _draggingPos[2])) {
 		// can't reach, so throw
-		pout << "Throwing item to (" << _draggingPos[0] << ","
-		     << _draggingPos[1] << "," << _draggingPos[2] << ")" << Std::endl;
+		debugC(kDebugObject, "Throwing item to (%d, %d, %d)",
+			   _draggingPos[0], _draggingPos[1], _draggingPos[2]);
 		int speed = 64 - item->getTotalWeight() + avatar->getStr();
 		if (speed < 1) speed = 1;
 		int32 ax, ay, az;
@@ -534,8 +535,8 @@ void GameMapGump::DropItem(Item *item, int mx, int my) {
 		                                  _draggingPos[0] - ax));
 #endif
 	} else {
-		pout << "Dropping item at (" << _draggingPos[0] << ","
-		     << _draggingPos[1] << "," << _draggingPos[2] << ")" << Std::endl;
+		debugC(kDebugObject, "Dropping item at (%d, %d, %d)",
+			   _draggingPos[0], _draggingPos[1], _draggingPos[2]);
 
 		// CHECKME: collideMove and grab (in StopDraggingItem)
 		// both call release on supporting items.
diff --git a/engines/ultima/ultima8/gumps/target_gump.cpp b/engines/ultima/ultima8/gumps/target_gump.cpp
index 7cbb41cf78c..4cbc9c01644 100644
--- a/engines/ultima/ultima8/gumps/target_gump.cpp
+++ b/engines/ultima/ultima8/gumps/target_gump.cpp
@@ -19,8 +19,8 @@
  *
  */
 
+#include "ultima/ultima.h"
 #include "ultima/ultima8/gumps/target_gump.h"
-
 #include "ultima/ultima8/ultima8.h"
 #include "ultima/ultima8/kernel/mouse.h"
 #include "ultima/ultima8/gumps/gump_notify_process.h"
@@ -85,7 +85,7 @@ void TargetGump::onMouseUp(int button, int32 mx, int32 my) {
 
 	if (item) {
 		// done
-		pout << "Target result: " << item->dumpInfo() << Std::endl;
+		debugC(kDebugObject, "Target result: %s", item->dumpInfo().c_str());
 
 		_processResult = objId;
 		Close();
diff --git a/engines/ultima/ultima8/kernel/mouse.cpp b/engines/ultima/ultima8/kernel/mouse.cpp
index 7d6e96f4d44..f6c85ff4d56 100644
--- a/engines/ultima/ultima8/kernel/mouse.cpp
+++ b/engines/ultima/ultima8/kernel/mouse.cpp
@@ -20,6 +20,7 @@
  */
 
 #include "graphics/cursorman.h"
+#include "ultima/ultima.h"
 #include "ultima/ultima8/kernel/mouse.h"
 #include "ultima/ultima8/misc/pent_include.h"
 #include "ultima/ultima8/games/game_data.h"
@@ -374,6 +375,8 @@ void Mouse::startDragging(int startx, int starty) {
 
 	// for a Gump, notify the Gump's parent that we started _dragging:
 	if (gump) {
+		debugC(kDebugObject, "Dragging gump %u (class=%s)", _dragging_objId, gump->GetClassType()._className);
+
 		Gump *parent = gump->GetParent();
 		assert(parent); // can't drag root gump
 		int32 px = startx, py = starty;
@@ -386,6 +389,7 @@ void Mouse::startDragging(int startx, int starty) {
 		}
 	} else if (item) {
 		// for an Item, notify the gump the item is in that we started _dragging
+		debugC(kDebugObject, "Dragging item %u (class=%s)", _dragging_objId, item->GetClassType()._className);
 
 		// find gump item was in
 		gump = desktopGump->FindGump(startx, starty);
@@ -408,11 +412,6 @@ void Mouse::startDragging(int startx, int starty) {
 		_dragging = DRAG_INVALID;
 	}
 
-#if 0
-	Object *obj = ObjectManager::get_instance()->getObject(_dragging_objId);
-	pout << "Dragging object " << _dragging_objId << " (class=" << (obj ? obj->GetClassType().class_name : "NULL") << ")" << Std::endl;
-#endif
-
 	pushMouseCursor(MOUSE_NORMAL);
 
 	// pause the kernel
@@ -471,7 +470,7 @@ void Mouse::moveDragging(int mx, int my) {
 
 
 void Mouse::stopDragging(int mx, int my) {
-	//pout << "Dropping object " << _dragging_objId << Std::endl;
+	debugC(kDebugObject, "Dropping object %u", _dragging_objId);
 
 	Gump *gump = getGump(_dragging_objId);
 	Item *item = getItem(_dragging_objId);
diff --git a/engines/ultima/ultima8/world/actors/u8_avatar_mover_process.cpp b/engines/ultima/ultima8/world/actors/u8_avatar_mover_process.cpp
index 55b17733861..61c9affecfe 100644
--- a/engines/ultima/ultima8/world/actors/u8_avatar_mover_process.cpp
+++ b/engines/ultima/ultima8/world/actors/u8_avatar_mover_process.cpp
@@ -180,7 +180,7 @@ void U8AvatarMoverProcess::handleCombatMode() {
 
 		if (canAttack()) {
 			// double right click = kick
-//			debug(MM_INFO, "AvatarMover: combat kick");
+//			debugC(kDebugActor, "AvatarMover: combat kick");
 
 			if (checkTurn(mousedir, false))
 				return;
diff --git a/engines/ultima/ultima8/world/item_sorter.cpp b/engines/ultima/ultima8/world/item_sorter.cpp
index 59b927526ee..92b75084d73 100644
--- a/engines/ultima/ultima8/world/item_sorter.cpp
+++ b/engines/ultima/ultima8/world/item_sorter.cpp
@@ -19,6 +19,7 @@
  *
  */
 
+#include "ultima/ultima.h"
 #include "ultima/ultima8/misc/pent_include.h"
 #include "ultima/ultima8/world/item_sorter.h"
 #include "ultima/ultima8/world/item.h"
@@ -349,9 +350,9 @@ bool ItemSorter::PaintSortItem(RenderSurface *surf, SortItem *si) {
 	if (_sortLimit) {
 		if (si->_order == _sortLimit) {
 			if (!_painted || _painted->_itemNum != si->_itemNum) {
-				pout << "SortItem: " << si->dumpInfo() << Std::endl;
+				debugC(kDebugObject, "SortItem: %s", si->dumpInfo().c_str());
 				if (_painted && si->overlap(_painted)) {
-					pout << "Overlaps: " << _painted->dumpInfo() << Std::endl;
+					debugC(kDebugObject, "Overlaps: %s", _painted->dumpInfo().c_str());
 				}
 			}
 
diff --git a/engines/ultima/ultima8/world/map.cpp b/engines/ultima/ultima8/world/map.cpp
index 788b17f52a2..cce00f2131b 100644
--- a/engines/ultima/ultima8/world/map.cpp
+++ b/engines/ultima/ultima8/world/map.cpp
@@ -19,6 +19,7 @@
  *
  */
 
+#include "ultima/ultima.h"
 #include "ultima/ultima8/misc/pent_include.h"
 #include "ultima/ultima8/world/map.h"
 #include "ultima/ultima8/world/item_factory.h"
@@ -238,32 +239,21 @@ void Map::loadFixedFormatObjects(Std::list<Item *> &itemlist,
 			cont.pop();
 			contdepth--;
 #ifdef DUMP_ITEMS
-			pout << "---- Ending container ----" << Std::endl;
+			debugC(kDebugObject, "---- Ending container ----");
 #endif
 		}
 
 #ifdef DUMP_ITEMS
-		pout << shape << "," << frame << ":\t(" << x << "," << y << "," << z << "),\t" << ConsoleStream::hex << flags << ConsoleStream::dec << ", " << quality << ", " << npcNum << ", " << mapNum << ", " << next << Std::endl;
+		debugC(kDebugObject, "%u,%u:\t(%d, %d, %d),\t%x, %u, %u, %u, %u",
+			shape , frame, x, y, z, flags, quality, npcNum, mapNum, next);
 #endif
 
 		Item *item = ItemFactory::createItem(shape, frame, quality, flags, npcNum,
 		                                     mapNum, extendedflags, false);
 		if (!item) {
-			pout << shape << "," << frame << ":\t(" << x << "," << y << "," << z << "),\t" << ConsoleStream::hex << flags << ConsoleStream::dec << ", " << quality << ", " << npcNum << ", " << mapNum << ", " << next;
-
-			const ShapeInfo *info = GameData::get_instance()->getMainShapes()->
-			                  getShapeInfo(shape);
-			if (info) pout << ", family = " << info->_family;
-			pout << Std::endl;
-
-			pout << "Couldn't create item" << Std::endl;
+			warning("Couldn't create item: %u,%u:\t(%d, %d, %d),\t%x, %u, %u, %u, %u",
+				shape, frame, x, y, z, flags, quality, npcNum, mapNum, next);
 			continue;
-		} else {
-			const ShapeInfo *info = item->getShapeInfo();
-			assert(info);
-			if (info->_family > 10) {
-				//warning("Created fixed item unknown family %d, shape (%d, %d) at (%d, %d, %d)", info->_family, shape, frame, x, y, z);
-			}
 		}
 		item->setLocation(x, y, z);
 
@@ -279,7 +269,7 @@ void Map::loadFixedFormatObjects(Std::list<Item *> &itemlist,
 			contdepth++;
 			cont.push(c);
 #ifdef DUMP_ITEMS
-			pout << "---- Starting container ----" << Std::endl;
+			debugC(kDebugObject, "---- Starting container ----");
 #endif
 		}
 	}
diff --git a/engines/ultima/ultima8/world/split_item_process.cpp b/engines/ultima/ultima8/world/split_item_process.cpp
index cc3b2e9b4ba..0b722b3ab6d 100644
--- a/engines/ultima/ultima8/world/split_item_process.cpp
+++ b/engines/ultima/ultima8/world/split_item_process.cpp
@@ -19,6 +19,7 @@
  *
  */
 
+#include "ultima/ultima.h"
 #include "ultima/ultima8/world/split_item_process.h"
 #include "ultima/ultima8/world/item.h"
 #include "ultima/ultima8/world/get_object.h"
@@ -61,8 +62,8 @@ void SplitItemProcess::run() {
 	uint16 origcount = original->getQuality() - movecount;
 	uint16 targetcount = targetitem->getQuality() + movecount;
 
-	pout << "SplitItemProcess splitting: " << movecount << ": "
-	     << origcount << "-" << targetcount << Std::endl;
+	debugC(kDebugObject, "SplitItemProcess splitting: %u: %u-%u",
+		movecount, origcount, targetcount);
 
 	if (targetcount > 0) {
 		targetitem->setQuality(targetcount);


Commit: f1e8958fc2c7037e2d00fdfb66647e38917e736c
    https://github.com/scummvm/scummvm/commit/f1e8958fc2c7037e2d00fdfb66647e38917e736c
Author: Matthew Jimenez (matthew.jimenez at outlook.com)
Date: 2022-12-31T15:42:02-06:00

Commit Message:
ULTIMA8: Use object debug channel for more events

Changed paths:
    engines/ultima/ultima8/world/gravity_process.cpp
    engines/ultima/ultima8/world/item.cpp
    engines/ultima/ultima8/world/world.cpp


diff --git a/engines/ultima/ultima8/world/gravity_process.cpp b/engines/ultima/ultima8/world/gravity_process.cpp
index 54a6dbf2c56..c04a22cf9f2 100644
--- a/engines/ultima/ultima8/world/gravity_process.cpp
+++ b/engines/ultima/ultima8/world/gravity_process.cpp
@@ -156,9 +156,8 @@ void GravityProcess::run() {
 			return; // shouldn't happen..
 		if (_zSpeed < -2 && !dynamic_cast<Actor *>(item)) {
 #ifdef BOUNCE_DIAG
-			pout << "item " << _itemNum << " bounce ["
-			     << Kernel::get_instance()->getFrameNum()
-			     << "]: hit " << hititem->getObjId() << Std::endl;
+			debugC(kDebugObject, "item %u bounce [%u]: hit %u",
+				_itemNum, Kernel::get_instance()->getFrameNum(), hititem->getObjId());
 #endif
 
 			if (GAME_IS_U8 && (!hititem->getShapeInfo()->is_land() || _zSpeed < -2 * _gravity)) {
@@ -204,27 +203,22 @@ void GravityProcess::run() {
 					if (ABS(_xSpeed) > 2) _xSpeed /= 2;
 				}
 #ifdef BOUNCE_DIAG
-				pout << "item " << _itemNum << " bounce ["
-				     << Kernel::get_instance()->getFrameNum()
-				     << "]: speed was (" << xspeedold << ","
-				     << yspeedold << "," << zspeedold << ") new _zSpeed "
-				     << _zSpeed << " heading " << headingold_r
-				     << " impulse " << heading_r << " ("
-				     << (_xSpeed - xspeedold) << "," << (_ySpeed - yspeedold)
-				     << "), termFlag: " << termFlag << Std::endl;
+				debugc(kDebugObject, "item %u bounce [%u]: speed was (%d, %d, %d) new _zSpeed %d heading %lf impulse %lf (%d, %d), termFlag: %d",
+					  _itemNum, Kernel::get_instance()->getFrameNum(),
+					  xspeedold, yspeedold, zspeedold
+					  _zSpeed, headingold_r, heading_r,
+					  (_xSpeed - xspeedold), (_ySpeed - yspeedold), termFlag);
 #endif
 			} else {
 #ifdef BOUNCE_DIAG
-				pout << "item " << _itemNum << " bounce ["
-				     << Kernel::get_instance()->getFrameNum()
-				     << "]: no bounce" << Std::endl;
+				debugC(kDebugObject, "item %u bounce [%u]: no bounce",
+					  _itemNum, Kernel::get_instance()->getFrameNum());
 #endif
 			}
 		} else {
 #ifdef BOUNCE_DIAG
-			pout << "item " << _itemNum << " bounce ["
-			     << Kernel::get_instance()->getFrameNum()
-			     << "]: slow hit" << Std::endl;
+			debugC(kDebugObject, "item %u bounce [%u]: slow hit",
+				  _itemNum, Kernel::get_instance()->getFrameNum());
 #endif
 		}
 		if (termFlag) {
@@ -255,11 +249,10 @@ void GravityProcess::run() {
 			_zSpeed = -_zSpeed / 2;
 
 #ifdef BOUNCE_DIAG
-		pout << "item " << _itemNum << " bounce ["
-		     << Kernel::get_instance()->getFrameNum()
-		     << "]: speed was (" << xspeedold << ","
-		     << yspeedold << "," << zspeedold << ") new speed ("
-		     << _xSpeed << "," << _ySpeed << "," << _zSpeed << ")" << Std::endl;
+		debugC(kDebugObject, "item %u bounce [%u]: speed was (%d, %d, %d) new speed (%d, %d, %d)",
+			  _itemNum, Kernel::get_instance()->getFrameNum(),
+			  xspeedold, yspeedold, zspeedold ,
+			  _xSpeed, _ySpeed, _zSpeed);
 #endif
 
 		item->setFlag(Item::FLG_BOUNCING);
diff --git a/engines/ultima/ultima8/world/item.cpp b/engines/ultima/ultima8/world/item.cpp
index 6fdf8543920..d33615b6a9c 100644
--- a/engines/ultima/ultima8/world/item.cpp
+++ b/engines/ultima/ultima8/world/item.cpp
@@ -19,6 +19,7 @@
  *
  */
 
+#include "ultima/ultima.h"
 #include "ultima/ultima8/ultima8.h"
 #include "ultima/ultima8/usecode/usecode.h"
 #include "ultima/ultima8/games/game_data.h"
@@ -1539,7 +1540,7 @@ uint32 Item::callUsecodeEvent(uint32 event, const uint8 *args, int argsize) {
 	uint32 offset = u->get_class_event(class_id, event);
 	if (!offset) return 0; // event not found
 
-	debug(10, "Item: %d (shape %d) calling usecode event %d @ %04X:%04X",
+	debugC(kDebugObject, "Item: %d (shape %d) calling usecode event %d @ %04X:%04X",
 			_objId, _shape, event, class_id, offset);
 
 	return callUsecode(static_cast<uint16>(class_id),
@@ -1844,7 +1845,7 @@ void Item::animateItem() {
 		break;
 
 	default:
-		pout << "type " << info->_animType << " data " << anim_data << Std::endl;
+		debugC(kDebugObject, "type %u data %u", info->_animType, anim_data);
 		break;
 	}
 }
@@ -1927,7 +1928,7 @@ uint32 Item::enterFastArea() {
 // Called when an item is leaving the fast area
 void Item::leaveFastArea() {
 	if (_objId == 1) {
-		debug(6, "avatar leaving fast area");
+		debugC(kDebugActor, "Main actor leaving fast area");
 	}
 
 	// Call usecode
@@ -2022,7 +2023,7 @@ void Item::clearGump() {
 }
 
 int32 Item::ascend(int delta) {
-//	pout << "Ascend: _objId=" << getObjId() << ", delta=" << delta << Std::endl;
+	debugC(kDebugObject, "Ascend: _objId=%u, delta=%d", getObjId(), delta);
 
 	if (delta == 0) return 0x4000;
 
@@ -2051,7 +2052,7 @@ int32 Item::ascend(int delta) {
 	int dist = collideMove(xv, yv, zv + delta, false, false);
 	delta = (delta * dist) / 0x4000;
 
-//	pout << "Ascend: dist=" << dist << Std::endl;
+	debugC(kDebugObject, "Ascend: dist=%d", dist);
 
 	// move other items
 	for (uint32 i = 0; i < uclist.getSize(); i++) {
@@ -2747,7 +2748,7 @@ uint32 Item::I_setShape(const uint8 *args, unsigned int /*argsize*/) {
 	if (!item) return 0;
 
 #if 0
-	debug(6, "Item::setShape: objid %04X shape (%d -> %d)",
+	debugC(kDebugObject, "Item::setShape: objid %04X shape (%d -> %d)",
 		  item->getObjId(), item->getShape(), shape);
 #endif
 
@@ -3359,7 +3360,8 @@ uint32 Item::I_push(const uint8 *args, unsigned int /*argsize*/) {
 		return 0;
 
 	#if 0
-		pout << "Pushing item to ethereal void: id: " << item->getObjId() << " shp: " << item->getShape() << "," << item->getFrame() << Std::endl;
+		debugC(kDebugObject, "Pushing item to ethereal void: id: %u shp: %u, %u",
+			item->getObjId(), item->getShape(), item->getFrame());
 	#endif
 
 	item->moveToEtherealVoid();
@@ -3380,7 +3382,7 @@ uint32 Item::I_create(const uint8 *args, unsigned int /*argsize*/) {
 	uint16 objID = newitem->getObjId();
 
 #if 0
-	debug(6, "Item::create: objid %04X shape (%d, %d)",
+	debugC(kDebugObject, "Item::create: objid %04X shape (%d, %d)",
 		  objID, shape, frame);
 #endif
 
@@ -3412,7 +3414,7 @@ uint32 Item::I_pop(const uint8 */*args*/, unsigned int /*argsize*/) {
 	item->returnFromEtherealVoid();
 
 #if 0
-	pout << "Popping item to original location: " << item->getShape() << "," << item->getFrame() << Std::endl;
+	debugC(kDebugObject, "Popping item to original location: %u, %u", item->getShape(), item->getFrame());
 #endif
 
 	//! Anything else?
@@ -3450,7 +3452,8 @@ uint32 Item::I_popToCoords(const uint8 *args, unsigned int /*argsize*/) {
 	item->move(x, y, z);
 
 #if 0
-	pout << "Popping item into map: " << item->getShape() << "," << item->getFrame() << " at (" << x << "," << y << "," << z << ")" << Std::endl;
+	debugC(kDebugObject, "Popping item into map: %u, %u at (%d, %d, %d)",
+		item->getShape(), item->getFrame(), x, y, z);
 #endif
 
 	//! Anything else?
@@ -3558,7 +3561,8 @@ uint32 Item::I_move(const uint8 *args, unsigned int /*argsize*/) {
 	World_FromUsecodeXY(x, y);
 
 	#if 0
-		pout << "Moving item: " << item->getShape() << "," << item->getFrame() << " to (" << x << "," << y << "," << z << ")" << Std::endl;
+		debugC(kDebugObject, "Moving item: %u, %u to (%d, %d, %d)",
+			item->getShape(), item->getFrame(), x, y, z);
 	#endif
 
 	item->move(x, y, z);
@@ -3800,7 +3804,7 @@ uint32 Item::I_getSliderInput(const uint8 *args, unsigned int /*argsize*/) {
 	UCProcess *current = dynamic_cast<UCProcess *>(Kernel::get_instance()->getRunningProcess());
 	assert(current);
 
-//	pout << "SliderGump: min=" << minval << ", max=" << maxval << ", step=" << step << Std::endl;
+//	debugC(kDebugObject, "SliderGump: min=%d, max=%d, step=%d", minval, maxval, step);
 
 	SliderGump *_gump = new SliderGump(100, 100, minval, maxval, minval, step);
 	_gump->InitGump(0); // modal _gump
diff --git a/engines/ultima/ultima8/world/world.cpp b/engines/ultima/ultima8/world/world.cpp
index ffcab1d8f98..8386cc2fac6 100644
--- a/engines/ultima/ultima8/world/world.cpp
+++ b/engines/ultima/ultima8/world/world.cpp
@@ -278,7 +278,8 @@ void World::loadItemCachNPCData(Common::SeekableReadStream *itemcach, Common::Se
 		}
 
 #ifdef DUMP_ITEMS
-		pout << shape << "," << frame << ":\t(" << x << "," << y << "," << z << "),\t" << Std::hex << flags << Std::dec << ", " << quality << ", " << npcnum << ", " << mapnum << ", " << next << Std::endl;
+		debugC(kDebugObject, "%u,%u:\t(%d, %d, %d),\t%04X, %u, %u, u",
+			shape, frame, x, y, z, flags, quality, npcnum, mapnum);
 #endif
 
 		Actor *actor = ItemFactory::createActor(shape, frame, quality,
@@ -286,9 +287,7 @@ void World::loadItemCachNPCData(Common::SeekableReadStream *itemcach, Common::Se
 		                                        npcnum, mapnum,
 		                                        Item::EXT_PERMANENT_NPC, false);
 		if (!actor) {
-#ifdef DUMP_ITEMS
-			pout << "Couldn't create actor" << Std::endl;
-#endif
+			warning("Couldn't create actor");
 			continue;
 		}
 		ObjectManager::get_instance()->assignActorObjId(actor, i);




More information about the Scummvm-git-logs mailing list