diff options
author | D G Turner | 2014-06-05 03:01:12 +0100 |
---|---|---|
committer | D G Turner | 2014-06-05 03:01:12 +0100 |
commit | d8751516ccd4c695696985b330b0ac65475f5170 (patch) | |
tree | 7c76e009ec58d90ffcebae1ea5e0ab95d2d1db2e | |
parent | 1e6fe10e3d5febb178cc7f009295a386da579066 (diff) | |
download | scummvm-rg350-d8751516ccd4c695696985b330b0ac65475f5170.tar.gz scummvm-rg350-d8751516ccd4c695696985b330b0ac65475f5170.tar.bz2 scummvm-rg350-d8751516ccd4c695696985b330b0ac65475f5170.zip |
GROOVIE: Remove engine-specific "all" debugflag. Minor naming cleanup.
This is now uneeded as the GUI debugger superclass implements the same
functionality and this removes a bunch of complexity from the Groovie
engine debug calls. Also, removed groovie prefix from the debug flag
naming as unecessary as these are within the Groovie namespace.
-rw-r--r-- | engines/groovie/cursor.cpp | 18 | ||||
-rw-r--r-- | engines/groovie/groovie.cpp | 21 | ||||
-rw-r--r-- | engines/groovie/groovie.h | 24 | ||||
-rw-r--r-- | engines/groovie/music.cpp | 38 | ||||
-rw-r--r-- | engines/groovie/player.cpp | 6 | ||||
-rw-r--r-- | engines/groovie/resource.cpp | 10 | ||||
-rw-r--r-- | engines/groovie/roq.cpp | 26 | ||||
-rw-r--r-- | engines/groovie/script.cpp | 19 | ||||
-rw-r--r-- | engines/groovie/vdx.cpp | 37 |
9 files changed, 98 insertions, 101 deletions
diff --git a/engines/groovie/cursor.cpp b/engines/groovie/cursor.cpp index 65f3e108b8..442f0bfada 100644 --- a/engines/groovie/cursor.cpp +++ b/engines/groovie/cursor.cpp @@ -107,8 +107,8 @@ Cursor_t7g::Cursor_t7g(uint8 *img, uint8 *pal) : _img = img + 5; - debugC(1, kGroovieDebugCursor | kGroovieDebugAll, "Groovie::Cursor: width: %d, height: %d, frames:%d", _width, _height, _numFrames); - debugC(1, kGroovieDebugCursor | kGroovieDebugUnknown | kGroovieDebugAll, "Groovie::Cursor: elinor: 0x%02X (%d), 0x%02X (%d)", elinor1, elinor1, elinor2, elinor2); + debugC(1, kDebugCursor, "Groovie::Cursor: width: %d, height: %d, frames:%d", _width, _height, _numFrames); + debugC(1, kDebugCursor | kDebugUnknown, "Groovie::Cursor: elinor: 0x%02X (%d), 0x%02X (%d)", elinor1, elinor1, elinor2, elinor2); } void Cursor_t7g::enable() { @@ -262,26 +262,26 @@ Cursor_v2::Cursor_v2(Common::File &file) { _img = new byte[_width * _height * _numFrames * 4]; - debugC(1, kGroovieDebugCursor | kGroovieDebugAll, "Groovie::Cursor: width: %d, height: %d, frames:%d", _width, _height, _numFrames); + debugC(1, kDebugCursor, "Groovie::Cursor: width: %d, height: %d, frames:%d", _width, _height, _numFrames); uint16 tmp16 = file.readUint16LE(); - debugC(5, kGroovieDebugCursor | kGroovieDebugAll, "hotspot x?: %d\n", tmp16); + debugC(5, kDebugCursor, "hotspot x?: %d\n", tmp16); tmp16 = file.readUint16LE(); - debugC(5, kGroovieDebugCursor | kGroovieDebugAll, "hotspot y?: %d\n", tmp16); + debugC(5, kDebugCursor, "hotspot y?: %d\n", tmp16); int loop2count = file.readUint16LE(); - debugC(5, kGroovieDebugCursor | kGroovieDebugAll, "loop2count?: %d\n", loop2count); + debugC(5, kDebugCursor, "loop2count?: %d\n", loop2count); for (int l = 0; l < loop2count; l++) { tmp16 = file.readUint16LE(); - debugC(5, kGroovieDebugCursor | kGroovieDebugAll, "loop2a: %d\n", tmp16); // Index frame can merge to/from? + debugC(5, kDebugCursor, "loop2a: %d\n", tmp16); // Index frame can merge to/from? tmp16 = file.readUint16LE(); - debugC(5, kGroovieDebugCursor | kGroovieDebugAll, "loop2b: %d\n", tmp16); // Number of frames? + debugC(5, kDebugCursor, "loop2b: %d\n", tmp16); // Number of frames? } file.read(pal, 0x20 * 3); for (int f = 0; f < _numFrames; f++) { uint32 tmp32 = file.readUint32LE(); - debugC(5, kGroovieDebugCursor | kGroovieDebugAll, "loop3: %d\n", tmp32); + debugC(5, kDebugCursor, "loop3: %d\n", tmp32); byte *data = new byte[tmp32]; file.read(data, tmp32); diff --git a/engines/groovie/groovie.cpp b/engines/groovie/groovie.cpp index 427b1c866a..b42cf09245 100644 --- a/engines/groovie/groovie.cpp +++ b/engines/groovie/groovie.cpp @@ -68,17 +68,16 @@ GroovieEngine::GroovieEngine(OSystem *syst, const GroovieGameDescription *gd) : _modeSpeed = kGroovieSpeedFast; // Initialize the custom debug levels - DebugMan.addDebugChannel(kGroovieDebugAll, "All", "Debug everything"); - DebugMan.addDebugChannel(kGroovieDebugVideo, "Video", "Debug video and audio playback"); - DebugMan.addDebugChannel(kGroovieDebugResource, "Resource", "Debug resouce management"); - DebugMan.addDebugChannel(kGroovieDebugScript, "Script", "Debug the scripts"); - DebugMan.addDebugChannel(kGroovieDebugUnknown, "Unknown", "Report values of unknown data in files"); - DebugMan.addDebugChannel(kGroovieDebugHotspots, "Hotspots", "Show the hotspots"); - DebugMan.addDebugChannel(kGroovieDebugCursor, "Cursor", "Debug cursor decompression / switching"); - DebugMan.addDebugChannel(kGroovieDebugMIDI, "MIDI", "Debug MIDI / XMIDI files"); - DebugMan.addDebugChannel(kGroovieDebugScriptvars, "Scriptvars", "Print out any change to script variables"); - DebugMan.addDebugChannel(kGroovieDebugCell, "Cell", "Debug the cell game (in the microscope)"); - DebugMan.addDebugChannel(kGroovieDebugFast, "Fast", "Play videos quickly, with no sound (unstable)"); + DebugMan.addDebugChannel(kDebugVideo, "Video", "Debug video and audio playback"); + DebugMan.addDebugChannel(kDebugResource, "Resource", "Debug resouce management"); + DebugMan.addDebugChannel(kDebugScript, "Script", "Debug the scripts"); + DebugMan.addDebugChannel(kDebugUnknown, "Unknown", "Report values of unknown data in files"); + DebugMan.addDebugChannel(kDebugHotspots, "Hotspots", "Show the hotspots"); + DebugMan.addDebugChannel(kDebugCursor, "Cursor", "Debug cursor decompression / switching"); + DebugMan.addDebugChannel(kDebugMIDI, "MIDI", "Debug MIDI / XMIDI files"); + DebugMan.addDebugChannel(kDebugScriptvars, "Scriptvars", "Print out any change to script variables"); + DebugMan.addDebugChannel(kDebugCell, "Cell", "Debug the cell game (in the microscope)"); + DebugMan.addDebugChannel(kDebugFast, "Fast", "Play videos quickly, with no sound (unstable)"); } GroovieEngine::~GroovieEngine() { diff --git a/engines/groovie/groovie.h b/engines/groovie/groovie.h index 9fe6b0c2f5..d442d39cb2 100644 --- a/engines/groovie/groovie.h +++ b/engines/groovie/groovie.h @@ -58,18 +58,18 @@ class Script; class VideoPlayer; enum DebugLevels { - kGroovieDebugAll = 1 << 0, - kGroovieDebugVideo = 1 << 1, - kGroovieDebugResource = 1 << 2, - kGroovieDebugScript = 1 << 3, - kGroovieDebugUnknown = 1 << 4, - kGroovieDebugHotspots = 1 << 5, - kGroovieDebugCursor = 1 << 6, - kGroovieDebugMIDI = 1 << 7, - kGroovieDebugScriptvars = 1 << 8, - kGroovieDebugCell = 1 << 9, - kGroovieDebugFast = 1 << 10 - // the current limitation is 32 debug levels (1 << 31 is the last one) + kDebugVideo = 1 << 0, + kDebugResource = 1 << 1, + kDebugScript = 1 << 2, + kDebugUnknown = 1 << 3, + kDebugHotspots = 1 << 4, + kDebugCursor = 1 << 5, + kDebugMIDI = 1 << 6, + kDebugScriptvars = 1 << 7, + kDebugCell = 1 << 8, + kDebugFast = 1 << 9 + // the current limitation is 32 debug levels (1 << 31 is the last one) + // but some are used by system, so avoid high values. }; /** diff --git a/engines/groovie/music.cpp b/engines/groovie/music.cpp index 390f47f084..2c164e020c 100644 --- a/engines/groovie/music.cpp +++ b/engines/groovie/music.cpp @@ -64,7 +64,7 @@ void MusicPlayer::playSong(uint32 fileref) { void MusicPlayer::setBackgroundSong(uint32 fileref) { Common::StackLock lock(_mutex); - debugC(1, kGroovieDebugMIDI | kGroovieDebugAll, "Groovie::Music: Changing the background song: %04X", fileref); + debugC(1, kDebugMIDI, "Groovie::Music: Changing the background song: %04X", fileref); _backgroundFileRef = fileref; } @@ -86,7 +86,7 @@ void MusicPlayer::playCD(uint8 track) { // Stop the MIDI playback unload(); - debugC(1, kGroovieDebugMIDI | kGroovieDebugAll, "Groovie::Music: Playing CD track %d", track); + debugC(1, kDebugMIDI, "Groovie::Music: Playing CD track %d", track); if (track == 3) { // This is the credits song, start at 23:20 @@ -136,9 +136,9 @@ void MusicPlayer::playCD(uint8 track) { } void MusicPlayer::startBackground() { - debugC(3, kGroovieDebugMIDI | kGroovieDebugAll, "Groovie::Music: startBackground()"); + debugC(3, kDebugMIDI, "Groovie::Music: startBackground()"); if (!_isPlaying && _backgroundFileRef) { - debugC(3, kGroovieDebugMIDI | kGroovieDebugAll, "Groovie::Music: Starting the background song (0x%4X)", _backgroundFileRef); + debugC(3, kDebugMIDI, "Groovie::Music: Starting the background song (0x%4X)", _backgroundFileRef); play(_backgroundFileRef, true); } } @@ -158,7 +158,7 @@ void MusicPlayer::setUserVolume(uint16 volume) { void MusicPlayer::setGameVolume(uint16 volume, uint16 time) { Common::StackLock lock(_mutex); - debugC(1, kGroovieDebugMIDI | kGroovieDebugAll, "Groovie::Music: Setting game volume from %d to %d in %dms", _gameVolume, volume, time); + debugC(1, kDebugMIDI, "Groovie::Music: Setting game volume from %d to %d in %dms", _gameVolume, volume, time); // Save the start parameters of the fade _fadingStartTime = _vm->_system->getMillis(); @@ -183,12 +183,12 @@ bool MusicPlayer::play(uint32 fileref, bool loop) { } void MusicPlayer::applyFading() { - debugC(6, kGroovieDebugMIDI | kGroovieDebugAll, "Groovie::Music: applyFading() _fadingStartTime = %d, _fadingDuration = %d, _fadingStartVolume = %d, _fadingEndVolume = %d", _fadingStartTime, _fadingDuration, _fadingStartVolume, _fadingEndVolume); + debugC(6, kDebugMIDI, "Groovie::Music: applyFading() _fadingStartTime = %d, _fadingDuration = %d, _fadingStartVolume = %d, _fadingEndVolume = %d", _fadingStartTime, _fadingDuration, _fadingStartVolume, _fadingEndVolume); Common::StackLock lock(_mutex); // Calculate the passed time uint32 time = _vm->_system->getMillis() - _fadingStartTime; - debugC(6, kGroovieDebugMIDI | kGroovieDebugAll, "Groovie::Music: time = %d, _gameVolume = %d", time, _gameVolume); + debugC(6, kDebugMIDI, "Groovie::Music: time = %d, _gameVolume = %d", time, _gameVolume); if (time >= _fadingDuration) { // Set the end volume _gameVolume = _fadingEndVolume; @@ -200,7 +200,7 @@ void MusicPlayer::applyFading() { if (_gameVolume == _fadingEndVolume) { // If we were fading to 0, stop the playback and restore the volume if (_fadingEndVolume == 0) { - debugC(1, kGroovieDebugMIDI | kGroovieDebugAll, "Groovie::Music: Faded to zero: end of song. _fadingEndVolume set to 100"); + debugC(1, kDebugMIDI, "Groovie::Music: Faded to zero: end of song. _fadingEndVolume set to 100"); unload(); } } @@ -210,7 +210,7 @@ void MusicPlayer::applyFading() { } void MusicPlayer::onTimer(void *refCon) { - debugC(9, kGroovieDebugMIDI | kGroovieDebugAll, "Groovie::Music: onTimer()"); + debugC(9, kDebugMIDI, "Groovie::Music: onTimer()"); MusicPlayer *music = (MusicPlayer *)refCon; Common::StackLock lock(music->_mutex); @@ -225,7 +225,7 @@ void MusicPlayer::onTimer(void *refCon) { } void MusicPlayer::unload() { - debugC(1, kGroovieDebugMIDI | kGroovieDebugAll, "Groovie::Music: Stopping the playback"); + debugC(1, kDebugMIDI, "Groovie::Music: Stopping the playback"); // Set the new state _isPlaying = false; @@ -319,7 +319,7 @@ void MusicPlayerMidi::updateChanVolume(byte channel) { } void MusicPlayerMidi::endTrack() { - debugC(3, kGroovieDebugMIDI | kGroovieDebugAll, "Groovie::Music: endTrack()"); + debugC(3, kDebugMIDI, "Groovie::Music: endTrack()"); unload(); } @@ -439,7 +439,7 @@ void MusicPlayerXMI::send(uint32 b) { byte chan = b & 0xF; byte bank = (b >> 16) & 0xFF; - debugC(5, kGroovieDebugMIDI | kGroovieDebugAll, "Groovie::Music: Selecting bank %X for channel %X", bank, chan); + debugC(5, kDebugMIDI, "Groovie::Music: Selecting bank %X for channel %X", bank, chan); _chanBanks[chan] = bank; return; } else if ((b & 0xF0) == 0xC0) { // Program change @@ -450,7 +450,7 @@ void MusicPlayerXMI::send(uint32 b) { byte chan = b & 0xF; byte patch = (b >> 8) & 0xFF; - debugC(5, kGroovieDebugMIDI | kGroovieDebugAll, "Groovie::Music: Setting custom patch %X from bank %X to channel %X", patch, _chanBanks[chan], chan); + debugC(5, kDebugMIDI, "Groovie::Music: Setting custom patch %X from bank %X to channel %X", patch, _chanBanks[chan], chan); // Try to find the requested patch from the previously // specified bank @@ -475,7 +475,7 @@ void MusicPlayerXMI::send(uint32 b) { } bool MusicPlayerXMI::load(uint32 fileref, bool loop) { - debugC(1, kGroovieDebugMIDI | kGroovieDebugAll, "Groovie::Music: Starting the playback of song: %04X", fileref); + debugC(1, kDebugMIDI, "Groovie::Music: Starting the playback of song: %04X", fileref); // Open the song resource Common::SeekableReadStream *file = _vm->_resMan->open(fileref); @@ -489,7 +489,7 @@ bool MusicPlayerXMI::load(uint32 fileref, bool loop) { void MusicPlayerXMI::loadTimbres(const Common::String &filename) { // Load the Global Timbre Library format as documented in AIL2 - debugC(1, kGroovieDebugMIDI | kGroovieDebugAll, "Groovie::Music: Loading the GTL file %s", filename.c_str()); + debugC(1, kDebugMIDI, "Groovie::Music: Loading the GTL file %s", filename.c_str()); // Does it exist? if (!Common::File::exists(filename)) { @@ -537,7 +537,7 @@ void MusicPlayerXMI::loadTimbres(const Common::String &filename) { // Read the timbre data gtl->read(_timbres[i].data, _timbres[i].size); - debugC(5, kGroovieDebugMIDI | kGroovieDebugAll, "Groovie::Music: Loaded patch %x in bank %x with size %d", + debugC(5, kDebugMIDI, "Groovie::Music: Loaded patch %x in bank %x with size %d", _timbres[i].patch, _timbres[i].bank, _timbres[i].size); } @@ -636,7 +636,7 @@ void setRolandInstrument(MidiDriver *drv, byte channel, byte *instrument) { // Show the timbre name as extra debug information Common::String name((char *)instrument, 10); - debugC(5, kGroovieDebugMIDI | kGroovieDebugAll, "Groovie::Music: Setting MT32 timbre '%s' to channel %d", name.c_str(), channel); + debugC(5, kDebugMIDI, "Groovie::Music: Setting MT32 timbre '%s' to channel %d", name.c_str(), channel); sysex.roland_id = 0x41; sysex.device_id = channel; // Unit# @@ -702,7 +702,7 @@ MusicPlayerMac_t7g::MusicPlayerMac_t7g(GroovieEngine *vm) : MusicPlayerMidi(vm) } bool MusicPlayerMac_t7g::load(uint32 fileref, bool loop) { - debugC(1, kGroovieDebugMIDI | kGroovieDebugAll, "Groovie::Music: Starting the playback of song: %04X", fileref); + debugC(1, kDebugMIDI, "Groovie::Music: Starting the playback of song: %04X", fileref); // First try for compressed MIDI Common::SeekableReadStream *file = _vm->_macResFork->getResource(MKTAG('c','m','i','d'), fileref & 0x3FF); @@ -789,7 +789,7 @@ MusicPlayerMac_v2::MusicPlayerMac_v2(GroovieEngine *vm) : MusicPlayerMidi(vm) { } bool MusicPlayerMac_v2::load(uint32 fileref, bool loop) { - debugC(1, kGroovieDebugMIDI | kGroovieDebugAll, "Groovie::Music: Starting the playback of song: %04X", fileref); + debugC(1, kDebugMIDI, "Groovie::Music: Starting the playback of song: %04X", fileref); // Find correct filename ResInfo info; diff --git a/engines/groovie/player.cpp b/engines/groovie/player.cpp index 16cb3c47ff..c1b90fbd2c 100644 --- a/engines/groovie/player.cpp +++ b/engines/groovie/player.cpp @@ -94,13 +94,13 @@ void VideoPlayer::waitFrame() { } else { uint32 millisDiff = currTime - _lastFrameTime; if (millisDiff < _millisBetweenFrames) { - debugC(7, kGroovieDebugVideo | kGroovieDebugAll, "Groovie::Player: Delaying %d (currTime=%d, _lastFrameTime=%d, millisDiff=%d, _millisBetweenFrame=%d)", + debugC(7, kDebugVideo, "Groovie::Player: Delaying %d (currTime=%d, _lastFrameTime=%d, millisDiff=%d, _millisBetweenFrame=%d)", _millisBetweenFrames - millisDiff, currTime, _lastFrameTime, millisDiff, _millisBetweenFrames); _syst->delayMillis(_millisBetweenFrames - millisDiff); currTime = _syst->getMillis(); - debugC(7, kGroovieDebugVideo | kGroovieDebugAll, "Groovie::Player: Finished delay at %d", currTime); + debugC(7, kDebugVideo, "Groovie::Player: Finished delay at %d", currTime); } - debugC(6, kGroovieDebugVideo | kGroovieDebugAll, "Groovie::Player: Frame displayed at %d (%f FPS)", currTime, 1000.0 / (currTime - _lastFrameTime)); + debugC(6, kDebugVideo, "Groovie::Player: Frame displayed at %d (%f FPS)", currTime, 1000.0 / (currTime - _lastFrameTime)); _lastFrameTime = currTime; } } diff --git a/engines/groovie/resource.cpp b/engines/groovie/resource.cpp index 8229d02d91..75eba95240 100644 --- a/engines/groovie/resource.cpp +++ b/engines/groovie/resource.cpp @@ -47,7 +47,7 @@ Common::SeekableReadStream *ResMan::open(uint32 fileRef) { return NULL; } - debugC(1, kGroovieDebugResource | kGroovieDebugAll, "Groovie::Resource: Opening resource 0x%04X (%s, %d, %d)", fileRef, _gjds[resInfo.gjd].c_str(), resInfo.offset, resInfo.size); + debugC(1, kDebugResource, "Groovie::Resource: Opening resource 0x%04X (%s, %d, %d)", fileRef, _gjds[resInfo.gjd].c_str(), resInfo.offset, resInfo.size); // Does it exist? if (!Common::File::exists(_gjds[resInfo.gjd])) { @@ -120,7 +120,7 @@ uint32 ResMan_t7g::getRef(Common::String name, Common::String scriptname) { // Test whether it's the resource we're searching Common::String resname(readname, 12); if (resname.hasPrefix(name.c_str())) { - debugC(2, kGroovieDebugResource | kGroovieDebugAll, "Groovie::Resource: Resource %12s matches %s", readname, name.c_str()); + debugC(2, kDebugResource, "Groovie::Resource: Resource %12s matches %s", readname, name.c_str()); found = true; } @@ -173,7 +173,7 @@ bool ResMan_t7g::getResInfo(uint32 fileRef, ResInfo &resInfo) { char resname[13]; rlFile->read(resname, 12); resname[12] = 0; - debugC(2, kGroovieDebugResource | kGroovieDebugAll, "Groovie::Resource: Resource name: %12s", resname); + debugC(2, kDebugResource, "Groovie::Resource: Resource name: %12s", resname); resInfo.filename = resname; // Read the resource information @@ -240,7 +240,7 @@ uint32 ResMan_v2::getRef(Common::String name, Common::String scriptname) { // Test whether it's the resource we're searching Common::String resname(readname, 18); if (resname.hasPrefix(name.c_str())) { - debugC(2, kGroovieDebugResource | kGroovieDebugAll, "Groovie::Resource: Resource %18s matches %s", readname, name.c_str()); + debugC(2, kDebugResource, "Groovie::Resource: Resource %18s matches %s", readname, name.c_str()); found = true; break; } @@ -284,7 +284,7 @@ bool ResMan_v2::getResInfo(uint32 fileRef, ResInfo &resInfo) { char resname[19]; resname[18] = 0; rlFile.read(resname, 18); - debugC(2, kGroovieDebugResource | kGroovieDebugAll, "Groovie::Resource: Resource name: %18s", resname); + debugC(2, kDebugResource, "Groovie::Resource: Resource name: %18s", resname); resInfo.filename = resname; // 6 padding bytes? (it looks like they're always 0) diff --git a/engines/groovie/roq.cpp b/engines/groovie/roq.cpp index 3b82543695..379fcabc07 100644 --- a/engines/groovie/roq.cpp +++ b/engines/groovie/roq.cpp @@ -64,7 +64,7 @@ ROQPlayer::~ROQPlayer() { uint16 ROQPlayer::loadInternal() { // Begin reading the file - debugC(1, kGroovieDebugVideo | kGroovieDebugAll, "Groovie::ROQ: Loading video"); + debugC(1, kDebugVideo, "Groovie::ROQ: Loading video"); // Read the file header ROQBlockHeader blockHeader; @@ -131,7 +131,7 @@ void ROQPlayer::buildShowBuf() { } bool ROQPlayer::playFrameInternal() { - debugC(5, kGroovieDebugVideo | kGroovieDebugAll, "Groovie::ROQ: Playing frame"); + debugC(5, kDebugVideo, "Groovie::ROQ: Playing frame"); // Process the needed blocks until the next video frame bool endframe = false; @@ -168,9 +168,9 @@ bool ROQPlayer::readBlockHeader(ROQBlockHeader &blockHeader) { blockHeader.size = _file->readUint32LE(); blockHeader.param = _file->readUint16LE(); - debugC(10, kGroovieDebugVideo | kGroovieDebugAll, "Groovie::ROQ: Block type = 0x%02X", blockHeader.type); - debugC(10, kGroovieDebugVideo | kGroovieDebugAll, "Groovie::ROQ: Block size = 0x%08X", blockHeader.size); - debugC(10, kGroovieDebugVideo | kGroovieDebugAll, "Groovie::ROQ: Block param = 0x%04X", blockHeader.param); + debugC(10, kDebugVideo, "Groovie::ROQ: Block type = 0x%02X", blockHeader.type); + debugC(10, kDebugVideo, "Groovie::ROQ: Block size = 0x%08X", blockHeader.size); + debugC(10, kDebugVideo, "Groovie::ROQ: Block param = 0x%04X", blockHeader.param); return true; } @@ -238,7 +238,7 @@ bool ROQPlayer::processBlock() { } bool ROQPlayer::processBlockInfo(ROQBlockHeader &blockHeader) { - debugC(5, kGroovieDebugVideo | kGroovieDebugAll, "Groovie::ROQ: Processing info block"); + debugC(5, kDebugVideo, "Groovie::ROQ: Processing info block"); // Verify the block header if (blockHeader.type != 0x1001 || blockHeader.size != 8 || (blockHeader.param != 0 && blockHeader.param != 1)) { @@ -285,7 +285,7 @@ bool ROQPlayer::processBlockInfo(ROQBlockHeader &blockHeader) { } bool ROQPlayer::processBlockQuadCodebook(ROQBlockHeader &blockHeader) { - debugC(5, kGroovieDebugVideo | kGroovieDebugAll, "Groovie::ROQ: Processing quad codebook block"); + debugC(5, kDebugVideo, "Groovie::ROQ: Processing quad codebook block"); // Get the number of 2x2 pixel blocks to read int newNum2blocks = blockHeader.param >> 8; @@ -333,7 +333,7 @@ bool ROQPlayer::processBlockQuadCodebook(ROQBlockHeader &blockHeader) { } bool ROQPlayer::processBlockQuadVector(ROQBlockHeader &blockHeader) { - debugC(5, kGroovieDebugVideo | kGroovieDebugAll, "Groovie::ROQ: Processing quad vector block"); + debugC(5, kDebugVideo, "Groovie::ROQ: Processing quad vector block"); // Get the mean motion vectors int8 Mx = blockHeader.param >> 8; @@ -396,7 +396,7 @@ void ROQPlayer::processBlockQuadVectorBlock(int baseX, int baseY, int8 Mx, int8 } void ROQPlayer::processBlockQuadVectorBlockSub(int baseX, int baseY, int8 Mx, int8 My) { - debugC(6, kGroovieDebugVideo | kGroovieDebugAll, "Groovie::ROQ: Processing quad vector sub block"); + debugC(6, kDebugVideo, "Groovie::ROQ: Processing quad vector sub block"); uint16 codingType = getCodingType(); switch (codingType) { @@ -422,7 +422,7 @@ void ROQPlayer::processBlockQuadVectorBlockSub(int baseX, int baseY, int8 Mx, in } bool ROQPlayer::processBlockStill(ROQBlockHeader &blockHeader) { - debugC(5, kGroovieDebugVideo | kGroovieDebugAll, "Groovie::ROQ: Processing still (JPEG) block"); + debugC(5, kDebugVideo, "Groovie::ROQ: Processing still (JPEG) block"); Image::JPEGDecoder jpg; @@ -440,7 +440,7 @@ bool ROQPlayer::processBlockStill(ROQBlockHeader &blockHeader) { } bool ROQPlayer::processBlockSoundMono(ROQBlockHeader &blockHeader) { - debugC(5, kGroovieDebugVideo | kGroovieDebugAll, "Groovie::ROQ: Processing mono sound block"); + debugC(5, kDebugVideo, "Groovie::ROQ: Processing mono sound block"); // Verify the block header if (blockHeader.type != 0x1020) { @@ -483,7 +483,7 @@ bool ROQPlayer::processBlockSoundMono(ROQBlockHeader &blockHeader) { } bool ROQPlayer::processBlockSoundStereo(ROQBlockHeader &blockHeader) { - debugC(5, kGroovieDebugVideo | kGroovieDebugAll, "Groovie::ROQ: Processing stereo sound block"); + debugC(5, kDebugVideo, "Groovie::ROQ: Processing stereo sound block"); // Verify the block header if (blockHeader.type != 0x1021) { @@ -539,7 +539,7 @@ bool ROQPlayer::processBlockSoundStereo(ROQBlockHeader &blockHeader) { } bool ROQPlayer::processBlockAudioContainer(ROQBlockHeader &blockHeader) { - debugC(5, kGroovieDebugVideo | kGroovieDebugAll, "Groovie::ROQ: Processing audio container block: 0x%04X", blockHeader.param); + debugC(5, kDebugVideo, "Groovie::ROQ: Processing audio container block: 0x%04X", blockHeader.param); return true; } diff --git a/engines/groovie/script.cpp b/engines/groovie/script.cpp index 308811635e..27a18450d4 100644 --- a/engines/groovie/script.cpp +++ b/engines/groovie/script.cpp @@ -47,14 +47,14 @@ namespace Groovie { +// FIXME - Outdated. Can be replaced by debugC() and debugCN() calls. static void debugScript(int level, bool nl, const char *s, ...) GCC_PRINTF(3, 4); static void debugScript(int level, bool nl, const char *s, ...) { char buf[STRINGBUFLEN]; va_list va; - if (!DebugMan.isDebugChannelEnabled(kGroovieDebugScript) && - !DebugMan.isDebugChannelEnabled(kGroovieDebugAll)) + if (!DebugMan.isDebugChannelEnabled(kDebugScript)) return; va_start(va, s); @@ -120,7 +120,7 @@ Script::~Script() { void Script::setVariable(uint16 variablenum, byte value) { _variables[variablenum] = value; - debugC(1, kGroovieDebugScriptvars | kGroovieDebugAll, "script variable[0x%03X] = %d (0x%04X)", variablenum, value, value); + debugC(1, kDebugScriptvars, "script variable[0x%03X] = %d (0x%04X)", variablenum, value, value); } void Script::setDebugger(Debugger *debugger) { @@ -369,8 +369,7 @@ bool Script::hotspot(Common::Rect rect, uint16 address, uint8 cursor) { bool contained = rect.contains(mousepos); // Show hotspots when debugging - if (DebugMan.isDebugChannelEnabled(kGroovieDebugHotspots) || - DebugMan.isDebugChannelEnabled(kGroovieDebugAll)) { + if (DebugMan.isDebugChannelEnabled(kDebugHotspots)) { rect.translate(0, -80); _vm->_graphicsMan->_foreground.frameRect(rect, 250); _vm->_system->copyRectToScreen(_vm->_graphicsMan->_foreground.getPixels(), _vm->_graphicsMan->_foreground.pitch, 0, 80, 640, 320); @@ -416,7 +415,7 @@ void Script::savegame(uint slot) { Common::OutSaveFile *file = SaveLoad::openForSaving(ConfMan.getActiveDomainName(), slot); if (!file) { - debugC(9, kGroovieDebugScript, "Save file pointer is null"); + debugC(9, kDebugScript, "Save file pointer is null"); GUI::MessageDialog dialog(_("Failed to save game"), _("OK")); dialog.runModal(); return; @@ -532,7 +531,7 @@ void Script::o_videofromref() { // 0x09 // Show the debug information just when starting the playback if (fileref != _videoRef) { debugScript(1, false, "VIDEOFROMREF(0x%04X) (Not fully imp): Play video file from ref", fileref); - debugC(5, kGroovieDebugVideo | kGroovieDebugAll, "Playing video 0x%04X via 0x09", fileref); + debugC(5, kDebugVideo, "Playing video 0x%04X via 0x09", fileref); } switch (fileref) { case 0x1C03: // Trilobyte logo @@ -913,7 +912,7 @@ void Script::o_vdxtransition() { // 0x1C // Show the debug information just when starting the playback if (fileref != _videoRef) { debugScript(1, true, "VDX transition fileref = 0x%04X", fileref); - debugC(1, kGroovieDebugVideo | kGroovieDebugAll, "Playing video 0x%04X with transition", fileref); + debugC(1, kDebugVideo, "Playing video 0x%04X with transition", fileref); } // Set bit 1 @@ -1654,7 +1653,7 @@ void Script::o2_videofromref() { // Show the debug information just when starting the playback if (fileref != _videoRef) { debugScript(1, true, "VIDEOFROMREF(0x%08X) (Not fully imp): Play video file from ref", fileref); - debugC(5, kGroovieDebugVideo | kGroovieDebugAll, "Playing video 0x%08X via 0x09", fileref); + debugC(5, kDebugVideo, "Playing video 0x%08X via 0x09", fileref); } // Play the video @@ -1670,7 +1669,7 @@ void Script::o2_vdxtransition() { // Show the debug information just when starting the playback if (fileref != _videoRef) { debugScript(1, true, "VDX transition fileref = 0x%08X", fileref); - debugC(1, kGroovieDebugVideo | kGroovieDebugAll, "Playing video 0x%08X with transition", fileref); + debugC(1, kDebugVideo, "Playing video 0x%08X with transition", fileref); } // Set bit 1 diff --git a/engines/groovie/vdx.cpp b/engines/groovie/vdx.cpp index 4626a6f81b..09c2e0d3ea 100644 --- a/engines/groovie/vdx.cpp +++ b/engines/groovie/vdx.cpp @@ -56,8 +56,7 @@ void VDXPlayer::setOrigin(int16 x, int16 y) { } uint16 VDXPlayer::loadInternal() { - if (DebugMan.isDebugChannelEnabled(kGroovieDebugVideo) || - DebugMan.isDebugChannelEnabled(kGroovieDebugAll)) { + if (DebugMan.isDebugChannelEnabled(kDebugVideo)) { int8 i; debugN(1, "Groovie::VDX: New VDX: bitflags are "); for (i = 15; i >= 0; i--) { @@ -106,24 +105,24 @@ uint16 VDXPlayer::loadInternal() { //_flagUpdateStill = _flagNine || _flagSix; // Begin reading the file - debugC(1, kGroovieDebugVideo | kGroovieDebugAll, "Groovie::VDX: Playing video"); + debugC(1, kDebugVideo, "Groovie::VDX: Playing video"); if (_file->readUint16LE() != VDX_IDENT) { error("Groovie::VDX: This does not appear to be a 7th guest VDX file"); return 0; } else { - debugC(5, kGroovieDebugVideo | kGroovieDebugAll, "Groovie::VDX: VDX file identified correctly"); + debugC(5, kDebugVideo, "Groovie::VDX: VDX file identified correctly"); } uint16 tmp; // Skip unknown data: 6 bytes, ref Martine tmp = _file->readUint16LE(); - debugC(2, kGroovieDebugVideo | kGroovieDebugUnknown | kGroovieDebugAll, "Groovie::VDX: Martine1 = 0x%04X", tmp); + debugC(2, kDebugVideo | kDebugUnknown, "Groovie::VDX: Martine1 = 0x%04X", tmp); tmp = _file->readUint16LE(); - debugC(2, kGroovieDebugVideo | kGroovieDebugUnknown | kGroovieDebugAll, "Groovie::VDX: Martine2 = 0x%04X", tmp); + debugC(2, kDebugVideo | kDebugUnknown, "Groovie::VDX: Martine2 = 0x%04X", tmp); tmp = _file->readUint16LE(); - debugC(2, kGroovieDebugVideo | kGroovieDebugUnknown | kGroovieDebugAll, "Groovie::VDX: Martine3 (FPS?) = %d", tmp); + debugC(2, kDebugVideo | kDebugUnknown, "Groovie::VDX: Martine3 (FPS?) = %d", tmp); return tmp; } @@ -144,7 +143,7 @@ bool VDXPlayer::playFrameInternal() { if (_file->eos()) break; - debugC(5, kGroovieDebugVideo | kGroovieDebugUnknown | kGroovieDebugAll, "Groovie::VDX: Edward = 0x%04X", tmp); + debugC(5, kDebugVideo | kDebugUnknown, "Groovie::VDX: Edward = 0x%04X", tmp); // Read the chunk data and decompress if needed if (compSize) @@ -159,18 +158,18 @@ bool VDXPlayer::playFrameInternal() { // Use the current chunk switch (currRes) { case 0x00: - debugC(6, kGroovieDebugVideo | kGroovieDebugAll, "Groovie::VDX: Replay frame"); + debugC(6, kDebugVideo, "Groovie::VDX: Replay frame"); break; case 0x20: - debugC(5, kGroovieDebugVideo | kGroovieDebugAll, "Groovie::VDX: Still frame"); + debugC(5, kDebugVideo, "Groovie::VDX: Still frame"); getStill(vdxData); break; case 0x25: - debugC(5, kGroovieDebugVideo | kGroovieDebugAll, "Groovie::VDX: Animation frame"); + debugC(5, kDebugVideo, "Groovie::VDX: Animation frame"); getDelta(vdxData); break; case 0x80: - debugC(5, kGroovieDebugVideo | kGroovieDebugAll, "Groovie::VDX: Sound resource"); + debugC(5, kDebugVideo, "Groovie::VDX: Sound resource"); chunkSound(vdxData); break; default: @@ -182,7 +181,7 @@ bool VDXPlayer::playFrameInternal() { // Wait until the current frame can be shown - if (!DebugMan.isDebugChannelEnabled(kGroovieDebugFast)) { + if (!DebugMan.isDebugChannelEnabled(kDebugFast)) { waitFrame(); } // TODO: Move it to a better place @@ -344,13 +343,13 @@ void VDXPlayer::getDelta(Common::ReadStream *in) { void VDXPlayer::getStill(Common::ReadStream *in) { uint16 numXTiles = in->readUint16LE(); - debugC(5, kGroovieDebugVideo | kGroovieDebugAll, "Groovie::VDX: numXTiles=%d", numXTiles); + debugC(5, kDebugVideo, "Groovie::VDX: numXTiles=%d", numXTiles); uint16 numYTiles = in->readUint16LE(); - debugC(5, kGroovieDebugVideo | kGroovieDebugAll, "Groovie::VDX: numYTiles=%d", numYTiles); + debugC(5, kDebugVideo, "Groovie::VDX: numYTiles=%d", numYTiles); // It's skipped in the original: uint16 colorDepth = in->readUint16LE(); - debugC(5, kGroovieDebugVideo | kGroovieDebugAll, "Groovie::VDX: colorDepth=%d", colorDepth); + debugC(5, kDebugVideo, "Groovie::VDX: colorDepth=%d", colorDepth); uint16 imageWidth = TILE_SIZE * numXTiles; @@ -423,7 +422,7 @@ void VDXPlayer::getStill(Common::ReadStream *in) { */ } else { // Skip the remaining data - debugC(10, kGroovieDebugVideo | kGroovieDebugAll, "Groovie::VDX: Skipping still frame"); + debugC(10, kDebugVideo, "Groovie::VDX: Skipping still frame"); while (!in->eos()) { in->readByte(); } @@ -538,7 +537,7 @@ void VDXPlayer::chunkSound(Common::ReadStream *in) { byte *data = (byte *)malloc(60000); int chunksize = in->read(data, 60000); - if (!DebugMan.isDebugChannelEnabled(kGroovieDebugFast)) { + if (!DebugMan.isDebugChannelEnabled(kDebugFast)) { _audioStream->queueBuffer(data, chunksize, DisposeAfterUse::YES, Audio::FLAG_UNSIGNED); } } @@ -563,7 +562,7 @@ void VDXPlayer::setPalette(uint8 *palette) { if (_flagSkipPalette) return; - debugC(7, kGroovieDebugVideo | kGroovieDebugAll, "Groovie::VDX: Setting palette"); + debugC(7, kDebugVideo, "Groovie::VDX: Setting palette"); _syst->getPaletteManager()->setPalette(palette, 0, 256); } |