diff options
author | Max Horn | 2010-11-01 21:37:47 +0000 |
---|---|---|
committer | Max Horn | 2010-11-01 21:37:47 +0000 |
commit | a7248a0601a5b8e34fa9cccc3543e93fa9ab6649 (patch) | |
tree | b2e3e2b6e15de28bd203a7ab8e3024928ae592ce /engines/agos | |
parent | cba30ee716a3679d86656d6f1aade3e33d3130d7 (diff) | |
download | scummvm-rg350-a7248a0601a5b8e34fa9cccc3543e93fa9ab6649.tar.gz scummvm-rg350-a7248a0601a5b8e34fa9cccc3543e93fa9ab6649.tar.bz2 scummvm-rg350-a7248a0601a5b8e34fa9cccc3543e93fa9ab6649.zip |
ENGINES: Replace many printfs by warning/debug/debugN
svn-id: r54031
Diffstat (limited to 'engines/agos')
-rw-r--r-- | engines/agos/debug.cpp | 72 | ||||
-rw-r--r-- | engines/agos/midi.cpp | 8 | ||||
-rw-r--r-- | engines/agos/subroutine.cpp | 2 | ||||
-rw-r--r-- | engines/agos/vga.cpp | 4 | ||||
-rw-r--r-- | engines/agos/vga_ff.cpp | 4 |
5 files changed, 45 insertions, 45 deletions
diff --git a/engines/agos/debug.cpp b/engines/agos/debug.cpp index 519dfc344c..cb11d65218 100644 --- a/engines/agos/debug.cpp +++ b/engines/agos/debug.cpp @@ -76,30 +76,30 @@ const byte *AGOSEngine::dumpOpcode(const byte *p) { while (*st != '|') st++; - printf("%s ", st + 1); + debugN("%s ", st + 1); for (;;) { switch (*s++) { case 'x': - printf("\n"); + debugN("\n"); return NULL; case '|': - printf("\n"); + debugN("\n"); return p; case 'B':{ byte b = *p++; if (b == 255) - printf("[%d] ", *p++); + debugN("[%d] ", *p++); else - printf("%d ", b); + debugN("%d ", b); break; } case 'V':{ byte b = *p++; if (b == 255) - printf("[[%d]] ", *p++); + debugN("[[%d]] ", *p++); else - printf("[%d] ", b); + debugN("[%d] ", b); break; } @@ -108,15 +108,15 @@ const byte *AGOSEngine::dumpOpcode(const byte *p) { p += 2; if (getGameType() == GType_PP) { if (n >= 60000 && n < 62048) - printf("[%d] ", n - 60000); + debugN("[%d] ", n - 60000); else - printf("%d ", n); + debugN("%d ", n); } else { if (n >= 30000 && n < 30512) - printf("[%d] ", n - 30000); + debugN("[%d] ", n - 30000); else - printf("%d ", n); + debugN("%d ", n); } break; } @@ -124,7 +124,7 @@ const byte *AGOSEngine::dumpOpcode(const byte *p) { case 'w':{ int n = (int16)READ_BE_UINT16(p); p += 2; - printf("%d ", n); + debugN("%d ", n); break; } @@ -132,22 +132,22 @@ const byte *AGOSEngine::dumpOpcode(const byte *p) { int n = (int16)READ_BE_UINT16(p); p += 2; if (n == -1) - printf("SUBJECT_ITEM "); + debugN("SUBJECT_ITEM "); else if (n == -3) - printf("OBJECT_ITEM "); + debugN("OBJECT_ITEM "); else if (n == -5) - printf("ME_ITEM "); + debugN("ME_ITEM "); else if (n == -7) - printf("ACTOR_ITEM "); + debugN("ACTOR_ITEM "); else if (n == -9) - printf("ITEM_A_PARENT "); + debugN("ITEM_A_PARENT "); else - printf("<%d> ", n); + debugN("<%d> ", n); break; } case 'J':{ - printf("-> "); + debugN("-> "); } break; @@ -155,9 +155,9 @@ const byte *AGOSEngine::dumpOpcode(const byte *p) { uint n = READ_BE_UINT16(p); p += 2; if (n != 0xFFFF) - printf("\"%s\"(%d) ", getStringPtrByID(n), n); + debugN("\"%s\"(%d) ", getStringPtrByID(n), n); else - printf("NULL_STRING "); + debugN("NULL_STRING "); } break; } @@ -167,11 +167,11 @@ const byte *AGOSEngine::dumpOpcode(const byte *p) { void AGOSEngine::dumpSubroutineLine(SubroutineLine *sl, Subroutine *sub) { const byte *p; - printf("; ****\n"); + debugN("; ****\n"); p = (byte *)sl + SUBROUTINE_LINE_SMALL_SIZE; if (sub->id == 0) { - printf("; verb=%d, noun1=%d, noun2=%d\n", sl->verb, sl->noun1, sl->noun2); + debugN("; verb=%d, noun1=%d, noun2=%d\n", sl->verb, sl->noun1, sl->noun2); p = (byte *)sl + SUBROUTINE_LINE_BIG_SIZE; } @@ -185,12 +185,12 @@ void AGOSEngine::dumpSubroutineLine(SubroutineLine *sl, Subroutine *sub) { void AGOSEngine::dumpSubroutine(Subroutine *sub) { SubroutineLine *sl; - printf("\n******************************************\n;Subroutine, ID=%d:\nSUB_%d:\n", sub->id, sub->id); + debugN("\n******************************************\n;Subroutine, ID=%d:\nSUB_%d:\n", sub->id, sub->id); sl = (SubroutineLine *)((byte *)sub + sub->first); for (; (byte *)sl != (byte *)sub; sl = (SubroutineLine *)((byte *)sub + sl->next)) { dumpSubroutineLine(sl, sub); } - printf("\nEND ******************************************\n"); + debugN("\nEND ******************************************\n"); } void AGOSEngine::dumpSubroutines() { @@ -245,35 +245,35 @@ void AGOSEngine::dumpVideoScript(const byte *src, bool singeOpcode) { while (*strn != '|') strn++; - printf("%.2d: %s ", opcode, strn + 1); + debugN("%.2d: %s ", opcode, strn + 1); int end = (getGameType() == GType_FF || getGameType() == GType_PP) ? 9999 : 999; for (; *str != '|'; str++) { switch (*str) { case 'x': - printf("\n"); + debugN("\n"); return; case 'b': - printf("%d ", *src++); + debugN("%d ", *src++); break; case 'd': - printf("%d ", (int16)readUint16Wrapper(src)); + debugN("%d ", (int16)readUint16Wrapper(src)); src += 2; break; case 'v': - printf("[%d] ", readUint16Wrapper(src)); + debugN("[%d] ", readUint16Wrapper(src)); src += 2; break; case 'i': - printf("%d ", (int16)readUint16Wrapper(src)); + debugN("%d ", (int16)readUint16Wrapper(src)); src += 2; break; case 'j': - printf("-> "); + debugN("-> "); break; case 'q': while (readUint16Wrapper(src) != end) { - printf("(%d,%d) ", readUint16Wrapper(src), + debugN("(%d,%d) ", readUint16Wrapper(src), readUint16Wrapper(src + 2)); src += 4; } @@ -284,7 +284,7 @@ void AGOSEngine::dumpVideoScript(const byte *src, bool singeOpcode) { } } - printf("\n"); + debugN("\n"); } while (!singeOpcode); } @@ -293,10 +293,10 @@ void AGOSEngine::dumpVgaScript(const byte *ptr, uint16 res, uint16 id) { } void AGOSEngine::dumpVgaScriptAlways(const byte *ptr, uint16 res, uint16 id) { - printf("; address=%x, vgafile=%d vgasprite=%d\n", + debugN("; address=%x, vgafile=%d vgasprite=%d\n", (unsigned int)(ptr - _vgaBufferPointers[res].vgaFile1), res, id); dumpVideoScript(ptr, false); - printf("; end\n"); + debugN("; end\n"); } void AGOSEngine::dumpAllVgaImageFiles() { diff --git a/engines/agos/midi.cpp b/engines/agos/midi.cpp index 858307685c..fe2d1cd25b 100644 --- a/engines/agos/midi.cpp +++ b/engines/agos/midi.cpp @@ -226,7 +226,7 @@ void MidiPlayer::startTrack(int track) { parser->setMidiDriver(this); parser->setTimerRate(_driver->getBaseTempo()); if (!parser->loadMusic(_music.songs[track], _music.song_sizes[track])) { - printf ("Error reading track!\n"); + warning("Error reading track %d", track); delete parser; parser = 0; } @@ -455,7 +455,7 @@ void MidiPlayer::loadSMF(Common::File *in, int song, bool sfx) { parser->setMidiDriver(this); parser->setTimerRate(timerRate); if (!parser->loadMusic(p->data, size)) { - printf("Error reading track!\n"); + warning("Error reading track"); delete parser; parser = 0; } @@ -484,7 +484,7 @@ void MidiPlayer::loadMultipleSMF(Common::File *in, bool sfx) { p->num_songs = in->readByte(); if (p->num_songs > 16) { - printf ("playMultipleSMF: %d is too many songs to keep track of!\n", (int)p->num_songs); + warning("playMultipleSMF: %d is too many songs to keep track of", (int)p->num_songs); return; } @@ -496,7 +496,7 @@ void MidiPlayer::loadMultipleSMF(Common::File *in, bool sfx) { // Make sure there's a MThd in->read(buf, 4); if (memcmp(buf, "MThd", 4)) { - printf("Expected MThd but found '%c%c%c%c' instead!\n", buf[0], buf[1], buf[2], buf[3]); + warning("Expected MThd but found '%c%c%c%c' instead", buf[0], buf[1], buf[2], buf[3]); return; } in->seek(in->readUint32BE(), SEEK_CUR); diff --git a/engines/agos/subroutine.cpp b/engines/agos/subroutine.cpp index 076e562a76..733d40e52d 100644 --- a/engines/agos/subroutine.cpp +++ b/engines/agos/subroutine.cpp @@ -570,7 +570,7 @@ restart: _codePtr += 8; if (_dumpOpcodes) - printf("; %d\n", sub->id); + debug("; %d", sub->id); result = runScript(); if (result != 0) { break; diff --git a/engines/agos/vga.cpp b/engines/agos/vga.cpp index dd2df79c07..8b8b16c9bb 100644 --- a/engines/agos/vga.cpp +++ b/engines/agos/vga.cpp @@ -155,7 +155,7 @@ void AGOSEngine::runVgaScript() { if (_dumpVgaOpcodes) { if (_vcPtr != (const byte *)&_vcGetOutOfCode) { - printf("%.5d %.5X: %5d %4d ", _vgaTickCounter, (unsigned int)(_vcPtr - _curVgaFile1), _vgaCurSpriteId, _vgaCurZoneNum); + debugN("%.5d %.5X: %5d %4d ", _vgaTickCounter, (unsigned int)(_vcPtr - _curVgaFile1), _vgaCurSpriteId, _vgaCurZoneNum); dumpVideoScript(_vcPtr, true); } } @@ -383,7 +383,7 @@ void AGOSEngine::vcSkipNextInstruction() { } if (_dumpVgaOpcodes) - printf("; skipped\n"); + debugN("; skipped\n"); } // VGA Script commands diff --git a/engines/agos/vga_ff.cpp b/engines/agos/vga_ff.cpp index 0a6458ac11..38a3479292 100644 --- a/engines/agos/vga_ff.cpp +++ b/engines/agos/vga_ff.cpp @@ -405,9 +405,9 @@ void AGOSEngine_PuzzlePack::vc63_fastFadeIn() { if (getBitFlag(100)) { startOverlayAnims(); } else if (getBitFlag(103)) { - printf("NameAndTime\n"); + debug("vc63_fastFadeIn: NameAndTime"); } else if (getBitFlag(104)) { - printf("HiScoreTable\n"); + debug("vc63_fastFadeIn: HiScoreTable"); } } |