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

OMGPizzaGuy noreply at scummvm.org
Sat Dec 31 16:46:41 UTC 2022


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

Summary:
a706725df1 ULTIMA8: replace stream output on sort item with dump info method
05450d43c0 ULTIMA8: Remove excessive log messages
ec8cfa397a ULTIMA8: add debug channels for actors


Commit: a706725df10ea061ceb9dcb4556579b309517394
    https://github.com/scummvm/scummvm/commit/a706725df10ea061ceb9dcb4556579b309517394
Author: Matthew Jimenez (matthew.jimenez at outlook.com)
Date: 2022-12-31T10:46:17-06:00

Commit Message:
ULTIMA8: replace stream output on sort item with dump info method

Changed paths:
    engines/ultima/ultima8/world/item_sorter.cpp
    engines/ultima/ultima8/world/sort_item.h


diff --git a/engines/ultima/ultima8/world/item_sorter.cpp b/engines/ultima/ultima8/world/item_sorter.cpp
index 1bb7e525100..59b927526ee 100644
--- a/engines/ultima/ultima8/world/item_sorter.cpp
+++ b/engines/ultima/ultima8/world/item_sorter.cpp
@@ -349,9 +349,9 @@ bool ItemSorter::PaintSortItem(RenderSurface *surf, SortItem *si) {
 	if (_sortLimit) {
 		if (si->_order == _sortLimit) {
 			if (!_painted || _painted->_itemNum != si->_itemNum) {
-				pout << "SortItem: " << *si << Std::endl;
+				pout << "SortItem: " << si->dumpInfo() << Std::endl;
 				if (_painted && si->overlap(_painted)) {
-					pout << "Overlaps: " << *_painted << Std::endl;
+					pout << "Overlaps: " << _painted->dumpInfo() << Std::endl;
 				}
 			}
 
diff --git a/engines/ultima/ultima8/world/sort_item.h b/engines/ultima/ultima8/world/sort_item.h
index 7be12a30889..b85aada37dd 100644
--- a/engines/ultima/ultima8/world/sort_item.h
+++ b/engines/ultima/ultima8/world/sort_item.h
@@ -23,7 +23,6 @@
 #define ULTIMA8_WORLD_SORTITEM_H
 
 #include "ultima/ultima8/misc/common_types.h"
-#include "ultima/ultima8/misc/debugger.h"
 
 namespace Ultima {
 namespace Ultima8 {
@@ -232,6 +231,7 @@ struct SortItem {
 		return _z < other->_z || (_z == other->_z && _flat && !other->_flat);
 	}
 
+	Common::String dumpInfo() const;
 };
 
 inline bool SortItem::overlap(const SortItem &si2) const {
@@ -401,34 +401,33 @@ inline bool SortItem::below(const SortItem &si2) const {
 	return si1._frame < si2._frame;
 }
 
-ConsoleStream &operator<<(ConsoleStream &cs, const SortItem &si) {
-	cs << si._shapeNum << ":" << si._frame <<
-		" (" << si._xLeft << "," << si._yFar << "," << si._z << ")" <<
-		" (" << si._x << "," << si._y << "," << si._zTop << "): ";
-	if (si._sprite)
-		cs << "sprite ";
-	if (si._flat)
-		cs << "flat ";
-	if (si._anim)
-		cs << "anim ";
-	if (si._trans)
-		cs << "trans ";
-	if (si._draw)
-		cs << "draw ";
-	if (si._solid)
-		cs << "solid ";
-	if (si._occl)
-		cs << "occl ";
-	if (si._fbigsq)
-		cs << "fbigsq ";
-	if (si._roof)
-		cs << "roof ";
-	if (si._land)
-		cs << "land ";
-	if (si._noisy)
-		cs << "noisy ";
-
-	return cs;
+Common::String SortItem::dumpInfo() const {
+	Common::String info = Common::String::format("%u:%u (%d, %d, %d) (%d, %d, %d): ",
+								_shapeNum, _frame, _xLeft, _yFar, _z, _x, _y, _zTop);
+	if (_sprite)
+		info += "sprite ";
+	if (_flat)
+		info += "flat ";
+	if (_anim)
+		info += "anim ";
+	if (_trans)
+		info += "trans ";
+	if (_draw)
+		info += "draw ";
+	if (_solid)
+		info += "solid ";
+	if (_occl)
+		info += "occl ";
+	if (_fbigsq)
+		info += "fbigsq ";
+	if (_roof)
+		info += "roof ";
+	if (_land)
+		info += "land ";
+	if (_noisy)
+		info += "noisy ";
+
+	return info;
 }
 
 } // End of namespace Ultima8


Commit: 05450d43c0e49dd4b0b43611d4555d2149358a52
    https://github.com/scummvm/scummvm/commit/05450d43c0e49dd4b0b43611d4555d2149358a52
Author: Matthew Jimenez (matthew.jimenez at outlook.com)
Date: 2022-12-31T10:46:17-06:00

Commit Message:
ULTIMA8: Remove excessive log messages

Changed paths:
    engines/ultima/ultima8/gumps/u8_save_gump.cpp
    engines/ultima/ultima8/world/teleport_egg.cpp


diff --git a/engines/ultima/ultima8/gumps/u8_save_gump.cpp b/engines/ultima/ultima8/gumps/u8_save_gump.cpp
index 108014135c2..1981edcac62 100644
--- a/engines/ultima/ultima8/gumps/u8_save_gump.cpp
+++ b/engines/ultima/ultima8/gumps/u8_save_gump.cpp
@@ -272,8 +272,6 @@ bool U8SaveGump::loadgame(int saveIndex) {
 }
 
 bool U8SaveGump::savegame(int saveIndex, const Std::string &name) {
-	pout << "Save " << saveIndex << ": \"" << name << "\"" << Std::endl;
-
 	if (name.empty())
 		return false;
 
diff --git a/engines/ultima/ultima8/world/teleport_egg.cpp b/engines/ultima/ultima8/world/teleport_egg.cpp
index 85ca12ef4c2..6919bd3984f 100644
--- a/engines/ultima/ultima8/world/teleport_egg.cpp
+++ b/engines/ultima/ultima8/world/teleport_egg.cpp
@@ -40,8 +40,6 @@ uint16 TeleportEgg::hatch() {
 	if (!isTeleporter()) return 0; // teleport target
 
 	// teleport to destination egg
-	pout << "Teleport!!!!!!!!" << Std::endl;
-
 	MainActor *av = getMainActor();
 	av->teleport(_mapNum, getTeleportId());
 


Commit: ec8cfa397ae2af89b2b2169c309694ed42129811
    https://github.com/scummvm/scummvm/commit/ec8cfa397ae2af89b2b2169c309694ed42129811
Author: Matthew Jimenez (matthew.jimenez at outlook.com)
Date: 2022-12-31T10:46:18-06:00

Commit Message:
ULTIMA8: add debug channels for actors

Changed paths:
    engines/ultima/detection.cpp
    engines/ultima/ultima.h
    engines/ultima/ultima8/world/actors/actor.cpp
    engines/ultima/ultima8/world/actors/actor_anim_process.cpp
    engines/ultima/ultima8/world/actors/animation_tracker.cpp
    engines/ultima/ultima8/world/actors/combat_process.cpp
    engines/ultima/ultima8/world/actors/main_actor.cpp
    engines/ultima/ultima8/world/actors/scheduler_process.cpp
    engines/ultima/ultima8/world/actors/u8_avatar_mover_process.cpp


diff --git a/engines/ultima/detection.cpp b/engines/ultima/detection.cpp
index 86111c0812b..e6035a88055 100644
--- a/engines/ultima/detection.cpp
+++ b/engines/ultima/detection.cpp
@@ -54,6 +54,7 @@ const DebugChannelDef UltimaMetaEngineDetection::debugFlagList[] = {
 	{Ultima::kDebugPath, "Path", "Pathfinding debug level"},
 	{Ultima::kDebugGraphics, "Graphics", "Graphics debug level"},
 	{Ultima::kDebugVideo, "Video", "Video playback debug level"},
+	{Ultima::kDebugActor, "Actor", "Actor debug level"},
 	DEBUG_CHANNEL_END
 };
 
diff --git a/engines/ultima/ultima.h b/engines/ultima/ultima.h
index c19e8642b3a..fa9751aef39 100644
--- a/engines/ultima/ultima.h
+++ b/engines/ultima/ultima.h
@@ -27,7 +27,8 @@ namespace Ultima {
 enum UltimaDebugChannels {
 	kDebugPath = 1 << 0,
 	kDebugGraphics = 1 << 1,
-	kDebugVideo = 1 << 2
+	kDebugVideo = 1 << 2,
+	kDebugActor = 1 << 3
 };
 
 } // End of namespace Ultima
diff --git a/engines/ultima/ultima8/world/actors/actor.cpp b/engines/ultima/ultima8/world/actors/actor.cpp
index d45e34c0e02..4b7e8cf6a54 100644
--- a/engines/ultima/ultima8/world/actors/actor.cpp
+++ b/engines/ultima/ultima8/world/actors/actor.cpp
@@ -19,6 +19,7 @@
  *
  */
 
+#include "ultima/ultima.h"
 #include "ultima/ultima8/misc/pent_include.h"
 #include "ultima/ultima8/kernel/object_manager.h"
 #include "ultima/ultima8/kernel/kernel.h"
@@ -203,10 +204,9 @@ bool Actor::giveTreasure() {
 					if (!chance) continue;
 
 					int r = getRandom() % 100;
-#if 0
-					pout << "weapon (" << s << ") chance: " << r << "/"
-					     << chance << Std::endl;
-#endif
+
+					debugC(kDebugActor, "weapon (%u) chance: %d/%d", s, r, chance);
+
 					if (r >= chance) continue;
 
 					// create the weapon
@@ -311,8 +311,7 @@ bool Actor::giveTreasure() {
 				}
 
 			} else {
-				pout << "Unhandled special treasure: " << ti._special
-				     << Std::endl;
+				debugC(kDebugActor, "Unhandled special treasure: %s", ti._special.c_str());
 			}
 			continue;
 		}
@@ -445,10 +444,8 @@ void Actor::teleport(int newmap, int32 newx, int32 newy, int32 newz) {
 
 	// Move it to this map
 	if (newmapnum == World::get_instance()->getCurrentMap()->getNum()) {
-#ifdef DEBUG
-		pout << "Actor::teleport: " << getObjId() << " to " << newmap << ","
-		     << newx << "," << newy << "," << newz << Std::endl;
-#endif
+		debugC(kDebugActor, "Actor::teleport: %u to %d (%d, %d, %d)",
+			getObjId(), newmap, newx, newy, newz);
 		move(newx, newy, newz);
 	}
 	// Move it to another map
@@ -550,7 +547,7 @@ uint16 Actor::doAnim(Animation::Sequence anim, Direction dir, unsigned int steps
 		getLocation(x, y, z);
 		int32 actionno = AnimDat::getActionNumberForSequence(anim, this);
 		const AnimAction *action = GameData::get_instance()->getMainShapes()->getAnim(getShape(), actionno);
-		debug(6, "Actor::doAnim(%d, %d, %d) from (%d, %d, %d) frame repeat %d", anim, dir, steps, x, y, z, action ? action->getFrameRepeat() : -1);
+		debugC(kDebugActor, "Actor::doAnim(%d, %d, %d) from (%d, %d, %d) frame repeat %d", anim, dir, steps, x, y, z, action ? action->getFrameRepeat() : -1);
 	}
 #endif
 
@@ -1188,16 +1185,15 @@ void Actor::receiveHitU8(uint16 other, Direction dir, int damage, uint16 damage_
 		av->accumulateStr(damage / 4);
 	}
 
-	pout << "Actor " << getObjId() << " received hit from " << other
-	     << " (dmg=" << damage << ",type=" << ConsoleStream::hex << damage_type
-	     << ConsoleStream::dec << "). ";
+	debugCN(kDebugActor, "Actor %u received hit from %u (dmg=%d,type=%x) ",
+		getObjId(), other, damage, damage_type);
 
 	damage = calculateAttackDamage(other, damage, damage_type);
 
 	if (!damage) {
-		pout << "No damage." << Std::endl;
+		debugC(kDebugActor, "No damage.");
 	} else {
-		pout << "Damage: " << damage << Std::endl;
+		debugC(kDebugActor, "Damage: %d", damage);
 	}
 
 	if (damage >= 4 && _objId == 1 && attacker) {
@@ -1350,7 +1346,7 @@ ProcId Actor::dieU8(uint16 damageType) {
 	if (mi && mi->_resurrection && !(damageType & WeaponInfo::DMG_FIRE)) {
 		// this monster will be resurrected after a while
 
-		pout << "Actor::die: scheduling resurrection" << Std::endl;
+		debugC(kDebugActor, "Actor::die: scheduling resurrection");
 
 		int timeout = ((getRandom() % 25) + 5) * 30; // 5-30 seconds
 
@@ -1370,8 +1366,7 @@ ProcId Actor::dieU8(uint16 damageType) {
 
 	if (mi && mi->_explode) {
 		// this monster explodes when it dies
-
-		pout << "Actor::die: exploding" << Std::endl;
+		debugC(kDebugActor, "Actor::die: exploding");
 
 		int count = 5;
 		Shape *explosionshape = GameData::get_instance()->getMainShapes()
@@ -2579,8 +2574,7 @@ uint32 Actor::I_createActor(const uint8 *args, unsigned int /*argsize*/) {
 	UCMachine::get_instance()->assignPointer(ptr, buf, 2);
 
 #if 0
-	pout << "I_createActor: created actor #" << objID << " shape "
-		 << shape << " frame " << frame << Std::endl;
+	debugC(kDebugActor, "I_createActor: created actor #%u shape %u frame %u", objID, shape, frame);
 #endif
 
 	return objID;
diff --git a/engines/ultima/ultima8/world/actors/actor_anim_process.cpp b/engines/ultima/ultima8/world/actors/actor_anim_process.cpp
index 931ec4e8f3e..767abcb13f3 100644
--- a/engines/ultima/ultima8/world/actors/actor_anim_process.cpp
+++ b/engines/ultima/ultima8/world/actors/actor_anim_process.cpp
@@ -69,10 +69,8 @@ ActorAnimProcess::ActorAnimProcess(Actor *actor, Animation::Sequence action,
 	_type = ACTOR_ANIM_PROC_TYPE;
 #ifdef WATCHACTOR
 	if (_itemNum == watchactor)
-		pout << "Animation [" << Kernel::get_instance()->getFrameNum()
-			 << "] ActorAnimProcess created (" << _itemNum << ","
-			 << _action << "," << _dir << ") steps " << _steps
-			 << Std::endl;
+		debugC(kDebugActor, "Animation [%u] ActorAnimProcess created (%u, %d, %d) steps %u",
+			  Kernel::get_instance()->getFrameNum(), _itemNum, _action, _dir, _steps);
 #endif
 }
 
@@ -95,9 +93,8 @@ bool ActorAnimProcess::init() {
 
 #ifdef WATCHACTOR
 	if (_itemNum == watchactor)
-		pout << "Animation [" << Kernel::get_instance()->getFrameNum()
-			 << "] ActorAnimProcess " << getPid() << " init failed "
-			 << "(actor " << _itemNum << "not fast)" << Std::endl;
+		debugC(kDebugActor, "Animation [%u] ActorAnimProcess %u init failed (actor %u not fast)",
+			  Kernel::get_instance()->getFrameNum(), getPid(), _itemNum);
 #endif
 
 		return false;
@@ -122,9 +119,8 @@ bool ActorAnimProcess::init() {
 
 #ifdef WATCHACTOR
 	if (_itemNum == watchactor)
-		pout << "Animation [" << Kernel::get_instance()->getFrameNum()
-			 << "] ActorAnimProcess " << getPid() << " init failed "
-			 << "(tracker init failed)" << Std::endl;
+		debugC(kDebugActor, "Animation [%u] ActorAnimProcess %u init failed (tracker not fast)",
+			  Kernel::get_instance()->getFrameNum(), getPid());
 #endif
 
 		return false;
@@ -138,10 +134,8 @@ bool ActorAnimProcess::init() {
 
 #ifdef WATCHACTOR
 	if (_itemNum == watchactor)
-		pout << "Animation [" << Kernel::get_instance()->getFrameNum()
-		     << "] ActorAnimProcess " << getPid() << " initalized ("
-			 << _itemNum << "," << _action << "," << _dir << ") steps "
-			 << _steps << Std::endl;
+		debugC(kDebugActor, "Animation [%u] ActorAnimProcess %u initalized (%u, %d, %d) steps %d",
+			  Kernel::get_instance()->getFrameNum(), getPid(), _itemNum, _action, _dir, _steps);
 #endif
 
 	return true;
@@ -189,10 +183,8 @@ void ActorAnimProcess::run() {
 		//  AnimationTracker is done.)
 #ifdef WATCHACTOR
 		if (_itemNum == watchactor)
-			pout << "Animation ["
-			     << Kernel::get_instance()->getFrameNum()
-			     << "] ActorAnimProcess left fastarea; terminating"
-			     << Std::endl;
+			debugC(kDebugActor, "Animation [%u] ActorAnimProcess left fastarea; terminating",
+				  Kernel::get_instance()->getFrameNum());
 #endif
 		terminate();
 		return;
@@ -214,19 +206,16 @@ void ActorAnimProcess::run() {
 				// all done
 #ifdef WATCHACTOR
 				if (_itemNum == watchactor)
-					pout << "Animation ["
-					     << Kernel::get_instance()->getFrameNum()
-					     << "] ActorAnimProcess done; terminating"
-					     << Std::endl;
+					debugC(kDebugActor, "Animation [%u] ActorAnimProcess done; terminating",
+						  Kernel::get_instance()->getFrameNum());
 #endif
 
 				// TODO: there are _three_ places where we can fall; clean up
 				if (_tracker->isUnsupported()) {
 #ifdef WATCHACTOR
 					if (_itemNum == watchactor) {
-						pout << "Animation ["
-						     << Kernel::get_instance()->getFrameNum()
-						     << "] falling at end" << Std::endl;
+						debugC(kDebugActor, "Animation [%u] ActorAnimProcess falling at end",
+							  Kernel::get_instance()->getFrameNum());
 					}
 #endif
 					int32 dx, dy, dz;
@@ -246,18 +235,15 @@ void ActorAnimProcess::run() {
 
 #ifdef WATCHACTOR
 				if (_itemNum == watchactor)
-					pout << "Animation ["
-					     << Kernel::get_instance()->getFrameNum()
-					     << "] ActorAnimProcess blocked; terminating"
-					     << Std::endl;
+					debugC(kDebugActor, "Animation [%u] ActorAnimProcess blocked; terminating",
+						  Kernel::get_instance()->getFrameNum());
 #endif
 
 				if (_tracker->isUnsupported()) {
 #ifdef WATCHACTOR
 					if (_itemNum == watchactor) {
-						pout << "Animation ["
-						     << Kernel::get_instance()->getFrameNum()
-						     << "] falling from blocked" << Std::endl;
+						debugC(kDebugActor, "Animation [%u] ActorAnimProcess falling from blocked",
+							  Kernel::get_instance()->getFrameNum());
 					}
 #endif
 					// no inertia here because we just crashed into something
@@ -316,8 +302,8 @@ void ActorAnimProcess::run() {
 #ifdef WATCHACTOR
 		} else {
 			if (_itemNum == watchactor) {
-				pout << "Animation [" << Kernel::get_instance()->getFrameNum()
-					 << "] moved, so aborting this frame." << Std::endl;
+				debugC(kDebugActor, "Animation [%u] ActorAnimProcess moved, so aborting this frame.",
+						Kernel::get_instance()->getFrameNum());
 			}
 #endif // WATCHACTOR
 		}
@@ -338,10 +324,8 @@ void ActorAnimProcess::run() {
 	if (!a->hasFlags(Item::FLG_FASTAREA)) {
 #ifdef WATCHACTOR
 		if (_itemNum == watchactor)
-			pout << "Animation ["
-			     << Kernel::get_instance()->getFrameNum()
-			     << "] ActorAnimProcess left fastarea; terminating"
-			     << Std::endl;
+			debugC(kDebugActor, "Animation [%u] ActorAnimProcess left fastarea; terminating",
+				  Kernel::get_instance()->getFrameNum());
 #endif
 		terminate();
 		return;
@@ -349,20 +333,20 @@ void ActorAnimProcess::run() {
 
 #ifdef WATCHACTOR
 	if (_itemNum == watchactor) {
-		pout << "Animation [" << Kernel::get_instance()->getFrameNum()
-		     << "] showing frame (" << x << "," << y << "," << z << ")-("
-			 << x2 << "," << y2 << "," << z2 << ")"
-		     << " shp (" << a->getShape() << "," << _tracker->getFrame()
-		     << ") sfx " << _tracker->getAnimFrame()->_sfx
-		     << " rep " << _repeatCounter << ConsoleStream::hex
-			 << " flg " << _tracker->getAnimFrame()->_flags << " "
-			 << ConsoleStream::dec;
-
-		if (_tracker->isDone()) pout << "D";
-		if (_tracker->isBlocked()) pout << "B";
-		if (_tracker->isUnsupported()) pout << "U";
-		if (_tracker->hitSomething()) pout << "H";
-		pout << Std::endl;
+		Common::String info;
+		if (_tracker->isDone())
+			info += "D";
+		if (_tracker->isBlocked())
+			info += "B";
+		if (_tracker->isUnsupported())
+			info += "U";
+		if (_tracker->hitSomething())
+			info += "H";
+
+		debugC(kDebugActor, "Animation [%u] ActorAnimProcess showing frame (%d, %d, %d)-(%d, %d, %d) shp (%u, %u) sfx %d rep %d flg %04X %s",
+			  Kernel::get_instance()->getFrameNum(), x, y, z, x2, y2, z2,
+			  a->getShape(), _tracker->getFrame(), _tracker->getAnimFrame()->_sfx,
+			  _repeatCounter, _tracker->getAnimFrame()->_flags, info.c_str());
 	}
 #endif
 
@@ -373,8 +357,8 @@ void ActorAnimProcess::run() {
 
 #ifdef WATCHACTOR
 			if (_itemNum == watchactor) {
-				pout << "Animation [" << Kernel::get_instance()->getFrameNum()
-				     << "] falling from repeat" << Std::endl;
+				debugC(kDebugActor, "Animation [%u] ActorAnimProcess falling from repeat",
+					  Kernel::get_instance()->getFrameNum());
 			}
 #endif
 
@@ -667,10 +651,8 @@ void ActorAnimProcess::doHitSpecial(Item *hit) {
 void ActorAnimProcess::terminate() {
 #ifdef WATCHACTOR
 	if (_itemNum == watchactor)
-		pout << "Animation ["
-		     << Kernel::get_instance()->getFrameNum()
-		     << "] ActorAnimProcess " << getPid() << " terminating"
-		     << Std::endl;
+		debugC(kDebugActor, "Animation [%u] ActorAnimProcess %u terminating",
+			  Kernel::get_instance()->getFrameNum(), getPid());
 #endif
 
 	Actor *a = getActor(_itemNum);
@@ -681,10 +663,8 @@ void ActorAnimProcess::terminate() {
 				// destroy the actor
 #ifdef WATCHACTOR
 				if (_itemNum == watchactor)
-					pout << "Animation ["
-					     << Kernel::get_instance()->getFrameNum()
-					     << "] ActorAnimProcess destroying actor " << _itemNum
-					     << Std::endl;
+					debugC(kDebugActor, "Animation [%u] ActorAnimProcess destroying actor %u",
+						  Kernel::get_instance()->getFrameNum(), _itemNum);
 #endif
 				Process *vanishproc = new DestroyItemProcess(a);
 				Kernel::get_instance()->addProcess(vanishproc);
diff --git a/engines/ultima/ultima8/world/actors/animation_tracker.cpp b/engines/ultima/ultima8/world/actors/animation_tracker.cpp
index c5499a0fefd..62d18cbb8f8 100644
--- a/engines/ultima/ultima8/world/actors/animation_tracker.cpp
+++ b/engines/ultima/ultima8/world/actors/animation_tracker.cpp
@@ -66,7 +66,7 @@ bool AnimationTracker::init(const Actor *actor, Animation::Sequence action,
 	if (!_animAction) {
 #ifdef WATCHACTOR
 		if (actor && actor->getObjId() == watchactor) {
-			debug(6, "AnimationTracker: no animation action %d for shape %d",
+			debugC(kDebugActor, "AnimationTracker: no animation action %d for shape %d",
 				  actionnum, shape);
 		}
 #endif
@@ -95,7 +95,7 @@ bool AnimationTracker::init(const Actor *actor, Animation::Sequence action,
 
 #ifdef WATCHACTOR
 	if (actor && actor->getObjId() == watchactor) {
-		debug(6, "AnimationTracker: playing action %d %d-%d (animAction flags: 0x04%x)",
+		debugC(kDebugActor, "AnimationTracker: playing action %d %d-%d (animAction flags: 0x04%x)",
 			  actionnum, _startFrame, _endFrame, _animAction->getFlags());
 	}
 #endif
@@ -292,8 +292,7 @@ bool AnimationTracker::step() {
 			if (!it->_touching && it->_blocking) {
 #ifdef WATCHACTOR
 				if (a->getObjId() == watchactor) {
-					pout << "AnimationTracker: did sweepTest for large step; "
-					     << "collision at time " << it->_hitTime << Std::endl;
+					debugC(kDebugActor, "AnimationTracker: did sweepTest for large step; collision at time %d", it->_hitTime);
 				}
 #endif
 				_blocked = true;
@@ -362,11 +361,8 @@ bool AnimationTracker::step() {
 			} else {
 #ifdef WATCHACTOR
 				if (a->getObjId() == watchactor) {
-					pout << "AnimationTracker: adjusted step: x: "
-					     << tx << "," << _x << "," << dx << " y: "
-						 << ty << "," << _y << "," << dy << " z: "
-						 << tz << "," << _z << "," << dz
-					     << Std::endl;
+					debugC(kDebugActor, "AnimationTracker: adjusted step: x: %d, %d, %d y: %d, %d, %d z: %d, %d, %d",
+						  tx, _x, dx, ty, _y, dy, tz, _z, dz);
 				}
 #endif
 			}
@@ -380,8 +376,8 @@ bool AnimationTracker::step() {
 
 #ifdef WATCHACTOR
 	if (a->getObjId() == watchactor) {
-		pout << "AnimationTracker: step (" << _x << "," << _y << "," << _z << ") +("<< tx - _x << "," << ty - _y
-		     << "," << tz - _z << ")" << Std::endl;
+		debugC(kDebugActor, "AnimationTracker: step (%d, %d, %d) + (%d, %d, %d)",
+			_x, _y, _z, tx - _x, ty - _y, tz - _z);
 	}
 #endif
 
@@ -471,9 +467,8 @@ void AnimationTracker::checkWeaponHit() {
 
 #ifdef WATCHACTOR
 	if (a->getObjId() == watchactor) {
-		pout << "AnimationTracker: Checking hit, range " << range << ", box "
-		     << abox._x << "," << abox._y << "," << abox._z << "," << abox._xd
-		     << "," << abox._yd << "," << abox._zd << ": ";
+		debugC(kDebugActor, "AnimationTracker: Checking hit, range %d, box %d, %d, %d : %d, %d, %d",
+			range, abox._x, abox._y, abox._z, abox._xd, abox._yd, abox._zd);
 	}
 #endif
 
@@ -498,7 +493,7 @@ void AnimationTracker::checkWeaponHit() {
 			hit = itemid;
 #ifdef WATCHACTOR
 			if (a->getObjId() == watchactor) {
-				pout << "hit: " << item->dumpInfo() << Std::endl;
+				debugC(kDebugActor, "hit: %s", item->dumpInfo().c_str());
 			}
 #endif
 			break;
@@ -507,7 +502,7 @@ void AnimationTracker::checkWeaponHit() {
 
 #ifdef WATCHACTOR
 	if (a->getObjId() == watchactor && !hit) {
-		pout << "nothing" << Std::endl;
+		debugC(kDebugActor, "nothing");
 	}
 #endif
 
diff --git a/engines/ultima/ultima8/world/actors/combat_process.cpp b/engines/ultima/ultima8/world/actors/combat_process.cpp
index fad7ccd5ac8..1de00e7efac 100644
--- a/engines/ultima/ultima8/world/actors/combat_process.cpp
+++ b/engines/ultima/ultima8/world/actors/combat_process.cpp
@@ -19,6 +19,7 @@
  *
  */
 
+#include "ultima/ultima.h"
 #include "ultima/ultima8/world/actors/combat_process.h"
 #include "ultima/ultima8/world/actors/actor.h"
 #include "ultima/ultima8/world/current_map.h"
@@ -79,8 +80,7 @@ void CombatProcess::run() {
 			return;
 		}
 
-		pout << "[COMBAT " << _itemNum << "] _target found: "
-		     << _target << Std::endl;
+		debugC(kDebugActor, "[COMBAT %u] _target found: %u", _itemNum, _target);
 		_combatMode = CM_WAITING;
 	}
 
@@ -93,8 +93,7 @@ void CombatProcess::run() {
 	if (inAttackRange()) {
 		_combatMode = CM_ATTACKING;
 
-		pout << "[COMBAT " << _itemNum << "] _target (" << _target
-		     << ") in range" << Std::endl;
+		debugC(kDebugActor, "[COMBAT %u] _target (%u) in range", _itemNum, _target);
 
 		bool hasidle1 = a->hasAnim(Animation::idle1);
 		bool hasidle2 = a->hasAnim(Animation::idle2);
diff --git a/engines/ultima/ultima8/world/actors/main_actor.cpp b/engines/ultima/ultima8/world/actors/main_actor.cpp
index 3700b81f908..bb6a0f7f81a 100644
--- a/engines/ultima/ultima8/world/actors/main_actor.cpp
+++ b/engines/ultima/ultima8/world/actors/main_actor.cpp
@@ -19,6 +19,7 @@
  *
  */
 
+#include "ultima/ultima.h"
 #include "ultima/ultima8/world/actors/main_actor.h"
 #include "ultima/ultima8/world/teleport_egg.h"
 #include "ultima/ultima8/world/current_map.h"
@@ -396,8 +397,7 @@ void MainActor::teleport(int mapNum, int teleport_id) {
 	World *world = World::get_instance();
 	CurrentMap *currentmap = world->getCurrentMap();
 
-	pout << "MainActor::teleport(): teleporting to map " << mapNum
-	     << ", egg " << teleport_id << Std::endl;
+	debugC(kDebugActor, "MainActor::teleport(): teleporting to map %d, egg %d", mapNum, teleport_id);
 
 	setMapNum(mapNum);
 
@@ -418,8 +418,8 @@ void MainActor::teleport(int mapNum, int teleport_id) {
 	int32 xv, yv, zv;
 	egg->getLocation(xv, yv, zv);
 
-	pout << "Found destination: " << xv << "," << yv << "," << zv << Std::endl;
-	pout << egg->dumpInfo() << Std::endl;
+	debugC(kDebugActor, "Found destination: %d, %d, %d", xv, yv, zv);
+	debugC(kDebugActor, "%s", egg->dumpInfo().c_str());
 
 	if (GAME_IS_CRUSADER) {
 		// Keep the camera on the avatar (the snap process will update on next move)
@@ -610,7 +610,7 @@ void MainActor::accumulateStr(int n) {
 		_accumStr = 0;
 		AudioProcess *audioproc = AudioProcess::get_instance();
 		if (audioproc) audioproc->playSFX(0x36, 0x60, 1, 0); //constants!!
-		pout << "Gained _strength!" << Std::endl;
+		debugC(kDebugActor, "Gained _strength!");
 	}
 }
 
@@ -624,7 +624,7 @@ void MainActor::accumulateDex(int n) {
 		_accumDex = 0;
 		AudioProcess *audioproc = AudioProcess::get_instance();
 		if (audioproc) audioproc->playSFX(0x36, 0x60, 1, 0); //constants!!
-		pout << "Gained _dexterity!" << Std::endl;
+		debugC(kDebugActor, "Gained _dexterity!");
 	}
 }
 
@@ -638,7 +638,7 @@ void MainActor::accumulateInt(int n) {
 		_accumInt = 0;
 		AudioProcess *audioproc = AudioProcess::get_instance();
 		if (audioproc) audioproc->playSFX(0x36, 0x60, 1, 0); //constants!!
-		pout << "Gained _intelligence!" << Std::endl;
+		debugC(kDebugActor, "Gained _intelligence!");
 	}
 }
 
@@ -965,7 +965,7 @@ void MainActor::useInventoryItem(Item *item) {
 	if (!item)
 		return;
 	if (Ultima8Engine::get_instance()->isAvatarInStasis()) {
-		pout << "Can't use item: avatarInStasis" << Std::endl;
+		debugC(kDebugActor, "Can't use item: avatarInStasis");
 		return;
 	}
 	const int32 shapenum = item->getShape();
diff --git a/engines/ultima/ultima8/world/actors/scheduler_process.cpp b/engines/ultima/ultima8/world/actors/scheduler_process.cpp
index 1a64ae688c7..e9fa0bc0604 100644
--- a/engines/ultima/ultima8/world/actors/scheduler_process.cpp
+++ b/engines/ultima/ultima8/world/actors/scheduler_process.cpp
@@ -52,8 +52,8 @@ void SchedulerProcess::run() {
 		if (_nextActor == 256) { // CONSTANT
 			_nextActor = 0; // done
 #if 0
-			pout << "Scheduler: finished run at "
-			     << Kernel::get_instance()->getFrameNum() << Std::endl;
+			debugC(kDebugActor, "Scheduler: finished run at %u",
+				Kernel::get_instance()->getFrameNum());
 #endif
 		}
 
@@ -68,8 +68,7 @@ void SchedulerProcess::run() {
 		_lastRun = currenthour;
 		_nextActor = 1;
 #if 0
-		pout << "Scheduler:  " << Kernel::get_instance()->getFrameNum()
-		     << Std::endl;
+		debugC(kDebugActor, "Scheduler: %u" , Kernel::get_instance()->getFrameNum());
 #endif
 	}
 }
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 12ef395bddc..55b17733861 100644
--- a/engines/ultima/ultima8/world/actors/u8_avatar_mover_process.cpp
+++ b/engines/ultima/ultima8/world/actors/u8_avatar_mover_process.cpp
@@ -133,7 +133,7 @@ void U8AvatarMoverProcess::handleCombatMode() {
 		if (lastanim == Animation::startBlock)
 			return;
 
-//		pout << "AvatarMover: combat block" << Std::endl;
+//		debugC(kDebugActor ,"AvatarMover: combat block");
 
 		if (checkTurn(mousedir, false))
 			return;
@@ -148,7 +148,7 @@ void U8AvatarMoverProcess::handleCombatMode() {
 
 		if (canAttack()) {
 			// double left click = attack
-//			pout << "AvatarMover: combat attack" << Std::endl;
+//			debugC(kDebugActor, "AvatarMover: combat attack");
 
 			if (checkTurn(mousedir, false))
 				return;
@@ -180,7 +180,7 @@ void U8AvatarMoverProcess::handleCombatMode() {
 
 		if (canAttack()) {
 			// double right click = kick
-//			pout << "AvatarMover: combat kick" << Std::endl;
+//			debug(MM_INFO, "AvatarMover: combat kick");
 
 			if (checkTurn(mousedir, false))
 				return;




More information about the Scummvm-git-logs mailing list