diff options
author | Marisa-Chan | 2014-06-13 21:43:04 +0700 |
---|---|---|
committer | Marisa-Chan | 2014-06-13 21:43:04 +0700 |
commit | 45589950c0fb1a449351e6a00ef10d42290d8bae (patch) | |
tree | 44e4eedcb7e69d5fc386155b000ed038af07251d /engines/kyra | |
parent | 48360645dcd5f8fddb135b6e31ae5cae4be8d77f (diff) | |
parent | 5c005ad3a3f1df0bc968c85c1cf0fc48e36ab0b2 (diff) | |
download | scummvm-rg350-45589950c0fb1a449351e6a00ef10d42290d8bae.tar.gz scummvm-rg350-45589950c0fb1a449351e6a00ef10d42290d8bae.tar.bz2 scummvm-rg350-45589950c0fb1a449351e6a00ef10d42290d8bae.zip |
Merge remote-tracking branch 'upstream/master' into zvision
Conflicts:
engines/zvision/animation/rlf_animation.cpp
engines/zvision/animation_control.h
engines/zvision/core/console.cpp
engines/zvision/core/events.cpp
engines/zvision/cursors/cursor.cpp
engines/zvision/cursors/cursor_manager.cpp
engines/zvision/cursors/cursor_manager.h
engines/zvision/fonts/truetype_font.cpp
engines/zvision/graphics/render_manager.cpp
engines/zvision/graphics/render_manager.h
engines/zvision/inventory/inventory_manager.h
engines/zvision/inventory_manager.h
engines/zvision/meta_animation.h
engines/zvision/module.mk
engines/zvision/scripting/actions.cpp
engines/zvision/scripting/control.h
engines/zvision/scripting/controls/animation_control.cpp
engines/zvision/scripting/controls/animation_control.h
engines/zvision/scripting/controls/input_control.cpp
engines/zvision/scripting/controls/lever_control.cpp
engines/zvision/scripting/controls/timer_node.cpp
engines/zvision/scripting/controls/timer_node.h
engines/zvision/scripting/puzzle.h
engines/zvision/scripting/scr_file_handling.cpp
engines/zvision/scripting/script_manager.cpp
engines/zvision/scripting/script_manager.h
engines/zvision/sidefx.cpp
engines/zvision/sound/zork_raw.cpp
engines/zvision/sound/zork_raw.h
engines/zvision/video/video.cpp
engines/zvision/video/zork_avi_decoder.h
engines/zvision/zvision.cpp
engines/zvision/zvision.h
Diffstat (limited to 'engines/kyra')
154 files changed, 1194 insertions, 1190 deletions
diff --git a/engines/kyra/animator_hof.cpp b/engines/kyra/animator_hof.cpp index 59112504d6..7ce79cb7a0 100644 --- a/engines/kyra/animator_hof.cpp +++ b/engines/kyra/animator_hof.cpp @@ -8,12 +8,12 @@ * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. - + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. diff --git a/engines/kyra/animator_lok.cpp b/engines/kyra/animator_lok.cpp index c246eebd46..ba6dc91e1f 100644 --- a/engines/kyra/animator_lok.cpp +++ b/engines/kyra/animator_lok.cpp @@ -8,12 +8,12 @@ * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. - + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. @@ -491,7 +491,7 @@ Animator_LoK::AnimObject *Animator_LoK::objectAddHead(AnimObject *queue, AnimObj } Animator_LoK::AnimObject *Animator_LoK::objectQueue(AnimObject *queue, AnimObject *add) { - if (add->drawY <= queue->drawY || !queue) { + if (!queue || add->drawY <= queue->drawY) { add->nextAnimObject = queue; return add; } diff --git a/engines/kyra/animator_lok.h b/engines/kyra/animator_lok.h index 74b8305468..55c4d571fd 100644 --- a/engines/kyra/animator_lok.h +++ b/engines/kyra/animator_lok.h @@ -8,12 +8,12 @@ * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. - + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. diff --git a/engines/kyra/animator_mr.cpp b/engines/kyra/animator_mr.cpp index 83e774e2fc..3b9454ce56 100644 --- a/engines/kyra/animator_mr.cpp +++ b/engines/kyra/animator_mr.cpp @@ -8,12 +8,12 @@ * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. - + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. diff --git a/engines/kyra/animator_tim.cpp b/engines/kyra/animator_tim.cpp index 90f4ad89ad..1d65ba7b1a 100644 --- a/engines/kyra/animator_tim.cpp +++ b/engines/kyra/animator_tim.cpp @@ -8,12 +8,12 @@ * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. - + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. diff --git a/engines/kyra/animator_v2.cpp b/engines/kyra/animator_v2.cpp index f7ae6749cf..5ac154bdce 100644 --- a/engines/kyra/animator_v2.cpp +++ b/engines/kyra/animator_v2.cpp @@ -8,12 +8,12 @@ * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. - + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. diff --git a/engines/kyra/chargen.cpp b/engines/kyra/chargen.cpp index 80a95da047..2454909440 100644 --- a/engines/kyra/chargen.cpp +++ b/engines/kyra/chargen.cpp @@ -8,12 +8,12 @@ * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. - + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. @@ -155,8 +155,10 @@ CharacterGenerator::~CharacterGenerator() { } bool CharacterGenerator::start(EoBCharacter *characters, uint8 ***faceShapes) { - if (!characters && !faceShapes) + if (!characters || !faceShapes) { + warning("CharacterGenerator::start: Called without character data"); return true; + } _characters = characters; _faceShapes = *faceShapes; diff --git a/engines/kyra/configure.engine b/engines/kyra/configure.engine new file mode 100644 index 0000000000..b7d6334fcc --- /dev/null +++ b/engines/kyra/configure.engine @@ -0,0 +1,5 @@ +# This file is included from the main "configure" script +# add_engine [name] [desc] [build-by-default] [subengines] [base games] [deps] +add_engine kyra "Kyra" yes "lol eob" "Legend of Kyrandia 1-3" +add_engine lol "Lands of Lore" yes +add_engine eob "Eye of the Beholder" yes diff --git a/engines/kyra/darkmoon.cpp b/engines/kyra/darkmoon.cpp index a694a4aba5..71ae98e4db 100644 --- a/engines/kyra/darkmoon.cpp +++ b/engines/kyra/darkmoon.cpp @@ -8,12 +8,12 @@ * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. - + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. diff --git a/engines/kyra/darkmoon.h b/engines/kyra/darkmoon.h index f0057ddd66..57eb46eb1c 100644 --- a/engines/kyra/darkmoon.h +++ b/engines/kyra/darkmoon.h @@ -8,12 +8,12 @@ * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. - + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. diff --git a/engines/kyra/debugger.cpp b/engines/kyra/debugger.cpp index 99d73d19c7..4a90722a35 100644 --- a/engines/kyra/debugger.cpp +++ b/engines/kyra/debugger.cpp @@ -8,12 +8,12 @@ * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. - + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. @@ -40,45 +40,45 @@ Debugger::Debugger(KyraEngine_v1 *vm) } void Debugger::initialize() { - DCmd_Register("continue", WRAP_METHOD(Debugger, Cmd_Exit)); - DCmd_Register("screen_debug_mode", WRAP_METHOD(Debugger, cmd_setScreenDebug)); - DCmd_Register("load_palette", WRAP_METHOD(Debugger, cmd_loadPalette)); - DCmd_Register("facings", WRAP_METHOD(Debugger, cmd_showFacings)); - DCmd_Register("gamespeed", WRAP_METHOD(Debugger, cmd_gameSpeed)); - DCmd_Register("flags", WRAP_METHOD(Debugger, cmd_listFlags)); - DCmd_Register("toggleflag", WRAP_METHOD(Debugger, cmd_toggleFlag)); - DCmd_Register("queryflag", WRAP_METHOD(Debugger, cmd_queryFlag)); - DCmd_Register("timers", WRAP_METHOD(Debugger, cmd_listTimers)); - DCmd_Register("settimercountdown", WRAP_METHOD(Debugger, cmd_setTimerCountdown)); -} - -bool Debugger::cmd_setScreenDebug(int argc, const char **argv) { + registerCmd("continue", WRAP_METHOD(Debugger, cmdExit)); + registerCmd("screen_debug_mode", WRAP_METHOD(Debugger, cmdSetScreenDebug)); + registerCmd("load_palette", WRAP_METHOD(Debugger, cmdLoadPalette)); + registerCmd("facings", WRAP_METHOD(Debugger, cmdShowFacings)); + registerCmd("gamespeed", WRAP_METHOD(Debugger, cmdGameSpeed)); + registerCmd("flags", WRAP_METHOD(Debugger, cmdListFlags)); + registerCmd("toggleflag", WRAP_METHOD(Debugger, cmdToggleFlag)); + registerCmd("queryflag", WRAP_METHOD(Debugger, cmdQueryFlag)); + registerCmd("timers", WRAP_METHOD(Debugger, cmdListTimers)); + registerCmd("settimercountdown", WRAP_METHOD(Debugger, cmdSetTimerCountdown)); +} + +bool Debugger::cmdSetScreenDebug(int argc, const char **argv) { if (argc > 1) { if (scumm_stricmp(argv[1], "enable") == 0) _vm->screen()->enableScreenDebug(true); else if (scumm_stricmp(argv[1], "disable") == 0) _vm->screen()->enableScreenDebug(false); else - DebugPrintf("Use screen_debug_mode <enable/disable> to enable or disable it.\n"); + debugPrintf("Use screen_debug_mode <enable/disable> to enable or disable it.\n"); } else { - DebugPrintf("Screen debug mode is %s.\n", (_vm->screen()->queryScreenDebug() ? "enabled" : "disabled")); - DebugPrintf("Use screen_debug_mode <enable/disable> to enable or disable it.\n"); + debugPrintf("Screen debug mode is %s.\n", (_vm->screen()->queryScreenDebug() ? "enabled" : "disabled")); + debugPrintf("Use screen_debug_mode <enable/disable> to enable or disable it.\n"); } return true; } -bool Debugger::cmd_loadPalette(int argc, const char **argv) { +bool Debugger::cmdLoadPalette(int argc, const char **argv) { Palette palette(_vm->screen()->getPalette(0).getNumColors()); if (argc <= 1) { - DebugPrintf("Use load_palette <file> [start_col] [end_col]\n"); + debugPrintf("Use load_palette <file> [start_col] [end_col]\n"); return true; } if (_vm->game() != GI_KYRA1 && _vm->resource()->getFileSize(argv[1]) != 768) { uint8 *buffer = new uint8[320 * 200 * sizeof(uint8)]; if (!buffer) { - DebugPrintf("ERROR: Cannot allocate buffer for screen region!\n"); + debugPrintf("ERROR: Cannot allocate buffer for screen region!\n"); return true; } @@ -89,7 +89,7 @@ bool Debugger::cmd_loadPalette(int argc, const char **argv) { delete[] buffer; } else if (!_vm->screen()->loadPalette(argv[1], palette)) { - DebugPrintf("ERROR: Palette '%s' not found!\n", argv[1]); + debugPrintf("ERROR: Palette '%s' not found!\n", argv[1]); return true; } @@ -111,87 +111,87 @@ bool Debugger::cmd_loadPalette(int argc, const char **argv) { return true; } -bool Debugger::cmd_showFacings(int argc, const char **argv) { - DebugPrintf("Facing directions:\n"); - DebugPrintf("7 0 1\n"); - DebugPrintf(" \\ | / \n"); - DebugPrintf("6--*--2\n"); - DebugPrintf(" / | \\\n"); - DebugPrintf("5 4 3\n"); +bool Debugger::cmdShowFacings(int argc, const char **argv) { + debugPrintf("Facing directions:\n"); + debugPrintf("7 0 1\n"); + debugPrintf(" \\ | / \n"); + debugPrintf("6--*--2\n"); + debugPrintf(" / | \\\n"); + debugPrintf("5 4 3\n"); return true; } -bool Debugger::cmd_gameSpeed(int argc, const char **argv) { +bool Debugger::cmdGameSpeed(int argc, const char **argv) { if (argc == 2) { int val = atoi(argv[1]); if (val < 1 || val > 1000) { - DebugPrintf("speed must lie between 1 and 1000 (default: 60)\n"); + debugPrintf("speed must lie between 1 and 1000 (default: 60)\n"); return true; } _vm->_tickLength = (uint8)(1000.0 / val); } else { - DebugPrintf("Syntax: gamespeed <value>\n"); + debugPrintf("Syntax: gamespeed <value>\n"); } return true; } -bool Debugger::cmd_listFlags(int argc, const char **argv) { +bool Debugger::cmdListFlags(int argc, const char **argv) { for (int i = 0, p = 0; i < (int)sizeof(_vm->_flagsTable) * 8; i++, ++p) { - DebugPrintf("(%-3i): %-2i", i, _vm->queryGameFlag(i)); + debugPrintf("(%-3i): %-2i", i, _vm->queryGameFlag(i)); if (p == 5) { - DebugPrintf("\n"); + debugPrintf("\n"); p -= 6; } } - DebugPrintf("\n"); + debugPrintf("\n"); return true; } -bool Debugger::cmd_toggleFlag(int argc, const char **argv) { +bool Debugger::cmdToggleFlag(int argc, const char **argv) { if (argc > 1) { uint flag = atoi(argv[1]); if (_vm->queryGameFlag(flag)) _vm->resetGameFlag(flag); else _vm->setGameFlag(flag); - DebugPrintf("Flag %i is now %i\n", flag, _vm->queryGameFlag(flag)); + debugPrintf("Flag %i is now %i\n", flag, _vm->queryGameFlag(flag)); } else { - DebugPrintf("Syntax: toggleflag <flag>\n"); + debugPrintf("Syntax: toggleflag <flag>\n"); } return true; } -bool Debugger::cmd_queryFlag(int argc, const char **argv) { +bool Debugger::cmdQueryFlag(int argc, const char **argv) { if (argc > 1) { uint flag = atoi(argv[1]); - DebugPrintf("Flag %i is %i\n", flag, _vm->queryGameFlag(flag)); + debugPrintf("Flag %i is %i\n", flag, _vm->queryGameFlag(flag)); } else { - DebugPrintf("Syntax: queryflag <flag>\n"); + debugPrintf("Syntax: queryflag <flag>\n"); } return true; } -bool Debugger::cmd_listTimers(int argc, const char **argv) { - DebugPrintf("Current time: %-8u\n", g_system->getMillis()); +bool Debugger::cmdListTimers(int argc, const char **argv) { + debugPrintf("Current time: %-8u\n", g_system->getMillis()); for (int i = 0; i < _vm->timer()->count(); i++) - DebugPrintf("Timer %-2i: Active: %-3s Countdown: %-6i %-8u\n", i, _vm->timer()->isEnabled(i) ? "Yes" : "No", _vm->timer()->getDelay(i), _vm->timer()->getNextRun(i)); + debugPrintf("Timer %-2i: Active: %-3s Countdown: %-6i %-8u\n", i, _vm->timer()->isEnabled(i) ? "Yes" : "No", _vm->timer()->getDelay(i), _vm->timer()->getNextRun(i)); return true; } -bool Debugger::cmd_setTimerCountdown(int argc, const char **argv) { +bool Debugger::cmdSetTimerCountdown(int argc, const char **argv) { if (argc > 2) { uint timer = atoi(argv[1]); uint countdown = atoi(argv[2]); _vm->timer()->setCountdown(timer, countdown); - DebugPrintf("Timer %i now has countdown %i\n", timer, _vm->timer()->getDelay(timer)); + debugPrintf("Timer %i now has countdown %i\n", timer, _vm->timer()->getDelay(timer)); } else { - DebugPrintf("Syntax: settimercountdown <timer> <countdown>\n"); + debugPrintf("Syntax: settimercountdown <timer> <countdown>\n"); } return true; @@ -204,21 +204,21 @@ Debugger_LoK::Debugger_LoK(KyraEngine_LoK *vm) } void Debugger_LoK::initialize() { - DCmd_Register("enter", WRAP_METHOD(Debugger_LoK, cmd_enterRoom)); - DCmd_Register("scenes", WRAP_METHOD(Debugger_LoK, cmd_listScenes)); - DCmd_Register("give", WRAP_METHOD(Debugger_LoK, cmd_giveItem)); - DCmd_Register("birthstones", WRAP_METHOD(Debugger_LoK, cmd_listBirthstones)); + registerCmd("enter", WRAP_METHOD(Debugger_LoK, cmdEnterRoom)); + registerCmd("scenes", WRAP_METHOD(Debugger_LoK, cmdListScenes)); + registerCmd("give", WRAP_METHOD(Debugger_LoK, cmdGiveItem)); + registerCmd("birthstones", WRAP_METHOD(Debugger_LoK, cmdListBirthstones)); Debugger::initialize(); } -bool Debugger_LoK::cmd_enterRoom(int argc, const char **argv) { +bool Debugger_LoK::cmdEnterRoom(int argc, const char **argv) { uint direction = 0; if (argc > 1) { int room = atoi(argv[1]); // game will crash if entering a non-existent room if (room >= _vm->_roomTableSize) { - DebugPrintf("room number must be any value between (including) 0 and %d\n", _vm->_roomTableSize - 1); + debugPrintf("room number must be any value between (including) 0 and %d\n", _vm->_roomTableSize - 1); return true; } @@ -246,44 +246,44 @@ bool Debugger_LoK::cmd_enterRoom(int argc, const char **argv) { return false; } - DebugPrintf("Syntax: room <roomnum> <direction>\n"); + debugPrintf("Syntax: room <roomnum> <direction>\n"); return true; } -bool Debugger_LoK::cmd_listScenes(int argc, const char **argv) { +bool Debugger_LoK::cmdListScenes(int argc, const char **argv) { for (int i = 0; i < _vm->_roomTableSize; i++) { - DebugPrintf("%-3i: %-10s", i, _vm->_roomFilenameTable[_vm->_roomTable[i].nameIndex]); + debugPrintf("%-3i: %-10s", i, _vm->_roomFilenameTable[_vm->_roomTable[i].nameIndex]); if (!(i % 8)) - DebugPrintf("\n"); + debugPrintf("\n"); } - DebugPrintf("\n"); - DebugPrintf("Current room: %i\n", _vm->_currentRoom); + debugPrintf("\n"); + debugPrintf("Current room: %i\n", _vm->_currentRoom); return true; } -bool Debugger_LoK::cmd_giveItem(int argc, const char **argv) { +bool Debugger_LoK::cmdGiveItem(int argc, const char **argv) { if (argc == 2) { int item = atoi(argv[1]); // Kyrandia 1 has only 108 items (-1 to 106), otherwise it will crash if (item < -1 || item > 106) { - DebugPrintf("'itemid' must be any value between (including) -1 and 106\n"); + debugPrintf("'itemid' must be any value between (including) -1 and 106\n"); return true; } _vm->setMouseItem(item); _vm->_itemInHand = item; } else { - DebugPrintf("Syntax: give <itemid>\n"); + debugPrintf("Syntax: give <itemid>\n"); } return true; } -bool Debugger_LoK::cmd_listBirthstones(int argc, const char **argv) { - DebugPrintf("Needed birthstone gems:\n"); +bool Debugger_LoK::cmdListBirthstones(int argc, const char **argv) { + debugPrintf("Needed birthstone gems:\n"); for (int i = 0; i < ARRAYSIZE(_vm->_birthstoneGemTable); ++i) - DebugPrintf("%-3d '%s'\n", _vm->_birthstoneGemTable[i], _vm->_itemList[_vm->_birthstoneGemTable[i]]); + debugPrintf("%-3d '%s'\n", _vm->_birthstoneGemTable[i], _vm->_itemList[_vm->_birthstoneGemTable[i]]); return true; } @@ -293,23 +293,23 @@ Debugger_v2::Debugger_v2(KyraEngine_v2 *vm) : Debugger(vm), _vm(vm) { } void Debugger_v2::initialize() { - DCmd_Register("character_info", WRAP_METHOD(Debugger_v2, cmd_characterInfo)); - DCmd_Register("enter", WRAP_METHOD(Debugger_v2, cmd_enterScene)); - DCmd_Register("scenes", WRAP_METHOD(Debugger_v2, cmd_listScenes)); - DCmd_Register("scene_info", WRAP_METHOD(Debugger_v2, cmd_sceneInfo)); - DCmd_Register("scene_to_facing", WRAP_METHOD(Debugger_v2, cmd_sceneToFacing)); - DCmd_Register("give", WRAP_METHOD(Debugger_v2, cmd_giveItem)); + registerCmd("character_info", WRAP_METHOD(Debugger_v2, cmdCharacterInfo)); + registerCmd("enter", WRAP_METHOD(Debugger_v2, cmdEnterScene)); + registerCmd("scenes", WRAP_METHOD(Debugger_v2, cmdListScenes)); + registerCmd("scene_info", WRAP_METHOD(Debugger_v2, cmdSceneInfo)); + registerCmd("scene_to_facing", WRAP_METHOD(Debugger_v2, cmdSceneToFacing)); + registerCmd("give", WRAP_METHOD(Debugger_v2, cmdGiveItem)); Debugger::initialize(); } -bool Debugger_v2::cmd_enterScene(int argc, const char **argv) { +bool Debugger_v2::cmdEnterScene(int argc, const char **argv) { uint direction = 0; if (argc > 1) { int scene = atoi(argv[1]); // game will crash if entering a non-existent scene if (scene >= _vm->_sceneListSize) { - DebugPrintf("scene number must be any value between (including) 0 and %d\n", _vm->_sceneListSize - 1); + debugPrintf("scene number must be any value between (including) 0 and %d\n", _vm->_sceneListSize - 1); return true; } @@ -337,40 +337,40 @@ bool Debugger_v2::cmd_enterScene(int argc, const char **argv) { return false; } - DebugPrintf("Syntax: %s <scenenum> <direction>\n", argv[0]); + debugPrintf("Syntax: %s <scenenum> <direction>\n", argv[0]); return true; } -bool Debugger_v2::cmd_listScenes(int argc, const char **argv) { +bool Debugger_v2::cmdListScenes(int argc, const char **argv) { int shown = 1; for (int i = 0; i < _vm->_sceneListSize; ++i) { if (_vm->_sceneList[i].filename1[0]) { - DebugPrintf("%-2i: %-10s", i, _vm->_sceneList[i].filename1); + debugPrintf("%-2i: %-10s", i, _vm->_sceneList[i].filename1); if (!(shown % 5)) - DebugPrintf("\n"); + debugPrintf("\n"); ++shown; } } - DebugPrintf("\n"); - DebugPrintf("Current scene: %i\n", _vm->_currentScene); + debugPrintf("\n"); + debugPrintf("Current scene: %i\n", _vm->_currentScene); return true; } -bool Debugger_v2::cmd_sceneInfo(int argc, const char **argv) { - DebugPrintf("Current scene: %d '%s'\n", _vm->_currentScene, _vm->_sceneList[_vm->_currentScene].filename1); - DebugPrintf("\n"); - DebugPrintf("Exit information:\n"); - DebugPrintf("Exit1: leads to %d, position %dx%d\n", int16(_vm->_sceneExit1), _vm->_sceneEnterX1, _vm->_sceneEnterY1); - DebugPrintf("Exit2: leads to %d, position %dx%d\n", int16(_vm->_sceneExit2), _vm->_sceneEnterX2, _vm->_sceneEnterY2); - DebugPrintf("Exit3: leads to %d, position %dx%d\n", int16(_vm->_sceneExit3), _vm->_sceneEnterX3, _vm->_sceneEnterY3); - DebugPrintf("Exit4: leads to %d, position %dx%d\n", int16(_vm->_sceneExit4), _vm->_sceneEnterX4, _vm->_sceneEnterY4); - DebugPrintf("Special exit information:\n"); +bool Debugger_v2::cmdSceneInfo(int argc, const char **argv) { + debugPrintf("Current scene: %d '%s'\n", _vm->_currentScene, _vm->_sceneList[_vm->_currentScene].filename1); + debugPrintf("\n"); + debugPrintf("Exit information:\n"); + debugPrintf("Exit1: leads to %d, position %dx%d\n", int16(_vm->_sceneExit1), _vm->_sceneEnterX1, _vm->_sceneEnterY1); + debugPrintf("Exit2: leads to %d, position %dx%d\n", int16(_vm->_sceneExit2), _vm->_sceneEnterX2, _vm->_sceneEnterY2); + debugPrintf("Exit3: leads to %d, position %dx%d\n", int16(_vm->_sceneExit3), _vm->_sceneEnterX3, _vm->_sceneEnterY3); + debugPrintf("Exit4: leads to %d, position %dx%d\n", int16(_vm->_sceneExit4), _vm->_sceneEnterX4, _vm->_sceneEnterY4); + debugPrintf("Special exit information:\n"); if (!_vm->_specialExitCount) { - DebugPrintf("No special exits.\n"); + debugPrintf("No special exits.\n"); } else { - DebugPrintf("This scene has %d special exits.\n", _vm->_specialExitCount); + debugPrintf("This scene has %d special exits.\n", _vm->_specialExitCount); for (int i = 0; i < _vm->_specialExitCount; ++i) { - DebugPrintf("SpecialExit%d: facing %d, position (x1/y1/x2/y2): %d/%d/%d/%d\n", i, + debugPrintf("SpecialExit%d: facing %d, position (x1/y1/x2/y2): %d/%d/%d/%d\n", i, _vm->_specialExitTable[20 + i], _vm->_specialExitTable[0 + i], _vm->_specialExitTable[5 + i], _vm->_specialExitTable[10 + i], _vm->_specialExitTable[15 + i]); } @@ -379,20 +379,20 @@ bool Debugger_v2::cmd_sceneInfo(int argc, const char **argv) { return true; } -bool Debugger_v2::cmd_characterInfo(int argc, const char **argv) { - DebugPrintf("Main character is in scene: %d '%s'\n", _vm->_mainCharacter.sceneId, _vm->_sceneList[_vm->_mainCharacter.sceneId].filename1); - DebugPrintf("Position: %dx%d\n", _vm->_mainCharacter.x1, _vm->_mainCharacter.y1); - DebugPrintf("Facing: %d\n", _vm->_mainCharacter.facing); - DebugPrintf("Inventory:\n"); +bool Debugger_v2::cmdCharacterInfo(int argc, const char **argv) { + debugPrintf("Main character is in scene: %d '%s'\n", _vm->_mainCharacter.sceneId, _vm->_sceneList[_vm->_mainCharacter.sceneId].filename1); + debugPrintf("Position: %dx%d\n", _vm->_mainCharacter.x1, _vm->_mainCharacter.y1); + debugPrintf("Facing: %d\n", _vm->_mainCharacter.facing); + debugPrintf("Inventory:\n"); for (int i = 0; i < 20; ++i) { - DebugPrintf("%-2d ", int8(_vm->_mainCharacter.inventory[i])); + debugPrintf("%-2d ", int8(_vm->_mainCharacter.inventory[i])); if (i == 9 || i == 19) - DebugPrintf("\n"); + debugPrintf("\n"); } return true; } -bool Debugger_v2::cmd_sceneToFacing(int argc, const char **argv) { +bool Debugger_v2::cmdSceneToFacing(int argc, const char **argv) { if (argc == 2) { int facing = atoi(argv[1]); int16 exit = -1; @@ -418,26 +418,26 @@ bool Debugger_v2::cmd_sceneToFacing(int argc, const char **argv) { break; } - DebugPrintf("Exit to facing %d leads to room %d.\n", facing, exit); + debugPrintf("Exit to facing %d leads to room %d.\n", facing, exit); } else { - DebugPrintf("Usage: %s <facing>\n", argv[0]); + debugPrintf("Usage: %s <facing>\n", argv[0]); } return true; } -bool Debugger_v2::cmd_giveItem(int argc, const char **argv) { +bool Debugger_v2::cmdGiveItem(int argc, const char **argv) { if (argc == 2) { int item = atoi(argv[1]); if (item < -1 || item > _vm->engineDesc().maxItemId) { - DebugPrintf("itemid must be any value between (including) -1 and %d\n", _vm->engineDesc().maxItemId); + debugPrintf("itemid must be any value between (including) -1 and %d\n", _vm->engineDesc().maxItemId); return true; } _vm->setHandItem(item); } else { - DebugPrintf("Syntax: give <itemid>\n"); + debugPrintf("Syntax: give <itemid>\n"); } return true; @@ -449,22 +449,22 @@ Debugger_HoF::Debugger_HoF(KyraEngine_HoF *vm) : Debugger_v2(vm), _vm(vm) { } void Debugger_HoF::initialize() { - DCmd_Register("pass_codes", WRAP_METHOD(Debugger_HoF, cmd_passcodes)); + registerCmd("pass_codes", WRAP_METHOD(Debugger_HoF, cmdPasscodes)); Debugger_v2::initialize(); } -bool Debugger_HoF::cmd_passcodes(int argc, const char **argv) { +bool Debugger_HoF::cmdPasscodes(int argc, const char **argv) { if (argc == 2) { int val = atoi(argv[1]); if (val < 0 || val > 1) { - DebugPrintf("value must be either 1 (on) or 0 (off)\n"); + debugPrintf("value must be either 1 (on) or 0 (off)\n"); return true; } _vm->_dbgPass = val; } else { - DebugPrintf("Syntax: pass_codes <0/1>\n"); + debugPrintf("Syntax: pass_codes <0/1>\n"); } return true; @@ -482,43 +482,43 @@ Debugger_EoB::Debugger_EoB(EoBCoreEngine *vm) : Debugger(vm), _vm(vm) { } void Debugger_EoB::initialize() { - DCmd_Register("import_savefile", WRAP_METHOD(Debugger_EoB, cmd_importSaveFile)); - DCmd_Register("save_original", WRAP_METHOD(Debugger_EoB, cmd_saveOriginal)); - DCmd_Register("list_monsters", WRAP_METHOD(Debugger_EoB, cmd_listMonsters)); - DCmd_Register("show_position", WRAP_METHOD(Debugger_EoB, cmd_showPosition)); - DCmd_Register("set_position", WRAP_METHOD(Debugger_EoB, cmd_setPosition)); - DCmd_Register("open_door", WRAP_METHOD(Debugger_EoB, cmd_openDoor)); - DCmd_Register("close_door", WRAP_METHOD(Debugger_EoB, cmd_closeDoor)); - DCmd_Register("list_flags", WRAP_METHOD(Debugger_EoB, cmd_listFlags)); - DCmd_Register("set_flag", WRAP_METHOD(Debugger_EoB, cmd_setFlag)); - DCmd_Register("clear_flag", WRAP_METHOD(Debugger_EoB, cmd_clearFlag)); -} - -bool Debugger_EoB::cmd_importSaveFile(int argc, const char **argv) { + registerCmd("import_savefile", WRAP_METHOD(Debugger_EoB, cmdImportSaveFile)); + registerCmd("save_original", WRAP_METHOD(Debugger_EoB, cmdSaveOriginal)); + registerCmd("list_monsters", WRAP_METHOD(Debugger_EoB, cmdListMonsters)); + registerCmd("show_position", WRAP_METHOD(Debugger_EoB, cmdShowPosition)); + registerCmd("set_position", WRAP_METHOD(Debugger_EoB, cmdSetPosition)); + registerCmd("open_door", WRAP_METHOD(Debugger_EoB, cmdOpenDoor)); + registerCmd("close_door", WRAP_METHOD(Debugger_EoB, cmdCloseDoor)); + registerCmd("list_flags", WRAP_METHOD(Debugger_EoB, cmdListFlags)); + registerCmd("set_flag", WRAP_METHOD(Debugger_EoB, cmdSetFlag)); + registerCmd("clear_flag", WRAP_METHOD(Debugger_EoB, cmdClearFlag)); +} + +bool Debugger_EoB::cmdImportSaveFile(int argc, const char **argv) { if (!_vm->_allowImport) { - DebugPrintf("This command only works from the main menu.\n"); + debugPrintf("This command only works from the main menu.\n"); return true; } if (argc == 3) { int slot = atoi(argv[1]); if (slot < -1 || slot > 989) { - DebugPrintf("slot must be between (including) -1 and 989 \n"); + debugPrintf("slot must be between (including) -1 and 989 \n"); return true; } - DebugPrintf(_vm->importOriginalSaveFile(slot, argv[2]) ? "Success.\n" : "Failure.\n"); + debugPrintf(_vm->importOriginalSaveFile(slot, argv[2]) ? "Success.\n" : "Failure.\n"); _vm->loadItemDefs(); } else { - DebugPrintf("Syntax: import_savefile <dest slot> <source file>\n (Imports source save game file to dest slot.)\n import_savefile -1\n (Imports all original save game files found and puts them into the first available slots.)\n\n"); + debugPrintf("Syntax: import_savefile <dest slot> <source file>\n (Imports source save game file to dest slot.)\n import_savefile -1\n (Imports all original save game files found and puts them into the first available slots.)\n\n"); } return true; } -bool Debugger_EoB::cmd_saveOriginal(int argc, const char **argv) { +bool Debugger_EoB::cmdSaveOriginal(int argc, const char **argv) { if (!_vm->_runFlag) { - DebugPrintf("This command doesn't work during intro or outro sequences,\nfrom the main menu or from the character generation.\n"); + debugPrintf("This command doesn't work during intro or outro sequences,\nfrom the main menu or from the character generation.\n"); return true; } @@ -535,57 +535,57 @@ bool Debugger_EoB::cmd_saveOriginal(int argc, const char **argv) { if (_vm->saveAsOriginalSaveFile()) { Common::FSNode nf = nd.getChild(Common::String::format("EOBDATA.SAV")); if (nf.isReadable()) - DebugPrintf("Saved to file: %s\n\n", nf.getPath().c_str()); + debugPrintf("Saved to file: %s\n\n", nf.getPath().c_str()); else - DebugPrintf("Failure.\n"); + debugPrintf("Failure.\n"); } else { - DebugPrintf("Failure.\n"); + debugPrintf("Failure.\n"); } } else { - DebugPrintf("Syntax: save_original\n (Saves game in original file format to a file which can be used with the orginal game executable.)\n\n"); + debugPrintf("Syntax: save_original\n (Saves game in original file format to a file which can be used with the orginal game executable.)\n\n"); } return true; } else if (argc == 2) { int slot = atoi(argv[1]); if (slot < 0 || slot > 5) { - DebugPrintf("Slot must be between (including) 0 and 5.\n"); + debugPrintf("Slot must be between (including) 0 and 5.\n"); } else if (_vm->saveAsOriginalSaveFile(slot)) { Common::FSNode nf = nd.getChild(Common::String::format("EOBDATA%d.SAV", slot)); if (nf.isReadable()) - DebugPrintf("Saved to file: %s\n\n", nf.getPath().c_str()); + debugPrintf("Saved to file: %s\n\n", nf.getPath().c_str()); else - DebugPrintf("Failure.\n"); + debugPrintf("Failure.\n"); } else { - DebugPrintf("Failure.\n"); + debugPrintf("Failure.\n"); } return true; } - DebugPrintf("Syntax: save_original <slot>\n (Saves game in original file format to a file which can be used with the orginal game executable.\n A save slot between 0 and 5 must be specified.)\n\n"); + debugPrintf("Syntax: save_original <slot>\n (Saves game in original file format to a file which can be used with the orginal game executable.\n A save slot between 0 and 5 must be specified.)\n\n"); return true; } -bool Debugger_EoB::cmd_listMonsters(int, const char **) { - DebugPrintf("\nCurrent level: %d\n----------------------\n\n", _vm->_currentLevel); - DebugPrintf("Id Type Unit Block Position Direction Sub Level Mode Dst.block HP Flags\n--------------------------------------------------------------------------------------------------------------\n"); +bool Debugger_EoB::cmdListMonsters(int, const char **) { + debugPrintf("\nCurrent level: %d\n----------------------\n\n", _vm->_currentLevel); + debugPrintf("Id Type Unit Block Position Direction Sub Level Mode Dst.block HP Flags\n--------------------------------------------------------------------------------------------------------------\n"); for (int i = 0; i < 30; i++) { EoBMonsterInPlay *m = &_vm->_monsters[i]; - DebugPrintf("%.02d %.02d %.02d 0x%.04x %d %d %d %.02d 0x%.04x %.03d/%.03d 0x%.02x\n", i, m->type, m->unit, m->block, m->pos, m->dir, m->sub, m->mode, m->dest, m->hitPointsCur, m->hitPointsMax, m->flags); + debugPrintf("%.02d %.02d %.02d 0x%.04x %d %d %d %.02d 0x%.04x %.03d/%.03d 0x%.02x\n", i, m->type, m->unit, m->block, m->pos, m->dir, m->sub, m->mode, m->dest, m->hitPointsCur, m->hitPointsMax, m->flags); } - DebugPrintf("\n"); + debugPrintf("\n"); return true; } -bool Debugger_EoB::cmd_showPosition(int, const char **) { - DebugPrintf("\nCurrent level: %d\nCurrent Sub Level: %d\nCurrent block: %d (0x%.04x)\nNext block: %d (0x%.04x)\nCurrent direction: %d\n\n", _vm->_currentLevel, _vm->_currentSub, _vm->_currentBlock, _vm->_currentBlock, _vm->calcNewBlockPosition(_vm->_currentBlock, _vm->_currentDirection), _vm->calcNewBlockPosition(_vm->_currentBlock, _vm->_currentDirection), _vm->_currentDirection); +bool Debugger_EoB::cmdShowPosition(int, const char **) { + debugPrintf("\nCurrent level: %d\nCurrent Sub Level: %d\nCurrent block: %d (0x%.04x)\nNext block: %d (0x%.04x)\nCurrent direction: %d\n\n", _vm->_currentLevel, _vm->_currentSub, _vm->_currentBlock, _vm->_currentBlock, _vm->calcNewBlockPosition(_vm->_currentBlock, _vm->_currentDirection), _vm->calcNewBlockPosition(_vm->_currentBlock, _vm->_currentDirection), _vm->_currentDirection); return true; } -bool Debugger_EoB::cmd_setPosition(int argc, const char **argv) { +bool Debugger_EoB::cmdSetPosition(int argc, const char **argv) { if (argc == 4) { _vm->_currentBlock = atoi(argv[3]); int sub = atoi(argv[2]); @@ -593,7 +593,7 @@ bool Debugger_EoB::cmd_setPosition(int argc, const char **argv) { int maxLevel = (_vm->game() == GI_EOB1) ? 12 : 16; if (level < 1 || level > maxLevel) { - DebugPrintf("<level> must be a value from 1 to %d.\n\n", maxLevel); + debugPrintf("<level> must be a value from 1 to %d.\n\n", maxLevel); return true; } @@ -613,83 +613,83 @@ bool Debugger_EoB::cmd_setPosition(int argc, const char **argv) { _vm->_sceneUpdateRequired = true; _vm->gui_drawAllCharPortraitsWithStats(); - DebugPrintf("Success.\n\n"); + debugPrintf("Success.\n\n"); } else { - DebugPrintf("Syntax: set_position <level>, <sub level>, <block>\n"); - DebugPrintf(" (Warning: The sub level and block position parameters will not be checked. Invalid parameters may cause problems.)\n\n"); + debugPrintf("Syntax: set_position <level>, <sub level>, <block>\n"); + debugPrintf(" (Warning: The sub level and block position parameters will not be checked. Invalid parameters may cause problems.)\n\n"); } return true; } -bool Debugger_EoB::cmd_openDoor(int, const char **) { - DebugPrintf("Warning: Using this command may cause glitches.\n"); +bool Debugger_EoB::cmdOpenDoor(int, const char **) { + debugPrintf("Warning: Using this command may cause glitches.\n"); uint16 block = _vm->calcNewBlockPosition(_vm->_currentBlock, _vm->_currentDirection); int c = (_vm->_wllWallFlags[_vm->_levelBlockProperties[block].walls[0]] & 8) ? 0 : 1; int v = _vm->_levelBlockProperties[block].walls[c]; int flg = (_vm->_flags.gameID == GI_EOB1) ? 1 : 0x10; if (_vm->_wllWallFlags[v] & flg) { - DebugPrintf("Couldn't open any door. Make sure you're facing the door you wish to open and standing right in front of it.\n\n"); + debugPrintf("Couldn't open any door. Make sure you're facing the door you wish to open and standing right in front of it.\n\n"); } else { _vm->openDoor(block); - DebugPrintf("Trying to open door at block %d.\n\n", block); + debugPrintf("Trying to open door at block %d.\n\n", block); } return true; } -bool Debugger_EoB::cmd_closeDoor(int, const char **) { - DebugPrintf("Warning: Using this command may cause glitches.\n"); +bool Debugger_EoB::cmdCloseDoor(int, const char **) { + debugPrintf("Warning: Using this command may cause glitches.\n"); uint16 block = _vm->calcNewBlockPosition(_vm->_currentBlock, _vm->_currentDirection); int c = (_vm->_wllWallFlags[_vm->_levelBlockProperties[block].walls[0]] & 8) ? 0 : 1; int v = _vm->_levelBlockProperties[block].walls[c]; if ((_vm->_flags.gameID == GI_EOB1 && !(_vm->_wllWallFlags[v] & 1)) || (_vm->_flags.gameID == GI_EOB2 && (_vm->_wllWallFlags[v] & 0x20))) { - DebugPrintf("Couldn't close any door. Make sure you're facing the door you wish to close and standing right in front of it.\n\n"); + debugPrintf("Couldn't close any door. Make sure you're facing the door you wish to close and standing right in front of it.\n\n"); } else { _vm->closeDoor(block); - DebugPrintf("Trying to close door at block %d.\n\n", block); + debugPrintf("Trying to close door at block %d.\n\n", block); } return true; } -bool Debugger_EoB::cmd_listFlags(int, const char **) { - DebugPrintf("Flag Status\n----------------------\n\n"); +bool Debugger_EoB::cmdListFlags(int, const char **) { + debugPrintf("Flag Status\n----------------------\n\n"); for (int i = 0; i < 32; i++) { uint32 flag = 1 << i; - DebugPrintf("%.2d %s\n", i, _vm->checkScriptFlags(flag) ? "TRUE" : "FALSE"); + debugPrintf("%.2d %s\n", i, _vm->checkScriptFlags(flag) ? "TRUE" : "FALSE"); } - DebugPrintf("\n"); + debugPrintf("\n"); return true; } -bool Debugger_EoB::cmd_setFlag(int argc, const char **argv) { +bool Debugger_EoB::cmdSetFlag(int argc, const char **argv) { if (argc != 2) { - DebugPrintf("Syntax: set_flag <flag>\n\n"); + debugPrintf("Syntax: set_flag <flag>\n\n"); return true; } int flag = atoi(argv[1]); if (flag < 0 || flag > 31) { - DebugPrintf("<flag> must be a value from 0 to 31.\n\n"); + debugPrintf("<flag> must be a value from 0 to 31.\n\n"); } else { _vm->setScriptFlags(1 << flag); - DebugPrintf("Flag '%.2d' has been set.\n\n", flag); + debugPrintf("Flag '%.2d' has been set.\n\n", flag); } return true; } -bool Debugger_EoB::cmd_clearFlag(int argc, const char **argv) { +bool Debugger_EoB::cmdClearFlag(int argc, const char **argv) { if (argc != 2) { - DebugPrintf("Syntax: clear_flag <flag>\n\n"); + debugPrintf("Syntax: clear_flag <flag>\n\n"); return true; } int flag = atoi(argv[1]); if (flag < 0 || flag > 31) { - DebugPrintf("<flag> must be a value from 0 to 31.\n\n"); + debugPrintf("<flag> must be a value from 0 to 31.\n\n"); } else { _vm->clearScriptFlags(1 << flag); - DebugPrintf("Flag '%.2d' has been cleared.\n\n", flag); + debugPrintf("Flag '%.2d' has been cleared.\n\n", flag); } return true; diff --git a/engines/kyra/debugger.h b/engines/kyra/debugger.h index c1056a6cf3..15cee2d592 100644 --- a/engines/kyra/debugger.h +++ b/engines/kyra/debugger.h @@ -8,12 +8,12 @@ * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. - + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. @@ -42,15 +42,15 @@ public: protected: KyraEngine_v1 *_vm; - bool cmd_setScreenDebug(int argc, const char **argv); - bool cmd_loadPalette(int argc, const char **argv); - bool cmd_showFacings(int argc, const char **argv); - bool cmd_gameSpeed(int argc, const char **argv); - bool cmd_listFlags(int argc, const char **argv); - bool cmd_toggleFlag(int argc, const char **argv); - bool cmd_queryFlag(int argc, const char **argv); - bool cmd_listTimers(int argc, const char **argv); - bool cmd_setTimerCountdown(int argc, const char **argv); + bool cmdSetScreenDebug(int argc, const char **argv); + bool cmdLoadPalette(int argc, const char **argv); + bool cmdShowFacings(int argc, const char **argv); + bool cmdGameSpeed(int argc, const char **argv); + bool cmdListFlags(int argc, const char **argv); + bool cmdToggleFlag(int argc, const char **argv); + bool cmdQueryFlag(int argc, const char **argv); + bool cmdListTimers(int argc, const char **argv); + bool cmdSetTimerCountdown(int argc, const char **argv); }; class Debugger_LoK : public Debugger { @@ -62,10 +62,10 @@ public: protected: KyraEngine_LoK *_vm; - bool cmd_enterRoom(int argc, const char **argv); - bool cmd_listScenes(int argc, const char **argv); - bool cmd_giveItem(int argc, const char **argv); - bool cmd_listBirthstones(int argc, const char **argv); + bool cmdEnterRoom(int argc, const char **argv); + bool cmdListScenes(int argc, const char **argv); + bool cmdGiveItem(int argc, const char **argv); + bool cmdListBirthstones(int argc, const char **argv); }; class Debugger_v2 : public Debugger { @@ -77,12 +77,12 @@ public: protected: KyraEngine_v2 *_vm; - bool cmd_enterScene(int argc, const char **argv); - bool cmd_listScenes(int argc, const char **argv); - bool cmd_sceneInfo(int argc, const char **argv); - bool cmd_characterInfo(int argc, const char **argv); - bool cmd_sceneToFacing(int argc, const char **argv); - bool cmd_giveItem(int argc, const char **argv); + bool cmdEnterScene(int argc, const char **argv); + bool cmdListScenes(int argc, const char **argv); + bool cmdSceneInfo(int argc, const char **argv); + bool cmdCharacterInfo(int argc, const char **argv); + bool cmdSceneToFacing(int argc, const char **argv); + bool cmdGiveItem(int argc, const char **argv); }; class Debugger_HoF : public Debugger_v2 { @@ -93,7 +93,7 @@ public: protected: KyraEngine_HoF *_vm; - bool cmd_passcodes(int argc, const char **argv); + bool cmdPasscodes(int argc, const char **argv); }; #ifdef ENABLE_LOL @@ -119,16 +119,16 @@ public: protected: EoBCoreEngine *_vm; - bool cmd_importSaveFile(int argc, const char **argv); - bool cmd_saveOriginal(int argc, const char **argv); - bool cmd_listMonsters(int argc, const char **argv); - bool cmd_showPosition(int argc, const char **argv); - bool cmd_setPosition(int argc, const char **argv); - bool cmd_openDoor(int argc, const char **argv); - bool cmd_closeDoor(int argc, const char **argv); - bool cmd_listFlags(int argc, const char **argv); - bool cmd_setFlag(int argc, const char **argv); - bool cmd_clearFlag(int argc, const char **argv); + bool cmdImportSaveFile(int argc, const char **argv); + bool cmdSaveOriginal(int argc, const char **argv); + bool cmdListMonsters(int argc, const char **argv); + bool cmdShowPosition(int argc, const char **argv); + bool cmdSetPosition(int argc, const char **argv); + bool cmdOpenDoor(int argc, const char **argv); + bool cmdCloseDoor(int argc, const char **argv); + bool cmdListFlags(int argc, const char **argv); + bool cmdSetFlag(int argc, const char **argv); + bool cmdClearFlag(int argc, const char **argv); }; #endif // ENABLE_EOB diff --git a/engines/kyra/detection_tables.h b/engines/kyra/detection_tables.h index f59d173fe6..1ada9a87ba 100644 --- a/engines/kyra/detection_tables.h +++ b/engines/kyra/detection_tables.h @@ -17,6 +17,7 @@ * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + * */ namespace { diff --git a/engines/kyra/eob.cpp b/engines/kyra/eob.cpp index 405ea2129a..6a6b20baac 100644 --- a/engines/kyra/eob.cpp +++ b/engines/kyra/eob.cpp @@ -8,12 +8,12 @@ * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. - + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. diff --git a/engines/kyra/eob.h b/engines/kyra/eob.h index b423b0da9d..09b6380c91 100644 --- a/engines/kyra/eob.h +++ b/engines/kyra/eob.h @@ -8,12 +8,12 @@ * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. - + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. diff --git a/engines/kyra/eobcommon.cpp b/engines/kyra/eobcommon.cpp index d477209e5b..38a5ab8440 100644 --- a/engines/kyra/eobcommon.cpp +++ b/engines/kyra/eobcommon.cpp @@ -8,12 +8,12 @@ * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. - + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. diff --git a/engines/kyra/eobcommon.h b/engines/kyra/eobcommon.h index 6421159dbe..1401d59dae 100644 --- a/engines/kyra/eobcommon.h +++ b/engines/kyra/eobcommon.h @@ -8,12 +8,12 @@ * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. - + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. diff --git a/engines/kyra/gui.cpp b/engines/kyra/gui.cpp index 1156b17957..e95d78c54d 100644 --- a/engines/kyra/gui.cpp +++ b/engines/kyra/gui.cpp @@ -8,12 +8,12 @@ * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. - + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. diff --git a/engines/kyra/gui.h b/engines/kyra/gui.h index 854f10e85d..3e2bdc04cd 100644 --- a/engines/kyra/gui.h +++ b/engines/kyra/gui.h @@ -8,12 +8,12 @@ * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. - + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. diff --git a/engines/kyra/gui_eob.cpp b/engines/kyra/gui_eob.cpp index 9b4c09d7f4..9456e575db 100644 --- a/engines/kyra/gui_eob.cpp +++ b/engines/kyra/gui_eob.cpp @@ -8,12 +8,12 @@ * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. - + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. diff --git a/engines/kyra/gui_eob.h b/engines/kyra/gui_eob.h index 1b7bdf3482..e4daff6ada 100644 --- a/engines/kyra/gui_eob.h +++ b/engines/kyra/gui_eob.h @@ -8,12 +8,12 @@ * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. - + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. diff --git a/engines/kyra/gui_hof.cpp b/engines/kyra/gui_hof.cpp index 3a2c07beff..8515cf51e0 100644 --- a/engines/kyra/gui_hof.cpp +++ b/engines/kyra/gui_hof.cpp @@ -8,12 +8,12 @@ * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. - + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. diff --git a/engines/kyra/gui_hof.h b/engines/kyra/gui_hof.h index c228c35551..9f6aaae2ca 100644 --- a/engines/kyra/gui_hof.h +++ b/engines/kyra/gui_hof.h @@ -8,12 +8,12 @@ * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. - + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. diff --git a/engines/kyra/gui_lok.cpp b/engines/kyra/gui_lok.cpp index 8e18ff910d..03b77bf677 100644 --- a/engines/kyra/gui_lok.cpp +++ b/engines/kyra/gui_lok.cpp @@ -8,12 +8,12 @@ * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. - + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. diff --git a/engines/kyra/gui_lok.h b/engines/kyra/gui_lok.h index d3e0beaa9e..76a5dc586b 100644 --- a/engines/kyra/gui_lok.h +++ b/engines/kyra/gui_lok.h @@ -8,12 +8,12 @@ * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. - + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. diff --git a/engines/kyra/gui_lol.cpp b/engines/kyra/gui_lol.cpp index 8808c313fc..cfdf762bba 100644 --- a/engines/kyra/gui_lol.cpp +++ b/engines/kyra/gui_lol.cpp @@ -8,12 +8,12 @@ * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. - + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. diff --git a/engines/kyra/gui_lol.h b/engines/kyra/gui_lol.h index 79d4b6b4c9..6fa6571016 100644 --- a/engines/kyra/gui_lol.h +++ b/engines/kyra/gui_lol.h @@ -8,12 +8,12 @@ * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. - + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. diff --git a/engines/kyra/gui_mr.cpp b/engines/kyra/gui_mr.cpp index ee0303c8c3..7984dde662 100644 --- a/engines/kyra/gui_mr.cpp +++ b/engines/kyra/gui_mr.cpp @@ -8,12 +8,12 @@ * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. - + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. diff --git a/engines/kyra/gui_mr.h b/engines/kyra/gui_mr.h index 6303dff83f..62872a5355 100644 --- a/engines/kyra/gui_mr.h +++ b/engines/kyra/gui_mr.h @@ -8,12 +8,12 @@ * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. - + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. diff --git a/engines/kyra/gui_rpg.cpp b/engines/kyra/gui_rpg.cpp index ab25f95df8..8e77a6e141 100644 --- a/engines/kyra/gui_rpg.cpp +++ b/engines/kyra/gui_rpg.cpp @@ -8,12 +8,12 @@ * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. - + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. diff --git a/engines/kyra/gui_v1.cpp b/engines/kyra/gui_v1.cpp index cec6562dd9..a75c14b071 100644 --- a/engines/kyra/gui_v1.cpp +++ b/engines/kyra/gui_v1.cpp @@ -8,12 +8,12 @@ * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. - + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. diff --git a/engines/kyra/gui_v1.h b/engines/kyra/gui_v1.h index 260edae8e5..94be09037c 100644 --- a/engines/kyra/gui_v1.h +++ b/engines/kyra/gui_v1.h @@ -8,12 +8,12 @@ * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. - + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. diff --git a/engines/kyra/gui_v2.cpp b/engines/kyra/gui_v2.cpp index 1df4149d2e..afda573c61 100644 --- a/engines/kyra/gui_v2.cpp +++ b/engines/kyra/gui_v2.cpp @@ -8,12 +8,12 @@ * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. - + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. diff --git a/engines/kyra/gui_v2.h b/engines/kyra/gui_v2.h index bdbcce1c4f..34651e4c22 100644 --- a/engines/kyra/gui_v2.h +++ b/engines/kyra/gui_v2.h @@ -8,12 +8,12 @@ * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. - + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. diff --git a/engines/kyra/item.h b/engines/kyra/item.h index 4b236372a2..cf06aad8ba 100644 --- a/engines/kyra/item.h +++ b/engines/kyra/item.h @@ -8,12 +8,12 @@ * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. - + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. diff --git a/engines/kyra/items_eob.cpp b/engines/kyra/items_eob.cpp index 6c7ccf14dc..c9c632f60b 100644 --- a/engines/kyra/items_eob.cpp +++ b/engines/kyra/items_eob.cpp @@ -8,12 +8,12 @@ * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. - + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. diff --git a/engines/kyra/items_hof.cpp b/engines/kyra/items_hof.cpp index e1d3c659de..2640af5188 100644 --- a/engines/kyra/items_hof.cpp +++ b/engines/kyra/items_hof.cpp @@ -8,12 +8,12 @@ * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. - + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. diff --git a/engines/kyra/items_lok.cpp b/engines/kyra/items_lok.cpp index 8ee07e8271..55a23b2a1a 100644 --- a/engines/kyra/items_lok.cpp +++ b/engines/kyra/items_lok.cpp @@ -8,12 +8,12 @@ * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. - + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. diff --git a/engines/kyra/items_lol.cpp b/engines/kyra/items_lol.cpp index f4024471d2..f2a9637dfe 100644 --- a/engines/kyra/items_lol.cpp +++ b/engines/kyra/items_lol.cpp @@ -8,12 +8,12 @@ * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. - + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. diff --git a/engines/kyra/items_mr.cpp b/engines/kyra/items_mr.cpp index 029f676538..397fab8d8f 100644 --- a/engines/kyra/items_mr.cpp +++ b/engines/kyra/items_mr.cpp @@ -8,12 +8,12 @@ * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. - + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. diff --git a/engines/kyra/items_v2.cpp b/engines/kyra/items_v2.cpp index 2145a2c2f0..732fa7c8dd 100644 --- a/engines/kyra/items_v2.cpp +++ b/engines/kyra/items_v2.cpp @@ -8,12 +8,12 @@ * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. - + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. diff --git a/engines/kyra/kyra_hof.cpp b/engines/kyra/kyra_hof.cpp index ce9b530dbe..9988899da8 100644 --- a/engines/kyra/kyra_hof.cpp +++ b/engines/kyra/kyra_hof.cpp @@ -8,12 +8,12 @@ * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. - + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. diff --git a/engines/kyra/kyra_hof.h b/engines/kyra/kyra_hof.h index 1b84e5b56f..1e500d4286 100644 --- a/engines/kyra/kyra_hof.h +++ b/engines/kyra/kyra_hof.h @@ -8,12 +8,12 @@ * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. - + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. diff --git a/engines/kyra/kyra_lok.cpp b/engines/kyra/kyra_lok.cpp index 7d4e35092f..80511c674d 100644 --- a/engines/kyra/kyra_lok.cpp +++ b/engines/kyra/kyra_lok.cpp @@ -8,12 +8,12 @@ * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. - + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. diff --git a/engines/kyra/kyra_lok.h b/engines/kyra/kyra_lok.h index def5cbcf6f..a10b208389 100644 --- a/engines/kyra/kyra_lok.h +++ b/engines/kyra/kyra_lok.h @@ -8,12 +8,12 @@ * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. - + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. diff --git a/engines/kyra/kyra_mr.cpp b/engines/kyra/kyra_mr.cpp index 48ba96ec8b..834bda9454 100644 --- a/engines/kyra/kyra_mr.cpp +++ b/engines/kyra/kyra_mr.cpp @@ -8,12 +8,12 @@ * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. - + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. @@ -378,7 +378,6 @@ void KyraEngine_MR::playVQA(const char *name) { _screen->fadeToBlack(60); _screen->clearPage(0); - vqa.setDrawPage(0); vqa.play(); vqa.close(); diff --git a/engines/kyra/kyra_mr.h b/engines/kyra/kyra_mr.h index d194fedd4d..787dd4c936 100644 --- a/engines/kyra/kyra_mr.h +++ b/engines/kyra/kyra_mr.h @@ -8,12 +8,12 @@ * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. - + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. diff --git a/engines/kyra/kyra_rpg.cpp b/engines/kyra/kyra_rpg.cpp index 4f7adcc6e5..635559dcfd 100644 --- a/engines/kyra/kyra_rpg.cpp +++ b/engines/kyra/kyra_rpg.cpp @@ -8,12 +8,12 @@ * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. - + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. diff --git a/engines/kyra/kyra_rpg.h b/engines/kyra/kyra_rpg.h index cd36d2a5cd..69fc705ff2 100644 --- a/engines/kyra/kyra_rpg.h +++ b/engines/kyra/kyra_rpg.h @@ -8,12 +8,12 @@ * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. - + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. diff --git a/engines/kyra/kyra_v1.cpp b/engines/kyra/kyra_v1.cpp index 9194b64155..c8993fea47 100644 --- a/engines/kyra/kyra_v1.cpp +++ b/engines/kyra/kyra_v1.cpp @@ -8,12 +8,12 @@ * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. - + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. diff --git a/engines/kyra/kyra_v1.h b/engines/kyra/kyra_v1.h index cd048563ca..c801829855 100644 --- a/engines/kyra/kyra_v1.h +++ b/engines/kyra/kyra_v1.h @@ -8,12 +8,12 @@ * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. - + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. diff --git a/engines/kyra/kyra_v2.cpp b/engines/kyra/kyra_v2.cpp index 848fb18b6a..925dcf7bfe 100644 --- a/engines/kyra/kyra_v2.cpp +++ b/engines/kyra/kyra_v2.cpp @@ -8,12 +8,12 @@ * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. - + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. diff --git a/engines/kyra/kyra_v2.h b/engines/kyra/kyra_v2.h index 563416bf1e..f00c4635b5 100644 --- a/engines/kyra/kyra_v2.h +++ b/engines/kyra/kyra_v2.h @@ -8,12 +8,12 @@ * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. - + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. diff --git a/engines/kyra/lol.cpp b/engines/kyra/lol.cpp index 3695041b83..5500e8b95f 100644 --- a/engines/kyra/lol.cpp +++ b/engines/kyra/lol.cpp @@ -8,12 +8,12 @@ * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. - + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. diff --git a/engines/kyra/lol.h b/engines/kyra/lol.h index 4002346d31..e060b307af 100644 --- a/engines/kyra/lol.h +++ b/engines/kyra/lol.h @@ -8,12 +8,12 @@ * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. - + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. diff --git a/engines/kyra/magic_eob.cpp b/engines/kyra/magic_eob.cpp index 2180c5359d..a435850e54 100644 --- a/engines/kyra/magic_eob.cpp +++ b/engines/kyra/magic_eob.cpp @@ -8,12 +8,12 @@ * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. - + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. diff --git a/engines/kyra/resource.cpp b/engines/kyra/resource.cpp index c350c81742..3c801ee923 100644 --- a/engines/kyra/resource.cpp +++ b/engines/kyra/resource.cpp @@ -8,12 +8,12 @@ * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. - + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. @@ -74,10 +74,14 @@ bool Resource::reset() { loadProtectedFiles(list); } else { + // We only search in the game path to avoid any invalid PAK or + // APK files from being picked up. This might happen, for example, + // when the user has an Android package file in the CWD. + Common::FSDirectory gameDir(dir); Common::ArchiveMemberList files; - _files.listMatchingMembers(files, "*.PAK"); - _files.listMatchingMembers(files, "*.APK"); + gameDir.listMatchingMembers(files, "*.PAK"); + gameDir.listMatchingMembers(files, "*.APK"); for (Common::ArchiveMemberList::const_iterator i = files.begin(); i != files.end(); ++i) { Common::String name = (*i)->getName(); diff --git a/engines/kyra/resource.h b/engines/kyra/resource.h index 5c179a7864..3ab08a4c7c 100644 --- a/engines/kyra/resource.h +++ b/engines/kyra/resource.h @@ -8,12 +8,12 @@ * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. - + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. @@ -566,50 +566,50 @@ enum KyraResources { kEoB2IntroStrings, kEoB2IntroCPSFiles, - kEob2IntroAnimData00, - kEob2IntroAnimData01, - kEob2IntroAnimData02, - kEob2IntroAnimData03, - kEob2IntroAnimData04, - kEob2IntroAnimData05, - kEob2IntroAnimData06, - kEob2IntroAnimData07, - kEob2IntroAnimData08, - kEob2IntroAnimData09, - kEob2IntroAnimData10, - kEob2IntroAnimData11, - kEob2IntroAnimData12, - kEob2IntroAnimData13, - kEob2IntroAnimData14, - kEob2IntroAnimData15, - kEob2IntroAnimData16, - kEob2IntroAnimData17, - kEob2IntroAnimData18, - kEob2IntroAnimData19, - kEob2IntroAnimData20, - kEob2IntroAnimData21, - kEob2IntroAnimData22, - kEob2IntroAnimData23, - kEob2IntroAnimData24, - kEob2IntroAnimData25, - kEob2IntroAnimData26, - kEob2IntroAnimData27, - kEob2IntroAnimData28, - kEob2IntroAnimData29, - kEob2IntroAnimData30, - kEob2IntroAnimData31, - kEob2IntroAnimData32, - kEob2IntroAnimData33, - kEob2IntroAnimData34, - kEob2IntroAnimData35, - kEob2IntroAnimData36, - kEob2IntroAnimData37, - kEob2IntroAnimData38, - kEob2IntroAnimData39, - kEob2IntroAnimData40, - kEob2IntroAnimData41, - kEob2IntroAnimData42, - kEob2IntroAnimData43, + kEoB2IntroAnimData00, + kEoB2IntroAnimData01, + kEoB2IntroAnimData02, + kEoB2IntroAnimData03, + kEoB2IntroAnimData04, + kEoB2IntroAnimData05, + kEoB2IntroAnimData06, + kEoB2IntroAnimData07, + kEoB2IntroAnimData08, + kEoB2IntroAnimData09, + kEoB2IntroAnimData10, + kEoB2IntroAnimData11, + kEoB2IntroAnimData12, + kEoB2IntroAnimData13, + kEoB2IntroAnimData14, + kEoB2IntroAnimData15, + kEoB2IntroAnimData16, + kEoB2IntroAnimData17, + kEoB2IntroAnimData18, + kEoB2IntroAnimData19, + kEoB2IntroAnimData20, + kEoB2IntroAnimData21, + kEoB2IntroAnimData22, + kEoB2IntroAnimData23, + kEoB2IntroAnimData24, + kEoB2IntroAnimData25, + kEoB2IntroAnimData26, + kEoB2IntroAnimData27, + kEoB2IntroAnimData28, + kEoB2IntroAnimData29, + kEoB2IntroAnimData30, + kEoB2IntroAnimData31, + kEoB2IntroAnimData32, + kEoB2IntroAnimData33, + kEoB2IntroAnimData34, + kEoB2IntroAnimData35, + kEoB2IntroAnimData36, + kEoB2IntroAnimData37, + kEoB2IntroAnimData38, + kEoB2IntroAnimData39, + kEoB2IntroAnimData40, + kEoB2IntroAnimData41, + kEoB2IntroAnimData42, + kEoB2IntroAnimData43, kEoB2IntroShapes00, kEoB2IntroShapes01, kEoB2IntroShapes04, @@ -618,27 +618,27 @@ enum KyraResources { kEoB2FinaleStrings, kEoB2CreditsData, kEoB2FinaleCPSFiles, - kEob2FinaleAnimData00, - kEob2FinaleAnimData01, - kEob2FinaleAnimData02, - kEob2FinaleAnimData03, - kEob2FinaleAnimData04, - kEob2FinaleAnimData05, - kEob2FinaleAnimData06, - kEob2FinaleAnimData07, - kEob2FinaleAnimData08, - kEob2FinaleAnimData09, - kEob2FinaleAnimData10, - kEob2FinaleAnimData11, - kEob2FinaleAnimData12, - kEob2FinaleAnimData13, - kEob2FinaleAnimData14, - kEob2FinaleAnimData15, - kEob2FinaleAnimData16, - kEob2FinaleAnimData17, - kEob2FinaleAnimData18, - kEob2FinaleAnimData19, - kEob2FinaleAnimData20, + kEoB2FinaleAnimData00, + kEoB2FinaleAnimData01, + kEoB2FinaleAnimData02, + kEoB2FinaleAnimData03, + kEoB2FinaleAnimData04, + kEoB2FinaleAnimData05, + kEoB2FinaleAnimData06, + kEoB2FinaleAnimData07, + kEoB2FinaleAnimData08, + kEoB2FinaleAnimData09, + kEoB2FinaleAnimData10, + kEoB2FinaleAnimData11, + kEoB2FinaleAnimData12, + kEoB2FinaleAnimData13, + kEoB2FinaleAnimData14, + kEoB2FinaleAnimData15, + kEoB2FinaleAnimData16, + kEoB2FinaleAnimData17, + kEoB2FinaleAnimData18, + kEoB2FinaleAnimData19, + kEoB2FinaleAnimData20, kEoB2FinaleShapes00, kEoB2FinaleShapes03, kEoB2FinaleShapes07, diff --git a/engines/kyra/resource_intern.cpp b/engines/kyra/resource_intern.cpp index 4c413487ff..9ec955477f 100644 --- a/engines/kyra/resource_intern.cpp +++ b/engines/kyra/resource_intern.cpp @@ -8,12 +8,12 @@ * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. - + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. diff --git a/engines/kyra/resource_intern.h b/engines/kyra/resource_intern.h index e63eab7d6a..530df51f35 100644 --- a/engines/kyra/resource_intern.h +++ b/engines/kyra/resource_intern.h @@ -8,12 +8,12 @@ * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. - + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. diff --git a/engines/kyra/saveload.cpp b/engines/kyra/saveload.cpp index bacfb62c16..2ae6420bd7 100644 --- a/engines/kyra/saveload.cpp +++ b/engines/kyra/saveload.cpp @@ -8,12 +8,12 @@ * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. - + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. diff --git a/engines/kyra/saveload_eob.cpp b/engines/kyra/saveload_eob.cpp index aa223414bc..cca8f3a0a4 100644 --- a/engines/kyra/saveload_eob.cpp +++ b/engines/kyra/saveload_eob.cpp @@ -8,12 +8,12 @@ * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. - + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. diff --git a/engines/kyra/saveload_hof.cpp b/engines/kyra/saveload_hof.cpp index 1d28b6bc13..e8e76143bd 100644 --- a/engines/kyra/saveload_hof.cpp +++ b/engines/kyra/saveload_hof.cpp @@ -8,12 +8,12 @@ * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. - + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. diff --git a/engines/kyra/saveload_lok.cpp b/engines/kyra/saveload_lok.cpp index f8cca1ab7b..1d729d0103 100644 --- a/engines/kyra/saveload_lok.cpp +++ b/engines/kyra/saveload_lok.cpp @@ -8,12 +8,12 @@ * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. - + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. diff --git a/engines/kyra/saveload_lol.cpp b/engines/kyra/saveload_lol.cpp index 6c83ebd51b..e02b8fb22c 100644 --- a/engines/kyra/saveload_lol.cpp +++ b/engines/kyra/saveload_lol.cpp @@ -8,12 +8,12 @@ * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. - + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. diff --git a/engines/kyra/saveload_mr.cpp b/engines/kyra/saveload_mr.cpp index c49a528d02..a938003a07 100644 --- a/engines/kyra/saveload_mr.cpp +++ b/engines/kyra/saveload_mr.cpp @@ -8,12 +8,12 @@ * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. - + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. diff --git a/engines/kyra/saveload_rpg.cpp b/engines/kyra/saveload_rpg.cpp index d22c50dbeb..8f44960753 100644 --- a/engines/kyra/saveload_rpg.cpp +++ b/engines/kyra/saveload_rpg.cpp @@ -8,12 +8,12 @@ * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. - + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. diff --git a/engines/kyra/scene_eob.cpp b/engines/kyra/scene_eob.cpp index cfac5db8b3..84822c3fd2 100644 --- a/engines/kyra/scene_eob.cpp +++ b/engines/kyra/scene_eob.cpp @@ -8,12 +8,12 @@ * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. - + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. diff --git a/engines/kyra/scene_hof.cpp b/engines/kyra/scene_hof.cpp index 62690c4766..8ec14e4ac7 100644 --- a/engines/kyra/scene_hof.cpp +++ b/engines/kyra/scene_hof.cpp @@ -8,12 +8,12 @@ * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. - + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. diff --git a/engines/kyra/scene_lok.cpp b/engines/kyra/scene_lok.cpp index ea09091af7..df9b11d5a2 100644 --- a/engines/kyra/scene_lok.cpp +++ b/engines/kyra/scene_lok.cpp @@ -8,12 +8,12 @@ * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. - + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. diff --git a/engines/kyra/scene_lol.cpp b/engines/kyra/scene_lol.cpp index 154606d46f..391de5e49c 100644 --- a/engines/kyra/scene_lol.cpp +++ b/engines/kyra/scene_lol.cpp @@ -8,12 +8,12 @@ * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. - + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. @@ -620,14 +620,14 @@ void LoLEngine::updateCompass() { if (_compassStep) _compassStep -= (((ABS(_compassStep) >> 4) + 2) * dir); - int16 d = _compassBroken ? (int8(_rnd.getRandomNumber(255)) - _compassDirection) : (_currentDirection << 6) - _compassDirection; - if (d <= -128) - d += 256; - if (d >= 128) - d -= 256; + int16 diff = _compassBroken ? (int8(_rnd.getRandomNumber(255)) - _compassDirection) : (_currentDirection << 6) - _compassDirection; + if (diff <= -128) + diff += 256; + if (diff >= 128) + diff -= 256; - d >>= 2; - _compassStep += d; + diff >>= 2; + _compassStep += diff; _compassStep = CLIP(_compassStep, -24, 24); _compassDirection += _compassStep; @@ -636,14 +636,9 @@ void LoLEngine::updateCompass() { if (_compassDirection > 255) _compassDirection -= 256; - if ((_compassDirection >> 6) == _currentDirection && _compassStep < 2) { - int16 d2 = d >> 16; - d ^= d2; - d -= d2; - if (d < 4) { - _compassDirection = _currentDirection << 6; - _compassStep = 0; - } + if (((((_compassDirection + 3) & 0xFD) >> 6) == _currentDirection) && (_compassStep < 2) && (ABS(diff) < 4)) { + _compassDirection = _currentDirection << 6; + _compassStep = 0; } gui_drawCompass(); diff --git a/engines/kyra/scene_mr.cpp b/engines/kyra/scene_mr.cpp index d2b4907b6a..38ee25f54a 100644 --- a/engines/kyra/scene_mr.cpp +++ b/engines/kyra/scene_mr.cpp @@ -8,12 +8,12 @@ * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. - + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. diff --git a/engines/kyra/scene_rpg.cpp b/engines/kyra/scene_rpg.cpp index 927d891a5f..dabc368a27 100644 --- a/engines/kyra/scene_rpg.cpp +++ b/engines/kyra/scene_rpg.cpp @@ -8,12 +8,12 @@ * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. - + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. diff --git a/engines/kyra/scene_v1.cpp b/engines/kyra/scene_v1.cpp index 36798970e3..48958e5b90 100644 --- a/engines/kyra/scene_v1.cpp +++ b/engines/kyra/scene_v1.cpp @@ -8,12 +8,12 @@ * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. - + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. diff --git a/engines/kyra/scene_v2.cpp b/engines/kyra/scene_v2.cpp index 9b6897f2ab..e4258836bc 100644 --- a/engines/kyra/scene_v2.cpp +++ b/engines/kyra/scene_v2.cpp @@ -8,12 +8,12 @@ * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. - + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. diff --git a/engines/kyra/screen.cpp b/engines/kyra/screen.cpp index 8c97e46a8f..eaa074ff0a 100644 --- a/engines/kyra/screen.cpp +++ b/engines/kyra/screen.cpp @@ -8,12 +8,12 @@ * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. - + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. diff --git a/engines/kyra/screen.h b/engines/kyra/screen.h index 156b5b9a7c..31b77b4179 100644 --- a/engines/kyra/screen.h +++ b/engines/kyra/screen.h @@ -8,12 +8,12 @@ * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. - + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. diff --git a/engines/kyra/screen_eob.cpp b/engines/kyra/screen_eob.cpp index ae62e522e7..6c1bd572e1 100644 --- a/engines/kyra/screen_eob.cpp +++ b/engines/kyra/screen_eob.cpp @@ -8,12 +8,12 @@ * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. - + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. diff --git a/engines/kyra/screen_eob.h b/engines/kyra/screen_eob.h index 934483d146..3634ae1a39 100644 --- a/engines/kyra/screen_eob.h +++ b/engines/kyra/screen_eob.h @@ -8,12 +8,12 @@ * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. - + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. diff --git a/engines/kyra/screen_hof.cpp b/engines/kyra/screen_hof.cpp index b7de7988b8..a80d91381c 100644 --- a/engines/kyra/screen_hof.cpp +++ b/engines/kyra/screen_hof.cpp @@ -8,12 +8,12 @@ * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. - + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. diff --git a/engines/kyra/screen_hof.h b/engines/kyra/screen_hof.h index 95f461677d..1ad2b3c93d 100644 --- a/engines/kyra/screen_hof.h +++ b/engines/kyra/screen_hof.h @@ -8,12 +8,12 @@ * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. - + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. diff --git a/engines/kyra/screen_lok.cpp b/engines/kyra/screen_lok.cpp index f028f93294..57601104ad 100644 --- a/engines/kyra/screen_lok.cpp +++ b/engines/kyra/screen_lok.cpp @@ -8,12 +8,12 @@ * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. - + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. diff --git a/engines/kyra/screen_lok.h b/engines/kyra/screen_lok.h index 3cb92543e5..8f36ce7fb0 100644 --- a/engines/kyra/screen_lok.h +++ b/engines/kyra/screen_lok.h @@ -8,12 +8,12 @@ * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. - + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. diff --git a/engines/kyra/screen_lol.cpp b/engines/kyra/screen_lol.cpp index 16a77c8fcb..6dd6080923 100644 --- a/engines/kyra/screen_lol.cpp +++ b/engines/kyra/screen_lol.cpp @@ -8,12 +8,12 @@ * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. - + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. diff --git a/engines/kyra/screen_lol.h b/engines/kyra/screen_lol.h index 8ceb8431bc..91d663d34f 100644 --- a/engines/kyra/screen_lol.h +++ b/engines/kyra/screen_lol.h @@ -8,12 +8,12 @@ * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. - + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. diff --git a/engines/kyra/screen_mr.cpp b/engines/kyra/screen_mr.cpp index 337860db30..fa820a79eb 100644 --- a/engines/kyra/screen_mr.cpp +++ b/engines/kyra/screen_mr.cpp @@ -8,12 +8,12 @@ * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. - + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. diff --git a/engines/kyra/screen_mr.h b/engines/kyra/screen_mr.h index e10afcc5d2..ef982d4bcd 100644 --- a/engines/kyra/screen_mr.h +++ b/engines/kyra/screen_mr.h @@ -8,12 +8,12 @@ * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. - + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. diff --git a/engines/kyra/screen_v2.cpp b/engines/kyra/screen_v2.cpp index cc7d526ffe..eabcdb2393 100644 --- a/engines/kyra/screen_v2.cpp +++ b/engines/kyra/screen_v2.cpp @@ -8,12 +8,12 @@ * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. - + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. @@ -280,7 +280,7 @@ void Screen_v2::setTextColorMap(const uint8 *cmap) { void Screen_v2::wsaFrameAnimationStep(int x1, int y1, int x2, int y2, int w1, int h1, int w2, int h2, int srcPage, int dstPage, int dim) { - if (!(w1 || h1 || w2 || h2)) + if (!w1 || !h1 || !w2 || !h2) return; ScreenDim cdm = *getScreenDim(dim); diff --git a/engines/kyra/screen_v2.h b/engines/kyra/screen_v2.h index 6f4d67136a..06f7aa2d4a 100644 --- a/engines/kyra/screen_v2.h +++ b/engines/kyra/screen_v2.h @@ -8,12 +8,12 @@ * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. - + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. diff --git a/engines/kyra/script.cpp b/engines/kyra/script.cpp index 303cbb45aa..2452d7f41c 100644 --- a/engines/kyra/script.cpp +++ b/engines/kyra/script.cpp @@ -8,12 +8,12 @@ * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. - + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. diff --git a/engines/kyra/script.h b/engines/kyra/script.h index ccbe733e4d..12a44b0a03 100644 --- a/engines/kyra/script.h +++ b/engines/kyra/script.h @@ -8,12 +8,12 @@ * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. - + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. diff --git a/engines/kyra/script_eob.cpp b/engines/kyra/script_eob.cpp index 4a6a498173..455180b5e1 100644 --- a/engines/kyra/script_eob.cpp +++ b/engines/kyra/script_eob.cpp @@ -8,12 +8,12 @@ * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. - + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. diff --git a/engines/kyra/script_eob.h b/engines/kyra/script_eob.h index 8e2dbd8423..b996e314d5 100644 --- a/engines/kyra/script_eob.h +++ b/engines/kyra/script_eob.h @@ -8,17 +8,16 @@ * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. - + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * */ #ifdef ENABLE_EOB diff --git a/engines/kyra/script_hof.cpp b/engines/kyra/script_hof.cpp index f6fde65109..f86d0e96bc 100644 --- a/engines/kyra/script_hof.cpp +++ b/engines/kyra/script_hof.cpp @@ -8,12 +8,12 @@ * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. - + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. diff --git a/engines/kyra/script_lok.cpp b/engines/kyra/script_lok.cpp index 22d5e9fd7c..380d7d551f 100644 --- a/engines/kyra/script_lok.cpp +++ b/engines/kyra/script_lok.cpp @@ -8,12 +8,12 @@ * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. - + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. diff --git a/engines/kyra/script_lol.cpp b/engines/kyra/script_lol.cpp index 0bbe66f530..1a36527cdb 100644 --- a/engines/kyra/script_lol.cpp +++ b/engines/kyra/script_lol.cpp @@ -8,12 +8,12 @@ * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. - + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. diff --git a/engines/kyra/script_mr.cpp b/engines/kyra/script_mr.cpp index f656b162fd..5ba645f1be 100644 --- a/engines/kyra/script_mr.cpp +++ b/engines/kyra/script_mr.cpp @@ -8,12 +8,12 @@ * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. - + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. diff --git a/engines/kyra/script_tim.cpp b/engines/kyra/script_tim.cpp index ba0f62a2b4..e3b339cba6 100644 --- a/engines/kyra/script_tim.cpp +++ b/engines/kyra/script_tim.cpp @@ -8,12 +8,12 @@ * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. - + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. diff --git a/engines/kyra/script_tim.h b/engines/kyra/script_tim.h index aa512daae8..bd9c2645e5 100644 --- a/engines/kyra/script_tim.h +++ b/engines/kyra/script_tim.h @@ -8,12 +8,12 @@ * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. - + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. diff --git a/engines/kyra/script_v1.cpp b/engines/kyra/script_v1.cpp index aaa07e6d61..3ac174a5b9 100644 --- a/engines/kyra/script_v1.cpp +++ b/engines/kyra/script_v1.cpp @@ -8,12 +8,12 @@ * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. - + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. diff --git a/engines/kyra/script_v2.cpp b/engines/kyra/script_v2.cpp index c38a144537..179d388109 100644 --- a/engines/kyra/script_v2.cpp +++ b/engines/kyra/script_v2.cpp @@ -8,12 +8,12 @@ * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. - + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. diff --git a/engines/kyra/seqplayer.cpp b/engines/kyra/seqplayer.cpp index 1f9097d09d..e1794b2416 100644 --- a/engines/kyra/seqplayer.cpp +++ b/engines/kyra/seqplayer.cpp @@ -8,12 +8,12 @@ * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. - + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. diff --git a/engines/kyra/seqplayer.h b/engines/kyra/seqplayer.h index 12d94e3f6d..155ed82a4e 100644 --- a/engines/kyra/seqplayer.h +++ b/engines/kyra/seqplayer.h @@ -8,12 +8,12 @@ * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. - + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. diff --git a/engines/kyra/sequences_darkmoon.cpp b/engines/kyra/sequences_darkmoon.cpp index 03b15d6950..53a30d0079 100644 --- a/engines/kyra/sequences_darkmoon.cpp +++ b/engines/kyra/sequences_darkmoon.cpp @@ -8,12 +8,12 @@ * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. - + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. diff --git a/engines/kyra/sequences_eob.cpp b/engines/kyra/sequences_eob.cpp index 0fec386485..187295bd2c 100644 --- a/engines/kyra/sequences_eob.cpp +++ b/engines/kyra/sequences_eob.cpp @@ -8,12 +8,12 @@ * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. - + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. diff --git a/engines/kyra/sequences_hof.cpp b/engines/kyra/sequences_hof.cpp index 9fcce4eb55..942cf16502 100644 --- a/engines/kyra/sequences_hof.cpp +++ b/engines/kyra/sequences_hof.cpp @@ -8,12 +8,12 @@ * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. - + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. @@ -1651,7 +1651,7 @@ void SeqPlayer_HOF::displayHoFTalkieScrollText(uint8 *data, const ScreenDim *d, textData[1].text += strlen((char *)textData[1].text); textData[1].text[0] = textData[1].unk1; cnt--; - memcpy(&textData[1], &textData[2], cnt * sizeof(ScrollTextData)); + memmove(&textData[1], &textData[2], cnt * sizeof(ScrollTextData)); } if (palCycle) { diff --git a/engines/kyra/sequences_hof.h b/engines/kyra/sequences_hof.h index 2558a68a6a..12fa4ffbc2 100644 --- a/engines/kyra/sequences_hof.h +++ b/engines/kyra/sequences_hof.h @@ -8,12 +8,12 @@ * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. - + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. diff --git a/engines/kyra/sequences_lok.cpp b/engines/kyra/sequences_lok.cpp index 51f1ea51cf..8a41ee9a21 100644 --- a/engines/kyra/sequences_lok.cpp +++ b/engines/kyra/sequences_lok.cpp @@ -8,12 +8,12 @@ * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. - + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. diff --git a/engines/kyra/sequences_lol.cpp b/engines/kyra/sequences_lol.cpp index c8f97eb770..4c87ff1dd8 100644 --- a/engines/kyra/sequences_lol.cpp +++ b/engines/kyra/sequences_lol.cpp @@ -8,12 +8,12 @@ * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. - + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. diff --git a/engines/kyra/sequences_mr.cpp b/engines/kyra/sequences_mr.cpp index 76badb63f5..0ac6b636b8 100644 --- a/engines/kyra/sequences_mr.cpp +++ b/engines/kyra/sequences_mr.cpp @@ -8,12 +8,12 @@ * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. - + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. diff --git a/engines/kyra/sequences_v2.cpp b/engines/kyra/sequences_v2.cpp index e431e45f10..1bcbb7d874 100644 --- a/engines/kyra/sequences_v2.cpp +++ b/engines/kyra/sequences_v2.cpp @@ -8,12 +8,12 @@ * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. - + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. diff --git a/engines/kyra/sound.cpp b/engines/kyra/sound.cpp index cb6faf2580..3c3aff6ea9 100644 --- a/engines/kyra/sound.cpp +++ b/engines/kyra/sound.cpp @@ -8,12 +8,12 @@ * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. - + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. diff --git a/engines/kyra/sound_adlib.cpp b/engines/kyra/sound_adlib.cpp index 1d665709e5..f950f9d5aa 100644 --- a/engines/kyra/sound_adlib.cpp +++ b/engines/kyra/sound_adlib.cpp @@ -8,12 +8,12 @@ * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. - + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. @@ -24,12 +24,12 @@ * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. - + * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. - + * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA diff --git a/engines/kyra/sound_amiga.cpp b/engines/kyra/sound_amiga.cpp index 7292541594..598b5080a9 100644 --- a/engines/kyra/sound_amiga.cpp +++ b/engines/kyra/sound_amiga.cpp @@ -8,12 +8,12 @@ * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. - + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. diff --git a/engines/kyra/sound_digital.cpp b/engines/kyra/sound_digital.cpp index 518805c43e..a1600f6464 100644 --- a/engines/kyra/sound_digital.cpp +++ b/engines/kyra/sound_digital.cpp @@ -8,12 +8,12 @@ * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. - + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. diff --git a/engines/kyra/sound_lok.cpp b/engines/kyra/sound_lok.cpp index b2a9c2fd93..c356f2fb67 100644 --- a/engines/kyra/sound_lok.cpp +++ b/engines/kyra/sound_lok.cpp @@ -8,12 +8,12 @@ * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. - + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. diff --git a/engines/kyra/sound_lol.cpp b/engines/kyra/sound_lol.cpp index 7ac33967dd..8be0cb6ab9 100644 --- a/engines/kyra/sound_lol.cpp +++ b/engines/kyra/sound_lol.cpp @@ -8,12 +8,12 @@ * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. - + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. diff --git a/engines/kyra/sound_midi.cpp b/engines/kyra/sound_midi.cpp index fc6e92abd9..cd8bc2377c 100644 --- a/engines/kyra/sound_midi.cpp +++ b/engines/kyra/sound_midi.cpp @@ -8,12 +8,12 @@ * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. - + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. diff --git a/engines/kyra/sound_pcspk.cpp b/engines/kyra/sound_pcspk.cpp index 8664e2a22e..255d6b451a 100644 --- a/engines/kyra/sound_pcspk.cpp +++ b/engines/kyra/sound_pcspk.cpp @@ -8,12 +8,12 @@ * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. - + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. diff --git a/engines/kyra/sound_towns.cpp b/engines/kyra/sound_towns.cpp index af741a1ebe..725dedae3f 100644 --- a/engines/kyra/sound_towns.cpp +++ b/engines/kyra/sound_towns.cpp @@ -8,12 +8,12 @@ * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. - + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. @@ -225,6 +225,7 @@ void SoundTowns::playSoundEffect(uint8 track, uint8) { _driver->chanPanPos(_sfxChannel, 0x40); _driver->chanPitch(_sfxChannel, 0); _driver->playSoundEffect(_sfxChannel, note, 127, sfxPlaybackBuffer); + delete[] sfxPlaybackBuffer; } void SoundTowns::updateVolumeSettings() { @@ -537,7 +538,8 @@ bool SoundTownsPC98_v2::init() { // check if we have access to CD audio. Resource *r = _vm->resource(); if (_musicEnabled && - (r->exists("track1.mp3") || r->exists("track1.ogg") || r->exists("track1.flac") || r->exists("track1.fla"))) + (r->exists("track1.mp3") || r->exists("track1.ogg") || r->exists("track1.flac") || r->exists("track1.fla") + || r->exists("track01.mp3") || r->exists("track01.ogg") || r->exists("track01.flac") || r->exists("track01.fla"))) _musicEnabled = 2; else _musicEnabled = 1; diff --git a/engines/kyra/sprites.cpp b/engines/kyra/sprites.cpp index f4cebf6470..540191e678 100644 --- a/engines/kyra/sprites.cpp +++ b/engines/kyra/sprites.cpp @@ -8,12 +8,12 @@ * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. - + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. diff --git a/engines/kyra/sprites.h b/engines/kyra/sprites.h index 93cdcdbbcb..3319948707 100644 --- a/engines/kyra/sprites.h +++ b/engines/kyra/sprites.h @@ -8,12 +8,12 @@ * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. - + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. diff --git a/engines/kyra/sprites_eob.cpp b/engines/kyra/sprites_eob.cpp index b96f2eca08..5a82cf604c 100644 --- a/engines/kyra/sprites_eob.cpp +++ b/engines/kyra/sprites_eob.cpp @@ -8,12 +8,12 @@ * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. - + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. diff --git a/engines/kyra/sprites_lol.cpp b/engines/kyra/sprites_lol.cpp index 4d4d596bac..b9ffe6cbdb 100644 --- a/engines/kyra/sprites_lol.cpp +++ b/engines/kyra/sprites_lol.cpp @@ -8,12 +8,12 @@ * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. - + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. diff --git a/engines/kyra/sprites_rpg.cpp b/engines/kyra/sprites_rpg.cpp index 9c08bc8dd6..b190ad8f07 100644 --- a/engines/kyra/sprites_rpg.cpp +++ b/engines/kyra/sprites_rpg.cpp @@ -8,12 +8,12 @@ * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. - + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. diff --git a/engines/kyra/staticres.cpp b/engines/kyra/staticres.cpp index c52b0a04ad..9b3b92b9c7 100644 --- a/engines/kyra/staticres.cpp +++ b/engines/kyra/staticres.cpp @@ -8,12 +8,12 @@ * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. - + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. @@ -39,7 +39,7 @@ namespace Kyra { -#define RESFILE_VERSION 84 +#define RESFILE_VERSION 85 namespace { bool checkKyraDat(Common::SeekableReadStream *file) { @@ -1172,7 +1172,7 @@ void GUI_LoK::initStaticResource() { GUI_V1_MENU_ITEM(_menu[5].item[2], 1, 0, 0, 0, 0xA5, 0, 0x40, 0x80, 0x0F, 252, 253, 5, 0, 248, 249, 250, -1, 0, 0x10, 0x42, 0, 0); GUI_V1_MENU_ITEM(_menu[5].item[3], 1, 0, 0, 0, 0xA5, 0, 0x51, 0x80, 0x0F, 252, 253, 5, 0, 248, 249, 250, -1, 0, 0x10, 0x53, 0, 0); GUI_V1_MENU_ITEM(_menu[5].item[4], 1, 0, 0, 0, 0xA5, 0, 0x62, 0x80, 0x0F, 252, 253, 5, 0, 248, 249, 250, -1, 0, 0x10, 0x65, 0, 0); - GUI_V1_MENU_ITEM(_menu[5].item[5], 1, 0, 0, 0, -1, 0, 0x7F, 0x6C, 0x0F, 252, 253, -1, 255, 248, 249, 250, -1, -0, 0, 0, 0, 0); + GUI_V1_MENU_ITEM(_menu[5].item[5], 1, 0, 0, 0, -1, 0, 0x7F, 0x6C, 0x0F, 252, 253, -1, 255, 248, 249, 250, -1, 0, 0, 0, 0, 0); _menu[5].item[0].callback = BUTTON_FUNCTOR(GUI_LoK, this, &GUI_LoK::controlsChangeMusic); _menu[5].item[1].callback = BUTTON_FUNCTOR(GUI_LoK, this, &GUI_LoK::controlsChangeSounds); _menu[5].item[2].callback = BUTTON_FUNCTOR(GUI_LoK, this, &GUI_LoK::controlsChangeWalk); diff --git a/engines/kyra/staticres_eob.cpp b/engines/kyra/staticres_eob.cpp index e0a2862dea..54cc3066ec 100644 --- a/engines/kyra/staticres_eob.cpp +++ b/engines/kyra/staticres_eob.cpp @@ -8,17 +8,16 @@ * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. - + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * */ #include "kyra/eob.h" @@ -1207,7 +1206,7 @@ void DarkMoonEngine::initStaticResource() { _animIntro = new const DarkMoonAnimCommand*[44]; for (int i = 0; i < 44; i++) - _animIntro[i] = _staticres->loadEoB2SeqData(kEob2IntroAnimData00 + i, temp); + _animIntro[i] = _staticres->loadEoB2SeqData(kEoB2IntroAnimData00 + i, temp); _shapesIntro = new const DarkMoonShapeDef*[13]; memset(_shapesIntro, 0, sizeof(DarkMoonShapeDef *) * 13); @@ -1222,7 +1221,7 @@ void DarkMoonEngine::initStaticResource() { _animFinale = new const DarkMoonAnimCommand*[21]; for (int i = 0; i < 21; i++) - _animFinale[i] = _staticres->loadEoB2SeqData(kEob2FinaleAnimData00 + i, temp); + _animFinale[i] = _staticres->loadEoB2SeqData(kEoB2FinaleAnimData00 + i, temp); _shapesFinale = new const DarkMoonShapeDef*[13]; memset(_shapesFinale, 0, sizeof(DarkMoonShapeDef *) * 13); diff --git a/engines/kyra/staticres_lol.cpp b/engines/kyra/staticres_lol.cpp index c2cdcf9f51..9a4fc281d5 100644 --- a/engines/kyra/staticres_lol.cpp +++ b/engines/kyra/staticres_lol.cpp @@ -8,12 +8,12 @@ * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. - + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. diff --git a/engines/kyra/staticres_rpg.cpp b/engines/kyra/staticres_rpg.cpp index a30cbf7d05..671d3dfd1d 100644 --- a/engines/kyra/staticres_rpg.cpp +++ b/engines/kyra/staticres_rpg.cpp @@ -8,17 +8,16 @@ * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. - + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * */ #include "kyra/resource.h" diff --git a/engines/kyra/text.cpp b/engines/kyra/text.cpp index 2e3acffeb9..f88ba183ba 100644 --- a/engines/kyra/text.cpp +++ b/engines/kyra/text.cpp @@ -8,12 +8,12 @@ * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. - + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. diff --git a/engines/kyra/text.h b/engines/kyra/text.h index 199029469e..d5f423105e 100644 --- a/engines/kyra/text.h +++ b/engines/kyra/text.h @@ -8,12 +8,12 @@ * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. - + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. diff --git a/engines/kyra/text_hof.cpp b/engines/kyra/text_hof.cpp index f1933e9623..354eff03b9 100644 --- a/engines/kyra/text_hof.cpp +++ b/engines/kyra/text_hof.cpp @@ -8,12 +8,12 @@ * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. - + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. diff --git a/engines/kyra/text_hof.h b/engines/kyra/text_hof.h index 414d02fe4b..aacdc97d76 100644 --- a/engines/kyra/text_hof.h +++ b/engines/kyra/text_hof.h @@ -8,12 +8,12 @@ * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. - + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. diff --git a/engines/kyra/text_lok.cpp b/engines/kyra/text_lok.cpp index a557940868..1ca5644b9d 100644 --- a/engines/kyra/text_lok.cpp +++ b/engines/kyra/text_lok.cpp @@ -8,12 +8,12 @@ * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. - + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. diff --git a/engines/kyra/text_lol.cpp b/engines/kyra/text_lol.cpp index 6e77db1f8a..d8a36b954f 100644 --- a/engines/kyra/text_lol.cpp +++ b/engines/kyra/text_lol.cpp @@ -8,12 +8,12 @@ * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. - + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. diff --git a/engines/kyra/text_lol.h b/engines/kyra/text_lol.h index e2b10e8d4d..ad3efadcaf 100644 --- a/engines/kyra/text_lol.h +++ b/engines/kyra/text_lol.h @@ -8,12 +8,12 @@ * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. - + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. diff --git a/engines/kyra/text_mr.cpp b/engines/kyra/text_mr.cpp index 10b0880f29..685d5447cd 100644 --- a/engines/kyra/text_mr.cpp +++ b/engines/kyra/text_mr.cpp @@ -8,12 +8,12 @@ * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. - + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. diff --git a/engines/kyra/text_mr.h b/engines/kyra/text_mr.h index 957415490f..5b6a7cd192 100644 --- a/engines/kyra/text_mr.h +++ b/engines/kyra/text_mr.h @@ -8,12 +8,12 @@ * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. - + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. diff --git a/engines/kyra/text_rpg.cpp b/engines/kyra/text_rpg.cpp index 24c523c856..03acde8497 100644 --- a/engines/kyra/text_rpg.cpp +++ b/engines/kyra/text_rpg.cpp @@ -8,17 +8,16 @@ * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. - + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * */ #if defined(ENABLE_EOB) || defined(ENABLE_LOL) diff --git a/engines/kyra/text_rpg.h b/engines/kyra/text_rpg.h index eb8617a371..30d3463726 100644 --- a/engines/kyra/text_rpg.h +++ b/engines/kyra/text_rpg.h @@ -1,19 +1,19 @@ /* ScummVM - Graphic Adventure Engine * * ScummVM is the legal property of its developers, whose names - * are to numerous to list here. Please refer to the COPYRIGHT + * are too numerous to list here. Please refer to the COPYRIGHT * file distributed with this source distribution. * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. - + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. diff --git a/engines/kyra/timer.cpp b/engines/kyra/timer.cpp index 95c283f063..edca3ef5bf 100644 --- a/engines/kyra/timer.cpp +++ b/engines/kyra/timer.cpp @@ -8,12 +8,12 @@ * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. - + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. diff --git a/engines/kyra/timer.h b/engines/kyra/timer.h index 205be5957d..a753707b8a 100644 --- a/engines/kyra/timer.h +++ b/engines/kyra/timer.h @@ -8,12 +8,12 @@ * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. - + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. diff --git a/engines/kyra/timer_eob.cpp b/engines/kyra/timer_eob.cpp index f7a4e23006..c5290790e7 100644 --- a/engines/kyra/timer_eob.cpp +++ b/engines/kyra/timer_eob.cpp @@ -8,12 +8,12 @@ * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. - + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. @@ -347,7 +347,7 @@ void EoBCoreEngine::timerUpdateFoodStatus(int timerNum) { } void EoBCoreEngine::timerUpdateMonsterIdleAnim(int timerNum) { - for (int i = 0; i < 18; i++) { + for (int i = 0; i < 30; i++) { EoBMonsterInPlay *m = &_monsters[i]; if (m->mode == 7 || m->mode == 10 || (m->flags & 0x20) || (rollDice(1, 2, 0) != 1)) continue; diff --git a/engines/kyra/timer_hof.cpp b/engines/kyra/timer_hof.cpp index 96b14c28f5..bdfb93eebb 100644 --- a/engines/kyra/timer_hof.cpp +++ b/engines/kyra/timer_hof.cpp @@ -8,12 +8,12 @@ * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. - + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. diff --git a/engines/kyra/timer_lok.cpp b/engines/kyra/timer_lok.cpp index 13f5403618..b046e92988 100644 --- a/engines/kyra/timer_lok.cpp +++ b/engines/kyra/timer_lok.cpp @@ -8,12 +8,12 @@ * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. - + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. diff --git a/engines/kyra/timer_lol.cpp b/engines/kyra/timer_lol.cpp index 9d0cc0dd72..1326eea754 100644 --- a/engines/kyra/timer_lol.cpp +++ b/engines/kyra/timer_lol.cpp @@ -8,12 +8,12 @@ * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. - + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. diff --git a/engines/kyra/timer_mr.cpp b/engines/kyra/timer_mr.cpp index 7d8325cd05..58c75ac980 100644 --- a/engines/kyra/timer_mr.cpp +++ b/engines/kyra/timer_mr.cpp @@ -8,12 +8,12 @@ * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. - + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. diff --git a/engines/kyra/timer_rpg.cpp b/engines/kyra/timer_rpg.cpp index 02c2669436..b31c406480 100644 --- a/engines/kyra/timer_rpg.cpp +++ b/engines/kyra/timer_rpg.cpp @@ -8,12 +8,12 @@ * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. - + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. diff --git a/engines/kyra/util.cpp b/engines/kyra/util.cpp index f71978d03e..325f29ebd7 100644 --- a/engines/kyra/util.cpp +++ b/engines/kyra/util.cpp @@ -8,12 +8,12 @@ * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. - + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. diff --git a/engines/kyra/util.h b/engines/kyra/util.h index b91f84ad36..130768f89d 100644 --- a/engines/kyra/util.h +++ b/engines/kyra/util.h @@ -8,12 +8,12 @@ * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. - + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. diff --git a/engines/kyra/vqa.cpp b/engines/kyra/vqa.cpp index 081d94a050..fb51c05e51 100644 --- a/engines/kyra/vqa.cpp +++ b/engines/kyra/vqa.cpp @@ -8,12 +8,12 @@ * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. - + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. @@ -28,644 +28,606 @@ // // The jung2.vqa movie does work, but only thanks to a grotesque hack. - +#include "kyra/kyra_v1.h" #include "kyra/vqa.h" -#include "kyra/resource.h" - -#include "common/system.h" +#include "kyra/screen.h" #include "audio/audiostream.h" -#include "audio/mixer.h" #include "audio/decoders/raw.h" -namespace Kyra { - -VQAMovie::VQAMovie(KyraEngine_v1 *vm, OSystem *system) { - _system = system; - _vm = vm; - _screen = _vm->screen(); - _opened = false; - _x = _y = _drawPage = -1; - _frame = 0; - _vectorPointers = 0; - _numPartialCodeBooks = 0; - _partialCodeBookSize = 0; - _compressedCodeBook = 0; - _partialCodeBook = 0; - _codeBook = 0; - _frameInfo = 0; - memset(_buffers, 0, sizeof(_buffers)); -} - -VQAMovie::~VQAMovie() { - close(); -} - -void VQAMovie::initBuffers() { - for (int i = 0; i < ARRAYSIZE(_buffers); i++) { - _buffers[i].data = 0; - _buffers[i].size = 0; - } -} - -void *VQAMovie::allocBuffer(int num, uint32 size) { - assert(num >= 0 && num < ARRAYSIZE(_buffers)); - assert(size > 0); - - if (size > _buffers[num].size) { - /* - * We could use realloc() here, but we don't actually need the - * old contents of the buffer. - */ - delete[] _buffers[num].data; - _buffers[num].data = new uint8[size]; - _buffers[num].size = size; - } - - assert(_buffers[num].data); +#include "common/system.h" +#include "common/events.h" - return _buffers[num].data; -} +#include "graphics/palette.h" +#include "graphics/surface.h" -void VQAMovie::freeBuffers() { - for (int i = 0; i < ARRAYSIZE(_buffers); i++) { - delete[] _buffers[i].data; - _buffers[i].data = NULL; - _buffers[i].size = 0; - } -} +namespace Kyra { -uint32 VQAMovie::readTag() { +static uint32 readTag(Common::SeekableReadStream *stream) { // Some tags have to be on an even offset, so they are padded with a // zero byte. Skip that. - uint32 tag = _file->readUint32BE(); + uint32 tag = stream->readUint32BE(); - if (_file->eos()) + if (stream->eos()) return 0; if (!(tag & 0xFF000000)) { - tag = (tag << 8) | _file->readByte(); + tag = (tag << 8) | stream->readByte(); } return tag; } -void VQAMovie::decodeSND1(byte *inbuf, uint32 insize, byte *outbuf, uint32 outsize) { - const int8 WSTable2Bit[] = { -2, -1, 0, 1 }; - const int8 WSTable4Bit[] = { - -9, -8, -6, -5, -4, -3, -2, -1, - 0, 1, 2, 3, 4, 5, 6, 8 - }; - - byte code; - int8 count; - uint16 input; - - int16 curSample = 0x80; - - while (outsize > 0) { - input = *inbuf++ << 2; - code = (input >> 8) & 0xFF; - count = (input & 0xFF) >> 2; - - switch (code) { - case 2: - if (count & 0x20) { - /* NOTE: count is signed! */ - count <<= 3; - curSample += (count >> 3); - *outbuf++ = curSample; - outsize--; - } else { - for (; count >= 0; count--) { - *outbuf++ = *inbuf++; - outsize--; - } - curSample = *(outbuf - 1); - } - break; - case 1: - for (; count >= 0; count--) { - code = *inbuf++; - - curSample += WSTable4Bit[code & 0x0F]; - curSample = CLIP<int16>(curSample, 0, 255); - *outbuf++ = curSample; - - curSample += WSTable4Bit[code >> 4]; - curSample = CLIP<int16>(curSample, 0, 255); - *outbuf++ = curSample; - - outsize -= 2; - } - break; - case 0: - for (; count >= 0; count--) { - code = *inbuf++; - - curSample += WSTable2Bit[code & 0x03]; - curSample = CLIP<int16>(curSample, 0, 255); - *outbuf++ = curSample; - - curSample += WSTable2Bit[(code >> 2) & 0x03]; - curSample = CLIP<int16>(curSample, 0, 255); - *outbuf++ = curSample; - - curSample += WSTable2Bit[(code >> 4) & 0x03]; - curSample = CLIP<int16>(curSample, 0, 255); - *outbuf++ = curSample; - - curSample += WSTable2Bit[(code >> 6) & 0x03]; - curSample = CLIP<int16>(curSample, 0, 255); - *outbuf++ = curSample; - - outsize -= 4; - } - break; - default: - for (; count >= 0; count--) { - *outbuf++ = curSample; - outsize--; - } - } - } +VQADecoder::VQADecoder() { + memset(&_header, 0, sizeof(_header)); } -bool VQAMovie::open(const char *filename) { +VQADecoder::~VQADecoder() { close(); + delete[] _frameInfo; +} - _file = _vm->resource()->createReadStream(filename); - if (!_file) - return false; +bool VQADecoder::loadStream(Common::SeekableReadStream *stream) { + close(); + _fileStream = stream; - if (_file->readUint32BE() != MKTAG('F','O','R','M')) { - warning("VQAMovie::open: Cannot find `FORM' tag"); + if (_fileStream->readUint32BE() != MKTAG('F','O','R','M')) { + warning("VQADecoder::loadStream(): Cannot find `FORM' tag"); return false; } - // For now, we ignore the size of the FORM chunk. - _file->readUint32BE(); + // Ignore the size of the FORM chunk. We're only interested in its + // children. + _fileStream->readUint32BE(); - if (_file->readUint32BE() != MKTAG('W','V','Q','A')) { - warning("WQAMovie::open: Cannot find `WVQA' tag"); + if (_fileStream->readUint32BE() != MKTAG('W','V','Q','A')) { + warning("VQADecoder::loadStream(): Cannot find `WVQA' tag"); return false; } - bool foundHeader = false; - bool foundFrameInfo = false; + // We want to find both a VQHD chunk containing the header, and a FINF + // chunk containing the frame offsets. + + bool foundVQHD = false; + bool foundFINF = false; + + VQAAudioTrack *audioTrack = NULL; // The information we need is stored in two chunks: VQHD and FINF. We // need both of them before we can begin decoding the movie. - while (!foundHeader || !foundFrameInfo) { - uint32 tag = readTag(); - uint32 size = _file->readUint32BE(); + while (!foundVQHD || !foundFINF) { + uint32 tag = readTag(stream); + uint32 size = _fileStream->readUint32BE(); switch (tag) { - case MKTAG('V','Q','H','D'): // VQA header - _header.version = _file->readUint16LE(); - _header.flags = _file->readUint16LE(); - _header.numFrames = _file->readUint16LE(); - _header.width = _file->readUint16LE(); - _header.height = _file->readUint16LE(); - _header.blockW = _file->readByte(); - _header.blockH = _file->readByte(); - _header.frameRate = _file->readByte(); - _header.cbParts = _file->readByte(); - _header.colors = _file->readUint16LE(); - _header.maxBlocks = _file->readUint16LE(); - _header.unk1 = _file->readUint32LE(); - _header.unk2 = _file->readUint16LE(); - _header.freq = _file->readUint16LE(); - _header.channels = _file->readByte(); - _header.bits = _file->readByte(); - _header.unk3 = _file->readUint32LE(); - _header.unk4 = _file->readUint16LE(); - _header.maxCBFZSize = _file->readUint32LE(); - _header.unk5 = _file->readUint32LE(); - - // Kyrandia 3 uses version 1 VQA files, and is the only - // known game to do so. This version of the format has - // some implicit default values. - - if (_header.version == 1) { - if (_header.freq == 0) - _header.freq = 22050; - if (_header.channels == 0) - _header.channels = 1; - if (_header.bits == 0) - _header.bits = 8; - } - - _x = (Screen::SCREEN_W - _header.width) / 2; - _y = (Screen::SCREEN_H - _header.height) / 2; - - _frameInfo = new uint32[_header.numFrames]; - _frame = new byte[_header.width * _header.height]; - - _codeBookSize = 0xF00 * _header.blockW * _header.blockH; - _codeBook = new byte[_codeBookSize]; - _partialCodeBook = new byte[_codeBookSize]; - memset(_codeBook, 0, _codeBookSize); - memset(_partialCodeBook, 0, _codeBookSize); - - _numVectorPointers = (_header.width / _header.blockW) * (_header.height * _header.blockH); - _vectorPointers = new uint16[_numVectorPointers]; - memset(_vectorPointers, 0, _numVectorPointers * sizeof(uint16)); - - _partialCodeBookSize = 0; - _numPartialCodeBooks = 0; - + case MKTAG('V','Q','H','D'): + handleVQHD(_fileStream); if (_header.flags & 1) { - // This VQA movie has sound. Kyrandia 3 uses - // 8-bit sound, and so far testing indicates - // that it's all mono. - // - // This is good, because it means we won't have - // to worry about the confusing parts of the - // VQA spec, where 8- and 16-bit data have - // different signedness and stereo sample - // layout varies between different games. - - assert(_header.bits == 8); - assert(_header.channels == 1); - - _stream = Audio::makeQueuingAudioStream(_header.freq, false); - } else { - _stream = NULL; + audioTrack = new VQAAudioTrack(&_header); + addTrack(audioTrack); } - - foundHeader = true; + foundVQHD = true; break; - - case MKTAG('F','I','N','F'): // Frame info - if (!foundHeader) { - warning("VQAMovie::open: Found `FINF' before `VQHD'"); + case MKTAG('F','I','N','F'): + if (!foundVQHD) { + warning("VQADecoder::loadStream(): Found `FINF' before `VQHD'"); return false; } - - if (size != 4 * (uint32)_header.numFrames) { - warning("VQAMovie::open: Expected size %d for `FINF' chunk, but got %u", 4 * _header.numFrames, size); + if (size != 4 * getFrameCount()) { + warning("VQADecoder::loadStream(): Expected size %d for `FINF' chunk, but got %u", 4 * getFrameCount(), size); return false; } + handleFINF(_fileStream); + foundFINF = true; + break; + default: + warning("VQADecoder::loadStream(): Unknown tag `%s'", tag2str(tag)); + _fileStream->seek(size, SEEK_CUR); + break; + } + } - foundFrameInfo = true; + return true; +} - for (int i = 0; i < _header.numFrames; i++) { - _frameInfo[i] = 2 * _file->readUint32LE(); - } +void VQADecoder::handleVQHD(Common::SeekableReadStream *stream) { + _header.version = stream->readUint16LE(); + _header.flags = stream->readUint16LE(); + _header.numFrames = stream->readUint16LE(); + _header.width = stream->readUint16LE(); + _header.height = stream->readUint16LE(); + _header.blockW = stream->readByte(); + _header.blockH = stream->readByte(); + _header.frameRate = stream->readByte(); + _header.cbParts = stream->readByte(); + _header.colors = stream->readUint16LE(); + _header.maxBlocks = stream->readUint16LE(); + _header.unk1 = stream->readUint32LE(); + _header.unk2 = stream->readUint16LE(); + _header.freq = stream->readUint16LE(); + _header.channels = stream->readByte(); + _header.bits = stream->readByte(); + _header.unk3 = stream->readUint32LE(); + _header.unk4 = stream->readUint16LE(); + _header.maxCBFZSize = stream->readUint32LE(); + _header.unk5 = stream->readUint32LE(); + + _frameInfo = new uint32[_header.numFrames + 1]; + + VQAVideoTrack *videoTrack = new VQAVideoTrack(&_header); + addTrack(videoTrack); + + // Kyrandia 3 uses version 1 VQA files, and is the only known game to + // do so. This version of the format has some implicit default values. + + if (_header.version == 1) { + if (_header.freq == 0) + _header.freq = 22050; + if (_header.channels == 0) + _header.channels = 1; + if (_header.bits == 0) + _header.bits = 8; + } - // HACK: This flag is set in jung2.vqa, and its - // purpose, if it has one, is unknown. It can't be a - // general purpose flag, because in large movies the - // frame offsets can be large enough to set this flag, - // though of course never for the first frame. - // - // At least in my copy of Kyrandia 3, _frameInfo[0] is - // 0x81000098, and the desired index is 0x4716. So the - // value should be 0x80004716, but I don't want to - // hard-code it. Instead, scan the file for the offset - // to the first VQFR chunk. - - if (_frameInfo[0] & 0x01000000) { - uint32 oldPos = _file->pos(); - - while (1) { - uint32 scanTag = readTag(); - uint32 scanSize = _file->readUint32BE(); - - if (_file->eos()) - break; - - if (scanTag == MKTAG('V','Q','F','R')) { - _frameInfo[0] = (_file->pos() - 8) | 0x80000000; - break; - } + if (_header.flags & 1) { + // Kyrandia 3 uses 8-bit sound, and so far testing indicates + // that it's all mono. + // + // This is good, because it means we won't have to worry about + // the confusing parts of the VQA spec, where 8- and 16-bit + // data have different signedness and stereo sample layout + // varies between different games. + + assert(_header.bits == 8); + assert(_header.channels == 1); + } +} - _file->seek(scanSize, SEEK_CUR); - } +void VQADecoder::handleFINF(Common::SeekableReadStream *stream) { + for (int i = 0; i < _header.numFrames; i++) { + _frameInfo[i] = 2 * stream->readUint32LE(); + } - _file->seek(oldPos); - } + // HACK: This flag is set in jung2.vqa, and its purpose - if it has + // one - is currently unknown. It can't be a general purpose flag, + // because in large movies the frame offset can be large enough to + // set this flag, though of course never for the first frame. + // + // At least in my copy of Kyrandia 3, _frameInfo[0] is 0x81000098, and + // the desired index is 0x4716. So the value should be 0x80004716, but + // I don't want to hard-code it. Instead, scan the file for the offset + // to the first VQFR chunk. - break; + if (_frameInfo[0] & 0x01000000) { + uint32 oldPos = stream->pos(); - default: - warning("VQAMovie::open: Unknown tag `%c%c%c%c'", char((tag >> 24) & 0xFF), char((tag >> 16) & 0xFF), char((tag >> 8) & 0xFF), char(tag & 0xFF)); - _file->seek(size, SEEK_CUR); - } - } + while (1) { + uint32 scanTag = readTag(stream); + uint32 scanSize = stream->readUint32BE(); + + if (stream->eos()) + break; - initBuffers(); + if (scanTag == MKTAG('V','Q','F','R')) { + _frameInfo[0] = (stream->pos() - 8) | 0x80000000; + break; + } - _opened = true; - return true; -} + stream->seek(scanSize, SEEK_CUR); + } -void VQAMovie::close() { - if (_opened) { - delete[] _frameInfo; - delete[] _frame; - delete[] _codeBook; - delete[] _partialCodeBook; - delete[] _vectorPointers; - - if (_vm->_mixer->isSoundHandleActive(_sound)) - _vm->_mixer->stopHandle(_sound); - - _frameInfo = NULL; - _frame = NULL; - _codeBookSize = 0; - _codeBook = NULL; - _partialCodeBook = NULL; - _vectorPointers = NULL; - _stream = NULL; - - delete _file; - _file = 0; - - freeBuffers(); - - _opened = false; + stream->seek(oldPos); } + + _frameInfo[_header.numFrames] = 0x7FFFFFFF; } -void VQAMovie::displayFrame(uint frameNum) { - if (frameNum >= _header.numFrames || !_opened) - return; +void VQADecoder::readNextPacket() { + VQAVideoTrack *videoTrack = (VQAVideoTrack *)getTrack(0); + VQAAudioTrack *audioTrack = (VQAAudioTrack *)getTrack(1); - bool foundSound = !_stream; - bool foundFrame = false; - uint i; + assert(videoTrack); - _file->seek(_frameInfo[frameNum] & 0x7FFFFFFF); + int curFrame = videoTrack->getCurFrame(); - while (!foundSound || !foundFrame) { - uint32 tag = readTag(); - uint32 size = _file->readUint32BE(); + // Stop if reading the tag is enough to put us ahead of the next frame + int32 end = (_frameInfo[curFrame + 1] & 0x7FFFFFFF) - 7; - if (_file->eos()) { - // This happens at the last frame. Apparently it has - // no sound? - break; + // At this point, we probably only need to adjust for the offset in the + // stream to be even. But we may as well do this to really make sure + // we have the correct offset. + if (curFrame >= 0) { + _fileStream->seek(_frameInfo[curFrame] & 0x7FFFFFFF); + if (_frameInfo[curFrame] & 0x80000000) { + videoTrack->setHasDirtyPalette(); } + } - byte *inbuf, *outbuf; - uint32 insize, outsize; - int32 end; + while (!_fileStream->eos() && _fileStream->pos() < end) { + uint32 tag = readTag(_fileStream); + uint32 size; switch (tag) { case MKTAG('S','N','D','0'): // Uncompressed sound - foundSound = true; - inbuf = (byte *)malloc(size); - _file->read(inbuf, size); - assert(_stream); - _stream->queueBuffer(inbuf, size, DisposeAfterUse::YES, Audio::FLAG_UNSIGNED); + assert(audioTrack); + audioTrack->handleSND0(_fileStream); break; - case MKTAG('S','N','D','1'): // Compressed sound, almost like AUD - foundSound = true; - outsize = _file->readUint16LE(); - insize = _file->readUint16LE(); - - inbuf = (byte *)malloc(insize); - _file->read(inbuf, insize); - - if (insize == outsize) { - assert(_stream); - _stream->queueBuffer(inbuf, insize, DisposeAfterUse::YES, Audio::FLAG_UNSIGNED); - } else { - outbuf = (byte *)malloc(outsize); - decodeSND1(inbuf, insize, outbuf, outsize); - assert(_stream); - _stream->queueBuffer(outbuf, outsize, DisposeAfterUse::YES, Audio::FLAG_UNSIGNED); - free(inbuf); - } + assert(audioTrack); + audioTrack->handleSND1(_fileStream); break; - case MKTAG('S','N','D','2'): // Compressed sound - foundSound = true; - warning("VQAMovie::displayFrame: `SND2' is not implemented"); - _file->seek(size, SEEK_CUR); + assert(audioTrack); + audioTrack->handleSND2(_fileStream); break; - case MKTAG('V','Q','F','R'): - foundFrame = true; - end = _file->pos() + size - 8; - - while (_file->pos() < end) { - tag = readTag(); - size = _file->readUint32BE(); - - switch (tag) { - case MKTAG('C','B','F','0'): // Full codebook - _file->read(_codeBook, size); - break; + videoTrack->handleVQFR(_fileStream); + break; + case MKTAG('C','M','D','S'): + // The purpose of this is unknown, but it's known to + // exist so don't warn about it. + size = _fileStream->readUint32BE(); + _fileStream->seek(size, SEEK_CUR); + break; + default: + warning("VQADecoder::readNextPacket(): Unknown tag `%s'", tag2str(tag)); + size = _fileStream->readUint32BE(); + _fileStream->seek(size, SEEK_CUR); + break; + } + } +} - case MKTAG('C','B','F','Z'): // Full codebook - inbuf = (byte *)allocBuffer(0, size); - _file->read(inbuf, size); - Screen::decodeFrame4(inbuf, _codeBook, _codeBookSize); - break; +// ----------------------------------------------------------------------- - case MKTAG('C','B','P','0'): // Partial codebook - _compressedCodeBook = false; - _file->read(_partialCodeBook + _partialCodeBookSize, size); - _partialCodeBookSize += size; - _numPartialCodeBooks++; - break; +VQADecoder::VQAAudioTrack::VQAAudioTrack(const VQAHeader *header) { + _audioStream = Audio::makeQueuingAudioStream(header->freq, false); +} - case MKTAG('C','B','P','Z'): // Partial codebook - _compressedCodeBook = true; - _file->read(_partialCodeBook + _partialCodeBookSize, size); - _partialCodeBookSize += size; - _numPartialCodeBooks++; - break; +VQADecoder::VQAAudioTrack::~VQAAudioTrack() { + delete _audioStream; +} - case MKTAG('C','P','L','0'): // Palette - assert(size <= 3 * 256); - _file->read(_screen->getPalette(0).getData(), size); - break; +Audio::AudioStream *VQADecoder::VQAAudioTrack::getAudioStream() const { + return _audioStream; +} - case MKTAG('C','P','L','Z'): // Palette - inbuf = (byte *)allocBuffer(0, size); - _file->read(inbuf, size); - Screen::decodeFrame4(inbuf, _screen->getPalette(0).getData(), 768); - break; +void VQADecoder::VQAAudioTrack::handleSND0(Common::SeekableReadStream *stream) { + uint32 size = stream->readUint32BE(); + byte *buf = (byte *)malloc(size); + stream->read(buf, size); + _audioStream->queueBuffer(buf, size, DisposeAfterUse::YES, Audio::FLAG_UNSIGNED); +} - case MKTAG('V','P','T','0'): // Frame data - assert(size / 2 <= _numVectorPointers); +void VQADecoder::VQAAudioTrack::handleSND1(Common::SeekableReadStream *stream) { + stream->readUint32BE(); + uint16 outsize = stream->readUint16LE(); + uint16 insize = stream->readUint16LE(); + byte *inbuf = (byte *)malloc(insize); + + stream->read(inbuf, insize); + + if (insize == outsize) { + _audioStream->queueBuffer(inbuf, insize, DisposeAfterUse::YES, Audio::FLAG_UNSIGNED); + } else { + const int8 WSTable2Bit[] = { -2, -1, 0, 1 }; + const int8 WSTable4Bit[] = { + -9, -8, -6, -5, -4, -3, -2, -1, + 0, 1, 2, 3, 4, 5, 6, 8 + }; + + byte *outbuf = (byte *)malloc(outsize); + byte *in = inbuf; + byte *out = outbuf; + int16 curSample = 0x80; + uint16 bytesLeft = outsize; + + while (bytesLeft > 0) { + uint16 input = *in++ << 2; + byte code = (input >> 8) & 0xFF; + int8 count = (input & 0xFF) >> 2; + int i; + + switch (code) { + case 2: + if (count & 0x20) { + /* NOTE: count is signed! */ + count <<= 3; + curSample += (count >> 3); + *out++ = curSample; + bytesLeft--; + } else { + for (; count >= 0; count--) { + *out++ = *in++; + bytesLeft--; + } + curSample = *(out - 1); + } + break; + case 1: + for (; count >= 0; count--) { + code = *in++; - for (i = 0; i < size / 2; i++) - _vectorPointers[i] = _file->readUint16LE(); - break; + for (i = 0; i < 2; i++) { + curSample += WSTable4Bit[code & 0x0F]; + curSample = CLIP<int16>(curSample, 0, 255); + code >>= 4; + *out++ = curSample; + } - case MKTAG('V','P','T','Z'): // Frame data - inbuf = (byte *)allocBuffer(0, size); - outbuf = (byte *)allocBuffer(1, 2 * _numVectorPointers); + bytesLeft -= 2; + } + break; + case 0: + for (; count >= 0; count--) { + code = *in++; - _file->read(inbuf, size); - size = Screen::decodeFrame4(inbuf, outbuf, 2 * _numVectorPointers); + for (i = 0; i < 4; i++) { + curSample += WSTable2Bit[code & 0x03]; + curSample = CLIP<int16>(curSample, 0, 255); + code >>= 2; + *out++ = curSample; + } - assert(size / 2 <= _numVectorPointers); + bytesLeft -= 4; + } + break; + default: + for (; count >= 0; count--) { + *out++ = curSample; + bytesLeft--; + } + break; + } + } + _audioStream->queueBuffer(outbuf, outsize, DisposeAfterUse::YES, Audio::FLAG_UNSIGNED); + free(inbuf); + } +} - for (i = 0; i < size / 2; i++) - _vectorPointers[i] = READ_LE_UINT16(outbuf + 2 * i); - break; +void VQADecoder::VQAAudioTrack::handleSND2(Common::SeekableReadStream *stream) { + uint32 size = stream->readUint32BE(); + warning("VQADecoder::VQAAudioTrack::handleSND2(): `SND2' is not implemented"); + stream->seek(size, SEEK_CUR); +} - default: - warning("VQAMovie::displayFrame: Unknown `VQFR' sub-tag `%c%c%c%c'", char((tag >> 24) & 0xFF), char((tag >> 16) & 0xFF), char((tag >> 8) & 0xFF), char(tag & 0xFF)); - _file->seek(size, SEEK_CUR); - } +// ----------------------------------------------------------------------- - } +VQADecoder::VQAVideoTrack::VQAVideoTrack(const VQAHeader *header) { + memset(_palette, 0, sizeof(_palette)); + _dirtyPalette = false; - break; + _width = header->width; + _height = header->height; + _blockW = header->blockW; + _blockH = header->blockH; + _cbParts = header->cbParts; - default: - warning("VQAMovie::displayFrame: Unknown tag `%c%c%c%c'", char((tag >> 24) & 0xFF), char((tag >> 16) & 0xFF), char((tag >> 8) & 0xFF), char(tag & 0xFF)); - _file->seek(size, SEEK_CUR); - } - } + _newFrame = false; - // The frame has been decoded + _curFrame = -1; + _frameCount = header->numFrames; + _frameRate = header->frameRate; - if (_frameInfo[frameNum] & 0x80000000) - _screen->setScreenPalette(_screen->getPalette(0)); + _codeBookSize = 0xF00 * header->blockW * header->blockH; + _compressedCodeBook = false; + _codeBook = new byte[_codeBookSize]; + _partialCodeBookSize = 0; + _numPartialCodeBooks = 0; + _partialCodeBook = new byte[_codeBookSize]; + _numVectorPointers = (header->width / header->blockW) * (header->height * header->blockH); + _vectorPointers = new uint16[_numVectorPointers]; - int blockPitch = _header.width / _header.blockW; + memset(_codeBook, 0, _codeBookSize); + memset(_partialCodeBook, 0, _codeBookSize); + memset(_vectorPointers, 0, _numVectorPointers); - for (int by = 0; by < _header.height / _header.blockH; by++) { - for (int bx = 0; bx < blockPitch; bx++) { - byte *dst = _frame + by * _header.width * _header.blockH + bx * _header.blockW; - int val = _vectorPointers[by * blockPitch + bx]; + _surface = new Graphics::Surface(); + _surface->create(header->width, header->height, Graphics::PixelFormat::createFormatCLUT8()); +} - if ((val & 0xFF00) == 0xFF00) { - // Solid color - for (i = 0; i < _header.blockH; i++) { - memset(dst, 255 - (val & 0xFF), _header.blockW); - dst += _header.width; - } - } else { - // Copy data from _vectorPointers. I'm not sure - // why we don't use the three least significant - // bits of 'val'. - byte *src = &_codeBook[(val >> 3) * _header.blockW * _header.blockH]; - - for (i = 0; i < _header.blockH; i++) { - memcpy(dst, src, _header.blockW); - src += _header.blockW; - dst += _header.width; - } - } - } - } +VQADecoder::VQAVideoTrack::~VQAVideoTrack() { + _surface->free(); + delete _surface; + delete[] _codeBook; + delete[] _partialCodeBook; + delete[] _vectorPointers; +} - if (_numPartialCodeBooks == _header.cbParts) { - if (_compressedCodeBook) { - Screen::decodeFrame4(_partialCodeBook, _codeBook, _codeBookSize); - } else { - memcpy(_codeBook, _partialCodeBook, _partialCodeBookSize); - } - _numPartialCodeBooks = 0; - _partialCodeBookSize = 0; - } +uint16 VQADecoder::VQAVideoTrack::getWidth() const { + return _width; +} - _screen->copyBlockToPage(_drawPage, _x, _y, _header.width, _header.height, _frame); +uint16 VQADecoder::VQAVideoTrack::getHeight() const { + return _height; } -void VQAMovie::play() { - uint32 startTick; +Graphics::PixelFormat VQADecoder::VQAVideoTrack::getPixelFormat() const { + return _surface->format; +} - if (!_opened) - return; +int VQADecoder::VQAVideoTrack::getCurFrame() const { + return _curFrame; +} - startTick = _system->getMillis(); +int VQADecoder::VQAVideoTrack::getFrameCount() const { + return _frameCount; +} - // First, handle any sound chunk that appears before the first frame. - // At least in some versions, it will contain half a second of audio, - // presumably to lessen the risk of audio underflow. - // - // In most movies, we will find a CMDS tag. The purpose of this is - // currently unknown. - // - // In cow1_0.vqa, cow1_1.vqa, jung0.vqa, and jung1.vqa we will find a - // VQFR tag. A frame before the first frame? Weird. It doesn't seem to - // be needed, though. +Common::Rational VQADecoder::VQAVideoTrack::getFrameRate() const { + return _frameRate; +} - byte *inbuf, *outbuf; - uint32 insize, outsize; +void VQADecoder::VQAVideoTrack::setHasDirtyPalette() { + _dirtyPalette = true; +} - if (_stream) { - while ((uint)_file->pos() < (_frameInfo[0] & 0x7FFFFFFF)) { - uint32 tag = readTag(); - uint32 size = _file->readUint32BE(); +bool VQADecoder::VQAVideoTrack::hasDirtyPalette() const { + return _dirtyPalette; +} - if (_file->eos()) { - warning("VQAMovie::play: Unexpected EOF"); - break; - } +const byte *VQADecoder::VQAVideoTrack::getPalette() const { + _dirtyPalette = false; + return _palette; +} - switch (tag) { - case MKTAG('S','N','D','0'): // Uncompressed sound - inbuf = (byte *)malloc(size); - _file->read(inbuf, size); - _stream->queueBuffer(inbuf, size, DisposeAfterUse::YES, Audio::FLAG_UNSIGNED); - break; +const Graphics::Surface *VQADecoder::VQAVideoTrack::decodeNextFrame() { + if (_newFrame) { + _newFrame = false; - case MKTAG('S','N','D','1'): // Compressed sound - outsize = _file->readUint16LE(); - insize = _file->readUint16LE(); + int blockPitch = _width / _blockW; - inbuf = (byte *)malloc(insize); - _file->read(inbuf, insize); + for (int by = 0; by < _height / _blockH; by++) { + for (int bx = 0; bx < blockPitch; bx++) { + byte *dst = (byte *)_surface->getBasePtr(bx * _blockW, by * _blockH); + int val = _vectorPointers[by * blockPitch + bx]; + int i; - if (insize == outsize) { - _stream->queueBuffer(inbuf, insize, DisposeAfterUse::YES, Audio::FLAG_UNSIGNED); + if ((val & 0xFF00) == 0xFF00) { + // Solid color + for (i = 0; i < _blockH; i++) { + memset(dst, 255 - (val & 0xFF), _blockW); + dst += _width; + } } else { - outbuf = (byte *)malloc(outsize); - decodeSND1(inbuf, insize, outbuf, outsize); - _stream->queueBuffer(outbuf, outsize, DisposeAfterUse::YES, Audio::FLAG_UNSIGNED); - free(inbuf); + // Copy data from _vectorPointers. I'm not sure + // why we don't use the three least significant + // bits of 'val'. + byte *src = &_codeBook[(val >> 3) * _blockW * _blockH]; + + for (i = 0; i < _blockH; i++) { + memcpy(dst, src, _blockW); + src += _blockW; + dst += _width; + } } - break; + } + } - case MKTAG('S','N','D','2'): // Compressed sound - warning("VQAMovie::play: `SND2' is not implemented"); - _file->seek(size, SEEK_CUR); - break; + if (_numPartialCodeBooks == _cbParts) { + if (_compressedCodeBook) { + Screen::decodeFrame4(_partialCodeBook, _codeBook, _codeBookSize); + } else { + memcpy(_codeBook, _partialCodeBook, _partialCodeBookSize); + } + _numPartialCodeBooks = 0; + _partialCodeBookSize = 0; + } + } - case MKTAG('C','M','D','S'): // Unused tag, always empty in kyra3 - _file->seek(size, SEEK_CUR); - break; + _curFrame++; + return _surface; +} - default: - warning("VQAMovie::play: Unknown tag `%c%c%c%c'", char((tag >> 24) & 0xFF), char((tag >> 16) & 0xFF), char((tag >> 8) & 0xFF), char(tag & 0xFF)); - _file->seek(size, SEEK_CUR); - } +void VQADecoder::VQAVideoTrack::handleVQFR(Common::SeekableReadStream *stream) { + uint32 size = stream->readUint32BE(); + int32 end = stream->pos() + size - 8; + byte *inbuf; + + _newFrame = true; + + while (stream->pos() < end) { + uint32 tag = readTag(stream); + uint32 i; + size = stream->readUint32BE(); + + switch (tag) { + case MKTAG('C','B','F','0'): // Full codebook + stream->read(_codeBook, size); + break; + case MKTAG('C','B','F','Z'): // Full codebook + inbuf = (byte *)malloc(size); + stream->read(inbuf, size); + Screen::decodeFrame4(inbuf, _codeBook, _codeBookSize); + free(inbuf); + break; + case MKTAG('C','B','P','0'): // Partial codebook + _compressedCodeBook = false; + stream->read(_partialCodeBook + _partialCodeBookSize, size); + _partialCodeBookSize += size; + _numPartialCodeBooks++; + break; + case MKTAG('C','B','P','Z'): // Partial codebook + _compressedCodeBook = true; + stream->read(_partialCodeBook + _partialCodeBookSize, size); + _partialCodeBookSize += size; + _numPartialCodeBooks++; + break; + case MKTAG('C','P','L','0'): // Palette + assert(size <= 3 * 256); + stream->read(_palette, size); + break; + case MKTAG('C','P','L','Z'): // Palette + inbuf = (byte *)malloc(size); + stream->read(inbuf, size); + Screen::decodeFrame4(inbuf, _palette, 3 * 256); + free(inbuf); + break; + case MKTAG('V','P','T','0'): // Frame data + assert(size / 2 <= _numVectorPointers); + for (i = 0; i < size / 2; i++) + _vectorPointers[i] = stream->readUint16LE(); + break; + case MKTAG('V','P','T','Z'): // Frame data + inbuf = (byte *)malloc(size); + stream->read(inbuf, size); + size = Screen::decodeFrame4(inbuf, (uint8 *)_vectorPointers, 2 * _numVectorPointers); + for (i = 0; i < size / 2; i++) + _vectorPointers[i] = TO_LE_16(_vectorPointers[i]); + free(inbuf); + break; + default: + warning("VQADecoder::VQAVideoTrack::handleVQFR(): Unknown `VQFR' sub-tag `%s'", tag2str(tag)); + stream->seek(size, SEEK_CUR); + break; } } +} - _vm->_mixer->playStream(Audio::Mixer::kSFXSoundType, &_sound, _stream); - Common::EventManager *eventMan = _vm->getEventManager(); +// ----------------------------------------------------------------------- - for (uint i = 0; i < _header.numFrames; i++) { - displayFrame(i); +VQAMovie::VQAMovie(KyraEngine_v1 *vm, OSystem *system) { + _system = system; + _vm = vm; + _screen = _vm->screen(); + _decoder = new VQADecoder(); +} - // TODO: Implement frame skipping? +VQAMovie::~VQAMovie() { + close(); + delete _decoder; +} - while (1) { - uint32 elapsedTime; +bool VQAMovie::open(const char *filename) { + if (_file.open(filename)) { + return true; + } + return false; +} + +void VQAMovie::close() { + if (_file.isOpen()) { + _file.close(); + } +} + +void VQAMovie::play() { + if (_decoder->loadStream(&_file)) { + Common::EventManager *eventMan = _vm->getEventManager(); + int width = _decoder->getWidth(); + int height = _decoder->getHeight(); + int x = (Screen::SCREEN_W - width) / 2; + int y = (Screen::SCREEN_H - height) / 2; - if (_vm->_mixer->isSoundHandleActive(_sound)) - elapsedTime = _vm->_mixer->getSoundElapsedTime(_sound); - else - elapsedTime = _system->getMillis() - startTick; + _decoder->start(); - if (elapsedTime >= (i * 1000) / _header.frameRate) - break; + // Note that decoding starts at frame -1. That's because there + // is usually sound data before the first frame, probably to + // avoid sound underflow. + while (!_decoder->endOfVideo()) { Common::Event event; while (eventMan->pollEvent(event)) { switch (event.type) { @@ -673,23 +635,32 @@ void VQAMovie::play() { if (event.kbd.keycode == Common::KEYCODE_ESCAPE) return; break; - case Common::EVENT_RTL: case Common::EVENT_QUIT: return; - default: break; } } + if (_decoder->needsUpdate()) { + const Graphics::Surface *surface = _decoder->decodeNextFrame(); + if (_decoder->hasDirtyPalette()) { + const byte *decoderPalette = _decoder->getPalette(); + byte systemPalette[256 * 3]; + for (int i = 0; i < ARRAYSIZE(systemPalette); i++) { + systemPalette[i] = (decoderPalette[i] * 0xFF) / 0x3F; + } + _system->getPaletteManager()->setPalette(systemPalette, 0, 256); + } + + _system->copyRectToScreen((const byte *)surface->getBasePtr(0, 0), surface->pitch, x, y, width, height); + } + + _system->updateScreen(); _system->delayMillis(10); } - - _screen->updateScreen(); } - - // TODO: Wait for the sound to finish? } } // End of namespace Kyra diff --git a/engines/kyra/vqa.h b/engines/kyra/vqa.h index 839bf5ac48..d23704a9ea 100644 --- a/engines/kyra/vqa.h +++ b/engines/kyra/vqa.h @@ -8,12 +8,12 @@ * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. - + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. @@ -23,9 +23,9 @@ #ifndef KYRA_VQA_H #define KYRA_VQA_H -#include "common/scummsys.h" - -#include "audio/mixer.h" +#include "video/video_decoder.h" +#include "common/file.h" +#include "common/rational.h" class OSystem; @@ -33,40 +33,24 @@ namespace Audio { class QueuingAudioStream; } // End of namespace Audio -namespace Common { -class SeekableReadStream; -} // End of namespace Common - namespace Kyra { class KyraEngine_v1; class Screen; -class VQAMovie { +class VQADecoder : public Video::VideoDecoder { public: - VQAMovie(KyraEngine_v1 *vm, OSystem *system); - ~VQAMovie(); + VQADecoder(); + virtual ~VQADecoder(); - bool opened() { return _opened; } - int frames() { return _opened ? _header.numFrames : -1; } + bool loadStream(Common::SeekableReadStream *stream); + void readNextPacket(); - // It's unlikely that we ever want to change the movie position from - // its default. +private: + Common::SeekableReadStream *_fileStream; - void setDrawPage(int page) { _drawPage = page; } - - bool open(const char *filename); - void close(); - void play(); - -protected: - OSystem *_system; - KyraEngine_v1 *_vm; - Screen *_screen; - - bool _opened; - int _x, _y; - int _drawPage; + void handleVQHD(Common::SeekableReadStream *stream); + void handleFINF(Common::SeekableReadStream *stream); struct VQAHeader { uint16 version; @@ -91,40 +75,85 @@ protected: uint32 unk5; }; - struct Buffer { - uint8 *data; - uint32 size; - }; - - Buffer _buffers[2]; - - void initBuffers(); - void *allocBuffer(int num, uint32 size); - void freeBuffers(); + VQAHeader _header; + uint32 *_frameInfo; - void decodeSND1(byte *inbuf, uint32 insize, byte *outbuf, uint32 outsize); + class VQAAudioTrack : public AudioTrack { + public: + VQAAudioTrack(const VQAHeader *header); + ~VQAAudioTrack(); - void displayFrame(uint frameNum); + void handleSND0(Common::SeekableReadStream *stream); + void handleSND1(Common::SeekableReadStream *stream); + void handleSND2(Common::SeekableReadStream *stream); - Common::SeekableReadStream *_file; + protected: + Audio::AudioStream *getAudioStream() const; - VQAHeader _header; - uint32 *_frameInfo; - uint32 _codeBookSize; - byte *_codeBook; - byte *_partialCodeBook; - bool _compressedCodeBook; - int _partialCodeBookSize; - int _numPartialCodeBooks; - uint32 _numVectorPointers; - uint16 *_vectorPointers; + private: + Audio::QueuingAudioStream *_audioStream; + }; - byte *_frame; + class VQAVideoTrack : public FixedRateVideoTrack { + public: + VQAVideoTrack(const VQAHeader *header); + ~VQAVideoTrack(); + + uint16 getWidth() const; + uint16 getHeight() const; + Graphics::PixelFormat getPixelFormat() const; + int getCurFrame() const; + int getFrameCount() const; + const Graphics::Surface *decodeNextFrame(); + + void setHasDirtyPalette(); + bool hasDirtyPalette() const; + const byte *getPalette() const; + + void handleVQFR(Common::SeekableReadStream *stream); + + protected: + Common::Rational getFrameRate() const; + + private: + Graphics::Surface *_surface; + byte _palette[3 * 256]; + mutable bool _dirtyPalette; + + bool _newFrame; + + uint16 _width, _height; + uint8 _blockW, _blockH; + uint8 _cbParts; + int _frameCount; + int _curFrame; + byte _frameRate; + + uint32 _codeBookSize; + bool _compressedCodeBook; + byte *_codeBook; + int _partialCodeBookSize; + int _numPartialCodeBooks; + byte *_partialCodeBook; + uint32 _numVectorPointers; + uint16 *_vectorPointers; + }; +}; - Audio::QueuingAudioStream *_stream; - Audio::SoundHandle _sound; +class VQAMovie { +public: + VQAMovie(KyraEngine_v1 *vm, OSystem *system); + ~VQAMovie(); - uint32 readTag(); + bool open(const char *filename); + void close(); + void play(); +private: + OSystem *_system; + KyraEngine_v1 *_vm; + Screen *_screen; + VQADecoder *_decoder; + Common::File _file; }; } // End of namespace Kyra diff --git a/engines/kyra/wsamovie.cpp b/engines/kyra/wsamovie.cpp index f6aca2bb82..560ac8c332 100644 --- a/engines/kyra/wsamovie.cpp +++ b/engines/kyra/wsamovie.cpp @@ -8,12 +8,12 @@ * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. - + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. diff --git a/engines/kyra/wsamovie.h b/engines/kyra/wsamovie.h index 7dadc9319b..d00aa89af1 100644 --- a/engines/kyra/wsamovie.h +++ b/engines/kyra/wsamovie.h @@ -8,12 +8,12 @@ * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. - + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. |