aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--queen/command.cpp16
-rw-r--r--queen/cutaway.cpp136
-rw-r--r--queen/display.cpp4
-rw-r--r--queen/display.h2
-rw-r--r--queen/input.cpp4
-rw-r--r--queen/logic.cpp29
-rw-r--r--queen/talk.cpp48
7 files changed, 120 insertions, 119 deletions
diff --git a/queen/command.cpp b/queen/command.cpp
index 023941b75a..09b55651ef 100644
--- a/queen/command.cpp
+++ b/queen/command.cpp
@@ -163,7 +163,7 @@ void Command::executeCurrentAction() {
}
}
- debug(0, "Command::executeCurrentAction() - comMax=%d subj1=%X subj2=%X", comMax, _state.subject[0], _state.subject[1]);
+ debug(6, "Command::executeCurrentAction() - comMax=%d subj1=%X subj2=%X", comMax, _state.subject[0], _state.subject[1]);
if (comMax == 0) {
sayInvalidAction(_state.selAction, _state.subject[0], _state.subject[1]);
@@ -317,7 +317,7 @@ ItemData *Command::findItemData(Verb invNum) const {
int16 Command::executeCommand(uint16 comId, int16 condResult) {
// execute.c l.313-452
- debug(0, "Command::executeCommand() - cond = %X, com = %X", condResult, comId);
+ debug(6, "Command::executeCommand() - cond = %X, com = %X", condResult, comId);
CmdListData *com = &_cmdList[comId];
@@ -462,7 +462,7 @@ int16 Command::makeJoeWalkTo(int16 x, int16 y, int16 objNum, Verb v, bool mustWa
_vm->logic()->newRoom(0);
}
- debug(0, "Command::makeJoeWalkTo() - x=%d y=%d newRoom=%d", x, y, _vm->logic()->newRoom());
+ debug(6, "Command::makeJoeWalkTo() - x=%d y=%d newRoom=%d", x, y, _vm->logic()->newRoom());
int16 p = 0;
if (mustWalk) {
@@ -966,7 +966,7 @@ void Command::openOrCloseAssociatedObject(Verb action, int16 otherObj) {
}
}
- debug(0, "Command::openOrCloseAssociatedObject() - com=%X", com);
+ debug(6, "Command::openOrCloseAssociatedObject() - com=%X", com);
if (com != 0) {
@@ -1011,7 +1011,7 @@ int16 Command::setConditions(uint16 command, bool lastCmd) {
if (cmdGs->id == command) {
if (cmdGs->gameStateSlot > 0) {
if (_vm->logic()->gameState(cmdGs->gameStateSlot) != cmdGs->gameStateValue) {
- debug(0, "Command::setConditions() - GS[%d] == %d (should be %d)", cmdGs->gameStateSlot, _vm->logic()->gameState(cmdGs->gameStateSlot), cmdGs->gameStateValue);
+ debug(6, "Command::setConditions() - GS[%d] == %d (should be %d)", cmdGs->gameStateSlot, _vm->logic()->gameState(cmdGs->gameStateSlot), cmdGs->gameStateValue);
// failed test
ret = i;
break;
@@ -1083,7 +1083,7 @@ void Command::setObjects(uint16 command) {
uint16 dstObj = ABS(cmdObj->dstObj);
ObjectData *objData = _vm->logic()->objectData(dstObj);
- debug(0, "Command::setObjects() - dstObj=%X srcObj=%X _state.subject[0]=%X", cmdObj->dstObj, cmdObj->srcObj, _state.subject[0]);
+ debug(6, "Command::setObjects() - dstObj=%X srcObj=%X _state.subject[0]=%X", cmdObj->dstObj, cmdObj->srcObj, _state.subject[0]);
if (cmdObj->dstObj > 0) {
// show the object
@@ -1182,7 +1182,7 @@ uint16 Command::nextObjectDescription(ObjectDescription* objDesc, uint16 firstDe
// l.69-103 select.c
uint16 i;
uint16 diff = objDesc->lastDescription - firstDesc;
- debug(0, "Command::nextObjectDescription() - diff = %d, type = %d", diff, objDesc->type);
+ debug(6, "Command::nextObjectDescription() - diff = %d, type = %d", diff, objDesc->type);
switch (objDesc->type) {
case 0:
// random type, start with first description
@@ -1239,7 +1239,7 @@ void Command::lookAtSelectedObject() {
desc = objData->description;
}
- debug(0, "Command::lookAtSelectedObject() - desc = %X, _state.subject[0] = %X", desc, _state.subject[0]);
+ debug(6, "Command::lookAtSelectedObject() - desc = %X, _state.subject[0] = %X", desc, _state.subject[0]);
// check to see if the object/item has a series of description
ObjectDescription *objDesc = _vm->logic()->objectDescription(1);
diff --git a/queen/cutaway.cpp b/queen/cutaway.cpp
index fc679a6882..25c8588b92 100644
--- a/queen/cutaway.cpp
+++ b/queen/cutaway.cpp
@@ -72,7 +72,7 @@ Cutaway::~Cutaway() {
void Cutaway::load(const char *filename) {
byte *ptr;
- debug(0, "----- Cutaway::load(\"%s\") -----", filename);
+ debug(6, "----- Cutaway::load(\"%s\") -----", filename);
ptr = _fileData = _vm->resource()->loadFile(filename, 20);
if (!_fileData) {
@@ -87,11 +87,11 @@ void Cutaway::load(const char *filename) {
_comPanel = READ_BE_UINT16(ptr);
ptr += 2;
- debug(0, "_comPanel = %i", _comPanel);
+ debug(6, "_comPanel = %i", _comPanel);
_cutawayObjectCount = (int16)READ_BE_UINT16(ptr);
ptr += 2;
- debug(0, "_cutawayObjectCount = %i", _cutawayObjectCount);
+ debug(6, "_cutawayObjectCount = %i", _cutawayObjectCount);
if (_cutawayObjectCount < 0) {
_cutawayObjectCount = -_cutawayObjectCount;
@@ -102,7 +102,7 @@ void Cutaway::load(const char *filename) {
int16 flags1 = (int16)READ_BE_UINT16(ptr);
ptr += 2;
- debug(0, "flags1 = %i", flags1);
+ debug(6, "flags1 = %i", flags1);
if (flags1 < 0) {
_vm->logic()->entryObj(0);
@@ -113,8 +113,8 @@ void Cutaway::load(const char *filename) {
_anotherCutaway = (flags1 == 1);
- debug(0, "[Cutaway::load] _finalRoom = %i", _finalRoom);
- debug(0, "[Cutaway::load] _anotherCutaway = %i", _anotherCutaway);
+ debug(6, "[Cutaway::load] _finalRoom = %i", _finalRoom);
+ debug(6, "[Cutaway::load] _anotherCutaway = %i", _anotherCutaway);
/*
Pointers to other places in the cutaway data
@@ -128,20 +128,20 @@ void Cutaway::load(const char *filename) {
byte *bankNamesPtr = _fileData + READ_BE_UINT16(ptr);
ptr += 2;
- //debug(0, "Bank name file offset = %08x", 20 + bankNamesPtr - _fileData);
+ //debug(6, "Bank name file offset = %08x", 20 + bankNamesPtr - _fileData);
_objectData = ptr;
loadStrings(bankNamesPtr);
if (_bankNames[0][0]) {
- debug(0, "Loading bank '%s'", _bankNames[0]);
+ debug(6, "Loading bank '%s'", _bankNames[0]);
_vm->graphics()->bankLoad(_bankNames[0], CUTAWAY_BANK);
}
char entryString[MAX_STRING_SIZE];
_nextSentence = Talk::getString(_nextSentence, entryString, MAX_STRING_LENGTH);
- debug(0, "Entry string = '%s'", entryString);
+ debug(6, "Entry string = '%s'", entryString);
_vm->logic()->joeCutFacing(_vm->logic()->joeFacing());
_vm->logic()->joeFace();
@@ -173,7 +173,7 @@ void Cutaway::loadStrings(byte *ptr) {
int bankNameCount = READ_BE_UINT16(ptr);
ptr += 2;
- //debug(0, "Bank name count = %i", bankNameCount);
+ //debug(6, "Bank name count = %i", bankNameCount);
/*
The _bankNames zero-based array is the one-based BANK_NAMEstr array in
@@ -184,18 +184,18 @@ void Cutaway::loadStrings(byte *ptr) {
ptr = Talk::getString(ptr, _bankNames[j], MAX_FILENAME_LENGTH);
if (_bankNames[j][0]) {
- //debug(0, "Bank name %i = '%s'", j, _bankNames[j]);
+ //debug(6, "Bank name %i = '%s'", j, _bankNames[j]);
j++;
}
}
- debug(0, "Getting talk file");
+ debug(6, "Getting talk file");
ptr = Talk::getString(ptr, _talkFile, MAX_FILENAME_LENGTH);
- debug(0, "Talk file = '%s'", _talkFile);
+ debug(6, "Talk file = '%s'", _talkFile);
_talkTo = (int16)READ_BE_UINT16(ptr);
ptr += 2;
- debug(0, "_talkTo = %i", _talkTo);
+ debug(6, "_talkTo = %i", _talkTo);
}
byte *Cutaway::getCutawayObject(byte *ptr, CutawayObject &object)
@@ -236,7 +236,7 @@ byte *Cutaway::getCutawayObject(byte *ptr, CutawayObject &object)
void Cutaway::dumpCutawayObject(int index, CutawayObject &object)
{
- debug(0, "----- CutawayObject[%i] -----", index);
+ debug(6, "----- CutawayObject[%i] -----", index);
const char *objectNumberStr;
@@ -253,24 +253,24 @@ void Cutaway::dumpCutawayObject(int index, CutawayObject &object)
break;
}
- debug(0, "objectNumber = %i (%s)", object.objectNumber, objectNumberStr);
-
- if (object.moveToX) debug(0, "moveToX = %i", object.moveToX);
- if (object.moveToY) debug(0, "moveToY = %i", object.moveToY);
- if (object.bank) debug(0, "bank = %i", object.bank);
- if (object.animList) debug(0, "animList = %i", object.animList);
- if (object.execute) debug(0, "execute = %i", object.execute);
- if (object.limitBobX1) debug(0, "limitBobX1 = %i", object.limitBobX1);
- if (object.limitBobY1) debug(0, "limitBobY1 = %i", object.limitBobY1);
- if (object.limitBobX2) debug(0, "limitBobX2 = %i", object.limitBobX2);
- if (object.limitBobY2) debug(0, "limitBobY2 = %i", object.limitBobY2);
- if (object.specialMove) debug(0, "specialMove = %i", object.specialMove);
- if (object.animType) debug(0, "animType = %i", object.animType);
- if (object.fromObject) debug(0, "fromObject = %i", object.fromObject);
- if (object.bobStartX) debug(0, "bobStartX = %i", object.bobStartX);
- if (object.bobStartY) debug(0, "bobStartY = %i", object.bobStartY);
- if (object.room) debug(0, "room = %i", object.room);
- if (object.scale) debug(0, "scale = %i", object.scale);
+ debug(6, "objectNumber = %i (%s)", object.objectNumber, objectNumberStr);
+
+ if (object.moveToX) debug(6, "moveToX = %i", object.moveToX);
+ if (object.moveToY) debug(6, "moveToY = %i", object.moveToY);
+ if (object.bank) debug(6, "bank = %i", object.bank);
+ if (object.animList) debug(6, "animList = %i", object.animList);
+ if (object.execute) debug(6, "execute = %i", object.execute);
+ if (object.limitBobX1) debug(6, "limitBobX1 = %i", object.limitBobX1);
+ if (object.limitBobY1) debug(6, "limitBobY1 = %i", object.limitBobY1);
+ if (object.limitBobX2) debug(6, "limitBobX2 = %i", object.limitBobX2);
+ if (object.limitBobY2) debug(6, "limitBobY2 = %i", object.limitBobY2);
+ if (object.specialMove) debug(6, "specialMove = %i", object.specialMove);
+ if (object.animType) debug(6, "animType = %i", object.animType);
+ if (object.fromObject) debug(6, "fromObject = %i", object.fromObject);
+ if (object.bobStartX) debug(6, "bobStartX = %i", object.bobStartX);
+ if (object.bobStartY) debug(6, "bobStartY = %i", object.bobStartY);
+ if (object.room) debug(6, "room = %i", object.room);
+ if (object.scale) debug(6, "scale = %i", object.scale);
}
@@ -286,7 +286,7 @@ byte *Cutaway::turnOnPeople(byte *ptr, CutawayObject &object) {
for (int i = 0; i < object.personCount; i++) {
object.person[i] = (int16)READ_BE_UINT16(ptr);
ptr += 2;
- //debug(0, "[%i] Turn on person %i", i, object.person[i]);
+ //debug(6, "[%i] Turn on person %i", i, object.person[i]);
}
return ptr;
@@ -327,7 +327,7 @@ void Cutaway::restorePersonData() {
void Cutaway::changeRooms(CutawayObject &object) {
// Lines 1291-1385 in cutaway.c
- debug(0, "Changing from room %i to room %i",
+ debug(6, "Changing from room %i to room %i",
_temporaryRoom,
object.room);
@@ -358,7 +358,7 @@ void Cutaway::changeRooms(CutawayObject &object) {
}
}
- /*debug(0, "Person '%s' (%i) is %s",
+ /*debug(6, "Person '%s' (%i) is %s",
_vm->logic()->objectName(objectData->name),
objectData->name,
on ? "on" : "off");*/
@@ -492,7 +492,7 @@ Cutaway::ObjectType Cutaway::getObjectType(CutawayObject &object) {
byte *Cutaway::getCutawayAnim(byte *ptr, int header, CutawayAnim &anim) {
// lines 1531-1607 in cutaway.c
- //debug(0, "[Cutaway::getCutawayAnim] header=%i", header);
+ //debug(6, "[Cutaway::getCutawayAnim] header=%i", header);
anim.currentFrame = 0;
anim.originalFrame = 0;
@@ -536,7 +536,7 @@ byte *Cutaway::getCutawayAnim(byte *ptr, int header, CutawayAnim &anim) {
else {
if (anim.bank != 13) {
/* XXX if (OLDBANK != T) */ {
- //debug(0, "Loading bank '%s'", _bankNames[anim.bank-1]);
+ //debug(6, "Loading bank '%s'", _bankNames[anim.bank-1]);
_vm->graphics()->bankLoad(_bankNames[anim.bank-1], CUTAWAY_BANK);
// XXX OLDBANK=T;
}
@@ -584,19 +584,19 @@ byte *Cutaway::getCutawayAnim(byte *ptr, int header, CutawayAnim &anim) {
}
void Cutaway::dumpCutawayAnim(CutawayAnim &anim) {
- debug(0, "----- CutawayAnim -----");
- if (anim.object) debug(0, "object = %i", anim.object);
- if (anim.unpackFrame) debug(0, "unpackFrame = %i", anim.unpackFrame);
- if (anim.speed) debug(0, "speed = %i", anim.speed);
- if (anim.bank) debug(0, "bank = %i", anim.bank);
- if (anim.mx) debug(0, "mx = %i", anim.mx);
- if (anim.my) debug(0, "my = %i", anim.my);
- if (anim.cx) debug(0, "cx = %i", anim.cx);
- if (anim.cy) debug(0, "cy = %i", anim.cy);
- if (anim.scale) debug(0, "scale = %i", anim.scale);
- if (anim.currentFrame) debug(0, "currentFrame = %i", anim.currentFrame);
- if (anim.originalFrame) debug(0, "originalFrame = %i", anim.originalFrame);
- if (anim.song) debug(0, "song = %i", anim.song);
+ debug(6, "----- CutawayAnim -----");
+ if (anim.object) debug(6, "object = %i", anim.object);
+ if (anim.unpackFrame) debug(6, "unpackFrame = %i", anim.unpackFrame);
+ if (anim.speed) debug(6, "speed = %i", anim.speed);
+ if (anim.bank) debug(6, "bank = %i", anim.bank);
+ if (anim.mx) debug(6, "mx = %i", anim.mx);
+ if (anim.my) debug(6, "my = %i", anim.my);
+ if (anim.cx) debug(6, "cx = %i", anim.cx);
+ if (anim.cy) debug(6, "cy = %i", anim.cy);
+ if (anim.scale) debug(6, "scale = %i", anim.scale);
+ if (anim.currentFrame) debug(6, "currentFrame = %i", anim.currentFrame);
+ if (anim.originalFrame) debug(6, "originalFrame = %i", anim.originalFrame);
+ if (anim.song) debug(6, "song = %i", anim.song);
}
byte *Cutaway::handleAnimation(byte *ptr, CutawayObject &object) {
@@ -616,7 +616,7 @@ byte *Cutaway::handleAnimation(byte *ptr, CutawayObject &object) {
if (-2 == header)
break;
- //debug(0, "Animation frame %i, header = %i", frameCount, header);
+ //debug(6, "Animation frame %i, header = %i", frameCount, header);
if (header > 1000)
error("Header too large");
@@ -633,7 +633,7 @@ byte *Cutaway::handleAnimation(byte *ptr, CutawayObject &object) {
if (object.animType == 1) {
// lines 1615-1636 in cutaway.c
- debug(0, "----- Complex cutaway animation (animType = %i) -----", object.animType);
+ debug(6, "----- Complex cutaway animation (animType = %i) -----", object.animType);
if ((_vm->logic()->currentRoom() == 47 || _vm->logic()->currentRoom() == 63) &&
objAnim[0].object == 1) {
@@ -673,10 +673,10 @@ byte *Cutaway::handleAnimation(byte *ptr, CutawayObject &object) {
if (object.animType != 1) {
// lines 1657-1761 in cutaway.c
- debug(0, "----- Normal cutaway animation (animType = %i) -----", object.animType);
+ debug(6, "----- Normal cutaway animation (animType = %i) -----", object.animType);
for (i = 0; i < frameCount; i++) {
- //debug(0, "===== Animating frame %i =====", i);
+ //debug(6, "===== Animating frame %i =====", i);
//dumpCutawayAnim(objAnim[i]);
BobSlot *bob = _vm->graphics()->bob(objAnim[i].object);
@@ -698,7 +698,7 @@ byte *Cutaway::handleAnimation(byte *ptr, CutawayObject &object) {
// Unpack animation, but do not unpack moving people
if (!((objAnim[i].mx > 0 || objAnim[i].my > 0) && InRange(objAnim[i].object, 1, 3))) {
- /*debug(0, "Animation - bankUnpack(%i, %i, %i);",
+ /*debug(6, "Animation - bankUnpack(%i, %i, %i);",
objAnim[i].unpackFrame,
objAnim[i].originalFrame,
objAnim[i].bank);*/
@@ -778,7 +778,7 @@ static void findCdCut(const char *basename, int index, char *result) {
for (int i = strlen(basename); i < 5; i++)
result[i] = '_';
snprintf(result + 5, 3, "%02i", index);
- //debug(0, "findCdCut(\"%s\", %i, \"%s\")", basename, index, result);
+ //debug(6, "findCdCut(\"%s\", %i, \"%s\")", basename, index, result);
}
void Cutaway::handlePersonRecord(
@@ -863,7 +863,7 @@ void Cutaway::run(char *nextFilename) {
BobSlot *joeBob = _vm->graphics()->bob(0);
int initialJoeX = joeBob->x;
int initialJoeY = joeBob->y;
- debug(0, "[Cutaway::run] Joe started at (%i, %i)", initialJoeX, initialJoeY);
+ debug(6, "[Cutaway::run] Joe started at (%i, %i)", initialJoeX, initialJoeY);
_vm->input()->cutawayRunning(true);
@@ -905,7 +905,7 @@ void Cutaway::run(char *nextFilename) {
char sentence[MAX_STRING_SIZE];
_nextSentence = Talk::getString(_nextSentence, sentence, MAX_STRING_LENGTH);
- //debug(0, "Sentence = '%s'", sentence);
+ //debug(6, "Sentence = '%s'", sentence);
if (OBJECT_ROOMFADE == object.objectNumber) {
_roomFade = true;
@@ -992,13 +992,13 @@ void Cutaway::run(char *nextFilename) {
restorePersonData();
- debug(0, "_vm->logic()->entryObj() = %i", _vm->logic()->entryObj());
+ debug(6, "_vm->logic()->entryObj() = %i", _vm->logic()->entryObj());
if (_vm->logic()->entryObj() > 0) {
_initialRoom = _vm->logic()->objectData(_vm->logic()->entryObj())->room;
}
else {
// We're not returning to new room, so return to old Joe X,Y coords
- debug(0, "[Cutaway::run] Moving joe to (%i, %i)", initialJoeX, initialJoeY);
+ debug(6, "[Cutaway::run] Moving joe to (%i, %i)", initialJoeX, initialJoeY);
_vm->logic()->joeX(initialJoeX);
_vm->logic()->joeY(initialJoeY);
}
@@ -1074,14 +1074,14 @@ void Cutaway::stop() {
int16 joeX = READ_BE_UINT16(ptr); ptr += 2;
int16 joeY = READ_BE_UINT16(ptr); ptr += 2;
- debug(0, "[Cutaway::stop] Final position is room %i and coordinates (%i, %i)",
+ debug(6, "[Cutaway::stop] Final position is room %i and coordinates (%i, %i)",
joeRoom, joeX, joeY);
if ((!_vm->input()->cutawayQuit() || (!_anotherCutaway && joeRoom == _finalRoom)) &&
joeRoom != _temporaryRoom &&
joeRoom != 0) {
- debug(0, "[Cutaway::stop] Changing rooms and moving Joe");
+ debug(6, "[Cutaway::stop] Changing rooms and moving Joe");
_vm->logic()->joeX(joeX);
_vm->logic()->joeY(joeY);
@@ -1190,7 +1190,7 @@ void Cutaway::stop() {
(joeX || joeY)) {
BobSlot *joeBob = _vm->graphics()->bob(0);
- debug(0, "[Cutaway::stop] Moving Joe");
+ debug(6, "[Cutaway::stop] Moving Joe");
joeBob->x = joeX;
joeBob->y = joeY;
@@ -1296,7 +1296,7 @@ int Cutaway::makeComplexAnimation(int16 currentImage, Cutaway::CutawayAnim *objA
int bobNum = objAnim[0].object;
memset(frameIndex, 0, sizeof(frameIndex));
- debug(0, "[Cutaway::makeComplexAnimation] currentImage = %i", currentImage);
+ debug(6, "[Cutaway::makeComplexAnimation] currentImage = %i", currentImage);
BobSlot *bob = _vm->graphics()->bob(bobNum);
bob->xflip = objAnim[0].flip;
@@ -1318,13 +1318,13 @@ int Cutaway::makeComplexAnimation(int16 currentImage, Cutaway::CutawayAnim *objA
for (i = 0; i < frameCount; i++) {
_cutAnim[bobNum][i].frame = currentImage + frameIndex[objAnim[i].unpackFrame];
- //debug(0, "_cutAnim[%i][%i].frame = %i", bobNum, i, _cutAnim[bobNum][i].frame);
+ //debug(6, "_cutAnim[%i][%i].frame = %i", bobNum, i, _cutAnim[bobNum][i].frame);
}
for (i = 1; i < 256; i++) {
if (frameIndex[i]) {
currentImage++;
- //debug(0, "bankUnpack(%i, %i, %i)", i, currentImage, objAnim[0].bank);
+ //debug(6, "bankUnpack(%i, %i, %i)", i, currentImage, objAnim[0].bank);
_vm->graphics()->bankUnpack(i, currentImage, objAnim[0].bank);
}
}
@@ -1341,7 +1341,7 @@ void Cutaway::handleText(
const char *sentence) {
// lines 1776-1863 in cutaway.c
- //debug(0, "----- Write '%s' ----", sentence);
+ //debug(6, "----- Write '%s' ----", sentence);
int spaces = countSpaces(type, sentence);
diff --git a/queen/display.cpp b/queen/display.cpp
index fe83852d38..da2b99dfea 100644
--- a/queen/display.cpp
+++ b/queen/display.cpp
@@ -175,7 +175,7 @@ void Display::dynalumUpdate(int16 x, int16 y) {
uint offset = (y / 4) * 160 + (x / 4);
if (offset >= sizeof(_dynalum.msk)) {
- debug(0, "Graphics::dynalumUpdate(%d, %d) - invalid offset: %08x", x, y, offset);
+ debug(6, "Graphics::dynalumUpdate(%d, %d) - invalid offset: %08x", x, y, offset);
return;
}
@@ -621,7 +621,7 @@ void Display::palCustomLightsOn(uint16 roomNum) {
void Display::screenMode(int comPanel, bool inCutaway) {
- debug(0, "Display::screenMode(%d, %d)", comPanel, inCutaway);
+ debug(6, "Display::screenMode(%d, %d)", comPanel, inCutaway);
// FIXME: this is temporary, just to see if my theory is right
if (comPanel == 2 && !inCutaway) {
diff --git a/queen/display.h b/queen/display.h
index 34faf886df..645176f64b 100644
--- a/queen/display.h
+++ b/queen/display.h
@@ -100,7 +100,7 @@ public:
void horizontalScroll(int16 scroll);
int16 horizontalScroll() const { return _horizontalScroll; }
- void fullscreen(bool fs) { debug(0, "Display::fullscreen(%d)", fs); _fullscreen = fs; }
+ void fullscreen(bool fs) { debug(6, "Display::fullscreen(%d)", fs); _fullscreen = fs; }
bool fullscreen() const { return _fullscreen; }
void handleTimer();
diff --git a/queen/input.cpp b/queen/input.cpp
index a7bb6972f8..d1d2f88f49 100644
--- a/queen/input.cpp
+++ b/queen/input.cpp
@@ -143,7 +143,7 @@ void Input::delay(uint amount) {
int Input::checkKeys() {
if (_inKey)
- debug(0, "[Input::checkKeys] _inKey = %i", _inKey);
+ debug(6, "[Input::checkKeys] _inKey = %i", _inKey);
switch (_inKey) {
case KEY_SPACE:
@@ -177,7 +177,7 @@ int Input::checkKeys() {
case KEY_ESCAPE:
if (_canQuit) {
if (_cutawayRunning) {
- debug(0, "[Input::checkKeys] Setting _cutawayQuit to true!");
+ debug(6, "[Input::checkKeys] Setting _cutawayQuit to true!");
_cutawayQuit = true;
}
diff --git a/queen/logic.cpp b/queen/logic.cpp
index c13960c6a0..1f8ab6108b 100644
--- a/queen/logic.cpp
+++ b/queen/logic.cpp
@@ -550,7 +550,7 @@ int16 Logic::gameState(int index) {
void Logic::gameState(int index, int16 newValue) {
if (index >= 0 && index < GAME_STATE_COUNT) {
-// debug(0, "Logic::gameState() - GAMESTATE[%d] = %d", index, newValue);
+// debug(6, "Logic::gameState() - GAMESTATE[%d] = %d", index, newValue);
_gameState[index] = newValue;
}
else
@@ -894,7 +894,7 @@ void Logic::roomSetupObjects() {
for (i = firstRoomObj; i <= lastRoomObj; ++i) {
ObjectData *pod = &_objectData[i];
if (pod->image == -3 || pod->image == -4) {
- debug(0, "Logic::roomSetupObjects() - Setting up person %X, name=%X", i, pod->name);
+ debug(6, "Logic::roomSetupObjects() - Setting up person %X, name=%X", i, pod->name);
uint16 noun = i - _roomData[_currentRoom];
if (pod->name > 0) {
curImage = personSetup(noun, curImage);
@@ -936,11 +936,11 @@ uint16 Logic::roomRefreshObject(uint16 obj) {
return curImage;
}
- debug(0, "Logic::roomRefreshObject(%X, %s)", obj, _objName[ABS(pod->name)]);
+ debug(6, "Logic::roomRefreshObject(%X, %s)", obj, _objName[ABS(pod->name)]);
// check the object is in the current room
if (pod->room != _currentRoom) {
- debug(0, "Refreshing an object (%i=%s) not in current room (object room=%i, current room=%i)", obj, _objName[ABS(pod->name)], pod->room, _currentRoom);
+ debug(6, "Refreshing an object (%i=%s) not in current room (object room=%i, current room=%i)", obj, _objName[ABS(pod->name)], pod->room, _currentRoom);
return curImage;
}
@@ -1054,7 +1054,7 @@ void Logic::roomSetup(const char *room, int comPanel, bool inCutaway) {
void Logic::roomDisplay(uint16 room, RoomDisplayMode mode, uint16 scale, int comPanel, bool inCutaway) {
- debug(0, "Logic::roomDisplay(%d, %d, %d, %d, %d)", room, mode, scale, comPanel, inCutaway);
+ debug(6, "Logic::roomDisplay(%d, %d, %d, %d, %d)", room, mode, scale, comPanel, inCutaway);
roomErase();
@@ -1135,7 +1135,7 @@ void Logic::personSetData(int16 noun, const char *actorName, bool loadBank, Pers
pp->anim = NULL;
}
- debug(0, "Logic::personSetData() - name=%s n=%d", pp->name, actor);
+ debug(6, "Logic::personSetData() - name=%s n=%d", pp->name, actor);
if (loadBank) {
const char *actorFile = _aFile[pp->actor->actorFile];
@@ -1182,7 +1182,7 @@ uint16 Logic::personSetup(uint16 noun, uint16 curImage) {
pbs->frameNum = p.bobFrame;
pbs->xflip = xflip;
- debug(0, "Logic::personSetup(%d, %d) - bob = %d name = %s", noun, curImage, pad->bobNum, p.name);
+ debug(6, "Logic::personSetup(%d, %d) - bob = %d name = %s", noun, curImage, pad->bobNum, p.name);
if (p.anim != NULL) {
_personFrames[pad->bobNum] = curImage + 1;
@@ -1423,7 +1423,7 @@ void Logic::joeSetup() {
ObjectData *Logic::joeSetupInRoom(bool autoPosition, uint16 scale) {
- debug(0, "Logic::joeSetupInRoom(%d, %d) joe.x=%d joe.y=%d", autoPosition, scale, _joe.x, _joe.y);
+ debug(6, "Logic::joeSetupInRoom(%d, %d) joe.x=%d joe.y=%d", autoPosition, scale, _joe.x, _joe.y);
uint16 oldx;
uint16 oldy;
@@ -1450,7 +1450,7 @@ ObjectData *Logic::joeSetupInRoom(bool autoPosition, uint16 scale) {
}
}
- debug(0, "Logic::joeSetupInRoom() - oldx=%d, oldy=%d scale=%d", oldx, oldy, scale);
+ debug(6, "Logic::joeSetupInRoom() - oldx=%d, oldy=%d scale=%d", oldx, oldy, scale);
if (scale > 0 && scale < 100) {
joeScale(scale);
@@ -2368,7 +2368,7 @@ bool Logic::gameLoad(uint16 slot) {
}
void Logic::sceneStart() {
- debug(0, "[Logic::sceneStart] _scene = %i", _scene);
+ debug(6, "[Logic::sceneStart] _scene = %i", _scene);
_scene++;
_vm->display()->showMouseCursor(false);
@@ -2381,7 +2381,7 @@ void Logic::sceneStart() {
}
void Logic::sceneStop() {
- debug(0, "[Logic::sceneStop] _scene = %i", _scene);
+ debug(6, "[Logic::sceneStop] _scene = %i", _scene);
_scene--;
if (_scene > 0)
@@ -2636,9 +2636,10 @@ bool Logic::executeASM_Game(uint16 sm) {
void Logic::executeSpecialMove(uint16 sm) {
- debug(0, "Special move: %d", sm);
- if (!(this->*_executeASM)(sm))
- warning("unhandled / invalid special move : %d", sm);
+ debug(6, "Special move: %d", sm);
+ if (sm)
+ if (!(this->*_executeASM)(sm))
+ warning("unhandled / invalid special move : %d", sm);
}
diff --git a/queen/talk.cpp b/queen/talk.cpp
index 8353d91bb2..ed5a3a080d 100644
--- a/queen/talk.cpp
+++ b/queen/talk.cpp
@@ -81,7 +81,7 @@ void Talk::talk(const char *filename, int personInRoom, char *cutawayFilename) {
_oldSelectedSentenceIndex = 0;
_oldSelectedSentenceValue = 0;
- debug(0, "----- talk(\"%s\") -----", filename);
+ debug(6, "----- talk(\"%s\") -----", filename);
cutawayFilename[0] = '\0';
@@ -143,7 +143,7 @@ void Talk::talk(const char *filename, int personInRoom, char *cutawayFilename) {
// TODO: split this loop in several functions
while(retval != -1) {
- // debug(0, "retval = %i", retval);
+ // debug(6, "retval = %i", retval);
char otherVoiceFilePrefix [MAX_STRING_SIZE];
@@ -191,7 +191,7 @@ void Talk::talk(const char *filename, int personInRoom, char *cutawayFilename) {
}
}
- debug(0, "choicesLeft = %i", choicesLeft);
+ debug(6, "choicesLeft = %i", choicesLeft);
if (1 == choicesLeft) {
// Automatically run the final dialogue option
@@ -369,7 +369,7 @@ void Talk::findDialogueString(byte *ptr, int16 id, int16 max, char *str) {
int16 currentId = (int16)READ_BE_UINT16(ptr); ptr += 2;
if (id == currentId) {
ptr = getString(ptr, str, MAX_STRING_LENGTH, 4);
- //debug(0, "Found string with ID %i: '%s'", id, str);
+ //debug(6, "Found string with ID %i: '%s'", id, str);
break;
}
else
@@ -395,7 +395,7 @@ byte *Talk::loadDialogFile(const char *filename) {
File fdog;
fdog.open(filename, _vm->getGameDataPath());
if (fdog.isOpen()) {
- debug(0, "Loading dog file '%s' from game data path", filename);
+ debug(6, "Loading dog file '%s' from game data path", filename);
uint32 size = fdog.size() - DOG_HEADER_SIZE;
byte *buf = new byte[size];
fdog.seek(DOG_HEADER_SIZE);
@@ -423,7 +423,7 @@ void Talk::load(const char *filename) {
_levelMax = (int16)READ_BE_UINT16(ptr); ptr += 2;
- //debug(0, "levelMax = %i", _levelMax);
+ //debug(6, "levelMax = %i", _levelMax);
if (_levelMax < 0) {
_levelMax = -_levelMax;
@@ -443,8 +443,8 @@ void Talk::load(const char *filename) {
_itemNumber[i] = (int16)READ_BE_UINT16(ptr); ptr += 2;
}
- //debug(0, "uniqueKey = %i", _uniqueKey);
- //debug(0, "talkKey = %i", _talkKey);
+ //debug(6, "uniqueKey = %i", _uniqueKey);
+ //debug(6, "talkKey = %i", _talkKey);
_person1Ptr = _fileData + READ_BE_UINT16(ptr); ptr += 2;
_cutawayPtr = _fileData + READ_BE_UINT16(ptr); ptr += 2;
@@ -485,18 +485,18 @@ void Talk::initialTalk() {
char joeString[MAX_STRING_SIZE];
if (!hasNotString) {
ptr = getString(ptr, joeString, MAX_STRING_LENGTH);
- //debug(0, "joeString = '%s'", joeString);
+ //debug(6, "joeString = '%s'", joeString);
}
else
joeString[0] = '\0';
ptr = _person2Ptr;
ptr = getString(ptr, _person2String, MAX_STRING_LENGTH);
- //debug(0, "person2String = '%s'", _person2String);
+ //debug(6, "person2String = '%s'", _person2String);
char joe2String[MAX_STRING_SIZE];
ptr = getString(ptr, joe2String, MAX_STRING_LENGTH);
- //debug(0, "joe2String = '%s'", joe2String);
+ //debug(6, "joe2String = '%s'", joe2String);
if (!hasTalkedTo()) {
@@ -581,7 +581,7 @@ int Talk::getSpeakCommand(const char *sentence, unsigned &index) {
commandCode = atoi(sentence + index + 2);
int x = atoi(sentence + index + 5);
int y = atoi(sentence + index + 9);
- debug(0, "Calling MOVE_SPEAK(person, %i, %i)",x, y);
+ debug(6, "Calling MOVE_SPEAK(person, %i, %i)",x, y);
// XXX MOVE_SPEAK(person, x, y)
index += 11;
/// XXX personWalking = true;
@@ -632,7 +632,7 @@ bool Talk::speak(const char *sentence, Person *person, const char *voiceFilePref
person = &joe_person;
}
- //debug(0, "Sentence '%s' is said by person '%s' and voice files with prefix '%s' played",
+ //debug(6, "Sentence '%s' is said by person '%s' and voice files with prefix '%s' played",
// sentence, person->name, voiceFilePrefix);
if (sentence[0] == '\0') {
@@ -760,7 +760,7 @@ void Talk::stringAnimation(const SpeechParameters *parameters, int startFrame, i
return;
}
else if (!isdigit(parameters->animation[0])) {
- debug(0, "Error in speak string animation: '%s'", parameters->animation);
+ debug(6, "Error in speak string animation: '%s'", parameters->animation);
return;
}
else
@@ -807,7 +807,7 @@ void Talk::defaultAnimation(
// lines 1730-1823 in talk.c
#if 0
- debug(0, "Talk::defaultAnimation(\"%s\", %s, {\"%s\", %i, ...}, %i, %i)",
+ debug(6, "Talk::defaultAnimation(\"%s\", %s, {\"%s\", %i, ...}, %i, %i)",
segment,
isJoe ? "true" : "false",
parameters->name,
@@ -868,7 +868,7 @@ void Talk::defaultAnimation(
}
}
else {
- debug(0, "[Talk::defaultAnimation] Body action!");
+ debug(6, "[Talk::defaultAnimation] Body action!");
// Just do a body action
_vm->graphics()->bankOverpack(parameters->body, startFrame, bankNum);
}
@@ -928,7 +928,7 @@ void Talk::speakSegment(
char voiceFileName[MAX_STRING_SIZE];
snprintf(voiceFileName, sizeof(voiceFileName), "%s%1x", voiceFilePrefix, index + 1);
- // debug(0, "Sentence segment '%*s' is said by person '%s' and voice file '%s' is played",
+ // debug(6, "Sentence segment '%*s' is said by person '%s' and voice file '%s' is played",
// length, segment, person->name, voiceFileName);
// FIXME - it seems the french talkie version has a useless voice file ;
@@ -1192,7 +1192,7 @@ TalkSelected *Talk::talkSelected() {
int Talk::splitOption(const char *str, char optionText[5][MAX_STRING_SIZE]) {
- //debug(0, "splitOption(\"%s\")", str);
+ //debug(6, "splitOption(\"%s\")", str);
// Check to see if option fits on one line, and exit early
@@ -1294,7 +1294,7 @@ int16 Talk::selectSentence() {
int j;
for (j = 0; j < optionLines; j++) {
if (yOffset < 5) {
- //debug(0, "Draw text '%s'", optionText[j]);
+ //debug(6, "Draw text '%s'", optionText[j]);
_vm->graphics()->textSet(
(j == 0) ? 0 : 24,
150 - PUSHUP + yOffset * LINE_HEIGHT,
@@ -1333,14 +1333,14 @@ int16 Talk::selectSentence() {
if (5 == zone || 6 == zone) {
// XXX Arrow zones
- debug(0, "Arrow zones");
+ debug(6, "Arrow zones");
}
else {
if (oldZone != zone) {
// Changed zone, change text colors
int y;
- /*debug(0, "Changed zone. oldZone = %i, zone = %i",
+ /*debug(6, "Changed zone. oldZone = %i, zone = %i",
oldZone, zone);*/
if (zone > 0) {
@@ -1384,10 +1384,10 @@ int16 Talk::selectSentence() {
// XXX Begin debug stuff
- // debug(0, "----- Select a sentence of these -----");
+ // debug(6, "----- Select a sentence of these -----");
for (i = 1; i <= 4; i++) {
if (_talkString[i][0] != '\0') {
- // XXX debug(0, "%i: %s", i, _talkString[i]);
+ // XXX debug(6, "%i: %s", i, _talkString[i]);
if (!selectedSentence)
selectedSentence = i;
}
@@ -1395,7 +1395,7 @@ int16 Talk::selectSentence() {
// XXX End debug stuff
- debug(0, "Selected sentence %i", selectedSentence);
+ debug(6, "Selected sentence %i", selectedSentence);
arrowBobUp->active = false;
arrowBobDown->active = false;