[Scummvm-cvs-logs] SF.net SVN: scummvm:[53868] scummvm/trunk/engines/agi

fingolfin at users.sourceforge.net fingolfin at users.sourceforge.net
Wed Oct 27 00:33:49 CEST 2010


Revision: 53868
          http://scummvm.svn.sourceforge.net/scummvm/?rev=53868&view=rev
Author:   fingolfin
Date:     2010-10-26 22:33:49 +0000 (Tue, 26 Oct 2010)

Log Message:
-----------
AGI: Replace report() macro by debug() / warning()

This makes AGI quite a bit less noisy by default.

Modified Paths:
--------------
    scummvm/trunk/engines/agi/agi.cpp
    scummvm/trunk/engines/agi/agi.h
    scummvm/trunk/engines/agi/console.cpp
    scummvm/trunk/engines/agi/cycle.cpp
    scummvm/trunk/engines/agi/id.cpp
    scummvm/trunk/engines/agi/keyboard.cpp
    scummvm/trunk/engines/agi/loader_v2.cpp
    scummvm/trunk/engines/agi/objects.cpp
    scummvm/trunk/engines/agi/op_cmd.cpp
    scummvm/trunk/engines/agi/op_dbg.cpp
    scummvm/trunk/engines/agi/sound_sarien.cpp
    scummvm/trunk/engines/agi/words.cpp

Modified: scummvm/trunk/engines/agi/agi.cpp
===================================================================
--- scummvm/trunk/engines/agi/agi.cpp	2010-10-26 22:30:39 UTC (rev 53867)
+++ scummvm/trunk/engines/agi/agi.cpp	2010-10-26 22:33:49 UTC (rev 53868)
@@ -360,12 +360,12 @@
 
 	switch (getVersion() >> 12) {
 	case 2:
-		report("Emulating Sierra AGI v%x.%03x\n",
+		debug("Emulating Sierra AGI v%x.%03x\n",
 				(int)(getVersion() >> 12) & 0xF,
 				(int)(getVersion()) & 0xFFF);
 		break;
 	case 3:
-		report("Emulating Sierra AGI v%x.002.%03x\n",
+		debug("Emulating Sierra AGI v%x.002.%03x\n",
 				(int)(getVersion() >> 12) & 0xF,
 				(int)(getVersion()) & 0xFFF);
 		break;
@@ -382,10 +382,10 @@
 		_game.sbuf = _game.sbuf256c;
 
 	if (_game.gameFlags & ID_AMIGA)
-		report("Amiga padded game detected.\n");
+		debug(1, "Amiga padded game detected.");
 
 	if (_game.gameFlags & ID_AGDS)
-		report("AGDS mode enabled.\n");
+		debug(1, "AGDS mode enabled.");
 
 	ec = _loader->init();	// load vol files, etc
 
@@ -655,7 +655,7 @@
 		_game.state = STATE_LOADED;
 		debugC(2, kDebugLevelMain, "game loaded");
 	} else {
-		report("Could not open AGI game");
+		warning("Could not open AGI game");
 	}
 
 	debugC(2, kDebugLevelMain, "Init sound");
@@ -703,7 +703,6 @@
 Common::Error AgiEngine::go() {
 	CursorMan.showMouse(true);
 
-	report(" \nAGI engine %s is ready.\n", gScummVMVersion);
 	if (_game.state < STATE_LOADED) {
 		do {
 			mainCycle();
@@ -747,7 +746,7 @@
 	for (int i = 0; i < numFeatures; i++) {
 		for (const Flags *flag = flags; flag->name; flag++) {
 			if (!scumm_stricmp(feature[i], flag->name)) {
-				debug(0, "Added feature: %s", flag->name);
+				debug(2, "Added feature: %s", flag->name);
 
 				setFeature(flag->flag);
 				break;

Modified: scummvm/trunk/engines/agi/agi.h
===================================================================
--- scummvm/trunk/engines/agi/agi.h	2010-10-26 22:30:39 UTC (rev 53867)
+++ scummvm/trunk/engines/agi/agi.h	2010-10-26 22:33:49 UTC (rev 53868)
@@ -236,8 +236,6 @@
 	kAgiMouseButtonMiddle // Middle mouse button
 };
 
-#define report printf
-
 enum GameId {
 	GID_AGI = 1
 };

Modified: scummvm/trunk/engines/agi/console.cpp
===================================================================
--- scummvm/trunk/engines/agi/console.cpp	2010-10-26 22:30:39 UTC (rev 53867)
+++ scummvm/trunk/engines/agi/console.cpp	2010-10-26 22:33:49 UTC (rev 53868)
@@ -152,7 +152,7 @@
 		for (j = 0; j < 10; j++, i++) {
 			DebugPrintf("%c ", _vm->getflag(i) ? 'T' : 'F');
 		}
-		report("\n");
+		DebugPrintf("\n");
 	}
 
 	return true;

Modified: scummvm/trunk/engines/agi/cycle.cpp
===================================================================
--- scummvm/trunk/engines/agi/cycle.cpp	2010-10-26 22:30:39 UTC (rev 53867)
+++ scummvm/trunk/engines/agi/cycle.cpp	2010-10-26 22:33:49 UTC (rev 53868)
@@ -319,12 +319,12 @@
 
 	// We run AGIMOUSE always as a side effect
 	if (getFeatures() & GF_AGIMOUSE || true)
-		report("Using AGI Mouse 1.0 protocol\n");
+		debug(1, "Using AGI Mouse 1.0 protocol");
 
 	if (getFeatures() & GF_AGIPAL)
 		debug(1, "Running AGIPAL game");
 
-	report("Running AGI script.\n");
+	debug(0, "Running AGI script.\n");
 
 	setflag(fEnteredCli, false);
 	setflag(fSaidAcceptedInput, false);

Modified: scummvm/trunk/engines/agi/id.cpp
===================================================================
--- scummvm/trunk/engines/agi/id.cpp	2010-10-26 22:30:39 UTC (rev 53867)
+++ scummvm/trunk/engines/agi/id.cpp	2010-10-26 22:33:49 UTC (rev 53868)
@@ -47,7 +47,7 @@
 	if (getFeatures() & GF_AGDS)
 		setVersion(ver = 0x2440);	// ALL AGDS games built for 2.440
 
-	report("Setting up for version 0x%04X\n", ver);
+	debug(0, "Setting up for version 0x%04X", ver);
 
 	// 'quit' takes 0 args for 2.089
 	if (ver == 0x2089)
@@ -70,7 +70,7 @@
 int AgiEngine::setupV3Game(int ver) {
 	int ec = errOK;
 
-	report("Setting up for version 0x%04X\n", ver);
+	debug(0, "Setting up for version 0x%04X", ver);
 
 	// 'unknown176' takes 1 arg for 3.002.086, not 0 args.
 	// 'unknown173' also takes 1 arg for 3.002.068, not 0 args.

Modified: scummvm/trunk/engines/agi/keyboard.cpp
===================================================================
--- scummvm/trunk/engines/agi/keyboard.cpp	2010-10-26 22:30:39 UTC (rev 53867)
+++ scummvm/trunk/engines/agi/keyboard.cpp	2010-10-26 22:33:49 UTC (rev 53868)
@@ -121,7 +121,6 @@
 		if (_game.controllers[i].keycode == key) {
 			debugC(3, kDebugLevelInput, "event %d: key press", _game.controllers[i].controller);
 			_game.controllerOccured[_game.controllers[i].controller] = true;
-			report("event AC:%i occurred\n", _game.controllers[i].controller);
 			return true;
 		}
 	}

Modified: scummvm/trunk/engines/agi/loader_v2.cpp
===================================================================
--- scummvm/trunk/engines/agi/loader_v2.cpp	2010-10-26 22:30:39 UTC (rev 53867)
+++ scummvm/trunk/engines/agi/loader_v2.cpp	2010-10-26 22:33:49 UTC (rev 53868)
@@ -43,7 +43,7 @@
 	uint32 flen;
 	uint i;
 
-	report("Loading directory: %s\n", fname);
+	debug(0, "Loading directory: %s", fname);
 
 	if (!fp.open(fname)) {
 		return errBadFileOpen;
@@ -157,7 +157,7 @@
 				exit(1);
 			}
 		} else {
-			report("Error: bad signature %04x\n", sig);
+			warning("AgiLoader_v2::loadVolRes: bad signature %04x", sig);
 			// fprintf (stderr, "ACK! BAD RESOURCE!!!\n");
 			return 0;
 		}

Modified: scummvm/trunk/engines/agi/objects.cpp
===================================================================
--- scummvm/trunk/engines/agi/objects.cpp	2010-10-26 22:30:39 UTC (rev 53867)
+++ scummvm/trunk/engines/agi/objects.cpp	2010-10-26 22:33:49 UTC (rev 53868)
@@ -46,9 +46,9 @@
 	// if so, its encrypted, else it is not
 
 	if (READ_LE_UINT16(mem) > flen) {
-		report("Decrypting objects... ");
+		debugN(0, "Decrypting objects... ");
 		decrypt(mem, flen);
-		report("done.\n");
+		debug(0, "done.");
 	}
 
 	// alloc memory for object list
@@ -79,7 +79,7 @@
 			(_objects + i)->name = strdup("");
 		}
 	}
-	report("Reading objects: %d objects read.\n", _game.numObjects);
+	debug(0, "Reading objects: %d objects read.", _game.numObjects);
 
 	return errOK;
 }
@@ -92,8 +92,7 @@
 	_objects = NULL;
 	_game.numObjects = 0;
 
-	debugC(5, kDebugLevelResources, "(fname = %s)", fname);
-	report("Loading objects: %s\n", fname);
+	debugC(5, kDebugLevelResources, "(Loading objects '%s')", fname);
 
 	if (!fp.open(fname))
 		return errBadFileOpen;
@@ -130,7 +129,7 @@
 
 void AgiEngine::objectSetLocation(unsigned int n, int i) {
 	if (n >= _game.numObjects) {
-		report("Error: Can't access object %d.\n", n);
+		warning("AgiEngine::objectSetLocation: Can't access object %d.\n", n);
 		return;
 	}
 	_objects[n].location = i;
@@ -138,7 +137,7 @@
 
 int AgiEngine::objectGetLocation(unsigned int n) {
 	if (n >= _game.numObjects) {
-		report("Error: Can't access object %d.\n", n);
+		warning("AgiEngine::objectGetLocation: Can't access object %d.\n", n);
 		return 0;
 	}
 	return _objects[n].location;
@@ -146,7 +145,7 @@
 
 const char *AgiEngine::objectName(unsigned int n) {
 	if (n >= _game.numObjects) {
-		report("Error: Can't access object %d.\n", n);
+		warning("AgiEngine::objectName: Can't access object %d.\n", n);
 		return "";
 	}
 	return _objects[n].name;

Modified: scummvm/trunk/engines/agi/op_cmd.cpp
===================================================================
--- scummvm/trunk/engines/agi/op_cmd.cpp	2010-10-26 22:30:39 UTC (rev 53867)
+++ scummvm/trunk/engines/agi/op_cmd.cpp	2010-10-26 22:33:49 UTC (rev 53868)
@@ -492,7 +492,7 @@
 }
 
 void AgiEngine::cmd_script_size(uint8 *p) {
-	report("script.size(%d)\n", p0);
+	debug(0, "script.size(%d)", p0);
 }
 
 void AgiEngine::cmd_cancel_line(uint8 *p) {
@@ -609,7 +609,7 @@
 
 void AgiEngine::cmd_pop_script(uint8 *p) {
 	if (getVersion() >= 0x2915) {
-		report("pop.script\n");
+		debug(0, "pop.script");
 	}
 }
 
@@ -621,7 +621,7 @@
 
 void AgiEngine::cmd_discard_sound(uint8 *p) {
 	if (getVersion() >= 0x2936) {
-		report("discard.sound\n");
+		debug(0, "discard.sound");
 	}
 }
 
@@ -1101,7 +1101,7 @@
 	else
 		_game.id[0] = 0;
 
-	report("Game ID: \"%s\"\n", _game.id);
+	debug(0, "Game ID: \"%s\"", _game.id);
 }
 
 void AgiEngine::cmd_pause(uint8 *p) {
@@ -1453,7 +1453,7 @@
 }
 
 void AgiEngine::cmd_toggle_monitor(uint8 *p) {
-	report("toggle.monitor\n");
+	debug(0, "toggle.monitor");
 }
 
 void AgiEngine::cmd_echo_line(uint8 *p) {
@@ -1510,7 +1510,7 @@
 		_game.vars[29] = _mouse.y;
 	} else {
 		if (getVersion() >= 0x2915) {
-			report("push.script\n");
+			debug(0, "push.script");
 		}
 	}
 }
@@ -1518,7 +1518,7 @@
 void AgiEngine::cmd_set_pri_base(uint8 *p) {
 	int i, x, pri;
 
-	report("Priority base set to %d\n", p0);
+	debug(0, "Priority base set to %d", p0);
 
 	// _game.alt_pri = true;
 	x = (_HEIGHT - p0) * _HEIGHT / 10;

Modified: scummvm/trunk/engines/agi/op_dbg.cpp
===================================================================
--- scummvm/trunk/engines/agi/op_dbg.cpp	2010-10-26 22:30:39 UTC (rev 53867)
+++ scummvm/trunk/engines/agi/op_dbg.cpp	2010-10-26 22:33:49 UTC (rev 53868)
@@ -275,11 +275,11 @@
 	uint8 a, c, z;
 
 	if (str) {
-		report("         %s\n", str);
+		debug(0, "         %s", str);
 		return;
 	}
 
-	report("%03d:%04x ", lognum, ip);
+	debugN(0, "%03d:%04x ", lognum, ip);
 
 	switch (*(code + ip)) {
 	case 0xFC:
@@ -289,7 +289,7 @@
 		x = logicNamesIf;
 
 		if (_debug.opcodes) {
-			report("%02X %02X %02X %02X %02X %02X %02X %02X %02X\n"
+			debugN(0, "%02X %02X %02X %02X %02X %02X %02X %02X %02X\n"
 			    "         ",
 			    (uint8)*(code + (0 + ip)) & 0xFF,
 			    (uint8)*(code + (1 + ip)) & 0xFF,
@@ -301,7 +301,7 @@
 			    (uint8)*(code + (7 + ip)) & 0xFF,
 			    (uint8)*(code + (8 + ip)) & 0xFF);
 		}
-		report("%s ", (x + *(code + ip) - 0xFC)->name);
+		debugN(0, "%s ", (x + *(code + ip) - 0xFC)->name);
 		break;
 	default:
 		x = mode == lCOMMAND_MODE ? logicNamesCmd : logicNamesTest;
@@ -309,7 +309,7 @@
 		c = (unsigned char)(x + *(code + ip))->argMask;
 
 		if (_debug.opcodes) {
-			report("%02X %02X %02X %02X %02X %02X %02X %02X %02X\n"
+			debugN(0, "%02X %02X %02X %02X %02X %02X %02X %02X %02X\n"
 			    "         ",
 			    (uint8)*(code + (0 + ip)) & 0xFF,
 			    (uint8)*(code + (1 + ip)) & 0xFF,
@@ -321,23 +321,23 @@
 			    (uint8)*(code + (7 + ip)) & 0xFF,
 			    (uint8)*(code + (8 + ip)) & 0xFF);
 		}
-		report("%s ", (x + *(code + ip))->name);
+		debugN(0, "%s ", (x + *(code + ip))->name);
 
 		for (z = 1; a > 0;) {
 			if (~c & 0x80) {
-				report("%d", *(code + (ip + z)));
+				debugN(0, "%d", *(code + (ip + z)));
 			} else {
-				report("v%d[%d]", *(code + (ip + z)), getvar(*(code + (ip + z))));
+				debugN(0, "v%d[%d]", *(code + (ip + z)), getvar(*(code + (ip + z))));
 			}
 			c <<= 1;
 			z++;
 			if (--a > 0)
-				report(",");
+				debugN(0, ",");
 		}
 		break;
 	}
 
-	report("\n");
+	debugN(0, "\n");
 }
 
 } // End of namespace Agi

Modified: scummvm/trunk/engines/agi/sound_sarien.cpp
===================================================================
--- scummvm/trunk/engines/agi/sound_sarien.cpp	2010-10-26 22:30:39 UTC (rev 53867)
+++ scummvm/trunk/engines/agi/sound_sarien.cpp	2010-10-26 22:33:49 UTC (rev 53868)
@@ -95,13 +95,10 @@
 		break;
 	}
 
-	report("Initializing sound:\n");
-
-	report("sound: envelopes ");
 	if (_env) {
-		report("enabled (decay=%d, sustain=%d)\n", ENV_DECAY, ENV_SUSTAIN);
+		debug(0, "Initializing sound: envelopes enabled (decay=%d, sustain=%d)", ENV_DECAY, ENV_SUSTAIN);
 	} else {
-		report("disabled\n");
+		debug(0, "Initializing sound: envelopes disabled");
 	}
 
 	_mixer->playStream(Audio::Mixer::kMusicSoundType, &_soundHandle, this, -1, Audio::Mixer::kMaxChannelVolume, 0, DisposeAfterUse::NO, true);

Modified: scummvm/trunk/engines/agi/words.cpp
===================================================================
--- scummvm/trunk/engines/agi/words.cpp	2010-10-26 22:30:39 UTC (rev 53867)
+++ scummvm/trunk/engines/agi/words.cpp	2010-10-26 22:33:49 UTC (rev 53868)
@@ -52,10 +52,10 @@
 	words = NULL;
 
 	if (!fp.open(fname)) {
-		report("Warning: can't open %s\n", fname);
+		warning("loadWords: can't open %s", fname);
 		return errOK; // err_BadFileOpen
 	}
-	report("Loading dictionary: %s\n", fname);
+	debug(0, "Loading dictionary: %s", fname);
 
 	fp.seek(0, SEEK_END);
 	flen = fp.pos();


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