diff options
author | Max Horn | 2010-10-26 22:33:49 +0000 |
---|---|---|
committer | Max Horn | 2010-10-26 22:33:49 +0000 |
commit | 7c2323bdc3163dae4f03dfc033ad7e47fb20ccda (patch) | |
tree | 0bd8440076b6a1482bf95ee975c5ab73ec2d8346 | |
parent | 4e2d1b507a395c6dc618af38711e30bd89a91b00 (diff) | |
download | scummvm-rg350-7c2323bdc3163dae4f03dfc033ad7e47fb20ccda.tar.gz scummvm-rg350-7c2323bdc3163dae4f03dfc033ad7e47fb20ccda.tar.bz2 scummvm-rg350-7c2323bdc3163dae4f03dfc033ad7e47fb20ccda.zip |
AGI: Replace report() macro by debug() / warning()
This makes AGI quite a bit less noisy by default.
svn-id: r53868
-rw-r--r-- | engines/agi/agi.cpp | 13 | ||||
-rw-r--r-- | engines/agi/agi.h | 2 | ||||
-rw-r--r-- | engines/agi/console.cpp | 2 | ||||
-rw-r--r-- | engines/agi/cycle.cpp | 4 | ||||
-rw-r--r-- | engines/agi/id.cpp | 4 | ||||
-rw-r--r-- | engines/agi/keyboard.cpp | 1 | ||||
-rw-r--r-- | engines/agi/loader_v2.cpp | 4 | ||||
-rw-r--r-- | engines/agi/objects.cpp | 15 | ||||
-rw-r--r-- | engines/agi/op_cmd.cpp | 14 | ||||
-rw-r--r-- | engines/agi/op_dbg.cpp | 20 | ||||
-rw-r--r-- | engines/agi/sound_sarien.cpp | 7 | ||||
-rw-r--r-- | engines/agi/words.cpp | 4 |
12 files changed, 41 insertions, 49 deletions
diff --git a/engines/agi/agi.cpp b/engines/agi/agi.cpp index 0646f321d4..2cf6d2613f 100644 --- a/engines/agi/agi.cpp +++ b/engines/agi/agi.cpp @@ -360,12 +360,12 @@ int AgiEngine::agiInit() { 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 @@ int AgiEngine::agiInit() { _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 @@ void AgiEngine::initialize() { _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 AgiBase::init() { 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 @@ void AgiEngine::parseFeatures() { 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; diff --git a/engines/agi/agi.h b/engines/agi/agi.h index bc9a6810a2..8ff7f6c35e 100644 --- a/engines/agi/agi.h +++ b/engines/agi/agi.h @@ -236,8 +236,6 @@ enum AgiMouseButton { kAgiMouseButtonMiddle // Middle mouse button }; -#define report printf - enum GameId { GID_AGI = 1 }; diff --git a/engines/agi/console.cpp b/engines/agi/console.cpp index e5942455e2..370f48e018 100644 --- a/engines/agi/console.cpp +++ b/engines/agi/console.cpp @@ -152,7 +152,7 @@ bool Console::Cmd_Flags(int argc, const char **argv) { for (j = 0; j < 10; j++, i++) { DebugPrintf("%c ", _vm->getflag(i) ? 'T' : 'F'); } - report("\n"); + DebugPrintf("\n"); } return true; diff --git a/engines/agi/cycle.cpp b/engines/agi/cycle.cpp index 57bcabb188..86c1b519a9 100644 --- a/engines/agi/cycle.cpp +++ b/engines/agi/cycle.cpp @@ -319,12 +319,12 @@ int AgiEngine::playGame() { // 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); diff --git a/engines/agi/id.cpp b/engines/agi/id.cpp index 77c527444b..2e12e45458 100644 --- a/engines/agi/id.cpp +++ b/engines/agi/id.cpp @@ -47,7 +47,7 @@ int AgiEngine::setupV2Game(int ver) { 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::setupV2Game(int ver) { 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. diff --git a/engines/agi/keyboard.cpp b/engines/agi/keyboard.cpp index 62bcd5d8d8..344654128d 100644 --- a/engines/agi/keyboard.cpp +++ b/engines/agi/keyboard.cpp @@ -121,7 +121,6 @@ int AgiEngine::handleController(int key) { 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; } } diff --git a/engines/agi/loader_v2.cpp b/engines/agi/loader_v2.cpp index de6f8d0653..54b40d66b2 100644 --- a/engines/agi/loader_v2.cpp +++ b/engines/agi/loader_v2.cpp @@ -43,7 +43,7 @@ int AgiLoader_v2::loadDir(AgiDir *agid, const char *fname) { 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 @@ uint8 *AgiLoader_v2::loadVolRes(struct AgiDir *agid) { 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; } diff --git a/engines/agi/objects.cpp b/engines/agi/objects.cpp index 5d1866bea4..8de36f24e1 100644 --- a/engines/agi/objects.cpp +++ b/engines/agi/objects.cpp @@ -46,9 +46,9 @@ int AgiEngine::decodeObjects(uint8 *mem, uint32 flen) { // 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 @@ int AgiEngine::decodeObjects(uint8 *mem, uint32 flen) { (_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 @@ int AgiEngine::loadObjects(const char *fname) { _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::unloadObjects() { 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 @@ void AgiEngine::objectSetLocation(unsigned int n, int i) { 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 @@ int AgiEngine::objectGetLocation(unsigned int n) { 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; diff --git a/engines/agi/op_cmd.cpp b/engines/agi/op_cmd.cpp index 1627f03863..2ea53e57ad 100644 --- a/engines/agi/op_cmd.cpp +++ b/engines/agi/op_cmd.cpp @@ -492,7 +492,7 @@ void AgiEngine::cmd_init_joy(uint8 *p) { // do nothing } 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_set_simple(uint8 *p) { 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_hold_key(uint8 *p) { void AgiEngine::cmd_discard_sound(uint8 *p) { if (getVersion() >= 0x2936) { - report("discard.sound\n"); + debug(0, "discard.sound"); } } @@ -1101,7 +1101,7 @@ void AgiEngine::cmd_set_game_id(uint8 *p) { 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_clear_text_rect(uint8 *p) { } 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 @@ void AgiEngine::cmd_push_script(uint8 *p) { _game.vars[29] = _mouse.y; } else { if (getVersion() >= 0x2915) { - report("push.script\n"); + debug(0, "push.script"); } } } @@ -1518,7 +1518,7 @@ void AgiEngine::cmd_push_script(uint8 *p) { 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; diff --git a/engines/agi/op_dbg.cpp b/engines/agi/op_dbg.cpp index be10f6ee75..f3b4815790 100644 --- a/engines/agi/op_dbg.cpp +++ b/engines/agi/op_dbg.cpp @@ -275,11 +275,11 @@ void AgiEngine::debugConsole(int lognum, int mode, const char *str) { 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 @@ void AgiEngine::debugConsole(int lognum, int mode, const char *str) { 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 @@ void AgiEngine::debugConsole(int lognum, int mode, const char *str) { (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 @@ void AgiEngine::debugConsole(int lognum, int mode, const char *str) { 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 @@ void AgiEngine::debugConsole(int lognum, int mode, const char *str) { (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 diff --git a/engines/agi/sound_sarien.cpp b/engines/agi/sound_sarien.cpp index 08bdd47497..4ede50a749 100644 --- a/engines/agi/sound_sarien.cpp +++ b/engines/agi/sound_sarien.cpp @@ -95,13 +95,10 @@ SoundGenSarien::SoundGenSarien(AgiEngine *vm, Audio::Mixer *pMixer) : SoundGen(v 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); diff --git a/engines/agi/words.cpp b/engines/agi/words.cpp index 464c218ae8..c48ed90ad8 100644 --- a/engines/agi/words.cpp +++ b/engines/agi/words.cpp @@ -52,10 +52,10 @@ int AgiEngine::loadWords(const char *fname) { 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(); |