aboutsummaryrefslogtreecommitdiff
path: root/engines/kyra
diff options
context:
space:
mode:
Diffstat (limited to 'engines/kyra')
-rw-r--r--engines/kyra/animator.cpp54
-rw-r--r--engines/kyra/debugger.cpp59
-rw-r--r--engines/kyra/debugger.h1
-rw-r--r--engines/kyra/gui.cpp26
-rw-r--r--engines/kyra/items.cpp52
-rw-r--r--engines/kyra/kyra.cpp65
-rw-r--r--engines/kyra/kyra.h9
-rw-r--r--engines/kyra/resource.cpp16
-rw-r--r--engines/kyra/saveload.cpp8
-rw-r--r--engines/kyra/scene.cpp40
-rw-r--r--engines/kyra/screen.cpp132
-rw-r--r--engines/kyra/script.cpp2
-rw-r--r--engines/kyra/script_v1.cpp286
-rw-r--r--engines/kyra/seqplayer.cpp10
-rw-r--r--engines/kyra/sequences_v1.cpp76
-rw-r--r--engines/kyra/sound.cpp12
-rw-r--r--engines/kyra/sprites.cpp136
-rw-r--r--engines/kyra/staticres.cpp4
-rw-r--r--engines/kyra/text.cpp34
-rw-r--r--engines/kyra/timer.cpp40
-rw-r--r--engines/kyra/wsamovie.cpp8
21 files changed, 495 insertions, 575 deletions
diff --git a/engines/kyra/animator.cpp b/engines/kyra/animator.cpp
index f774b4f6f2..64200f0027 100644
--- a/engines/kyra/animator.cpp
+++ b/engines/kyra/animator.cpp
@@ -43,7 +43,7 @@ ScreenAnimator::~ScreenAnimator() {
}
void ScreenAnimator::init(int actors_, int items_, int sprites_) {
- debug(9, kDebugLevelAnimator, "ScreenAnimator::init(%d, %d, %d)", actors_, items_, sprites_);
+ debugC(9, kDebugLevelAnimator, "ScreenAnimator::init(%d, %d, %d)", actors_, items_, sprites_);
_screenObjects = new AnimObject[actors_ + items_ + sprites_];
assert(_screenObjects);
memset(_screenObjects, 0, sizeof(AnimObject) * (actors_ + items_ + sprites_));
@@ -56,7 +56,7 @@ void ScreenAnimator::init(int actors_, int items_, int sprites_) {
}
void ScreenAnimator::close() {
- debug(9, kDebugLevelAnimator, "ScreenAnimator::close()");
+ debugC(9, kDebugLevelAnimator, "ScreenAnimator::close()");
if (_initOk) {
_initOk = false;
delete [] _screenObjects;
@@ -107,7 +107,7 @@ void ScreenAnimator::initAnimStateList() {
}
void ScreenAnimator::preserveAllBackgrounds() {
- debug(9, kDebugLevelAnimator, "ScreenAnimator::preserveAllBackgrounds()");
+ debugC(9, kDebugLevelAnimator, "ScreenAnimator::preserveAllBackgrounds()");
uint8 curPage = _screen->_curPage;
_screen->_curPage = 2;
@@ -123,7 +123,7 @@ void ScreenAnimator::preserveAllBackgrounds() {
}
void ScreenAnimator::flagAllObjectsForBkgdChange() {
- debug(9, kDebugLevelAnimator, "ScreenAnimator::flagAllObjectsForBkgdChange()");
+ debugC(9, kDebugLevelAnimator, "ScreenAnimator::flagAllObjectsForBkgdChange()");
AnimObject *curObject = _objectQueue;
while (curObject) {
curObject->bkgdChangeFlag = 1;
@@ -132,7 +132,7 @@ void ScreenAnimator::flagAllObjectsForBkgdChange() {
}
void ScreenAnimator::flagAllObjectsForRefresh() {
- debug(9, kDebugLevelAnimator, "ScreenAnimator::flagAllObjectsForRefresh()");
+ debugC(9, kDebugLevelAnimator, "ScreenAnimator::flagAllObjectsForRefresh()");
AnimObject *curObject = _objectQueue;
while (curObject) {
curObject->refreshFlag = 1;
@@ -141,7 +141,7 @@ void ScreenAnimator::flagAllObjectsForRefresh() {
}
void ScreenAnimator::restoreAllObjectBackgrounds() {
- debug(9, kDebugLevelAnimator, "ScreenAnimator::restoreAllObjectBackground()");
+ debugC(9, kDebugLevelAnimator, "ScreenAnimator::restoreAllObjectBackground()");
AnimObject *curObject = _objectQueue;
_screen->_curPage = 2;
@@ -158,7 +158,7 @@ void ScreenAnimator::restoreAllObjectBackgrounds() {
}
void ScreenAnimator::preserveAnyChangedBackgrounds() {
- debug(9, kDebugLevelAnimator, "ScreenAnimator::preserveAnyChangedBackgrounds()");
+ debugC(9, kDebugLevelAnimator, "ScreenAnimator::preserveAnyChangedBackgrounds()");
AnimObject *curObject = _objectQueue;
_screen->_curPage = 2;
@@ -174,7 +174,7 @@ void ScreenAnimator::preserveAnyChangedBackgrounds() {
}
void ScreenAnimator::preserveOrRestoreBackground(AnimObject *obj, bool restore) {
- debug(9, kDebugLevelAnimator, "ScreenAnimator::preserveOrRestoreBackground(0x%X, restore)", obj, restore);
+ debugC(9, kDebugLevelAnimator, "ScreenAnimator::preserveOrRestoreBackground(0x%X, restore)", obj, restore);
int x = 0, y = 0, width = obj->width << 3, height = obj->height;
if (restore) {
@@ -209,7 +209,7 @@ void ScreenAnimator::preserveOrRestoreBackground(AnimObject *obj, bool restore)
}
void ScreenAnimator::prepDrawAllObjects() {
- debug(9, kDebugLevelAnimator, "ScreenAnimator::prepDrawAllObjects()");
+ debugC(9, kDebugLevelAnimator, "ScreenAnimator::prepDrawAllObjects()");
AnimObject *curObject = _objectQueue;
int drawPage = 2;
int flagUnk1 = 0, flagUnk2 = 0, flagUnk3 = 0;
@@ -366,7 +366,7 @@ void ScreenAnimator::prepDrawAllObjects() {
}
void ScreenAnimator::copyChangedObjectsForward(int refreshFlag) {
- debug(9, kDebugLevelAnimator, "ScreenAnimator::copyChangedObjectsForward(%d)", refreshFlag);
+ debugC(9, kDebugLevelAnimator, "ScreenAnimator::copyChangedObjectsForward(%d)", refreshFlag);
AnimObject *curObject = _objectQueue;
while (curObject) {
@@ -404,7 +404,7 @@ void ScreenAnimator::copyChangedObjectsForward(int refreshFlag) {
}
void ScreenAnimator::updateAllObjectShapes() {
- debug(9, kDebugLevelAnimator, "ScreenAnimator::updateAllObjectShapes()");
+ debugC(9, kDebugLevelAnimator, "ScreenAnimator::updateAllObjectShapes()");
restoreAllObjectBackgrounds();
preserveAnyChangedBackgrounds();
prepDrawAllObjects();
@@ -412,7 +412,7 @@ void ScreenAnimator::updateAllObjectShapes() {
}
void ScreenAnimator::animRemoveGameItem(int index) {
- debug(9, kDebugLevelAnimator, "ScreenAnimator::animRemoveGameItem(%d)", index);
+ debugC(9, kDebugLevelAnimator, "ScreenAnimator::animRemoveGameItem(%d)", index);
restoreAllObjectBackgrounds();
AnimObject *animObj = &_items[index];
@@ -427,7 +427,7 @@ void ScreenAnimator::animRemoveGameItem(int index) {
}
void ScreenAnimator::animAddGameItem(int index, uint16 sceneId) {
- debug(9, kDebugLevelAnimator, "ScreenAnimator::animRemoveGameItem(%d, %d)", index, sceneId);
+ debugC(9, kDebugLevelAnimator, "ScreenAnimator::animRemoveGameItem(%d, %d)", index, sceneId);
restoreAllObjectBackgrounds();
assert(sceneId < _vm->_roomTableSize);
Room *currentRoom = &_vm->_roomTable[sceneId];
@@ -453,7 +453,7 @@ void ScreenAnimator::animAddGameItem(int index, uint16 sceneId) {
}
void ScreenAnimator::animAddNPC(int character) {
- debug(9, kDebugLevelAnimator, "ScreenAnimator::animAddNPC(%d)", character);
+ debugC(9, kDebugLevelAnimator, "ScreenAnimator::animAddNPC(%d)", character);
restoreAllObjectBackgrounds();
AnimObject *animObj = &_actors[character];
const Character *ch = &_vm->_characterList[character];
@@ -477,7 +477,7 @@ void ScreenAnimator::animAddNPC(int character) {
}
AnimObject *ScreenAnimator::objectRemoveQueue(AnimObject *queue, AnimObject *rem) {
- debug(9, kDebugLevelAnimator, "ScreenAnimator::objectRemoveQueue(0x%X, 0x%X)", queue, rem);
+ debugC(9, kDebugLevelAnimator, "ScreenAnimator::objectRemoveQueue(0x%X, 0x%X)", queue, rem);
AnimObject *cur = queue;
AnimObject *prev = queue;
@@ -513,13 +513,13 @@ AnimObject *ScreenAnimator::objectRemoveQueue(AnimObject *queue, AnimObject *rem
}
AnimObject *ScreenAnimator::objectAddHead(AnimObject *queue, AnimObject *head) {
- debug(9, kDebugLevelAnimator, "ScreenAnimator::objectAddHead(0x%X, 0x%X)", queue, head);
+ debugC(9, kDebugLevelAnimator, "ScreenAnimator::objectAddHead(0x%X, 0x%X)", queue, head);
head->nextAnimObject = queue;
return head;
}
AnimObject *ScreenAnimator::objectQueue(AnimObject *queue, AnimObject *add) {
- debug(9, kDebugLevelAnimator, "ScreenAnimator::objectQueue(0x%X, 0x%X)", queue, add);
+ debugC(9, kDebugLevelAnimator, "ScreenAnimator::objectQueue(0x%X, 0x%X)", queue, add);
if (add->drawY <= queue->drawY || !queue) {
add->nextAnimObject = queue;
return add;
@@ -545,7 +545,7 @@ AnimObject *ScreenAnimator::objectQueue(AnimObject *queue, AnimObject *add) {
}
void ScreenAnimator::addObjectToQueue(AnimObject *object) {
- debug(9, kDebugLevelAnimator, "ScreenAnimator::addObjectToQueue(0x%X)", object);
+ debugC(9, kDebugLevelAnimator, "ScreenAnimator::addObjectToQueue(0x%X)", object);
if (!_objectQueue) {
_objectQueue = objectAddHead(0, object);
} else {
@@ -554,7 +554,7 @@ void ScreenAnimator::addObjectToQueue(AnimObject *object) {
}
void ScreenAnimator::refreshObject(AnimObject *object) {
- debug(9, kDebugLevelAnimator, "ScreenAnimator::refreshObject(0x%X)", object);
+ debugC(9, kDebugLevelAnimator, "ScreenAnimator::refreshObject(0x%X)", object);
_objectQueue = objectRemoveQueue(_objectQueue, object);
if (_objectQueue) {
_objectQueue = objectQueue(_objectQueue, object);
@@ -564,7 +564,7 @@ void ScreenAnimator::refreshObject(AnimObject *object) {
}
void ScreenAnimator::makeBrandonFaceMouse() {
- debug(9, kDebugLevelAnimator, "ScreenAnimator::makeBrandonFaceMouse()");
+ debugC(9, kDebugLevelAnimator, "ScreenAnimator::makeBrandonFaceMouse()");
if (_vm->mouseX() >= _vm->_currentCharacter->x1) {
_vm->_currentCharacter->facing = 3;
} else {
@@ -575,21 +575,21 @@ void ScreenAnimator::makeBrandonFaceMouse() {
}
int16 ScreenAnimator::fetchAnimWidth(const uint8 *shape, int16 mult) {
- debug(9, kDebugLevelAnimator, "ScreenAnimator::fetchAnimWidth(0x%X, %d)", shape, mult);
+ debugC(9, kDebugLevelAnimator, "ScreenAnimator::fetchAnimWidth(0x%X, %d)", shape, mult);
if (_vm->features() & GF_TALKIE)
shape += 2;
return (((int16)READ_LE_UINT16((shape+3))) * mult) >> 8;
}
int16 ScreenAnimator::fetchAnimHeight(const uint8 *shape, int16 mult) {
- debug(9, kDebugLevelAnimator, "ScreenAnimator::fetchAnimHeight(0x%X, %d)", shape, mult);
+ debugC(9, kDebugLevelAnimator, "ScreenAnimator::fetchAnimHeight(0x%X, %d)", shape, mult);
if (_vm->features() & GF_TALKIE)
shape += 2;
return (int16)(((int8)*(shape+2)) * mult) >> 8;
}
void ScreenAnimator::setBrandonAnimSeqSize(int width, int height) {
- debug(9, kDebugLevelAnimator, "ScreenAnimator::setBrandonAnimSeqSize(%d, %d)", width, height);
+ debugC(9, kDebugLevelAnimator, "ScreenAnimator::setBrandonAnimSeqSize(%d, %d)", width, height);
restoreAllObjectBackgrounds();
_brandonAnimSeqSizeWidth = _actors[0].width;
_brandonAnimSeqSizeHeight = _actors[0].height;
@@ -599,7 +599,7 @@ void ScreenAnimator::setBrandonAnimSeqSize(int width, int height) {
}
void ScreenAnimator::resetBrandonAnimSeqSize() {
- debug(9, kDebugLevelAnimator, "ScreenAnimator::resetBrandonAnimSeqSize()");
+ debugC(9, kDebugLevelAnimator, "ScreenAnimator::resetBrandonAnimSeqSize()");
restoreAllObjectBackgrounds();
_actors[0].width = _brandonAnimSeqSizeWidth;
_actors[0].height = _brandonAnimSeqSizeHeight;
@@ -607,7 +607,7 @@ void ScreenAnimator::resetBrandonAnimSeqSize() {
}
void ScreenAnimator::animRefreshNPC(int character) {
- debug(9, kDebugLevelAnimator, "ScreenAnimator::animRefreshNPC(%d)", character);
+ debugC(9, kDebugLevelAnimator, "ScreenAnimator::animRefreshNPC(%d)", character);
AnimObject *animObj = &_actors[character];
Character *ch = &_vm->characterList()[character];
@@ -664,7 +664,7 @@ void ScreenAnimator::animRefreshNPC(int character) {
}
void ScreenAnimator::setCharacterDefaultFrame(int character) {
- debug(9, kDebugLevelAnimator, "ScreenAnimator::setCharacterDefaultFrame()");
+ debugC(9, kDebugLevelAnimator, "ScreenAnimator::setCharacterDefaultFrame()");
static uint16 initFrameTable[] = {
7, 41, 77, 0, 0
};
@@ -677,7 +677,7 @@ void ScreenAnimator::setCharacterDefaultFrame(int character) {
}
void ScreenAnimator::setCharactersHeight() {
- debug(9, kDebugLevelAnimator, "ScreenAnimator::setCharactersHeight()");
+ debugC(9, kDebugLevelAnimator, "ScreenAnimator::setCharactersHeight()");
static int8 initHeightTable[] = {
48, 40, 48, 47, 56,
44, 42, 47, 38, 35,
diff --git a/engines/kyra/debugger.cpp b/engines/kyra/debugger.cpp
index 24b51976ee..7497a8f7aa 100644
--- a/engines/kyra/debugger.cpp
+++ b/engines/kyra/debugger.cpp
@@ -45,7 +45,6 @@ Debugger::Debugger(KyraEngine *vm)
DCmd_Register("timers", &Debugger::cmd_listTimers);
DCmd_Register("settimercountdown", &Debugger::cmd_setTimerCountdown);
DCmd_Register("give", &Debugger::cmd_giveItem);
- DCmd_Register("toggle_debug", &Debugger::cmd_toggleDebug);
}
void Debugger::preEnter() {
@@ -204,62 +203,4 @@ bool Debugger::cmd_giveItem(int argc, const char **argv) {
return true;
}
-
-bool Debugger::cmd_toggleDebug(int argc, const char **argv) {
- if (argc < 2) {
- DebugPrintf("Syntax: toggle_debug <level>\n");
- DebugPrintf("Where level is one of:\n");
- DebugPrintf("ScriptFuncs, Script, Sprites, Screen, Sound, Animator, Main, GUI, Sequence, Movie\n");
- DebugPrintf("or: EALL for enabling all and DALL for disabling all\n");
- return true;
- }
-
- struct ArgList {
- const char* param;
- int level;
- };
-
- static const ArgList argList[] = {
- { "ScriptFuncs", kDebugLevelScriptFuncs },
- { "Script", kDebugLevelScript },
- { "Sprites", kDebugLevelSprites },
- { "Screen", kDebugLevelScreen },
- { "Sound", kDebugLevelSound },
- { "Animator", kDebugLevelAnimator },
- { "Main", kDebugLevelMain },
- { "GUI", kDebugLevelGUI },
- { "Sequence", kDebugLevelSequence },
- { "Movie", kDebugLevelMovie },
- { 0, 0 },
- };
-
- for (int i = 0; argList[i].param != 0; ++i) {
- if (!scumm_stricmp(argList[i].param, argv[1])) {
- if (!(_vm->debugLevels() & argList[i].level)) {
- _vm->enableDebugLevel(argList[i].level);
- DebugPrintf("Enabled debug level: '%s'\n", argList[i].param);
- } else {
- _vm->disableDebugLevel(argList[i].level);
- DebugPrintf("Disabled debug level: '%s'\n", argList[i].param);
- }
- return true;
- }
- }
-
- if (!scumm_stricmp("EALL", argv[1])) {
- for (int i = 0; argList[i].param != 0; ++i) {
- _vm->enableDebugLevel(argList[i].level);
- }
- DebugPrintf("Enabled all debug levels!\n");
- } else if (!scumm_stricmp("DALL", argv[1])) {
- for (int i = 0; argList[i].param != 0; ++i) {
- _vm->disableDebugLevel(argList[i].level);
- }
- DebugPrintf("Disabled all debug levels!\n");
- } else {
- DebugPrintf("Unknown debug level: '%s'\n", argv[1]);
- }
-
- return true;
-}
} // End of namespace Kyra
diff --git a/engines/kyra/debugger.h b/engines/kyra/debugger.h
index 65e1de383e..69766f3fc0 100644
--- a/engines/kyra/debugger.h
+++ b/engines/kyra/debugger.h
@@ -50,7 +50,6 @@ protected:
bool cmd_listTimers(int argc, const char **argv);
bool cmd_setTimerCountdown(int argc, const char **argv);
bool cmd_giveItem(int argc, const char **argv);
- bool cmd_toggleDebug(int argc, const char **argv);
};
} // End of namespace Kyra
diff --git a/engines/kyra/gui.cpp b/engines/kyra/gui.cpp
index 7a81c26b7c..1b41135767 100644
--- a/engines/kyra/gui.cpp
+++ b/engines/kyra/gui.cpp
@@ -589,7 +589,7 @@ void KyraEngine::gui_getInput() {
}
int KyraEngine::gui_resumeGame(Button *button) {
- debug(9, kDebugLevelGUI, "KyraEngine::gui_resumeGame()");
+ debugC(9, kDebugLevelGUI, "KyraEngine::gui_resumeGame()");
processMenuButton(button);
_displayMenu = false;
@@ -648,7 +648,7 @@ void KyraEngine::setupSavegames(Menu &menu, int num) {
}
int KyraEngine::gui_saveGameMenu(Button *button) {
- debug(9, kDebugLevelGUI, "KyraEngine::gui_saveGameMenu()");
+ debugC(9, kDebugLevelGUI, "KyraEngine::gui_saveGameMenu()");
processMenuButton(button);
_menu[2].item[5].enabled = true;
@@ -688,7 +688,7 @@ int KyraEngine::gui_saveGameMenu(Button *button) {
}
int KyraEngine::gui_loadGameMenu(Button *button) {
- debug(9, kDebugLevelGUI, "KyraEngine::gui_loadGameMenu()");
+ debugC(9, kDebugLevelGUI, "KyraEngine::gui_loadGameMenu()");
if (_menuDirectlyToLoad)
_menu[2].item[5].enabled = false;
else {
@@ -772,7 +772,7 @@ void KyraEngine::gui_updateSavegameString() {
}
int KyraEngine::gui_saveGame(Button *button) {
- debug(9, kDebugLevelGUI, "KyraEngine::gui_saveGame()");
+ debugC(9, kDebugLevelGUI, "KyraEngine::gui_saveGame()");
processMenuButton(button);
_gameToLoad = button->specialValue;
@@ -822,7 +822,7 @@ int KyraEngine::gui_saveGame(Button *button) {
}
int KyraEngine::gui_savegameConfirm(Button *button) {
- debug(9, kDebugLevelGUI, "KyraEngine::gui_savegameConfirm()");
+ debugC(9, kDebugLevelGUI, "KyraEngine::gui_savegameConfirm()");
processMenuButton(button);
_displaySubMenu = false;
@@ -830,7 +830,7 @@ int KyraEngine::gui_savegameConfirm(Button *button) {
}
int KyraEngine::gui_loadGame(Button *button) {
- debug(9, kDebugLevelGUI, "KyraEngine::gui_loadGame()");
+ debugC(9, kDebugLevelGUI, "KyraEngine::gui_loadGame()");
processMenuButton(button);
_displaySubMenu = false;
_gameToLoad = button->specialValue;
@@ -839,7 +839,7 @@ int KyraEngine::gui_loadGame(Button *button) {
}
int KyraEngine::gui_cancelSubMenu(Button *button) {
- debug(9, kDebugLevelGUI, "KyraEngine::gui_cancelLoadGameMenu()");
+ debugC(9, kDebugLevelGUI, "KyraEngine::gui_cancelLoadGameMenu()");
processMenuButton(button);
_displaySubMenu = false;
_cancelSubMenu = true;
@@ -848,7 +848,7 @@ int KyraEngine::gui_cancelSubMenu(Button *button) {
}
int KyraEngine::gui_quitPlaying(Button *button) {
- debug(9, kDebugLevelGUI, "KyraEngine::gui_quitPlaying()");
+ debugC(9, kDebugLevelGUI, "KyraEngine::gui_quitPlaying()");
processMenuButton(button);
if (gui_quitConfirm("Are you sure you want to quit playing?"))
@@ -862,7 +862,7 @@ int KyraEngine::gui_quitPlaying(Button *button) {
}
bool KyraEngine::gui_quitConfirm(const char *str) {
- debug(9, kDebugLevelGUI, "KyraEngine::gui_quitConfirm()");
+ debugC(9, kDebugLevelGUI, "KyraEngine::gui_quitConfirm()");
_screen->loadPageFromDisk("SEENPAGE.TMP", 0);
_screen->savePageToDisk("SEENPAGE.TMP", 0);
@@ -886,7 +886,7 @@ bool KyraEngine::gui_quitConfirm(const char *str) {
}
int KyraEngine::gui_quitConfirmYes(Button *button) {
- debug(9, kDebugLevelGUI, "KyraEngine::gui_quitConfirmYes()");
+ debugC(9, kDebugLevelGUI, "KyraEngine::gui_quitConfirmYes()");
processMenuButton(button);
_displaySubMenu = false;
_cancelSubMenu = false;
@@ -895,7 +895,7 @@ int KyraEngine::gui_quitConfirmYes(Button *button) {
}
int KyraEngine::gui_quitConfirmNo(Button *button) {
- debug(9, kDebugLevelGUI, "KyraEngine::gui_quitConfirmNo()");
+ debugC(9, kDebugLevelGUI, "KyraEngine::gui_quitConfirmNo()");
processMenuButton(button);
_displaySubMenu = false;
_cancelSubMenu = true;
@@ -904,7 +904,7 @@ int KyraEngine::gui_quitConfirmNo(Button *button) {
}
int KyraEngine::gui_scrollUp(Button *button) {
- debug(9, kDebugLevelGUI, "KyraEngine::gui_scrollUp()");
+ debugC(9, kDebugLevelGUI, "KyraEngine::gui_scrollUp()");
processMenuButton(button);
if (_savegameOffset > 0) {
@@ -916,7 +916,7 @@ int KyraEngine::gui_scrollUp(Button *button) {
}
int KyraEngine::gui_scrollDown(Button *button) {
- debug(9, kDebugLevelGUI, "KyraEngine::gui_scrollDown()");
+ debugC(9, kDebugLevelGUI, "KyraEngine::gui_scrollDown()");
processMenuButton(button);
_savegameOffset++;
diff --git a/engines/kyra/items.cpp b/engines/kyra/items.cpp
index fabf028c1f..e04f59898b 100644
--- a/engines/kyra/items.cpp
+++ b/engines/kyra/items.cpp
@@ -53,7 +53,7 @@ int KyraEngine::findDuplicateItemShape(int shape) {
}
void KyraEngine::addToNoDropRects(int x, int y, int w, int h) {
- debug(9, kDebugLevelMain, "KyraEngine::addToNoDropRects(%d, %d, %d, %d)", x, y, w, h);
+ debugC(9, kDebugLevelMain, "KyraEngine::addToNoDropRects(%d, %d, %d, %d)", x, y, w, h);
for (int rect = 0; rect < 11; ++rect) {
if (_noDropRects[rect].x == -1) {
_noDropRects[rect].x = x;
@@ -66,12 +66,12 @@ void KyraEngine::addToNoDropRects(int x, int y, int w, int h) {
}
void KyraEngine::clearNoDropRects() {
- debug(9, kDebugLevelMain, "KyraEngine::clearNoDropRects()");
+ debugC(9, kDebugLevelMain, "KyraEngine::clearNoDropRects()");
memset(_noDropRects, -1, sizeof(_noDropRects));
}
byte KyraEngine::findFreeItemInScene(int scene) {
- debug(9, kDebugLevelMain, "KyraEngine::findFreeItemInScene(%d)", scene);
+ debugC(9, kDebugLevelMain, "KyraEngine::findFreeItemInScene(%d)", scene);
assert(scene < _roomTableSize);
Room *room = &_roomTable[scene];
for (int i = 0; i < 12; ++i) {
@@ -82,7 +82,7 @@ byte KyraEngine::findFreeItemInScene(int scene) {
}
byte KyraEngine::findItemAtPos(int x, int y) {
- debug(9, kDebugLevelMain, "KyraEngine::findItemAtPos(%d, %d)", x, y);
+ debugC(9, kDebugLevelMain, "KyraEngine::findItemAtPos(%d, %d)", x, y);
assert(_currentCharacter->sceneId < _roomTableSize);
const uint8 *itemsTable = _roomTable[_currentCharacter->sceneId].itemsTable;
const uint16 *xposOffset = _roomTable[_currentCharacter->sceneId].itemsXPos;
@@ -118,7 +118,7 @@ byte KyraEngine::findItemAtPos(int x, int y) {
}
void KyraEngine::placeItemInGenericMapScene(int item, int index) {
- debug(9, kDebugLevelMain, "KyraEngine::placeItemInGenericMapScene(%d, %d)", item, index);
+ debugC(9, kDebugLevelMain, "KyraEngine::placeItemInGenericMapScene(%d, %d)", item, index);
static const uint16 itemMapSceneMinTable[] = {
0x0000, 0x0011, 0x006D, 0x0025, 0x00C7, 0x0000
};
@@ -175,7 +175,7 @@ void KyraEngine::placeItemInGenericMapScene(int item, int index) {
}
void KyraEngine::createMouseItem(int item) {
- debug(9, kDebugLevelMain, "KyraEngine::createMouseItem(%d)", item);
+ debugC(9, kDebugLevelMain, "KyraEngine::createMouseItem(%d)", item);
_screen->hideMouse();
setMouseItem(item);
_itemInHand = item;
@@ -183,7 +183,7 @@ void KyraEngine::createMouseItem(int item) {
}
void KyraEngine::destroyMouseItem() {
- debug(9, kDebugLevelMain, "KyraEngine::destroyMouseItem()");
+ debugC(9, kDebugLevelMain, "KyraEngine::destroyMouseItem()");
_screen->hideMouse();
_screen->setMouseCursor(1, 1, _shapes[4]);
_itemInHand = -1;
@@ -191,7 +191,7 @@ void KyraEngine::destroyMouseItem() {
}
void KyraEngine::setMouseItem(int item) {
- debug(9, kDebugLevelMain, "KyraEngine::setMouseItem(%d)", item);
+ debugC(9, kDebugLevelMain, "KyraEngine::setMouseItem(%d)", item);
if (item == -1) {
_screen->setMouseCursor(1, 1, _shapes[10]);
} else {
@@ -200,7 +200,7 @@ void KyraEngine::setMouseItem(int item) {
}
void KyraEngine::wipeDownMouseItem(int xpos, int ypos) {
- debug(9, kDebugLevelMain, "KyraEngine::wipeDownMouseItem(%d, %d)", xpos, ypos);
+ debugC(9, kDebugLevelMain, "KyraEngine::wipeDownMouseItem(%d, %d)", xpos, ypos);
if (_itemInHand == -1)
return;
xpos -= 8;
@@ -227,7 +227,7 @@ void KyraEngine::wipeDownMouseItem(int xpos, int ypos) {
}
void KyraEngine::setupSceneItems() {
- debug(9, kDebugLevelMain, "KyraEngine::setupSceneItems()");
+ debugC(9, kDebugLevelMain, "KyraEngine::setupSceneItems()");
uint16 sceneId = _currentCharacter->sceneId;
assert(sceneId < _roomTableSize);
Room *currentRoom = &_roomTable[sceneId];
@@ -267,7 +267,7 @@ void KyraEngine::setupSceneItems() {
}
int KyraEngine::countItemsInScene(uint16 sceneId) {
- debug(9, kDebugLevelMain, "KyraEngine::countItemsInScene(%d)", sceneId);
+ debugC(9, kDebugLevelMain, "KyraEngine::countItemsInScene(%d)", sceneId);
assert(sceneId < _roomTableSize);
Room *currentRoom = &_roomTable[sceneId];
@@ -283,7 +283,7 @@ int KyraEngine::countItemsInScene(uint16 sceneId) {
}
int KyraEngine::processItemDrop(uint16 sceneId, uint8 item, int x, int y, int unk1, int unk2) {
- debug(9, kDebugLevelMain, "KyraEngine::processItemDrop(%d, %d, %d, %d, %d, %d)", sceneId, item, x, y, unk1, unk2);
+ debugC(9, kDebugLevelMain, "KyraEngine::processItemDrop(%d, %d, %d, %d, %d, %d)", sceneId, item, x, y, unk1, unk2);
int freeItem = -1;
uint8 itemIndex = findItemAtPos(x, y);
if (unk1) {
@@ -448,7 +448,7 @@ int KyraEngine::processItemDrop(uint16 sceneId, uint8 item, int x, int y, int un
}
void KyraEngine::exchangeItemWithMouseItem(uint16 sceneId, int itemIndex) {
- debug(9, kDebugLevelMain, "KyraEngine::exchangeItemWithMouseItem(%d, %d)", sceneId, itemIndex);
+ debugC(9, kDebugLevelMain, "KyraEngine::exchangeItemWithMouseItem(%d, %d)", sceneId, itemIndex);
_screen->hideMouse();
_animator->animRemoveGameItem(itemIndex);
assert(sceneId < _roomTableSize);
@@ -468,7 +468,7 @@ void KyraEngine::exchangeItemWithMouseItem(uint16 sceneId, int itemIndex) {
}
void KyraEngine::addItemToRoom(uint16 sceneId, uint8 item, int itemIndex, int x, int y) {
- debug(9, kDebugLevelMain, "KyraEngine::addItemToRoom(%d, %d, %d, %d, %d)", sceneId, item, itemIndex, x, y);
+ debugC(9, kDebugLevelMain, "KyraEngine::addItemToRoom(%d, %d, %d, %d, %d)", sceneId, item, itemIndex, x, y);
assert(sceneId < _roomTableSize);
Room *currentRoom = &_roomTable[sceneId];
currentRoom->itemsTable[itemIndex] = item;
@@ -478,7 +478,7 @@ void KyraEngine::addItemToRoom(uint16 sceneId, uint8 item, int itemIndex, int x,
}
int KyraEngine::checkNoDropRects(int x, int y) {
- debug(9, kDebugLevelMain, "KyraEngine::checkNoDropRects(%d, %d)", x, y);
+ debugC(9, kDebugLevelMain, "KyraEngine::checkNoDropRects(%d, %d)", x, y);
if (_lastProcessedItemHeight < 1 || _lastProcessedItemHeight > 16) {
_lastProcessedItemHeight = 16;
}
@@ -511,7 +511,7 @@ int KyraEngine::checkNoDropRects(int x, int y) {
}
int KyraEngine::isDropable(int x, int y) {
- debug(9, kDebugLevelMain, "KyraEngine::isDropable(%d, %d)", x, y);
+ debugC(9, kDebugLevelMain, "KyraEngine::isDropable(%d, %d)", x, y);
x -= 8;
y -= 1;
@@ -528,7 +528,7 @@ int KyraEngine::isDropable(int x, int y) {
}
void KyraEngine::itemDropDown(int x, int y, int destX, int destY, byte freeItem, int item) {
- debug(9, kDebugLevelMain, "KyraEngine::itemDropDown(%d, %d, %d, %d, %d, %d)", x, y, destX, destY, freeItem, item);
+ debugC(9, kDebugLevelMain, "KyraEngine::itemDropDown(%d, %d, %d, %d, %d, %d)", x, y, destX, destY, freeItem, item);
assert(_currentCharacter->sceneId < _roomTableSize);
Room *currentRoom = &_roomTable[_currentCharacter->sceneId];
if (x == destX && y == destY) {
@@ -622,7 +622,7 @@ void KyraEngine::itemDropDown(int x, int y, int destX, int destY, byte freeItem,
}
void KyraEngine::dropItem(int unk1, int item, int x, int y, int unk2) {
- debug(9, kDebugLevelMain, "KyraEngine::dropItem(%d, %d, %d, %d, %d)", unk1, item, x, y, unk2);
+ debugC(9, kDebugLevelMain, "KyraEngine::dropItem(%d, %d, %d, %d, %d)", unk1, item, x, y, unk2);
if (processItemDrop(_currentCharacter->sceneId, item, x, y, unk1, unk2))
return;
snd_playSoundEffect(54);
@@ -636,7 +636,7 @@ void KyraEngine::dropItem(int unk1, int item, int x, int y, int unk2) {
}
void KyraEngine::itemSpecialFX(int x, int y, int item) {
- debug(9, kDebugLevelMain, "KyraEngine::itemSpecialFX(%d, %d, %d)", x, y, item);
+ debugC(9, kDebugLevelMain, "KyraEngine::itemSpecialFX(%d, %d, %d)", x, y, item);
if (item == 41) {
itemSpecialFX1(x, y, item);
} else {
@@ -645,7 +645,7 @@ void KyraEngine::itemSpecialFX(int x, int y, int item) {
}
void KyraEngine::itemSpecialFX1(int x, int y, int item) {
- debug(9, kDebugLevelMain, "KyraEngine::itemSpecialFX1(%d, %d, %d)", x, y, item);
+ debugC(9, kDebugLevelMain, "KyraEngine::itemSpecialFX1(%d, %d, %d)", x, y, item);
uint8 *shape = _shapes[220+item];
x -= 8;
int startY = y;
@@ -669,7 +669,7 @@ void KyraEngine::itemSpecialFX1(int x, int y, int item) {
}
void KyraEngine::itemSpecialFX2(int x, int y, int item) {
- debug(9, kDebugLevelMain, "KyraEngine::itemSpecialFX2(%d, %d, %d)", x, y, item);
+ debugC(9, kDebugLevelMain, "KyraEngine::itemSpecialFX2(%d, %d, %d)", x, y, item);
x -= 8;
y -= 15;
int yAdd = (int8)(((16 - _itemTable[item].height) >> 1) & 0xFF);
@@ -704,7 +704,7 @@ void KyraEngine::itemSpecialFX2(int x, int y, int item) {
}
void KyraEngine::magicOutMouseItem(int animIndex, int itemPos) {
- debug(9, kDebugLevelMain, "KyraEngine::magicOutMouseItem(%d, %d)", animIndex, itemPos);
+ debugC(9, kDebugLevelMain, "KyraEngine::magicOutMouseItem(%d, %d)", animIndex, itemPos);
int videoPageBackUp = _screen->_curPage;
_screen->_curPage = 0;
int x = 0, y = 0;
@@ -797,7 +797,7 @@ void KyraEngine::magicOutMouseItem(int animIndex, int itemPos) {
}
void KyraEngine::magicInMouseItem(int animIndex, int item, int itemPos) {
- debug(9, kDebugLevelMain, "KyraEngine::magicInMouseItem(%d, %d, %d)", animIndex, item, itemPos);
+ debugC(9, kDebugLevelMain, "KyraEngine::magicInMouseItem(%d, %d, %d)", animIndex, item, itemPos);
int videoPageBackUp = _screen->_curPage;
_screen->_curPage = 0;
int x = 0, y = 0;
@@ -878,7 +878,7 @@ void KyraEngine::magicInMouseItem(int animIndex, int item, int itemPos) {
}
void KyraEngine::specialMouseItemFX(int shape, int x, int y, int animIndex, int tableIndex, int loopStart, int maxLoops) {
- debug(9, kDebugLevelMain, "KyraEngine::specialMouseItemFX(%d, %d, %d, %d, %d, %d, %d)", shape, x, y, animIndex, tableIndex, loopStart, maxLoops);
+ debugC(9, kDebugLevelMain, "KyraEngine::specialMouseItemFX(%d, %d, %d, %d, %d, %d, %d)", shape, x, y, animIndex, tableIndex, loopStart, maxLoops);
static const uint8 table1[] = {
0x23, 0x45, 0x55, 0x72, 0x84, 0xCF, 0x00, 0x00
};
@@ -902,7 +902,7 @@ void KyraEngine::specialMouseItemFX(int shape, int x, int y, int animIndex, int
}
void KyraEngine::processSpecialMouseItemFX(int shape, int x, int y, int tableValue, int loopStart, int maxLoops) {
- debug(9, kDebugLevelMain, "KyraEngine::processSpecialMouseItemFX(%d, %d, %d, %d, %d, %d)", shape, x, y, tableValue, loopStart, maxLoops);
+ debugC(9, kDebugLevelMain, "KyraEngine::processSpecialMouseItemFX(%d, %d, %d, %d, %d, %d)", shape, x, y, tableValue, loopStart, maxLoops);
uint8 shapeColorTable[16];
uint8 *shapePtr = _shapes[4+shape] + 10;
if (_features & GF_TALKIE)
@@ -921,7 +921,7 @@ void KyraEngine::processSpecialMouseItemFX(int shape, int x, int y, int tableVal
}
void KyraEngine::updatePlayerItemsForScene() {
- debug(9, kDebugLevelMain, "KyraEngine::updatePlayerItemsForScene()");
+ debugC(9, kDebugLevelMain, "KyraEngine::updatePlayerItemsForScene()");
if (_itemInHand >= 29 && _itemInHand < 33) {
++_itemInHand;
if (_itemInHand > 33)
diff --git a/engines/kyra/kyra.cpp b/engines/kyra/kyra.cpp
index 833aace112..a2f38669f5 100644
--- a/engines/kyra/kyra.cpp
+++ b/engines/kyra/kyra.cpp
@@ -209,33 +209,8 @@ REGISTER_PLUGIN(KYRA, "Legend of Kyrandia Engine")
namespace Kyra {
-// never use this!
-KyraEngine *gKyraEngine = 0;
-void debug(int level, int level2, const char *s, ...) {
- if (!(gKyraEngine->debugLevels() & level2))
- return;
- char buf[120];
- va_list va;
- va_start(va, s);
- vsnprintf(buf, 120, s, va);
- va_end(va);
- ::debug(level, buf);
-}
-
KyraEngine::KyraEngine(GameDetector *detector, OSystem *system)
: Engine(system) {
- gKyraEngine = this;
-
- // if we have an debug level enable all by default for now
- if (gDebugLevel != -1) {
- _debugLevelsEnabled = kDebugLevelScriptFuncs | kDebugLevelScript | kDebugLevelSprites |
- kDebugLevelScreen | kDebugLevelSound | kDebugLevelAnimator |
- kDebugLevelMain | kDebugLevelGUI | kDebugLevelSequence |
- kDebugLevelMovie;
- } else {
- _debugLevelsEnabled = 0;
- }
-
_seq_Forest = _seq_KallakWriting = _seq_KyrandiaLogo = _seq_KallakMalcolm =
_seq_MalcolmTree = _seq_WestwoodLogo = _seq_Demo1 = _seq_Demo2 = _seq_Demo3 =
_seq_Demo4 = 0;
@@ -271,6 +246,18 @@ KyraEngine::KyraEngine(GameDetector *detector, OSystem *system)
_mixer->setVolumeForSoundType(Audio::Mixer::kMusicSoundType, ConfMan.getInt("music_volume"));
_mixer->setVolumeForSoundType(Audio::Mixer::kSpeechSoundType, ConfMan.getInt("speech_volume"));
+ // sets up all engine specific debug levels
+ Common::addSpecialDebugLevel(kDebugLevelScriptFuncs, "ScriptFuncs", "Script function debug level");
+ Common::addSpecialDebugLevel(kDebugLevelScript, "Script", "Script interpreter debug level");
+ Common::addSpecialDebugLevel(kDebugLevelSprites, "Sprites", "Sprite debug level");
+ Common::addSpecialDebugLevel(kDebugLevelScreen, "Screen", "Screen debug level");
+ Common::addSpecialDebugLevel(kDebugLevelSound, "Sound", "Sound debug level");
+ Common::addSpecialDebugLevel(kDebugLevelAnimator, "Animator", "Animator debug level");
+ Common::addSpecialDebugLevel(kDebugLevelMain, "Main", "Generic debug level");
+ Common::addSpecialDebugLevel(kDebugLevelGUI, "GUI", "GUI debug level");
+ Common::addSpecialDebugLevel(kDebugLevelSequence, "Sequence", "Sequence debug level");
+ Common::addSpecialDebugLevel(kDebugLevelMovie, "Movie", "Movie debug level");
+
// Detect game features based on MD5. Again brutally ripped from Gobliins.
uint8 md5sum[16];
char md5str[32 + 1];
@@ -543,6 +530,8 @@ KyraEngine::~KyraEngine() {
for (int i = 0; i < ARRAYSIZE(_sceneAnimTable); ++i) {
free(_sceneAnimTable[i]);
}
+
+ Common::clearAllSpecialDebugLevels();
}
void KyraEngine::errorString(const char *buf1, char *buf2) {
@@ -580,7 +569,7 @@ int KyraEngine::go() {
}
void KyraEngine::startup() {
- debug( 9, kDebugLevelMain, "KyraEngine::startup()");
+ debugC(9, kDebugLevelMain, "KyraEngine::startup()");
static const uint8 colorMap[] = { 0, 0, 0, 0, 12, 12, 12, 0, 0, 0, 0, 0 };
_screen->setTextColorMap(colorMap);
// _screen->setFont(Screen::FID_6_FNT);
@@ -660,7 +649,7 @@ void KyraEngine::startup() {
}
void KyraEngine::mainLoop() {
- debug( 9, kDebugLevelMain, "KyraEngine::mainLoop()");
+ debugC(9, kDebugLevelMain, "KyraEngine::mainLoop()");
while (!_quitFlag) {
int32 frameTime = (int32)_system->getMillis();
@@ -845,7 +834,7 @@ void KyraEngine::delayWithTicks(int ticks) {
#pragma mark -
void KyraEngine::setupShapes123(const Shape *shapeTable, int endShape, int flags) {
- debug( 9, kDebugLevelMain, "KyraEngine::setupShapes123(0x%X, startShape, flags)", shapeTable, endShape, flags);
+ debugC(9, kDebugLevelMain, "KyraEngine::setupShapes123(0x%X, startShape, flags)", shapeTable, endShape, flags);
for (int i = 123; i <= 172; ++i) {
_shapes[4+i] = NULL;
}
@@ -873,7 +862,7 @@ void KyraEngine::setupShapes123(const Shape *shapeTable, int endShape, int flags
}
void KyraEngine::freeShapes123() {
- debug( 9, kDebugLevelMain, "KyraEngine::freeShapes123()");
+ debugC(9, kDebugLevelMain, "KyraEngine::freeShapes123()");
for (int i = 123; i <= 172; ++i) {
free(_shapes[4+i]);
_shapes[4+i] = NULL;
@@ -904,7 +893,7 @@ int KyraEngine::resetGameFlag(int flag) {
}
void KyraEngine::setBrandonPoisonFlags(int reset) {
- debug( 9, kDebugLevelMain, "KyraEngine::setBrandonPoisonFlags(%d)", reset);
+ debugC(9, kDebugLevelMain, "KyraEngine::setBrandonPoisonFlags(%d)", reset);
_brandonStatusBit |= 1;
if (reset)
_poisonDeathCounter = 0;
@@ -919,7 +908,7 @@ void KyraEngine::setBrandonPoisonFlags(int reset) {
}
void KyraEngine::resetBrandonPoisonFlags() {
- debug( 9, kDebugLevelMain, "KyraEngine::resetBrandonPoisonFlags()");
+ debugC(9, kDebugLevelMain, "KyraEngine::resetBrandonPoisonFlags()");
_brandonStatusBit = 0;
for (int i = 0; i < 0x100; ++i) {
_brandonPoisonFlagsGFX[i] = i;
@@ -931,7 +920,7 @@ void KyraEngine::resetBrandonPoisonFlags() {
#pragma mark -
void KyraEngine::processInput(int xpos, int ypos) {
- debug( 9, kDebugLevelMain, "KyraEngine::processInput(%d, %d)", xpos, ypos);
+ debugC(9, kDebugLevelMain, "KyraEngine::processInput(%d, %d)", xpos, ypos);
_abortWalkFlag2 = false;
if (processInputHelper(xpos, ypos)) {
@@ -991,7 +980,7 @@ void KyraEngine::processInput(int xpos, int ypos) {
}
int KyraEngine::processInputHelper(int xpos, int ypos) {
- debug( 9, kDebugLevelMain, "KyraEngine::processInputHelper(%d, %d)", xpos, ypos);
+ debugC(9, kDebugLevelMain, "KyraEngine::processInputHelper(%d, %d)", xpos, ypos);
uint8 item = findItemAtPos(xpos, ypos);
if (item != 0xFF) {
if (_itemInHand == -1) {
@@ -1018,7 +1007,7 @@ int KyraEngine::processInputHelper(int xpos, int ypos) {
}
int KyraEngine::clickEventHandler(int xpos, int ypos) {
- debug( 9, kDebugLevelMain, "KyraEngine::clickEventHandler(%d, %d)", xpos, ypos);
+ debugC(9, kDebugLevelMain, "KyraEngine::clickEventHandler(%d, %d)", xpos, ypos);
_scriptInterpreter->initScript(_scriptClick, _scriptClickData);
_scriptClick->variables[1] = xpos;
_scriptClick->variables[2] = ypos;
@@ -1146,7 +1135,7 @@ void KyraEngine::updateMousePointer(bool forceUpdate) {
}
bool KyraEngine::hasClickedOnExit(int xpos, int ypos) {
- debug( 9, kDebugLevelMain, "KyraEngine::hasClickedOnExit(%d, %d)", xpos, ypos);
+ debugC(9, kDebugLevelMain, "KyraEngine::hasClickedOnExit(%d, %d)", xpos, ypos);
if (xpos < 16 || xpos >= 304) {
return true;
}
@@ -1159,7 +1148,7 @@ bool KyraEngine::hasClickedOnExit(int xpos, int ypos) {
}
void KyraEngine::clickEventHandler2() {
- debug( 9, kDebugLevelMain, "KyraEngine::clickEventHandler2()");
+ debugC(9, kDebugLevelMain, "KyraEngine::clickEventHandler2()");
_scriptInterpreter->initScript(_scriptClick, _scriptClickData);
_scriptClick->variables[0] = _currentCharacter->sceneId;
_scriptClick->variables[1] = _mouseX;
@@ -1173,7 +1162,7 @@ void KyraEngine::clickEventHandler2() {
}
int KyraEngine::checkForNPCScriptRun(int xpos, int ypos) {
- debug( 9, kDebugLevelMain, "KyraEngine::checkForNPCScriptRun(%d, %d)", xpos, ypos);
+ debugC(9, kDebugLevelMain, "KyraEngine::checkForNPCScriptRun(%d, %d)", xpos, ypos);
int returnValue = -1;
const Character *currentChar = _currentCharacter;
int charLeft = 0, charRight = 0, charTop = 0, charBottom = 0;
@@ -1227,7 +1216,7 @@ int KyraEngine::checkForNPCScriptRun(int xpos, int ypos) {
}
void KyraEngine::runNpcScript(int func) {
- debug( 9, kDebugLevelMain, "KyraEngine::runNpcScript(%d)", func);
+ debugC(9, kDebugLevelMain, "KyraEngine::runNpcScript(%d)", func);
_scriptInterpreter->initScript(_npcScript, _npcScriptData);
_scriptInterpreter->startScript(_npcScript, func);
_npcScript->variables[0] = _currentCharacter->sceneId;
diff --git a/engines/kyra/kyra.h b/engines/kyra/kyra.h
index 0f1554d87a..80d5d49389 100644
--- a/engines/kyra/kyra.h
+++ b/engines/kyra/kyra.h
@@ -80,9 +80,6 @@ enum kDebugLevels {
kDebugLevelMovie = 1 << 9 // prints debug output of movie specific funtions
};
-// our intern debug function
-void debug(int level, int level2, const char *s, ...);
-
struct Character {
uint16 sceneId;
uint8 height;
@@ -264,10 +261,6 @@ public:
uint8 game() const { return _game; }
uint32 features() const { return _features; }
-
- void enableDebugLevel(int level) { _debugLevelsEnabled |= level; }
- void disableDebugLevel(int level) { _debugLevelsEnabled &= ~level; }
- int debugLevels() const { return _debugLevelsEnabled; }
uint8 **shapes() { return _shapes; }
Character *currentCharacter() { return _currentCharacter; }
@@ -691,8 +684,6 @@ protected:
void gui_redrawTextfield();
void gui_fadePalette();
void gui_restorePalette();
-
- int _debugLevelsEnabled; // the enabled debug levels
uint8 _game;
bool _quitFlag;
diff --git a/engines/kyra/resource.cpp b/engines/kyra/resource.cpp
index 6ad6e8af07..c4c0bd7b24 100644
--- a/engines/kyra/resource.cpp
+++ b/engines/kyra/resource.cpp
@@ -93,7 +93,7 @@ Resource::Resource(KyraEngine *engine) {
_pakfiles.push_back(newPak);
else {
delete file;
- ::debug(3, "couldn't load file '%s' correctly", usedFilelist[tmp]);
+ debug(3, "couldn't load file '%s' correctly", usedFilelist[tmp]);
}
}
}
@@ -211,7 +211,7 @@ PAKFile::PAKFile(const Common::String& file) {
_open = false;
if (!pakfile.open(file.c_str())) {
- ::debug(3, "couldn't open pakfile '%s'\n", file.c_str());
+ debug(3, "couldn't open pakfile '%s'\n", file.c_str());
return;
}
@@ -283,7 +283,7 @@ uint8 *PAKFile::getFile(const char *file) {
if (!scumm_stricmp((*start)->_name, file)) {
Common::File pakfile;
if (!pakfile.open(_filename)) {
- ::debug(3, "couldn't open pakfile '%s'\n", _filename);
+ debug(3, "couldn't open pakfile '%s'\n", _filename);
return 0;
}
pakfile.seek((*start)->_start);
@@ -302,7 +302,7 @@ bool PAKFile::getFileHandle(const char *file, Common::File &filehandle) {
for (PAKFile_Iterate) {
if (!scumm_stricmp((*start)->_name, file)) {
if (!filehandle.open(_filename)) {
- ::debug(3, "couldn't open pakfile '%s'\n", _filename);
+ debug(3, "couldn't open pakfile '%s'\n", _filename);
return 0;
}
filehandle.seek((*start)->_start);
@@ -321,26 +321,26 @@ uint32 PAKFile::getFileSize(const char* file) {
}
void KyraEngine::loadPalette(const char *filename, uint8 *palData) {
- debug( 9, kDebugLevelMain, "KyraEngine::loadPalette('%s' 0x%X)", filename, palData);
+ debugC( 9, kDebugLevelMain, "KyraEngine::loadPalette('%s' 0x%X)", filename, palData);
uint32 fileSize = 0;
uint8 *srcData = _res->fileData(filename, &fileSize);
if (palData && fileSize) {
- debug( 9, kDebugLevelMain,"Loading a palette of size %i from '%s'", fileSize, filename);
+ debugC( 9, kDebugLevelMain,"Loading a palette of size %i from '%s'", fileSize, filename);
memcpy(palData, srcData, fileSize);
}
delete [] srcData;
}
void KyraEngine::loadBitmap(const char *filename, int tempPage, int dstPage, uint8 *palData) {
- debug( 9, kDebugLevelMain,"KyraEngine::copyBitmap('%s', %d, %d, 0x%X)", filename, tempPage, dstPage, palData);
+ debugC( 9, kDebugLevelMain,"KyraEngine::copyBitmap('%s', %d, %d, 0x%X)", filename, tempPage, dstPage, palData);
uint32 fileSize;
uint8 *srcData = _res->fileData(filename, &fileSize);
uint8 compType = srcData[2];
uint32 imgSize = READ_LE_UINT32(srcData + 4);
uint16 palSize = READ_LE_UINT16(srcData + 8);
if (palData && palSize) {
- debug( 9, kDebugLevelMain,"Loading a palette of size %i from %s", palSize, filename);
+ debugC( 9, kDebugLevelMain,"Loading a palette of size %i from %s", palSize, filename);
memcpy(palData, srcData + 10, palSize);
}
uint8 *srcPtr = srcData + 10 + palSize;
diff --git a/engines/kyra/saveload.cpp b/engines/kyra/saveload.cpp
index 819d187ff5..8471c2ae77 100644
--- a/engines/kyra/saveload.cpp
+++ b/engines/kyra/saveload.cpp
@@ -32,7 +32,7 @@
namespace Kyra {
void KyraEngine::loadGame(const char *fileName) {
- debug(9, kDebugLevelMain, "loadGame('%s')", fileName);
+ debugC(9, kDebugLevelMain, "loadGame('%s')", fileName);
Common::InSaveFile *in;
if (!(in = _saveFileMan->openForLoading(fileName))) {
@@ -218,13 +218,13 @@ void KyraEngine::loadGame(const char *fileName) {
if (in->ioFailed())
error("Load failed.");
else
- debug(1, kDebugLevelMain, "Loaded savegame '%s.'", saveName);
+ debugC(1, kDebugLevelMain, "Loaded savegame '%s.'", saveName);
delete in;
}
void KyraEngine::saveGame(const char *fileName, const char *saveName) {
- debug(9, kDebugLevelMain, "saveGame('%s', '%s')", fileName, saveName);
+ debugC(9, kDebugLevelMain, "saveGame('%s', '%s')", fileName, saveName);
Common::OutSaveFile *out;
if (!(out = _saveFileMan->openForSaving(fileName))) {
@@ -312,7 +312,7 @@ void KyraEngine::saveGame(const char *fileName, const char *saveName) {
if (out->ioFailed())
warning("Can't write file '%s'. (Disk full?)", fileName);
else
- debug(1, kDebugLevelMain, "Saved game '%s.'", saveName);
+ debugC(1, kDebugLevelMain, "Saved game '%s.'", saveName);
delete out;
}
diff --git a/engines/kyra/scene.cpp b/engines/kyra/scene.cpp
index 2697fd22f4..ef8e8089a3 100644
--- a/engines/kyra/scene.cpp
+++ b/engines/kyra/scene.cpp
@@ -37,7 +37,7 @@
namespace Kyra {
void KyraEngine::enterNewScene(int sceneId, int facing, int unk1, int unk2, int brandonAlive) {
- debug(9, kDebugLevelMain, "KyraEngine::enterNewScene(%d, %d, %d, %d, %d)", sceneId, facing, unk1, unk2, brandonAlive);
+ debugC(9, kDebugLevelMain, "KyraEngine::enterNewScene(%d, %d, %d, %d, %d)", sceneId, facing, unk1, unk2, brandonAlive);
int unkVar1 = 1;
_screen->hideMouse();
_handleInput = false;
@@ -206,7 +206,7 @@ void KyraEngine::enterNewScene(int sceneId, int facing, int unk1, int unk2, int
}
void KyraEngine::transcendScenes(int roomIndex, int roomName) {
- debug(9, kDebugLevelMain, "KyraEngine::transcendScenes(%d, %d)", roomIndex, roomName);
+ debugC(9, kDebugLevelMain, "KyraEngine::transcendScenes(%d, %d)", roomIndex, roomName);
assert(roomIndex < _roomTableSize);
if (_features & GF_TALKIE) {
char file[32];
@@ -230,13 +230,13 @@ void KyraEngine::transcendScenes(int roomIndex, int roomName) {
}
void KyraEngine::setSceneFile(int roomIndex, int roomName) {
- debug(9, kDebugLevelMain, "KyraEngine::setSceneFile(%d, %d)", roomIndex, roomName);
+ debugC(9, kDebugLevelMain, "KyraEngine::setSceneFile(%d, %d)", roomIndex, roomName);
assert(roomIndex < _roomTableSize);
_roomTable[roomIndex].nameIndex = roomName;
}
void KyraEngine::moveCharacterToPos(int character, int facing, int xpos, int ypos) {
- debug(9, kDebugLevelMain, "KyraEngine::moveCharacterToPos(%d, %d, %d, %d)", character, facing, xpos, ypos);
+ debugC(9, kDebugLevelMain, "KyraEngine::moveCharacterToPos(%d, %d, %d, %d)", character, facing, xpos, ypos);
Character *ch = &_characterList[character];
ch->facing = facing;
_screen->hideMouse();
@@ -289,7 +289,7 @@ void KyraEngine::moveCharacterToPos(int character, int facing, int xpos, int ypo
}
void KyraEngine::setCharacterPositionWithUpdate(int character) {
- debug(9, kDebugLevelMain, "KyraEngine::setCharacterPositionWithUpdate(%d)", character);
+ debugC(9, kDebugLevelMain, "KyraEngine::setCharacterPositionWithUpdate(%d)", character);
setCharacterPosition(character, 0);
_sprites->updateSceneAnims();
updateGameTimers();
@@ -302,7 +302,7 @@ void KyraEngine::setCharacterPositionWithUpdate(int character) {
}
int KyraEngine::setCharacterPosition(int character, int *facingTable) {
- debug(9, kDebugLevelMain, "KyraEngine::setCharacterPosition(%d, 0x%X)", character, facingTable);
+ debugC(9, kDebugLevelMain, "KyraEngine::setCharacterPosition(%d, 0x%X)", character, facingTable);
if (character == 0) {
_currentCharacter->x1 += _charXPosTable[_currentCharacter->facing];
_currentCharacter->y1 += _charYPosTable[_currentCharacter->facing];
@@ -319,7 +319,7 @@ int KyraEngine::setCharacterPosition(int character, int *facingTable) {
}
void KyraEngine::setCharacterPositionHelper(int character, int *facingTable) {
- debug(9, kDebugLevelMain, "KyraEngine::setCharacterPositionHelper(%d, 0x%X)", character, facingTable);
+ debugC(9, kDebugLevelMain, "KyraEngine::setCharacterPositionHelper(%d, 0x%X)", character, facingTable);
Character *ch = &_characterList[character];
++ch->currentAnimFrame;
int facing = ch->facing;
@@ -415,7 +415,7 @@ void KyraEngine::setCharacterPositionHelper(int character, int *facingTable) {
}
int KyraEngine::getOppositeFacingDirection(int dir) {
- debug(9, kDebugLevelMain, "KyraEngine::getOppositeFacingDirection(%d)", dir);
+ debugC(9, kDebugLevelMain, "KyraEngine::getOppositeFacingDirection(%d)", dir);
switch (dir) {
case 0:
return 2;
@@ -463,7 +463,7 @@ void KyraEngine::loadSceneMSC() {
}
void KyraEngine::startSceneScript(int brandonAlive) {
- debug(9, kDebugLevelMain, "KyraEngine::startSceneScript(%d)", brandonAlive);
+ debugC(9, kDebugLevelMain, "KyraEngine::startSceneScript(%d)", brandonAlive);
assert(_currentCharacter->sceneId < _roomTableSize);
int tableId = _roomTable[_currentCharacter->sceneId].nameIndex;
assert(tableId < _roomFilenameTableSize);
@@ -497,7 +497,7 @@ void KyraEngine::startSceneScript(int brandonAlive) {
}
void KyraEngine::initSceneData(int facing, int unk1, int brandonAlive) {
- debug(9, kDebugLevelMain, "KyraEngine::initSceneData(%d, %d, %d)", facing, unk1, brandonAlive);
+ debugC(9, kDebugLevelMain, "KyraEngine::initSceneData(%d, %d, %d)", facing, unk1, brandonAlive);
int16 xpos2 = 0;
int setFacing = 1;
@@ -675,7 +675,7 @@ void KyraEngine::initSceneData(int facing, int unk1, int brandonAlive) {
}
void KyraEngine::initSceneObjectList(int brandonAlive) {
- debug(9, kDebugLevelMain, "KyraEngine::initSceneObjectList(%d)", brandonAlive);
+ debugC(9, kDebugLevelMain, "KyraEngine::initSceneObjectList(%d)", brandonAlive);
for (int i = 0; i < 28; ++i) {
_animator->actors()[i].active = 0;
}
@@ -878,7 +878,7 @@ void KyraEngine::initSceneScreen(int brandonAlive) {
}
int KyraEngine::handleSceneChange(int xpos, int ypos, int unk1, int frameReset) {
- debug(9, kDebugLevelMain, "KyraEngine::handleSceneChange(%d, %d, %d, %d)", xpos, ypos, unk1, frameReset);
+ debugC(9, kDebugLevelMain, "KyraEngine::handleSceneChange(%d, %d, %d, %d)", xpos, ypos, unk1, frameReset);
if (queryGameFlag(0xEF)) {
unk1 = 0;
}
@@ -936,7 +936,7 @@ int KyraEngine::handleSceneChange(int xpos, int ypos, int unk1, int frameReset)
}
int KyraEngine::processSceneChange(int *table, int unk1, int frameReset) {
- debug(9, kDebugLevelMain, "KyraEngine::processSceneChange(0x%X, %d, %d)", table, unk1, frameReset);
+ debugC(9, kDebugLevelMain, "KyraEngine::processSceneChange(0x%X, %d, %d)", table, unk1, frameReset);
if (queryGameFlag(0xEF)) {
unk1 = 0;
}
@@ -1033,7 +1033,7 @@ int KyraEngine::processSceneChange(int *table, int unk1, int frameReset) {
}
int KyraEngine::changeScene(int facing) {
- debug(9, kDebugLevelMain, "KyraEngine::changeScene(%d)", facing);
+ debugC(9, kDebugLevelMain, "KyraEngine::changeScene(%d)", facing);
if (queryGameFlag(0xEF)) {
if (_currentCharacter->sceneId == 5) {
return 0;
@@ -1191,7 +1191,7 @@ void KyraEngine::setCharactersPositions(int character) {
#pragma mark -
int KyraEngine::findWay(int x, int y, int toX, int toY, int *moveTable, int moveTableSize) {
- debug(9, kDebugLevelMain, "KyraEngine::findWay(%d, %d, %d, %d, 0x%X, %d)", x, y, toX, toY, moveTable, moveTableSize);
+ debugC(9, kDebugLevelMain, "KyraEngine::findWay(%d, %d, %d, %d, 0x%X, %d)", x, y, toX, toY, moveTable, moveTableSize);
x &= 0xFFFC; toX &= 0xFFFC;
y &= 0xFFFE; toY &= 0xFFFE;
x = (int16)x; y = (int16)y; toX = (int16)toX; toY = (int16)toY;
@@ -1307,7 +1307,7 @@ int KyraEngine::findWay(int x, int y, int toX, int toY, int *moveTable, int move
}
int KyraEngine::findSubPath(int x, int y, int toX, int toY, int *moveTable, int start, int end) {
- debug(9, kDebugLevelMain, "KyraEngine::findSubPath(%d, %d, %d, %d, 0x%X, %d, %d)", x, y, toX, toY, moveTable, start, end);
+ debugC(9, kDebugLevelMain, "KyraEngine::findSubPath(%d, %d, %d, %d, 0x%X, %d, %d)", x, y, toX, toY, moveTable, start, end);
// only used for debug specific code
//static uint16 unkTable[] = { 8, 5 };
static const int8 facingTable1[] = { 7, 0, 1, 2, 3, 4, 5, 6, 1, 2, 3, 4, 5, 6, 7, 0 };
@@ -1376,7 +1376,7 @@ int KyraEngine::findSubPath(int x, int y, int toX, int toY, int *moveTable, int
}
int KyraEngine::getFacingFromPointToPoint(int x, int y, int toX, int toY) {
- debug(9, kDebugLevelMain, "KyraEngine::getFacingFromPointToPoint(%d, %d, %d, %d)", x, y, toX, toY);
+ debugC(9, kDebugLevelMain, "KyraEngine::getFacingFromPointToPoint(%d, %d, %d, %d)", x, y, toX, toY);
static const int facingTable[] = {
1, 0, 1, 2, 3, 4, 3, 2, 7, 0, 7, 6, 5, 4, 5, 6
};
@@ -1418,13 +1418,13 @@ int KyraEngine::getFacingFromPointToPoint(int x, int y, int toX, int toY) {
}
void KyraEngine::changePosTowardsFacing(int &x, int &y, int facing) {
- debug(9, kDebugLevelMain, "KyraEngine::changePosTowardsFacing(%d, %d, %d)", x, y, facing);
+ debugC(9, kDebugLevelMain, "KyraEngine::changePosTowardsFacing(%d, %d, %d)", x, y, facing);
x += _addXPosTable[facing];
y += _addYPosTable[facing];
}
bool KyraEngine::lineIsPassable(int x, int y) {
- debug(9, kDebugLevelMain, "KyraEngine::lineIsPassable(%d, %d)", x, y);
+ debugC(9, kDebugLevelMain, "KyraEngine::lineIsPassable(%d, %d)", x, y);
if (queryGameFlag(0xEF)) {
if (_currentCharacter->sceneId == 5)
return true;
@@ -1483,7 +1483,7 @@ bool KyraEngine::lineIsPassable(int x, int y) {
}
int KyraEngine::getMoveTableSize(int *moveTable) {
- debug(9, kDebugLevelMain, "KyraEngine::getMoveTableSize(0x%X)", moveTable);
+ debugC(9, kDebugLevelMain, "KyraEngine::getMoveTableSize(0x%X)", moveTable);
int retValue = 0;
if (moveTable[0] == 8)
return 0;
diff --git a/engines/kyra/screen.cpp b/engines/kyra/screen.cpp
index fe868a7ddd..764f0ae7f5 100644
--- a/engines/kyra/screen.cpp
+++ b/engines/kyra/screen.cpp
@@ -106,7 +106,7 @@ Screen::~Screen() {
}
void Screen::updateScreen() {
- debug( 9, kDebugLevelScreen, "Screen::updateScreen()");
+ debugC( 9, kDebugLevelScreen, "Screen::updateScreen()");
_system->copyRectToScreen(getPagePtr(0), SCREEN_W, 0, 0, SCREEN_W, SCREEN_H);
//for debug reasons (needs 640x200 screen)
//_system->copyRectToScreen(getPagePtr(2), SCREEN_W, 320, 0, SCREEN_W, SCREEN_H);
@@ -114,19 +114,19 @@ void Screen::updateScreen() {
}
uint8 *Screen::getPagePtr(int pageNum) {
- debug( 9, kDebugLevelScreen, "Screen::getPagePtr(%d)", pageNum);
+ debugC( 9, kDebugLevelScreen, "Screen::getPagePtr(%d)", pageNum);
assert(pageNum < SCREEN_PAGE_NUM);
return _pagePtrs[pageNum];
}
void Screen::clearPage(int pageNum) {
- debug( 9, kDebugLevelScreen, "Screen::clearPage(%d)", pageNum);
+ debugC( 9, kDebugLevelScreen, "Screen::clearPage(%d)", pageNum);
assert(pageNum < SCREEN_PAGE_NUM);
memset(getPagePtr(pageNum), 0, SCREEN_PAGE_SIZE);
}
int Screen::setCurPage(int pageNum) {
- debug( 9, kDebugLevelScreen, "Screen::setCurPage(%d)", pageNum);
+ debugC( 9, kDebugLevelScreen, "Screen::setCurPage(%d)", pageNum);
assert(pageNum < SCREEN_PAGE_NUM);
int previousPage = _curPage;
_curPage = pageNum;
@@ -134,38 +134,38 @@ int Screen::setCurPage(int pageNum) {
}
void Screen::clearCurPage() {
- debug( 9, kDebugLevelScreen, "Screen::clearCurPage()");
+ debugC( 9, kDebugLevelScreen, "Screen::clearCurPage()");
memset(getPagePtr(_curPage), 0, SCREEN_PAGE_SIZE);
}
uint8 Screen::getPagePixel(int pageNum, int x, int y) {
- debug( 9, kDebugLevelScreen, "Screen::getPagePixel(%d, %d, %d)", pageNum, x, y);
+ debugC( 9, kDebugLevelScreen, "Screen::getPagePixel(%d, %d, %d)", pageNum, x, y);
assert(pageNum < SCREEN_PAGE_NUM);
assert(x >= 0 && x < SCREEN_W && y >= 0 && y < SCREEN_H);
return _pagePtrs[pageNum][y * SCREEN_W + x];
}
void Screen::setPagePixel(int pageNum, int x, int y, uint8 color) {
- debug( 9, kDebugLevelScreen, "Screen::setPagePixel(%d, %d, %d, %d)", pageNum, x, y, color);
+ debugC( 9, kDebugLevelScreen, "Screen::setPagePixel(%d, %d, %d, %d)", pageNum, x, y, color);
assert(pageNum < SCREEN_PAGE_NUM);
assert(x >= 0 && x < SCREEN_W && y >= 0 && y < SCREEN_H);
_pagePtrs[pageNum][y * SCREEN_W + x] = color;
}
void Screen::fadeFromBlack() {
- debug( 9, kDebugLevelScreen, "Screen::fadeFromBlack()");
+ debugC( 9, kDebugLevelScreen, "Screen::fadeFromBlack()");
fadePalette(_currentPalette, 0x54);
}
void Screen::fadeToBlack() {
- debug( 9, kDebugLevelScreen, "Screen::fadeToBlack()");
+ debugC( 9, kDebugLevelScreen, "Screen::fadeToBlack()");
uint8 blackPal[768];
memset(blackPal, 0, 768);
fadePalette(blackPal, 0x54);
}
void Screen::fadeSpecialPalette(int palIndex, int startIndex, int size, int fadeTime) {
- debug( 9, kDebugLevelScreen, "fadeSpecialPalette(%d, %d, %d, %d)", palIndex, startIndex, size, fadeTime);
+ debugC( 9, kDebugLevelScreen, "fadeSpecialPalette(%d, %d, %d, %d)", palIndex, startIndex, size, fadeTime);
assert(_vm->palTable1()[palIndex]);
assert(_currentPalette);
uint8 tempPal[768];
@@ -178,7 +178,7 @@ void Screen::fadeSpecialPalette(int palIndex, int startIndex, int size, int fade
}
void Screen::fadePalette(const uint8 *palData, int delay) {
- debug( 9, kDebugLevelScreen, "Screen::fadePalette(0x%X, %d)", palData, delay);
+ debugC( 9, kDebugLevelScreen, "Screen::fadePalette(0x%X, %d)", palData, delay);
uint8 fadePal[768];
memcpy(fadePal, _screenPalette, 768);
uint8 diff, maxDiff = 0;
@@ -235,7 +235,7 @@ void Screen::fadePalette(const uint8 *palData, int delay) {
}
void Screen::setScreenPalette(const uint8 *palData) {
- debug( 9, kDebugLevelScreen, "Screen::setScreenPalette(0x%X)", palData);
+ debugC( 9, kDebugLevelScreen, "Screen::setScreenPalette(0x%X)", palData);
memcpy(_screenPalette, palData, 768);
uint8 screenPal[256 * 4];
for (int i = 0; i < 256; ++i) {
@@ -249,7 +249,7 @@ void Screen::setScreenPalette(const uint8 *palData) {
}
void Screen::copyToPage0(int y, int h, uint8 page, uint8 *seqBuf) {
- debug( 9, kDebugLevelScreen, "Screen::copyToPage0(%d, %d, %d, 0x%X)", y, h, page, seqBuf);
+ debugC( 9, kDebugLevelScreen, "Screen::copyToPage0(%d, %d, %d, 0x%X)", y, h, page, seqBuf);
assert(y + h <= SCREEN_H);
const uint8 *src = getPagePtr(page) + y * SCREEN_W;
uint8 *dstPage = getPagePtr(0) + y * SCREEN_W;
@@ -267,7 +267,7 @@ void Screen::copyToPage0(int y, int h, uint8 page, uint8 *seqBuf) {
}
void Screen::copyRegion(int x1, int y1, int x2, int y2, int w, int h, int srcPage, int dstPage, int flags) {
- debug( 9, kDebugLevelScreen, "Screen::copyRegion(%d, %d, %d, %d, %d, %d, %d, %d, %d)", x1, y1, x2, y2, w, h, srcPage, dstPage, flags);
+ debugC( 9, kDebugLevelScreen, "Screen::copyRegion(%d, %d, %d, %d, %d, %d, %d, %d, %d)", x1, y1, x2, y2, w, h, srcPage, dstPage, flags);
if (flags & CR_CLIPPED) {
if (x2 < 0) {
@@ -324,7 +324,7 @@ void Screen::copyRegion(int x1, int y1, int x2, int y2, int w, int h, int srcPag
}
void Screen::copyRegionToBuffer(int pageNum, int x, int y, int w, int h, uint8 *dest) {
- debug( 9, kDebugLevelScreen, "Screen::copyRegionToBuffer(%d, %d, %d, %d, %d)", pageNum, x, y, w, h);
+ debugC( 9, kDebugLevelScreen, "Screen::copyRegionToBuffer(%d, %d, %d, %d, %d)", pageNum, x, y, w, h);
assert(x >= 0 && x < Screen::SCREEN_W && y >= 0 && y < Screen::SCREEN_H && dest);
uint8 *pagePtr = getPagePtr(pageNum);
for (int i = y; i < y + h; i++) {
@@ -333,7 +333,7 @@ void Screen::copyRegionToBuffer(int pageNum, int x, int y, int w, int h, uint8 *
}
void Screen::copyBlockToPage(int pageNum, int x, int y, int w, int h, const uint8 *src) {
- debug( 9, kDebugLevelScreen, "Screen::copyBlockToPage(%d, %d, %d, %d, %d, 0x%X)", pageNum, x, y, w, h, src);
+ debugC( 9, kDebugLevelScreen, "Screen::copyBlockToPage(%d, %d, %d, %d, %d, 0x%X)", pageNum, x, y, w, h, src);
assert(x >= 0 && x < Screen::SCREEN_W && y >= 0 && y < Screen::SCREEN_H);
uint8 *dst = getPagePtr(pageNum) + y * SCREEN_W + x;
while (h--) {
@@ -344,7 +344,7 @@ void Screen::copyBlockToPage(int pageNum, int x, int y, int w, int h, const uint
}
void Screen::copyFromCurPageBlock(int x, int y, int w, int h, const uint8 *src) {
- debug( 9, kDebugLevelScreen, "Screen::copyFromCurPageBlock(%d, %d, %d, %d, 0x%X)", x, y, w, h, src);
+ debugC( 9, kDebugLevelScreen, "Screen::copyFromCurPageBlock(%d, %d, %d, %d, 0x%X)", x, y, w, h, src);
if (x < 0) {
x = 0;
} else if (x >= 40) {
@@ -370,7 +370,7 @@ void Screen::copyFromCurPageBlock(int x, int y, int w, int h, const uint8 *src)
}
void Screen::copyCurPageBlock(int x, int y, int w, int h, uint8 *dst) {
- debug( 9, kDebugLevelScreen, "Screen::copyCurPageBlock(%d, %d, %d, %d, 0x%X)", x, y, w, h, dst);
+ debugC( 9, kDebugLevelScreen, "Screen::copyCurPageBlock(%d, %d, %d, %d, 0x%X)", x, y, w, h, dst);
assert(dst);
if (x < 0) {
x = 0;
@@ -397,7 +397,7 @@ void Screen::copyCurPageBlock(int x, int y, int w, int h, uint8 *dst) {
}
void Screen::shuffleScreen(int sx, int sy, int w, int h, int srcPage, int dstPage, int ticks, bool transparent) {
- debug( 9, kDebugLevelScreen, "Screen::shuffleScreen(%d, %d, %d, %d, %d, %d, %d, %d)", sx, sy, w, h, srcPage, dstPage, ticks, transparent);
+ debugC( 9, kDebugLevelScreen, "Screen::shuffleScreen(%d, %d, %d, %d, %d, %d, %d, %d)", sx, sy, w, h, srcPage, dstPage, ticks, transparent);
assert(sx >= 0 && w <= SCREEN_W);
int x;
uint16 x_offs[SCREEN_W];
@@ -447,7 +447,7 @@ void Screen::shuffleScreen(int sx, int sy, int w, int h, int srcPage, int dstPag
}
void Screen::fillRect(int x1, int y1, int x2, int y2, uint8 color, int pageNum) {
- debug( 9, kDebugLevelScreen, "Screen::fillRect(%d, %d, %d, %d, %d, %d)", x1, y1, x2, y2, color, pageNum);
+ debugC( 9, kDebugLevelScreen, "Screen::fillRect(%d, %d, %d, %d, %d, %d)", x1, y1, x2, y2, color, pageNum);
assert(x2 < SCREEN_W && y2 < SCREEN_H);
if (pageNum == -1) {
pageNum = _curPage;
@@ -460,7 +460,7 @@ void Screen::fillRect(int x1, int y1, int x2, int y2, uint8 color, int pageNum)
}
void Screen::drawBox(int x1, int y1, int x2, int y2, int color) {
- debug( 9, kDebugLevelScreen, "Screen::drawBox(%i, %i, %i, %i, %i)", x1, y1, x2, y2, color);
+ debugC( 9, kDebugLevelScreen, "Screen::drawBox(%i, %i, %i, %i, %i)", x1, y1, x2, y2, color);
drawClippedLine(x1, y1, x2, y1, color);
drawClippedLine(x1, y1, x1, y2, color);
@@ -469,7 +469,7 @@ void Screen::drawBox(int x1, int y1, int x2, int y2, int color) {
}
void Screen::drawShadedBox(int x1, int y1, int x2, int y2, int color1, int color2) {
- debug( 9, kDebugLevelScreen, "Screen::drawShadedBox(%i, %i, %i, %i, %i, %i)", x1, y1, x2, y2, color1, color2);
+ debugC( 9, kDebugLevelScreen, "Screen::drawShadedBox(%i, %i, %i, %i, %i, %i)", x1, y1, x2, y2, color1, color2);
assert(x1 > 0 && y1 > 0);
hideMouse();
@@ -485,7 +485,7 @@ void Screen::drawShadedBox(int x1, int y1, int x2, int y2, int color1, int color
}
void Screen::drawClippedLine(int x1, int y1, int x2, int y2, int color) {
- debug( 9, kDebugLevelScreen, "Screen::drawClippedLine(%i, %i, %i, %i, %i)", x1, y1, x2, y2, color);
+ debugC( 9, kDebugLevelScreen, "Screen::drawClippedLine(%i, %i, %i, %i, %i)", x1, y1, x2, y2, color);
if (x1 < 0)
x1 = 0;
@@ -520,7 +520,7 @@ void Screen::drawClippedLine(int x1, int y1, int x2, int y2, int color) {
}
void Screen::drawLine(bool horizontal, int x, int y, int length, int color) {
- debug( 9, kDebugLevelScreen, "Screen::drawLine(%i, %i, %i, %i, %i)", horizontal, x, y, length, color);
+ debugC( 9, kDebugLevelScreen, "Screen::drawLine(%i, %i, %i, %i, %i)", horizontal, x, y, length, color);
uint8 *ptr = getPagePtr(_curPage) + y * SCREEN_W + x;
@@ -539,7 +539,7 @@ void Screen::drawLine(bool horizontal, int x, int y, int length, int color) {
}
void Screen::setAnimBlockPtr(int size) {
- debug( 9, kDebugLevelScreen, "Screen::setAnimBlockPtr(%d)", size);
+ debugC( 9, kDebugLevelScreen, "Screen::setAnimBlockPtr(%d)", size);
free(_animBlockPtr);
_animBlockPtr = (uint8 *)malloc(size);
assert(_animBlockPtr);
@@ -548,19 +548,19 @@ void Screen::setAnimBlockPtr(int size) {
}
void Screen::setTextColorMap(const uint8 *cmap) {
- debug( 9, kDebugLevelScreen, "Screen::setTextColorMap(0x%X)", cmap);
+ debugC( 9, kDebugLevelScreen, "Screen::setTextColorMap(0x%X)", cmap);
setTextColor(cmap, 0, 11);
}
void Screen::setTextColor(const uint8 *cmap, int a, int b) {
- debug( 9, kDebugLevelScreen, "Screen::setTextColor(0x%X, %d, %d)", cmap, a, b);
+ debugC( 9, kDebugLevelScreen, "Screen::setTextColor(0x%X, %d, %d)", cmap, a, b);
for (int i = a; i <= b; ++i) {
_textColorsMap[i] = *cmap++;
}
}
void Screen::loadFont(FontId fontId, uint8 *fontData) {
- debug( 9, kDebugLevelScreen, "Screen::loadFont(%d, 0x%X)", fontId, fontData);
+ debugC( 9, kDebugLevelScreen, "Screen::loadFont(%d, 0x%X)", fontId, fontData);
Font *fnt = &_fonts[fontId];
assert(fontData && !fnt->fontData);
fnt->fontData = fontData;
@@ -576,19 +576,19 @@ void Screen::loadFont(FontId fontId, uint8 *fontData) {
}
Screen::FontId Screen::setFont(FontId fontId) {
- debug( 9, kDebugLevelScreen, "Screen::setFont(%d)", fontId);
+ debugC( 9, kDebugLevelScreen, "Screen::setFont(%d)", fontId);
FontId prev = _currentFont;
_currentFont = fontId;
return prev;
}
int Screen::getCharWidth(uint8 c) const {
- debug( 9, kDebugLevelScreen, "Screen::getCharWidth('%c')", c);
+ debugC( 9, kDebugLevelScreen, "Screen::getCharWidth('%c')", c);
return (int)_fonts[_currentFont].charWidthTable[c] + _charWidth;
}
int Screen::getTextWidth(const char *str) const {
- debug( 9, kDebugLevelScreen, "Screen::getTextWidth('%s')", str);
+ debugC( 9, kDebugLevelScreen, "Screen::getTextWidth('%s')", str);
int curLineLen = 0;
int maxLineLen = 0;
while (1) {
@@ -609,7 +609,7 @@ int Screen::getTextWidth(const char *str) const {
}
void Screen::printText(const char *str, int x, int y, uint8 color1, uint8 color2) {
- debug( 9, kDebugLevelScreen, "Screen::printText('%s', %d, %d, 0x%X, 0x%X)", str, x, y, color1, color2);
+ debugC( 9, kDebugLevelScreen, "Screen::printText('%s', %d, %d, 0x%X, 0x%X)", str, x, y, color1, color2);
uint8 cmap[2];
cmap[0] = color2;
cmap[1] = color1;
@@ -653,7 +653,7 @@ void Screen::printText(const char *str, int x, int y, uint8 color1, uint8 color2
}
void Screen::drawChar(uint8 c, int x, int y) {
- debug( 9, kDebugLevelScreen, "Screen::drawChar('%c', %d, %d)", c, x, y);
+ debugC( 9, kDebugLevelScreen, "Screen::drawChar('%c', %d, %d)", c, x, y);
Font *fnt = &_fonts[_currentFont];
uint8 *dst = getPagePtr(_curPage) + y * SCREEN_W + x;
uint16 bitmapOffset = READ_LE_UINT16(fnt->fontData + fnt->charBitmapOffset + c * 2);
@@ -717,14 +717,14 @@ void Screen::drawChar(uint8 c, int x, int y) {
}
void Screen::setScreenDim(int dim) {
- debug( 9, kDebugLevelScreen, "setScreenDim(%d)", dim);
+ debugC( 9, kDebugLevelScreen, "setScreenDim(%d)", dim);
assert(dim < _screenDimTableCount);
_curDim = &_screenDimTable[dim];
// XXX
}
void Screen::drawShape(uint8 pageNum, const uint8 *shapeData, int x, int y, int sd, int flags, ...) {
- debug( 9, kDebugLevelScreen, "Screen::drawShape(%d, 0x%X, %d, %d, %d, 0x%.04X, ...)", pageNum, shapeData, x, y, sd, flags);
+ debugC( 9, kDebugLevelScreen, "Screen::drawShape(%d, 0x%X, %d, %d, %d, 0x%.04X, ...)", pageNum, shapeData, x, y, sd, flags);
if (!shapeData)
return;
va_list args;
@@ -1225,7 +1225,7 @@ void Screen::drawShape(uint8 pageNum, const uint8 *shapeData, int x, int y, int
}
void Screen::decodeFrame3(const uint8 *src, uint8 *dst, uint32 size) {
- debug( 9, kDebugLevelScreen, "Screen::decodeFrame3(0x%X, 0x%X, %d)", src, dst, size);
+ debugC( 9, kDebugLevelScreen, "Screen::decodeFrame3(0x%X, 0x%X, %d)", src, dst, size);
const uint8 *dstEnd = dst + size;
while (dst < dstEnd) {
int8 code = *src++;
@@ -1246,7 +1246,7 @@ void Screen::decodeFrame3(const uint8 *src, uint8 *dst, uint32 size) {
}
void Screen::decodeFrame4(const uint8 *src, uint8 *dst, uint32 dstSize) {
- debug( 9, kDebugLevelScreen, "Screen::decodeFrame4(0x%X, 0x%X, %d)", src, dst, dstSize);
+ debugC( 9, kDebugLevelScreen, "Screen::decodeFrame4(0x%X, 0x%X, %d)", src, dst, dstSize);
uint8 *dstOrig = dst;
uint8 *dstEnd = dst + dstSize;
while (1) {
@@ -1295,7 +1295,7 @@ void Screen::decodeFrame4(const uint8 *src, uint8 *dst, uint32 dstSize) {
}
void Screen::decodeFrameDelta(uint8 *dst, const uint8 *src) {
- debug( 9, kDebugLevelScreen, "Screen::decodeFrameDelta(0x%X, 0x%X)", dst, src);
+ debugC( 9, kDebugLevelScreen, "Screen::decodeFrameDelta(0x%X, 0x%X)", dst, src);
while (1) {
uint8 code = *src++;
if (code == 0) {
@@ -1338,7 +1338,7 @@ void Screen::decodeFrameDelta(uint8 *dst, const uint8 *src) {
}
void Screen::decodeFrameDeltaPage(uint8 *dst, const uint8 *src, int pitch, int noXor) {
- debug( 9, kDebugLevelScreen, "Screen::decodeFrameDeltaPage(0x%X, 0x%X, %d, %d)", dst, src, pitch, noXor);
+ debugC( 9, kDebugLevelScreen, "Screen::decodeFrameDeltaPage(0x%X, 0x%X, %d, %d)", dst, src, pitch, noXor);
int count = 0;
uint8 *dstNext = dst;
while (1) {
@@ -1434,7 +1434,7 @@ void Screen::decodeFrameDeltaPage(uint8 *dst, const uint8 *src, int pitch, int n
}
uint8 *Screen::encodeShape(int x, int y, int w, int h, int flags) {
- debug( 9, kDebugLevelScreen, "Screen::encodeShape(%d, %d, %d, %d, %d)", x, y, w, h, flags);
+ debugC( 9, kDebugLevelScreen, "Screen::encodeShape(%d, %d, %d, %d, %d)", x, y, w, h, flags);
uint8 *srcPtr = &_pagePtrs[_curPage][y * SCREEN_W + x];
int16 shapeSize = 0;
uint8 *tmp = srcPtr;
@@ -1619,7 +1619,7 @@ uint8 *Screen::encodeShape(int x, int y, int w, int h, int flags) {
}
int16 Screen::encodeShapeAndCalculateSize(uint8 *from, uint8 *to, int size_to) {
- debug( 9, kDebugLevelScreen, "Screen::encodeShapeAndCalculateSize(0x%X, 0x%X, %d)", from, to, size_to);
+ debugC( 9, kDebugLevelScreen, "Screen::encodeShapeAndCalculateSize(0x%X, 0x%X, %d)", from, to, size_to);
byte *fromPtrEnd = from + size_to;
bool skipPixel = true;
byte *tempPtr = 0;
@@ -1767,13 +1767,13 @@ int Screen::getRectSize(int x, int y) {
}
void Screen::hideMouse() {
- debug( 9, kDebugLevelScreen, "Screen::hideMouse()");
+ debugC( 9, kDebugLevelScreen, "Screen::hideMouse()");
++_mouseLockCount;
_system->showMouse(false);
}
void Screen::showMouse() {
- debug( 9, kDebugLevelScreen, "Screen::showMouse()");
+ debugC( 9, kDebugLevelScreen, "Screen::showMouse()");
if (_mouseLockCount == 1)
_system->showMouse(true);
@@ -1784,13 +1784,13 @@ void Screen::showMouse() {
}
void Screen::setShapePages(int page1, int page2) {
- debug( 9, kDebugLevelScreen, "Screen::setShapePages(%d, %d)", page1, page2);
+ debugC( 9, kDebugLevelScreen, "Screen::setShapePages(%d, %d)", page1, page2);
_shapePages[0] = _pagePtrs[page1];
_shapePages[1] = _pagePtrs[page2];
}
void Screen::setMouseCursor(int x, int y, byte *shape) {
- debug( 9, kDebugLevelScreen, "Screen::setMouseCursor(%d, %d, 0x%X)", x, y, shape);
+ debugC( 9, kDebugLevelScreen, "Screen::setMouseCursor(%d, %d, 0x%X)", x, y, shape);
if (!shape)
return;
// if mouseDisabled
@@ -1820,7 +1820,7 @@ void Screen::setMouseCursor(int x, int y, byte *shape) {
}
void Screen::copyScreenFromRect(int x, int y, int w, int h, uint8 *ptr) {
- debug( 9, kDebugLevelScreen, "Screen::copyScreenFromRect(%d, %d, %d, %d, 0x%X)", x, y, w, h, ptr);
+ debugC( 9, kDebugLevelScreen, "Screen::copyScreenFromRect(%d, %d, %d, %d, 0x%X)", x, y, w, h, ptr);
x <<= 3; w <<= 3;
uint8 *src = ptr;
uint8 *dst = &_pagePtrs[0][y * SCREEN_W + x];
@@ -1832,7 +1832,7 @@ void Screen::copyScreenFromRect(int x, int y, int w, int h, uint8 *ptr) {
}
void Screen::copyScreenToRect(int x, int y, int w, int h, uint8 *ptr) {
- debug( 9, kDebugLevelScreen, "Screen::copyScreenToRect(%d, %d, %d, %d, 0x%X)", x, y, w, h, ptr);
+ debugC( 9, kDebugLevelScreen, "Screen::copyScreenToRect(%d, %d, %d, %d, 0x%X)", x, y, w, h, ptr);
x <<= 3; w <<= 3;
uint8 *src = &_pagePtrs[0][y * SCREEN_W + x];
uint8 *dst = ptr;
@@ -1844,7 +1844,7 @@ void Screen::copyScreenToRect(int x, int y, int w, int h, uint8 *ptr) {
}
uint8 *Screen::getPalette(int num) {
- debug( 9, kDebugLevelScreen, "Screen::getPalette(%d)", num);
+ debugC( 9, kDebugLevelScreen, "Screen::getPalette(%d)", num);
assert(num >= 0 && num < 4);
if (num == 0) {
return _screenPalette;
@@ -1854,7 +1854,7 @@ uint8 *Screen::getPalette(int num) {
}
byte Screen::getShapeFlag1(int x, int y) {
- debug( 9, kDebugLevelScreen, "Screen::getShapeFlag1(%d, %d)", x, y);
+ debugC( 9, kDebugLevelScreen, "Screen::getShapeFlag1(%d, %d)", x, y);
uint8 color = _shapePages[0][y * SCREEN_W + x];
color &= 0x80;
color ^= 0x80;
@@ -1866,7 +1866,7 @@ byte Screen::getShapeFlag1(int x, int y) {
}
byte Screen::getShapeFlag2(int x, int y) {
- debug( 9, kDebugLevelScreen, "Screen::getShapeFlag2(%d, %d)", x, y);
+ debugC( 9, kDebugLevelScreen, "Screen::getShapeFlag2(%d, %d)", x, y);
uint8 color = _shapePages[0][y * SCREEN_W + x];
color &= 0x7F;
color &= 0x87;
@@ -1874,7 +1874,7 @@ byte Screen::getShapeFlag2(int x, int y) {
}
int Screen::setNewShapeHeight(uint8 *shape, int height) {
- debug( 9, kDebugLevelScreen, "Screen::setNewShapeHeight(0x%X, %d)", shape, height);
+ debugC( 9, kDebugLevelScreen, "Screen::setNewShapeHeight(0x%X, %d)", shape, height);
if (_vm->features() & GF_TALKIE)
shape += 2;
int oldHeight = shape[2];
@@ -1883,7 +1883,7 @@ int Screen::setNewShapeHeight(uint8 *shape, int height) {
}
int Screen::resetShapeHeight(uint8 *shape) {
- debug( 9, kDebugLevelScreen, "Screen::setNewShapeHeight(0x%X)", shape);
+ debugC( 9, kDebugLevelScreen, "Screen::setNewShapeHeight(0x%X)", shape);
if (_vm->features() & GF_TALKIE)
shape += 2;
int oldHeight = shape[2];
@@ -1892,7 +1892,7 @@ int Screen::resetShapeHeight(uint8 *shape) {
}
void Screen::addBitBlitRect(int x, int y, int w, int h) {
- debug( 9, kDebugLevelScreen, "Screen::addBitBlitRects(%d, %d, %d, %d)", x, y, w, h);
+ debugC( 9, kDebugLevelScreen, "Screen::addBitBlitRects(%d, %d, %d, %d)", x, y, w, h);
if (_bitBlitNum >= BITBLIT_RECTS) {
error("too many bit blit rects");
}
@@ -1904,7 +1904,7 @@ void Screen::addBitBlitRect(int x, int y, int w, int h) {
}
void Screen::bitBlitRects() {
- debug( 9, kDebugLevelScreen, "Screen::bitBlitRects()");
+ debugC( 9, kDebugLevelScreen, "Screen::bitBlitRects()");
Rect *cur = _bitBlitRects;
while (_bitBlitNum) {
_bitBlitNum--;
@@ -1914,7 +1914,7 @@ void Screen::bitBlitRects() {
}
void Screen::savePageToDisk(const char *file, int page) {
- debug( 9, kDebugLevelScreen, "Screen::savePageToDisk('%s', %d)", file, page);
+ debugC( 9, kDebugLevelScreen, "Screen::savePageToDisk('%s', %d)", file, page);
if (!_saveLoadPage[page/2]) {
_saveLoadPage[page/2] = new uint8[SCREEN_W * SCREEN_H];
assert(_saveLoadPage[page/2]);
@@ -1923,20 +1923,20 @@ void Screen::savePageToDisk(const char *file, int page) {
}
void Screen::loadPageFromDisk(const char *file, int page) {
- debug( 9, kDebugLevelScreen, "Screen::loadPageFromDisk('%s', %d)", file, page);
+ debugC( 9, kDebugLevelScreen, "Screen::loadPageFromDisk('%s', %d)", file, page);
copyBlockToPage(page, 0, 0, SCREEN_W, SCREEN_H, _saveLoadPage[page/2]);
delete [] _saveLoadPage[page/2];
_saveLoadPage[page/2] = 0;
}
void Screen::deletePageFromDisk(int page) {
- debug( 9, kDebugLevelScreen, "Screen::deletePageFromDisk(%d)", page);
+ debugC( 9, kDebugLevelScreen, "Screen::deletePageFromDisk(%d)", page);
delete [] _saveLoadPage[page/2];
_saveLoadPage[page/2] = 0;
}
void Screen::blockInRegion(int x, int y, int width, int height) {
- debug( 9, kDebugLevelScreen, "Screen::blockInRegion(%d, %d, %d, %d)", x, y, width, height);
+ debugC( 9, kDebugLevelScreen, "Screen::blockInRegion(%d, %d, %d, %d)", x, y, width, height);
assert(_shapePages[0]);
byte *toPtr = _shapePages[0] + (y * 320 + x);
for (int i = 0; i < height; ++i) {
@@ -1949,7 +1949,7 @@ void Screen::blockInRegion(int x, int y, int width, int height) {
}
void Screen::blockOutRegion(int x, int y, int width, int height) {
- debug( 9, kDebugLevelScreen, "Screen::blockOutRegion(%d, %d, %d, %d)", x, y, width, height);
+ debugC( 9, kDebugLevelScreen, "Screen::blockOutRegion(%d, %d, %d, %d)", x, y, width, height);
assert(_shapePages[0]);
byte *toPtr = _shapePages[0] + (y * 320 + x);
for (int i = 0; i < height; ++i) {
@@ -1975,31 +1975,31 @@ void Screen::rectClip(int &x, int &y, int w, int h) {
}
void Screen::backUpRect0(int xpos, int ypos) {
- debug( 9, kDebugLevelScreen, "Screen::backUpRect0(%d, %d)", xpos, ypos);
+ debugC( 9, kDebugLevelScreen, "Screen::backUpRect0(%d, %d)", xpos, ypos);
rectClip(xpos, ypos, 3<<3, 24);
copyRegionToBuffer(_curPage, xpos, ypos, 3<<3, 24, _vm->shapes()[0]);
}
void Screen::restoreRect0(int xpos, int ypos) {
- debug( 9, kDebugLevelScreen, "Screen::restoreRect0(%d, %d)", xpos, ypos);
+ debugC( 9, kDebugLevelScreen, "Screen::restoreRect0(%d, %d)", xpos, ypos);
rectClip(xpos, ypos, 3<<3, 24);
copyBlockToPage(_curPage, xpos, ypos, 3<<3, 24, _vm->shapes()[0]);
}
void Screen::backUpRect1(int xpos, int ypos) {
- debug( 9, kDebugLevelScreen, "Screen::backUpRect1(%d, %d)", xpos, ypos);
+ debugC( 9, kDebugLevelScreen, "Screen::backUpRect1(%d, %d)", xpos, ypos);
rectClip(xpos, ypos, 4<<3, 32);
copyRegionToBuffer(_curPage, xpos, ypos, 4<<3, 32, _vm->shapes()[1]);
}
void Screen::restoreRect1(int xpos, int ypos) {
- debug( 9, kDebugLevelScreen, "Screen::restoreRect1(%d, %d)", xpos, ypos);
+ debugC( 9, kDebugLevelScreen, "Screen::restoreRect1(%d, %d)", xpos, ypos);
rectClip(xpos, ypos, 4<<3, 32);
copyBlockToPage(_curPage, xpos, ypos, 4<<3, 32, _vm->shapes()[1]);
}
int Screen::getDrawLayer(int x, int y) {
- debug( 9, kDebugLevelScreen, "Screen::getDrawLayer(%d, %d)", x, y);
+ debugC( 9, kDebugLevelScreen, "Screen::getDrawLayer(%d, %d)", x, y);
int xpos = x - 8;
int ypos = y - 1;
int layer = 1;
@@ -2016,7 +2016,7 @@ int Screen::getDrawLayer(int x, int y) {
}
int Screen::getDrawLayer2(int x, int y, int height) {
- debug( 9, kDebugLevelScreen, "Screen::getDrawLayer2(%d, %d, %d)", x, y, height);
+ debugC( 9, kDebugLevelScreen, "Screen::getDrawLayer2(%d, %d, %d)", x, y, height);
int xpos = x - 8;
int ypos = y - 1;
int layer = 1;
@@ -2037,7 +2037,7 @@ int Screen::getDrawLayer2(int x, int y, int height) {
}
void Screen::copyBackgroundBlock(int x, int page, int flag) {
- debug( 9, kDebugLevelScreen, "Screen::copyBackgroundBlock(%d, %d, %d)", x, page, flag);
+ debugC( 9, kDebugLevelScreen, "Screen::copyBackgroundBlock(%d, %d, %d)", x, page, flag);
if (x < 1)
return;
diff --git a/engines/kyra/script.cpp b/engines/kyra/script.cpp
index fbd186582e..14a8c33d4d 100644
--- a/engines/kyra/script.cpp
+++ b/engines/kyra/script.cpp
@@ -217,7 +217,7 @@ bool ScriptHelper::runScript(ScriptState *script) {
if (opcode > 18) {
error("Script unknown command: %d", opcode);
} else {
- debug(5, kDebugLevelScript, "%s([%d/%u])", _commands[opcode].desc, _parameter, (uint)_parameter);
+ debugC(5, kDebugLevelScript, "%s([%d/%u])", _commands[opcode].desc, _parameter, (uint)_parameter);
(this->*(_commands[opcode].proc))(script);
}
diff --git a/engines/kyra/script_v1.cpp b/engines/kyra/script_v1.cpp
index a10135459d..5eb487dd4c 100644
--- a/engines/kyra/script_v1.cpp
+++ b/engines/kyra/script_v1.cpp
@@ -35,7 +35,7 @@ namespace Kyra {
#define stackPosString(x) (char*)&script->dataPtr->text[READ_BE_UINT16(&((uint16 *)script->dataPtr->text)[stackPos(x)])]
int KyraEngine::cmd_magicInMouseItem(ScriptState *script) {
- debug(3, kDebugLevelScriptFuncs, "cmd_magicInMouseItem(0x%X) (%d, %d)", script, stackPos(0), stackPos(1));
+ debugC(3, kDebugLevelScriptFuncs, "cmd_magicInMouseItem(0x%X) (%d, %d)", script, stackPos(0), stackPos(1));
magicInMouseItem(stackPos(0), stackPos(1), -1);
return 0;
}
@@ -43,12 +43,12 @@ int KyraEngine::cmd_magicInMouseItem(ScriptState *script) {
int KyraEngine::cmd_characterSays(ScriptState *script) {
_skipFlag = false;
if (_features & GF_TALKIE) {
- debug(3, kDebugLevelScriptFuncs, "cmd_characterSays(0x%X) (%d, '%s', %d, %d)", script, stackPos(0), stackPosString(1), stackPos(2), stackPos(3));
+ debugC(3, kDebugLevelScriptFuncs, "cmd_characterSays(0x%X) (%d, '%s', %d, %d)", script, stackPos(0), stackPosString(1), stackPos(2), stackPos(3));
snd_voiceWaitForFinish();
snd_playVoiceFile(stackPos(0));
characterSays(stackPosString(1), stackPos(2), stackPos(3));
} else {
- debug(3, kDebugLevelScriptFuncs, "cmd_characterSays(0x%X) ('%s', %d, %d)", script, stackPosString(0), stackPos(1), stackPos(2));
+ debugC(3, kDebugLevelScriptFuncs, "cmd_characterSays(0x%X) ('%s', %d, %d)", script, stackPosString(0), stackPos(1), stackPos(2));
characterSays(stackPosString(0), stackPos(1), stackPos(2));
}
@@ -56,7 +56,7 @@ int KyraEngine::cmd_characterSays(ScriptState *script) {
}
int KyraEngine::cmd_pauseTicks(ScriptState *script) {
- debug(3, kDebugLevelScriptFuncs, "cmd_pauseTicks(0x%X) (%d, %d)", script, stackPos(0), stackPos(1));
+ debugC(3, kDebugLevelScriptFuncs, "cmd_pauseTicks(0x%X) (%d, %d)", script, stackPos(0), stackPos(1));
if (stackPos(1)) {
warning("STUB: special cmd_pauseTicks");
// delete this after correct implementing
@@ -68,23 +68,23 @@ int KyraEngine::cmd_pauseTicks(ScriptState *script) {
}
int KyraEngine::cmd_drawSceneAnimShape(ScriptState *script) {
- debug(3, kDebugLevelScriptFuncs, "cmd_drawSceneAnimShape(0x%X) (%d, %d, %d, %d, %d)", script, stackPos(0), stackPos(1), stackPos(2), stackPos(3), stackPos(4));
+ debugC(3, kDebugLevelScriptFuncs, "cmd_drawSceneAnimShape(0x%X) (%d, %d, %d, %d, %d)", script, stackPos(0), stackPos(1), stackPos(2), stackPos(3), stackPos(4));
_screen->drawShape(stackPos(4), _sprites->_sceneShapes[stackPos(0)], stackPos(1), stackPos(2), 0, (stackPos(3) != 0) ? 1 : 0);
return 0;
}
int KyraEngine::cmd_queryGameFlag(ScriptState *script) {
- debug(3, kDebugLevelScriptFuncs, "cmd_queryGameFlag(0x%X) (0x%X)", script, stackPos(0));
+ debugC(3, kDebugLevelScriptFuncs, "cmd_queryGameFlag(0x%X) (0x%X)", script, stackPos(0));
return queryGameFlag(stackPos(0));
}
int KyraEngine::cmd_setGameFlag(ScriptState *script) {
- debug(3, kDebugLevelScriptFuncs, "cmd_setGameFlag(0x%X) (0x%X)", script, stackPos(0));
+ debugC(3, kDebugLevelScriptFuncs, "cmd_setGameFlag(0x%X) (0x%X)", script, stackPos(0));
return setGameFlag(stackPos(0));
}
int KyraEngine::cmd_resetGameFlag(ScriptState *script) {
- debug(3, kDebugLevelScriptFuncs, "cmd_resetGameFlag(0x%X) (0x%X)", script, stackPos(0));
+ debugC(3, kDebugLevelScriptFuncs, "cmd_resetGameFlag(0x%X) (0x%X)", script, stackPos(0));
return resetGameFlag(stackPos(0));
}
@@ -94,7 +94,7 @@ int KyraEngine::cmd_runNPCScript(ScriptState *script) {
}
int KyraEngine::cmd_setSpecialExitList(ScriptState *script) {
- debug(3, kDebugLevelScriptFuncs, "cmd_setSpecialExitList(0x%X) (%d, %d, %d, %d, %d, %d, %d, %d, %d, %d)", script, stackPos(0), stackPos(1), stackPos(2), stackPos(3), stackPos(4), stackPos(5), stackPos(6), stackPos(7), stackPos(8), stackPos(9));
+ debugC(3, kDebugLevelScriptFuncs, "cmd_setSpecialExitList(0x%X) (%d, %d, %d, %d, %d, %d, %d, %d, %d, %d)", script, stackPos(0), stackPos(1), stackPos(2), stackPos(3), stackPos(4), stackPos(5), stackPos(6), stackPos(7), stackPos(8), stackPos(9));
for (int i = 0; i < 10; ++i) {
_exitList[i] = stackPos(i);
@@ -105,19 +105,19 @@ int KyraEngine::cmd_setSpecialExitList(ScriptState *script) {
}
int KyraEngine::cmd_blockInWalkableRegion(ScriptState *script) {
- debug(3, kDebugLevelScriptFuncs, "cmd_blockInWalkableRegion(0x%X) (%d, %d, %d, %d)", script, stackPos(0), stackPos(1), stackPos(2), stackPos(3));
+ debugC(3, kDebugLevelScriptFuncs, "cmd_blockInWalkableRegion(0x%X) (%d, %d, %d, %d)", script, stackPos(0), stackPos(1), stackPos(2), stackPos(3));
_screen->blockInRegion(stackPos(0), stackPos(1), stackPos(2)-stackPos(0)+1, stackPos(3)-stackPos(1)+1);
return 0;
}
int KyraEngine::cmd_blockOutWalkableRegion(ScriptState *script) {
- debug(3, kDebugLevelScriptFuncs, "cmd_blockOutWalkableRegion(0x%X) (%d, %d, %d, %d)", script, stackPos(0), stackPos(1), stackPos(2), stackPos(3));
+ debugC(3, kDebugLevelScriptFuncs, "cmd_blockOutWalkableRegion(0x%X) (%d, %d, %d, %d)", script, stackPos(0), stackPos(1), stackPos(2), stackPos(3));
_screen->blockOutRegion(stackPos(0), stackPos(1), stackPos(2)-stackPos(0)+1, stackPos(3)-stackPos(1)+1);
return 0;
}
int KyraEngine::cmd_walkPlayerToPoint(ScriptState *script) {
- debug(3, kDebugLevelScriptFuncs, "cmd_walkPlayerToPoint(0x%X) (%d, %d, %d, %d)", script, stackPos(0), stackPos(1), stackPos(2), stackPos(3));
+ debugC(3, kDebugLevelScriptFuncs, "cmd_walkPlayerToPoint(0x%X) (%d, %d, %d, %d)", script, stackPos(0), stackPos(1), stackPos(2), stackPos(3));
int normalTimers = stackPos(2);
if (!normalTimers) {
@@ -146,7 +146,7 @@ int KyraEngine::cmd_walkPlayerToPoint(ScriptState *script) {
}
int KyraEngine::cmd_dropItemInScene(ScriptState *script) {
- debug(3, kDebugLevelScriptFuncs, "cmd_dropItemInScene(0x%X) (%d, %d, %d)", script, stackPos(0), stackPos(1), stackPos(2));
+ debugC(3, kDebugLevelScriptFuncs, "cmd_dropItemInScene(0x%X) (%d, %d, %d)", script, stackPos(0), stackPos(1), stackPos(2));
int item = stackPos(0);
int xpos = stackPos(1);
int ypos = stackPos(2);
@@ -172,7 +172,7 @@ int KyraEngine::cmd_dropItemInScene(ScriptState *script) {
}
int KyraEngine::cmd_drawAnimShapeIntoScene(ScriptState *script) {
- debug(3, kDebugLevelScriptFuncs, "cmd_drawAnimShapeIntoScene(0x%X) (%d, %d, %d, %d)", stackPos(0), stackPos(1), stackPos(2), stackPos(3));
+ debugC(3, kDebugLevelScriptFuncs, "cmd_drawAnimShapeIntoScene(0x%X) (%d, %d, %d, %d)", stackPos(0), stackPos(1), stackPos(2), stackPos(3));
_screen->hideMouse();
_animator->restoreAllObjectBackgrounds();
int shape = stackPos(0);
@@ -190,36 +190,36 @@ int KyraEngine::cmd_drawAnimShapeIntoScene(ScriptState *script) {
}
int KyraEngine::cmd_createMouseItem(ScriptState *script) {
- debug(3, kDebugLevelScriptFuncs, "cmd_createMouseItem(0x%X) (%d)", script, stackPos(0));
+ debugC(3, kDebugLevelScriptFuncs, "cmd_createMouseItem(0x%X) (%d)", script, stackPos(0));
createMouseItem(stackPos(0));
return 0;
}
int KyraEngine::cmd_savePageToDisk(ScriptState *script) {
- debug(3, kDebugLevelScriptFuncs, "cmd_savePageToDisk(0x%X) ('%s', %d)", script, stackPosString(0), stackPos(1));
+ debugC(3, kDebugLevelScriptFuncs, "cmd_savePageToDisk(0x%X) ('%s', %d)", script, stackPosString(0), stackPos(1));
_screen->savePageToDisk(stackPosString(0), stackPos(1));
return 0;
}
int KyraEngine::cmd_sceneAnimOn(ScriptState *script) {
- debug(3, kDebugLevelScriptFuncs, "cmd_sceneAnimOn(0x%X) (%d)", script, stackPos(0));
+ debugC(3, kDebugLevelScriptFuncs, "cmd_sceneAnimOn(0x%X) (%d)", script, stackPos(0));
_sprites->_anims[stackPos(0)].play = true;
return 0;
}
int KyraEngine::cmd_sceneAnimOff(ScriptState *script) {
- debug(3, kDebugLevelScriptFuncs, "cmd_sceneAnimOff(0x%X) (%d)", script, stackPos(0));
+ debugC(3, kDebugLevelScriptFuncs, "cmd_sceneAnimOff(0x%X) (%d)", script, stackPos(0));
_sprites->_anims[stackPos(0)].play = false;
return 0;
}
int KyraEngine::cmd_getElapsedSeconds(ScriptState *script) {
- debug(3, kDebugLevelScriptFuncs, "cmd_getElapsedSeconds(0x%X) ()", script);
+ debugC(3, kDebugLevelScriptFuncs, "cmd_getElapsedSeconds(0x%X) ()", script);
return _system->getMillis() / 1000;
}
int KyraEngine::cmd_mouseIsPointer(ScriptState *script) {
- debug(3, kDebugLevelScriptFuncs, "cmd_mouseIsPointer(0x%X) ()", script);
+ debugC(3, kDebugLevelScriptFuncs, "cmd_mouseIsPointer(0x%X) ()", script);
if (_itemInHand == -1) {
return 1;
}
@@ -227,13 +227,13 @@ int KyraEngine::cmd_mouseIsPointer(ScriptState *script) {
}
int KyraEngine::cmd_destroyMouseItem(ScriptState *script) {
- debug(3, kDebugLevelScriptFuncs, "cmd_destroyMouseItem(0x%X) ()", script);
+ debugC(3, kDebugLevelScriptFuncs, "cmd_destroyMouseItem(0x%X) ()", script);
destroyMouseItem();
return 0;
}
int KyraEngine::cmd_runSceneAnimUntilDone(ScriptState *script) {
- debug(3, kDebugLevelScriptFuncs, "cmd_runSceneAnimUntilDone(0x%X) (%d)", script, stackPos(0));
+ debugC(3, kDebugLevelScriptFuncs, "cmd_runSceneAnimUntilDone(0x%X) (%d)", script, stackPos(0));
_screen->hideMouse();
_animator->restoreAllObjectBackgrounds();
_sprites->_anims[stackPos(0)].play = true;
@@ -251,48 +251,48 @@ int KyraEngine::cmd_runSceneAnimUntilDone(ScriptState *script) {
}
int KyraEngine::cmd_fadeSpecialPalette(ScriptState *script) {
- debug(3, kDebugLevelScriptFuncs, "cmd_fadeSpecialPalette(0x%X) (%d, %d, %d, %d)", script, stackPos(0), stackPos(1), stackPos(2), stackPos(3));
+ debugC(3, kDebugLevelScriptFuncs, "cmd_fadeSpecialPalette(0x%X) (%d, %d, %d, %d)", script, stackPos(0), stackPos(1), stackPos(2), stackPos(3));
_screen->fadeSpecialPalette(stackPos(0), stackPos(1), stackPos(2), stackPos(3));
return 0;
}
int KyraEngine::cmd_playAdlibSound(ScriptState *script) {
- debug(3, kDebugLevelScriptFuncs, "cmd_playAdlibSound(0x%X) (%d)", script, stackPos(0));
+ debugC(3, kDebugLevelScriptFuncs, "cmd_playAdlibSound(0x%X) (%d)", script, stackPos(0));
snd_playSoundEffect(stackPos(0));
return 0;
}
int KyraEngine::cmd_playAdlibScore(ScriptState *script) {
- debug(3, kDebugLevelScriptFuncs, "cmd_playAdlibScore(0x%X) (%d, %d)", script, stackPos(0), stackPos(1));
+ debugC(3, kDebugLevelScriptFuncs, "cmd_playAdlibScore(0x%X) (%d, %d)", script, stackPos(0), stackPos(1));
snd_playWanderScoreViaMap(stackPos(0), stackPos(1));
return 0;
}
int KyraEngine::cmd_phaseInSameScene(ScriptState *script) {
- debug(3, kDebugLevelScriptFuncs, "cmd_phaseInSameScene(0x%X) (%d, %d)", script, stackPos(0), stackPos(1));
+ debugC(3, kDebugLevelScriptFuncs, "cmd_phaseInSameScene(0x%X) (%d, %d)", script, stackPos(0), stackPos(1));
transcendScenes(stackPos(0), stackPos(1));
return 0;
}
int KyraEngine::cmd_setScenePhasingFlag(ScriptState *script) {
- debug(3, kDebugLevelScriptFuncs, "cmd_setScenePhasingFlag(0x%X) ()", script);
+ debugC(3, kDebugLevelScriptFuncs, "cmd_setScenePhasingFlag(0x%X) ()", script);
_scenePhasingFlag = 1;
return 1;
}
int KyraEngine::cmd_resetScenePhasingFlag(ScriptState *script) {
- debug(3, kDebugLevelScriptFuncs, "cmd_resetScenePhasingFlag(0x%X) ()", script);
+ debugC(3, kDebugLevelScriptFuncs, "cmd_resetScenePhasingFlag(0x%X) ()", script);
_scenePhasingFlag = 0;
return 0;
}
int KyraEngine::cmd_queryScenePhasingFlag(ScriptState *script) {
- debug(3, kDebugLevelScriptFuncs, "cmd_queryScenePhasingFlag(0x%X) ()", script);
+ debugC(3, kDebugLevelScriptFuncs, "cmd_queryScenePhasingFlag(0x%X) ()", script);
return _scenePhasingFlag;
}
int KyraEngine::cmd_sceneToDirection(ScriptState *script) {
- debug(3, kDebugLevelScriptFuncs, "cmd_sceneToDirection(0x%X) (%d, %d)", script, stackPos(0), stackPos(1));
+ debugC(3, kDebugLevelScriptFuncs, "cmd_sceneToDirection(0x%X) (%d, %d)", script, stackPos(0), stackPos(1));
assert(stackPos(0) < _roomTableSize);
Room *curRoom = &_roomTable[stackPos(0)];
uint16 returnValue = 0xFFFF;
@@ -322,7 +322,7 @@ int KyraEngine::cmd_sceneToDirection(ScriptState *script) {
}
int KyraEngine::cmd_setBirthstoneGem(ScriptState *script) {
- debug(3, kDebugLevelScriptFuncs, "cmd_setBirthstoneGem(0x%X) (%d, %d)", script, stackPos(0), stackPos(1));
+ debugC(3, kDebugLevelScriptFuncs, "cmd_setBirthstoneGem(0x%X) (%d, %d)", script, stackPos(0), stackPos(1));
int index = stackPos(0);
if (index < 4 && index >= 0) {
_birthstoneGemTable[index] = stackPos(1);
@@ -332,19 +332,19 @@ int KyraEngine::cmd_setBirthstoneGem(ScriptState *script) {
}
int KyraEngine::cmd_placeItemInGenericMapScene(ScriptState *script) {
- debug(3, kDebugLevelScriptFuncs, "cmd_placeItemInGenericMapScene(0x%X) (%d, %d)", script, stackPos(0), stackPos(1));
+ debugC(3, kDebugLevelScriptFuncs, "cmd_placeItemInGenericMapScene(0x%X) (%d, %d)", script, stackPos(0), stackPos(1));
placeItemInGenericMapScene(stackPos(0), stackPos(1));
return 0;
}
int KyraEngine::cmd_setBrandonStatusBit(ScriptState *script) {
- debug(3, kDebugLevelScriptFuncs, "cmd_setBrandonStatusBit(0x%X) (%d)", script, stackPos(0));
+ debugC(3, kDebugLevelScriptFuncs, "cmd_setBrandonStatusBit(0x%X) (%d)", script, stackPos(0));
_brandonStatusBit |= stackPos(0);
return 0;
}
int KyraEngine::cmd_pauseSeconds(ScriptState *script) {
- debug(3, kDebugLevelScriptFuncs, "cmd_pauseSeconds(0x%X) (%d)", script, stackPos(0));
+ debugC(3, kDebugLevelScriptFuncs, "cmd_pauseSeconds(0x%X) (%d)", script, stackPos(0));
if (stackPos(0) > 0 && !_skipFlag)
delay(stackPos(0)*1000, true);
_skipFlag = false;
@@ -352,7 +352,7 @@ int KyraEngine::cmd_pauseSeconds(ScriptState *script) {
}
int KyraEngine::cmd_getCharactersLocation(ScriptState *script) {
- debug(3, kDebugLevelScriptFuncs, "cmd_getCharactersLocation(0x%X) (%d)", script, stackPos(0));
+ debugC(3, kDebugLevelScriptFuncs, "cmd_getCharactersLocation(0x%X) (%d)", script, stackPos(0));
return _characterList[stackPos(0)].sceneId;
}
@@ -362,31 +362,31 @@ int KyraEngine::cmd_runNPCSubscript(ScriptState *script) {
}
int KyraEngine::cmd_magicOutMouseItem(ScriptState *script) {
- debug(3, kDebugLevelScriptFuncs, "cmd_magicOutMouseItem(0x%X) (%d)", script, stackPos(0));
+ debugC(3, kDebugLevelScriptFuncs, "cmd_magicOutMouseItem(0x%X) (%d)", script, stackPos(0));
magicOutMouseItem(stackPos(0), -1);
return 0;
}
int KyraEngine::cmd_internalAnimOn(ScriptState *script) {
- debug(3, kDebugLevelScriptFuncs, "cmd_internalAnimOn(0x%X) (%d)", script, stackPos(0));
+ debugC(3, kDebugLevelScriptFuncs, "cmd_internalAnimOn(0x%X) (%d)", script, stackPos(0));
_animator->sprites()[stackPos(0)].active = 1;
return 0;
}
int KyraEngine::cmd_forceBrandonToNormal(ScriptState *script) {
- debug(3, kDebugLevelScriptFuncs, "cmd_forceBrandonToNormal(0x%X) ()", script);
+ debugC(3, kDebugLevelScriptFuncs, "cmd_forceBrandonToNormal(0x%X) ()", script);
checkAmuletAnimFlags();
return 0;
}
int KyraEngine::cmd_poisonDeathNow(ScriptState *script) {
- debug(3, kDebugLevelScriptFuncs, "cmd_poisonDeathNow(0x%X) ()", script);
+ debugC(3, kDebugLevelScriptFuncs, "cmd_poisonDeathNow(0x%X) ()", script);
seq_poisonDeathNow(1);
return 0;
}
int KyraEngine::cmd_setScaleMode(ScriptState *script) {
- debug(3, kDebugLevelScriptFuncs, "cmd_setScaleMode(0x%X) (%d, %d, %d, %d)", script, stackPos(0), stackPos(1), stackPos(2), stackPos(3));
+ debugC(3, kDebugLevelScriptFuncs, "cmd_setScaleMode(0x%X) (%d, %d, %d, %d)", script, stackPos(0), stackPos(1), stackPos(2), stackPos(3));
int len = stackPos(0);
int setValue1 = stackPos(1);
int start2 = stackPos(2);
@@ -407,7 +407,7 @@ int KyraEngine::cmd_setScaleMode(ScriptState *script) {
}
int KyraEngine::cmd_openWSAFile(ScriptState *script) {
- debug(3, kDebugLevelScriptFuncs, "cmd_openWSAFile(0x%X) ('%s', %d, %d)", script, stackPosString(0), stackPos(1), stackPos(2));
+ debugC(3, kDebugLevelScriptFuncs, "cmd_openWSAFile(0x%X) ('%s', %d, %d)", script, stackPosString(0), stackPos(1), stackPos(2));
char *filename = stackPosString(0);
int wsaIndex = stackPos(1);
@@ -419,7 +419,7 @@ int KyraEngine::cmd_openWSAFile(ScriptState *script) {
}
int KyraEngine::cmd_closeWSAFile(ScriptState *script) {
- debug(3, kDebugLevelScriptFuncs, "cmd_closeWSAFile(0x%X) (%d)", script, stackPos(0));
+ debugC(3, kDebugLevelScriptFuncs, "cmd_closeWSAFile(0x%X) (%d)", script, stackPos(0));
int wsaIndex = stackPos(0);
if (_movieObjects[wsaIndex]) {
@@ -430,7 +430,7 @@ int KyraEngine::cmd_closeWSAFile(ScriptState *script) {
}
int KyraEngine::cmd_runWSAFromBeginningToEnd(ScriptState *script) {
- debug(3, kDebugLevelScriptFuncs, "cmd_runWSAFromBeginningToEnd(0x%X) (%d, %d, %d, %d, %d)", script, stackPos(0), stackPos(1), stackPos(2), stackPos(3), stackPos(4));
+ debugC(3, kDebugLevelScriptFuncs, "cmd_runWSAFromBeginningToEnd(0x%X) (%d, %d, %d, %d, %d)", script, stackPos(0), stackPos(1), stackPos(2), stackPos(3), stackPos(4));
_screen->hideMouse();
@@ -471,7 +471,7 @@ int KyraEngine::cmd_runWSAFromBeginningToEnd(ScriptState *script) {
}
int KyraEngine::cmd_displayWSAFrame(ScriptState *script) {
- debug(3, kDebugLevelScriptFuncs, "cmd_displayWSAFrame(0x%X) (%d, %d, %d, %d, %d)", script, stackPos(0), stackPos(1), stackPos(2), stackPos(3), stackPos(4));
+ debugC(3, kDebugLevelScriptFuncs, "cmd_displayWSAFrame(0x%X) (%d, %d, %d, %d, %d)", script, stackPos(0), stackPos(1), stackPos(2), stackPos(3), stackPos(4));
int frame = stackPos(0);
int xpos = stackPos(1);
int ypos = stackPos(2);
@@ -495,13 +495,13 @@ int KyraEngine::cmd_displayWSAFrame(ScriptState *script) {
}
int KyraEngine::cmd_enterNewScene(ScriptState *script) {
- debug(3, kDebugLevelScriptFuncs, "cmd_enterNewScene(0x%X) (%d, %d, %d, %d, %d)", script, stackPos(0), stackPos(1), stackPos(2), stackPos(3), stackPos(4));
+ debugC(3, kDebugLevelScriptFuncs, "cmd_enterNewScene(0x%X) (%d, %d, %d, %d, %d)", script, stackPos(0), stackPos(1), stackPos(2), stackPos(3), stackPos(4));
enterNewScene(stackPos(0), stackPos(1), stackPos(2), stackPos(3), stackPos(4));
return 0;
}
int KyraEngine::cmd_setSpecialEnterXAndY(ScriptState *script) {
- debug(3, kDebugLevelScriptFuncs, "cmd_setSpecialEnterXAndY(0x%X) (%d, %d)", script, stackPos(0), stackPos(1));
+ debugC(3, kDebugLevelScriptFuncs, "cmd_setSpecialEnterXAndY(0x%X) (%d, %d)", script, stackPos(0), stackPos(1));
_brandonPosX = stackPos(0);
_brandonPosY = stackPos(1);
if (_brandonPosX + 1 == 0 && _brandonPosY + 1 == 0)
@@ -510,7 +510,7 @@ int KyraEngine::cmd_setSpecialEnterXAndY(ScriptState *script) {
}
int KyraEngine::cmd_runWSAFrames(ScriptState *script) {
- debug(3, kDebugLevelScriptFuncs, "cmd_runWSAFrames(0x%X) (%d, %d, %d, %d, %d, %d)", script, stackPos(0), stackPos(1), stackPos(2), stackPos(3), stackPos(4), stackPos(5));
+ debugC(3, kDebugLevelScriptFuncs, "cmd_runWSAFrames(0x%X) (%d, %d, %d, %d, %d, %d)", script, stackPos(0), stackPos(1), stackPos(2), stackPos(3), stackPos(4), stackPos(5));
int xpos = stackPos(0);
int ypos = stackPos(1);
int delayTime = stackPos(2);
@@ -537,7 +537,7 @@ int KyraEngine::cmd_runWSAFrames(ScriptState *script) {
}
int KyraEngine::cmd_popBrandonIntoScene(ScriptState *script) {
- debug(3, kDebugLevelScriptFuncs, "cmd_popBrandonIntoScene(0x%X) (%d, %d, %d, %d)", script, stackPos(0), stackPos(1), stackPos(2), stackPos(3));
+ debugC(3, kDebugLevelScriptFuncs, "cmd_popBrandonIntoScene(0x%X) (%d, %d, %d, %d)", script, stackPos(0), stackPos(1), stackPos(2), stackPos(3));
int changeScaleMode = stackPos(3);
int xpos = (int16)(stackPos(0) & 0xFFFC);
int ypos = (int16)(stackPos(1) & 0xFFFE);
@@ -587,13 +587,13 @@ int KyraEngine::cmd_popBrandonIntoScene(ScriptState *script) {
}
int KyraEngine::cmd_restoreAllObjectBackgrounds(ScriptState *script) {
- debug(3, kDebugLevelScriptFuncs, "cmd_restoreAllObjectBackgrounds(0x%X) ()", script);
+ debugC(3, kDebugLevelScriptFuncs, "cmd_restoreAllObjectBackgrounds(0x%X) ()", script);
_animator->restoreAllObjectBackgrounds();
return 0;
}
int KyraEngine::cmd_setCustomPaletteRange(ScriptState *script) {
- debug(3, kDebugLevelScriptFuncs, "cmd_setCustomPaletteRange(0x%X) (%d, %d, %d)", script, stackPos(0), stackPos(1), stackPos(2));
+ debugC(3, kDebugLevelScriptFuncs, "cmd_setCustomPaletteRange(0x%X) (%d, %d, %d)", script, stackPos(0), stackPos(1), stackPos(2));
uint8 *screenPal = _screen->_currentPalette;
memcpy(&screenPal[stackPos(1)*3], _specialPalettes[stackPos(0)], stackPos(2)*3);
_screen->setScreenPalette(screenPal);
@@ -601,7 +601,7 @@ int KyraEngine::cmd_setCustomPaletteRange(ScriptState *script) {
}
int KyraEngine::cmd_loadPageFromDisk(ScriptState *script) {
- debug(3, kDebugLevelScriptFuncs, "cmd_loadPageFromDisk(0x%X) ('%s', %d)", script, stackPosString(0), stackPos(1));
+ debugC(3, kDebugLevelScriptFuncs, "cmd_loadPageFromDisk(0x%X) ('%s', %d)", script, stackPosString(0), stackPos(1));
_screen->loadPageFromDisk(stackPosString(0), stackPos(1));
_animator->_updateScreen = true;
return 0;
@@ -609,13 +609,13 @@ int KyraEngine::cmd_loadPageFromDisk(ScriptState *script) {
int KyraEngine::cmd_customPrintTalkString(ScriptState *script) {
if (_features & GF_TALKIE) {
- debug(3, kDebugLevelScriptFuncs, "cmd_customPrintTalkString(0x%X) (%d, '%s', %d, %d, %d)", script, stackPos(0), stackPosString(1), stackPos(2), stackPos(3), stackPos(4) & 0xFF);
+ debugC(3, kDebugLevelScriptFuncs, "cmd_customPrintTalkString(0x%X) (%d, '%s', %d, %d, %d)", script, stackPos(0), stackPosString(1), stackPos(2), stackPos(3), stackPos(4) & 0xFF);
snd_voiceWaitForFinish();
snd_playVoiceFile(stackPos(0));
_skipFlag = false;
_text->printTalkTextMessage(stackPosString(1), stackPos(2), stackPos(3), stackPos(4) & 0xFF, 0, 2);
} else {
- debug(3, kDebugLevelScriptFuncs, "cmd_customPrintTalkString(0x%X) ('%s', %d, %d, %d)", script, stackPosString(0), stackPos(1), stackPos(2), stackPos(3) & 0xFF);
+ debugC(3, kDebugLevelScriptFuncs, "cmd_customPrintTalkString(0x%X) ('%s', %d, %d, %d)", script, stackPosString(0), stackPos(1), stackPos(2), stackPos(3) & 0xFF);
_skipFlag = false;
_text->printTalkTextMessage(stackPosString(0), stackPos(1), stackPos(2), stackPos(3) & 0xFF, 0, 2);
}
@@ -624,35 +624,35 @@ int KyraEngine::cmd_customPrintTalkString(ScriptState *script) {
}
int KyraEngine::cmd_restoreCustomPrintBackground(ScriptState *script) {
- debug(3, kDebugLevelScriptFuncs, "cmd_restoreCustomPrintBackground(0x%X) ()", script);
+ debugC(3, kDebugLevelScriptFuncs, "cmd_restoreCustomPrintBackground(0x%X) ()", script);
_text->restoreTalkTextMessageBkgd(2, 0);
return 0;
}
int KyraEngine::cmd_hideMouse(ScriptState *script) {
- debug(3, kDebugLevelScriptFuncs, "cmd_hideMouse(0x%X) ()", script);
+ debugC(3, kDebugLevelScriptFuncs, "cmd_hideMouse(0x%X) ()", script);
_screen->hideMouse();
return 0;
}
int KyraEngine::cmd_showMouse(ScriptState *script) {
- debug(3, kDebugLevelScriptFuncs, "cmd_showMouse(0x%X) ()", script);
+ debugC(3, kDebugLevelScriptFuncs, "cmd_showMouse(0x%X) ()", script);
_screen->showMouse();
return 0;
}
int KyraEngine::cmd_getCharacterX(ScriptState *script) {
- debug(3, kDebugLevelScriptFuncs, "cmd_getCharacterX(0x%X) (%d)", script, stackPos(0));
+ debugC(3, kDebugLevelScriptFuncs, "cmd_getCharacterX(0x%X) (%d)", script, stackPos(0));
return _characterList[stackPos(0)].x1;
}
int KyraEngine::cmd_getCharacterY(ScriptState *script) {
- debug(3, kDebugLevelScriptFuncs, "cmd_getCharacterY(0x%X) (%d)", script, stackPos(0));
+ debugC(3, kDebugLevelScriptFuncs, "cmd_getCharacterY(0x%X) (%d)", script, stackPos(0));
return _characterList[stackPos(0)].y1;
}
int KyraEngine::cmd_changeCharactersFacing(ScriptState *script) {
- debug(3, kDebugLevelScriptFuncs, "cmd_changeCharactersFacing(0x%X) (%d, %d, %d)", script, stackPos(0), stackPos(1), stackPos(2));
+ debugC(3, kDebugLevelScriptFuncs, "cmd_changeCharactersFacing(0x%X) (%d, %d, %d)", script, stackPos(0), stackPos(1), stackPos(2));
int character = stackPos(0);
int facing = stackPos(1);
int newAnimFrame = stackPos(2);
@@ -671,7 +671,7 @@ int KyraEngine::cmd_changeCharactersFacing(ScriptState *script) {
}
int KyraEngine::cmd_copyWSARegion(ScriptState *script) {
- debug(3, kDebugLevelScriptFuncs, "cmd_copyWSARegion(0x%X) (%d, %d, %d, %d, %d, %d)", script, stackPos(0), stackPos(1), stackPos(2), stackPos(3), stackPos(4), stackPos(5));
+ debugC(3, kDebugLevelScriptFuncs, "cmd_copyWSARegion(0x%X) (%d, %d, %d, %d, %d, %d)", script, stackPos(0), stackPos(1), stackPos(2), stackPos(3), stackPos(4), stackPos(5));
int xpos = stackPos(0);
int ypos = stackPos(1);
int width = stackPos(2);
@@ -684,14 +684,14 @@ int KyraEngine::cmd_copyWSARegion(ScriptState *script) {
}
int KyraEngine::cmd_printText(ScriptState *script) {
- debug(3, kDebugLevelScriptFuncs, "cmd_printText(0x%X) ('%s', %d, %d, 0x%X, 0x%X)", script, stackPosString(0), stackPos(1), stackPos(2), stackPos(3), stackPos(4));
+ debugC(3, kDebugLevelScriptFuncs, "cmd_printText(0x%X) ('%s', %d, %d, 0x%X, 0x%X)", script, stackPosString(0), stackPos(1), stackPos(2), stackPos(3), stackPos(4));
_screen->printText(stackPosString(0), stackPos(1), stackPos(2), stackPos(3), stackPos(4));
_screen->updateScreen();
return 0;
}
int KyraEngine::cmd_random(ScriptState *script) {
- debug(3, kDebugLevelScriptFuncs, "cmd_random(0x%X) (%d, %d)", script, stackPos(0), stackPos(1));
+ debugC(3, kDebugLevelScriptFuncs, "cmd_random(0x%X) (%d, %d)", script, stackPos(0), stackPos(1));
assert(stackPos(0) < stackPos(1));
return _rnd.getRandomNumberRng(stackPos(0), stackPos(1));
}
@@ -702,7 +702,7 @@ int KyraEngine::cmd_loadSoundFile(ScriptState *script) {
}
int KyraEngine::cmd_displayWSAFrameOnHidPage(ScriptState *script) {
- debug(3, kDebugLevelScriptFuncs, "cmd_displayWSAFrameOnHidPage(0x%X) (%d, %d, %d, %d, %d)", script, stackPos(0), stackPos(1), stackPos(2), stackPos(3), stackPos(4));
+ debugC(3, kDebugLevelScriptFuncs, "cmd_displayWSAFrameOnHidPage(0x%X) (%d, %d, %d, %d, %d)", script, stackPos(0), stackPos(1), stackPos(2), stackPos(3), stackPos(4));
int frame = stackPos(0);
int xpos = stackPos(1);
int ypos = stackPos(2);
@@ -728,7 +728,7 @@ int KyraEngine::cmd_displayWSAFrameOnHidPage(ScriptState *script) {
}
int KyraEngine::cmd_displayWSASequentialFrames(ScriptState *script) {
- debug(3, kDebugLevelScriptFuncs, "cmd_displayWSASequentialFrames(0x%X) (%d, %d, %d, %d, %d, %d, %d)", script, stackPos(0), stackPos(1), stackPos(2), stackPos(3), stackPos(4), stackPos(5), stackPos(6));
+ debugC(3, kDebugLevelScriptFuncs, "cmd_displayWSASequentialFrames(0x%X) (%d, %d, %d, %d, %d, %d, %d)", script, stackPos(0), stackPos(1), stackPos(2), stackPos(3), stackPos(4), stackPos(5), stackPos(6));
int startFrame = stackPos(0);
int endFrame = stackPos(1);
int xpos = stackPos(2);
@@ -786,7 +786,7 @@ int KyraEngine::cmd_displayWSASequentialFrames(ScriptState *script) {
}
int KyraEngine::cmd_drawCharacterStanding(ScriptState *script) {
- debug(3, kDebugLevelScriptFuncs, "cmd_drawCharacterStanding(0x%X) (%d, %d, %d, %d)", script, stackPos(0), stackPos(1), stackPos(2), stackPos(3));
+ debugC(3, kDebugLevelScriptFuncs, "cmd_drawCharacterStanding(0x%X) (%d, %d, %d, %d)", script, stackPos(0), stackPos(1), stackPos(2), stackPos(3));
int character = stackPos(0);
int animFrame = stackPos(1);
int newFacing = stackPos(2);
@@ -803,13 +803,13 @@ int KyraEngine::cmd_drawCharacterStanding(ScriptState *script) {
}
int KyraEngine::cmd_internalAnimOff(ScriptState *script) {
- debug(3, kDebugLevelScriptFuncs, "cmd_internalAnimOff(0x%X) (%d)", script, stackPos(0));
+ debugC(3, kDebugLevelScriptFuncs, "cmd_internalAnimOff(0x%X) (%d)", script, stackPos(0));
_animator->sprites()[stackPos(0)].active = 0;
return 0;
}
int KyraEngine::cmd_changeCharactersXAndY(ScriptState *script) {
- debug(3, kDebugLevelScriptFuncs, "cmd_changeCharactersXAndY(0x%X) (%d, %d, %d)", script, stackPos(0), stackPos(1), stackPos(2));
+ debugC(3, kDebugLevelScriptFuncs, "cmd_changeCharactersXAndY(0x%X) (%d, %d, %d)", script, stackPos(0), stackPos(1), stackPos(2));
Character *ch = &_characterList[stackPos(0)];
int16 x = stackPos(1);
int16 y = stackPos(2);
@@ -825,25 +825,25 @@ int KyraEngine::cmd_changeCharactersXAndY(ScriptState *script) {
}
int KyraEngine::cmd_clearSceneAnimatorBeacon(ScriptState *script) {
- debug(3, kDebugLevelScriptFuncs, "cmd_clearSceneAnimatorBeacon(0x%X) ()", script);
+ debugC(3, kDebugLevelScriptFuncs, "cmd_clearSceneAnimatorBeacon(0x%X) ()", script);
_sprites->_sceneAnimatorBeaconFlag = 0;
return 0;
}
int KyraEngine::cmd_querySceneAnimatorBeacon(ScriptState *script) {
- debug(3, kDebugLevelScriptFuncs, "cmd_querySceneAnimatorBeacon(0x%X) ()", script);
+ debugC(3, kDebugLevelScriptFuncs, "cmd_querySceneAnimatorBeacon(0x%X) ()", script);
return _sprites->_sceneAnimatorBeaconFlag;
}
int KyraEngine::cmd_refreshSceneAnimator(ScriptState *script) {
- debug(3, kDebugLevelScriptFuncs, "cmd_refreshSceneAnimator(0x%X) ()", script);
+ debugC(3, kDebugLevelScriptFuncs, "cmd_refreshSceneAnimator(0x%X) ()", script);
_sprites->updateSceneAnims();
_animator->updateAllObjectShapes();
return 0;
}
int KyraEngine::cmd_placeItemInOffScene(ScriptState *script) {
- debug(3, kDebugLevelScriptFuncs, "cmd_placeItemInOffScene(0x%X) (%d, %d, %d, %d)", script, stackPos(0), stackPos(1), stackPos(2), stackPos(3));
+ debugC(3, kDebugLevelScriptFuncs, "cmd_placeItemInOffScene(0x%X) (%d, %d, %d, %d)", script, stackPos(0), stackPos(1), stackPos(2), stackPos(3));
int item = stackPos(0);
int xpos = stackPos(1);
int ypos = stackPos(2);
@@ -862,7 +862,7 @@ int KyraEngine::cmd_placeItemInOffScene(ScriptState *script) {
}
int KyraEngine::cmd_wipeDownMouseItem(ScriptState *script) {
- debug(3, kDebugLevelScriptFuncs, "cmd_wipeDownMouseItem(0x%X) (%d, %d, %d)", script, stackPos(0), stackPos(1), stackPos(2));
+ debugC(3, kDebugLevelScriptFuncs, "cmd_wipeDownMouseItem(0x%X) (%d, %d, %d)", script, stackPos(0), stackPos(1), stackPos(2));
_screen->hideMouse();
wipeDownMouseItem(stackPos(1), stackPos(2));
destroyMouseItem();
@@ -871,7 +871,7 @@ int KyraEngine::cmd_wipeDownMouseItem(ScriptState *script) {
}
int KyraEngine::cmd_placeCharacterInOtherScene(ScriptState *script) {
- debug(3, kDebugLevelScriptFuncs, "cmd_placeCharacterInOtherScene(0x%X) (%d, %d, %d, %d, %d, %d)", script, stackPos(0), stackPos(1), stackPos(2), stackPos(3), stackPos(4), stackPos(5));
+ debugC(3, kDebugLevelScriptFuncs, "cmd_placeCharacterInOtherScene(0x%X) (%d, %d, %d, %d, %d, %d)", script, stackPos(0), stackPos(1), stackPos(2), stackPos(3), stackPos(4), stackPos(5));
int id = stackPos(0);
int sceneId = stackPos(1);
int xpos = (int16)(stackPos(2) & 0xFFFC);
@@ -888,7 +888,7 @@ int KyraEngine::cmd_placeCharacterInOtherScene(ScriptState *script) {
}
int KyraEngine::cmd_getKey(ScriptState *script) {
- debug(3, kDebugLevelScriptFuncs, "cmd_getKey(0x%X) ()", script);
+ debugC(3, kDebugLevelScriptFuncs, "cmd_getKey(0x%X) ()", script);
waitForEvent();
return 0;
}
@@ -899,7 +899,7 @@ int KyraEngine::cmd_specificItemInInventory(ScriptState *script) {
}
int KyraEngine::cmd_popMobileNPCIntoScene(ScriptState *script) {
- debug(3, kDebugLevelScriptFuncs, "cmd_popMobileNPCIntoScene(0x%X) (%d, %d, %d, %d, %d, %d)", script, stackPos(0), stackPos(1), stackPos(2), stackPos(3), (int16)(stackPos(4) & 0xFFFC), (int8)(stackPos(5) & 0xFE));
+ debugC(3, kDebugLevelScriptFuncs, "cmd_popMobileNPCIntoScene(0x%X) (%d, %d, %d, %d, %d, %d)", script, stackPos(0), stackPos(1), stackPos(2), stackPos(3), (int16)(stackPos(4) & 0xFFFC), (int8)(stackPos(5) & 0xFE));
int character = stackPos(0);
int sceneId = stackPos(1);
int animFrame = stackPos(2);
@@ -935,7 +935,7 @@ int KyraEngine::cmd_unhideMobileCharacter(ScriptState *script) {
}
int KyraEngine::cmd_setCharactersLocation(ScriptState *script) {
- debug(3, kDebugLevelScriptFuncs, "cmd_setCharactersLocation(0x%X) (%d, %d)", script, stackPos(0), stackPos(1));
+ debugC(3, kDebugLevelScriptFuncs, "cmd_setCharactersLocation(0x%X) (%d, %d)", script, stackPos(0), stackPos(1));
Character *ch = &_characterList[stackPos(0)];
AnimObject *animObj = &_animator->actors()[stackPos(0)];
int newScene = stackPos(1);
@@ -952,7 +952,7 @@ int KyraEngine::cmd_setCharactersLocation(ScriptState *script) {
}
int KyraEngine::cmd_walkCharacterToPoint(ScriptState *script) {
- debug(3, kDebugLevelScriptFuncs, "cmd_walkCharacterToPoint(0x%X) (%d, %d, %d)", script, stackPos(0), stackPos(1), stackPos(2));
+ debugC(3, kDebugLevelScriptFuncs, "cmd_walkCharacterToPoint(0x%X) (%d, %d, %d)", script, stackPos(0), stackPos(1), stackPos(2));
int character = stackPos(0);
int toX = stackPos(1);
int toY = stackPos(2);
@@ -1035,7 +1035,7 @@ int KyraEngine::cmd_walkCharacterToPoint(ScriptState *script) {
}
int KyraEngine::cmd_specialEventDisplayBrynnsNote(ScriptState *script) {
- debug(3, kDebugLevelScriptFuncs, "cmd_specialEventDisplayBrynnsNote(0x%X) ()", script);
+ debugC(3, kDebugLevelScriptFuncs, "cmd_specialEventDisplayBrynnsNote(0x%X) ()", script);
_screen->hideMouse();
_screen->savePageToDisk("HIDPAGE.TMP", 2);
_screen->savePageToDisk("SEENPAGE.TMP", 0);
@@ -1058,7 +1058,7 @@ int KyraEngine::cmd_specialEventDisplayBrynnsNote(ScriptState *script) {
}
int KyraEngine::cmd_specialEventRemoveBrynnsNote(ScriptState *script) {
- debug(3, kDebugLevelScriptFuncs, "cmd_specialEventRemoveBrynnsNote(0x%X) ()", script);
+ debugC(3, kDebugLevelScriptFuncs, "cmd_specialEventRemoveBrynnsNote(0x%X) ()", script);
_screen->hideMouse();
_screen->loadPageFromDisk("SEENPAGE.TMP", 0);
_screen->loadPageFromDisk("HIDPAGE.TMP", 2);
@@ -1069,25 +1069,25 @@ int KyraEngine::cmd_specialEventRemoveBrynnsNote(ScriptState *script) {
}
int KyraEngine::cmd_setLogicPage(ScriptState *script) {
- debug(3, kDebugLevelScriptFuncs, "cmd_setLogicPage(0x%X) (%d)", script, stackPos(0));
+ debugC(3, kDebugLevelScriptFuncs, "cmd_setLogicPage(0x%X) (%d)", script, stackPos(0));
_screen->_curPage = stackPos(0);
return stackPos(0);
}
int KyraEngine::cmd_fatPrint(ScriptState *script) {
- debug(3, kDebugLevelScriptFuncs, "cmd_fatPrint(0x%X) ('%s', %d, %d, %d, %d, %d)", script, stackPosString(0), stackPos(1), stackPos(2), stackPos(3), stackPos(4), stackPos(5));
+ debugC(3, kDebugLevelScriptFuncs, "cmd_fatPrint(0x%X) ('%s', %d, %d, %d, %d, %d)", script, stackPosString(0), stackPos(1), stackPos(2), stackPos(3), stackPos(4), stackPos(5));
_text->printText(stackPosString(0), stackPos(1), stackPos(2), stackPos(3), stackPos(4), stackPos(5));
return 0;
}
int KyraEngine::cmd_preserveAllObjectBackgrounds(ScriptState *script) {
- debug(3, kDebugLevelScriptFuncs, "cmd_preserveAllObjectBackgrounds(0x%X) ()", script);
+ debugC(3, kDebugLevelScriptFuncs, "cmd_preserveAllObjectBackgrounds(0x%X) ()", script);
_animator->preserveAllBackgrounds();
return 0;
}
int KyraEngine::cmd_updateSceneAnimations(ScriptState *script) {
- debug(3, kDebugLevelScriptFuncs, "cmd_updateSceneAnimations(0x%X) (%d)", script, stackPos(0));
+ debugC(3, kDebugLevelScriptFuncs, "cmd_updateSceneAnimations(0x%X) (%d)", script, stackPos(0));
if (stackPos(0)) {
_sprites->updateSceneAnims();
_animator->updateAllObjectShapes();
@@ -1096,23 +1096,23 @@ int KyraEngine::cmd_updateSceneAnimations(ScriptState *script) {
}
int KyraEngine::cmd_sceneAnimationActive(ScriptState *script) {
- debug(3, kDebugLevelScriptFuncs, "cmd_sceneAnimationActive(0x%X) (%d)", script, stackPos(0));
+ debugC(3, kDebugLevelScriptFuncs, "cmd_sceneAnimationActive(0x%X) (%d)", script, stackPos(0));
return _sprites->_anims[stackPos(0)].play;
}
int KyraEngine::cmd_setCharactersMovementDelay(ScriptState *script) {
- debug(3, kDebugLevelScriptFuncs, "cmd_setCharactersMovementDelay(0x%X) (%d, %d)", script, stackPos(0), stackPos(1));
+ debugC(3, kDebugLevelScriptFuncs, "cmd_setCharactersMovementDelay(0x%X) (%d, %d)", script, stackPos(0), stackPos(1));
setTimerDelay(stackPos(0)+5, stackPos(1));
return 0;
}
int KyraEngine::cmd_getCharactersFacing(ScriptState *script) {
- debug(3, kDebugLevelScriptFuncs, "cmd_getCharactersFacing(0x%X) (%d)", script, stackPos(0));
+ debugC(3, kDebugLevelScriptFuncs, "cmd_getCharactersFacing(0x%X) (%d)", script, stackPos(0));
return _characterList[stackPos(0)].facing;
}
int KyraEngine::cmd_bkgdScrollSceneAndMasksRight(ScriptState *script) {
- debug(3, kDebugLevelScriptFuncs, "cmd_bkgdScrollSceneAndMasksRight(0x%X) (%d)", script, stackPos(0));
+ debugC(3, kDebugLevelScriptFuncs, "cmd_bkgdScrollSceneAndMasksRight(0x%X) (%d)", script, stackPos(0));
_screen->copyBackgroundBlock(stackPos(0), 2, 0);
_screen->copyBackgroundBlock2(stackPos(0));
// update the whole screen
@@ -1122,13 +1122,13 @@ int KyraEngine::cmd_bkgdScrollSceneAndMasksRight(ScriptState *script) {
}
int KyraEngine::cmd_dispelMagicAnimation(ScriptState *script) {
- debug(3, kDebugLevelScriptFuncs, "cmd_dispelMagicAnimation(0x%X) ()", script);
+ debugC(3, kDebugLevelScriptFuncs, "cmd_dispelMagicAnimation(0x%X) ()", script);
seq_dispelMagicAnimation();
return 0;
}
int KyraEngine::cmd_findBrightestFireberry(ScriptState *script) {
- debug(3, kDebugLevelScriptFuncs, "cmd_findBrightestFireberry(0x%X) ()", script);
+ debugC(3, kDebugLevelScriptFuncs, "cmd_findBrightestFireberry(0x%X) ()", script);
if (_currentCharacter->sceneId >= 187 && _currentCharacter->sceneId <= 198) {
return 29;
}
@@ -1171,7 +1171,7 @@ int KyraEngine::cmd_findBrightestFireberry(ScriptState *script) {
}
int KyraEngine::cmd_setFireberryGlowPalette(ScriptState *script) {
- debug(3, kDebugLevelScriptFuncs, "cmd_setFireberryGlowPalette(0x%X) (%d)", script, stackPos(0));
+ debugC(3, kDebugLevelScriptFuncs, "cmd_setFireberryGlowPalette(0x%X) (%d)", script, stackPos(0));
int palIndex = 0;
switch (stackPos(0)) {
case 0x1E:
@@ -1209,19 +1209,19 @@ int KyraEngine::cmd_setFireberryGlowPalette(ScriptState *script) {
}
int KyraEngine::cmd_setDeathHandlerFlag(ScriptState *script) {
- debug(3, kDebugLevelScriptFuncs, "cmd_setDeathHandlerFlag(0x%X) (%d)", script, stackPos(0));
+ debugC(3, kDebugLevelScriptFuncs, "cmd_setDeathHandlerFlag(0x%X) (%d)", script, stackPos(0));
_deathHandler = stackPos(0);
return 0;
}
int KyraEngine::cmd_drinkPotionAnimation(ScriptState *script) {
- debug(3, kDebugLevelScriptFuncs, "cmd_drinkPotionAnimation(0x%X) (%d, %d, %d)", script, stackPos(0), stackPos(1), stackPos(2));
+ debugC(3, kDebugLevelScriptFuncs, "cmd_drinkPotionAnimation(0x%X) (%d, %d, %d)", script, stackPos(0), stackPos(1), stackPos(2));
seq_playDrinkPotionAnim(stackPos(0), stackPos(1), stackPos(2));
return 0;
}
int KyraEngine::cmd_makeAmuletAppear(ScriptState *script) {
- debug(3, kDebugLevelScriptFuncs, "cmd_makeAmuletAppear(0x%X) ()", script);
+ debugC(3, kDebugLevelScriptFuncs, "cmd_makeAmuletAppear(0x%X) ()", script);
WSAMovieV1 amulet(this);
amulet.open("AMULET.WSA", 1, 0);
amulet._drawPage = 0;
@@ -1266,7 +1266,7 @@ int KyraEngine::cmd_makeAmuletAppear(ScriptState *script) {
}
int KyraEngine::cmd_drawItemShapeIntoScene(ScriptState *script) {
- debug(3, kDebugLevelScriptFuncs, "cmd_drawItemShapeIntoScene(0x%X) (%d, %d, %d, %d, %d)", script, stackPos(0), stackPos(1), stackPos(2), stackPos(3), stackPos(4));
+ debugC(3, kDebugLevelScriptFuncs, "cmd_drawItemShapeIntoScene(0x%X) (%d, %d, %d, %d, %d)", script, stackPos(0), stackPos(1), stackPos(2), stackPos(3), stackPos(4));
int item = stackPos(0);
int x = stackPos(1);
int y = stackPos(2);
@@ -1290,13 +1290,13 @@ int KyraEngine::cmd_drawItemShapeIntoScene(ScriptState *script) {
}
int KyraEngine::cmd_setCharactersCurrentFrame(ScriptState *script) {
- debug(3, kDebugLevelScriptFuncs, "cmd_setCharactersCurrentFrame(0x%X) (%d, %d)", script, stackPos(0), stackPos(1));
+ debugC(3, kDebugLevelScriptFuncs, "cmd_setCharactersCurrentFrame(0x%X) (%d, %d)", script, stackPos(0), stackPos(1));
_characterList[stackPos(0)].currentAnimFrame = stackPos(1);
return 0;
}
int KyraEngine::cmd_waitForConfirmationMouseClick(ScriptState *script) {
- debug(3, kDebugLevelScriptFuncs, "cmd_waitForConfirmationMouseClick(0x%X) ()", script);
+ debugC(3, kDebugLevelScriptFuncs, "cmd_waitForConfirmationMouseClick(0x%X) ()", script);
// if (mouseEnabled) {
while (!_mousePressFlag) {
updateMousePointer();
@@ -1324,18 +1324,18 @@ int KyraEngine::cmd_pageFlip(ScriptState *script) {
}
int KyraEngine::cmd_setSceneFile(ScriptState *script) {
- debug(3, kDebugLevelScriptFuncs, "cmd_setSceneFile(0x%X) (%d, %d)", script, stackPos(0), stackPos(1));
+ debugC(3, kDebugLevelScriptFuncs, "cmd_setSceneFile(0x%X) (%d, %d)", script, stackPos(0), stackPos(1));
setSceneFile(stackPos(0), stackPos(1));
return 0;
}
int KyraEngine::cmd_getItemInMarbleVase(ScriptState *script) {
- debug(3, kDebugLevelScriptFuncs, "cmd_getItemInMarbleVase(0x%X) ()", script);
+ debugC(3, kDebugLevelScriptFuncs, "cmd_getItemInMarbleVase(0x%X) ()", script);
return _marbleVaseItem;
}
int KyraEngine::cmd_setItemInMarbleVase(ScriptState *script) {
- debug(3, kDebugLevelScriptFuncs, "cmd_setItemInMarbleVase(0x%X) (%d)", script, stackPos(0));
+ debugC(3, kDebugLevelScriptFuncs, "cmd_setItemInMarbleVase(0x%X) (%d)", script, stackPos(0));
_marbleVaseItem = stackPos(0);
return 0;
}
@@ -1356,37 +1356,37 @@ int KyraEngine::cmd_shakeScreen(ScriptState *script) {
}
int KyraEngine::cmd_createAmuletJewel(ScriptState *script) {
- debug(3, kDebugLevelScriptFuncs, "cmd_createAmuletJewel(0x%X) (%d)", script, stackPos(0));
+ debugC(3, kDebugLevelScriptFuncs, "cmd_createAmuletJewel(0x%X) (%d)", script, stackPos(0));
seq_createAmuletJewel(stackPos(0), 0, 0, 0);
return 0;
}
int KyraEngine::cmd_setSceneAnimCurrXY(ScriptState *script) {
- debug(3, kDebugLevelScriptFuncs, "cmd_setSceneAnimCurrXY(0x%X) (%d, %d, %d)", script, stackPos(0), stackPos(1), stackPos(2));
+ debugC(3, kDebugLevelScriptFuncs, "cmd_setSceneAnimCurrXY(0x%X) (%d, %d, %d)", script, stackPos(0), stackPos(1), stackPos(2));
_sprites->_anims[stackPos(0)].x = stackPos(1);
_sprites->_anims[stackPos(0)].y = stackPos(2);
return 0;
}
int KyraEngine::cmd_poisonBrandonAndRemaps(ScriptState *script) {
- debug(3, kDebugLevelScriptFuncs, "cmd_poisonBrandonAndRemaps(0x%X) ()", script);
+ debugC(3, kDebugLevelScriptFuncs, "cmd_poisonBrandonAndRemaps(0x%X) ()", script);
setBrandonPoisonFlags(1);
return 0;
}
int KyraEngine::cmd_fillFlaskWithWater(ScriptState *script) {
- debug(3, kDebugLevelScriptFuncs, "cmd_fillFlaskWithWater(0x%X) (%d, %d)", script, stackPos(0), stackPos(1));
+ debugC(3, kDebugLevelScriptFuncs, "cmd_fillFlaskWithWater(0x%X) (%d, %d)", script, stackPos(0), stackPos(1));
seq_fillFlaskWithWater(stackPos(0), stackPos(1));
return 0;
}
int KyraEngine::cmd_getCharactersMovementDelay(ScriptState *script) {
- debug(3, kDebugLevelScriptFuncs, "cmd_getCharactersMovementDelay(0x%X) (%d)", script, stackPos(0));
+ debugC(3, kDebugLevelScriptFuncs, "cmd_getCharactersMovementDelay(0x%X) (%d)", script, stackPos(0));
return getTimerDelay(stackPos(0)+5);
}
int KyraEngine::cmd_getBirthstoneGem(ScriptState *script) {
- debug(3, kDebugLevelScriptFuncs, "cmd_getBirthstoneGem(0x%X) (%d)", script, stackPos(0));
+ debugC(3, kDebugLevelScriptFuncs, "cmd_getBirthstoneGem(0x%X) (%d)", script, stackPos(0));
if (stackPos(0) < 4) {
return _birthstoneGemTable[stackPos(0)];
}
@@ -1394,7 +1394,7 @@ int KyraEngine::cmd_getBirthstoneGem(ScriptState *script) {
}
int KyraEngine::cmd_queryBrandonStatusBit(ScriptState *script) {
- debug(3, kDebugLevelScriptFuncs, "cmd_queryBrandonStatusBit(0x%X) (%d)", script, stackPos(0));
+ debugC(3, kDebugLevelScriptFuncs, "cmd_queryBrandonStatusBit(0x%X) (%d)", script, stackPos(0));
if (_brandonStatusBit & stackPos(0)) {
return 1;
}
@@ -1402,13 +1402,13 @@ int KyraEngine::cmd_queryBrandonStatusBit(ScriptState *script) {
}
int KyraEngine::cmd_playFluteAnimation(ScriptState *script) {
- debug(3, kDebugLevelScriptFuncs, "cmd_playFluteAnimation(0x%X) ()", script);
+ debugC(3, kDebugLevelScriptFuncs, "cmd_playFluteAnimation(0x%X) ()", script);
seq_playFluteAnimation();
return 0;
}
int KyraEngine::cmd_playWinterScrollSequence(ScriptState *script) {
- debug(3, kDebugLevelScriptFuncs, "cmd_playWinterScrollSequence(0x%X) (%d)", script, stackPos(0));
+ debugC(3, kDebugLevelScriptFuncs, "cmd_playWinterScrollSequence(0x%X) (%d)", script, stackPos(0));
if (!stackPos(0)) {
seq_winterScroll2();
} else {
@@ -1418,30 +1418,30 @@ int KyraEngine::cmd_playWinterScrollSequence(ScriptState *script) {
}
int KyraEngine::cmd_getIdolGem(ScriptState *script) {
- debug(3, kDebugLevelScriptFuncs, "cmd_getIdolGem(0x%X) (%d)", script, stackPos(0));
+ debugC(3, kDebugLevelScriptFuncs, "cmd_getIdolGem(0x%X) (%d)", script, stackPos(0));
return _idolGemsTable[stackPos(0)];;
}
int KyraEngine::cmd_setIdolGem(ScriptState *script) {
- debug(3, kDebugLevelScriptFuncs, "cmd_setIdolGem(0x%X) (%d, %d)", script, stackPos(0), stackPos(1));
+ debugC(3, kDebugLevelScriptFuncs, "cmd_setIdolGem(0x%X) (%d, %d)", script, stackPos(0), stackPos(1));
_idolGemsTable[stackPos(0)] = stackPos(1);
return 0;
}
int KyraEngine::cmd_totalItemsInScene(ScriptState *script) {
- debug(3, kDebugLevelScriptFuncs, "cmd_totalItemsInScene(0x%X) (%d)", script, stackPos(0));
+ debugC(3, kDebugLevelScriptFuncs, "cmd_totalItemsInScene(0x%X) (%d)", script, stackPos(0));
return countItemsInScene(stackPos(0));
}
int KyraEngine::cmd_restoreBrandonsMovementDelay(ScriptState *script) {
- debug(3, kDebugLevelScriptFuncs, "cmd_restoreBrandonsMovementDelay(0x%X) ()", script);
+ debugC(3, kDebugLevelScriptFuncs, "cmd_restoreBrandonsMovementDelay(0x%X) ()", script);
//TODO: Use movement set by menu, instead of 5.
setTimerDelay(5, 5);
return 0;
}
int KyraEngine::cmd_setMousePos(ScriptState *script) {
- debug(3, kDebugLevelScriptFuncs, "cmd_setMousePos(0x%X) (%d, %d)", script, stackPos(0), stackPos(1));
+ debugC(3, kDebugLevelScriptFuncs, "cmd_setMousePos(0x%X) (%d, %d)", script, stackPos(0), stackPos(1));
_system->warpMouse(stackPos(0), stackPos(1));
_mouseX = stackPos(0);
_mouseY = stackPos(1);
@@ -1449,12 +1449,12 @@ int KyraEngine::cmd_setMousePos(ScriptState *script) {
}
int KyraEngine::cmd_getMouseState(ScriptState *script) {
- debug(3, kDebugLevelScriptFuncs, "cmd_getMouseState(0x%X) ()", script);
+ debugC(3, kDebugLevelScriptFuncs, "cmd_getMouseState(0x%X) ()", script);
return _mouseState;
}
int KyraEngine::cmd_setEntranceMouseCursorTrack(ScriptState *script) {
- debug(3, kDebugLevelScriptFuncs, "cmd_setEntranceMouseCursorTrack(0x%X) (%d, %d, %d, %d, %d)", script, stackPos(0), stackPos(1), stackPos(2), stackPos(3), stackPos(4));
+ debugC(3, kDebugLevelScriptFuncs, "cmd_setEntranceMouseCursorTrack(0x%X) (%d, %d, %d, %d, %d)", script, stackPos(0), stackPos(1), stackPos(2), stackPos(3), stackPos(4));
_entranceMouseCursorTracks[0] = stackPos(0);
_entranceMouseCursorTracks[1] = stackPos(1);
_entranceMouseCursorTracks[2] = stackPos(0) + stackPos(2) - 1;
@@ -1464,13 +1464,13 @@ int KyraEngine::cmd_setEntranceMouseCursorTrack(ScriptState *script) {
}
int KyraEngine::cmd_itemAppearsOnGround(ScriptState *script) {
- debug(3, kDebugLevelScriptFuncs, "cmd_itemAppearsOnGround(0x%X) (%d, %d, %d)", script, stackPos(0), stackPos(1), stackPos(2));
+ debugC(3, kDebugLevelScriptFuncs, "cmd_itemAppearsOnGround(0x%X) (%d, %d, %d)", script, stackPos(0), stackPos(1), stackPos(2));
processItemDrop(_currentCharacter->sceneId, stackPos(0), stackPos(1), stackPos(2), 2, 0);
return 0;
}
int KyraEngine::cmd_setNoDrawShapesFlag(ScriptState *script) {
- debug(3, kDebugLevelScriptFuncs, "cmd_setNoDrawShapesFlag(0x%X) (%d)", script, stackPos(0));
+ debugC(3, kDebugLevelScriptFuncs, "cmd_setNoDrawShapesFlag(0x%X) (%d)", script, stackPos(0));
_animator->_noDrawShapesFlag = stackPos(0);
return 0;
}
@@ -1481,7 +1481,7 @@ int KyraEngine::cmd_fadeEntirePalette(ScriptState *script) {
}
int KyraEngine::cmd_itemOnGroundHere(ScriptState *script) {
- debug(3, kDebugLevelScriptFuncs, "cmd_itemOnGroundHere(0x%X) (%d, %d)", script, stackPos(0), stackPos(1));
+ debugC(3, kDebugLevelScriptFuncs, "cmd_itemOnGroundHere(0x%X) (%d, %d)", script, stackPos(0), stackPos(1));
assert(stackPos(0) < _roomTableSize);
Room *curRoom = &_roomTable[stackPos(0)];
for (int i = 0; i < 12; ++i) {
@@ -1492,18 +1492,18 @@ int KyraEngine::cmd_itemOnGroundHere(ScriptState *script) {
}
int KyraEngine::cmd_queryCauldronState(ScriptState *script) {
- debug(3, kDebugLevelScriptFuncs, "cmd_queryCauldronState(0x%X) ()", script);
+ debugC(3, kDebugLevelScriptFuncs, "cmd_queryCauldronState(0x%X) ()", script);
return _cauldronState;
}
int KyraEngine::cmd_setCauldronState(ScriptState *script) {
- debug(3, kDebugLevelScriptFuncs, "cmd_setCauldronState(0x%X) (%d)", script, stackPos(0));
+ debugC(3, kDebugLevelScriptFuncs, "cmd_setCauldronState(0x%X) (%d)", script, stackPos(0));
_cauldronState = stackPos(0);
return _cauldronState;
}
int KyraEngine::cmd_queryCrystalState(ScriptState *script) {
- debug(3, kDebugLevelScriptFuncs, "cmd_queryCrystalState(0x%X) (%d)", script, stackPos(0));
+ debugC(3, kDebugLevelScriptFuncs, "cmd_queryCrystalState(0x%X) (%d)", script, stackPos(0));
if (!stackPos(0)) {
return _crystalState[0];
} else if (stackPos(0) == 1) {
@@ -1513,7 +1513,7 @@ int KyraEngine::cmd_queryCrystalState(ScriptState *script) {
}
int KyraEngine::cmd_setCrystalState(ScriptState *script) {
- debug(3, kDebugLevelScriptFuncs, "cmd_setCrystalState(0x%X) (%d)", script, stackPos(0), stackPos(1));
+ debugC(3, kDebugLevelScriptFuncs, "cmd_setCrystalState(0x%X) (%d)", script, stackPos(0), stackPos(1));
if (!stackPos(0)) {
_crystalState[0] = stackPos(1);
} else if (stackPos(0) == 1) {
@@ -1528,7 +1528,7 @@ int KyraEngine::cmd_setPaletteRange(ScriptState *script) {
}
int KyraEngine::cmd_shrinkBrandonDown(ScriptState *script) {
- debug(3, kDebugLevelScriptFuncs, "cmd_shrinkBrandonDown(0x%X) (%d)", script, stackPos(0));
+ debugC(3, kDebugLevelScriptFuncs, "cmd_shrinkBrandonDown(0x%X) (%d)", script, stackPos(0));
int delayTime = stackPos(0);
checkAmuletAnimFlags();
int scaleValue = _scaleTable[_currentCharacter->y1];
@@ -1553,7 +1553,7 @@ int KyraEngine::cmd_shrinkBrandonDown(ScriptState *script) {
}
int KyraEngine::cmd_growBrandonUp(ScriptState *script) {
- debug(3, kDebugLevelScriptFuncs, "cmd_growBrandonUp(0x%X) ()", script);
+ debugC(3, kDebugLevelScriptFuncs, "cmd_growBrandonUp(0x%X) ()", script);
int scaleValue = _scaleTable[_currentCharacter->y1];
int scale = 0;
if (_scaleMode) {
@@ -1574,26 +1574,26 @@ int KyraEngine::cmd_growBrandonUp(ScriptState *script) {
}
int KyraEngine::cmd_setBrandonScaleXAndY(ScriptState *script) {
- debug(3, kDebugLevelScriptFuncs, "cmd_setBrandonScaleXAndY(0x%X) (%d, %d)", script, stackPos(0), stackPos(1));
+ debugC(3, kDebugLevelScriptFuncs, "cmd_setBrandonScaleXAndY(0x%X) (%d, %d)", script, stackPos(0), stackPos(1));
_animator->_brandonScaleX = stackPos(0);
_animator->_brandonScaleY = stackPos(1);
return 0;
}
int KyraEngine::cmd_resetScaleMode(ScriptState *script) {
- debug(3, kDebugLevelScriptFuncs, "cmd_resetScaleMode(0x%X) ()", script);
+ debugC(3, kDebugLevelScriptFuncs, "cmd_resetScaleMode(0x%X) ()", script);
_scaleMode = 0;
return 0;
}
int KyraEngine::cmd_getScaleDepthTableValue(ScriptState *script) {
- debug(3, kDebugLevelScriptFuncs, "cmd_getScaleDepthTableValue(0x%X) (%d)", script, stackPos(0));
+ debugC(3, kDebugLevelScriptFuncs, "cmd_getScaleDepthTableValue(0x%X) (%d)", script, stackPos(0));
assert(stackPos(0) < ARRAYSIZE(_scaleTable));
return _scaleTable[stackPos(0)];
}
int KyraEngine::cmd_setScaleDepthTableValue(ScriptState *script) {
- debug(3, kDebugLevelScriptFuncs, "cmd_setScaleDepthTableValue(0x%X) (%d, %d)", script, stackPos(0), stackPos(1));
+ debugC(3, kDebugLevelScriptFuncs, "cmd_setScaleDepthTableValue(0x%X) (%d, %d)", script, stackPos(0), stackPos(1));
assert(stackPos(0) < ARRAYSIZE(_scaleTable));
_scaleTable[stackPos(0)] = stackPos(1);
return stackPos(1);
@@ -1601,10 +1601,10 @@ int KyraEngine::cmd_setScaleDepthTableValue(ScriptState *script) {
int KyraEngine::cmd_message(ScriptState *script) {
if (_features & GF_TALKIE) {
- debug(3, kDebugLevelScriptFuncs, "cmd_message(0x%X) (%d, '%s', %d)", script, stackPos(0), stackPosString(1), stackPos(2));
+ debugC(3, kDebugLevelScriptFuncs, "cmd_message(0x%X) (%d, '%s', %d)", script, stackPos(0), stackPosString(1), stackPos(2));
drawSentenceCommand(stackPosString(1), stackPos(2));
} else {
- debug(3, kDebugLevelScriptFuncs, "cmd_message(0x%X) ('%s', %d)", script, stackPosString(0), stackPos(1));
+ debugC(3, kDebugLevelScriptFuncs, "cmd_message(0x%X) ('%s', %d)", script, stackPosString(0), stackPos(1));
drawSentenceCommand(stackPosString(0), stackPos(1));
}
@@ -1612,38 +1612,38 @@ int KyraEngine::cmd_message(ScriptState *script) {
}
int KyraEngine::cmd_checkClickOnNPC(ScriptState *script) {
- debug(3, kDebugLevelScriptFuncs, "cmd_checkClickOnNPC(0x%X) (%d, %d)", script, stackPos(0), stackPos(1));
+ debugC(3, kDebugLevelScriptFuncs, "cmd_checkClickOnNPC(0x%X) (%d, %d)", script, stackPos(0), stackPos(1));
return checkForNPCScriptRun(stackPos(0), stackPos(1));
}
int KyraEngine::cmd_getFoyerItem(ScriptState *script) {
- debug(3, kDebugLevelScriptFuncs, "cmd_getFoyerItem(0x%X) (%d)", stackPos(0));
+ debugC(3, kDebugLevelScriptFuncs, "cmd_getFoyerItem(0x%X) (%d)", stackPos(0));
assert(stackPos(0) < ARRAYSIZE(_foyerItemTable));
return _foyerItemTable[stackPos(0)];
}
int KyraEngine::cmd_setFoyerItem(ScriptState *script) {
- debug(3, kDebugLevelScriptFuncs, "cmd_setFoyerItem(0x%X) (%d, %d)", stackPos(0), stackPos(1));
+ debugC(3, kDebugLevelScriptFuncs, "cmd_setFoyerItem(0x%X) (%d, %d)", stackPos(0), stackPos(1));
assert(stackPos(0) < ARRAYSIZE(_foyerItemTable));
_foyerItemTable[stackPos(0)] = stackPos(1);
return stackPos(1);
}
int KyraEngine::cmd_setNoItemDropRegion(ScriptState *script) {
- debug(3, kDebugLevelScriptFuncs, "cmd_setNoItemDropRegion(0x%X) (%d, %d, %d, %d)", script, stackPos(0), stackPos(1), stackPos(2), stackPos(3));
+ debugC(3, kDebugLevelScriptFuncs, "cmd_setNoItemDropRegion(0x%X) (%d, %d, %d, %d)", script, stackPos(0), stackPos(1), stackPos(2), stackPos(3));
addToNoDropRects(stackPos(0), stackPos(1), stackPos(2), stackPos(3));
return 0;
}
int KyraEngine::cmd_walkMalcolmOn(ScriptState *script) {
- debug(3, kDebugLevelScriptFuncs, "cmd_walkMalcolmOn(0x%X) ()", script);
+ debugC(3, kDebugLevelScriptFuncs, "cmd_walkMalcolmOn(0x%X) ()", script);
if (!_malcolmFlag)
_malcolmFlag = 1;
return 0;
}
int KyraEngine::cmd_passiveProtection(ScriptState *script) {
- debug(3, kDebugLevelScriptFuncs, "cmd_passiveProtection(0x%X) ()", script);
+ debugC(3, kDebugLevelScriptFuncs, "cmd_passiveProtection(0x%X) ()", script);
return 1;
}
@@ -1658,13 +1658,13 @@ int KyraEngine::cmd_brandonToStoneSequence(ScriptState *script) {
}
int KyraEngine::cmd_brandonHealingSequence(ScriptState *script) {
- debug(3, kDebugLevelScriptFuncs, "cmd_brandonHealingSequence(0x%X) ()", script);
+ debugC(3, kDebugLevelScriptFuncs, "cmd_brandonHealingSequence(0x%X) ()", script);
seq_brandonHealing();
return 0;
}
int KyraEngine::cmd_protectCommandLine(ScriptState *script) {
- debug(3, kDebugLevelScriptFuncs, "cmd_protectCommandLine(0x%X) (%d)", script, stackPos(0));
+ debugC(3, kDebugLevelScriptFuncs, "cmd_protectCommandLine(0x%X) (%d)", script, stackPos(0));
return stackPos(0);
}
@@ -1679,13 +1679,13 @@ int KyraEngine::cmd_resetMaskRegion(ScriptState *script) {
}
int KyraEngine::cmd_setPaletteChangeFlag(ScriptState *script) {
- debug(3, kDebugLevelScriptFuncs, "cmd_setPaletteChangeFlag(0x%X) (%d)", script, stackPos(0));
+ debugC(3, kDebugLevelScriptFuncs, "cmd_setPaletteChangeFlag(0x%X) (%d)", script, stackPos(0));
_paletteChanged = stackPos(0);
return _paletteChanged;
}
int KyraEngine::cmd_fillRect(ScriptState *script) {
- debug(3, kDebugLevelScriptFuncs, "cmd_fillRect(0x%X) (%d, %d, %d, %d, %d, 0x%X)", script, stackPos(0), stackPos(1), stackPos(2), stackPos(3), stackPos(4), stackPos(5));
+ debugC(3, kDebugLevelScriptFuncs, "cmd_fillRect(0x%X) (%d, %d, %d, %d, %d, 0x%X)", script, stackPos(0), stackPos(1), stackPos(2), stackPos(3), stackPos(4), stackPos(5));
int videoPageBackup = _screen->_curPage;
_screen->_curPage = stackPos(0);
_screen->fillRect(stackPos(1), stackPos(2), stackPos(3), stackPos(4), stackPos(5));
@@ -1694,19 +1694,19 @@ int KyraEngine::cmd_fillRect(ScriptState *script) {
}
int KyraEngine::cmd_vocUnload(ScriptState *script) {
- debug(3, kDebugLevelScriptFuncs, "cmd_vocUnload(0x%X) ()", script);
+ debugC(3, kDebugLevelScriptFuncs, "cmd_vocUnload(0x%X) ()", script);
// this should unload all voc files (not needed)
return 0;
}
int KyraEngine::cmd_vocLoad(ScriptState *script) {
- debug(3, kDebugLevelScriptFuncs, "cmd_vocLoad(0x%X) (%d)", script, stackPos(0));
+ debugC(3, kDebugLevelScriptFuncs, "cmd_vocLoad(0x%X) (%d)", script, stackPos(0));
// this should load the specified voc file (not needed)
return 0;
}
int KyraEngine::cmd_dummy(ScriptState *script) {
- debug(3, kDebugLevelScriptFuncs, "cmd_dummy(0x%X) ()", script);
+ debugC(3, kDebugLevelScriptFuncs, "cmd_dummy(0x%X) ()", script);
return 0;
}
diff --git a/engines/kyra/seqplayer.cpp b/engines/kyra/seqplayer.cpp
index fdafb1ce09..b91f50d490 100644
--- a/engines/kyra/seqplayer.cpp
+++ b/engines/kyra/seqplayer.cpp
@@ -64,7 +64,7 @@ SeqPlayer::~SeqPlayer() {
}
uint8 *SeqPlayer::setPanPages(int pageNum, int shape) {
- debug( 9, kDebugLevelSequence, "SeqPlayer::setPanPages(%d, %d)", pageNum, shape);
+ debugC( 9, kDebugLevelSequence, "SeqPlayer::setPanPages(%d, %d)", pageNum, shape);
uint8 *panPage = 0;
const uint8 *data = _screen->getPagePtr(pageNum);
uint16 numShapes = READ_LE_UINT16(data);
@@ -88,7 +88,7 @@ uint8 *SeqPlayer::setPanPages(int pageNum, int shape) {
}
void SeqPlayer::makeHandShapes() {
- debug( 9, kDebugLevelSequence, "SeqPlayer::makeHandShapes()");
+ debugC( 9, kDebugLevelSequence, "SeqPlayer::makeHandShapes()");
_vm->loadBitmap("WRITING.CPS", 3, 3, 0);
for (int i = 0; i < ARRAYSIZE(_handShapes); ++i) {
if (_handShapes[i])
@@ -98,7 +98,7 @@ void SeqPlayer::makeHandShapes() {
}
void SeqPlayer::freeHandShapes() {
- debug( 9, kDebugLevelSequence, "SeqPlayer::freeHandShapes()");
+ debugC( 9, kDebugLevelSequence, "SeqPlayer::freeHandShapes()");
for (int i = 0; i < ARRAYSIZE(_handShapes); ++i) {
free(_handShapes[i]);
_handShapes[i] = 0;
@@ -461,7 +461,7 @@ void SeqPlayer::s1_prefetchVocFile() {
}
bool SeqPlayer::playSequence(const uint8 *seqData, bool skipSeq) {
- debug( 9, kDebugLevelSequence, "SeqPlayer::seq_playSequence(0x%X, %d)", seqData, skipSeq);
+ debugC( 9, kDebugLevelSequence, "SeqPlayer::seq_playSequence(0x%X, %d)", seqData, skipSeq);
assert(seqData);
static SeqEntry floppySeqProcs[] = {
@@ -623,7 +623,7 @@ bool SeqPlayer::playSequence(const uint8 *seqData, bool skipSeq) {
uint8 seqCode = *_seqData++;
if (seqCode < numCommands) {
SeqProc currentProc = commands[seqCode].proc;
- debug( 5, kDebugLevelSequence, "seqCode = %d (%s)", seqCode, commands[seqCode].desc);
+ debugC( 5, kDebugLevelSequence, "seqCode = %d (%s)", seqCode, commands[seqCode].desc);
(this->*currentProc)();
} else {
error("Invalid sequence opcode %d", seqCode);
diff --git a/engines/kyra/sequences_v1.cpp b/engines/kyra/sequences_v1.cpp
index f3e63840b3..04eb9d3a48 100644
--- a/engines/kyra/sequences_v1.cpp
+++ b/engines/kyra/sequences_v1.cpp
@@ -36,7 +36,7 @@
namespace Kyra {
void KyraEngine::seq_demo() {
- debug(9, kDebugLevelMain, "KyraEngine::seq_demo()");
+ debugC(9, kDebugLevelMain, "KyraEngine::seq_demo()");
snd_playTheme(MUSIC_INTRO, 2);
@@ -86,7 +86,7 @@ void KyraEngine::seq_demo() {
}
void KyraEngine::seq_intro() {
- debug(9, kDebugLevelMain, "KyraEngine::seq_intro()");
+ debugC(9, kDebugLevelMain, "KyraEngine::seq_intro()");
if (_features & GF_TALKIE) {
_res->loadPakFile("INTRO.VRM");
@@ -126,7 +126,7 @@ void KyraEngine::seq_intro() {
}
void KyraEngine::seq_introLogos() {
- debug(9, kDebugLevelMain, "KyraEngine::seq_introLogos()");
+ debugC(9, kDebugLevelMain, "KyraEngine::seq_introLogos()");
_screen->clearPage(0);
loadBitmap("TOP.CPS", 7, 7, NULL);
loadBitmap("BOTTOM.CPS", 5, 5, _screen->_currentPalette);
@@ -181,7 +181,7 @@ void KyraEngine::seq_introLogos() {
}
void KyraEngine::seq_introStory() {
- debug(9, kDebugLevelMain, "KyraEngine::seq_introStory()");
+ debugC(9, kDebugLevelMain, "KyraEngine::seq_introStory()");
_screen->clearPage(3);
_screen->clearPage(0);
if (_features & GF_TALKIE) {
@@ -199,19 +199,19 @@ void KyraEngine::seq_introStory() {
}
_screen->copyRegion(0, 0, 0, 0, 320, 200, 3, 0);
_screen->updateScreen();
- //debug(0, kDebugLevelMain, "skipFlag %i, %i", _skipFlag, _tickLength);
+ //debugC(0, kDebugLevelMain, "skipFlag %i, %i", _skipFlag, _tickLength);
delay(360 * _tickLength);
}
void KyraEngine::seq_introMalcolmTree() {
- debug(9, kDebugLevelMain, "KyraEngine::seq_introMalcolmTree()");
+ debugC(9, kDebugLevelMain, "KyraEngine::seq_introMalcolmTree()");
_screen->_curPage = 0;
_screen->clearPage(3);
_seq->playSequence(_seq_MalcolmTree, true);
}
void KyraEngine::seq_introKallakWriting() {
- debug(9, kDebugLevelMain, "KyraEngine::seq_introKallakWriting()");
+ debugC(9, kDebugLevelMain, "KyraEngine::seq_introKallakWriting()");
_seq->makeHandShapes();
_screen->setAnimBlockPtr(5060);
_screen->_charWidth = -2;
@@ -220,13 +220,13 @@ void KyraEngine::seq_introKallakWriting() {
}
void KyraEngine::seq_introKallakMalcolm() {
- debug(9, kDebugLevelMain, "KyraEngine::seq_introKallakMalcolm()");
+ debugC(9, kDebugLevelMain, "KyraEngine::seq_introKallakMalcolm()");
_screen->clearPage(3);
_seq->playSequence(_seq_KallakMalcolm, true);
}
void KyraEngine::seq_createAmuletJewel(int jewel, int page, int noSound, int drawOnly) {
- debug(9, kDebugLevelMain, "seq_createAmuletJewel(%d, %d, %d, %d)", jewel, page, noSound, drawOnly);
+ debugC(9, kDebugLevelMain, "seq_createAmuletJewel(%d, %d, %d, %d)", jewel, page, noSound, drawOnly);
static const uint16 specialJewelTable[] = {
0x167, 0x162, 0x15D, 0x158, 0x153, 0xFFFF
};
@@ -286,7 +286,7 @@ void KyraEngine::seq_createAmuletJewel(int jewel, int page, int noSound, int dra
}
void KyraEngine::seq_brandonHealing() {
- debug(9, kDebugLevelMain, "seq_brandonHealing()");
+ debugC(9, kDebugLevelMain, "seq_brandonHealing()");
if (!(_deathHandler & 8))
return;
if (_currentCharacter->sceneId == 210) {
@@ -317,7 +317,7 @@ void KyraEngine::seq_brandonHealing() {
}
void KyraEngine::seq_brandonHealing2() {
- debug(9, kDebugLevelMain, "seq_brandonHealing2()");
+ debugC(9, kDebugLevelMain, "seq_brandonHealing2()");
_screen->hideMouse();
checkAmuletAnimFlags();
assert(_healingShape2Table);
@@ -349,7 +349,7 @@ void KyraEngine::seq_brandonHealing2() {
}
void KyraEngine::seq_poisonDeathNow(int now) {
- debug(9, kDebugLevelMain, "seq_poisonDeathNow(%d)", now);
+ debugC(9, kDebugLevelMain, "seq_poisonDeathNow(%d)", now);
if (!(_brandonStatusBit & 1))
return;
++_poisonDeathCounter;
@@ -386,7 +386,7 @@ void KyraEngine::seq_poisonDeathNow(int now) {
}
void KyraEngine::seq_poisonDeathNowAnim() {
- debug(9, kDebugLevelMain, "seq_poisonDeathNowAnim()");
+ debugC(9, kDebugLevelMain, "seq_poisonDeathNowAnim()");
_screen->hideMouse();
checkAmuletAnimFlags();
assert(_posionDeathShapeTable);
@@ -427,7 +427,7 @@ void KyraEngine::seq_poisonDeathNowAnim() {
}
void KyraEngine::seq_playFluteAnimation() {
- debug(9, kDebugLevelMain, "seq_playFluteAnimation()");
+ debugC(9, kDebugLevelMain, "seq_playFluteAnimation()");
_screen->hideMouse();
checkAmuletAnimFlags();
setupShapes123(_fluteAnimShapeTable, 36, 0);
@@ -489,7 +489,7 @@ void KyraEngine::seq_playFluteAnimation() {
}
void KyraEngine::seq_winterScroll1() {
- debug(9, kDebugLevelMain, "seq_winterScroll1()");
+ debugC(9, kDebugLevelMain, "seq_winterScroll1()");
_screen->hideMouse();
checkAmuletAnimFlags();
assert(_winterScrollTable);
@@ -570,7 +570,7 @@ void KyraEngine::seq_winterScroll1() {
}
void KyraEngine::seq_winterScroll2() {
- debug(9, kDebugLevelMain, "seq_winterScroll2()");
+ debugC(9, kDebugLevelMain, "seq_winterScroll2()");
_screen->hideMouse();
checkAmuletAnimFlags();
assert(_winterScrollTable);
@@ -599,7 +599,7 @@ void KyraEngine::seq_winterScroll2() {
}
void KyraEngine::seq_makeBrandonInv() {
- debug(9, kDebugLevelMain, "seq_makeBrandonInv()");
+ debugC(9, kDebugLevelMain, "seq_makeBrandonInv()");
if (_deathHandler == 8)
return;
@@ -625,7 +625,7 @@ void KyraEngine::seq_makeBrandonInv() {
}
void KyraEngine::seq_makeBrandonNormal() {
- debug(9, kDebugLevelMain, "seq_makeBrandonNormal()");
+ debugC(9, kDebugLevelMain, "seq_makeBrandonNormal()");
_screen->hideMouse();
_brandonStatusBit |= 0x40;
snd_playSoundEffect(0x77);
@@ -641,7 +641,7 @@ void KyraEngine::seq_makeBrandonNormal() {
}
void KyraEngine::seq_makeBrandonNormal2() {
- debug(9, kDebugLevelMain, "seq_makeBrandonNormal2()");
+ debugC(9, kDebugLevelMain, "seq_makeBrandonNormal2()");
_screen->hideMouse();
assert(_brandonToWispTable);
setupShapes123(_brandonToWispTable, 26, 0);
@@ -666,7 +666,7 @@ void KyraEngine::seq_makeBrandonNormal2() {
}
void KyraEngine::seq_makeBrandonWisp() {
- debug(9, kDebugLevelMain, "seq_makeBrandonWisp()");
+ debugC(9, kDebugLevelMain, "seq_makeBrandonWisp()");
if (_deathHandler == 8)
return;
@@ -706,7 +706,7 @@ void KyraEngine::seq_makeBrandonWisp() {
}
void KyraEngine::seq_dispelMagicAnimation() {
- debug(9, kDebugLevelMain, "seq_dispelMagicAnimation()");
+ debugC(9, kDebugLevelMain, "seq_dispelMagicAnimation()");
if (_deathHandler == 8)
return;
if (_currentCharacter->sceneId == 210) {
@@ -748,7 +748,7 @@ void KyraEngine::seq_dispelMagicAnimation() {
}
void KyraEngine::seq_fillFlaskWithWater(int item, int type) {
- debug(9, kDebugLevelMain, "seq_fillFlaskWithWater(%d, %d)", item, type);
+ debugC(9, kDebugLevelMain, "seq_fillFlaskWithWater(%d, %d)", item, type);
int newItem = -1;
static const uint8 flaskTable1[] = { 0x46, 0x48, 0x4A, 0x4C };
static const uint8 flaskTable2[] = { 0x47, 0x49, 0x4B, 0x4D };
@@ -789,7 +789,7 @@ void KyraEngine::seq_fillFlaskWithWater(int item, int type) {
}
void KyraEngine::seq_playDrinkPotionAnim(int unk1, int unk2, int flags) {
- debug(9, kDebugLevelMain, "KyraEngine::seq_playDrinkPotionAnim(%d, %d, %d)", unk1, unk2, flags);
+ debugC(9, kDebugLevelMain, "KyraEngine::seq_playDrinkPotionAnim(%d, %d, %d)", unk1, unk2, flags);
// XXX
_screen->hideMouse();
checkAmuletAnimFlags();
@@ -832,7 +832,7 @@ void KyraEngine::seq_playDrinkPotionAnim(int unk1, int unk2, int flags) {
}
int KyraEngine::seq_playEnd() {
- debug(9, kDebugLevelMain, "KyraEngine::seq_playEnd()");
+ debugC(9, kDebugLevelMain, "KyraEngine::seq_playEnd()");
if (_endSequenceSkipFlag) {
return 0;
}
@@ -917,7 +917,7 @@ int KyraEngine::seq_playEnd() {
}
void KyraEngine::seq_brandonToStone() {
- debug(9, kDebugLevelMain, "KyraEngine::seq_brandonToStone()");
+ debugC(9, kDebugLevelMain, "KyraEngine::seq_brandonToStone()");
_screen->hideMouse();
assert(_brandonStoneTable);
setupShapes123(_brandonStoneTable, 14, 0);
@@ -933,7 +933,7 @@ void KyraEngine::seq_brandonToStone() {
}
void KyraEngine::seq_playEnding() {
- debug(9, kDebugLevelMain, "KyraEngine::seq_playEnding()");
+ debugC(9, kDebugLevelMain, "KyraEngine::seq_playEnding()");
_screen->hideMouse();
res_unloadResources(RES_INGAME);
res_loadResources(RES_OUTRO);
@@ -952,7 +952,7 @@ void KyraEngine::seq_playEnding() {
}
void KyraEngine::seq_playCredits() {
- debug(9, kDebugLevelMain, "KyraEngine::seq_playCredits()");
+ debugC(9, kDebugLevelMain, "KyraEngine::seq_playCredits()");
static const uint8 colorMap[] = { 0, 0, 0xC, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
_screen->hideMouse();
uint32 sz = 0;
@@ -978,12 +978,12 @@ void KyraEngine::seq_playCredits() {
}
bool KyraEngine::seq_skipSequence() const {
- debug(9, kDebugLevelMain, "KyraEngine::seq_skipSequence()");
+ debugC(9, kDebugLevelMain, "KyraEngine::seq_skipSequence()");
return _quitFlag || _abortIntroFlag;
}
int KyraEngine::handleMalcolmFlag() {
- debug(9, kDebugLevelMain, "KyraEngine::handleMalcolmFlag()");
+ debugC(9, kDebugLevelMain, "KyraEngine::handleMalcolmFlag()");
static uint16 frame = 0;
static uint32 timer1 = 0;
static uint32 timer2 = 0;
@@ -1150,7 +1150,7 @@ int KyraEngine::handleMalcolmFlag() {
}
int KyraEngine::handleBeadState() {
- debug(9, kDebugLevelMain, "KyraEngine::handleBeadState()");
+ debugC(9, kDebugLevelMain, "KyraEngine::handleBeadState()");
static uint32 timer1 = 0;
static uint32 timer2 = 0;
static BeadState beadState1 = { -1, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
@@ -1366,7 +1366,7 @@ int KyraEngine::handleBeadState() {
}
void KyraEngine::initBeadState(int x, int y, int x2, int y2, int unk, BeadState *ptr) {
- debug(9, kDebugLevelMain, "KyraEngine::initBeadState(%d, %d, %d, %d, %d, 0x%X)", x, y, x2, y2, unk, ptr);
+ debugC(9, kDebugLevelMain, "KyraEngine::initBeadState(%d, %d, %d, %d, %d, 0x%X)", x, y, x2, y2, unk, ptr);
ptr->unk9 = unk;
int xDiff = x2 - x;
int yDiff = y2 - y;
@@ -1401,7 +1401,7 @@ void KyraEngine::initBeadState(int x, int y, int x2, int y2, int unk, BeadState
}
int KyraEngine::processBead(int x, int y, int &x2, int &y2, BeadState *ptr) {
- debug(9, kDebugLevelMain, "KyraEngine::processBead(%d, %d, 0x%X, 0x%X, 0x%X)", x, y, &x2, &y2, ptr);
+ debugC(9, kDebugLevelMain, "KyraEngine::processBead(%d, %d, 0x%X, 0x%X, 0x%X)", x, y, &x2, &y2, ptr);
if (x == ptr->dstX && y == ptr->dstY) {
return 1;
}
@@ -1441,7 +1441,7 @@ int KyraEngine::processBead(int x, int y, int &x2, int &y2, BeadState *ptr) {
}
void KyraEngine::setupPanPages() {
- debug(9, kDebugLevelMain, "KyraEngine::setupPanPages()");
+ debugC(9, kDebugLevelMain, "KyraEngine::setupPanPages()");
loadBitmap("bead.cps", 3, 3, 0);
for (int i = 0; i <= 19; ++i) {
_panPagesTable[i] = _seq->setPanPages(3, i);
@@ -1449,7 +1449,7 @@ void KyraEngine::setupPanPages() {
}
void KyraEngine::freePanPages() {
- debug(9, kDebugLevelMain, "KyraEngine::freePanPages()");
+ debugC(9, kDebugLevelMain, "KyraEngine::freePanPages()");
delete _endSequenceBackUpRect;
_endSequenceBackUpRect = 0;
for (int i = 0; i <= 19; ++i) {
@@ -1459,7 +1459,7 @@ void KyraEngine::freePanPages() {
}
void KyraEngine::closeFinalWsa() {
- debug(9, kDebugLevelMain, "KyraEngine::closeFinalWsa()");
+ debugC(9, kDebugLevelMain, "KyraEngine::closeFinalWsa()");
delete _finalA;
_finalA = 0;
delete _finalB;
@@ -1541,7 +1541,7 @@ void KyraEngine::updateKyragemFading() {
}
void KyraEngine::drawJewelPress(int jewel, int drawSpecial) {
- debug(9, kDebugLevelMain, "KyraEngine::drawJewelPress(%d, %d)", jewel, drawSpecial);
+ debugC(9, kDebugLevelMain, "KyraEngine::drawJewelPress(%d, %d)", jewel, drawSpecial);
_screen->hideMouse();
int shape = 0;
if (drawSpecial) {
@@ -1564,7 +1564,7 @@ void KyraEngine::drawJewelPress(int jewel, int drawSpecial) {
}
void KyraEngine::drawJewelsFadeOutStart() {
- debug(9, kDebugLevelMain, "KyraEngine::drawJewelsFadeOutStart()");
+ debugC(9, kDebugLevelMain, "KyraEngine::drawJewelsFadeOutStart()");
static const uint16 jewelTable1[] = { 0x164, 0x15F, 0x15A, 0x155, 0x150, 0xFFFF };
static const uint16 jewelTable2[] = { 0x163, 0x15E, 0x159, 0x154, 0x14F, 0xFFFF };
static const uint16 jewelTable3[] = { 0x166, 0x160, 0x15C, 0x157, 0x152, 0xFFFF };
@@ -1588,7 +1588,7 @@ void KyraEngine::drawJewelsFadeOutStart() {
}
void KyraEngine::drawJewelsFadeOutEnd(int jewel) {
- debug(9, kDebugLevelMain, "KyraEngine::drawJewelsFadeOutEnd(%d)", jewel);
+ debugC(9, kDebugLevelMain, "KyraEngine::drawJewelsFadeOutEnd(%d)", jewel);
static const uint16 jewelTable[] = { 0x153, 0x158, 0x15D, 0x162, 0x148, 0xFFFF };
int newDelay = 0;
switch (jewel-1) {
diff --git a/engines/kyra/sound.cpp b/engines/kyra/sound.cpp
index 3d4ac5ca47..564174306a 100644
--- a/engines/kyra/sound.cpp
+++ b/engines/kyra/sound.cpp
@@ -376,7 +376,7 @@ bool SoundPC::voiceIsPlaying() {
}
void KyraEngine::snd_playTheme(int file, int track) {
- debug(9, kDebugLevelMain, "KyraEngine::snd_playTheme(%d)", file);
+ debugC(9, kDebugLevelMain, "KyraEngine::snd_playTheme(%d)", file);
assert(file < _xmidiFilesCount);
_curMusicTheme = _newMusicTheme = file;
_sound->playMusic(_xmidiFiles[file]);
@@ -384,13 +384,13 @@ void KyraEngine::snd_playTheme(int file, int track) {
}
void KyraEngine::snd_setSoundEffectFile(int file) {
- debug(9, kDebugLevelMain, "KyraEngine::snd_setSoundEffectFile(%d)", file);
+ debugC(9, kDebugLevelMain, "KyraEngine::snd_setSoundEffectFile(%d)", file);
assert(file < _xmidiFilesCount);
_sound->loadSoundEffectFile(_xmidiFiles[file]);
}
void KyraEngine::snd_playSoundEffect(int track) {
- debug(9, kDebugLevelMain, "KyraEngine::snd_playSoundEffect(%d)", track);
+ debugC(9, kDebugLevelMain, "KyraEngine::snd_playSoundEffect(%d)", track);
if (track == 49) {
snd_playWanderScoreViaMap(56, 1);
} else {
@@ -399,7 +399,7 @@ void KyraEngine::snd_playSoundEffect(int track) {
}
void KyraEngine::snd_playWanderScoreViaMap(int command, int restart) {
- debug(9, kDebugLevelMain, "KyraEngine::snd_playWanderScoreViaMap(%d, %d)", command, restart);
+ debugC(9, kDebugLevelMain, "KyraEngine::snd_playWanderScoreViaMap(%d, %d)", command, restart);
static const int8 soundTable[] = {
-1, 0, -1, 1, 0, 3, 0, 2,
0, 4, 1, 2, 1, 3, 1, 4,
@@ -441,7 +441,7 @@ void KyraEngine::snd_playWanderScoreViaMap(int command, int restart) {
}
void KyraEngine::snd_playVoiceFile(int id) {
- debug(9, kDebugLevelMain, "KyraEngine::snd_playVoiceFile(%d)", id);
+ debugC(9, kDebugLevelMain, "KyraEngine::snd_playVoiceFile(%d)", id);
char vocFile[9];
assert(id >= 0 && id < 9999);
sprintf(vocFile, "%03d", id);
@@ -449,7 +449,7 @@ void KyraEngine::snd_playVoiceFile(int id) {
}
void KyraEngine::snd_voiceWaitForFinish(bool ingame) {
- debug(9, kDebugLevelMain, "KyraEngine::snd_voiceWaitForFinish(%d)", ingame);
+ debugC(9, kDebugLevelMain, "KyraEngine::snd_voiceWaitForFinish(%d)", ingame);
while (_sound->voiceIsPlaying() && !_skipFlag) {
if (ingame) {
delay(10, true);
diff --git a/engines/kyra/sprites.cpp b/engines/kyra/sprites.cpp
index 0b82bdf589..1bfd7813de 100644
--- a/engines/kyra/sprites.cpp
+++ b/engines/kyra/sprites.cpp
@@ -56,7 +56,7 @@ Sprites::~Sprites() {
}
void Sprites::setupSceneAnims() {
- debug(9, kDebugLevelSprites, "Sprites::setupSceneAnims()");
+ debugC(9, kDebugLevelSprites, "Sprites::setupSceneAnims()");
uint8 *data;
for (int i = 0; i < MAX_NUM_ANIMS; i++) {
@@ -126,7 +126,7 @@ void Sprites::setupSceneAnims() {
}
void Sprites::updateSceneAnims() {
- debug(9, kDebugLevelSprites, "Sprites::updateSceneAnims()");
+ debugC(9, kDebugLevelSprites, "Sprites::updateSceneAnims()");
uint32 currTime = _system->getMillis();
uint8 *data;
bool endLoop;
@@ -153,16 +153,16 @@ void Sprites::updateSceneAnims() {
switch (READ_LE_UINT16(data)) {
case 0xFF88:
data += 2;
- debug(6, kDebugLevelSprites, "func: Set sprite image.");
- debug(6, kDebugLevelSprites, "Sprite index %i", READ_LE_UINT16(data));
+ debugC(6, kDebugLevelSprites, "func: Set sprite image.");
+ debugC(6, kDebugLevelSprites, "Sprite index %i", READ_LE_UINT16(data));
_anims[i].sprite = READ_LE_UINT16(data);
data += 2;
- //debug(6, kDebugLevelSprites, "Unused %i", READ_LE_UINT16(data));
+ //debugC(6, kDebugLevelSprites, "Unused %i", READ_LE_UINT16(data));
data += 2;
- debug(6, kDebugLevelSprites, "X %i", READ_LE_UINT16(data));
+ debugC(6, kDebugLevelSprites, "X %i", READ_LE_UINT16(data));
_anims[i].x = READ_LE_UINT16(data);
data += 2;
- debug(6, kDebugLevelSprites, "Y %i", READ_LE_UINT16(data));
+ debugC(6, kDebugLevelSprites, "Y %i", READ_LE_UINT16(data));
_anims[i].y = READ_LE_UINT16(data);
data += 2;
_anims[i].flipX = false;
@@ -170,16 +170,16 @@ void Sprites::updateSceneAnims() {
break;
case 0xFF8D:
data += 2;
- debug(6, kDebugLevelSprites, "func: Set sprite image, flipped.");
- debug(6, kDebugLevelSprites, "Sprite index %i", READ_LE_UINT16(data));
+ debugC(6, kDebugLevelSprites, "func: Set sprite image, flipped.");
+ debugC(6, kDebugLevelSprites, "Sprite index %i", READ_LE_UINT16(data));
_anims[i].sprite = READ_LE_UINT16(data);
data += 2;
- //debug(9, kDebugLevelSprites, "Unused %i", READ_LE_UINT16(data));
+ //debugC(9, kDebugLevelSprites, "Unused %i", READ_LE_UINT16(data));
data += 2;
- debug(6, kDebugLevelSprites, "X %i", READ_LE_UINT16(data));
+ debugC(6, kDebugLevelSprites, "X %i", READ_LE_UINT16(data));
_anims[i].x = READ_LE_UINT16(data);
data += 2;
- debug(6, kDebugLevelSprites, "Y %i", READ_LE_UINT16(data));
+ debugC(6, kDebugLevelSprites, "Y %i", READ_LE_UINT16(data));
_anims[i].y = READ_LE_UINT16(data);
data += 2;
_anims[i].flipX = true;
@@ -187,69 +187,69 @@ void Sprites::updateSceneAnims() {
break;
case 0xFF8A:
data += 2;
- debug(6, kDebugLevelSprites, "func: Set time to wait");
- debug(6, kDebugLevelSprites, "Time %i", READ_LE_UINT16(data));
+ debugC(6, kDebugLevelSprites, "func: Set time to wait");
+ debugC(6, kDebugLevelSprites, "Time %i", READ_LE_UINT16(data));
_anims[i].nextRun = _system->getMillis() + READ_LE_UINT16(data) * _animDelay;
data += 2;
break;
case 0xFFB3:
data += 2;
- debug(6, kDebugLevelSprites, "func: Set time to wait to random value");
+ debugC(6, kDebugLevelSprites, "func: Set time to wait to random value");
rndNr = READ_LE_UINT16(data) + _rnd.getRandomNumber( READ_LE_UINT16(data) + 2);
- debug(6, kDebugLevelSprites, "Minimum time %i", READ_LE_UINT16(data));
+ debugC(6, kDebugLevelSprites, "Minimum time %i", READ_LE_UINT16(data));
data += 2;
- debug(6, kDebugLevelSprites, "Maximum time %i", READ_LE_UINT16(data));
+ debugC(6, kDebugLevelSprites, "Maximum time %i", READ_LE_UINT16(data));
data += 2;
_anims[i].nextRun = _system->getMillis() + rndNr * _animDelay;
break;
case 0xFF8C:
data += 2;
- debug(6, kDebugLevelSprites, "func: Wait until wait time has elapsed");
+ debugC(6, kDebugLevelSprites, "func: Wait until wait time has elapsed");
_anims[i].reentry = data;
endLoop = true;
//assert( _anims[i].nextRun > _system->getMillis());
break;
case 0xFF99:
data += 2;
- debug(1, kDebugLevelSprites, "func: Set value of unknown animation property to 1");
+ debugC(1, kDebugLevelSprites, "func: Set value of unknown animation property to 1");
_anims[i].unk1 = 1;
break;
case 0xFF9A:
data += 2;
- debug(1, kDebugLevelSprites, "func: Set value of unknown animation property to 0");
+ debugC(1, kDebugLevelSprites, "func: Set value of unknown animation property to 0");
_anims[i].unk1 = 0;
break;
case 0xFF97:
data += 2;
- debug(6, kDebugLevelSprites, "func: Set default X coordinate of sprite");
- debug(6, kDebugLevelSprites, "X %i", READ_LE_UINT16(data));
+ debugC(6, kDebugLevelSprites, "func: Set default X coordinate of sprite");
+ debugC(6, kDebugLevelSprites, "X %i", READ_LE_UINT16(data));
_anims[i].x = READ_LE_UINT16(data);
data += 2;
break;
case 0xFF98:
data += 2;
- debug(6, kDebugLevelSprites, "func: Set default Y coordinate of sprite");
- debug(6, kDebugLevelSprites, "Y %i", READ_LE_UINT16(data));
+ debugC(6, kDebugLevelSprites, "func: Set default Y coordinate of sprite");
+ debugC(6, kDebugLevelSprites, "Y %i", READ_LE_UINT16(data));
_anims[i].y = READ_LE_UINT16(data);
data += 2;
break;
case 0xFF8B:
- debug(6, kDebugLevelSprites, "func: Jump to start of script section");
+ debugC(6, kDebugLevelSprites, "func: Jump to start of script section");
//data = scriptStart;
_anims[i].nextRun = _system->getMillis();
endLoop = true;
break;
case 0xFF8E:
data += 2;
- debug(6, kDebugLevelSprites, "func: Begin for () loop");
- debug(6, kDebugLevelSprites, "Iterations: %i", READ_LE_UINT16(data));
+ debugC(6, kDebugLevelSprites, "func: Begin for () loop");
+ debugC(6, kDebugLevelSprites, "Iterations: %i", READ_LE_UINT16(data));
_anims[i].loopsLeft = READ_LE_UINT16(data);
data += 2;
_anims[i].loopStart = data;
break;
case 0xFF8F:
data += 2;
- debug(6, kDebugLevelSprites, "func: End for () loop");
+ debugC(6, kDebugLevelSprites, "func: End for () loop");
if (_anims[i].loopsLeft > 0) {
_anims[i].loopsLeft--;
data = _anims[i].loopStart;
@@ -257,8 +257,8 @@ void Sprites::updateSceneAnims() {
break;
case 0xFF90:
data += 2;
- debug(6, kDebugLevelSprites, "func: Set sprite image using default X and Y");
- debug(6, kDebugLevelSprites, "Sprite index %i", READ_LE_UINT16(data));
+ debugC(6, kDebugLevelSprites, "func: Set sprite image using default X and Y");
+ debugC(6, kDebugLevelSprites, "Sprite index %i", READ_LE_UINT16(data));
_anims[i].sprite = READ_LE_UINT16(data);
_anims[i].flipX = false;
data += 2;
@@ -266,8 +266,8 @@ void Sprites::updateSceneAnims() {
break;
case 0xFF91:
data += 2;
- debug(6, kDebugLevelSprites, "func: Set sprite image using default X and Y, flipped.");
- debug(6, kDebugLevelSprites, "Sprite index %i", READ_LE_UINT16(data));
+ debugC(6, kDebugLevelSprites, "func: Set sprite image using default X and Y, flipped.");
+ debugC(6, kDebugLevelSprites, "Sprite index %i", READ_LE_UINT16(data));
_anims[i].sprite = READ_LE_UINT16(data);
_anims[i].flipX = true;
data += 2;
@@ -275,36 +275,36 @@ void Sprites::updateSceneAnims() {
break;
case 0xFF92:
data += 2;
- debug(6, kDebugLevelSprites, "func: Increase value of default X-coordinate");
- debug(6, kDebugLevelSprites, "Increment %i", READ_LE_UINT16(data));
+ debugC(6, kDebugLevelSprites, "func: Increase value of default X-coordinate");
+ debugC(6, kDebugLevelSprites, "Increment %i", READ_LE_UINT16(data));
_anims[i].x += READ_LE_UINT16(data);
data += 2;
break;
case 0xFF93:
data += 2;
- debug(6, kDebugLevelSprites, "func: Increase value of default Y-coordinate");
- debug(6, kDebugLevelSprites, "Increment %i", READ_LE_UINT16(data));
+ debugC(6, kDebugLevelSprites, "func: Increase value of default Y-coordinate");
+ debugC(6, kDebugLevelSprites, "Increment %i", READ_LE_UINT16(data));
_anims[i].y += READ_LE_UINT16(data);
data += 2;
break;
case 0xFF94:
data += 2;
- debug(6, kDebugLevelSprites, "func: Decrease value of default X-coordinate");
- debug(6, kDebugLevelSprites, "Decrement %i", READ_LE_UINT16(data));
+ debugC(6, kDebugLevelSprites, "func: Decrease value of default X-coordinate");
+ debugC(6, kDebugLevelSprites, "Decrement %i", READ_LE_UINT16(data));
_anims[i].x -= READ_LE_UINT16(data);
data += 2;
break;
case 0xFF95:
data += 2;
- debug(6, kDebugLevelSprites, "func: Decrease value of default Y-coordinate");
- debug(6, kDebugLevelSprites, "Decrement %i", READ_LE_UINT16(data));
+ debugC(6, kDebugLevelSprites, "func: Decrease value of default Y-coordinate");
+ debugC(6, kDebugLevelSprites, "Decrement %i", READ_LE_UINT16(data));
_anims[i].y -= READ_LE_UINT16(data);
data += 2;
break;
case 0xFF96:
data += 2;
- debug(9, kDebugLevelSprites, "func: Stop animation");
- debug(9, kDebugLevelSprites, "Animation index %i", READ_LE_UINT16(data));
+ debugC(9, kDebugLevelSprites, "func: Stop animation");
+ debugC(9, kDebugLevelSprites, "Animation index %i", READ_LE_UINT16(data));
anim = READ_LE_UINT16(data);
data += 2;
_anims[anim].play = false;
@@ -312,44 +312,44 @@ void Sprites::updateSceneAnims() {
break;
/* case 0xFF97:
data += 2;
- debug(1, kDebugLevelSprites, "func: Set value of animation property 34h to 0");
+ debugC(1, kDebugLevelSprites, "func: Set value of animation property 34h to 0");
break;*/
case 0xFFAD:
data += 2;
- debug(6, kDebugLevelSprites, "func: Set Brandon's X coordinate");
- debug(6, kDebugLevelSprites, "X %i", READ_LE_UINT16(data));
+ debugC(6, kDebugLevelSprites, "func: Set Brandon's X coordinate");
+ debugC(6, kDebugLevelSprites, "X %i", READ_LE_UINT16(data));
_engine->currentCharacter()->x1 = READ_LE_UINT16(data);
data += 2;
break;
case 0xFFAE:
data += 2;
- debug(6, kDebugLevelSprites, "func: Set Brandon's Y coordinate");
- debug(6, kDebugLevelSprites, "Y %i", READ_LE_UINT16(data));
+ debugC(6, kDebugLevelSprites, "func: Set Brandon's Y coordinate");
+ debugC(6, kDebugLevelSprites, "Y %i", READ_LE_UINT16(data));
_engine->currentCharacter()->y1 = READ_LE_UINT16(data);
data += 2;
break;
case 0xFFAF:
data += 2;
- debug(6, kDebugLevelSprites, "func: Set Brandon's sprite");
- debug(6, kDebugLevelSprites, "Sprite %i", READ_LE_UINT16(data));
+ debugC(6, kDebugLevelSprites, "func: Set Brandon's sprite");
+ debugC(6, kDebugLevelSprites, "Sprite %i", READ_LE_UINT16(data));
_engine->currentCharacter()->currentAnimFrame = READ_LE_UINT16(data);
data += 2;
break;
case 0xFFAA:
data += 2;
- debug(1, kDebugLevelSprites, "TODO func: Reset Brandon's sprite");
+ debugC(1, kDebugLevelSprites, "TODO func: Reset Brandon's sprite");
break;
case 0xFFAB:
data += 2;
- debug(6, kDebugLevelSprites, "func: Update Brandon's sprite");
+ debugC(6, kDebugLevelSprites, "func: Update Brandon's sprite");
_engine->animator()->animRefreshNPC(0);
_engine->animator()->flagAllObjectsForRefresh();
_engine->animator()->updateAllObjectShapes();
break;
case 0xFFB0:
data += 2;
- debug(6, kDebugLevelSprites, "func: Play sound");
- debug(6, kDebugLevelSprites, "Sound index %i", READ_LE_UINT16(data));
+ debugC(6, kDebugLevelSprites, "func: Play sound");
+ debugC(6, kDebugLevelSprites, "Sound index %i", READ_LE_UINT16(data));
_engine->snd_playSoundEffect(READ_LE_UINT16(data));
data += 2;
break;
@@ -363,11 +363,11 @@ void Sprites::updateSceneAnims() {
break;
case 0xFFB4:
data += 2;
- debug(6, kDebugLevelSprites, "func: Play (at random) a certain sound at a certain percentage of time");
- debug(6, kDebugLevelSprites, "Sound index %i", READ_LE_UINT16(data));
+ debugC(6, kDebugLevelSprites, "func: Play (at random) a certain sound at a certain percentage of time");
+ debugC(6, kDebugLevelSprites, "Sound index %i", READ_LE_UINT16(data));
sound = READ_LE_UINT16(data);
data += 2;
- debug(6, kDebugLevelSprites, "Percentage %i", READ_LE_UINT16(data));
+ debugC(6, kDebugLevelSprites, "Percentage %i", READ_LE_UINT16(data));
rndNr = _rnd.getRandomNumber(100);
if (rndNr <= READ_LE_UINT16(data))
_engine->snd_playSoundEffect(sound);
@@ -379,7 +379,7 @@ void Sprites::updateSceneAnims() {
data += 2;
break;
default:
- debug(1, kDebugLevelSprites, "Unsupported anim command %X in script %i", READ_LE_UINT16(data), i);
+ debugC(1, kDebugLevelSprites, "Unsupported anim command %X in script %i", READ_LE_UINT16(data), i);
//endLoop = true;
data += 1;
break;
@@ -392,7 +392,7 @@ void Sprites::updateSceneAnims() {
}
void Sprites::loadDAT(const char *filename, SceneExits &exits) {
- debug(9, kDebugLevelSprites, "Sprites::loadDat('%s')", filename);
+ debugC(9, kDebugLevelSprites, "Sprites::loadDat('%s')", filename);
uint32 fileSize;
delete[] _dat;
@@ -426,7 +426,7 @@ void Sprites::loadDAT(const char *filename, SceneExits &exits) {
break;
if (READ_LE_UINT16(data) == 0xFF83) {
- //debug(1, kDebugLevelSprites, "Body section end.");
+ //debugC(1, kDebugLevelSprites, "Body section end.");
data += 2;
break;
}
@@ -434,11 +434,11 @@ void Sprites::loadDAT(const char *filename, SceneExits &exits) {
switch (READ_LE_UINT16(data)) {
case 0xFF81:
data += 2;
- //debug(1, kDebugLevelSprites, "Body section start");
+ //debugC(1, kDebugLevelSprites, "Body section start");
break;
case 0xFF82:
data += 2;
- //debug(1, kDebugLevelSprites, "Unknown 0xFF82 section");
+ //debugC(1, kDebugLevelSprites, "Unknown 0xFF82 section");
break;
case 0xFF84:
data += 2;
@@ -460,12 +460,12 @@ void Sprites::loadDAT(const char *filename, SceneExits &exits) {
data += 2;
}
_anims[nextAnim].length = data - animstart;
- //debug(1, kDebugLevelSprites, "Found an anim script of length %i!", _anims[nextAnim].length);
+ //debugC(1, kDebugLevelSprites, "Found an anim script of length %i!", _anims[nextAnim].length);
nextAnim++;
data += 2;
break;
default:
- debug(1, kDebugLevelSprites, "Unknown code in DAT file: %x", READ_LE_UINT16(data));
+ debugC(1, kDebugLevelSprites, "Unknown code in DAT file: %x", READ_LE_UINT16(data));
data += 2;
break;
}
@@ -487,7 +487,7 @@ void Sprites::loadDAT(const char *filename, SceneExits &exits) {
}
void Sprites::freeSceneShapes() {
- debug(9, kDebugLevelSprites, "Sprites::freeSceneShapes()");
+ debugC(9, kDebugLevelSprites, "Sprites::freeSceneShapes()");
for (int i = 0; i < ARRAYSIZE(_sceneShapes); i++ ) {
free(_sceneShapes[i]);
_sceneShapes[i] = 0;
@@ -495,7 +495,7 @@ void Sprites::freeSceneShapes() {
}
void Sprites::loadSceneShapes() {
- debug(9, kDebugLevelSprites, "Sprites::loadSceneShapes()");
+ debugC(9, kDebugLevelSprites, "Sprites::loadSceneShapes()");
uint8 *data = _spriteDefStart;
int spriteNum, x, y, width, height;
@@ -521,13 +521,13 @@ void Sprites::loadSceneShapes() {
height = READ_LE_UINT16(data);
data += 2;
_sceneShapes[spriteNum] = _screen->encodeShape(x, y, width, height, 2);
- debug(9, kDebugLevelSprites, "Sprite %i is at (%i, %i), width %i, height %i", spriteNum, x, y, width, height);
+ debugC(9, kDebugLevelSprites, "Sprite %i is at (%i, %i), width %i, height %i", spriteNum, x, y, width, height);
}
_screen->_curPage = bakPage;
}
void Sprites::refreshSceneAnimObject(uint8 animNum, uint8 shapeNum, uint16 x, uint16 y, bool flipX, bool unkFlag) {
- debug(9, kDebugLevelSprites, "Sprites::refreshSceneAnimObject(%i, %i, %i, %i, %i, %i", animNum, shapeNum, x, y, flipX, unkFlag);
+ debugC(9, kDebugLevelSprites, "Sprites::refreshSceneAnimObject(%i, %i, %i, %i, %i, %i", animNum, shapeNum, x, y, flipX, unkFlag);
AnimObject &anim = _engine->animator()->sprites()[animNum];
anim.refreshFlag = 1;
anim.bkgdChangeFlag = 1;
@@ -549,7 +549,7 @@ void Sprites::refreshSceneAnimObject(uint8 animNum, uint8 shapeNum, uint16 x, ui
}
int Sprites::getDrawLayer(int y) {
- debug(9, kDebugLevelSprites, "getDrawLayer(%d)", y);
+ debugC(9, kDebugLevelSprites, "getDrawLayer(%d)", y);
uint8 returnValue = 0;
for (int i = 0; i < ARRAYSIZE(_drawLayerTable); ++i) {
uint8 temp = _drawLayerTable[i];
diff --git a/engines/kyra/staticres.cpp b/engines/kyra/staticres.cpp
index f7a26ce8af..90cb5350aa 100644
--- a/engines/kyra/staticres.cpp
+++ b/engines/kyra/staticres.cpp
@@ -54,7 +54,7 @@ static LanguageTypes languages[] = {
};
void KyraEngine::res_loadResources(int type) {
- debug(9, kDebugLevelMain, "KyraEngine::res_loadResources(%d)", type);
+ debugC(9, kDebugLevelMain, "KyraEngine::res_loadResources(%d)", type);
PAKFile resFile("KYRA.DAT");
if (!resFile.isValid() || !resFile.isOpen()) {
error("couldn't open Kyrandia resource file ('KYRA.DAT') make sure you got one file for your version");
@@ -257,7 +257,7 @@ void KyraEngine::res_loadResources(int type) {
}
void KyraEngine::res_unloadResources(int type) {
- debug(9, kDebugLevelMain, "KyraEngine::res_unloadResources(%d)", type);
+ debugC(9, kDebugLevelMain, "KyraEngine::res_unloadResources(%d)", type);
if ((type & RES_INTRO) || (type & RES_OUTRO) || type & RES_ALL) {
res_freeLangTable(&_seq_WSATable, &_seq_WSATable_Size);
res_freeLangTable(&_seq_CPSTable, &_seq_CPSTable_Size);
diff --git a/engines/kyra/text.cpp b/engines/kyra/text.cpp
index 068c363f7f..1f7284c9c1 100644
--- a/engines/kyra/text.cpp
+++ b/engines/kyra/text.cpp
@@ -33,7 +33,7 @@
namespace Kyra {
void KyraEngine::waitForChatToFinish(int16 chatDuration, char *chatStr, uint8 charNum) {
- debug(9, kDebugLevelMain, "KyraEngine::waitForChatToFinish(%i, %s, %i)", chatDuration, chatStr, charNum);
+ debugC(9, kDebugLevelMain, "KyraEngine::waitForChatToFinish(%i, %s, %i)", chatDuration, chatStr, charNum);
bool hasUpdatedNPCs = false;
bool runLoop = true;
uint8 currPage;
@@ -230,7 +230,7 @@ int KyraEngine::initCharacterChat(int8 charNum) {
}
void KyraEngine::characterSays(char *chatStr, int8 charNum, int8 chatDuration) {
- debug(9, kDebugLevelMain, "KyraEngine::characterSays('%s', %i, %d)", chatStr, charNum, chatDuration);
+ debugC(9, kDebugLevelMain, "KyraEngine::characterSays('%s', %i, %d)", chatStr, charNum, chatDuration);
uint8 startAnimFrames[] = { 0x10, 0x32, 0x56, 0x0, 0x0, 0x0 };
uint16 chatTicks;
@@ -303,7 +303,7 @@ void KyraEngine::characterSays(char *chatStr, int8 charNum, int8 chatDuration) {
}
void KyraEngine::drawSentenceCommand(char *sentence, int color) {
- debug(9, kDebugLevelMain, "KyraEngine::drawSentenceCommand('%s', %i)", sentence, color);
+ debugC(9, kDebugLevelMain, "KyraEngine::drawSentenceCommand('%s', %i)", sentence, color);
_screen->hideMouse();
_screen->fillRect(8, 143, 311, 152, 12);
@@ -323,7 +323,7 @@ void KyraEngine::drawSentenceCommand(char *sentence, int color) {
}
void KyraEngine::updateSentenceCommand(char *str1, char *str2, int color) {
- debug(9, kDebugLevelMain, "KyraEngine::updateSentenceCommand('%s', '%s', %i)", str1, str2, color);
+ debugC(9, kDebugLevelMain, "KyraEngine::updateSentenceCommand('%s', '%s', %i)", str1, str2, color);
char sentenceCommand[500];
strncpy(sentenceCommand, str1, 500);
if (str2)
@@ -334,7 +334,7 @@ void KyraEngine::updateSentenceCommand(char *str1, char *str2, int color) {
}
void KyraEngine::updateTextFade() {
- debug(9, kDebugLevelMain, "KyraEngine::updateTextFade()");
+ debugC(9, kDebugLevelMain, "KyraEngine::updateTextFade()");
if (!_fadeText)
return;
@@ -371,12 +371,12 @@ TextDisplayer::TextDisplayer(Screen *screen) {
}
void TextDisplayer::setTalkCoords(uint16 y) {
- debug(9, kDebugLevelMain, "TextDisplayer::setTalkCoords(%d)", y);
+ debugC(9, kDebugLevelMain, "TextDisplayer::setTalkCoords(%d)", y);
_talkCoords.y = y;
}
int TextDisplayer::getCenterStringX(const char *str, int x1, int x2) {
- debug(9, kDebugLevelMain, "TextDisplayer::getCenterStringX('%s', %d, %d)", str, x1, x2);
+ debugC(9, kDebugLevelMain, "TextDisplayer::getCenterStringX('%s', %d, %d)", str, x1, x2);
_screen->_charWidth = -2;
Screen::FontId curFont = _screen->setFont(Screen::FID_8_FNT);
int strWidth = _screen->getTextWidth(str);
@@ -387,7 +387,7 @@ int TextDisplayer::getCenterStringX(const char *str, int x1, int x2) {
}
int TextDisplayer::getCharLength(const char *str, int len) {
- debug(9, kDebugLevelMain, "TextDisplayer::getCharLength('%s', %d)", str, len);
+ debugC(9, kDebugLevelMain, "TextDisplayer::getCharLength('%s', %d)", str, len);
int charsCount = 0;
if (*str) {
_screen->_charWidth = -2;
@@ -404,7 +404,7 @@ int TextDisplayer::getCharLength(const char *str, int len) {
}
int TextDisplayer::dropCRIntoString(char *str, int offs) {
- debug(9, kDebugLevelMain, "TextDisplayer::dropCRIntoString('%s', %d)", str, offs);
+ debugC(9, kDebugLevelMain, "TextDisplayer::dropCRIntoString('%s', %d)", str, offs);
int pos = 0;
str += offs;
while (*str) {
@@ -419,7 +419,7 @@ int TextDisplayer::dropCRIntoString(char *str, int offs) {
}
char *TextDisplayer::preprocessString(const char *str) {
- debug(9, kDebugLevelMain, "TextDisplayer::preprocessString('%s')", str);
+ debugC(9, kDebugLevelMain, "TextDisplayer::preprocessString('%s')", str);
assert(strlen(str) < sizeof(_talkBuffer) - 1);
strcpy(_talkBuffer, str);
char *p = _talkBuffer;
@@ -454,7 +454,7 @@ char *TextDisplayer::preprocessString(const char *str) {
}
int TextDisplayer::buildMessageSubstrings(const char *str) {
- debug(9, kDebugLevelMain, "TextDisplayer::buildMessageSubstrings('%s')", str);
+ debugC(9, kDebugLevelMain, "TextDisplayer::buildMessageSubstrings('%s')", str);
int currentLine = 0;
int pos = 0;
while (*str) {
@@ -477,7 +477,7 @@ int TextDisplayer::buildMessageSubstrings(const char *str) {
}
int TextDisplayer::getWidestLineWidth(int linesCount) {
- debug(9, kDebugLevelMain, "TextDisplayer::getWidestLineWidth(%d)", linesCount);
+ debugC(9, kDebugLevelMain, "TextDisplayer::getWidestLineWidth(%d)", linesCount);
int maxWidth = 0;
Screen::FontId curFont = _screen->setFont(Screen::FID_8_FNT);
_screen->_charWidth = -2;
@@ -493,7 +493,7 @@ int TextDisplayer::getWidestLineWidth(int linesCount) {
}
void TextDisplayer::calcWidestLineBounds(int &x1, int &x2, int w, int cx) {
- debug(9, kDebugLevelMain, "TextDisplayer::calcWidestLineBounds(%d, %d)", w, cx);
+ debugC(9, kDebugLevelMain, "TextDisplayer::calcWidestLineBounds(%d, %d)", w, cx);
x1 = cx - w / 2;
if (x1 + w >= Screen::SCREEN_W - 12) {
x1 = Screen::SCREEN_W - 12 - w - 1;
@@ -504,7 +504,7 @@ void TextDisplayer::calcWidestLineBounds(int &x1, int &x2, int w, int cx) {
}
void TextDisplayer::restoreTalkTextMessageBkgd(int srcPage, int dstPage) {
- debug(9, kDebugLevelMain, "TextDisplayer::restoreTalkTextMessageBkgd(%d, %d)", srcPage, dstPage);
+ debugC(9, kDebugLevelMain, "TextDisplayer::restoreTalkTextMessageBkgd(%d, %d)", srcPage, dstPage);
if (_talkMessagePrinted) {
_talkMessagePrinted = false;
_screen->copyRegion(_talkCoords.x, _talkCoords.y, _talkCoords.x, _talkMessageY, _talkCoords.w, _talkMessageH, srcPage, dstPage);
@@ -512,7 +512,7 @@ void TextDisplayer::restoreTalkTextMessageBkgd(int srcPage, int dstPage) {
}
void TextDisplayer::printTalkTextMessage(const char *text, int x, int y, uint8 color, int srcPage, int dstPage) {
- debug(9, kDebugLevelMain, "TextDisplayer::printTalkTextMessage('%s', %d, %d, %d, %d, %d)", text, x, y, color, srcPage, dstPage);
+ debugC(9, kDebugLevelMain, "TextDisplayer::printTalkTextMessage('%s', %d, %d, %d, %d, %d)", text, x, y, color, srcPage, dstPage);
char *str = preprocessString(text);
int lineCount = buildMessageSubstrings(str);
int top = y - lineCount * 10;
@@ -540,7 +540,7 @@ void TextDisplayer::printTalkTextMessage(const char *text, int x, int y, uint8 c
}
void TextDisplayer::printText(const char *str, int x, int y, uint8 c0, uint8 c1, uint8 c2) {
- debug(9, kDebugLevelMain, "TextDisplayer::printText('%s', %d, %d, %d, %d, %d)", str, x, y, c0, c1, c2);
+ debugC(9, kDebugLevelMain, "TextDisplayer::printText('%s', %d, %d, %d, %d, %d)", str, x, y, c0, c1, c2);
uint8 colorMap[] = { 0, 15, 12, 12 };
colorMap[3] = c1;
_screen->setTextColor(colorMap, 0, 3);
@@ -552,7 +552,7 @@ void TextDisplayer::printText(const char *str, int x, int y, uint8 c0, uint8 c1,
}
void TextDisplayer::printCharacterText(char *text, int8 charNum, int charX) {
- debug(9, kDebugLevelMain, "TextDisplayer::printCharacterText('%s', %d, %d)", text, charNum, charX);
+ debugC(9, kDebugLevelMain, "TextDisplayer::printCharacterText('%s', %d, %d)", text, charNum, charX);
uint8 colorTable[] = {0x0F, 0x9, 0x0C9, 0x80, 0x5, 0x81, 0x0E, 0xD8, 0x55, 0x3A, 0x3a};
int top, left, x1, x2, w, x;
char *msg;
diff --git a/engines/kyra/timer.cpp b/engines/kyra/timer.cpp
index fba922b266..fa16a8b008 100644
--- a/engines/kyra/timer.cpp
+++ b/engines/kyra/timer.cpp
@@ -28,7 +28,7 @@
namespace Kyra {
void KyraEngine::setupTimers() {
- debug(9, kDebugLevelMain, "KyraEngine::setupTimers()");
+ debugC(9, kDebugLevelMain, "KyraEngine::setupTimers()");
memset(_timers, 0, sizeof(_timers));
for (int i = 0; i < 34; i++)
@@ -82,7 +82,7 @@ void KyraEngine::setupTimers() {
}
void KyraEngine::updateGameTimers() {
- debug(9, kDebugLevelMain, "KyraEngine::updateGameTimers()");
+ debugC(9, kDebugLevelMain, "KyraEngine::updateGameTimers()");
if (_system->getMillis() < _timerNextRun)
return;
@@ -104,22 +104,22 @@ void KyraEngine::updateGameTimers() {
}
void KyraEngine::clearNextEventTickCount() {
- debug(9, kDebugLevelMain, "KyraEngine::clearNextEventTickCount()");
+ debugC(9, kDebugLevelMain, "KyraEngine::clearNextEventTickCount()");
_timerNextRun = 0;
}
void KyraEngine::setTimerDelay(uint8 timer, int32 countdown) {
- debug(9, kDebugLevelMain, "KyraEngine::setTimerDelay(%i, %d)", timer, countdown);
+ debugC(9, kDebugLevelMain, "KyraEngine::setTimerDelay(%i, %d)", timer, countdown);
_timers[timer].countdown = countdown;
}
int16 KyraEngine::getTimerDelay(uint8 timer) {
- debug(9, kDebugLevelMain, "KyraEngine::getTimerDelay(%i)", timer);
+ debugC(9, kDebugLevelMain, "KyraEngine::getTimerDelay(%i)", timer);
return _timers[timer].countdown;
}
void KyraEngine::setTimerCountdown(uint8 timer, int32 countdown) {
- debug(9, kDebugLevelMain, "KyraEngine::setTimerCountdown(%i, %i)", timer, countdown);
+ debugC(9, kDebugLevelMain, "KyraEngine::setTimerCountdown(%i, %i)", timer, countdown);
_timers[timer].countdown = countdown;
_timers[timer].nextRun = _system->getMillis() + countdown * _tickLength;
@@ -129,17 +129,17 @@ void KyraEngine::setTimerCountdown(uint8 timer, int32 countdown) {
}
void KyraEngine::enableTimer(uint8 timer) {
- debug(9, kDebugLevelMain, "KyraEngine::enableTimer(%i)", timer);
+ debugC(9, kDebugLevelMain, "KyraEngine::enableTimer(%i)", timer);
_timers[timer].active = 1;
}
void KyraEngine::disableTimer(uint8 timer) {
- debug(9, kDebugLevelMain, "KyraEngine::disableTimer(%i)", timer);
+ debugC(9, kDebugLevelMain, "KyraEngine::disableTimer(%i)", timer);
_timers[timer].active = 0;
}
void KyraEngine::timerUpdateHeadAnims(int timerNum) {
- debug(9, kDebugLevelMain, "KyraEngine::timerUpdateHeadAnims(%i)", timerNum);
+ debugC(9, kDebugLevelMain, "KyraEngine::timerUpdateHeadAnims(%i)", timerNum);
static int8 currentFrame = 0;
static const int8 frameTable[] = {4, 5, 4, 5, 4, 5, 0, 1, 4, 5,
4, 4, 6, 4, 8, 1, 9, 4, -1};
@@ -158,7 +158,7 @@ void KyraEngine::timerUpdateHeadAnims(int timerNum) {
}
void KyraEngine::timerSetFlags1(int timerNum) {
- debug(9, kDebugLevelMain, "KyraEngine::timerSetFlags(%i)", timerNum);
+ debugC(9, kDebugLevelMain, "KyraEngine::timerSetFlags(%i)", timerNum);
if (_currentCharacter->sceneId == 0x1C)
return;
@@ -177,26 +177,26 @@ void KyraEngine::timerSetFlags1(int timerNum) {
}
void KyraEngine::timerFadeText(int timerNum) {
- debug(9, kDebugLevelMain, "KyraEngine::timerFadeText(%i)", timerNum);
+ debugC(9, kDebugLevelMain, "KyraEngine::timerFadeText(%i)", timerNum);
_fadeText = true;
}
void KyraEngine::updateAnimFlag1(int timerNum) {
- debug(9, kDebugLevelMain, "KyraEngine::updateAnimFlag1(%d)", timerNum);
+ debugC(9, kDebugLevelMain, "KyraEngine::updateAnimFlag1(%d)", timerNum);
if (_brandonStatusBit & 2) {
_brandonStatusBit0x02Flag = 1;
}
}
void KyraEngine::updateAnimFlag2(int timerNum) {
- debug(9, kDebugLevelMain, "KyraEngine::updateAnimFlag2(%d)", timerNum);
+ debugC(9, kDebugLevelMain, "KyraEngine::updateAnimFlag2(%d)", timerNum);
if (_brandonStatusBit & 0x20) {
_brandonStatusBit0x20Flag = 1;
}
}
void KyraEngine::setTextFadeTimerCountdown(int16 countdown) {
- debug(9, kDebugLevelMain, "KyraEngine::setTextFadeTimerCountdown(%i)", countdown);
+ debugC(9, kDebugLevelMain, "KyraEngine::setTextFadeTimerCountdown(%i)", countdown);
//if (countdown == -1)
//countdown = 32000;
@@ -204,13 +204,13 @@ void KyraEngine::setTextFadeTimerCountdown(int16 countdown) {
}
void KyraEngine::timerSetFlags2(int timerNum) {
- debug(9, kDebugLevelMain, "KyraEngine::timerSetFlags2(%i)", timerNum);
+ debugC(9, kDebugLevelMain, "KyraEngine::timerSetFlags2(%i)", timerNum);
if (!((uint32*)(_flagsTable+0x2D))[timerNum])
((uint32*)(_flagsTable+0x2D))[timerNum] = 1;
}
void KyraEngine::timerCheckAnimFlag1(int timerNum) {
- debug(9, kDebugLevelMain, "KyraEngine::timerCheckAnimFlag1(%i)", timerNum);
+ debugC(9, kDebugLevelMain, "KyraEngine::timerCheckAnimFlag1(%i)", timerNum);
if (_brandonStatusBit & 0x20) {
checkAmuletAnimFlags();
setTimerCountdown(18, -1);
@@ -218,7 +218,7 @@ void KyraEngine::timerCheckAnimFlag1(int timerNum) {
}
void KyraEngine::timerCheckAnimFlag2(int timerNum) {
- debug(9, kDebugLevelMain, "KyraEngine::timerCheckAnimFlag1(%i)", timerNum);
+ debugC(9, kDebugLevelMain, "KyraEngine::timerCheckAnimFlag1(%i)", timerNum);
if (_brandonStatusBit & 0x2) {
checkAmuletAnimFlags();
setTimerCountdown(14, -1);
@@ -226,7 +226,7 @@ void KyraEngine::timerCheckAnimFlag2(int timerNum) {
}
void KyraEngine::checkAmuletAnimFlags() {
- debug(9, kDebugLevelMain, "KyraEngine::checkSpecialAnimFlags()");
+ debugC(9, kDebugLevelMain, "KyraEngine::checkSpecialAnimFlags()");
if (_brandonStatusBit & 2) {
seq_makeBrandonNormal2();
setTimerCountdown(19, 300);
@@ -239,7 +239,7 @@ void KyraEngine::checkAmuletAnimFlags() {
}
void KyraEngine::timerRedrawAmulet(int timerNum) {
- debug(9, kDebugLevelMain, "KyraEngine::timerRedrawAmulet(%i)", timerNum);
+ debugC(9, kDebugLevelMain, "KyraEngine::timerRedrawAmulet(%i)", timerNum);
if (queryGameFlag(0xF1)) {
drawAmulet();
setTimerCountdown(19, -1);
@@ -247,7 +247,7 @@ void KyraEngine::timerRedrawAmulet(int timerNum) {
}
void KyraEngine::drawAmulet() {
- debug(9, kDebugLevelMain, "KyraEngine::drawAmulet()");
+ debugC(9, kDebugLevelMain, "KyraEngine::drawAmulet()");
static const int16 amuletTable1[] = {0x167, 0x162, 0x15D, 0x158, 0x153, 0x150, 0x155, 0x15A, 0x15F, 0x164, 0x145, -1};
static const int16 amuletTable3[] = {0x167, 0x162, 0x15D, 0x158, 0x153, 0x14F, 0x154, 0x159, 0x15E, 0x163, 0x144, -1};
static const int16 amuletTable2[] = {0x167, 0x162, 0x15D, 0x158, 0x153, 0x152, 0x157, 0x15C, 0x161, 0x166, 0x147, -1};
diff --git a/engines/kyra/wsamovie.cpp b/engines/kyra/wsamovie.cpp
index df511aaae8..8b2ba579c6 100644
--- a/engines/kyra/wsamovie.cpp
+++ b/engines/kyra/wsamovie.cpp
@@ -31,7 +31,7 @@ WSAMovieV1::WSAMovieV1(KyraEngine *vm) : Movie(vm) {}
WSAMovieV1::~WSAMovieV1() { close(); }
void WSAMovieV1::open(const char *filename, int offscreenDecode, uint8 *palBuf) {
- debug(9, kDebugLevelMovie, "WSAMovieV1::open('%s', %d, 0x%X)", filename, offscreenDecode, palBuf);
+ debugC(9, kDebugLevelMovie, "WSAMovieV1::open('%s', %d, 0x%X)", filename, offscreenDecode, palBuf);
close();
uint32 flags = 0;
@@ -110,7 +110,7 @@ void WSAMovieV1::open(const char *filename, int offscreenDecode, uint8 *palBuf)
}
void WSAMovieV1::close() {
- debug(9, kDebugLevelMovie, "WSAMovieV1::close()");
+ debugC(9, kDebugLevelMovie, "WSAMovieV1::close()");
if (_opened) {
delete [] _deltaBuffer;
delete [] _offscreenBuffer;
@@ -121,7 +121,7 @@ void WSAMovieV1::close() {
}
void WSAMovieV1::displayFrame(int frameNum) {
- debug(9, kDebugLevelMovie, "WSAMovieV1::displayFrame(%d)", frameNum);
+ debugC(9, kDebugLevelMovie, "WSAMovieV1::displayFrame(%d)", frameNum);
if (frameNum >= _numFrames || !_opened)
return;
@@ -191,7 +191,7 @@ void WSAMovieV1::displayFrame(int frameNum) {
}
void WSAMovieV1::processFrame(int frameNum, uint8 *dst) {
- debug(9, kDebugLevelMovie, "WSAMovieV1::processFrame(%d, 0x%X)", frameNum, dst);
+ debugC(9, kDebugLevelMovie, "WSAMovieV1::processFrame(%d, 0x%X)", frameNum, dst);
if (!_opened)
return;
assert(frameNum <= _numFrames);