aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBorja Lorente2016-08-07 17:15:01 +0200
committerBorja Lorente2016-08-14 19:01:01 +0200
commit8608776768e9926d5be09904232647bff39d7e72 (patch)
treeef0306bfedddddfa7c84a5d2c68a0a88eca6b7dd
parent0b36a77af42868edaab4434215bbae5d8c3a5e2f (diff)
downloadscummvm-rg350-8608776768e9926d5be09904232647bff39d7e72.tar.gz
scummvm-rg350-8608776768e9926d5be09904232647bff39d7e72.tar.bz2
scummvm-rg350-8608776768e9926d5be09904232647bff39d7e72.zip
MACVENTURE: Add debug channels
-rw-r--r--engines/macventure/container.h9
-rw-r--r--engines/macventure/debug.h39
-rw-r--r--engines/macventure/dialog.cpp2
-rw-r--r--engines/macventure/gui.cpp37
-rw-r--r--engines/macventure/gui.h2
-rw-r--r--engines/macventure/macventure.cpp33
-rw-r--r--engines/macventure/macventure.h10
-rw-r--r--engines/macventure/script.cpp18
-rw-r--r--engines/macventure/sound.cpp4
-rw-r--r--engines/macventure/stringtable.h2
-rw-r--r--engines/macventure/text.cpp14
-rw-r--r--engines/macventure/world.cpp2
12 files changed, 106 insertions, 66 deletions
diff --git a/engines/macventure/container.h b/engines/macventure/container.h
index 21fdc6c529..013a11dafc 100644
--- a/engines/macventure/container.h
+++ b/engines/macventure/container.h
@@ -45,9 +45,6 @@ public:
Container(Common::String filename) {
_filename = filename;
- //FSNode node = FSDirectory(".");
- //debug(node.getDisplayName().c_str());
-
if (!_file.open(_filename))
error("Could not open %s", _filename.c_str());
@@ -100,11 +97,10 @@ public:
for (uint j = 0; j < 64; ++j) {
uint32 length = 0;
- //debug("reading mask from address %x", _res->pos());
uint32 mask = _res->readUint32BE();
mask >>= (16 - bits);
mask &= 0xFFFF;
- debug(11, "Load mask of object &%d:%d is %x", i, j, mask);
+ debugC(11, kMVDebugContainer, "Load mask of object &%d:%d is %x", i, j, mask);
_res->seek(-4, SEEK_CUR);
// Look in the Huffman table
int x = 0;
@@ -143,7 +139,7 @@ public:
}
group.lengths[j] = length;
- debug(11, "Load legth of object %d:%d is %d", i, j, length);
+ debugC(11, kMVDebugContainer, "Load legth of object %d:%d is %d", i, j, length);
}
_groups.push_back(group);
@@ -214,7 +210,6 @@ protected:
Common::File _file;
Common::SeekableReadStream *_res;
-
};
diff --git a/engines/macventure/debug.h b/engines/macventure/debug.h
new file mode 100644
index 0000000000..8ee9ebe008
--- /dev/null
+++ b/engines/macventure/debug.h
@@ -0,0 +1,39 @@
+/* ScummVM - Graphic Adventure Engine
+*
+* ScummVM is the legal property of its developers, whose names
+* are too numerous to list here. Please refer to the COPYRIGHT
+* file distributed with this source distribution.
+*
+* This program is free software; you can redistribute it and/or
+* modify it under the terms of the GNU General Public License
+* as published by the Free Software Foundation; either version 2
+* of the License, or (at your option) any later version.
+
+* This program is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU General Public License for more details.
+
+* You should have received a copy of the GNU General Public License
+* along with this program; if not, write to the Free Software
+* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+*
+*/
+
+#ifndef MACVENTURE_DEBUG_H
+#define MACVENTURE_DEBUG_H
+
+namespace MacVenture {
+enum MacVentureDebugChannel {
+ kMVDebugMain = 1 << 0,
+ kMVDebugGUI = 1 << 1,
+ kMVDebugImage = 1 << 2,
+ kMVDebugText = 1 << 3,
+ kMVDebugScript = 1 << 4,
+ kMVDebugSound = 1 << 5,
+ kMVDebugContainer = 1 << 6,
+ kMVDebugTests = 1 << 31
+};
+} // End namespace MacVenture
+
+#endif
diff --git a/engines/macventure/dialog.cpp b/engines/macventure/dialog.cpp
index a6c1e78a6f..fe01d8fd8a 100644
--- a/engines/macventure/dialog.cpp
+++ b/engines/macventure/dialog.cpp
@@ -159,7 +159,7 @@ bool DialogButton::doProcessEvent(MacVenture::Dialog *dialog, Common::Event even
if (event.type == Common::EVENT_LBUTTONDOWN) {
dialog->localize(mouse);
if (_bounds.contains(mouse)) {
- debug(1, "Click! Button: %s", _text.c_str());
+ debugC(1, kMVDebugGUI, "Click! Button: %s", _text.c_str());
dialog->handleDialogAction(this, _action);
return true;
}
diff --git a/engines/macventure/gui.cpp b/engines/macventure/gui.cpp
index 17d31d824d..5fa746ce3d 100644
--- a/engines/macventure/gui.cpp
+++ b/engines/macventure/gui.cpp
@@ -330,7 +330,7 @@ WindowReference Gui::createInventoryWindow(ObjID objRef) {
loadBorders(newWindow, newData.type);
_inventoryWindows.push_back(newWindow);
- debug("Create new inventory window. Reference: %d", newData.refcon);
+ debugC(1, kMVDebugGUI, "Create new inventory window. Reference: %d", newData.refcon);
return newData.refcon;
}
@@ -455,7 +455,7 @@ bool Gui::loadWindows() {
}
data.scrollPos = Common::Point(0, 0);
- debug(4, "Window loaded: %s", data.title.c_str());
+ debugC(4, kMVDebugGUI, "Window loaded: %s", data.title.c_str());
_windowData->push_back(data);
}
@@ -834,7 +834,7 @@ void Gui::updateExit(ObjID obj) {
}
void Gui::printText(const Common::String & text) {
- debug(1, "Print Text: %s", text.c_str());
+ debugC(1, kMVDebugGUI, "Print Text: %s", text.c_str());
_consoleText->printLine(text, _outConsoleWindow->getDimensions().width());
}
@@ -880,7 +880,7 @@ void Gui::moveDraggedObject(Common::Point target) {
// TODO FInd more elegant way of making pow2
_draggedObj.hasMoved = (_draggedObj.startPos.sqrDist(_draggedObj.pos) >= (kDragThreshold * kDragThreshold));
- debug(4, "Dragged obj position: (%d, %d), mouse offset: (%d, %d), hasMoved: %d, dist: %d, threshold: %d",
+ debugC(4, kMVDebugGUI, "Dragged obj position: (%d, %d), mouse offset: (%d, %d), hasMoved: %d, dist: %d, threshold: %d",
_draggedObj.pos.x, _draggedObj.pos.y,
_draggedObj.mouseOffset.x, _draggedObj.mouseOffset.y,
_draggedObj.hasMoved,
@@ -1037,7 +1037,7 @@ void Gui::handleDragRelease(bool shiftPressed, bool isDoubleClick) {
ObjID destObject = destinationWindowData.objRef;
Common::Point dropPosition = _draggedObj.pos - _draggedObj.startPos;
dropPosition = localizeTravelledDistance(dropPosition, _draggedObj.startWin, destinationWindow);
- debug(3, "drop the object %d at obj %d, pos (%d, %d)", _draggedObj.id, destObject, dropPosition.x, dropPosition.y);
+ debugC(3, kMVDebugGUI, "Drop the object %d at obj %d, pos (%d, %d)", _draggedObj.id, destObject, dropPosition.x, dropPosition.y);
_engine->handleObjectDrop(_draggedObj.id, dropPosition, destObject);
}
@@ -1082,49 +1082,46 @@ void Gui::removeInventoryWindow(WindowReference ref) {
void Gui::handleMenuAction(MenuAction action) {
switch (action) {
case MacVenture::kMenuActionAbout:
- debug("MacVenture Menu Action: About");
+ warning("Unimplemented MacVenture Menu Action: About");
break;
case MacVenture::kMenuActionNew:
- debug("MacVenture Menu Action: New");
+ warning("Unimplemented MacVenture Menu Action: New");
break;
case MacVenture::kMenuActionOpen:
- debug("MacVenture Menu Action: Open");
_engine->scummVMSaveLoadDialog(false);
break;
case MacVenture::kMenuActionSave:
- debug("MacVenture Menu Action: Save");
_engine->scummVMSaveLoadDialog(true);
break;
case MacVenture::kMenuActionSaveAs:
- debug("MacVenture Menu Action: Save As");
_engine->scummVMSaveLoadDialog(true);
break;
case MacVenture::kMenuActionQuit:
debug("MacVenture Menu Action: Quit");
break;
case MacVenture::kMenuActionUndo:
- debug("MacVenture Menu Action: Undo");
+ warning("Unimplemented MacVenture Menu Action: Undo");
break;
case MacVenture::kMenuActionCut:
- debug("MacVenture Menu Action: Cut");
+ warning("Unimplemented MacVenture Menu Action: Cut");
break;
case MacVenture::kMenuActionCopy:
- debug("MacVenture Menu Action: Copy");
+ warning("Unimplemented MacVenture Menu Action: Copy");
break;
case MacVenture::kMenuActionPaste:
- debug("MacVenture Menu Action: Paste");
+ warning("Unimplemented MacVenture Menu Action: Paste");
break;
case MacVenture::kMenuActionClear:
- debug("MacVenture Menu Action: Clear");
+ warning("Unimplemented MacVenture Menu Action: Clear");
break;
case MacVenture::kMenuActionCleanUp:
- debug("MacVenture Menu Action: Clean Up");
+ warning("Unimplemented MacVenture Menu Action: Clean Up");
break;
case MacVenture::kMenuActionMessUp:
- debug("MacVenture Menu Action: Mess Up");
+ warning("Unimplemented MacVenture Menu Action: Mess Up");
break;
case MacVenture::kMenuActionCommand:
- debug("MacVenture Menu Action: GENERIC");
+ warning("Unimplemented MacVenture Menu Action: GENERIC");
break;
default:
break;
@@ -1385,14 +1382,14 @@ void Gui::selectForDrag(Common::Point cursorPosition) {
}
void Gui::handleSingleClick() {
- debug("Single Click");
+ debugC(2, kMVDebugGUI, "Registered Single Click");
// HACK THERE HAS TO BE A MORE ELEGANT WAY
if (_dialog) return;
handleDragRelease(false, false);
}
void Gui::handleDoubleClick() {
- debug("Double Click");
+ debugC(2, kMVDebugGUI, "Registered Double Click");
if (_dialog) return;
handleDragRelease(false, true);
}
diff --git a/engines/macventure/gui.h b/engines/macventure/gui.h
index c7fb1c74ac..a62264cb6f 100644
--- a/engines/macventure/gui.h
+++ b/engines/macventure/gui.h
@@ -316,7 +316,7 @@ public:
private:
void changeState(CursorInput input) {
- debug(1, "Change cursor state: [%d] -> [%d]", _state, _transitionTable[_state][input]);
+ debugC(3, kMVDebugGUI, "Change cursor state: [%d] -> [%d]", _state, _transitionTable[_state][input]);
if (_state != _transitionTable[_state][input]) {
executeStateOut();
_state = _transitionTable[_state][input];
diff --git a/engines/macventure/macventure.cpp b/engines/macventure/macventure.cpp
index 867504b427..e1d1febd57 100644
--- a/engines/macventure/macventure.cpp
+++ b/engines/macventure/macventure.cpp
@@ -36,7 +36,7 @@ namespace MacVenture {
// HACK, see below
void toASCII(Common::String &str) {
- debug("toASCII: %s", str.c_str());
+ debugC(1, kMVDebugMain, "toASCII: %s", str.c_str());
Common::String::iterator it = str.begin();
for (; it != str.end(); it++) {
if (*it == '\216') { str.replace(it, it + 1, "e"); }
@@ -52,11 +52,14 @@ MacVentureEngine::MacVentureEngine(OSystem *syst, const ADGameDescription *gameD
_gameDescription = gameDesc;
_rnd = new Common::RandomSource("macventure");
+ initDebugChannels();
+
_debugger = NULL;
_gui = NULL;
_soundManager = NULL;
+
debug("MacVenture::MacVentureEngine()");
}
@@ -91,6 +94,16 @@ MacVentureEngine::~MacVentureEngine() {
delete _dataBundle;
}
+void MacVentureEngine::initDebugChannels() {
+ DebugMan.addDebugChannel(kMVDebugMain, "main", "Engine state");
+ DebugMan.addDebugChannel(kMVDebugGUI, "gui", "Gui");
+ DebugMan.addDebugChannel(kMVDebugText, "text", "Text decoders and printers");
+ DebugMan.addDebugChannel(kMVDebugImage, "image", "Image decoders and renderers");
+ DebugMan.addDebugChannel(kMVDebugScript, "script", "Script engine");
+ DebugMan.addDebugChannel(kMVDebugSound, "sound", "Sound decoders");
+ DebugMan.addDebugChannel(kMVDebugContainer, "container", "Containers");
+}
+
Common::Error MacVentureEngine::run() {
debug("MacVenture::MacVentureEngine::init()");
@@ -224,7 +237,7 @@ void MacVentureEngine::requestUnpause() {
}
void MacVentureEngine::selectControl(ControlAction id) {
- debug(2, "Select control %x", id);
+ debugC(2, kMVDebugMain, "Select control %x", id);
_selectedControl = id;
}
@@ -239,7 +252,7 @@ void MacVentureEngine::activateCommand(ControlAction id) {
_activeControl = kNoCommand;
_activeControl = id;
}
- debug(2, "Activating Command %x... Command %x is active", id, _activeControl);
+ debugC(2, kMVDebugMain, "Activating Command %x... Command %x is active", id, _activeControl);
refreshReady();
}
@@ -392,7 +405,7 @@ void MacVentureEngine::handleObjectDrop(ObjID objID, Common::Point delta, ObjID
}
void MacVentureEngine::updateDelta(Common::Point newPos) {
- debug("Update delta: Old(%d, %d), New(%d, %d)",
+ debugC(4, kMVDebugMain, "Update delta: Old(%d, %d), New(%d, %d)",
_deltaPoint.x, _deltaPoint.y,
newPos.x, newPos.y);
_deltaPoint = newPos;
@@ -407,7 +420,7 @@ void MacVentureEngine::updateWindow(WindowReference winID) {
}
bool MacVentureEngine::showTextEntry(ObjID text, ObjID srcObj, ObjID destObj) {
- debug("Showing speech dialog, asset %d from %d to %d", text, srcObj, destObj);
+ debugC(3, kMVDebugMain, "Showing speech dialog, asset %d from %d to %d", text, srcObj, destObj);
_gui->getTextFromUser();
// HACK WITH FLAGS
@@ -467,7 +480,7 @@ void MacVentureEngine::processEvents() {
}
bool MacVenture::MacVentureEngine::runScriptEngine() {
- debug(4, "MAIN: Running script engine");
+ debugC(4, kMVDebugMain, "MAIN: Running script engine");
if (_haltedAtEnd) {
_haltedAtEnd = false;
if (_scriptEngine->resume(false)) {
@@ -745,7 +758,7 @@ void MacVentureEngine::focusObjectWindow(ObjID objID) {
void MacVentureEngine::openObject(ObjID objID) {
- debug("Open Object[%d] parent[%d] x[%d] y[%d]",
+ debugC(1, kMVDebugMain, "Open Object[%d] parent[%d] x[%d] y[%d]",
objID,
_world->getObjAttr(objID, kAttrParentObject),
_world->getObjAttr(objID, kAttrPosX),
@@ -775,7 +788,7 @@ void MacVentureEngine::closeObject(ObjID objID) {
void MacVentureEngine::checkObject(QueuedObject old) {
//warning("checkObject: unimplemented");
bool hasChanged = false;
- debug("Check Object[%d] parent[%d] x[%d] y[%d]",
+ debugC(1, kMVDebugMain, "Check Object[%d] parent[%d] x[%d] y[%d]",
old.object,
old.parent,
old.x,
@@ -842,7 +855,7 @@ void MacVentureEngine::reflectSwap(ObjID fromID, ObjID toID) {
WindowReference from = getObjWindow(fromID);
WindowReference to = getObjWindow(toID);
WindowReference tmp = to;
- debug("Swap Object[%d] to Object[%d], from win[%d] to win[%d] ",
+ debugC(1, kMVDebugMain, "Swap Object[%d] to Object[%d], from win[%d] to win[%d] ",
fromID, toID, from, to);
if (!to) {
@@ -1098,7 +1111,7 @@ bool MacVentureEngine::loadTextHuffman() {
values[i] = res->readByte();
_textHuffman = new HuffmanLists(numEntries, lengths, masks, values);
- debug(4, "Text is huffman-encoded");
+ debugC(4, kMVDebugMain, "Text is huffman-encoded");
return true;
}
return false;
diff --git a/engines/macventure/macventure.h b/engines/macventure/macventure.h
index 275a7ac1a7..e9d4e12bfc 100644
--- a/engines/macventure/macventure.h
+++ b/engines/macventure/macventure.h
@@ -34,6 +34,7 @@
#include "gui/debugger.h"
+#include "macventure/debug.h"
#include "macventure/gui.h"
#include "macventure/world.h"
#include "macventure/hufflists.h"
@@ -66,13 +67,6 @@ enum {
};
enum {
- kMacVentureDebugExample = 1 << 0,
- kMacVentureDebugExample2 = 1 << 1
- // next new level must be 1 << 2 (4)
- // the current limitation is 32 debug levels (1 << 31 is the last one)
-};
-
-enum {
kGlobalSettingsID = 0x80,
kDiplomaGeometryID = 0x81,
kTextHuffmanTableID = 0x83
@@ -191,6 +185,8 @@ public:
virtual Common::Error loadGameState(int slot);
virtual Common::Error saveGameState(int slot, const Common::String &desc);
+ void initDebugChannels();
+
// datafiles.cpp
void loadDataBundle();
Common::SeekableReadStream *getBorderFile(MVWindowType windowType, bool isActive);
diff --git a/engines/macventure/script.cpp b/engines/macventure/script.cpp
index ef1d36cbae..d191cefa12 100644
--- a/engines/macventure/script.cpp
+++ b/engines/macventure/script.cpp
@@ -51,14 +51,14 @@ bool ScriptEngine::runControl(ControlAction action, ObjID source, ObjID destinat
frame.haltedInFirst = false;
frame.haltedInFamily = false;
_frames.push_back(frame);
- debug(3, "SCRIPT: Stored frame %d, action: %d src: %d dest: %d point: (%d, %d)",
+ debugC(3, kMVDebugScript, "SCRIPT: Stored frame %d, action: %d src: %d dest: %d point: (%d, %d)",
_frames.size() - 1, frame.action, frame.src, frame.dest, frame.x, frame.y);
return resume(true);
}
bool ScriptEngine::resume(bool execAll) {
- debug(3, "SCRIPT: Resume");
+ debugC(3, kMVDebugScript, "SCRIPT: Resume");
while (_frames.size()) {
bool fail = execFrame(execAll);
if (fail) return true;
@@ -146,7 +146,7 @@ bool ScriptEngine::execFrame(bool execAll) {
bool ScriptEngine::loadScript(EngineFrame * frame, uint32 scriptID) {
if (_scripts->getItemByteSize(scriptID) > 0) {
- debug(2, "SCRIPT: Loading function %d", scriptID);
+ debugC(2, kMVDebugScript, "SCRIPT: Loading function %d", scriptID);
// Insert the new script at the front
frame->scripts.push_front(ScriptAsset(scriptID, _scripts));
return runFunc(frame);
@@ -169,7 +169,7 @@ bool ScriptEngine::runFunc(EngineFrame *frame) {
byte op;
while (script.hasNext()) {
op = script.fetch();
- debug(3, "SCRIPT: I'm running operation %d", op);
+ debugC(3, kMVDebugScript, "SCRIPT: I'm running operation %d", op);
if (!(op & 0x80)) {
state->push(op);
} else {
@@ -924,12 +924,12 @@ bool ScriptEngine::opbcCALL(EngineState * state, EngineFrame * frame, ScriptAsse
word id = state->pop();
ScriptAsset newfun = ScriptAsset(id, _scripts);
ScriptAsset current = script;
- debug(2, "SCRIPT: Call function: %d", id);
+ debugC(2, kMVDebugScript, "SCRIPT: Call function: %d", id);
if (loadScript(frame, id))
return true;
frame->scripts.pop_front();
script = frame->scripts.front();
- debug(2, "SCRIPT: Return from fuction %d", id);
+ debugC(2, kMVDebugScript, "SCRIPT: Return from fuction %d", id);
}
void ScriptEngine::opbdFOOB(EngineState * state, EngineFrame * frame) {
@@ -1013,7 +1013,7 @@ void ScriptEngine::opcaTIME(EngineState * state, EngineFrame * frame) {
totalPlayTime %= 60;
state->push(minutes);
state->push(totalPlayTime);
- debug("Saved time: h[%d] m[%d] s[%d]", hours, minutes, totalPlayTime);
+ debugC(2, kMVDebugScript, "Saved time: h[%d] m[%d] s[%d]", hours, minutes, totalPlayTime);
}
void ScriptEngine::opcbDAY(EngineState * state, EngineFrame * frame) {
@@ -1168,7 +1168,7 @@ void ScriptEngine::ope7CFIB(EngineState * state, EngineFrame * frame) {
}
void ScriptEngine::op00NOOP(byte op) {
- debug("SCRIPT: Opcode not implemented => %x", op);
+ warning("SCRIPT: Opcode not implemented => %x", op);
}
@@ -1208,7 +1208,7 @@ void ScriptAsset::loadInstructions() {
for (uint i = 0; i < amount; i++) {
_instructions.push_back(res->readByte());
}
- debug(2, "SCRIPT: Load %d instructions for script %d", amount, _id);
+ debugC(2, kMVDebugScript, "SCRIPT: Load %d instructions for script %d", amount, _id);
}
} // End of namespace MacVenture
diff --git a/engines/macventure/sound.cpp b/engines/macventure/sound.cpp
index 0f9ea43afe..785c83ee0b 100644
--- a/engines/macventure/sound.cpp
+++ b/engines/macventure/sound.cpp
@@ -34,7 +34,7 @@ SoundManager::SoundManager(MacVentureEngine *engine, Audio::Mixer *mixer) {
Common::String filename = engine->getFilePath(kSoundPathID);
_container = new Container(filename);
_mixer = mixer;
- debug(1, "Created sound manager with file %s", filename.c_str());
+ debugC(1, kMVDebugSound, "Created sound manager with file %s", filename.c_str());
}
SoundManager::~SoundManager(){
@@ -68,7 +68,7 @@ SoundAsset::SoundAsset(Container *container, ObjID id) :
stream->seek(5, SEEK_SET);
SoundType type = (SoundType)stream->readByte();
- debug(2, "Decoding sound of type %x", type);
+ debugC(2, kMVDebugSound, "Decoding sound of type %x", type);
switch(type) {
case kSound10:
decode10(stream);
diff --git a/engines/macventure/stringtable.h b/engines/macventure/stringtable.h
index ff9eddc040..f05b793ced 100644
--- a/engines/macventure/stringtable.h
+++ b/engines/macventure/stringtable.h
@@ -85,7 +85,7 @@ private:
// HACK until a proper special char implementation is found, this will have to do.
Common::String result = Common::String(str);
toASCII(result);
- debug(11, "Loaded string %s", str);
+ debugC(5, kMVDebugText, "Loaded string %s", str);
_strings.push_back(Common::String(result));
delete[] str;
}
diff --git a/engines/macventure/text.cpp b/engines/macventure/text.cpp
index cf7402822d..74b5685e7f 100644
--- a/engines/macventure/text.cpp
+++ b/engines/macventure/text.cpp
@@ -37,7 +37,7 @@ TextAsset::TextAsset(MacVentureEngine *engine, ObjID objid, ObjID source, ObjID
}
else {
decodeHuffman();
- }
+ }
}
void TextAsset::decodeOld() {
@@ -110,7 +110,7 @@ void TextAsset::decodeOld() {
}
str[strLen] = '\0';
- debug(7, "Decoded %d string (old): %s", _id, str);
+ debugC(3, kMVDebugText, "Decoded %d string (old): %s", _id, str);
_decoded = Common::String(str);
}
@@ -136,7 +136,7 @@ void TextAsset::decodeHuffman() {
// Find the length index
for (entry = 0; entry < _huffman->getNumEntries(); entry++) {
if (mask < _huffman->getMask(entry)) break;
- }
+ }
stream.skip(_huffman->getLength(entry));
@@ -171,10 +171,10 @@ void TextAsset::decodeHuffman() {
} else { // Plain ascii
c = symbol & 0xFF;
_decoded.replace(_decoded.end(), _decoded.end(), Common::String(c));
- }
+ }
}
_decoded += '\0';
- debug(7, "Decoded %d'th string (new): %s", _id, _decoded.c_str());
+ debugC(4, kMVDebugText, "Decoded %d'th string (new): %s", _id, _decoded.c_str());
}
Common::String TextAsset::getNoun(ObjID subval) {
ObjID obj;
@@ -208,8 +208,8 @@ Common::String TextAsset::getNoun(ObjID subval) {
name.toUppercase();
name.replace(1, name.size() - 1, tmp, 1, tmp.size() - 1);
}
-
+
return name;
}
-} // End of namespace MacVenture \ No newline at end of file
+} // End of namespace MacVenture
diff --git a/engines/macventure/world.cpp b/engines/macventure/world.cpp
index f5af029f8f..012e872272 100644
--- a/engines/macventure/world.cpp
+++ b/engines/macventure/world.cpp
@@ -59,7 +59,7 @@ uint32 World::getObjAttr(ObjID objID, uint32 attrID) {
res >>= _engine->getGlobalSettings().attrShifts[attrID];
if (res & 0x8000)
res = -((res ^ 0xffff) + 1);
- debug(6, "Attribute %x from object %x is %x", attrID, objID, res);
+ debugC(5, kMVDebugMain, "Attribute %x from object %x is %x", attrID, objID, res);
return res;
}