Skip to content

Commit

Permalink
PRINCE: Cleanup debug output
Browse files Browse the repository at this point in the history
  • Loading branch information
sev- committed May 6, 2018
1 parent c6872dc commit 9a5ba52
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 15 deletions.
2 changes: 0 additions & 2 deletions engines/prince/archive.cpp
Expand Up @@ -162,8 +162,6 @@ Common::SeekableReadStream *PtcArchive::createReadStreamForMember(const Common::
debug(8, "PtcArchive::createReadStreamForMember: decompressed %d to %d bytes", entryHeader._size, decompLen);
}

//debug("PtcArchive::createReadStreamForMember name %s", name.c_str());

return new Common::MemoryReadStream(buffer, size, DisposeAfterUse::YES);
}

Expand Down
2 changes: 1 addition & 1 deletion engines/prince/hero.cpp
Expand Up @@ -68,7 +68,7 @@ bool Hero::loadAnimSet(uint32 animSetNr) {

_moveSet.resize(kMoveSetSize);
for (uint32 i = 0; i < kMoveSetSize; i++) {
debug("Anim set item %d %s", i, animSet[i]);
debug(5, "Anim set item %d %s", i, animSet[i]);
Animation *anim = nullptr;
if (animSet[i] != nullptr) {
anim = new Animation();
Expand Down
2 changes: 1 addition & 1 deletion engines/prince/music.cpp
Expand Up @@ -150,7 +150,7 @@ void MusicPlayer::killMidi() {
void MusicPlayer::loadMidi(const char *name) {
Common::SeekableReadStream *stream = SearchMan.createReadStreamForMember(name);
if (!stream) {
debug("Can't load midi stream %s", name);
warning("Can't load midi stream %s", name);
return;
}

Expand Down
4 changes: 2 additions & 2 deletions engines/prince/resource.cpp
Expand Up @@ -78,8 +78,8 @@ bool AnimListItem::loadFromStream(Common::SeekableReadStream &stream) {
_nextAnim = stream.readUint16LE();
_flags = stream.readUint16LE();

//debug("AnimListItem type %d, fileNumber %d, x %d, y %d, flags %d", _type, _fileNumber, _x, _y, _flags);
//debug("startPhase %d, endPhase %d, loopPhase %d", _startPhase, _endPhase, _loopPhase);
debug(7, "AnimListItem type %d, fileNumber %d, x %d, y %d, flags %d", _type, _fileNumber, _x, _y, _flags);
debug(7, "startPhase %d, endPhase %d, loopPhase %d", _startPhase, _endPhase, _loopPhase);

// 32 byte aligment
stream.seek(pos + 32);
Expand Down
14 changes: 6 additions & 8 deletions engines/prince/script.cpp
Expand Up @@ -222,15 +222,15 @@ void Script::setObjId(int roomObjOffset, int slot, byte objectId) {
}

int Script::scanMobEvents(int mobMask, int dataEventOffset) {
debug("mobMask: %d", mobMask);
debug(3, "scanMobEvents: mobMask: %d", mobMask);
int i = 0;
int16 mob;
int32 code;
do {
mob = (int)READ_LE_UINT16(&_data[dataEventOffset + i * 6]);
if (mob == mobMask) {
code = (int)READ_LE_UINT32(&_data[dataEventOffset + i * 6 + 2]);
debug("code: %d", code);
debug(3, "scanMobEvents: code: %d", code);
return code;
}
i++;
Expand All @@ -239,7 +239,7 @@ int Script::scanMobEvents(int mobMask, int dataEventOffset) {
}

int Script::scanMobEventsWithItem(int mobMask, int dataEventOffset, int itemMask) {
debug("mobMask: %d", mobMask);
debug(3, "scanMobEventsWithItem: mobMask: %d", mobMask);
int i = 0;
int16 mob;
int16 item;
Expand All @@ -250,8 +250,8 @@ int Script::scanMobEventsWithItem(int mobMask, int dataEventOffset, int itemMask
item = (int)READ_LE_UINT16(&_data[dataEventOffset + i * 8 + 2]);
if (item == itemMask) {
code = (int)READ_LE_UINT32(&_data[dataEventOffset + i * 8 + 4]);
debug("itemMask: %d", item);
debug("code: %d", code);
debug(3, "scanMobEventsWithItem: itemMask: %d", item);
debug(3, "scanMobEventsWithItem: code: %d", code);
return code;
}
}
Expand Down Expand Up @@ -388,7 +388,7 @@ bool Script::loadAllMasks(Common::Array<Mask> &maskList, int offset) {
tempMask._width = 0;
tempMask._height = 0;
tempMask._data = nullptr;
debug("Can't load %s", msStreamName.c_str());
warning("loadAllMasks: Can't load %s", msStreamName.c_str());
delete msStream;
} else {
msStream = Resource::getDecompressedStream(msStream);
Expand Down Expand Up @@ -452,11 +452,9 @@ void Interpreter::debugInterpreter(const char *s, ...) {

Common::String str = Common::String::format("@0x%08X: ", _lastInstruction);
str += Common::String::format("op %04d: ", _lastOpcode);
//debugC(10, DebugChannel::kScript, "PrinceEngine::Script %s %s", str.c_str(), buf);
if (!strcmp(_mode, "fg")) {
debug(10, "PrinceEngine::Script %s %s", str.c_str(), buf);
}
//debug("Prince::Script mode %s %s %s", _mode, str.c_str(), buf);
}

void Interpreter::stepBg() {
Expand Down
2 changes: 1 addition & 1 deletion engines/prince/sound.cpp
Expand Up @@ -104,7 +104,7 @@ bool PrinceEngine::loadVoice(uint32 slot, uint32 sampleSlot, const Common::Strin
freeSample(sampleSlot);
Common::SeekableReadStream *sampleStream = SearchMan.createReadStreamForMember(streamName);
if (sampleStream == nullptr) {
debug("Can't open %s", streamName.c_str());
warning("loadVoice: Can't open %s", streamName.c_str());
return false;
}

Expand Down

0 comments on commit 9a5ba52

Please sign in to comment.