diff options
author | Matthew Hoops | 2011-05-18 18:23:37 -0400 |
---|---|---|
committer | Matthew Hoops | 2011-05-18 18:23:37 -0400 |
commit | d4c92983920cfe3b25a22d91e12c750e591b917e (patch) | |
tree | c0b63318b9ba0e67528337cfaa21515def1c3962 /engines | |
parent | 7e2edf16b3e2bf1d2b31999979a60802514df6cb (diff) | |
parent | cf107e24be28c7e6db65b5c7ffed120af4a7994b (diff) | |
download | scummvm-rg350-d4c92983920cfe3b25a22d91e12c750e591b917e.tar.gz scummvm-rg350-d4c92983920cfe3b25a22d91e12c750e591b917e.tar.bz2 scummvm-rg350-d4c92983920cfe3b25a22d91e12c750e591b917e.zip |
Merge remote branch 'upstream/master' into pegasus
Diffstat (limited to 'engines')
1938 files changed, 4175 insertions, 8830 deletions
diff --git a/engines/advancedDetector.cpp b/engines/advancedDetector.cpp index 8170452102..6874806bc7 100644 --- a/engines/advancedDetector.cpp +++ b/engines/advancedDetector.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ // FIXME: Avoid using printf diff --git a/engines/advancedDetector.h b/engines/advancedDetector.h index 757fb12f33..6ee0822f47 100644 --- a/engines/advancedDetector.h +++ b/engines/advancedDetector.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef ENGINES_ADVANCED_DETECTOR_H #define ENGINES_ADVANCED_DETECTOR_H diff --git a/engines/agi/agi.cpp b/engines/agi/agi.cpp index a69d19f06c..78316588b0 100644 --- a/engines/agi/agi.cpp +++ b/engines/agi/agi.cpp @@ -18,14 +18,10 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/md5.h" #include "common/events.h" -#include "common/EventRecorder.h" #include "common/file.h" #include "common/memstream.h" #include "common/savefile.h" @@ -488,10 +484,16 @@ static const GameSettings agiSettings[] = { AgiBase::AgiBase(OSystem *syst, const AGIGameDescription *gameDesc) : Engine(syst), _gameDescription(gameDesc) { _noSaveLoadAllowed = false; + _rnd = new Common::RandomSource("agi"); + initFeatures(); initVersion(); } +AgiBase::~AgiBase() { + delete _rnd; +} + AgiEngine::AgiEngine(OSystem *syst, const AGIGameDescription *gameDesc) : AgiBase(syst, gameDesc) { // Setup mixer @@ -499,9 +501,6 @@ AgiEngine::AgiEngine(OSystem *syst, const AGIGameDescription *gameDesc) : AgiBas parseFeatures(); - _rnd = new Common::RandomSource(); - g_eventRec.registerRandomSource(*_rnd, "agi"); - DebugMan.addDebugChannel(kDebugLevelMain, "Main", "Generic debug level"); DebugMan.addDebugChannel(kDebugLevelResources, "Resources", "Resources debugging"); DebugMan.addDebugChannel(kDebugLevelSprites, "Sprites", "Sprites debugging"); @@ -652,10 +651,11 @@ void AgiEngine::initialize() { } AgiEngine::~AgiEngine() { - // If the engine hasn't been initialized yet via AgiEngine::initialize(), don't attempt to free any resources, - // as they haven't been allocated. Fixes bug #1742432 - AGI: Engine crashes if no game is detected + // If the engine hasn't been initialized yet via + // AgiEngine::initialize(), don't attempt to free any resources, as + // they haven't been allocated. Fixes bug #1742432 - AGI: Engine + // crashes if no game is detected if (_game.state == STATE_INIT) { - delete _rnd; // delete _rnd, as it is allocated in the constructor, not in initialize() return; } @@ -669,7 +669,6 @@ AgiEngine::~AgiEngine() { free(_game.sbufOrig); _gfx->deinitMachine(); delete _gfx; - delete _rnd; delete _console; free(_predictiveDictLine); diff --git a/engines/agi/agi.h b/engines/agi/agi.h index c71a0ebf64..a42148b1ef 100644 --- a/engines/agi/agi.h +++ b/engines/agi/agi.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef AGI_H @@ -758,6 +755,7 @@ public: virtual void clearKeyQueue() = 0; AgiBase(OSystem *syst, const AGIGameDescription *gameDesc); + ~AgiBase(); virtual void clearImageStack() = 0; virtual void recordImageStackCall(uint8 type, int16 p1, int16 p2, int16 p3, @@ -971,7 +969,7 @@ public: int showWords(); int loadWords(const char *); void unloadWords(); - int findWord(char *word, int *flen); + int findWord(const char *word, int *flen); void dictionaryWords(char *); // Motion diff --git a/engines/agi/checks.cpp b/engines/agi/checks.cpp index afede0b836..8d03ae67b9 100644 --- a/engines/agi/checks.cpp +++ b/engines/agi/checks.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "agi/agi.h" diff --git a/engines/agi/console.cpp b/engines/agi/console.cpp index f4b50c0909..d49bd57ea2 100644 --- a/engines/agi/console.cpp +++ b/engines/agi/console.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "agi/agi.h" diff --git a/engines/agi/console.h b/engines/agi/console.h index e79db42054..308b0f1d1f 100644 --- a/engines/agi/console.h +++ b/engines/agi/console.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef AGI_CONSOLE_H diff --git a/engines/agi/cycle.cpp b/engines/agi/cycle.cpp index 86c1b519a9..d86fb36709 100644 --- a/engines/agi/cycle.cpp +++ b/engines/agi/cycle.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "agi/agi.h" diff --git a/engines/agi/detection.cpp b/engines/agi/detection.cpp index fb92344de2..22d8adf92d 100644 --- a/engines/agi/detection.cpp +++ b/engines/agi/detection.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ // FIXME: Avoid using printf @@ -167,7 +164,7 @@ public: AgiMetaEngine() : AdvancedMetaEngine(detectionParams) {} virtual const char *getName() const { - return "AGI preAGI + v2 + v3 Engine"; + return "AGI preAGI + v2 + v3"; } virtual const char *getOriginalCopyright() const { return "Sierra AGI Engine (C) Sierra On-Line Software"; diff --git a/engines/agi/detection_tables.h b/engines/agi/detection_tables.h index 4689915007..cd3edf50c6 100644 --- a/engines/agi/detection_tables.h +++ b/engines/agi/detection_tables.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ namespace Agi { diff --git a/engines/agi/font.h b/engines/agi/font.h index 171106145c..c2516d3520 100644 --- a/engines/agi/font.h +++ b/engines/agi/font.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef AGI_FONT_H diff --git a/engines/agi/global.cpp b/engines/agi/global.cpp index ed8e9e8dbe..fdece0737e 100644 --- a/engines/agi/global.cpp +++ b/engines/agi/global.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "agi/agi.h" diff --git a/engines/agi/graphics.cpp b/engines/agi/graphics.cpp index f0d38761d0..5ceccd9e27 100644 --- a/engines/agi/graphics.cpp +++ b/engines/agi/graphics.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/file.h" diff --git a/engines/agi/graphics.h b/engines/agi/graphics.h index 60fbea2285..037dacd8de 100644 --- a/engines/agi/graphics.h +++ b/engines/agi/graphics.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef AGI_GRAPHICS_H diff --git a/engines/agi/id.cpp b/engines/agi/id.cpp index 2e12e45458..00f8407529 100644 --- a/engines/agi/id.cpp +++ b/engines/agi/id.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "agi/agi.h" diff --git a/engines/agi/inv.cpp b/engines/agi/inv.cpp index f1d9523887..a165a32b29 100644 --- a/engines/agi/inv.cpp +++ b/engines/agi/inv.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "agi/agi.h" diff --git a/engines/agi/keyboard.cpp b/engines/agi/keyboard.cpp index 95211f8e3c..f5810a6e8c 100644 --- a/engines/agi/keyboard.cpp +++ b/engines/agi/keyboard.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "agi/agi.h" diff --git a/engines/agi/keyboard.h b/engines/agi/keyboard.h index c4dadb5836..665ee6a62c 100644 --- a/engines/agi/keyboard.h +++ b/engines/agi/keyboard.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef AGI_KEYBOARD_H diff --git a/engines/agi/loader_v2.cpp b/engines/agi/loader_v2.cpp index 0141a61065..f5f8830b43 100644 --- a/engines/agi/loader_v2.cpp +++ b/engines/agi/loader_v2.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/textconsole.h" diff --git a/engines/agi/loader_v3.cpp b/engines/agi/loader_v3.cpp index 025e755c8b..29635f935b 100644 --- a/engines/agi/loader_v3.cpp +++ b/engines/agi/loader_v3.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "agi/agi.h" diff --git a/engines/agi/logic.cpp b/engines/agi/logic.cpp index cc61d3455a..22798ba831 100644 --- a/engines/agi/logic.cpp +++ b/engines/agi/logic.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "agi/agi.h" diff --git a/engines/agi/logic.h b/engines/agi/logic.h index d285aa1dfb..fecc2e3b8a 100644 --- a/engines/agi/logic.h +++ b/engines/agi/logic.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef AGI_LOGIC_H diff --git a/engines/agi/lzw.cpp b/engines/agi/lzw.cpp index 495d6458da..a00281bd49 100644 --- a/engines/agi/lzw.cpp +++ b/engines/agi/lzw.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ /*************************************************************************** diff --git a/engines/agi/lzw.h b/engines/agi/lzw.h index 5e1f74c819..e3fbafe584 100644 --- a/engines/agi/lzw.h +++ b/engines/agi/lzw.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef AGI_LZW_H diff --git a/engines/agi/menu.cpp b/engines/agi/menu.cpp index b62bcd9ad8..b504cd3e30 100644 --- a/engines/agi/menu.cpp +++ b/engines/agi/menu.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "agi/agi.h" diff --git a/engines/agi/menu.h b/engines/agi/menu.h index 724ec3877c..e659c71fab 100644 --- a/engines/agi/menu.h +++ b/engines/agi/menu.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef AGI_MENU_H diff --git a/engines/agi/motion.cpp b/engines/agi/motion.cpp index 7498aafb5d..261a7f3e61 100644 --- a/engines/agi/motion.cpp +++ b/engines/agi/motion.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "agi/agi.h" diff --git a/engines/agi/objects.cpp b/engines/agi/objects.cpp index bea53d7fa4..e04c9742f3 100644 --- a/engines/agi/objects.cpp +++ b/engines/agi/objects.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "agi/agi.h" diff --git a/engines/agi/op_cmd.cpp b/engines/agi/op_cmd.cpp index e1f99456e8..fb4c079a4a 100644 --- a/engines/agi/op_cmd.cpp +++ b/engines/agi/op_cmd.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "base/version.h" diff --git a/engines/agi/op_dbg.cpp b/engines/agi/op_dbg.cpp index f3b4815790..be73dbefae 100644 --- a/engines/agi/op_dbg.cpp +++ b/engines/agi/op_dbg.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "agi/agi.h" diff --git a/engines/agi/op_test.cpp b/engines/agi/op_test.cpp index f5234d4e6c..13b2d25023 100644 --- a/engines/agi/op_test.cpp +++ b/engines/agi/op_test.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ diff --git a/engines/agi/opcodes.h b/engines/agi/opcodes.h index 6b62f9ee99..b0d2051f0b 100644 --- a/engines/agi/opcodes.h +++ b/engines/agi/opcodes.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef AGI_OPCODES_H diff --git a/engines/agi/picture.cpp b/engines/agi/picture.cpp index 8951fc81df..47e40fb5f1 100644 --- a/engines/agi/picture.cpp +++ b/engines/agi/picture.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "agi/agi.h" diff --git a/engines/agi/picture.h b/engines/agi/picture.h index 31f8605cde..f2a6586b93 100644 --- a/engines/agi/picture.h +++ b/engines/agi/picture.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef AGI_PICTURE_H diff --git a/engines/agi/preagi.cpp b/engines/agi/preagi.cpp index c51c53e76e..c1a6cd33fe 100644 --- a/engines/agi/preagi.cpp +++ b/engines/agi/preagi.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/config-manager.h" @@ -45,8 +42,6 @@ PreAgiEngine::PreAgiEngine(OSystem *syst, const AGIGameDescription *gameDesc) : // Setup mixer syncSoundSettings(); - _rnd = new Common::RandomSource(); - DebugMan.addDebugChannel(kDebugLevelMain, "Main", "Generic debug level"); DebugMan.addDebugChannel(kDebugLevelResources, "Resources", "Resources debugging"); DebugMan.addDebugChannel(kDebugLevelSprites, "Sprites", "Sprites debugging"); diff --git a/engines/agi/preagi.h b/engines/agi/preagi.h index 58e08945b6..1a178497ad 100644 --- a/engines/agi/preagi.h +++ b/engines/agi/preagi.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef AGI_PREAGI_H diff --git a/engines/agi/preagi_common.cpp b/engines/agi/preagi_common.cpp index 5bc0c92ab8..d437dc08f2 100644 --- a/engines/agi/preagi_common.cpp +++ b/engines/agi/preagi_common.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "agi/preagi.h" diff --git a/engines/agi/preagi_common.h b/engines/agi/preagi_common.h index 8b6dc0ee59..a557f69977 100644 --- a/engines/agi/preagi_common.h +++ b/engines/agi/preagi_common.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ diff --git a/engines/agi/preagi_mickey.cpp b/engines/agi/preagi_mickey.cpp index 64fc4e9ae5..21eb780916 100644 --- a/engines/agi/preagi_mickey.cpp +++ b/engines/agi/preagi_mickey.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/events.h" diff --git a/engines/agi/preagi_mickey.h b/engines/agi/preagi_mickey.h index 5ef12bfad2..62981375c6 100644 --- a/engines/agi/preagi_mickey.h +++ b/engines/agi/preagi_mickey.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef AGI_PREAGI_MICKEY_H diff --git a/engines/agi/preagi_troll.cpp b/engines/agi/preagi_troll.cpp index 76849949c7..445a9e34ff 100644 --- a/engines/agi/preagi_troll.cpp +++ b/engines/agi/preagi_troll.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "agi/preagi.h" diff --git a/engines/agi/preagi_troll.h b/engines/agi/preagi_troll.h index f460758b2c..d9a995072b 100644 --- a/engines/agi/preagi_troll.h +++ b/engines/agi/preagi_troll.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef AGI_PREAGI_TROLL_H diff --git a/engines/agi/preagi_winnie.cpp b/engines/agi/preagi_winnie.cpp index c92434c15f..1df31ff72a 100644 --- a/engines/agi/preagi_winnie.cpp +++ b/engines/agi/preagi_winnie.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "agi/preagi.h" @@ -217,15 +214,9 @@ int Winnie::getObjInRoom(int iRoom) { return 0; } -#define setTakeDrop() {\ - if (getObjInRoom(_room))\ - fCanSel[IDI_WTP_SEL_TAKE] = true;\ - else\ - fCanSel[IDI_WTP_SEL_TAKE] = false;\ - if (_game.iObjHave)\ - fCanSel[IDI_WTP_SEL_DROP] = true;\ - else\ - fCanSel[IDI_WTP_SEL_DROP] = false;\ +void Winnie::setTakeDrop(int fCanSel[]) { + fCanSel[IDI_WTP_SEL_TAKE] = getObjInRoom(_room); + fCanSel[IDI_WTP_SEL_DROP] = _game.iObjHave; } void Winnie::setFlag(int iFlag) { @@ -281,7 +272,7 @@ int Winnie::parser(int pc, int index, uint8 *buffer) { fCanSel[IDI_WTP_SEL_EAST] = fCanSel[IDI_WTP_SEL_WEST] = true; // check if object in room or player carrying one - setTakeDrop(); + setTakeDrop(fCanSel); // check which rows have a menu option for (iSel = 0; iSel < IDI_WTP_MAX_OPTION; iSel++) { @@ -367,11 +358,11 @@ int Winnie::parser(int pc, int index, uint8 *buffer) { break; case IDI_WTP_SEL_TAKE: takeObj(_room); - setTakeDrop(); + setTakeDrop(fCanSel); break; case IDI_WTP_SEL_DROP: dropObj(_room); - setTakeDrop(); + setTakeDrop(fCanSel); break; } } @@ -796,13 +787,12 @@ void Winnie::getMenuMouseSel(int *iSel, int fCanSel[], int x, int y) { } } -#define makeSel() {\ - if (fCanSel[*iSel]) {\ - return;\ - } else {\ - keyHelp();\ - clrMenuSel(iSel, fCanSel);\ - }\ +void Winnie::makeSel(int *iSel, int fCanSel[]) { + if (fCanSel[*iSel]) + return; + + keyHelp(); + clrMenuSel(iSel, fCanSel); } void Winnie::getMenuSel(char *szMenu, int *iSel, int fCanSel[]) { @@ -844,22 +834,22 @@ void Winnie::getMenuSel(char *szMenu, int *iSel, int fCanSel[]) { // Click to move if (fCanSel[IDI_WTP_SEL_NORTH] && hotspotNorth.contains(event.mouse.x, event.mouse.y)) { *iSel = IDI_WTP_SEL_NORTH; - makeSel(); + makeSel(iSel, fCanSel); _vm->_gfx->setCursorPalette(false); return; } else if (fCanSel[IDI_WTP_SEL_SOUTH] && hotspotSouth.contains(event.mouse.x, event.mouse.y)) { *iSel = IDI_WTP_SEL_SOUTH; - makeSel(); + makeSel(iSel, fCanSel); _vm->_gfx->setCursorPalette(false); return; } else if (fCanSel[IDI_WTP_SEL_WEST] && hotspotWest.contains(event.mouse.x, event.mouse.y)) { *iSel = IDI_WTP_SEL_WEST; - makeSel(); + makeSel(iSel, fCanSel); _vm->_gfx->setCursorPalette(false); return; } else if (fCanSel[IDI_WTP_SEL_EAST] && hotspotEast.contains(event.mouse.x, event.mouse.y)) { *iSel = IDI_WTP_SEL_EAST; - makeSel(); + makeSel(iSel, fCanSel); _vm->_gfx->setCursorPalette(false); return; } else { @@ -944,31 +934,31 @@ void Winnie::getMenuSel(char *szMenu, int *iSel, int fCanSel[]) { break; case Common::KEYCODE_n: *iSel = IDI_WTP_SEL_NORTH; - makeSel(); + makeSel(iSel, fCanSel); break; case Common::KEYCODE_s: if (event.kbd.flags & Common::KBD_CTRL) { _vm->flipflag(fSoundOn); } else { *iSel = IDI_WTP_SEL_SOUTH; - makeSel(); + makeSel(iSel, fCanSel); } break; case Common::KEYCODE_e: *iSel = IDI_WTP_SEL_EAST; - makeSel(); + makeSel(iSel, fCanSel); break; case Common::KEYCODE_w: *iSel = IDI_WTP_SEL_WEST; - makeSel(); + makeSel(iSel, fCanSel); break; case Common::KEYCODE_t: *iSel = IDI_WTP_SEL_TAKE; - makeSel(); + makeSel(iSel, fCanSel); break; case Common::KEYCODE_d: *iSel = IDI_WTP_SEL_DROP; - makeSel(); + makeSel(iSel, fCanSel); break; case Common::KEYCODE_RETURN: switch (*iSel) { diff --git a/engines/agi/preagi_winnie.h b/engines/agi/preagi_winnie.h index 5a5472feb0..002eada65c 100644 --- a/engines/agi/preagi_winnie.h +++ b/engines/agi/preagi_winnie.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef AGI_PREAGI_WINNIE_H @@ -342,6 +339,8 @@ private: void saveGame(); void loadGame(); void dropObjRnd(); + void setTakeDrop(int[]); + void makeSel(int*, int[]); void wind(); void mist(); diff --git a/engines/agi/predictive.cpp b/engines/agi/predictive.cpp index 96ad78ace5..80e89f410b 100644 --- a/engines/agi/predictive.cpp +++ b/engines/agi/predictive.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "agi/agi.h" diff --git a/engines/agi/saveload.cpp b/engines/agi/saveload.cpp index c8df726fc7..deda186439 100644 --- a/engines/agi/saveload.cpp +++ b/engines/agi/saveload.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ // diff --git a/engines/agi/sound.cpp b/engines/agi/sound.cpp index b40cef67ef..746d4e9070 100644 --- a/engines/agi/sound.cpp +++ b/engines/agi/sound.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "agi/agi.h" diff --git a/engines/agi/sound.h b/engines/agi/sound.h index b858493cb8..0ee19878c4 100644 --- a/engines/agi/sound.h +++ b/engines/agi/sound.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef AGI_SOUND_H diff --git a/engines/agi/sound_2gs.cpp b/engines/agi/sound_2gs.cpp index f5758ed140..88feadd084 100644 --- a/engines/agi/sound_2gs.cpp +++ b/engines/agi/sound_2gs.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/config-manager.h" diff --git a/engines/agi/sound_2gs.h b/engines/agi/sound_2gs.h index 76f0642b7b..d9c7b8d2f1 100644 --- a/engines/agi/sound_2gs.h +++ b/engines/agi/sound_2gs.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef AGI_SOUND_2GS_H diff --git a/engines/agi/sound_coco3.cpp b/engines/agi/sound_coco3.cpp index 858c1c8515..281f2cb2d4 100644 --- a/engines/agi/sound_coco3.cpp +++ b/engines/agi/sound_coco3.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "agi/agi.h" diff --git a/engines/agi/sound_coco3.h b/engines/agi/sound_coco3.h index a1cc271871..7058b770f5 100644 --- a/engines/agi/sound_coco3.h +++ b/engines/agi/sound_coco3.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef AGI_SOUND_COCO3_H diff --git a/engines/agi/sound_midi.cpp b/engines/agi/sound_midi.cpp index 997c1edd6b..d2c99171e2 100644 --- a/engines/agi/sound_midi.cpp +++ b/engines/agi/sound_midi.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ // Code is based on: diff --git a/engines/agi/sound_midi.h b/engines/agi/sound_midi.h index 5733358fee..92a4002498 100644 --- a/engines/agi/sound_midi.h +++ b/engines/agi/sound_midi.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ // Music class diff --git a/engines/agi/sound_pcjr.cpp b/engines/agi/sound_pcjr.cpp index 35c960d260..319b7049ed 100644 --- a/engines/agi/sound_pcjr.cpp +++ b/engines/agi/sound_pcjr.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ /* Heavily based on code from NAGI diff --git a/engines/agi/sound_pcjr.h b/engines/agi/sound_pcjr.h index 3aad29d2ce..f50fd0aa82 100644 --- a/engines/agi/sound_pcjr.h +++ b/engines/agi/sound_pcjr.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef AGI_SOUND_PCJR_H diff --git a/engines/agi/sound_sarien.cpp b/engines/agi/sound_sarien.cpp index 6f2f3c5ad3..fc9a57791c 100644 --- a/engines/agi/sound_sarien.cpp +++ b/engines/agi/sound_sarien.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/random.h" diff --git a/engines/agi/sound_sarien.h b/engines/agi/sound_sarien.h index cea396255c..22bfff3395 100644 --- a/engines/agi/sound_sarien.h +++ b/engines/agi/sound_sarien.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef AGI_SOUND_SARIEN_H diff --git a/engines/agi/sprite.cpp b/engines/agi/sprite.cpp index e2b74e87bb..ea0b07f4da 100644 --- a/engines/agi/sprite.cpp +++ b/engines/agi/sprite.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "agi/agi.h" diff --git a/engines/agi/sprite.h b/engines/agi/sprite.h index 57fd0dacf2..68f0e32b86 100644 --- a/engines/agi/sprite.h +++ b/engines/agi/sprite.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef AGI_SPRITE_H diff --git a/engines/agi/text.cpp b/engines/agi/text.cpp index f85c4c1cdd..fedfd29362 100644 --- a/engines/agi/text.cpp +++ b/engines/agi/text.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "agi/agi.h" @@ -92,8 +89,11 @@ void AgiEngine::printText2(int l, const char *msg, int foff, int xoff, int yoff, x1++; // DF: changed the len-1 to len... - if (x1 == len && m[len] != '\n') - y1++, x1 = foff = 0; + // FIXME: m[len] doesn't make sense and may read out of bounds? + if (x1 == len && m[len] != '\n') { + y1++; + x1 = foff = 0; + } } else { y1++; x1 = foff = 0; diff --git a/engines/agi/view.cpp b/engines/agi/view.cpp index fcca1e2a79..0d420caa81 100644 --- a/engines/agi/view.cpp +++ b/engines/agi/view.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "agi/agi.h" diff --git a/engines/agi/view.h b/engines/agi/view.h index 85f2d6eaf9..0ef443f8e5 100644 --- a/engines/agi/view.h +++ b/engines/agi/view.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef AGI_VIEW_H diff --git a/engines/agi/wagparser.cpp b/engines/agi/wagparser.cpp index fab3b5cf50..14159c0147 100644 --- a/engines/agi/wagparser.cpp +++ b/engines/agi/wagparser.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/file.h" diff --git a/engines/agi/wagparser.h b/engines/agi/wagparser.h index c16d4092e7..81cfecef1b 100644 --- a/engines/agi/wagparser.h +++ b/engines/agi/wagparser.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ namespace Agi { diff --git a/engines/agi/words.cpp b/engines/agi/words.cpp index d8596dec97..4b96fdf711 100644 --- a/engines/agi/words.cpp +++ b/engines/agi/words.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ // @@ -40,7 +37,7 @@ static uint32 wordsFlen; // length of word memory // Local implementation to avoid problems with strndup() used by // gcc 3.2 Cygwin (see #635984) // -static char *myStrndup(char *src, int n) { +static char *myStrndup(const char *src, int n) { char *tmp = strncpy((char *)malloc(n + 1), src, n); tmp[n] = 0; return tmp; @@ -89,11 +86,11 @@ void AgiEngine::unloadWords() { * * Thomas Akesson, November 2001 */ -int AgiEngine::findWord(char *word, int *flen) { +int AgiEngine::findWord(const char *word, int *flen) { int mchr = 0; // matched chars int len, fchr, id = -1; - uint8 *p = words; - uint8 *q = words + wordsFlen; + const uint8 *p = words; + const uint8 *q = words + wordsFlen; *flen = 0; debugC(2, kDebugLevelScripts, "find_word(%s)", word); diff --git a/engines/agos/agos.cpp b/engines/agos/agos.cpp index 56501b5294..4d879909c4 100644 --- a/engines/agos/agos.cpp +++ b/engines/agos/agos.cpp @@ -18,13 +18,9 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/config-manager.h" -#include "common/EventRecorder.h" #include "common/file.h" #include "common/fs.h" #include "common/textconsole.h" @@ -60,8 +56,8 @@ static const GameSpecificSettings puzzlepack_settings = { }; #ifdef ENABLE_AGOS2 -AGOSEngine_DIMP::AGOSEngine_DIMP(OSystem *system) - : AGOSEngine_PuzzlePack(system) { +AGOSEngine_DIMP::AGOSEngine_DIMP(OSystem *system, const AGOSGameDescription *gd) + : AGOSEngine_PuzzlePack(system, gd) { _iconToggleCount = 0; _voiceCount = 0; @@ -71,24 +67,24 @@ AGOSEngine_DIMP::AGOSEngine_DIMP(OSystem *system) _tSecondCount = 0; } -AGOSEngine_PuzzlePack::AGOSEngine_PuzzlePack(OSystem *system) - : AGOSEngine_Feeble(system) { +AGOSEngine_PuzzlePack::AGOSEngine_PuzzlePack(OSystem *system, const AGOSGameDescription *gd) + : AGOSEngine_Feeble(system, gd) { _oopsValid = false; _gameTime = 0; } #endif -AGOSEngine_Simon2::AGOSEngine_Simon2(OSystem *system) - : AGOSEngine_Simon1(system) { +AGOSEngine_Simon2::AGOSEngine_Simon2(OSystem *system, const AGOSGameDescription *gd) + : AGOSEngine_Simon1(system, gd) { } -AGOSEngine_Simon1::AGOSEngine_Simon1(OSystem *system) - : AGOSEngine_Waxworks(system) { +AGOSEngine_Simon1::AGOSEngine_Simon1(OSystem *system, const AGOSGameDescription *gd) + : AGOSEngine_Waxworks(system, gd) { } -AGOSEngine_Waxworks::AGOSEngine_Waxworks(OSystem *system) - : AGOSEngine_Elvira2(system) { +AGOSEngine_Waxworks::AGOSEngine_Waxworks(OSystem *system, const AGOSGameDescription *gd) + : AGOSEngine_Elvira2(system, gd) { _boxCR = false; _boxLineCount = 0; @@ -104,16 +100,16 @@ AGOSEngine_Waxworks::AGOSEngine_Waxworks(OSystem *system) memset(_lineCounts, 0, sizeof(_lineCounts)); } -AGOSEngine_Elvira2::AGOSEngine_Elvira2(OSystem *system) - : AGOSEngine_Elvira1(system) { +AGOSEngine_Elvira2::AGOSEngine_Elvira2(OSystem *system, const AGOSGameDescription *gd) + : AGOSEngine_Elvira1(system, gd) { } -AGOSEngine_Elvira1::AGOSEngine_Elvira1(OSystem *system) - : AGOSEngine(system) { +AGOSEngine_Elvira1::AGOSEngine_Elvira1(OSystem *system, const AGOSGameDescription *gd) + : AGOSEngine(system, gd) { } -AGOSEngine::AGOSEngine(OSystem *syst) - : Engine(syst) { +AGOSEngine::AGOSEngine(OSystem *system, const AGOSGameDescription *gd) + : Engine(system), _rnd("agos"), _gameDescription(gd) { _vcPtr = 0; _vcGetOutOfCode = 0; @@ -529,8 +525,6 @@ AGOSEngine::AGOSEngine(OSystem *syst) SearchMan.addSubDirectoryMatching(gameDataDir, "movies"); SearchMan.addSubDirectoryMatching(gameDataDir, "sfx"); SearchMan.addSubDirectoryMatching(gameDataDir, "speech"); - - g_eventRec.registerRandomSource(_rnd, "agos"); } Common::Error AGOSEngine::init() { diff --git a/engines/agos/agos.h b/engines/agos/agos.h index aecf2437a7..aa68a05eee 100644 --- a/engines/agos/agos.h +++ b/engines/agos/agos.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef AGOS_AGOS_H @@ -179,6 +176,7 @@ class Debugger; #endif class AGOSEngine : public Engine { +protected: friend class Debugger; // Engine APIs @@ -196,7 +194,6 @@ class AGOSEngine : public Engine { virtual void syncSoundSettings(); virtual void pauseEngineIntern(bool pause); -public: virtual void setupOpcodes(); uint16 _numOpcodes, _opcode; @@ -208,8 +205,9 @@ public: virtual void setupVideoOpcodes(VgaOpcodeProc *op); - const AGOSGameDescription *_gameDescription; + const AGOSGameDescription * const _gameDescription; +public: virtual void setupGame(); int getGameId() const; @@ -587,7 +585,7 @@ protected: byte _hebrewCharWidths[32]; public: - AGOSEngine(OSystem *syst); + AGOSEngine(OSystem *system, const AGOSGameDescription *gd); virtual ~AGOSEngine(); byte *_curSfxFile; @@ -1284,7 +1282,7 @@ class AGOSEngine_PN : public AGOSEngine { void setupBoxes(); int readfromline(); public: - AGOSEngine_PN(OSystem *system); + AGOSEngine_PN(OSystem *system, const AGOSGameDescription *gd); ~AGOSEngine_PN(); virtual void setupGame(); @@ -1526,7 +1524,7 @@ protected: class AGOSEngine_Elvira1 : public AGOSEngine { public: - AGOSEngine_Elvira1(OSystem *system); + AGOSEngine_Elvira1(OSystem *system, const AGOSGameDescription *gd); //~AGOSEngine_Elvira1(); virtual void setupGame(); @@ -1607,7 +1605,7 @@ protected: class AGOSEngine_Elvira2 : public AGOSEngine_Elvira1 { public: - AGOSEngine_Elvira2(OSystem *system); + AGOSEngine_Elvira2(OSystem *system, const AGOSGameDescription *gd); //~AGOSEngine_Elvira2(); virtual void setupGame(); @@ -1702,7 +1700,7 @@ protected: class AGOSEngine_Waxworks : public AGOSEngine_Elvira2 { public: - AGOSEngine_Waxworks(OSystem *system); + AGOSEngine_Waxworks(OSystem *system, const AGOSGameDescription *gd); //~AGOSEngine_Waxworks(); virtual void setupGame(); @@ -1769,7 +1767,7 @@ protected: class AGOSEngine_Simon1 : public AGOSEngine_Waxworks { public: - AGOSEngine_Simon1(OSystem *system); + AGOSEngine_Simon1(OSystem *system, const AGOSGameDescription *gd); //~AGOSEngine_Simon1(); virtual void setupGame(); @@ -1840,7 +1838,7 @@ protected: class AGOSEngine_Simon2 : public AGOSEngine_Simon1 { public: - AGOSEngine_Simon2(OSystem *system); + AGOSEngine_Simon2(OSystem *system, const AGOSGameDescription *gd); //~AGOSEngine_Simon2(); virtual void setupGame(); @@ -1887,7 +1885,7 @@ protected: #ifdef ENABLE_AGOS2 class AGOSEngine_Feeble : public AGOSEngine_Simon2 { public: - AGOSEngine_Feeble(OSystem *system); + AGOSEngine_Feeble(OSystem *system, const AGOSGameDescription *gd); ~AGOSEngine_Feeble(); virtual void setupGame(); @@ -2026,7 +2024,7 @@ protected: class AGOSEngine_FeebleDemo : public AGOSEngine_Feeble { public: - AGOSEngine_FeebleDemo(OSystem *system); + AGOSEngine_FeebleDemo(OSystem *system, const AGOSGameDescription *gd); protected: bool _filmMenuUsed; @@ -2047,7 +2045,7 @@ protected: class AGOSEngine_PuzzlePack : public AGOSEngine_Feeble { public: - AGOSEngine_PuzzlePack(OSystem *system); + AGOSEngine_PuzzlePack(OSystem *system, const AGOSGameDescription *gd); //~AGOSEngine_PuzzlePack(); virtual void setupGame(); @@ -2106,7 +2104,7 @@ protected: class AGOSEngine_DIMP : public AGOSEngine_PuzzlePack { public: - AGOSEngine_DIMP(OSystem *system); + AGOSEngine_DIMP(OSystem *system, const AGOSGameDescription *gd); //~AGOSEngine_DIMP(); virtual void setupOpcodes(); diff --git a/engines/agos/animation.cpp b/engines/agos/animation.cpp index ee47f62a58..eb78ca3d9b 100644 --- a/engines/agos/animation.cpp +++ b/engines/agos/animation.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ diff --git a/engines/agos/animation.h b/engines/agos/animation.h index 77b02ffd13..e1d7207251 100644 --- a/engines/agos/animation.h +++ b/engines/agos/animation.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifdef ENABLE_AGOS2 diff --git a/engines/agos/charset-fontdata.cpp b/engines/agos/charset-fontdata.cpp index a131bb841b..b708b4890b 100644 --- a/engines/agos/charset-fontdata.cpp +++ b/engines/agos/charset-fontdata.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ diff --git a/engines/agos/charset.cpp b/engines/agos/charset.cpp index 5e9279c491..9d27afaa27 100644 --- a/engines/agos/charset.cpp +++ b/engines/agos/charset.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ diff --git a/engines/agos/contain.cpp b/engines/agos/contain.cpp index 932557e798..ba60c65ff3 100644 --- a/engines/agos/contain.cpp +++ b/engines/agos/contain.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ diff --git a/engines/agos/cursor.cpp b/engines/agos/cursor.cpp index cf42fe1f36..ef4a1406c9 100644 --- a/engines/agos/cursor.cpp +++ b/engines/agos/cursor.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ diff --git a/engines/agos/debug.cpp b/engines/agos/debug.cpp index bb27557a6b..9c44342975 100644 --- a/engines/agos/debug.cpp +++ b/engines/agos/debug.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ // AGOS debug functions diff --git a/engines/agos/debug.h b/engines/agos/debug.h index 5865065ac3..fd5908997f 100644 --- a/engines/agos/debug.h +++ b/engines/agos/debug.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef AGOS_DEBUG_H diff --git a/engines/agos/debugger.cpp b/engines/agos/debugger.cpp index 5f46a9bc93..a313dbbd1e 100644 --- a/engines/agos/debugger.cpp +++ b/engines/agos/debugger.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ diff --git a/engines/agos/debugger.h b/engines/agos/debugger.h index 43c04c67c2..0ab992ebbe 100644 --- a/engines/agos/debugger.h +++ b/engines/agos/debugger.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef AGOS_DEBUGGER_H diff --git a/engines/agos/detection.cpp b/engines/agos/detection.cpp index c8c70c0ecc..629a5d63fc 100644 --- a/engines/agos/detection.cpp +++ b/engines/agos/detection.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "base/plugins.h" @@ -151,44 +148,41 @@ bool AgosMetaEngine::createInstance(OSystem *syst, Engine **engine, const ADGame switch (gd->gameType) { case AGOS::GType_PN: - *engine = new AGOS::AGOSEngine_PN(syst); + *engine = new AGOS::AGOSEngine_PN(syst, gd); break; case AGOS::GType_ELVIRA1: - *engine = new AGOS::AGOSEngine_Elvira1(syst); + *engine = new AGOS::AGOSEngine_Elvira1(syst, gd); break; case AGOS::GType_ELVIRA2: - *engine = new AGOS::AGOSEngine_Elvira2(syst); + *engine = new AGOS::AGOSEngine_Elvira2(syst, gd); break; case AGOS::GType_WW: - *engine = new AGOS::AGOSEngine_Waxworks(syst); + *engine = new AGOS::AGOSEngine_Waxworks(syst, gd); break; case AGOS::GType_SIMON1: - *engine = new AGOS::AGOSEngine_Simon1(syst); + *engine = new AGOS::AGOSEngine_Simon1(syst, gd); break; case AGOS::GType_SIMON2: - *engine = new AGOS::AGOSEngine_Simon2(syst); + *engine = new AGOS::AGOSEngine_Simon2(syst, gd); break; #ifdef ENABLE_AGOS2 case AGOS::GType_FF: if (gd->features & GF_DEMO) - *engine = new AGOS::AGOSEngine_FeebleDemo(syst); + *engine = new AGOS::AGOSEngine_FeebleDemo(syst, gd); else - *engine = new AGOS::AGOSEngine_Feeble(syst); + *engine = new AGOS::AGOSEngine_Feeble(syst, gd); break; case AGOS::GType_PP: if (gd->gameId == GID_DIMP) - *engine = new AGOS::AGOSEngine_DIMP(syst); + *engine = new AGOS::AGOSEngine_DIMP(syst, gd); else - *engine = new AGOS::AGOSEngine_PuzzlePack(syst); + *engine = new AGOS::AGOSEngine_PuzzlePack(syst, gd); break; #endif default: res = false; error("AGOS engine: unknown gameType"); } - if (res) { - ((AGOS::AGOSEngine *)*engine)->_gameDescription = gd; - } return res; } diff --git a/engines/agos/detection_tables.h b/engines/agos/detection_tables.h index 963c08849c..a43d581173 100644 --- a/engines/agos/detection_tables.h +++ b/engines/agos/detection_tables.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ namespace AGOS { diff --git a/engines/agos/draw.cpp b/engines/agos/draw.cpp index 6b9f65ee2b..4d66b56a96 100644 --- a/engines/agos/draw.cpp +++ b/engines/agos/draw.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ diff --git a/engines/agos/event.cpp b/engines/agos/event.cpp index 8799dbaa28..3411e6d632 100644 --- a/engines/agos/event.cpp +++ b/engines/agos/event.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ diff --git a/engines/agos/feeble.cpp b/engines/agos/feeble.cpp index 843298c6d7..4c82b7e19d 100644 --- a/engines/agos/feeble.cpp +++ b/engines/agos/feeble.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ @@ -35,8 +32,8 @@ namespace AGOS { -AGOSEngine_Feeble::AGOSEngine_Feeble(OSystem *system) - : AGOSEngine_Simon2(system) { +AGOSEngine_Feeble::AGOSEngine_Feeble(OSystem *system, const AGOSGameDescription *gd) + : AGOSEngine_Simon2(system, gd) { _interactiveVideo = 0; _moviePlayer = 0; @@ -111,8 +108,8 @@ void AGOSEngine_Feeble::stopInteractiveVideo() { } } -AGOSEngine_FeebleDemo::AGOSEngine_FeebleDemo(OSystem *system) - : AGOSEngine_Feeble(system) { +AGOSEngine_FeebleDemo::AGOSEngine_FeebleDemo(OSystem *system, const AGOSGameDescription *gd) + : AGOSEngine_Feeble(system, gd) { _filmMenuUsed = 0; } diff --git a/engines/agos/gfx.cpp b/engines/agos/gfx.cpp index 4c998dfa5f..0b045bae01 100644 --- a/engines/agos/gfx.cpp +++ b/engines/agos/gfx.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ diff --git a/engines/agos/icons.cpp b/engines/agos/icons.cpp index 39a7705c54..ead4e49ebb 100644 --- a/engines/agos/icons.cpp +++ b/engines/agos/icons.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ diff --git a/engines/agos/input.cpp b/engines/agos/input.cpp index 1246149aa5..2ab543a943 100644 --- a/engines/agos/input.cpp +++ b/engines/agos/input.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ diff --git a/engines/agos/input_pn.cpp b/engines/agos/input_pn.cpp index 9c35fbb3a2..9cc97ff10f 100644 --- a/engines/agos/input_pn.cpp +++ b/engines/agos/input_pn.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ diff --git a/engines/agos/intern.h b/engines/agos/intern.h index 2f5fc6278f..18f56be4a4 100644 --- a/engines/agos/intern.h +++ b/engines/agos/intern.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef AGOS_INTERN_H diff --git a/engines/agos/items.cpp b/engines/agos/items.cpp index 5d1523bbd5..0fb873a733 100644 --- a/engines/agos/items.cpp +++ b/engines/agos/items.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ diff --git a/engines/agos/menus.cpp b/engines/agos/menus.cpp index 2b103a75cb..4d62e34820 100644 --- a/engines/agos/menus.cpp +++ b/engines/agos/menus.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ diff --git a/engines/agos/midi.cpp b/engines/agos/midi.cpp index 26e2f2c736..4459701d65 100644 --- a/engines/agos/midi.cpp +++ b/engines/agos/midi.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ diff --git a/engines/agos/midi.h b/engines/agos/midi.h index 40f54dbaf0..635e091906 100644 --- a/engines/agos/midi.h +++ b/engines/agos/midi.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef AGOS_MIDI_H diff --git a/engines/agos/midiparser_s1d.cpp b/engines/agos/midiparser_s1d.cpp index f96518b5e9..01690247f0 100644 --- a/engines/agos/midiparser_s1d.cpp +++ b/engines/agos/midiparser_s1d.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/debug.h" diff --git a/engines/agos/oracle.cpp b/engines/agos/oracle.cpp index 8ff79965e4..2a3c668c08 100644 --- a/engines/agos/oracle.cpp +++ b/engines/agos/oracle.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ diff --git a/engines/agos/pn.cpp b/engines/agos/pn.cpp index 62d65de219..667a5c3fc8 100644 --- a/engines/agos/pn.cpp +++ b/engines/agos/pn.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/config-manager.h" @@ -30,8 +27,8 @@ namespace AGOS { -AGOSEngine_PN::AGOSEngine_PN(OSystem *system) - : AGOSEngine(system) { +AGOSEngine_PN::AGOSEngine_PN(OSystem *system, const AGOSGameDescription *gd) + : AGOSEngine(system, gd) { _stackbase = 0; _tagOfActiveDoline = 0; diff --git a/engines/agos/res.cpp b/engines/agos/res.cpp index 0e818963e2..a71d4d8150 100644 --- a/engines/agos/res.cpp +++ b/engines/agos/res.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ // Resource file routines for Simon1/Simon2 diff --git a/engines/agos/res_ami.cpp b/engines/agos/res_ami.cpp index 35432e1cc4..b83d10364a 100644 --- a/engines/agos/res_ami.cpp +++ b/engines/agos/res_ami.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ // Conversion routines for planar graphics in Amiga versions diff --git a/engines/agos/res_snd.cpp b/engines/agos/res_snd.cpp index 34deff37ab..819af4fa40 100644 --- a/engines/agos/res_snd.cpp +++ b/engines/agos/res_snd.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/config-manager.h" diff --git a/engines/agos/rooms.cpp b/engines/agos/rooms.cpp index 0993197594..f2629e419e 100644 --- a/engines/agos/rooms.cpp +++ b/engines/agos/rooms.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ diff --git a/engines/agos/saveload.cpp b/engines/agos/saveload.cpp index d6f25814bb..deab57d0e6 100644 --- a/engines/agos/saveload.cpp +++ b/engines/agos/saveload.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/file.h" diff --git a/engines/agos/script.cpp b/engines/agos/script.cpp index 94a3f371cc..68a90e405b 100644 --- a/engines/agos/script.cpp +++ b/engines/agos/script.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ // Item script opcodes for Simon1/Simon2 diff --git a/engines/agos/script_dp.cpp b/engines/agos/script_dp.cpp index 6eb3ca4779..a4ee249f47 100644 --- a/engines/agos/script_dp.cpp +++ b/engines/agos/script_dp.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ diff --git a/engines/agos/script_e1.cpp b/engines/agos/script_e1.cpp index df37a38a7c..c7a2f5b0a2 100644 --- a/engines/agos/script_e1.cpp +++ b/engines/agos/script_e1.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ diff --git a/engines/agos/script_e2.cpp b/engines/agos/script_e2.cpp index f8af7db214..79a7e89a89 100644 --- a/engines/agos/script_e2.cpp +++ b/engines/agos/script_e2.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ diff --git a/engines/agos/script_ff.cpp b/engines/agos/script_ff.cpp index 8dfee7f7c7..e2a4d0820f 100644 --- a/engines/agos/script_ff.cpp +++ b/engines/agos/script_ff.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ diff --git a/engines/agos/script_pn.cpp b/engines/agos/script_pn.cpp index b8ba7fb015..bde59b71b8 100644 --- a/engines/agos/script_pn.cpp +++ b/engines/agos/script_pn.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "agos/agos.h" diff --git a/engines/agos/script_pp.cpp b/engines/agos/script_pp.cpp index 624a1bbeba..0a599506b5 100644 --- a/engines/agos/script_pp.cpp +++ b/engines/agos/script_pp.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ diff --git a/engines/agos/script_s1.cpp b/engines/agos/script_s1.cpp index dab0302631..0e7e66778e 100644 --- a/engines/agos/script_s1.cpp +++ b/engines/agos/script_s1.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ diff --git a/engines/agos/script_s2.cpp b/engines/agos/script_s2.cpp index a0b14525f2..c646397ac3 100644 --- a/engines/agos/script_s2.cpp +++ b/engines/agos/script_s2.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ diff --git a/engines/agos/script_ww.cpp b/engines/agos/script_ww.cpp index 679c67df64..29a91a15aa 100644 --- a/engines/agos/script_ww.cpp +++ b/engines/agos/script_ww.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ diff --git a/engines/agos/sound.cpp b/engines/agos/sound.cpp index 25d861acb5..03932aa4de 100644 --- a/engines/agos/sound.cpp +++ b/engines/agos/sound.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/file.h" diff --git a/engines/agos/sound.h b/engines/agos/sound.h index 9739cfb58f..a7c4cd73db 100644 --- a/engines/agos/sound.h +++ b/engines/agos/sound.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef AGOS_SOUND_H diff --git a/engines/agos/string.cpp b/engines/agos/string.cpp index 1152d6ed04..1cdd7f6d81 100644 --- a/engines/agos/string.cpp +++ b/engines/agos/string.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ diff --git a/engines/agos/string_pn.cpp b/engines/agos/string_pn.cpp index 92d85ab96c..9656eb469e 100644 --- a/engines/agos/string_pn.cpp +++ b/engines/agos/string_pn.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "agos/agos.h" diff --git a/engines/agos/subroutine.cpp b/engines/agos/subroutine.cpp index bd07596a46..bd9abb16b5 100644 --- a/engines/agos/subroutine.cpp +++ b/engines/agos/subroutine.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ diff --git a/engines/agos/verb.cpp b/engines/agos/verb.cpp index b05bac1e57..abc45c1ace 100644 --- a/engines/agos/verb.cpp +++ b/engines/agos/verb.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ // Verb and hitarea handling diff --git a/engines/agos/verb_pn.cpp b/engines/agos/verb_pn.cpp index b36f634ec0..19e8bb2d48 100644 --- a/engines/agos/verb_pn.cpp +++ b/engines/agos/verb_pn.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ // Verb and hitarea handling diff --git a/engines/agos/vga.cpp b/engines/agos/vga.cpp index 6c07db13c1..de6a6976e5 100644 --- a/engines/agos/vga.cpp +++ b/engines/agos/vga.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ // Video script opcodes for Simon1/Simon2 diff --git a/engines/agos/vga.h b/engines/agos/vga.h index 2a2056ca7b..5a5764532e 100644 --- a/engines/agos/vga.h +++ b/engines/agos/vga.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef AGOS_VGA_H diff --git a/engines/agos/vga_e2.cpp b/engines/agos/vga_e2.cpp index 9e163ba91f..1bde6945f0 100644 --- a/engines/agos/vga_e2.cpp +++ b/engines/agos/vga_e2.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ // Video script opcodes for Simon1/Simon2 diff --git a/engines/agos/vga_ff.cpp b/engines/agos/vga_ff.cpp index 14a1c60ae5..c8c9673506 100644 --- a/engines/agos/vga_ff.cpp +++ b/engines/agos/vga_ff.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ diff --git a/engines/agos/vga_pn.cpp b/engines/agos/vga_pn.cpp index d249259ba6..3bd5400504 100644 --- a/engines/agos/vga_pn.cpp +++ b/engines/agos/vga_pn.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "agos/agos.h" diff --git a/engines/agos/vga_s1.cpp b/engines/agos/vga_s1.cpp index a2306d3cdb..ef05063fc1 100644 --- a/engines/agos/vga_s1.cpp +++ b/engines/agos/vga_s1.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ diff --git a/engines/agos/vga_s2.cpp b/engines/agos/vga_s2.cpp index db3a7c18f3..1021ea8f94 100644 --- a/engines/agos/vga_s2.cpp +++ b/engines/agos/vga_s2.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ diff --git a/engines/agos/vga_ww.cpp b/engines/agos/vga_ww.cpp index 08b2cee303..c74f0cf52b 100644 --- a/engines/agos/vga_ww.cpp +++ b/engines/agos/vga_ww.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ // Video script opcodes for Simon1/Simon2 diff --git a/engines/agos/window.cpp b/engines/agos/window.cpp index 08680c9e45..c55e3dcdda 100644 --- a/engines/agos/window.cpp +++ b/engines/agos/window.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ diff --git a/engines/agos/zones.cpp b/engines/agos/zones.cpp index d44192d4d2..61efbcb89a 100644 --- a/engines/agos/zones.cpp +++ b/engines/agos/zones.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ diff --git a/engines/cine/anim.cpp b/engines/cine/anim.cpp index 6b4b29dcfe..410fcca1f3 100644 --- a/engines/cine/anim.cpp +++ b/engines/cine/anim.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ /** \file diff --git a/engines/cine/anim.h b/engines/cine/anim.h index 2012ef875e..9c06c260ce 100644 --- a/engines/cine/anim.h +++ b/engines/cine/anim.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef CINE_ANIM_H diff --git a/engines/cine/bg.cpp b/engines/cine/bg.cpp index 22fd28a99c..2bad2183f5 100644 --- a/engines/cine/bg.cpp +++ b/engines/cine/bg.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ diff --git a/engines/cine/bg.h b/engines/cine/bg.h index 9f97bc467d..c464cd68be 100644 --- a/engines/cine/bg.h +++ b/engines/cine/bg.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef CINE_BG_H diff --git a/engines/cine/bg_list.cpp b/engines/cine/bg_list.cpp index 3ecda4125d..693fea3294 100644 --- a/engines/cine/bg_list.cpp +++ b/engines/cine/bg_list.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ diff --git a/engines/cine/bg_list.h b/engines/cine/bg_list.h index 8c1b3cb6ec..c564b4b43f 100644 --- a/engines/cine/bg_list.h +++ b/engines/cine/bg_list.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef CINE_BGLIST_H diff --git a/engines/cine/cine.cpp b/engines/cine/cine.cpp index 8104ad38cd..6f34b0f860 100644 --- a/engines/cine/cine.cpp +++ b/engines/cine/cine.cpp @@ -18,12 +18,8 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ -#include "common/EventRecorder.h" #include "common/config-manager.h" #include "common/debug-channels.h" @@ -45,7 +41,10 @@ Sound *g_sound = 0; CineEngine *g_cine = 0; -CineEngine::CineEngine(OSystem *syst, const CINEGameDescription *gameDesc) : Engine(syst), _gameDescription(gameDesc) { +CineEngine::CineEngine(OSystem *syst, const CINEGameDescription *gameDesc) + : Engine(syst), + _gameDescription(gameDesc), + _rnd("cine") { // Setup mixer syncSoundSettings(); @@ -56,8 +55,6 @@ CineEngine::CineEngine(OSystem *syst, const CINEGameDescription *gameDesc) : Eng _console = new CineConsole(this); g_cine = this; - - g_eventRec.registerRandomSource(_rnd, "cine"); } CineEngine::~CineEngine() { diff --git a/engines/cine/cine.h b/engines/cine/cine.h index 7de0bdc86f..371ea0dd1f 100644 --- a/engines/cine/cine.h +++ b/engines/cine/cine.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef CINE_H diff --git a/engines/cine/console.cpp b/engines/cine/console.cpp index dbbeb4c9b7..0a24b2408a 100644 --- a/engines/cine/console.cpp +++ b/engines/cine/console.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "cine/console.h" diff --git a/engines/cine/console.h b/engines/cine/console.h index 92d059cb63..7c19621e5f 100644 --- a/engines/cine/console.h +++ b/engines/cine/console.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef CINE_CONSOLE_H diff --git a/engines/cine/detection.cpp b/engines/cine/detection.cpp index 058c1a1140..262798a34e 100644 --- a/engines/cine/detection.cpp +++ b/engines/cine/detection.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "base/plugins.h" @@ -93,7 +90,7 @@ public: CineMetaEngine() : AdvancedMetaEngine(detectionParams) {} virtual const char *getName() const { - return "Cinematique evo 1 engine"; + return "Cinematique evo 1"; } virtual const char *getOriginalCopyright() const { diff --git a/engines/cine/detection_tables.h b/engines/cine/detection_tables.h index 6e450ebc80..4b293deb62 100644 --- a/engines/cine/detection_tables.h +++ b/engines/cine/detection_tables.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ namespace Cine { diff --git a/engines/cine/gfx.cpp b/engines/cine/gfx.cpp index 18feacd08b..01e05bed6d 100644 --- a/engines/cine/gfx.cpp +++ b/engines/cine/gfx.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "cine/cine.h" diff --git a/engines/cine/gfx.h b/engines/cine/gfx.h index da7e3dd572..737c49cc36 100644 --- a/engines/cine/gfx.h +++ b/engines/cine/gfx.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef CINE_GFX_H diff --git a/engines/cine/main_loop.cpp b/engines/cine/main_loop.cpp index 644744d3ed..bb0545db72 100644 --- a/engines/cine/main_loop.cpp +++ b/engines/cine/main_loop.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ diff --git a/engines/cine/main_loop.h b/engines/cine/main_loop.h index c729b324ca..4ab29149d8 100644 --- a/engines/cine/main_loop.h +++ b/engines/cine/main_loop.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef CINE_MAINLOOP_H diff --git a/engines/cine/msg.cpp b/engines/cine/msg.cpp index 3d58d6ddcd..b84982b19e 100644 --- a/engines/cine/msg.cpp +++ b/engines/cine/msg.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/debug.h" diff --git a/engines/cine/msg.h b/engines/cine/msg.h index fbf99d4b44..8d6291e2df 100644 --- a/engines/cine/msg.h +++ b/engines/cine/msg.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef CINE_MSG_H diff --git a/engines/cine/object.cpp b/engines/cine/object.cpp index d69ddc1271..afd95c04b0 100644 --- a/engines/cine/object.cpp +++ b/engines/cine/object.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ diff --git a/engines/cine/object.h b/engines/cine/object.h index 5a5ea91286..8331cf9f89 100644 --- a/engines/cine/object.h +++ b/engines/cine/object.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef CINE_OBJECT_H diff --git a/engines/cine/pal.cpp b/engines/cine/pal.cpp index 0f52600db5..779c279ea1 100644 --- a/engines/cine/pal.cpp +++ b/engines/cine/pal.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "cine/cine.h" diff --git a/engines/cine/pal.h b/engines/cine/pal.h index 58d23e5bf0..d41154aa0b 100644 --- a/engines/cine/pal.h +++ b/engines/cine/pal.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef CINE_PAL_H diff --git a/engines/cine/part.cpp b/engines/cine/part.cpp index 17ef01948c..03cb743b46 100644 --- a/engines/cine/part.cpp +++ b/engines/cine/part.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/debug.h" diff --git a/engines/cine/part.h b/engines/cine/part.h index 53ebafaa37..3d321f17e1 100644 --- a/engines/cine/part.h +++ b/engines/cine/part.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef CINE_PART_H diff --git a/engines/cine/prc.cpp b/engines/cine/prc.cpp index 183a537416..d86107a8f8 100644 --- a/engines/cine/prc.cpp +++ b/engines/cine/prc.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ diff --git a/engines/cine/prc.h b/engines/cine/prc.h index 84058426fa..ff0147d81e 100644 --- a/engines/cine/prc.h +++ b/engines/cine/prc.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef CINE_PRC_H diff --git a/engines/cine/rel.cpp b/engines/cine/rel.cpp index 4a11995ee1..0af9a2bc1f 100644 --- a/engines/cine/rel.cpp +++ b/engines/cine/rel.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ diff --git a/engines/cine/rel.h b/engines/cine/rel.h index 8d712dc416..d102791f6b 100644 --- a/engines/cine/rel.h +++ b/engines/cine/rel.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef CINE_REL_H diff --git a/engines/cine/saveload.cpp b/engines/cine/saveload.cpp index 1fc2a8b2fd..700875e302 100644 --- a/engines/cine/saveload.cpp +++ b/engines/cine/saveload.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/debug.h" diff --git a/engines/cine/saveload.h b/engines/cine/saveload.h index f88338ed82..49c9c0cef7 100644 --- a/engines/cine/saveload.h +++ b/engines/cine/saveload.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef CINE_SAVELOAD_H diff --git a/engines/cine/script.h b/engines/cine/script.h index 756bc930e8..3fc86c585b 100644 --- a/engines/cine/script.h +++ b/engines/cine/script.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef CINE_SCRIPT_H diff --git a/engines/cine/script_fw.cpp b/engines/cine/script_fw.cpp index 674bf4dd86..66150cc5b2 100644 --- a/engines/cine/script_fw.cpp +++ b/engines/cine/script_fw.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ /** \file diff --git a/engines/cine/script_os.cpp b/engines/cine/script_os.cpp index aa2c8c33ac..b452d9a8ee 100644 --- a/engines/cine/script_os.cpp +++ b/engines/cine/script_os.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ /** \file diff --git a/engines/cine/sound.cpp b/engines/cine/sound.cpp index 414761159b..0c3541fae7 100644 --- a/engines/cine/sound.cpp +++ b/engines/cine/sound.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/endian.h" diff --git a/engines/cine/sound.h b/engines/cine/sound.h index 7b506ab5f3..afc0994a26 100644 --- a/engines/cine/sound.h +++ b/engines/cine/sound.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef CINE_SOUND_H_ diff --git a/engines/cine/texte.cpp b/engines/cine/texte.cpp index fb6818d690..dc18d081c7 100644 --- a/engines/cine/texte.cpp +++ b/engines/cine/texte.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/file.h" diff --git a/engines/cine/texte.h b/engines/cine/texte.h index a23f43913a..f82127db98 100644 --- a/engines/cine/texte.h +++ b/engines/cine/texte.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef CINE_TEXTE_H diff --git a/engines/cine/unpack.cpp b/engines/cine/unpack.cpp index 7915fd1cf8..f68fbbc02c 100644 --- a/engines/cine/unpack.cpp +++ b/engines/cine/unpack.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ diff --git a/engines/cine/unpack.h b/engines/cine/unpack.h index 3215689867..d22c4944a7 100644 --- a/engines/cine/unpack.h +++ b/engines/cine/unpack.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef CINE_UNPACK_H diff --git a/engines/cine/various.cpp b/engines/cine/various.cpp index fdc7a28867..1892a78cca 100644 --- a/engines/cine/various.cpp +++ b/engines/cine/various.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ diff --git a/engines/cine/various.h b/engines/cine/various.h index 3a14328035..0c1883c323 100644 --- a/engines/cine/various.h +++ b/engines/cine/various.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef CINE_VARIOUS_H diff --git a/engines/cruise/actor.cpp b/engines/cruise/actor.cpp index 2c83aff743..94f620ed7b 100644 --- a/engines/cruise/actor.cpp +++ b/engines/cruise/actor.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/textconsole.h" diff --git a/engines/cruise/actor.h b/engines/cruise/actor.h index d55aac1eca..b409bf7b7f 100644 --- a/engines/cruise/actor.h +++ b/engines/cruise/actor.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef CRUISE_ACTOR_H diff --git a/engines/cruise/background.cpp b/engines/cruise/background.cpp index 7c63c155d3..1e7e87cf38 100644 --- a/engines/cruise/background.cpp +++ b/engines/cruise/background.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/textconsole.h" diff --git a/engines/cruise/background.h b/engines/cruise/background.h index caa90bea0f..7a8f2d5494 100644 --- a/engines/cruise/background.h +++ b/engines/cruise/background.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef CRUISE_BACKGROUND_H diff --git a/engines/cruise/backgroundIncrust.cpp b/engines/cruise/backgroundIncrust.cpp index 1685044c9d..39286670ed 100644 --- a/engines/cruise/backgroundIncrust.cpp +++ b/engines/cruise/backgroundIncrust.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "cruise/cruise_main.h" diff --git a/engines/cruise/backgroundIncrust.h b/engines/cruise/backgroundIncrust.h index 19982ee91c..567df0a51e 100644 --- a/engines/cruise/backgroundIncrust.h +++ b/engines/cruise/backgroundIncrust.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef CRUISE_BACKGROUNDINCRUST_H diff --git a/engines/cruise/cell.cpp b/engines/cruise/cell.cpp index 19189721e3..f0fb580ec1 100644 --- a/engines/cruise/cell.cpp +++ b/engines/cruise/cell.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "cruise/cruise_main.h" diff --git a/engines/cruise/cell.h b/engines/cruise/cell.h index 32b3455661..3620a0c945 100644 --- a/engines/cruise/cell.h +++ b/engines/cruise/cell.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef CRUISE_CELL_H diff --git a/engines/cruise/cruise.cpp b/engines/cruise/cruise.cpp index 9712bd9439..1e0b7b1d7a 100644 --- a/engines/cruise/cruise.cpp +++ b/engines/cruise/cruise.cpp @@ -18,12 +18,8 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ -#include "common/EventRecorder.h" #include "common/file.h" #include "common/debug-channels.h" #include "common/textconsole.h" @@ -44,7 +40,8 @@ namespace Cruise { CruiseEngine *_vm; -CruiseEngine::CruiseEngine(OSystem * syst, const CRUISEGameDescription *gameDesc) : Engine(syst), _gameDescription(gameDesc) { +CruiseEngine::CruiseEngine(OSystem * syst, const CRUISEGameDescription *gameDesc) + : Engine(syst), _gameDescription(gameDesc), _rnd("cruise") { DebugMan.addDebugChannel(kCruiseDebugScript, "scripts", "Scripts debug level"); DebugMan.addDebugChannel(kCruiseDebugSound, "sound", "Sound debug level"); @@ -55,8 +52,6 @@ CruiseEngine::CruiseEngine(OSystem * syst, const CRUISEGameDescription *gameDesc // Setup mixer syncSoundSettings(); - - g_eventRec.registerRandomSource(_rnd, "cruise"); } extern void listMemory(); diff --git a/engines/cruise/cruise.h b/engines/cruise/cruise.h index 8d03d47327..a9eb39c3f2 100644 --- a/engines/cruise/cruise.h +++ b/engines/cruise/cruise.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef CRUISE_CRUISE_H diff --git a/engines/cruise/cruise_main.cpp b/engines/cruise/cruise_main.cpp index e2f2d7468e..3f13c6cbff 100644 --- a/engines/cruise/cruise_main.cpp +++ b/engines/cruise/cruise_main.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/config-manager.h" diff --git a/engines/cruise/cruise_main.h b/engines/cruise/cruise_main.h index 8657b4bc21..9afae4336b 100644 --- a/engines/cruise/cruise_main.h +++ b/engines/cruise/cruise_main.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef CRUISE_CRUISE_MAIN_H diff --git a/engines/cruise/ctp.cpp b/engines/cruise/ctp.cpp index f1223c12e6..a7b6faec1c 100644 --- a/engines/cruise/ctp.cpp +++ b/engines/cruise/ctp.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "cruise/cruise.h" diff --git a/engines/cruise/ctp.h b/engines/cruise/ctp.h index 0aec9c52d8..340832e6fb 100644 --- a/engines/cruise/ctp.h +++ b/engines/cruise/ctp.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef CRUISE_CTP_H diff --git a/engines/cruise/dataLoader.cpp b/engines/cruise/dataLoader.cpp index 3ccd1689b8..66bc0fbf46 100644 --- a/engines/cruise/dataLoader.cpp +++ b/engines/cruise/dataLoader.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "cruise/cruise_main.h" diff --git a/engines/cruise/dataLoader.h b/engines/cruise/dataLoader.h index f6bea29cde..96188c7982 100644 --- a/engines/cruise/dataLoader.h +++ b/engines/cruise/dataLoader.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef CRUISE_DATALOADER_H diff --git a/engines/cruise/debugger.cpp b/engines/cruise/debugger.cpp index 3d3d69be58..a74f600ddd 100644 --- a/engines/cruise/debugger.cpp +++ b/engines/cruise/debugger.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "cruise/debugger.h" diff --git a/engines/cruise/debugger.h b/engines/cruise/debugger.h index 356acdbf84..3cef6b371d 100644 --- a/engines/cruise/debugger.h +++ b/engines/cruise/debugger.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef CRUISE_DEBUGGER_H diff --git a/engines/cruise/decompiler.cpp b/engines/cruise/decompiler.cpp index 3298776d0e..74a78201bc 100644 --- a/engines/cruise/decompiler.cpp +++ b/engines/cruise/decompiler.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "cruise/cruise_main.h" diff --git a/engines/cruise/delphine-unpack.cpp b/engines/cruise/delphine-unpack.cpp index a78a8af84b..ee7dbd3c5e 100644 --- a/engines/cruise/delphine-unpack.cpp +++ b/engines/cruise/delphine-unpack.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ diff --git a/engines/cruise/detection.cpp b/engines/cruise/detection.cpp index 63d7328e78..4aaaf03e29 100644 --- a/engines/cruise/detection.cpp +++ b/engines/cruise/detection.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ @@ -250,7 +247,7 @@ public: CruiseMetaEngine() : AdvancedMetaEngine(detectionParams) {} virtual const char *getName() const { - return "Cinematique evo 2 engine"; + return "Cinematique evo 2"; } virtual const char *getOriginalCopyright() const { diff --git a/engines/cruise/font.cpp b/engines/cruise/font.cpp index 2bf36bbdbd..a6680f7a02 100644 --- a/engines/cruise/font.cpp +++ b/engines/cruise/font.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/endian.h" diff --git a/engines/cruise/font.h b/engines/cruise/font.h index 17bb4372cf..679faf194d 100644 --- a/engines/cruise/font.h +++ b/engines/cruise/font.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef CRUISE_FONT_H diff --git a/engines/cruise/function.cpp b/engines/cruise/function.cpp index 75b90f7ec8..27b9be7e79 100644 --- a/engines/cruise/function.cpp +++ b/engines/cruise/function.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "cruise/cruise.h" diff --git a/engines/cruise/function.h b/engines/cruise/function.h index 347c9f23b8..4fba8d3c63 100644 --- a/engines/cruise/function.h +++ b/engines/cruise/function.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef CRUISE_FUNCTION_H diff --git a/engines/cruise/gfxModule.cpp b/engines/cruise/gfxModule.cpp index 4d48c2c466..7bbcae2259 100644 --- a/engines/cruise/gfxModule.cpp +++ b/engines/cruise/gfxModule.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ diff --git a/engines/cruise/gfxModule.h b/engines/cruise/gfxModule.h index 1ca2581af5..ce58c65d34 100644 --- a/engines/cruise/gfxModule.h +++ b/engines/cruise/gfxModule.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef CRUISE_GFXMODULE_H diff --git a/engines/cruise/linker.cpp b/engines/cruise/linker.cpp index afc7992493..e8ef415fe7 100644 --- a/engines/cruise/linker.cpp +++ b/engines/cruise/linker.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/endian.h" diff --git a/engines/cruise/linker.h b/engines/cruise/linker.h index f513d15845..ce212f6cea 100644 --- a/engines/cruise/linker.h +++ b/engines/cruise/linker.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef CRUISE_LINKER_H diff --git a/engines/cruise/mainDraw.cpp b/engines/cruise/mainDraw.cpp index f6b04e6d9d..336471b6ff 100644 --- a/engines/cruise/mainDraw.cpp +++ b/engines/cruise/mainDraw.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "cruise/cruise_main.h" diff --git a/engines/cruise/mainDraw.h b/engines/cruise/mainDraw.h index 306fb6845d..bb21f515af 100644 --- a/engines/cruise/mainDraw.h +++ b/engines/cruise/mainDraw.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef CRUISE_MAINDRAW_H diff --git a/engines/cruise/menu.cpp b/engines/cruise/menu.cpp index 36689ca0e3..407858574c 100644 --- a/engines/cruise/menu.cpp +++ b/engines/cruise/menu.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "cruise/cruise.h" diff --git a/engines/cruise/menu.h b/engines/cruise/menu.h index 3ee2ae6579..d605903cdc 100644 --- a/engines/cruise/menu.h +++ b/engines/cruise/menu.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef CRUISE_MENU_H diff --git a/engines/cruise/mouse.cpp b/engines/cruise/mouse.cpp index 24309030da..6248bd01d3 100644 --- a/engines/cruise/mouse.cpp +++ b/engines/cruise/mouse.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "cruise/cruise_main.h" diff --git a/engines/cruise/mouse.h b/engines/cruise/mouse.h index 509267ad26..a5f5c19073 100644 --- a/engines/cruise/mouse.h +++ b/engines/cruise/mouse.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef CRUISE_MOUSE_H diff --git a/engines/cruise/object.cpp b/engines/cruise/object.cpp index 8e2be0cf13..b4a3489c1d 100644 --- a/engines/cruise/object.cpp +++ b/engines/cruise/object.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/textconsole.h" diff --git a/engines/cruise/object.h b/engines/cruise/object.h index 625e8e479e..cbe5872a9d 100644 --- a/engines/cruise/object.h +++ b/engines/cruise/object.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef CRUISE_OBJECT_H diff --git a/engines/cruise/overlay.cpp b/engines/cruise/overlay.cpp index b7a0293f33..2f4b375865 100644 --- a/engines/cruise/overlay.cpp +++ b/engines/cruise/overlay.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/memstream.h" diff --git a/engines/cruise/overlay.h b/engines/cruise/overlay.h index 7b2f34b73d..3b69f2acef 100644 --- a/engines/cruise/overlay.h +++ b/engines/cruise/overlay.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef CRUISE_OVERLAY_H diff --git a/engines/cruise/perso.cpp b/engines/cruise/perso.cpp index e86daa5bef..85c9b1614f 100644 --- a/engines/cruise/perso.cpp +++ b/engines/cruise/perso.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "cruise/cruise.h" diff --git a/engines/cruise/perso.h b/engines/cruise/perso.h index 19201ecafb..e0ca479dff 100644 --- a/engines/cruise/perso.h +++ b/engines/cruise/perso.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef CRUISE_PERSO_H diff --git a/engines/cruise/polys.cpp b/engines/cruise/polys.cpp index 76792a69ba..964540f802 100644 --- a/engines/cruise/polys.cpp +++ b/engines/cruise/polys.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "cruise/cruise_main.h" diff --git a/engines/cruise/polys.h b/engines/cruise/polys.h index 53ce4672cd..8505f791a6 100644 --- a/engines/cruise/polys.h +++ b/engines/cruise/polys.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef CRUISE_POLYS_H diff --git a/engines/cruise/saveload.cpp b/engines/cruise/saveload.cpp index 6e75088d45..6392009373 100644 --- a/engines/cruise/saveload.cpp +++ b/engines/cruise/saveload.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "cruise/cruise_main.h" diff --git a/engines/cruise/saveload.h b/engines/cruise/saveload.h index 9aa1f89e0f..695913f46f 100644 --- a/engines/cruise/saveload.h +++ b/engines/cruise/saveload.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef CRUISE_SAVELOAD_H diff --git a/engines/cruise/script.cpp b/engines/cruise/script.cpp index d6ff784644..4e76194a45 100644 --- a/engines/cruise/script.cpp +++ b/engines/cruise/script.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "cruise/cruise.h" diff --git a/engines/cruise/script.h b/engines/cruise/script.h index 2a7a85689d..cba4f580f8 100644 --- a/engines/cruise/script.h +++ b/engines/cruise/script.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef CRUISE_SCRIPT_H diff --git a/engines/cruise/sound.cpp b/engines/cruise/sound.cpp index 322f808439..290cc220d4 100644 --- a/engines/cruise/sound.cpp +++ b/engines/cruise/sound.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/endian.h" diff --git a/engines/cruise/sound.h b/engines/cruise/sound.h index 61985ce802..11aec0b04e 100644 --- a/engines/cruise/sound.h +++ b/engines/cruise/sound.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef CRUISE_SOUND_H diff --git a/engines/cruise/stack.cpp b/engines/cruise/stack.cpp index 4f36dbec48..985fe8d7fd 100644 --- a/engines/cruise/stack.cpp +++ b/engines/cruise/stack.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "cruise/cruise_main.h" diff --git a/engines/cruise/stack.h b/engines/cruise/stack.h index a7cd3f556d..fe2d594c9e 100644 --- a/engines/cruise/stack.h +++ b/engines/cruise/stack.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef CRUISE_STACK_H diff --git a/engines/cruise/staticres.cpp b/engines/cruise/staticres.cpp index 101a2038b0..1565f254d0 100644 --- a/engines/cruise/staticres.cpp +++ b/engines/cruise/staticres.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "cruise/staticres.h" diff --git a/engines/cruise/staticres.h b/engines/cruise/staticres.h index af37b14f5e..a3cf13e41c 100644 --- a/engines/cruise/staticres.h +++ b/engines/cruise/staticres.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef CRUISE_STATICRES_H diff --git a/engines/cruise/various.cpp b/engines/cruise/various.cpp index 599da22de3..90b072b478 100644 --- a/engines/cruise/various.cpp +++ b/engines/cruise/various.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "cruise/cruise_main.h" diff --git a/engines/cruise/various.h b/engines/cruise/various.h index 9471464b32..b59593961d 100644 --- a/engines/cruise/various.h +++ b/engines/cruise/various.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef CRUISE_VARIOUS_H diff --git a/engines/cruise/vars.cpp b/engines/cruise/vars.cpp index 07bd646cae..f381358356 100644 --- a/engines/cruise/vars.cpp +++ b/engines/cruise/vars.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "cruise/cruise_main.h" diff --git a/engines/cruise/vars.h b/engines/cruise/vars.h index 54920a1436..ccbf149610 100644 --- a/engines/cruise/vars.h +++ b/engines/cruise/vars.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef CRUISE_VARS_H diff --git a/engines/cruise/volume.cpp b/engines/cruise/volume.cpp index 5535d5a016..773a146b9a 100644 --- a/engines/cruise/volume.cpp +++ b/engines/cruise/volume.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "cruise/cruise.h" diff --git a/engines/cruise/volume.h b/engines/cruise/volume.h index a842a30470..80e1f10db2 100644 --- a/engines/cruise/volume.h +++ b/engines/cruise/volume.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef CRUISE_VOLUME_H diff --git a/engines/dialogs.cpp b/engines/dialogs.cpp index 7e1f29271e..75b2ca9296 100644 --- a/engines/dialogs.cpp +++ b/engines/dialogs.cpp @@ -17,9 +17,6 @@ * 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. - * - * $URL$ - * $Id$ */ #include "base/version.h" diff --git a/engines/dialogs.h b/engines/dialogs.h index 587e91a2bb..32174031cc 100644 --- a/engines/dialogs.h +++ b/engines/dialogs.h @@ -17,9 +17,6 @@ * 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. - * - * $URL$ - * $Id$ */ #ifndef GLOBAL_DIALOGS_H diff --git a/engines/draci/animation.cpp b/engines/draci/animation.cpp index f2f1727fdd..6e6f167fba 100644 --- a/engines/draci/animation.cpp +++ b/engines/draci/animation.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "draci/draci.h" diff --git a/engines/draci/animation.h b/engines/draci/animation.h index bbcf03b02f..8b2a3d98b8 100644 --- a/engines/draci/animation.h +++ b/engines/draci/animation.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef DRACI_ANIMATION_H diff --git a/engines/draci/barchive.cpp b/engines/draci/barchive.cpp index 5307e04250..154073250c 100644 --- a/engines/draci/barchive.cpp +++ b/engines/draci/barchive.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/debug.h" diff --git a/engines/draci/barchive.h b/engines/draci/barchive.h index 87ee301de5..52ce79ad2d 100644 --- a/engines/draci/barchive.h +++ b/engines/draci/barchive.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef DRACI_BARCHIVE_H diff --git a/engines/draci/console.cpp b/engines/draci/console.cpp index 304b421ac3..a0013c59fe 100644 --- a/engines/draci/console.cpp +++ b/engines/draci/console.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "draci/console.h" diff --git a/engines/draci/console.h b/engines/draci/console.h index 9d463f2eb1..714871ffd3 100644 --- a/engines/draci/console.h +++ b/engines/draci/console.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef DRACI_CONSOLE_H diff --git a/engines/draci/detection.cpp b/engines/draci/detection.cpp index 78c5c71605..572ecce77b 100644 --- a/engines/draci/detection.cpp +++ b/engines/draci/detection.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "draci/draci.h" @@ -116,7 +113,7 @@ public: DraciMetaEngine() : AdvancedMetaEngine(detectionParams) {} virtual const char *getName() const { - return "Draci Historie Engine"; + return "Draci Historie"; } virtual const char *getOriginalCopyright() const { diff --git a/engines/draci/draci.cpp b/engines/draci/draci.cpp index 45d17ea24f..cdc91e8d9f 100644 --- a/engines/draci/draci.cpp +++ b/engines/draci/draci.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/scummsys.h" @@ -30,7 +27,6 @@ #include "common/events.h" #include "common/file.h" #include "common/keyboard.h" -#include "common/EventRecorder.h" #include "engines/util.h" @@ -74,7 +70,8 @@ const uint kSoundsFrequency = 13000; const uint kDubbingFrequency = 22050; DraciEngine::DraciEngine(OSystem *syst, const ADGameDescription *gameDesc) - : Engine(syst) { + : Engine(syst), _rnd("draci") { + // Put your engine in a sane state, but do nothing big yet; // in particular, do not load data from files; rather, if you // need to do such things, do them from init(). @@ -95,9 +92,6 @@ DraciEngine::DraciEngine(OSystem *syst, const ADGameDescription *gameDesc) DebugMan.addDebugChannel(kDraciWalkingDebugLevel, "walking", "Walking debug info"); _console = new DraciConsole(this); - - // Don't forget to register your random source - g_eventRec.registerRandomSource(_rnd, "draci"); } bool DraciEngine::hasFeature(EngineFeature f) const { diff --git a/engines/draci/draci.h b/engines/draci/draci.h index 6a597e123e..83e69ca332 100644 --- a/engines/draci/draci.h +++ b/engines/draci/draci.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef DRACI_H diff --git a/engines/draci/font.cpp b/engines/draci/font.cpp index d869d046f3..b4e799deb7 100644 --- a/engines/draci/font.cpp +++ b/engines/draci/font.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/file.h" diff --git a/engines/draci/font.h b/engines/draci/font.h index 0ccc900465..3d150f733e 100644 --- a/engines/draci/font.h +++ b/engines/draci/font.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef DRACI_FONT_H diff --git a/engines/draci/game.cpp b/engines/draci/game.cpp index e19ec67810..657e381986 100644 --- a/engines/draci/game.cpp +++ b/engines/draci/game.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/keyboard.h" diff --git a/engines/draci/game.h b/engines/draci/game.h index 0b5b3a03cc..47821fcf86 100644 --- a/engines/draci/game.h +++ b/engines/draci/game.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef DRACI_GAME_H diff --git a/engines/draci/mouse.cpp b/engines/draci/mouse.cpp index 5853d15d21..90c04ed4c3 100644 --- a/engines/draci/mouse.cpp +++ b/engines/draci/mouse.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "draci/draci.h" diff --git a/engines/draci/mouse.h b/engines/draci/mouse.h index c7f492cb6e..b934475ade 100644 --- a/engines/draci/mouse.h +++ b/engines/draci/mouse.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef DRACI_MOUSE_H diff --git a/engines/draci/music.cpp b/engines/draci/music.cpp index 1d725ebb15..6f3e3c8384 100644 --- a/engines/draci/music.cpp +++ b/engines/draci/music.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ // MIDI and digital music class diff --git a/engines/draci/music.h b/engines/draci/music.h index c0228074e5..62288a01dc 100644 --- a/engines/draci/music.h +++ b/engines/draci/music.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ // Music class diff --git a/engines/draci/saveload.cpp b/engines/draci/saveload.cpp index 32e852d9a6..ffb1ed7ff4 100644 --- a/engines/draci/saveload.cpp +++ b/engines/draci/saveload.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "draci/draci.h" diff --git a/engines/draci/saveload.h b/engines/draci/saveload.h index ca5f002ecd..3cc13701db 100644 --- a/engines/draci/saveload.h +++ b/engines/draci/saveload.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef DRACI_SAVELOAD_H diff --git a/engines/draci/screen.cpp b/engines/draci/screen.cpp index ab9c49c63a..8c1a0c40f7 100644 --- a/engines/draci/screen.cpp +++ b/engines/draci/screen.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/memstream.h" diff --git a/engines/draci/screen.h b/engines/draci/screen.h index e4e910475a..5a8297feba 100644 --- a/engines/draci/screen.h +++ b/engines/draci/screen.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef DRACI_SCREEN_H diff --git a/engines/draci/script.cpp b/engines/draci/script.cpp index a7ce8b27d9..c4df9d9dde 100644 --- a/engines/draci/script.cpp +++ b/engines/draci/script.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/array.h" diff --git a/engines/draci/script.h b/engines/draci/script.h index a75f6bcbc3..d788dfb66f 100644 --- a/engines/draci/script.h +++ b/engines/draci/script.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef DRACI_SCRIPT_H diff --git a/engines/draci/sound.cpp b/engines/draci/sound.cpp index ab2479f811..bbba9d9cc0 100644 --- a/engines/draci/sound.cpp +++ b/engines/draci/sound.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/archive.h" diff --git a/engines/draci/sound.h b/engines/draci/sound.h index 4f69af7ff0..358c228604 100644 --- a/engines/draci/sound.h +++ b/engines/draci/sound.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef DRACI_SOUND_H diff --git a/engines/draci/sprite.cpp b/engines/draci/sprite.cpp index b4296375f2..92ce7d31d9 100644 --- a/engines/draci/sprite.cpp +++ b/engines/draci/sprite.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/memstream.h" diff --git a/engines/draci/sprite.h b/engines/draci/sprite.h index 15e1cf80ca..c86728914e 100644 --- a/engines/draci/sprite.h +++ b/engines/draci/sprite.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef DRACI_SPRITE_H diff --git a/engines/draci/surface.cpp b/engines/draci/surface.cpp index 37a76dbe0e..8380f8777b 100644 --- a/engines/draci/surface.cpp +++ b/engines/draci/surface.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "draci/screen.h" diff --git a/engines/draci/surface.h b/engines/draci/surface.h index cb15ecebe4..71a3722a2a 100644 --- a/engines/draci/surface.h +++ b/engines/draci/surface.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef DRACI_SURFACE_H diff --git a/engines/draci/walking.cpp b/engines/draci/walking.cpp index d72e50be07..9a66c6163a 100644 --- a/engines/draci/walking.cpp +++ b/engines/draci/walking.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/memstream.h" diff --git a/engines/draci/walking.h b/engines/draci/walking.h index d6c7f0691d..a43aeb272a 100644 --- a/engines/draci/walking.h +++ b/engines/draci/walking.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef DRACI_WALKING_H diff --git a/engines/drascula/actors.cpp b/engines/drascula/actors.cpp index c0b0b7c98b..9d5d6550fa 100644 --- a/engines/drascula/actors.cpp +++ b/engines/drascula/actors.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "drascula/drascula.h" diff --git a/engines/drascula/animation.cpp b/engines/drascula/animation.cpp index f939a033d3..c4a8d3eb01 100644 --- a/engines/drascula/animation.cpp +++ b/engines/drascula/animation.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "drascula/drascula.h" diff --git a/engines/drascula/console.cpp b/engines/drascula/console.cpp index aa9fcc0960..d2fd32f2e5 100644 --- a/engines/drascula/console.cpp +++ b/engines/drascula/console.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "drascula/console.h" diff --git a/engines/drascula/console.h b/engines/drascula/console.h index d8d1918a60..894c85ff42 100644 --- a/engines/drascula/console.h +++ b/engines/drascula/console.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef DRASCULA_CONSOLE_H diff --git a/engines/drascula/converse.cpp b/engines/drascula/converse.cpp index dcd93d84d7..6f028e6e12 100644 --- a/engines/drascula/converse.cpp +++ b/engines/drascula/converse.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/textconsole.h" diff --git a/engines/drascula/detection.cpp b/engines/drascula/detection.cpp index 8729290d52..5a8903db9d 100644 --- a/engines/drascula/detection.cpp +++ b/engines/drascula/detection.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "base/plugins.h" @@ -299,7 +296,7 @@ public: DrasculaMetaEngine() : AdvancedMetaEngine(detectionParams) {} virtual const char *getName() const { - return "Drascula Engine"; + return "Drascula"; } virtual const char *getOriginalCopyright() const { diff --git a/engines/drascula/drascula.cpp b/engines/drascula/drascula.cpp index 470f28ccff..cac7f93f12 100644 --- a/engines/drascula/drascula.cpp +++ b/engines/drascula/drascula.cpp @@ -18,13 +18,9 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/events.h" -#include "common/EventRecorder.h" #include "common/keyboard.h" #include "common/file.h" #include "common/savefile.h" @@ -100,8 +96,7 @@ DrasculaEngine::DrasculaEngine(OSystem *syst, const DrasculaGameDescription *gam rightMouseButton = 0; *textName = 0; - _rnd = new Common::RandomSource(); - g_eventRec.registerRandomSource(*_rnd, "drascula"); + _rnd = new Common::RandomSource("drascula"); _console = 0; diff --git a/engines/drascula/drascula.h b/engines/drascula/drascula.h index ac3f86b9ba..f9dcbe2810 100644 --- a/engines/drascula/drascula.h +++ b/engines/drascula/drascula.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef DRASCULA_H @@ -573,8 +570,8 @@ public: void enterName(); bool soundIsActive(); void waitFrameSSN(); - void mixVideo(byte *OldScreen, byte *NewScreen); - void decodeRLE(byte *BufferRLE, byte *MiVideoRLE); + void mixVideo(byte *OldScreen, byte *NewScreen, uint16 oldPitch); + void decodeRLE(byte *BufferRLE, byte *MiVideoRLE, uint16 pitch = 320); void decodeOffset(byte *BufferOFF, byte *MiVideoOFF, int length); int playFrameSSN(Common::SeekableReadStream *stream); diff --git a/engines/drascula/graphics.cpp b/engines/drascula/graphics.cpp index 4cd91e48a0..d133b3609d 100644 --- a/engines/drascula/graphics.cpp +++ b/engines/drascula/graphics.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "drascula/drascula.h" @@ -134,14 +131,18 @@ void DrasculaEngine::showFrame(Common::SeekableReadStream *stream, bool firstFra } byte *prevFrame = (byte *)malloc(64000); - byte *screenBuffer = (byte *)_system->lockScreen()->pixels; - memcpy(prevFrame, screenBuffer, 64000); + Graphics::Surface *screenSurf = _system->lockScreen(); + byte *screenBuffer = (byte *)screenSurf->pixels; + uint16 screenPitch = screenSurf->pitch; + for (int y = 0; y < 200; y++) { + memcpy(prevFrame+y*320, screenBuffer+y*screenPitch, 320); + } - decodeRLE(pcxData, screenBuffer); + decodeRLE(pcxData, screenBuffer, screenPitch); free(pcxData); if (!firstFrame) - mixVideo(screenBuffer, prevFrame); + mixVideo(screenBuffer, prevFrame, screenPitch); _system->unlockScreen(); _system->updateScreen(); @@ -446,7 +447,9 @@ void DrasculaEngine::screenSaver() { int x1_, y1_, off1, off2; - byte *screenBuffer = (byte *)_system->lockScreen()->pixels; + Graphics::Surface *screenSurf = _system->lockScreen(); + byte *screenBuffer = (byte *)screenSurf->pixels; + uint16 screenPitch = screenSurf->pitch; for (int i = 0; i < 200; i++) { for (int j = 0; j < 320; j++) { x1_ = j + tempRow[i]; @@ -464,7 +467,7 @@ void DrasculaEngine::screenSaver() { y1_ = checkWrapY(y1_); off2 = 320 * y1_ + x1_; - screenBuffer[320 * i + j] = ghost[bgSurface[off2] + (copia[off1] << 8)]; + screenBuffer[screenPitch * i + j] = ghost[bgSurface[off2] + (copia[off1] << 8)]; } } @@ -533,11 +536,14 @@ int DrasculaEngine::playFrameSSN(Common::SeekableReadStream *stream) { free(BufferSSN); waitFrameSSN(); - byte *screenBuffer = (byte *)_system->lockScreen()->pixels; + Graphics::Surface *screenSurf = _system->lockScreen(); + byte *screenBuffer = (byte *)screenSurf->pixels; + uint16 screenPitch = screenSurf->pitch; if (FrameSSN) - mixVideo(screenBuffer, screenSurface); + mixVideo(screenBuffer, screenSurface, screenPitch); else - memcpy(screenBuffer, screenSurface, 64000); + for (int y = 0; y < 200; y++) + memcpy(screenBuffer+y*screenPitch, screenSurface+y*320, 320); _system->unlockScreen(); _system->updateScreen(); @@ -549,11 +555,14 @@ int DrasculaEngine::playFrameSSN(Common::SeekableReadStream *stream) { decodeOffset(BufferSSN, screenSurface, length); free(BufferSSN); waitFrameSSN(); - byte *screenBuffer = (byte *)_system->lockScreen()->pixels; + Graphics::Surface *screenSurf = _system->lockScreen(); + byte *screenBuffer = (byte *)screenSurf->pixels; + uint16 screenPitch = screenSurf->pitch; if (FrameSSN) - mixVideo(screenBuffer, screenSurface); + mixVideo(screenBuffer, screenSurface, screenPitch); else - memcpy(screenBuffer, screenSurface, 64000); + for (int y = 0; y < 200; y++) + memcpy(screenBuffer+y*screenPitch, screenSurface+y*320, 320); _system->unlockScreen(); _system->updateScreen(); @@ -589,11 +598,12 @@ void DrasculaEngine::decodeOffset(byte *BufferOFF, byte *MiVideoOFF, int length) } } -void DrasculaEngine::decodeRLE(byte* srcPtr, byte* dstPtr) { + void DrasculaEngine::decodeRLE(byte* srcPtr, byte* dstPtr, uint16 pitch) { bool stopProcessing = false; byte pixel; uint repeat; - int curByte = 0; + int curByte = 0, curLine = 0; + pitch -= 320; while (!stopProcessing) { pixel = *srcPtr++; @@ -604,17 +614,25 @@ void DrasculaEngine::decodeRLE(byte* srcPtr, byte* dstPtr) { } for (uint j = 0; j < repeat; j++) { *dstPtr++ = pixel; - if (++curByte >= 64000) { - stopProcessing = true; - break; + if (++curByte >= 320) { + curByte = 0; + dstPtr += pitch; + if (++curLine >= 200) { + stopProcessing = true; + break; + } } } } } -void DrasculaEngine::mixVideo(byte *OldScreen, byte *NewScreen) { - for (int x = 0; x < 64000; x++) - OldScreen[x] ^= NewScreen[x]; +void DrasculaEngine::mixVideo(byte *OldScreen, byte *NewScreen, uint16 oldPitch) { + for (int y = 0; y < 200; y++) { + for (int x = 0; x < 320; x++) + OldScreen[x] ^= NewScreen[x]; + OldScreen += oldPitch; + NewScreen += 320; + } } void DrasculaEngine::waitFrameSSN() { diff --git a/engines/drascula/interface.cpp b/engines/drascula/interface.cpp index 7bb94c2542..eb36baed18 100644 --- a/engines/drascula/interface.cpp +++ b/engines/drascula/interface.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "drascula/drascula.h" diff --git a/engines/drascula/objects.cpp b/engines/drascula/objects.cpp index 630eb08d3c..07b8464de4 100644 --- a/engines/drascula/objects.cpp +++ b/engines/drascula/objects.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/textconsole.h" diff --git a/engines/drascula/palette.cpp b/engines/drascula/palette.cpp index a75e72e249..500333badf 100644 --- a/engines/drascula/palette.cpp +++ b/engines/drascula/palette.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "graphics/palette.h" diff --git a/engines/drascula/resource.cpp b/engines/drascula/resource.cpp index cca1e47586..bda25113b7 100644 --- a/engines/drascula/resource.cpp +++ b/engines/drascula/resource.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "drascula/drascula.h" diff --git a/engines/drascula/rooms.cpp b/engines/drascula/rooms.cpp index 35d4eedb5d..50d44bab79 100644 --- a/engines/drascula/rooms.cpp +++ b/engines/drascula/rooms.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/array.h" diff --git a/engines/drascula/saveload.cpp b/engines/drascula/saveload.cpp index eacbe6756d..15f5855bdc 100644 --- a/engines/drascula/saveload.cpp +++ b/engines/drascula/saveload.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/textconsole.h" diff --git a/engines/drascula/sound.cpp b/engines/drascula/sound.cpp index 5cb1c4486a..4721d2d369 100644 --- a/engines/drascula/sound.cpp +++ b/engines/drascula/sound.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "audio/audiostream.h" diff --git a/engines/drascula/talk.cpp b/engines/drascula/talk.cpp index 8cefe0385c..6d1509fe3c 100644 --- a/engines/drascula/talk.cpp +++ b/engines/drascula/talk.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "drascula/drascula.h" diff --git a/engines/engine.cpp b/engines/engine.cpp index 2c1d3a732c..b3cb8bea06 100644 --- a/engines/engine.cpp +++ b/engines/engine.cpp @@ -17,9 +17,6 @@ * 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. - * - * $URL$ - * $Id$ */ #define FORBIDDEN_SYMBOL_EXCEPTION_getcwd diff --git a/engines/engine.h b/engines/engine.h index b7afc0f09d..375df2b0a3 100644 --- a/engines/engine.h +++ b/engines/engine.h @@ -17,9 +17,6 @@ * 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. - * - * $URL$ - * $Id$ */ #ifndef ENGINES_ENGINE_H diff --git a/engines/game.cpp b/engines/game.cpp index a27080cbf8..a14edb8af4 100644 --- a/engines/game.cpp +++ b/engines/game.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "engines/game.h" diff --git a/engines/game.h b/engines/game.h index c9a3b25853..f9988c2965 100644 --- a/engines/game.h +++ b/engines/game.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef ENGINES_GAME_H diff --git a/engines/gob/console.cpp b/engines/gob/console.cpp index 751956a848..b8aed37727 100644 --- a/engines/gob/console.cpp +++ b/engines/gob/console.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "gob/console.h" diff --git a/engines/gob/console.h b/engines/gob/console.h index 91e62f370e..b9f9b81d0e 100644 --- a/engines/gob/console.h +++ b/engines/gob/console.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef GOB_CONSOLE_H diff --git a/engines/gob/databases.cpp b/engines/gob/databases.cpp index 94f641db4e..497de489ce 100644 --- a/engines/gob/databases.cpp +++ b/engines/gob/databases.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/file.h" diff --git a/engines/gob/databases.h b/engines/gob/databases.h index cb76ae3b86..fb65d8cf96 100644 --- a/engines/gob/databases.h +++ b/engines/gob/databases.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef GOB_DATABASES_H diff --git a/engines/gob/dataio.cpp b/engines/gob/dataio.cpp index 78fc0ab3c1..a576cf9487 100644 --- a/engines/gob/dataio.cpp +++ b/engines/gob/dataio.cpp @@ -18,14 +18,12 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/endian.h" #include "common/types.h" #include "common/memstream.h" +#include "common/substream.h" #include "gob/gob.h" #include "gob/dataio.h" @@ -345,9 +343,8 @@ Common::SeekableReadStream *DataIO::getFile(File &file) { if (!file.archive->file.seek(file.offset)) return 0; - Common::SeekableReadStream *rawData = file.archive->file.readStream(file.size); - if (!rawData) - return 0; + Common::SeekableReadStream *rawData = + new Common::SafeSubReadStream(&file.archive->file, file.offset, file.offset + file.size); if (!file.packed) return rawData; diff --git a/engines/gob/dataio.h b/engines/gob/dataio.h index f2b39aed09..d95f001097 100644 --- a/engines/gob/dataio.h +++ b/engines/gob/dataio.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef GOB_DATAIO_H diff --git a/engines/gob/dbase.cpp b/engines/gob/dbase.cpp index 12c382dbcb..41bd5308ec 100644 --- a/engines/gob/dbase.cpp +++ b/engines/gob/dbase.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "gob/dbase.h" diff --git a/engines/gob/dbase.h b/engines/gob/dbase.h index 5f260f965f..3da1ef7270 100644 --- a/engines/gob/dbase.h +++ b/engines/gob/dbase.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef GOB_DBASE_H diff --git a/engines/gob/demos/batplayer.cpp b/engines/gob/demos/batplayer.cpp index 700aa6316f..9c073f0e77 100644 --- a/engines/gob/demos/batplayer.cpp +++ b/engines/gob/demos/batplayer.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/endian.h" diff --git a/engines/gob/demos/batplayer.h b/engines/gob/demos/batplayer.h index e9d9916f6a..f406ea1bf8 100644 --- a/engines/gob/demos/batplayer.h +++ b/engines/gob/demos/batplayer.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef GOB_BATPLAYER_H diff --git a/engines/gob/demos/demoplayer.cpp b/engines/gob/demos/demoplayer.cpp index 715e78adbc..9aa7a4123d 100644 --- a/engines/gob/demos/demoplayer.cpp +++ b/engines/gob/demos/demoplayer.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/endian.h" @@ -53,6 +50,9 @@ DemoPlayer::Script DemoPlayer::_scripts[] = { "slide xant.imd 20\nslide tum.imd 20\nslide voile.imd 20\n" \ "slide int.imd 20\nslide voila.imd 1\nslide voilb.imd 1\n"}, {kScriptSourceFile, "coktelplayer.scn"}, + {kScriptSourceFile, "demogb.scn"}, + {kScriptSourceFile, "demoall.scn"}, + {kScriptSourceFile, "demofra.scn"} }; DemoPlayer::DemoPlayer(GobEngine *vm) : _vm(vm) { diff --git a/engines/gob/demos/demoplayer.h b/engines/gob/demos/demoplayer.h index 207b050363..9ffdb71de1 100644 --- a/engines/gob/demos/demoplayer.h +++ b/engines/gob/demos/demoplayer.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef GOB_DEMOPLAYER_H diff --git a/engines/gob/demos/scnplayer.cpp b/engines/gob/demos/scnplayer.cpp index bf81773a15..434c49c4bd 100644 --- a/engines/gob/demos/scnplayer.cpp +++ b/engines/gob/demos/scnplayer.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/endian.h" diff --git a/engines/gob/demos/scnplayer.h b/engines/gob/demos/scnplayer.h index 1eb0ae4ba8..8627f8ceeb 100644 --- a/engines/gob/demos/scnplayer.h +++ b/engines/gob/demos/scnplayer.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef GOB_SCNPLAYER_H diff --git a/engines/gob/detection.cpp b/engines/gob/detection.cpp index a1eb8055aa..be44c05bfb 100644 --- a/engines/gob/detection.cpp +++ b/engines/gob/detection.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "base/plugins.h" @@ -119,7 +116,7 @@ public: GobMetaEngine() : AdvancedMetaEngine(detectionParams) {} virtual const char *getName() const { - return "Gob Engine"; + return "Gob"; } virtual const char *getOriginalCopyright() const { diff --git a/engines/gob/detection_tables.h b/engines/gob/detection_tables.h index b12fb81be1..11cca2b65e 100644 --- a/engines/gob/detection_tables.h +++ b/engines/gob/detection_tables.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ namespace Gob { @@ -2278,6 +2275,20 @@ static const GOBGameDescription gameDescriptions[] = { kFeaturesAdLib, "disk0.stk", 0, 0 }, + { // Supplied by alex86r in bug report #3297633 + { + "fascination", + "VGA 3 disks edition", + AD_ENTRY1s("disk0.stk", "ab3dfdce43917bc806812959d692fc8f", 1061929), + IT_ITA, + kPlatformPC, + ADGF_NO_FLAGS, + GUIO_NOSUBTITLES | GUIO_NOSPEECH + }, + kGameTypeFascination, + kFeaturesAdLib, + "disk0.stk", 0, 0 + }, { { "fascination", @@ -3779,6 +3790,20 @@ static const GOBGameDescription gameDescriptions[] = { kFeatures640x480 | kFeaturesTrueColor, 0, 0, 0 }, + { // Supplied by alex86r in bug report #3297602 + { + "urban", + "", + AD_ENTRY1s("intro.stk", "4e4a3c017fe5475353bf94c455fe3efd", 1253448), + IT_ITA, + kPlatformPC, + ADGF_NO_FLAGS, + GUIO_NOSUBTITLES | GUIO_NOSPEECH + }, + kGameTypeUrban, + kFeatures640x480 | kFeaturesTrueColor, + 0, 0, 0 + }, { // Supplied by goodoldgeorg in bug report #2770340 { "urban", @@ -4766,6 +4791,60 @@ static const GOBGameDescription gameDescriptions[] = { kFeaturesNone, 0, 0, 0 }, + { + { + "adibou2", + "Non-Interactive Demo", + { + {"demogb.scn", 0, "9291455a908ac0e6aaaca686e532609b", 105}, + {"demogb.vmd", 0, "bc9c1db97db7bec8f566332444fa0090", 14320840}, + {0, 0, 0, 0} + }, + EN_GRB, + kPlatformPC, + ADGF_DEMO, + GUIO_NOSUBTITLES | GUIO_NOSPEECH + }, + kGameTypeAdibou2, + kFeatures640x480 | kFeaturesSCNDemo, + 0, 0, 9 + }, + { + { + "adibou2", + "Non-Interactive Demo", + { + {"demoall.scn", 0, "c8fd308c037b829800006332b2c32674", 106}, + {"demoall.vmd", 0, "4672b2deacc6fca97484840424b1921b", 14263433}, + {0, 0, 0, 0} + }, + DE_DEU, + kPlatformPC, + ADGF_DEMO, + GUIO_NOSUBTITLES | GUIO_NOSPEECH + }, + kGameTypeAdibou2, + kFeatures640x480 | kFeaturesSCNDemo, + 0, 0, 10 + }, + { + { + "adibou2", + "Non-Interactive Demo", + { + {"demofra.scn", 0, "d1b2b1618af384ea1120def8b986c02b", 106}, + {"demofra.vmd", 0, "b494cdec1aac7e54c3f2480512d2880e", 14297100}, + {0, 0, 0, 0} + }, + FR_FRA, + kPlatformPC, + ADGF_DEMO, + GUIO_NOSUBTITLES | GUIO_NOSPEECH + }, + kGameTypeAdibou2, + kFeatures640x480 | kFeaturesSCNDemo, + 0, 0, 11 + }, { AD_TABLE_END_MARKER, kGameTypeNone, kFeaturesNone, 0, 0, 0} }; diff --git a/engines/gob/draw.cpp b/engines/gob/draw.cpp index d193f6bfa4..580696523f 100644 --- a/engines/gob/draw.cpp +++ b/engines/gob/draw.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/endian.h" diff --git a/engines/gob/draw.h b/engines/gob/draw.h index 59bcd58bdb..57faefa314 100644 --- a/engines/gob/draw.h +++ b/engines/gob/draw.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef GOB_DRAW_H diff --git a/engines/gob/draw_bargon.cpp b/engines/gob/draw_bargon.cpp index d335310dcf..a2a70927f6 100644 --- a/engines/gob/draw_bargon.cpp +++ b/engines/gob/draw_bargon.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "gob/gob.h" diff --git a/engines/gob/draw_fascin.cpp b/engines/gob/draw_fascin.cpp index 3f939e7790..69e04f74c9 100644 --- a/engines/gob/draw_fascin.cpp +++ b/engines/gob/draw_fascin.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "gob/draw.h" diff --git a/engines/gob/draw_playtoons.cpp b/engines/gob/draw_playtoons.cpp index edd7b76318..a443f81ccf 100644 --- a/engines/gob/draw_playtoons.cpp +++ b/engines/gob/draw_playtoons.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/endian.h" diff --git a/engines/gob/draw_v1.cpp b/engines/gob/draw_v1.cpp index fd0fb8ae4f..3873a99d5f 100644 --- a/engines/gob/draw_v1.cpp +++ b/engines/gob/draw_v1.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/endian.h" diff --git a/engines/gob/draw_v2.cpp b/engines/gob/draw_v2.cpp index 15a8f7ff8e..cc8f6b5e3c 100644 --- a/engines/gob/draw_v2.cpp +++ b/engines/gob/draw_v2.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/endian.h" @@ -899,17 +896,12 @@ void Draw_v2::spriteOperation(int16 operation) { _spriteTop = spriteTop; _spriteRight = spriteRight; _spriteBottom = spriteBottom; - _destSpriteX = destSpriteX; + if (operation != DRAW_PRINTTEXT) + _destSpriteX = destSpriteX; _destSpriteY = destSpriteY; _destSurface = destSurface; _sourceSurface = sourceSurface; - if (operation == DRAW_PRINTTEXT) { - len = _fonts[_fontIndex]->getCharWidth(); - adjustCoords(1, &len, 0); - _destSpriteX += len * strlen(_textToPrint); - } - if ((_renderFlags & RENDERFLAG_USEDELTAS) && !deltaVeto) { if (_sourceSurface == kBackSurface) { _spriteLeft -= _backDeltaX; diff --git a/engines/gob/expression.cpp b/engines/gob/expression.cpp index d053345b4c..fdb4233444 100644 --- a/engines/gob/expression.cpp +++ b/engines/gob/expression.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/endian.h" diff --git a/engines/gob/expression.h b/engines/gob/expression.h index 2c27ddc8e7..ecce7c869d 100644 --- a/engines/gob/expression.h +++ b/engines/gob/expression.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef GOB_EXPRESSION_H diff --git a/engines/gob/game.cpp b/engines/gob/game.cpp index 44a730cda0..926027e15d 100644 --- a/engines/gob/game.cpp +++ b/engines/gob/game.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/endian.h" diff --git a/engines/gob/game.h b/engines/gob/game.h index f529f7c025..b3057ac262 100644 --- a/engines/gob/game.h +++ b/engines/gob/game.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef GOB_GAME_H diff --git a/engines/gob/global.cpp b/engines/gob/global.cpp index 8b8fb3d4c9..1264c09860 100644 --- a/engines/gob/global.cpp +++ b/engines/gob/global.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "gob/gob.h" diff --git a/engines/gob/global.h b/engines/gob/global.h index 24925bc58a..fa2f2c9637 100644 --- a/engines/gob/global.h +++ b/engines/gob/global.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef GOB_GLOBAL_H diff --git a/engines/gob/gob.cpp b/engines/gob/gob.cpp index 3d697d3693..ea7e329480 100644 --- a/engines/gob/gob.cpp +++ b/engines/gob/gob.cpp @@ -18,13 +18,9 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/debug-channels.h" -#include "common/EventRecorder.h" #include "backends/audiocd/audiocd.h" #include "base/plugins.h" @@ -113,7 +109,7 @@ void PauseDialog::handleKeyDown(Common::KeyState state) { } -GobEngine::GobEngine(OSystem *syst) : Engine(syst) { +GobEngine::GobEngine(OSystem *syst) : Engine(syst), _rnd("gob") { _sound = 0; _mult = 0; _game = 0; _global = 0; _dataIO = 0; _goblin = 0; _vidPlayer = 0; _init = 0; _inter = 0; @@ -148,8 +144,6 @@ GobEngine::GobEngine(OSystem *syst) : Engine(syst) { DebugMan.addDebugChannel(kDebugVideo, "Video", "IMD/VMD video debug level"); DebugMan.addDebugChannel(kDebugHotspots, "Hotspots", "Hotspots debug level"); DebugMan.addDebugChannel(kDebugDemo, "Demo", "Demo script debug level"); - - g_eventRec.registerRandomSource(_rnd, "gob"); } GobEngine::~GobEngine() { diff --git a/engines/gob/gob.h b/engines/gob/gob.h index 4a928747b0..74c882e021 100644 --- a/engines/gob/gob.h +++ b/engines/gob/gob.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef GOB_GOB_H diff --git a/engines/gob/goblin.cpp b/engines/gob/goblin.cpp index 402b33d5fd..a032588a1f 100644 --- a/engines/gob/goblin.cpp +++ b/engines/gob/goblin.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/str.h" diff --git a/engines/gob/goblin.h b/engines/gob/goblin.h index c2bcaa5752..3d45da599d 100644 --- a/engines/gob/goblin.h +++ b/engines/gob/goblin.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef GOB_GOBLIN_H diff --git a/engines/gob/goblin_v1.cpp b/engines/gob/goblin_v1.cpp index 3dc4c6611d..ea46b4b9a1 100644 --- a/engines/gob/goblin_v1.cpp +++ b/engines/gob/goblin_v1.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/endian.h" diff --git a/engines/gob/goblin_v2.cpp b/engines/gob/goblin_v2.cpp index 2b4a529bdb..2dbdf39d7d 100644 --- a/engines/gob/goblin_v2.cpp +++ b/engines/gob/goblin_v2.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/endian.h" diff --git a/engines/gob/goblin_v3.cpp b/engines/gob/goblin_v3.cpp index 0cb3aadc71..38880bfdb6 100644 --- a/engines/gob/goblin_v3.cpp +++ b/engines/gob/goblin_v3.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "gob/gob.h" diff --git a/engines/gob/goblin_v4.cpp b/engines/gob/goblin_v4.cpp index 523357aab1..0d6a995af9 100644 --- a/engines/gob/goblin_v4.cpp +++ b/engines/gob/goblin_v4.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "gob/gob.h" diff --git a/engines/gob/hotspots.cpp b/engines/gob/hotspots.cpp index 301d594eb9..f3647af76e 100644 --- a/engines/gob/hotspots.cpp +++ b/engines/gob/hotspots.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/str.h" diff --git a/engines/gob/hotspots.h b/engines/gob/hotspots.h index 7346c66bb5..8d26ad224e 100644 --- a/engines/gob/hotspots.h +++ b/engines/gob/hotspots.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef GOB_HOTSPOTS_H diff --git a/engines/gob/iniconfig.cpp b/engines/gob/iniconfig.cpp index f08303c0bb..9b8f1c703e 100644 --- a/engines/gob/iniconfig.cpp +++ b/engines/gob/iniconfig.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "gob/iniconfig.h" diff --git a/engines/gob/iniconfig.h b/engines/gob/iniconfig.h index fc35315207..bf60f2d125 100644 --- a/engines/gob/iniconfig.h +++ b/engines/gob/iniconfig.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef GOB_INICONFIG_H diff --git a/engines/gob/init.cpp b/engines/gob/init.cpp index 7a757caadf..90c2a1602a 100644 --- a/engines/gob/init.cpp +++ b/engines/gob/init.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/endian.h" diff --git a/engines/gob/init.h b/engines/gob/init.h index ba4b1f979d..1cb2904099 100644 --- a/engines/gob/init.h +++ b/engines/gob/init.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef GOB_INIT_H diff --git a/engines/gob/init_fascin.cpp b/engines/gob/init_fascin.cpp index 9842b7e752..b87d816406 100644 --- a/engines/gob/init_fascin.cpp +++ b/engines/gob/init_fascin.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/endian.h" diff --git a/engines/gob/init_v1.cpp b/engines/gob/init_v1.cpp index af09626fe7..6772a13eb0 100644 --- a/engines/gob/init_v1.cpp +++ b/engines/gob/init_v1.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/endian.h" diff --git a/engines/gob/init_v2.cpp b/engines/gob/init_v2.cpp index 78be68d48c..f10d586a34 100644 --- a/engines/gob/init_v2.cpp +++ b/engines/gob/init_v2.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/endian.h" diff --git a/engines/gob/init_v3.cpp b/engines/gob/init_v3.cpp index b3816c10e9..bfbe00849f 100644 --- a/engines/gob/init_v3.cpp +++ b/engines/gob/init_v3.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/endian.h" diff --git a/engines/gob/init_v4.cpp b/engines/gob/init_v4.cpp index 3bd50a494d..ba92c2fc04 100644 --- a/engines/gob/init_v4.cpp +++ b/engines/gob/init_v4.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/endian.h" diff --git a/engines/gob/init_v6.cpp b/engines/gob/init_v6.cpp index 76f006533f..947556835a 100644 --- a/engines/gob/init_v6.cpp +++ b/engines/gob/init_v6.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/endian.h" diff --git a/engines/gob/init_v7.cpp b/engines/gob/init_v7.cpp index 709cefb69d..b5b51aad2a 100644 --- a/engines/gob/init_v7.cpp +++ b/engines/gob/init_v7.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/fs.h" diff --git a/engines/gob/inter.cpp b/engines/gob/inter.cpp index 9b4b06eea3..9df3c06c74 100644 --- a/engines/gob/inter.cpp +++ b/engines/gob/inter.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/endian.h" diff --git a/engines/gob/inter.h b/engines/gob/inter.h index 1807dc3ad7..78d5e34271 100644 --- a/engines/gob/inter.h +++ b/engines/gob/inter.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef GOB_INTER_H diff --git a/engines/gob/inter_bargon.cpp b/engines/gob/inter_bargon.cpp index 4dcdff8c6c..c2e6a2e912 100644 --- a/engines/gob/inter_bargon.cpp +++ b/engines/gob/inter_bargon.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/endian.h" diff --git a/engines/gob/inter_fascin.cpp b/engines/gob/inter_fascin.cpp index 5e820cef02..bab1975abc 100644 --- a/engines/gob/inter_fascin.cpp +++ b/engines/gob/inter_fascin.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/endian.h" diff --git a/engines/gob/inter_inca2.cpp b/engines/gob/inter_inca2.cpp index 01d3cda33e..f868f18242 100644 --- a/engines/gob/inter_inca2.cpp +++ b/engines/gob/inter_inca2.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/endian.h" diff --git a/engines/gob/inter_playtoons.cpp b/engines/gob/inter_playtoons.cpp index c5f9d2df06..d57d2f354b 100644 --- a/engines/gob/inter_playtoons.cpp +++ b/engines/gob/inter_playtoons.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/endian.h" diff --git a/engines/gob/inter_v1.cpp b/engines/gob/inter_v1.cpp index 8f1ff4c73f..47b0beaf63 100644 --- a/engines/gob/inter_v1.cpp +++ b/engines/gob/inter_v1.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/str.h" diff --git a/engines/gob/inter_v2.cpp b/engines/gob/inter_v2.cpp index 6a42b5ecd4..84cae3b380 100644 --- a/engines/gob/inter_v2.cpp +++ b/engines/gob/inter_v2.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/endian.h" diff --git a/engines/gob/inter_v3.cpp b/engines/gob/inter_v3.cpp index 8a5a839244..47486b0899 100644 --- a/engines/gob/inter_v3.cpp +++ b/engines/gob/inter_v3.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/endian.h" diff --git a/engines/gob/inter_v4.cpp b/engines/gob/inter_v4.cpp index 1da92b3766..f89af0e45a 100644 --- a/engines/gob/inter_v4.cpp +++ b/engines/gob/inter_v4.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/str.h" diff --git a/engines/gob/inter_v5.cpp b/engines/gob/inter_v5.cpp index f5e87bb936..ed371737bd 100644 --- a/engines/gob/inter_v5.cpp +++ b/engines/gob/inter_v5.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "gui/message.h" diff --git a/engines/gob/inter_v6.cpp b/engines/gob/inter_v6.cpp index 53ebfe7513..589328dfdb 100644 --- a/engines/gob/inter_v6.cpp +++ b/engines/gob/inter_v6.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/str.h" diff --git a/engines/gob/inter_v7.cpp b/engines/gob/inter_v7.cpp index c318252b68..a36154fe5e 100644 --- a/engines/gob/inter_v7.cpp +++ b/engines/gob/inter_v7.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/endian.h" diff --git a/engines/gob/map.cpp b/engines/gob/map.cpp index 503b934074..57f5f7af48 100644 --- a/engines/gob/map.cpp +++ b/engines/gob/map.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "gob/gob.h" diff --git a/engines/gob/map.h b/engines/gob/map.h index 48a9d1d4ac..856cf356da 100644 --- a/engines/gob/map.h +++ b/engines/gob/map.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef GOB_MAP_H diff --git a/engines/gob/map_v1.cpp b/engines/gob/map_v1.cpp index 372f501887..45499b71fe 100644 --- a/engines/gob/map_v1.cpp +++ b/engines/gob/map_v1.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/memstream.h" diff --git a/engines/gob/map_v2.cpp b/engines/gob/map_v2.cpp index 42c98c4a80..1db461370f 100644 --- a/engines/gob/map_v2.cpp +++ b/engines/gob/map_v2.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/stream.h" diff --git a/engines/gob/mult.cpp b/engines/gob/mult.cpp index f744f14faf..06a7130cef 100644 --- a/engines/gob/mult.cpp +++ b/engines/gob/mult.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/endian.h" diff --git a/engines/gob/mult.h b/engines/gob/mult.h index fc83e2dbe3..860e5a12e1 100644 --- a/engines/gob/mult.h +++ b/engines/gob/mult.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef GOB_MULT_H diff --git a/engines/gob/mult_v1.cpp b/engines/gob/mult_v1.cpp index 78ee3e60f5..230d0d2b4c 100644 --- a/engines/gob/mult_v1.cpp +++ b/engines/gob/mult_v1.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/endian.h" diff --git a/engines/gob/mult_v2.cpp b/engines/gob/mult_v2.cpp index 8018fb15c6..6593565e6a 100644 --- a/engines/gob/mult_v2.cpp +++ b/engines/gob/mult_v2.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/endian.h" diff --git a/engines/gob/palanim.cpp b/engines/gob/palanim.cpp index 755d28c6e9..42aeaf63eb 100644 --- a/engines/gob/palanim.cpp +++ b/engines/gob/palanim.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ diff --git a/engines/gob/palanim.h b/engines/gob/palanim.h index 6c91665b29..8d8a1e4388 100644 --- a/engines/gob/palanim.h +++ b/engines/gob/palanim.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef GOB_PALANIM_H diff --git a/engines/gob/resources.cpp b/engines/gob/resources.cpp index 0c838ca246..92eec0ee25 100644 --- a/engines/gob/resources.cpp +++ b/engines/gob/resources.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/util.h" diff --git a/engines/gob/resources.h b/engines/gob/resources.h index dec64f6b7c..39155c5176 100644 --- a/engines/gob/resources.h +++ b/engines/gob/resources.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef GOB_RESOURCES_H diff --git a/engines/gob/save/saveconverter.cpp b/engines/gob/save/saveconverter.cpp index 59d313138b..f24cb60005 100644 --- a/engines/gob/save/saveconverter.cpp +++ b/engines/gob/save/saveconverter.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/endian.h" diff --git a/engines/gob/save/saveconverter.h b/engines/gob/save/saveconverter.h index 8154377b64..d8cf723fd3 100644 --- a/engines/gob/save/saveconverter.h +++ b/engines/gob/save/saveconverter.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef GOB_SAVE_SAVECONVERTER_H diff --git a/engines/gob/save/saveconverter_v2.cpp b/engines/gob/save/saveconverter_v2.cpp index 1260a26280..7661c47836 100644 --- a/engines/gob/save/saveconverter_v2.cpp +++ b/engines/gob/save/saveconverter_v2.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/endian.h" diff --git a/engines/gob/save/saveconverter_v3.cpp b/engines/gob/save/saveconverter_v3.cpp index 2f52c789c6..2256575c4b 100644 --- a/engines/gob/save/saveconverter_v3.cpp +++ b/engines/gob/save/saveconverter_v3.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/endian.h" diff --git a/engines/gob/save/saveconverter_v4.cpp b/engines/gob/save/saveconverter_v4.cpp index ea5afaeebd..2618a25f37 100644 --- a/engines/gob/save/saveconverter_v4.cpp +++ b/engines/gob/save/saveconverter_v4.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/endian.h" diff --git a/engines/gob/save/savefile.cpp b/engines/gob/save/savefile.cpp index 45cd2a2b7d..0713c38684 100644 --- a/engines/gob/save/savefile.cpp +++ b/engines/gob/save/savefile.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/util.h" diff --git a/engines/gob/save/savefile.h b/engines/gob/save/savefile.h index 22eb79f4bf..01825207e0 100644 --- a/engines/gob/save/savefile.h +++ b/engines/gob/save/savefile.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef GOB_SAVE_SAVEFILE_H diff --git a/engines/gob/save/savehandler.cpp b/engines/gob/save/savehandler.cpp index 8cb8274402..9e46f1db6f 100644 --- a/engines/gob/save/savehandler.cpp +++ b/engines/gob/save/savehandler.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/endian.h" @@ -113,8 +110,8 @@ void SlotFileIndexed::buildIndex(byte *buffer, SavePartInfo &info, if (setLongest) { uint32 slot0Len; for (slot0Len = strlen((const char *) bufferStart); slot0Len < longest; slot0Len++) - buffer[slot0Len] = ' '; - buffer[slot0Len] = '\0'; + bufferStart[slot0Len] = ' '; + bufferStart[slot0Len] = '\0'; } } diff --git a/engines/gob/save/savehandler.h b/engines/gob/save/savehandler.h index d12d6bca0d..afc31f54f1 100644 --- a/engines/gob/save/savehandler.h +++ b/engines/gob/save/savehandler.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef GOB_SAVE_SAVEHANDLER_H diff --git a/engines/gob/save/saveload.cpp b/engines/gob/save/saveload.cpp index e490509914..6b2f710159 100644 --- a/engines/gob/save/saveload.cpp +++ b/engines/gob/save/saveload.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "gob/gob.h" diff --git a/engines/gob/save/saveload.h b/engines/gob/save/saveload.h index dc1c184504..4d51a5b51c 100644 --- a/engines/gob/save/saveload.h +++ b/engines/gob/save/saveload.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef GOB_SAVE_SAVELOAD_H diff --git a/engines/gob/save/saveload_fascin.cpp b/engines/gob/save/saveload_fascin.cpp index 6c3d22ecf3..cf1e7f0c0c 100644 --- a/engines/gob/save/saveload_fascin.cpp +++ b/engines/gob/save/saveload_fascin.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "gob/save/saveload.h" diff --git a/engines/gob/save/saveload_inca2.cpp b/engines/gob/save/saveload_inca2.cpp index 5fa1b69fa7..4c3aaf5a0e 100644 --- a/engines/gob/save/saveload_inca2.cpp +++ b/engines/gob/save/saveload_inca2.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "gob/save/saveload.h" diff --git a/engines/gob/save/saveload_playtoons.cpp b/engines/gob/save/saveload_playtoons.cpp index 3f578ce928..93c1b68b0c 100644 --- a/engines/gob/save/saveload_playtoons.cpp +++ b/engines/gob/save/saveload_playtoons.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "gob/save/saveload.h" diff --git a/engines/gob/save/saveload_v2.cpp b/engines/gob/save/saveload_v2.cpp index ea639b861a..b25d4788f7 100644 --- a/engines/gob/save/saveload_v2.cpp +++ b/engines/gob/save/saveload_v2.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "gob/save/saveload.h" diff --git a/engines/gob/save/saveload_v3.cpp b/engines/gob/save/saveload_v3.cpp index 39edddb66f..3e7a3b9e48 100644 --- a/engines/gob/save/saveload_v3.cpp +++ b/engines/gob/save/saveload_v3.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "gob/save/saveload.h" diff --git a/engines/gob/save/saveload_v4.cpp b/engines/gob/save/saveload_v4.cpp index e6973efd64..95283db336 100644 --- a/engines/gob/save/saveload_v4.cpp +++ b/engines/gob/save/saveload_v4.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "gob/save/saveload.h" diff --git a/engines/gob/save/saveload_v6.cpp b/engines/gob/save/saveload_v6.cpp index 37ac08ebea..c524cad352 100644 --- a/engines/gob/save/saveload_v6.cpp +++ b/engines/gob/save/saveload_v6.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "gob/save/saveload.h" @@ -284,6 +281,9 @@ SaveLoad_v6::GameHandler::GameHandler(GobEngine *vm, const char *target, SaveLoad_v6::GameHandler::~GameHandler() { delete _slotFile; + + delete _reader; + delete _writer; } int32 SaveLoad_v6::GameHandler::getSize() { diff --git a/engines/gob/save/saveload_v7.cpp b/engines/gob/save/saveload_v7.cpp index 2693617798..3753b4019f 100644 --- a/engines/gob/save/saveload_v7.cpp +++ b/engines/gob/save/saveload_v7.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "gob/save/saveload.h" diff --git a/engines/gob/scenery.cpp b/engines/gob/scenery.cpp index 9f3a908329..bb50818ed8 100644 --- a/engines/gob/scenery.cpp +++ b/engines/gob/scenery.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/endian.h" diff --git a/engines/gob/scenery.h b/engines/gob/scenery.h index 21bf29deda..d8312b1128 100644 --- a/engines/gob/scenery.h +++ b/engines/gob/scenery.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef GOB_SCENERY_H diff --git a/engines/gob/scenery_v1.cpp b/engines/gob/scenery_v1.cpp index 605b098693..46ceb35457 100644 --- a/engines/gob/scenery_v1.cpp +++ b/engines/gob/scenery_v1.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/endian.h" diff --git a/engines/gob/scenery_v2.cpp b/engines/gob/scenery_v2.cpp index 1a0de6f291..16ce077169 100644 --- a/engines/gob/scenery_v2.cpp +++ b/engines/gob/scenery_v2.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/endian.h" diff --git a/engines/gob/script.cpp b/engines/gob/script.cpp index eb37451229..c7e39f94af 100644 --- a/engines/gob/script.cpp +++ b/engines/gob/script.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/util.h" diff --git a/engines/gob/script.h b/engines/gob/script.h index 0e8ac0d69f..0095ad0cb6 100644 --- a/engines/gob/script.h +++ b/engines/gob/script.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef GOB_SCRIPT_H diff --git a/engines/gob/sound/adlib.cpp b/engines/gob/sound/adlib.cpp index 4244df68e5..f1ab2a2d79 100644 --- a/engines/gob/sound/adlib.cpp +++ b/engines/gob/sound/adlib.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/debug.h" diff --git a/engines/gob/sound/adlib.h b/engines/gob/sound/adlib.h index 090841b9d6..934e9966eb 100644 --- a/engines/gob/sound/adlib.h +++ b/engines/gob/sound/adlib.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef GOB_SOUND_ADLIB_H diff --git a/engines/gob/sound/bgatmosphere.cpp b/engines/gob/sound/bgatmosphere.cpp index b351d92275..daba72b2d5 100644 --- a/engines/gob/sound/bgatmosphere.cpp +++ b/engines/gob/sound/bgatmosphere.cpp @@ -18,12 +18,9 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ -#include "common/EventRecorder.h" +#include "common/array.h" #include "gob/sound/bgatmosphere.h" #include "gob/sound/sounddesc.h" @@ -31,14 +28,12 @@ namespace Gob { BackgroundAtmosphere::BackgroundAtmosphere(Audio::Mixer &mixer) : - SoundMixer(mixer, Audio::Mixer::kMusicSoundType) { + SoundMixer(mixer, Audio::Mixer::kMusicSoundType), _rnd("gobBA") { _playMode = kPlayModeLinear; _queuePos = -1; _shaded = false; _shadable = true; - - g_eventRec.registerRandomSource(_rnd, "gobBA"); } BackgroundAtmosphere::~BackgroundAtmosphere() { diff --git a/engines/gob/sound/bgatmosphere.h b/engines/gob/sound/bgatmosphere.h index 7e58c0b4e9..e88b91d540 100644 --- a/engines/gob/sound/bgatmosphere.h +++ b/engines/gob/sound/bgatmosphere.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef GOB_SOUND_BGATMOSPHERE_H diff --git a/engines/gob/sound/cdrom.cpp b/engines/gob/sound/cdrom.cpp index 217aa9c18e..4ce3372562 100644 --- a/engines/gob/sound/cdrom.cpp +++ b/engines/gob/sound/cdrom.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/endian.h" diff --git a/engines/gob/sound/cdrom.h b/engines/gob/sound/cdrom.h index 894744ca15..09d4c94865 100644 --- a/engines/gob/sound/cdrom.h +++ b/engines/gob/sound/cdrom.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef GOB_SOUND_CDROM_H diff --git a/engines/gob/sound/infogrames.cpp b/engines/gob/sound/infogrames.cpp index 9fb7410740..febf91719b 100644 --- a/engines/gob/sound/infogrames.cpp +++ b/engines/gob/sound/infogrames.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/textconsole.h" diff --git a/engines/gob/sound/infogrames.h b/engines/gob/sound/infogrames.h index cdcb0a7c39..ee5ffd1cff 100644 --- a/engines/gob/sound/infogrames.h +++ b/engines/gob/sound/infogrames.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef GOB_SOUND_INFOGRAMES_H diff --git a/engines/gob/sound/pcspeaker.cpp b/engines/gob/sound/pcspeaker.cpp index 61402eb30e..bc031e279f 100644 --- a/engines/gob/sound/pcspeaker.cpp +++ b/engines/gob/sound/pcspeaker.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "gob/sound/pcspeaker.h" diff --git a/engines/gob/sound/pcspeaker.h b/engines/gob/sound/pcspeaker.h index f83d65a615..fe0ec872e3 100644 --- a/engines/gob/sound/pcspeaker.h +++ b/engines/gob/sound/pcspeaker.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef GOB_SOUND_PCSPEAKER_H diff --git a/engines/gob/sound/protracker.cpp b/engines/gob/sound/protracker.cpp index 445d8f8cfb..fbc03256bb 100644 --- a/engines/gob/sound/protracker.cpp +++ b/engines/gob/sound/protracker.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/file.h" diff --git a/engines/gob/sound/protracker.h b/engines/gob/sound/protracker.h index 0397efb3b7..b4c3be1f61 100644 --- a/engines/gob/sound/protracker.h +++ b/engines/gob/sound/protracker.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef GOB_SOUND_PROTRACKER_H diff --git a/engines/gob/sound/sound.cpp b/engines/gob/sound/sound.cpp index 1aa63eb940..0ad17c1e33 100644 --- a/engines/gob/sound/sound.cpp +++ b/engines/gob/sound/sound.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "gob/gob.h" diff --git a/engines/gob/sound/sound.h b/engines/gob/sound/sound.h index 24e161154b..585cf36703 100644 --- a/engines/gob/sound/sound.h +++ b/engines/gob/sound/sound.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef GOB_SOUND_SOUND_H diff --git a/engines/gob/sound/soundblaster.cpp b/engines/gob/sound/soundblaster.cpp index 69610dc949..4ff555b0e3 100644 --- a/engines/gob/sound/soundblaster.cpp +++ b/engines/gob/sound/soundblaster.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "gob/sound/soundblaster.h" diff --git a/engines/gob/sound/soundblaster.h b/engines/gob/sound/soundblaster.h index ffe46801dc..c2704c5482 100644 --- a/engines/gob/sound/soundblaster.h +++ b/engines/gob/sound/soundblaster.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef GOB_SOUND_SOUNDBLASTER_H diff --git a/engines/gob/sound/sounddesc.cpp b/engines/gob/sound/sounddesc.cpp index cc1c6b1f6b..7d876ec484 100644 --- a/engines/gob/sound/sounddesc.cpp +++ b/engines/gob/sound/sounddesc.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/util.h" diff --git a/engines/gob/sound/sounddesc.h b/engines/gob/sound/sounddesc.h index 07eb73e7c8..f9223de964 100644 --- a/engines/gob/sound/sounddesc.h +++ b/engines/gob/sound/sounddesc.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef GOB_SOUND_SOUNDDESC_H diff --git a/engines/gob/sound/soundmixer.cpp b/engines/gob/sound/soundmixer.cpp index 3b6b2e5d52..a9303bc927 100644 --- a/engines/gob/sound/soundmixer.cpp +++ b/engines/gob/sound/soundmixer.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/util.h" diff --git a/engines/gob/sound/soundmixer.h b/engines/gob/sound/soundmixer.h index 5b283b2d84..2847c3de12 100644 --- a/engines/gob/sound/soundmixer.h +++ b/engines/gob/sound/soundmixer.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef GOB_SOUND_SOUNDMIXER_H diff --git a/engines/gob/surface.cpp b/engines/gob/surface.cpp index 7bd8aae597..e294209ed7 100644 --- a/engines/gob/surface.cpp +++ b/engines/gob/surface.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "gob/surface.h" diff --git a/engines/gob/surface.h b/engines/gob/surface.h index b84927af70..866e63490f 100644 --- a/engines/gob/surface.h +++ b/engines/gob/surface.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef GOB_SURFACE_H diff --git a/engines/gob/totfile.cpp b/engines/gob/totfile.cpp index 82dd0c38c0..4efe374793 100644 --- a/engines/gob/totfile.cpp +++ b/engines/gob/totfile.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/str.h" diff --git a/engines/gob/totfile.h b/engines/gob/totfile.h index ce467425e2..5a23912dbe 100644 --- a/engines/gob/totfile.h +++ b/engines/gob/totfile.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef GOB_TOTFILE_H diff --git a/engines/gob/util.cpp b/engines/gob/util.cpp index 787f85175a..6d83745602 100644 --- a/engines/gob/util.cpp +++ b/engines/gob/util.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ diff --git a/engines/gob/util.h b/engines/gob/util.h index 262bff0a7a..a6a689c1d2 100644 --- a/engines/gob/util.h +++ b/engines/gob/util.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef GOB_UTIL_H diff --git a/engines/gob/variables.cpp b/engines/gob/variables.cpp index 94cfadb9a0..efbf10af69 100644 --- a/engines/gob/variables.cpp +++ b/engines/gob/variables.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/endian.h" diff --git a/engines/gob/variables.h b/engines/gob/variables.h index d092a8bc4c..04775ff86c 100644 --- a/engines/gob/variables.h +++ b/engines/gob/variables.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef GOB_VARIABLES_H diff --git a/engines/gob/video.cpp b/engines/gob/video.cpp index 1d74a07bfc..ee5ff4abff 100644 --- a/engines/gob/video.cpp +++ b/engines/gob/video.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/endian.h" diff --git a/engines/gob/video.h b/engines/gob/video.h index 69cdfe49ed..ecbb579c5f 100644 --- a/engines/gob/video.h +++ b/engines/gob/video.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef GOB_VIDEO_H diff --git a/engines/gob/video_v1.cpp b/engines/gob/video_v1.cpp index 5c2f17d7dd..397e2bef22 100644 --- a/engines/gob/video_v1.cpp +++ b/engines/gob/video_v1.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/endian.h" diff --git a/engines/gob/video_v2.cpp b/engines/gob/video_v2.cpp index c908ccf7b1..bf4823ec90 100644 --- a/engines/gob/video_v2.cpp +++ b/engines/gob/video_v2.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/endian.h" diff --git a/engines/gob/video_v6.cpp b/engines/gob/video_v6.cpp index 23610aded1..e2c952952d 100644 --- a/engines/gob/video_v6.cpp +++ b/engines/gob/video_v6.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/endian.h" diff --git a/engines/gob/videoplayer.cpp b/engines/gob/videoplayer.cpp index de149c9787..651c9a3154 100644 --- a/engines/gob/videoplayer.cpp +++ b/engines/gob/videoplayer.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ diff --git a/engines/gob/videoplayer.h b/engines/gob/videoplayer.h index 15f1f066ab..373832939a 100644 --- a/engines/gob/videoplayer.h +++ b/engines/gob/videoplayer.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef GOB_VIDEOPLAYER_H diff --git a/engines/groovie/cell.cpp b/engines/groovie/cell.cpp index e59115cdf5..8241579156 100644 --- a/engines/groovie/cell.cpp +++ b/engines/groovie/cell.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "groovie/cell.h" diff --git a/engines/groovie/cell.h b/engines/groovie/cell.h index a5feab4017..32c7b46547 100644 --- a/engines/groovie/cell.h +++ b/engines/groovie/cell.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef GROOVIE_CELL_H diff --git a/engines/groovie/cursor.cpp b/engines/groovie/cursor.cpp index 8b62b829e1..abefac54bd 100644 --- a/engines/groovie/cursor.cpp +++ b/engines/groovie/cursor.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "groovie/cursor.h" diff --git a/engines/groovie/cursor.h b/engines/groovie/cursor.h index e40dc0c486..87d994b077 100644 --- a/engines/groovie/cursor.h +++ b/engines/groovie/cursor.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef GROOVIE_CURSOR_H diff --git a/engines/groovie/debug.cpp b/engines/groovie/debug.cpp index 0b70e4f83a..74fe22922c 100644 --- a/engines/groovie/debug.cpp +++ b/engines/groovie/debug.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "groovie/debug.h" diff --git a/engines/groovie/debug.h b/engines/groovie/debug.h index e21746a426..76f6d16c65 100644 --- a/engines/groovie/debug.h +++ b/engines/groovie/debug.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef GROOVIE_DEBUG_H diff --git a/engines/groovie/detection.cpp b/engines/groovie/detection.cpp index cf3a035354..78ecac8dbb 100644 --- a/engines/groovie/detection.cpp +++ b/engines/groovie/detection.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "groovie/groovie.h" @@ -222,7 +219,7 @@ public: GroovieMetaEngine() : AdvancedMetaEngine(detectionParams) {} const char *getName() const { - return "Groovie Engine"; + return "Groovie"; } const char *getOriginalCopyright() const { diff --git a/engines/groovie/detection.h b/engines/groovie/detection.h index 2304377a11..aa900cc54d 100644 --- a/engines/groovie/detection.h +++ b/engines/groovie/detection.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef GROOVIE_DETECTION_H diff --git a/engines/groovie/font.cpp b/engines/groovie/font.cpp index 13d0df0005..d29c22dd02 100644 --- a/engines/groovie/font.cpp +++ b/engines/groovie/font.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/array.h" diff --git a/engines/groovie/font.h b/engines/groovie/font.h index 71f8393d28..20aaa4cf23 100644 --- a/engines/groovie/font.h +++ b/engines/groovie/font.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef GROOVIE_FONT_H diff --git a/engines/groovie/graphics.cpp b/engines/groovie/graphics.cpp index 71ee231b80..c3ca03750a 100644 --- a/engines/groovie/graphics.cpp +++ b/engines/groovie/graphics.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "groovie/graphics.h" diff --git a/engines/groovie/graphics.h b/engines/groovie/graphics.h index a405822c9c..c91d895c25 100644 --- a/engines/groovie/graphics.h +++ b/engines/groovie/graphics.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef GROOVIE_GRAPHICS_H diff --git a/engines/groovie/groovie.cpp b/engines/groovie/groovie.cpp index 795cd6feb9..508049e1a0 100644 --- a/engines/groovie/groovie.cpp +++ b/engines/groovie/groovie.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "groovie/groovie.h" diff --git a/engines/groovie/groovie.h b/engines/groovie/groovie.h index 9335ffb7e4..0ac9c4b956 100644 --- a/engines/groovie/groovie.h +++ b/engines/groovie/groovie.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef GROOVIE_H diff --git a/engines/groovie/lzss.cpp b/engines/groovie/lzss.cpp index 889a12bd12..a09f6e2311 100644 --- a/engines/groovie/lzss.cpp +++ b/engines/groovie/lzss.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "groovie/lzss.h" diff --git a/engines/groovie/lzss.h b/engines/groovie/lzss.h index f78bc20351..f60ea14815 100644 --- a/engines/groovie/lzss.h +++ b/engines/groovie/lzss.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/stream.h" diff --git a/engines/groovie/music.cpp b/engines/groovie/music.cpp index b7078f4c9e..b8a78d9f56 100644 --- a/engines/groovie/music.cpp +++ b/engines/groovie/music.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "groovie/music.h" diff --git a/engines/groovie/music.h b/engines/groovie/music.h index bde0a7a16f..fa4150a83b 100644 --- a/engines/groovie/music.h +++ b/engines/groovie/music.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef GROOVIE_MUSIC_H diff --git a/engines/groovie/player.cpp b/engines/groovie/player.cpp index 3fee87d7bb..11318d2e94 100644 --- a/engines/groovie/player.cpp +++ b/engines/groovie/player.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/debug.h" diff --git a/engines/groovie/player.h b/engines/groovie/player.h index c9f47b8100..c6d927f2c0 100644 --- a/engines/groovie/player.h +++ b/engines/groovie/player.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef GROOVIE_PLAYER_H diff --git a/engines/groovie/resource.cpp b/engines/groovie/resource.cpp index 7670ab4315..05359342f8 100644 --- a/engines/groovie/resource.cpp +++ b/engines/groovie/resource.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/archive.h" diff --git a/engines/groovie/resource.h b/engines/groovie/resource.h index 9c306beecb..2c215917cc 100644 --- a/engines/groovie/resource.h +++ b/engines/groovie/resource.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef GROOVIE_RESOURCE_H diff --git a/engines/groovie/roq.cpp b/engines/groovie/roq.cpp index be9c4f6921..7f477c41fa 100644 --- a/engines/groovie/roq.cpp +++ b/engines/groovie/roq.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ // ROQ video player based on this specification by Dr. Tim Ferguson: diff --git a/engines/groovie/roq.h b/engines/groovie/roq.h index fd5af9300c..ddb307065c 100644 --- a/engines/groovie/roq.h +++ b/engines/groovie/roq.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef GROOVIE_ROQ_H diff --git a/engines/groovie/saveload.cpp b/engines/groovie/saveload.cpp index 4e3e4cfcf8..a0463db0be 100644 --- a/engines/groovie/saveload.cpp +++ b/engines/groovie/saveload.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "groovie/saveload.h" diff --git a/engines/groovie/saveload.h b/engines/groovie/saveload.h index 24a0ddfbf8..15ce108c7d 100644 --- a/engines/groovie/saveload.h +++ b/engines/groovie/saveload.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef GROOVIE_SAVELOAD_H diff --git a/engines/groovie/script.cpp b/engines/groovie/script.cpp index fabb70cca0..3bd90a042e 100644 --- a/engines/groovie/script.cpp +++ b/engines/groovie/script.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "groovie/script.h" @@ -36,7 +33,7 @@ #include "common/archive.h" #include "common/config-manager.h" #include "common/debug-channels.h" -#include "common/EventRecorder.h" +#include "common/events.h" #include "common/file.h" #include "common/macresman.h" @@ -68,7 +65,8 @@ static void debugScript(int level, bool nl, const char *s, ...) { Script::Script(GroovieEngine *vm, EngineVersion version) : _code(NULL), _savedCode(NULL), _stacktop(0), _debugger(NULL), _vm(vm), - _videoFile(NULL), _videoRef(0), _staufsMove(NULL) { + _videoFile(NULL), _videoRef(0), _staufsMove(NULL), + _random("GroovieScripts") { // Initialize the opcode set depending on the engine version switch (version) { case kGroovieT7G: @@ -79,9 +77,6 @@ Script::Script(GroovieEngine *vm, EngineVersion version) : break; } - // Initialize the random source - g_eventRec.registerRandomSource(_random, "GroovieScripts"); - // Prepare the variables _bitflags = 0; for (int i = 0; i < 0x400; i++) { diff --git a/engines/groovie/script.h b/engines/groovie/script.h index b959810bb6..95da96487e 100644 --- a/engines/groovie/script.h +++ b/engines/groovie/script.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef GROOVIE_SCRIPT_H diff --git a/engines/groovie/vdx.cpp b/engines/groovie/vdx.cpp index 432b17802c..ae1e9eebb3 100644 --- a/engines/groovie/vdx.cpp +++ b/engines/groovie/vdx.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "groovie/vdx.h" diff --git a/engines/groovie/vdx.h b/engines/groovie/vdx.h index 31c7606cb7..ebe58cb119 100644 --- a/engines/groovie/vdx.h +++ b/engines/groovie/vdx.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef GROOVIE_VDX_H diff --git a/engines/hugo/console.cpp b/engines/hugo/console.cpp index 3ff37ccbc7..3d7449e51f 100644 --- a/engines/hugo/console.cpp +++ b/engines/hugo/console.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "hugo/console.h" diff --git a/engines/hugo/console.h b/engines/hugo/console.h index 240b108ab6..4743b791f3 100644 --- a/engines/hugo/console.h +++ b/engines/hugo/console.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef HUGO_CONSOLE_H diff --git a/engines/hugo/detection.cpp b/engines/hugo/detection.cpp index 95302c9235..25b8b16084 100644 --- a/engines/hugo/detection.cpp +++ b/engines/hugo/detection.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "engines/advancedDetector.h" @@ -164,7 +161,7 @@ public: HugoMetaEngine() : AdvancedMetaEngine(detectionParams) {} const char *getName() const { - return "Hugo Engine"; + return "Hugo"; } const char *getOriginalCopyright() const { diff --git a/engines/hugo/dialogs.cpp b/engines/hugo/dialogs.cpp index f0dc84eae8..6c816141f7 100644 --- a/engines/hugo/dialogs.cpp +++ b/engines/hugo/dialogs.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/substream.h" diff --git a/engines/hugo/dialogs.h b/engines/hugo/dialogs.h index 56dbd41f81..4e710ff2f8 100644 --- a/engines/hugo/dialogs.h +++ b/engines/hugo/dialogs.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef HUGO_DIALOGS_H diff --git a/engines/hugo/display.cpp b/engines/hugo/display.cpp index af4d094ceb..c731b23e59 100644 --- a/engines/hugo/display.cpp +++ b/engines/hugo/display.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ /* diff --git a/engines/hugo/display.h b/engines/hugo/display.h index 91e1752df0..38c63e9fe5 100644 --- a/engines/hugo/display.h +++ b/engines/hugo/display.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ /* diff --git a/engines/hugo/file.cpp b/engines/hugo/file.cpp index ba4e420111..cde6e108ea 100644 --- a/engines/hugo/file.cpp +++ b/engines/hugo/file.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ /* diff --git a/engines/hugo/file.h b/engines/hugo/file.h index 0e131348f9..3792c01ab4 100644 --- a/engines/hugo/file.h +++ b/engines/hugo/file.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ /* diff --git a/engines/hugo/file_v1d.cpp b/engines/hugo/file_v1d.cpp index 021969f306..9ebd9d284c 100644 --- a/engines/hugo/file_v1d.cpp +++ b/engines/hugo/file_v1d.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ /* diff --git a/engines/hugo/file_v1w.cpp b/engines/hugo/file_v1w.cpp index 4f327b3095..eb2226f18a 100644 --- a/engines/hugo/file_v1w.cpp +++ b/engines/hugo/file_v1w.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ /* diff --git a/engines/hugo/file_v2d.cpp b/engines/hugo/file_v2d.cpp index 0ad89e987e..2a663edcfa 100644 --- a/engines/hugo/file_v2d.cpp +++ b/engines/hugo/file_v2d.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ /* diff --git a/engines/hugo/file_v2w.cpp b/engines/hugo/file_v2w.cpp index 245d4d017e..1384f02df6 100644 --- a/engines/hugo/file_v2w.cpp +++ b/engines/hugo/file_v2w.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ /* diff --git a/engines/hugo/file_v3d.cpp b/engines/hugo/file_v3d.cpp index 6370fffa4d..7ac0ffc48a 100644 --- a/engines/hugo/file_v3d.cpp +++ b/engines/hugo/file_v3d.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ /* diff --git a/engines/hugo/game.h b/engines/hugo/game.h index 08e8deb001..5db57789dc 100644 --- a/engines/hugo/game.h +++ b/engines/hugo/game.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ /* diff --git a/engines/hugo/hugo.cpp b/engines/hugo/hugo.cpp index a872a97bae..7d35aec972 100644 --- a/engines/hugo/hugo.cpp +++ b/engines/hugo/hugo.cpp @@ -18,16 +18,12 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/system.h" #include "common/random.h" #include "common/error.h" #include "common/events.h" -#include "common/EventRecorder.h" #include "common/debug-channels.h" #include "common/config-manager.h" #include "common/textconsole.h" @@ -599,8 +595,7 @@ void HugoEngine::initialize() { _file->openDatabaseFiles(); // Open database files calcMaxScore(); // Initialise maxscore - _rnd = new Common::RandomSource(); - g_eventRec.registerRandomSource(*_rnd, "hugo"); + _rnd = new Common::RandomSource("hugo"); _rnd->setSeed(42); // Kick random number generator switch (_gameVariant) { diff --git a/engines/hugo/hugo.h b/engines/hugo/hugo.h index b2d241f241..61b002a2ee 100644 --- a/engines/hugo/hugo.h +++ b/engines/hugo/hugo.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef HUGO_H diff --git a/engines/hugo/intro.cpp b/engines/hugo/intro.cpp index c31d76abd0..c66c0ef624 100644 --- a/engines/hugo/intro.cpp +++ b/engines/hugo/intro.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ /* diff --git a/engines/hugo/intro.h b/engines/hugo/intro.h index 772d98e244..1bb039216a 100644 --- a/engines/hugo/intro.h +++ b/engines/hugo/intro.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ /* diff --git a/engines/hugo/inventory.cpp b/engines/hugo/inventory.cpp index 45893f6965..410c4e715c 100644 --- a/engines/hugo/inventory.cpp +++ b/engines/hugo/inventory.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ /* diff --git a/engines/hugo/inventory.h b/engines/hugo/inventory.h index ec102f3cce..de9e4cd1f0 100644 --- a/engines/hugo/inventory.h +++ b/engines/hugo/inventory.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ /* diff --git a/engines/hugo/mouse.cpp b/engines/hugo/mouse.cpp index c02908e579..d2d5b59dae 100644 --- a/engines/hugo/mouse.cpp +++ b/engines/hugo/mouse.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ /* diff --git a/engines/hugo/mouse.h b/engines/hugo/mouse.h index ae1974b726..35f9e4e87e 100644 --- a/engines/hugo/mouse.h +++ b/engines/hugo/mouse.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ /* diff --git a/engines/hugo/object.cpp b/engines/hugo/object.cpp index acf9f6e50c..e888a1d998 100644 --- a/engines/hugo/object.cpp +++ b/engines/hugo/object.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ /* diff --git a/engines/hugo/object.h b/engines/hugo/object.h index 41ea776840..c0933729eb 100644 --- a/engines/hugo/object.h +++ b/engines/hugo/object.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ /* diff --git a/engines/hugo/object_v1d.cpp b/engines/hugo/object_v1d.cpp index 95bedf4fa2..297a856203 100644 --- a/engines/hugo/object_v1d.cpp +++ b/engines/hugo/object_v1d.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ /* diff --git a/engines/hugo/object_v1w.cpp b/engines/hugo/object_v1w.cpp index 54becd8234..098acdf367 100644 --- a/engines/hugo/object_v1w.cpp +++ b/engines/hugo/object_v1w.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ /* diff --git a/engines/hugo/object_v2d.cpp b/engines/hugo/object_v2d.cpp index 7c47bf4f92..3a98885ebe 100644 --- a/engines/hugo/object_v2d.cpp +++ b/engines/hugo/object_v2d.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ /* diff --git a/engines/hugo/object_v3d.cpp b/engines/hugo/object_v3d.cpp index 3ff6c56ad3..07bd5e0c7f 100644 --- a/engines/hugo/object_v3d.cpp +++ b/engines/hugo/object_v3d.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ /* diff --git a/engines/hugo/parser.cpp b/engines/hugo/parser.cpp index 29a1d5efa3..4a53d67377 100644 --- a/engines/hugo/parser.cpp +++ b/engines/hugo/parser.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ /* diff --git a/engines/hugo/parser.h b/engines/hugo/parser.h index b00b8d5c43..6ad2b38234 100644 --- a/engines/hugo/parser.h +++ b/engines/hugo/parser.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ /* diff --git a/engines/hugo/parser_v1d.cpp b/engines/hugo/parser_v1d.cpp index b2e515fd42..ccd428311b 100644 --- a/engines/hugo/parser_v1d.cpp +++ b/engines/hugo/parser_v1d.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ /* diff --git a/engines/hugo/parser_v1w.cpp b/engines/hugo/parser_v1w.cpp index a39063357b..b1657c3bf4 100644 --- a/engines/hugo/parser_v1w.cpp +++ b/engines/hugo/parser_v1w.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ /* diff --git a/engines/hugo/parser_v2d.cpp b/engines/hugo/parser_v2d.cpp index 6233f11c29..0095c4d726 100644 --- a/engines/hugo/parser_v2d.cpp +++ b/engines/hugo/parser_v2d.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ /* diff --git a/engines/hugo/parser_v3d.cpp b/engines/hugo/parser_v3d.cpp index 8c4946c534..b45e9186b3 100644 --- a/engines/hugo/parser_v3d.cpp +++ b/engines/hugo/parser_v3d.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ /* diff --git a/engines/hugo/route.cpp b/engines/hugo/route.cpp index 68b659cd3f..af8ec3427d 100644 --- a/engines/hugo/route.cpp +++ b/engines/hugo/route.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ /* diff --git a/engines/hugo/route.h b/engines/hugo/route.h index 83a36f27ef..a95dd2151b 100644 --- a/engines/hugo/route.h +++ b/engines/hugo/route.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ /* diff --git a/engines/hugo/schedule.cpp b/engines/hugo/schedule.cpp index 0e91124a7e..7e66f34af2 100644 --- a/engines/hugo/schedule.cpp +++ b/engines/hugo/schedule.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ /* diff --git a/engines/hugo/schedule.h b/engines/hugo/schedule.h index a066fc63c4..003974f2fa 100644 --- a/engines/hugo/schedule.h +++ b/engines/hugo/schedule.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ /* diff --git a/engines/hugo/sound.cpp b/engines/hugo/sound.cpp index d657eb96a6..9473536a47 100644 --- a/engines/hugo/sound.cpp +++ b/engines/hugo/sound.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ /* diff --git a/engines/hugo/sound.h b/engines/hugo/sound.h index d5f51704aa..33dba9f2a8 100644 --- a/engines/hugo/sound.h +++ b/engines/hugo/sound.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ /* diff --git a/engines/hugo/text.cpp b/engines/hugo/text.cpp index d2dcbe1405..f8b02bdf68 100644 --- a/engines/hugo/text.cpp +++ b/engines/hugo/text.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/system.h" diff --git a/engines/hugo/text.h b/engines/hugo/text.h index 0854bf3f6e..0ba8de9cdf 100644 --- a/engines/hugo/text.h +++ b/engines/hugo/text.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef TEXT_H #define TEXT_H diff --git a/engines/hugo/util.cpp b/engines/hugo/util.cpp index 6846bc98af..a936a23de1 100644 --- a/engines/hugo/util.cpp +++ b/engines/hugo/util.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ /* diff --git a/engines/hugo/util.h b/engines/hugo/util.h index 85fef01a6e..d8634c88e0 100644 --- a/engines/hugo/util.h +++ b/engines/hugo/util.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ /* diff --git a/engines/kyra/animator_hof.cpp b/engines/kyra/animator_hof.cpp index a563bc2b4f..4cdb622501 100644 --- a/engines/kyra/animator_hof.cpp +++ b/engines/kyra/animator_hof.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "kyra/kyra_hof.h" diff --git a/engines/kyra/animator_lok.cpp b/engines/kyra/animator_lok.cpp index 452d5e8062..3e9dd7aa66 100644 --- a/engines/kyra/animator_lok.cpp +++ b/engines/kyra/animator_lok.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "kyra/kyra_lok.h" diff --git a/engines/kyra/animator_lok.h b/engines/kyra/animator_lok.h index 6d22524a77..21d24866c8 100644 --- a/engines/kyra/animator_lok.h +++ b/engines/kyra/animator_lok.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef KYRA_ANIMATOR_LOK_H diff --git a/engines/kyra/animator_mr.cpp b/engines/kyra/animator_mr.cpp index 47c0e3b03a..6db2e45b0e 100644 --- a/engines/kyra/animator_mr.cpp +++ b/engines/kyra/animator_mr.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "kyra/kyra_mr.h" diff --git a/engines/kyra/animator_tim.cpp b/engines/kyra/animator_tim.cpp index fa42042bef..90f4ad89ad 100644 --- a/engines/kyra/animator_tim.cpp +++ b/engines/kyra/animator_tim.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "kyra/script_tim.h" diff --git a/engines/kyra/animator_v2.cpp b/engines/kyra/animator_v2.cpp index 07ff4456e5..ad7057f11a 100644 --- a/engines/kyra/animator_v2.cpp +++ b/engines/kyra/animator_v2.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "kyra/kyra_v2.h" diff --git a/engines/kyra/debugger.cpp b/engines/kyra/debugger.cpp index 066648b96f..d0baf8a133 100644 --- a/engines/kyra/debugger.cpp +++ b/engines/kyra/debugger.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "kyra/debugger.h" diff --git a/engines/kyra/debugger.h b/engines/kyra/debugger.h index de45bd0aaa..70c547381e 100644 --- a/engines/kyra/debugger.h +++ b/engines/kyra/debugger.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef KYRA_DEBUGGER_H diff --git a/engines/kyra/detection.cpp b/engines/kyra/detection.cpp index 87cda9f3b6..47a086e08c 100644 --- a/engines/kyra/detection.cpp +++ b/engines/kyra/detection.cpp @@ -17,9 +17,6 @@ * 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. - * - * $URL$ - * $Id$ */ #include "kyra/kyra_lok.h" @@ -82,7 +79,7 @@ public: KyraMetaEngine() : AdvancedMetaEngine(detectionParams) {} const char *getName() const { - return "Legend of Kyrandia Engine"; + return "Kyra"; } const char *getOriginalCopyright() const { diff --git a/engines/kyra/detection_tables.h b/engines/kyra/detection_tables.h index 5c97df8895..8a948eff00 100644 --- a/engines/kyra/detection_tables.h +++ b/engines/kyra/detection_tables.h @@ -17,9 +17,6 @@ * 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. - * - * $URL$ - * $Id$ */ namespace { diff --git a/engines/kyra/gui.cpp b/engines/kyra/gui.cpp index 849b65a24b..b9477c950a 100644 --- a/engines/kyra/gui.cpp +++ b/engines/kyra/gui.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "kyra/gui.h" diff --git a/engines/kyra/gui.h b/engines/kyra/gui.h index ff387debd6..6afdc431ed 100644 --- a/engines/kyra/gui.h +++ b/engines/kyra/gui.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef KYRA_GUI_H diff --git a/engines/kyra/gui_hof.cpp b/engines/kyra/gui_hof.cpp index 26e0d8f18a..1666cdd0e4 100644 --- a/engines/kyra/gui_hof.cpp +++ b/engines/kyra/gui_hof.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "kyra/gui_hof.h" diff --git a/engines/kyra/gui_hof.h b/engines/kyra/gui_hof.h index f0e693081f..a02d14e9f1 100644 --- a/engines/kyra/gui_hof.h +++ b/engines/kyra/gui_hof.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef KYRA_GUI_HOF_H diff --git a/engines/kyra/gui_lok.cpp b/engines/kyra/gui_lok.cpp index c31cbe3db2..eac82ec2c5 100644 --- a/engines/kyra/gui_lok.cpp +++ b/engines/kyra/gui_lok.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "kyra/gui_lok.h" diff --git a/engines/kyra/gui_lok.h b/engines/kyra/gui_lok.h index 084a798de4..4d7bfa1ada 100644 --- a/engines/kyra/gui_lok.h +++ b/engines/kyra/gui_lok.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef KYRA_GUI_LOK_H diff --git a/engines/kyra/gui_lol.cpp b/engines/kyra/gui_lol.cpp index 2625347d50..4c4dc50503 100644 --- a/engines/kyra/gui_lol.cpp +++ b/engines/kyra/gui_lol.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifdef ENABLE_LOL diff --git a/engines/kyra/gui_lol.h b/engines/kyra/gui_lol.h index 941f52bd3d..bc49b21299 100644 --- a/engines/kyra/gui_lol.h +++ b/engines/kyra/gui_lol.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifdef ENABLE_LOL diff --git a/engines/kyra/gui_mr.cpp b/engines/kyra/gui_mr.cpp index 6eca24fd46..25a77c6cc8 100644 --- a/engines/kyra/gui_mr.cpp +++ b/engines/kyra/gui_mr.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "kyra/gui_mr.h" diff --git a/engines/kyra/gui_mr.h b/engines/kyra/gui_mr.h index b104626db7..9c8d79b321 100644 --- a/engines/kyra/gui_mr.h +++ b/engines/kyra/gui_mr.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef KYRA_GUI_MR_H diff --git a/engines/kyra/gui_v2.cpp b/engines/kyra/gui_v2.cpp index 01922de7cf..0b82df8cd5 100644 --- a/engines/kyra/gui_v2.cpp +++ b/engines/kyra/gui_v2.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "kyra/gui_v2.h" diff --git a/engines/kyra/gui_v2.h b/engines/kyra/gui_v2.h index 4cc52be554..0009bf8e54 100644 --- a/engines/kyra/gui_v2.h +++ b/engines/kyra/gui_v2.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef KYRA_GUI_V2_H diff --git a/engines/kyra/item.h b/engines/kyra/item.h index 2088f4bd8b..86b6fc7d46 100644 --- a/engines/kyra/item.h +++ b/engines/kyra/item.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef KYRA_ITEM_H diff --git a/engines/kyra/items_hof.cpp b/engines/kyra/items_hof.cpp index d460698272..73aed2e067 100644 --- a/engines/kyra/items_hof.cpp +++ b/engines/kyra/items_hof.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "kyra/kyra_hof.h" diff --git a/engines/kyra/items_lok.cpp b/engines/kyra/items_lok.cpp index ed1299d239..d66eb553f2 100644 --- a/engines/kyra/items_lok.cpp +++ b/engines/kyra/items_lok.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "kyra/kyra_lok.h" diff --git a/engines/kyra/items_lol.cpp b/engines/kyra/items_lol.cpp index d4567ad737..b6388604f5 100644 --- a/engines/kyra/items_lol.cpp +++ b/engines/kyra/items_lol.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifdef ENABLE_LOL diff --git a/engines/kyra/items_mr.cpp b/engines/kyra/items_mr.cpp index 5659876307..88c02f56c8 100644 --- a/engines/kyra/items_mr.cpp +++ b/engines/kyra/items_mr.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "kyra/kyra_mr.h" diff --git a/engines/kyra/items_v2.cpp b/engines/kyra/items_v2.cpp index 90b6194f0d..29dddc6772 100644 --- a/engines/kyra/items_v2.cpp +++ b/engines/kyra/items_v2.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "kyra/kyra_v2.h" diff --git a/engines/kyra/kyra_hof.cpp b/engines/kyra/kyra_hof.cpp index de6aa55b08..9a4f7bc42e 100644 --- a/engines/kyra/kyra_hof.cpp +++ b/engines/kyra/kyra_hof.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "kyra/kyra_hof.h" diff --git a/engines/kyra/kyra_hof.h b/engines/kyra/kyra_hof.h index 308698484d..da7486bc29 100644 --- a/engines/kyra/kyra_hof.h +++ b/engines/kyra/kyra_hof.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef KYRA_KYRA_HOF_H diff --git a/engines/kyra/kyra_lok.cpp b/engines/kyra/kyra_lok.cpp index a04c28cad8..ee67062cdd 100644 --- a/engines/kyra/kyra_lok.cpp +++ b/engines/kyra/kyra_lok.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "kyra/kyra_lok.h" diff --git a/engines/kyra/kyra_lok.h b/engines/kyra/kyra_lok.h index cfa231e2d0..066c27c69a 100644 --- a/engines/kyra/kyra_lok.h +++ b/engines/kyra/kyra_lok.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef KYRA_KYRA_LOK_H diff --git a/engines/kyra/kyra_mr.cpp b/engines/kyra/kyra_mr.cpp index 570ebe0bab..4ce5c5b2cf 100644 --- a/engines/kyra/kyra_mr.cpp +++ b/engines/kyra/kyra_mr.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "kyra/kyra_mr.h" diff --git a/engines/kyra/kyra_mr.h b/engines/kyra/kyra_mr.h index 912c615757..0d9d66ce95 100644 --- a/engines/kyra/kyra_mr.h +++ b/engines/kyra/kyra_mr.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef KYRA_KYRA_MR_H diff --git a/engines/kyra/kyra_v1.cpp b/engines/kyra/kyra_v1.cpp index fb56e4a62a..7f4f1ec2c7 100644 --- a/engines/kyra/kyra_v1.cpp +++ b/engines/kyra/kyra_v1.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "kyra/kyra_v1.h" @@ -32,12 +29,11 @@ #include "common/error.h" #include "common/config-manager.h" #include "common/debug-channels.h" -#include "common/EventRecorder.h" namespace Kyra { KyraEngine_v1::KyraEngine_v1(OSystem *system, const GameFlags &flags) - : Engine(system), _flags(flags) { + : Engine(system), _flags(flags), _rnd("kyra") { _res = 0; _sound = 0; _text = 0; @@ -81,8 +77,6 @@ KyraEngine_v1::KyraEngine_v1(OSystem *system, const GameFlags &flags) DebugMan.addDebugChannel(kDebugLevelSequence, "Sequence", "Sequence debug level"); DebugMan.addDebugChannel(kDebugLevelMovie, "Movie", "Movie debug level"); DebugMan.addDebugChannel(kDebugLevelTimer, "Timer", "Timer debug level"); - - g_eventRec.registerRandomSource(_rnd, "kyra"); } ::GUI::Debugger *KyraEngine_v1::getDebugger() { diff --git a/engines/kyra/kyra_v1.h b/engines/kyra/kyra_v1.h index 08dc831dd9..bb533b14a5 100644 --- a/engines/kyra/kyra_v1.h +++ b/engines/kyra/kyra_v1.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef KYRA_KYRA_V1_H diff --git a/engines/kyra/kyra_v2.cpp b/engines/kyra/kyra_v2.cpp index 16b5ffa4e8..d0f8d78bd1 100644 --- a/engines/kyra/kyra_v2.cpp +++ b/engines/kyra/kyra_v2.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "kyra/kyra_v2.h" diff --git a/engines/kyra/kyra_v2.h b/engines/kyra/kyra_v2.h index 9f0aecd78c..f21458ab5d 100644 --- a/engines/kyra/kyra_v2.h +++ b/engines/kyra/kyra_v2.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef KYRA_KYRA_V2_H diff --git a/engines/kyra/lol.cpp b/engines/kyra/lol.cpp index ce73bffc89..9b0ae173d5 100644 --- a/engines/kyra/lol.cpp +++ b/engines/kyra/lol.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifdef ENABLE_LOL diff --git a/engines/kyra/lol.h b/engines/kyra/lol.h index a3170c2193..a815fa1a37 100644 --- a/engines/kyra/lol.h +++ b/engines/kyra/lol.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifdef ENABLE_LOL diff --git a/engines/kyra/resource.cpp b/engines/kyra/resource.cpp index 22786c1c7e..bc9c93f8ca 100644 --- a/engines/kyra/resource.cpp +++ b/engines/kyra/resource.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "kyra/resource.h" diff --git a/engines/kyra/resource.h b/engines/kyra/resource.h index 9948c52001..1c69362bfd 100644 --- a/engines/kyra/resource.h +++ b/engines/kyra/resource.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef KYRA_RESOURCE_H diff --git a/engines/kyra/resource_intern.cpp b/engines/kyra/resource_intern.cpp index 1dc084f14d..482bd1a5d6 100644 --- a/engines/kyra/resource_intern.cpp +++ b/engines/kyra/resource_intern.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "kyra/resource_intern.h" diff --git a/engines/kyra/resource_intern.h b/engines/kyra/resource_intern.h index 16f3a1fe91..03c9d871e8 100644 --- a/engines/kyra/resource_intern.h +++ b/engines/kyra/resource_intern.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef KYRA_RESOURCE_INTERN_H diff --git a/engines/kyra/saveload.cpp b/engines/kyra/saveload.cpp index 81b3ec15ae..80182d949b 100644 --- a/engines/kyra/saveload.cpp +++ b/engines/kyra/saveload.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "kyra/kyra_v1.h" diff --git a/engines/kyra/saveload_hof.cpp b/engines/kyra/saveload_hof.cpp index 1fd6c0f3c8..b395a38acd 100644 --- a/engines/kyra/saveload_hof.cpp +++ b/engines/kyra/saveload_hof.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "kyra/kyra_hof.h" diff --git a/engines/kyra/saveload_lok.cpp b/engines/kyra/saveload_lok.cpp index 5af4f1d8ca..7689a904b0 100644 --- a/engines/kyra/saveload_lok.cpp +++ b/engines/kyra/saveload_lok.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "kyra/kyra_lok.h" diff --git a/engines/kyra/saveload_lol.cpp b/engines/kyra/saveload_lol.cpp index c5240e2624..c81ace26f0 100644 --- a/engines/kyra/saveload_lol.cpp +++ b/engines/kyra/saveload_lol.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifdef ENABLE_LOL diff --git a/engines/kyra/saveload_mr.cpp b/engines/kyra/saveload_mr.cpp index a5e9b9e0f5..0fd3e520f9 100644 --- a/engines/kyra/saveload_mr.cpp +++ b/engines/kyra/saveload_mr.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/endian.h" diff --git a/engines/kyra/scene_hof.cpp b/engines/kyra/scene_hof.cpp index b44c88a0b4..197ef38bf1 100644 --- a/engines/kyra/scene_hof.cpp +++ b/engines/kyra/scene_hof.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "kyra/kyra_hof.h" diff --git a/engines/kyra/scene_lok.cpp b/engines/kyra/scene_lok.cpp index 6200e2ab1e..6cb3e2a98a 100644 --- a/engines/kyra/scene_lok.cpp +++ b/engines/kyra/scene_lok.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "kyra/kyra_lok.h" diff --git a/engines/kyra/scene_lol.cpp b/engines/kyra/scene_lol.cpp index ab9f89456b..305036fc51 100644 --- a/engines/kyra/scene_lol.cpp +++ b/engines/kyra/scene_lol.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifdef ENABLE_LOL diff --git a/engines/kyra/scene_mr.cpp b/engines/kyra/scene_mr.cpp index 4eac4889b6..6b234d9a73 100644 --- a/engines/kyra/scene_mr.cpp +++ b/engines/kyra/scene_mr.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "kyra/kyra_mr.h" diff --git a/engines/kyra/scene_v1.cpp b/engines/kyra/scene_v1.cpp index bc88377892..5319d4e657 100644 --- a/engines/kyra/scene_v1.cpp +++ b/engines/kyra/scene_v1.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "kyra/kyra_v1.h" diff --git a/engines/kyra/scene_v2.cpp b/engines/kyra/scene_v2.cpp index 897f2e937f..fbddb6604e 100644 --- a/engines/kyra/scene_v2.cpp +++ b/engines/kyra/scene_v2.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "kyra/kyra_v2.h" diff --git a/engines/kyra/screen.cpp b/engines/kyra/screen.cpp index 20a1022b26..b4304a6de0 100644 --- a/engines/kyra/screen.cpp +++ b/engines/kyra/screen.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "kyra/screen.h" diff --git a/engines/kyra/screen.h b/engines/kyra/screen.h index e35b9b37b2..e23f104760 100644 --- a/engines/kyra/screen.h +++ b/engines/kyra/screen.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef KYRA_SCREEN_H diff --git a/engines/kyra/screen_hof.cpp b/engines/kyra/screen_hof.cpp index f0af53f024..1282447411 100644 --- a/engines/kyra/screen_hof.cpp +++ b/engines/kyra/screen_hof.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "kyra/screen_hof.h" diff --git a/engines/kyra/screen_hof.h b/engines/kyra/screen_hof.h index 5117716ac0..08a9133809 100644 --- a/engines/kyra/screen_hof.h +++ b/engines/kyra/screen_hof.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef KYRA_SCREEN_HOF_H diff --git a/engines/kyra/screen_lok.cpp b/engines/kyra/screen_lok.cpp index 2431cde20b..106ef5df29 100644 --- a/engines/kyra/screen_lok.cpp +++ b/engines/kyra/screen_lok.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "kyra/screen_lok.h" diff --git a/engines/kyra/screen_lok.h b/engines/kyra/screen_lok.h index 0d30c35bfd..3b74912986 100644 --- a/engines/kyra/screen_lok.h +++ b/engines/kyra/screen_lok.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef KYRA_SCREEN_LOK_H diff --git a/engines/kyra/screen_lol.cpp b/engines/kyra/screen_lol.cpp index 20756e1fae..c6874ca0ed 100644 --- a/engines/kyra/screen_lol.cpp +++ b/engines/kyra/screen_lol.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifdef ENABLE_LOL diff --git a/engines/kyra/screen_lol.h b/engines/kyra/screen_lol.h index 9f4d751d0c..926183225f 100644 --- a/engines/kyra/screen_lol.h +++ b/engines/kyra/screen_lol.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifdef ENABLE_LOL diff --git a/engines/kyra/screen_mr.cpp b/engines/kyra/screen_mr.cpp index 4ae52b924d..2687dc8041 100644 --- a/engines/kyra/screen_mr.cpp +++ b/engines/kyra/screen_mr.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "kyra/screen_mr.h" diff --git a/engines/kyra/screen_mr.h b/engines/kyra/screen_mr.h index c02fc4bfb2..0cb3240954 100644 --- a/engines/kyra/screen_mr.h +++ b/engines/kyra/screen_mr.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef KYRA_SCREEN_MR_H diff --git a/engines/kyra/screen_v2.cpp b/engines/kyra/screen_v2.cpp index 9c224d1562..64fbe2b834 100644 --- a/engines/kyra/screen_v2.cpp +++ b/engines/kyra/screen_v2.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "kyra/screen_v2.h" diff --git a/engines/kyra/screen_v2.h b/engines/kyra/screen_v2.h index 92aeb3525d..eb8415be78 100644 --- a/engines/kyra/screen_v2.h +++ b/engines/kyra/screen_v2.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef KYRA_SCREEN_V2_H diff --git a/engines/kyra/script.cpp b/engines/kyra/script.cpp index 21dfe0bd31..b185b8ed6f 100644 --- a/engines/kyra/script.cpp +++ b/engines/kyra/script.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "kyra/script.h" diff --git a/engines/kyra/script.h b/engines/kyra/script.h index faa80a3f21..4250732c7c 100644 --- a/engines/kyra/script.h +++ b/engines/kyra/script.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef KYRA_SCRIPT_H diff --git a/engines/kyra/script_hof.cpp b/engines/kyra/script_hof.cpp index 056319e6d4..27cfc808cc 100644 --- a/engines/kyra/script_hof.cpp +++ b/engines/kyra/script_hof.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "kyra/kyra_hof.h" diff --git a/engines/kyra/script_lok.cpp b/engines/kyra/script_lok.cpp index 30f1138360..2b90d001ca 100644 --- a/engines/kyra/script_lok.cpp +++ b/engines/kyra/script_lok.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "kyra/kyra_lok.h" diff --git a/engines/kyra/script_lol.cpp b/engines/kyra/script_lol.cpp index 3185032218..2261ef8389 100644 --- a/engines/kyra/script_lol.cpp +++ b/engines/kyra/script_lol.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifdef ENABLE_LOL diff --git a/engines/kyra/script_mr.cpp b/engines/kyra/script_mr.cpp index b3943e1aef..8ab094ac0c 100644 --- a/engines/kyra/script_mr.cpp +++ b/engines/kyra/script_mr.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "kyra/kyra_mr.h" diff --git a/engines/kyra/script_tim.cpp b/engines/kyra/script_tim.cpp index 004ceb97bb..501ae2defd 100644 --- a/engines/kyra/script_tim.cpp +++ b/engines/kyra/script_tim.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "kyra/script_tim.h" diff --git a/engines/kyra/script_tim.h b/engines/kyra/script_tim.h index 7cf7d0a7dd..89040720c2 100644 --- a/engines/kyra/script_tim.h +++ b/engines/kyra/script_tim.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef KYRA_SCRIPT_TIM_H diff --git a/engines/kyra/script_v1.cpp b/engines/kyra/script_v1.cpp index 13fdcb7d97..b12a08a417 100644 --- a/engines/kyra/script_v1.cpp +++ b/engines/kyra/script_v1.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "kyra/kyra_v1.h" diff --git a/engines/kyra/script_v2.cpp b/engines/kyra/script_v2.cpp index 081f9dd517..2e3a3d2bc4 100644 --- a/engines/kyra/script_v2.cpp +++ b/engines/kyra/script_v2.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "kyra/kyra_v2.h" diff --git a/engines/kyra/seqplayer.cpp b/engines/kyra/seqplayer.cpp index 16e89de146..ce2eafcea5 100644 --- a/engines/kyra/seqplayer.cpp +++ b/engines/kyra/seqplayer.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "kyra/seqplayer.h" diff --git a/engines/kyra/seqplayer.h b/engines/kyra/seqplayer.h index b75410af53..1f030cde19 100644 --- a/engines/kyra/seqplayer.h +++ b/engines/kyra/seqplayer.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef KYRA_SEQPLAYER_H diff --git a/engines/kyra/sequences_hof.cpp b/engines/kyra/sequences_hof.cpp index b268f13fc1..e504278047 100644 --- a/engines/kyra/sequences_hof.cpp +++ b/engines/kyra/sequences_hof.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "kyra/kyra_hof.h" diff --git a/engines/kyra/sequences_lok.cpp b/engines/kyra/sequences_lok.cpp index 0b39201f85..5f9bd86724 100644 --- a/engines/kyra/sequences_lok.cpp +++ b/engines/kyra/sequences_lok.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "kyra/kyra_lok.h" diff --git a/engines/kyra/sequences_lol.cpp b/engines/kyra/sequences_lol.cpp index da1245d7e6..d11403ad9f 100644 --- a/engines/kyra/sequences_lol.cpp +++ b/engines/kyra/sequences_lol.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifdef ENABLE_LOL diff --git a/engines/kyra/sequences_mr.cpp b/engines/kyra/sequences_mr.cpp index d3250823c5..b3adc687c2 100644 --- a/engines/kyra/sequences_mr.cpp +++ b/engines/kyra/sequences_mr.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "kyra/kyra_mr.h" diff --git a/engines/kyra/sequences_v2.cpp b/engines/kyra/sequences_v2.cpp index 4d9cdf0d5d..fb61d7cddf 100644 --- a/engines/kyra/sequences_v2.cpp +++ b/engines/kyra/sequences_v2.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "kyra/kyra_v2.h" diff --git a/engines/kyra/sound.cpp b/engines/kyra/sound.cpp index 1392824235..4da35cc28b 100644 --- a/engines/kyra/sound.cpp +++ b/engines/kyra/sound.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ diff --git a/engines/kyra/sound.h b/engines/kyra/sound.h index 326fef94d1..4f8e54212f 100644 --- a/engines/kyra/sound.h +++ b/engines/kyra/sound.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef KYRA_SOUND_H diff --git a/engines/kyra/sound_adlib.cpp b/engines/kyra/sound_adlib.cpp index 16f6ca3eaa..6ca01c65f3 100644 --- a/engines/kyra/sound_adlib.cpp +++ b/engines/kyra/sound_adlib.cpp @@ -34,9 +34,6 @@ * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * - * $URL$ - * $Id$ - * */ diff --git a/engines/kyra/sound_adlib.h b/engines/kyra/sound_adlib.h index aaca1b9138..58b97e3474 100644 --- a/engines/kyra/sound_adlib.h +++ b/engines/kyra/sound_adlib.h @@ -34,9 +34,6 @@ * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * - * $URL$ - * $Id$ - * */ #ifndef KYRA_SOUND_ADLIB_H diff --git a/engines/kyra/sound_amiga.cpp b/engines/kyra/sound_amiga.cpp index fed21eba84..dc09670408 100644 --- a/engines/kyra/sound_amiga.cpp +++ b/engines/kyra/sound_amiga.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "kyra/sound_intern.h" diff --git a/engines/kyra/sound_digital.cpp b/engines/kyra/sound_digital.cpp index 3d318b7e24..3f8eddbb0d 100644 --- a/engines/kyra/sound_digital.cpp +++ b/engines/kyra/sound_digital.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "kyra/sound.h" diff --git a/engines/kyra/sound_intern.h b/engines/kyra/sound_intern.h index 354f5732bf..488dbc3742 100644 --- a/engines/kyra/sound_intern.h +++ b/engines/kyra/sound_intern.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef KYRA_SOUND_INTERN_H diff --git a/engines/kyra/sound_lok.cpp b/engines/kyra/sound_lok.cpp index 83566372bf..95a632c08c 100644 --- a/engines/kyra/sound_lok.cpp +++ b/engines/kyra/sound_lok.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "kyra/kyra_lok.h" diff --git a/engines/kyra/sound_lol.cpp b/engines/kyra/sound_lol.cpp index 10d35e03d5..a7776f0ab6 100644 --- a/engines/kyra/sound_lol.cpp +++ b/engines/kyra/sound_lol.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifdef ENABLE_LOL diff --git a/engines/kyra/sound_midi.cpp b/engines/kyra/sound_midi.cpp index 02ba735a70..00f6c9329e 100644 --- a/engines/kyra/sound_midi.cpp +++ b/engines/kyra/sound_midi.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "kyra/sound_intern.h" diff --git a/engines/kyra/sound_pcspk.cpp b/engines/kyra/sound_pcspk.cpp index 46f35af3ab..051f36dd1b 100644 --- a/engines/kyra/sound_pcspk.cpp +++ b/engines/kyra/sound_pcspk.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "kyra/sound_intern.h" diff --git a/engines/kyra/sound_towns.cpp b/engines/kyra/sound_towns.cpp index 6b30824a2f..9a9892c9a4 100644 --- a/engines/kyra/sound_towns.cpp +++ b/engines/kyra/sound_towns.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "kyra/sound_intern.h" @@ -116,7 +113,7 @@ void SoundTowns::haltTrack() { for (int i = 0x40; i < 0x46; i++) _driver->chanVolume(i, 0); for (int i = 0; i < 32; i++) - _driver->chanEnable(i, 0); + _driver->configChan_enable(i, 0); _driver->stopParser(); } @@ -333,15 +330,15 @@ void SoundTowns::playEuphonyTrack(uint32 offset, int loop) { const uint8 *src = _musicTrackData + 852; for (int i = 0; i < 32; i++) - _driver->chanEnable(i, *src++); + _driver->configChan_enable(i, *src++); for (int i = 0; i < 32; i++) - _driver->chanMode(i, *src++); + _driver->configChan_setMode(i, *src++); for (int i = 0; i < 32; i++) - _driver->chanOrdr(i, *src++); + _driver->configChan_remap(i, *src++); for (int i = 0; i < 32; i++) - _driver->chanVolumeShift(i, *src++); + _driver->configChan_adjustVolume(i, *src++); for (int i = 0; i < 32; i++) - _driver->chanNoteShift(i, *src++); + _driver->configChan_setTranspose(i, *src++); src = _musicTrackData + 1748; for (int i = 0; i < 6; i++) diff --git a/engines/kyra/sprites.cpp b/engines/kyra/sprites.cpp index 23775d2946..e0d1142905 100644 --- a/engines/kyra/sprites.cpp +++ b/engines/kyra/sprites.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "kyra/sprites.h" @@ -28,11 +25,10 @@ #include "kyra/animator_lok.h" #include "common/system.h" -#include "common/EventRecorder.h" namespace Kyra { -Sprites::Sprites(KyraEngine_LoK *vm, OSystem *system) { +Sprites::Sprites(KyraEngine_LoK *vm, OSystem *system) : _rnd("kyraSprites") { _vm = vm; _res = vm->resource(); _screen = vm->screen(); @@ -43,7 +39,6 @@ Sprites::Sprites(KyraEngine_LoK *vm, OSystem *system) { _spriteDefStart = 0; memset(_drawLayerTable, 0, sizeof(_drawLayerTable)); _sceneAnimatorBeaconFlag = 0; - g_eventRec.registerRandomSource(_rnd, "kyraSprites"); } Sprites::~Sprites() { diff --git a/engines/kyra/sprites.h b/engines/kyra/sprites.h index f6c53e6d04..6a4241f13e 100644 --- a/engines/kyra/sprites.h +++ b/engines/kyra/sprites.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef KYRA_SPRITES_H diff --git a/engines/kyra/sprites_lol.cpp b/engines/kyra/sprites_lol.cpp index 6245ecdd1f..a77fda043c 100644 --- a/engines/kyra/sprites_lol.cpp +++ b/engines/kyra/sprites_lol.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifdef ENABLE_LOL diff --git a/engines/kyra/staticres.cpp b/engines/kyra/staticres.cpp index f83546e0dd..499cc6f301 100644 --- a/engines/kyra/staticres.cpp +++ b/engines/kyra/staticres.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "kyra/resource.h" diff --git a/engines/kyra/staticres_lol.cpp b/engines/kyra/staticres_lol.cpp index 3287ee37d6..cf75a317e1 100644 --- a/engines/kyra/staticres_lol.cpp +++ b/engines/kyra/staticres_lol.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "kyra/resource.h" diff --git a/engines/kyra/text.cpp b/engines/kyra/text.cpp index e0114cda29..2e3acffeb9 100644 --- a/engines/kyra/text.cpp +++ b/engines/kyra/text.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "kyra/text.h" diff --git a/engines/kyra/text.h b/engines/kyra/text.h index c53f2d1d2f..a95c2c4abc 100644 --- a/engines/kyra/text.h +++ b/engines/kyra/text.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef KYRA_TEXT_H diff --git a/engines/kyra/text_hof.cpp b/engines/kyra/text_hof.cpp index c961d2bf49..393fa8d11f 100644 --- a/engines/kyra/text_hof.cpp +++ b/engines/kyra/text_hof.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "kyra/text_hof.h" diff --git a/engines/kyra/text_hof.h b/engines/kyra/text_hof.h index 8e88918fa4..f371fb1898 100644 --- a/engines/kyra/text_hof.h +++ b/engines/kyra/text_hof.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef KYRA_TEXT_HOF_H diff --git a/engines/kyra/text_lok.cpp b/engines/kyra/text_lok.cpp index cca8e5aaf5..0ee3574903 100644 --- a/engines/kyra/text_lok.cpp +++ b/engines/kyra/text_lok.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "kyra/text.h" diff --git a/engines/kyra/text_lol.cpp b/engines/kyra/text_lol.cpp index c9a77be1b2..346d5100b8 100644 --- a/engines/kyra/text_lol.cpp +++ b/engines/kyra/text_lol.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifdef ENABLE_LOL diff --git a/engines/kyra/text_lol.h b/engines/kyra/text_lol.h index edac131106..020d4b5e89 100644 --- a/engines/kyra/text_lol.h +++ b/engines/kyra/text_lol.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifdef ENABLE_LOL diff --git a/engines/kyra/text_mr.cpp b/engines/kyra/text_mr.cpp index 5679dc1ee6..2cb752fdb3 100644 --- a/engines/kyra/text_mr.cpp +++ b/engines/kyra/text_mr.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "kyra/text_mr.h" diff --git a/engines/kyra/text_mr.h b/engines/kyra/text_mr.h index 5803bd0c31..957415490f 100644 --- a/engines/kyra/text_mr.h +++ b/engines/kyra/text_mr.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef KYRA_TEXT_MR_H diff --git a/engines/kyra/timer.cpp b/engines/kyra/timer.cpp index 475f17cadc..9834646a45 100644 --- a/engines/kyra/timer.cpp +++ b/engines/kyra/timer.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "kyra/timer.h" diff --git a/engines/kyra/timer.h b/engines/kyra/timer.h index d85a48cfa4..e9cb8b2b0c 100644 --- a/engines/kyra/timer.h +++ b/engines/kyra/timer.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef KYRA_TIMER_H diff --git a/engines/kyra/timer_hof.cpp b/engines/kyra/timer_hof.cpp index d8f86e30a2..96b14c28f5 100644 --- a/engines/kyra/timer_hof.cpp +++ b/engines/kyra/timer_hof.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "kyra/kyra_hof.h" diff --git a/engines/kyra/timer_lok.cpp b/engines/kyra/timer_lok.cpp index 3a312c22c6..e1825d027d 100644 --- a/engines/kyra/timer_lok.cpp +++ b/engines/kyra/timer_lok.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "kyra/kyra_lok.h" diff --git a/engines/kyra/timer_lol.cpp b/engines/kyra/timer_lol.cpp index a3dab365c7..4f450f570f 100644 --- a/engines/kyra/timer_lol.cpp +++ b/engines/kyra/timer_lol.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifdef ENABLE_LOL diff --git a/engines/kyra/timer_mr.cpp b/engines/kyra/timer_mr.cpp index 97ce7c166d..7d8325cd05 100644 --- a/engines/kyra/timer_mr.cpp +++ b/engines/kyra/timer_mr.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "kyra/kyra_mr.h" diff --git a/engines/kyra/util.cpp b/engines/kyra/util.cpp index 8fd7d4d069..3776bdc705 100644 --- a/engines/kyra/util.cpp +++ b/engines/kyra/util.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "kyra/util.h" diff --git a/engines/kyra/util.h b/engines/kyra/util.h index 43a861907b..042da74cd9 100644 --- a/engines/kyra/util.h +++ b/engines/kyra/util.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef KYRA_UTIL_H diff --git a/engines/kyra/vqa.cpp b/engines/kyra/vqa.cpp index 28071bc171..04455ae307 100644 --- a/engines/kyra/vqa.cpp +++ b/engines/kyra/vqa.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ // Player for Kyrandia 3 VQA movies, based on the information found at diff --git a/engines/kyra/vqa.h b/engines/kyra/vqa.h index b618b2f044..839bf5ac48 100644 --- a/engines/kyra/vqa.h +++ b/engines/kyra/vqa.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef KYRA_VQA_H diff --git a/engines/kyra/wsamovie.cpp b/engines/kyra/wsamovie.cpp index db324d48d4..37102744a8 100644 --- a/engines/kyra/wsamovie.cpp +++ b/engines/kyra/wsamovie.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "kyra/wsamovie.h" diff --git a/engines/kyra/wsamovie.h b/engines/kyra/wsamovie.h index f755cdd557..0d8bfdc869 100644 --- a/engines/kyra/wsamovie.h +++ b/engines/kyra/wsamovie.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef KYRA_WSAMOVIE_H diff --git a/engines/lastexpress/data/animation.cpp b/engines/lastexpress/data/animation.cpp index 2bf9bd4999..8ce73993c3 100644 --- a/engines/lastexpress/data/animation.cpp +++ b/engines/lastexpress/data/animation.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ // Based on Deniz Oezmen's code: http://oezmen.eu/ diff --git a/engines/lastexpress/data/animation.h b/engines/lastexpress/data/animation.h index 9bc2ba99cb..293511b266 100644 --- a/engines/lastexpress/data/animation.h +++ b/engines/lastexpress/data/animation.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef LASTEXPRESS_ANIMATION_H diff --git a/engines/lastexpress/data/archive.cpp b/engines/lastexpress/data/archive.cpp index ab95c28b1e..3aa5584ca4 100644 --- a/engines/lastexpress/data/archive.cpp +++ b/engines/lastexpress/data/archive.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ // Based on the Xentax Wiki documentation: diff --git a/engines/lastexpress/data/archive.h b/engines/lastexpress/data/archive.h index 17b1d661fa..8e0c46f183 100644 --- a/engines/lastexpress/data/archive.h +++ b/engines/lastexpress/data/archive.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef LASTEXPRESS_HPFARCHIVE_H diff --git a/engines/lastexpress/data/background.cpp b/engines/lastexpress/data/background.cpp index e8236bca86..de6fd7eeae 100644 --- a/engines/lastexpress/data/background.cpp +++ b/engines/lastexpress/data/background.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ // Based on Deniz Oezmen's code and Xentax Wiki documentation diff --git a/engines/lastexpress/data/background.h b/engines/lastexpress/data/background.h index 994b216ff9..74dad541aa 100644 --- a/engines/lastexpress/data/background.h +++ b/engines/lastexpress/data/background.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef LASTEXPRESS_BACKGROUND_H diff --git a/engines/lastexpress/data/cursor.cpp b/engines/lastexpress/data/cursor.cpp index fca9ed5d45..86a66b49d9 100644 --- a/engines/lastexpress/data/cursor.cpp +++ b/engines/lastexpress/data/cursor.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "lastexpress/data/cursor.h" diff --git a/engines/lastexpress/data/cursor.h b/engines/lastexpress/data/cursor.h index d23aa86a95..0e11ec04b8 100644 --- a/engines/lastexpress/data/cursor.h +++ b/engines/lastexpress/data/cursor.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef LASTEXPRESS_CURSOR_H diff --git a/engines/lastexpress/data/font.cpp b/engines/lastexpress/data/font.cpp index d9acbb8382..9a60b88a25 100644 --- a/engines/lastexpress/data/font.cpp +++ b/engines/lastexpress/data/font.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "lastexpress/data/font.h" diff --git a/engines/lastexpress/data/font.h b/engines/lastexpress/data/font.h index 7bcf03ed7d..7696829b3b 100644 --- a/engines/lastexpress/data/font.h +++ b/engines/lastexpress/data/font.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef LASTEXPRESS_FONT_H diff --git a/engines/lastexpress/data/scene.cpp b/engines/lastexpress/data/scene.cpp index e893d641a5..2ec8e6935d 100644 --- a/engines/lastexpress/data/scene.cpp +++ b/engines/lastexpress/data/scene.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "lastexpress/data/scene.h" diff --git a/engines/lastexpress/data/scene.h b/engines/lastexpress/data/scene.h index 9ec1899402..0c0d12b9c0 100644 --- a/engines/lastexpress/data/scene.h +++ b/engines/lastexpress/data/scene.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef LASTEXPRESS_SCENE_H diff --git a/engines/lastexpress/data/sequence.cpp b/engines/lastexpress/data/sequence.cpp index b986a33d5c..a27c27de2e 100644 --- a/engines/lastexpress/data/sequence.cpp +++ b/engines/lastexpress/data/sequence.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ // Based on Deniz Oezmen's code: http://oezmen.eu/ diff --git a/engines/lastexpress/data/sequence.h b/engines/lastexpress/data/sequence.h index cd16f26ab2..9987eae48e 100644 --- a/engines/lastexpress/data/sequence.h +++ b/engines/lastexpress/data/sequence.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef LASTEXPRESS_SEQUENCE_H diff --git a/engines/lastexpress/data/snd.cpp b/engines/lastexpress/data/snd.cpp index a50fa7be08..3ffe3ca14b 100644 --- a/engines/lastexpress/data/snd.cpp +++ b/engines/lastexpress/data/snd.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ // Based on the Xentax Wiki documentation: diff --git a/engines/lastexpress/data/snd.h b/engines/lastexpress/data/snd.h index 61d1c0951a..95a136ee1c 100644 --- a/engines/lastexpress/data/snd.h +++ b/engines/lastexpress/data/snd.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef LASTEXPRESS_SND_H diff --git a/engines/lastexpress/data/subtitle.cpp b/engines/lastexpress/data/subtitle.cpp index 2bc5d3c5ad..c3a7397b66 100644 --- a/engines/lastexpress/data/subtitle.cpp +++ b/engines/lastexpress/data/subtitle.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ // Based on the Xentax Wiki documentation: diff --git a/engines/lastexpress/data/subtitle.h b/engines/lastexpress/data/subtitle.h index 6d8e7535cb..435408e4bd 100644 --- a/engines/lastexpress/data/subtitle.h +++ b/engines/lastexpress/data/subtitle.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef LASTEXPRESS_SUBTITLE_H diff --git a/engines/lastexpress/debug.cpp b/engines/lastexpress/debug.cpp index 520b4cfee3..e1bd9494a9 100644 --- a/engines/lastexpress/debug.cpp +++ b/engines/lastexpress/debug.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "lastexpress/debug.h" diff --git a/engines/lastexpress/debug.h b/engines/lastexpress/debug.h index e935b35fc0..d9ba6f47a1 100644 --- a/engines/lastexpress/debug.h +++ b/engines/lastexpress/debug.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef LASTEXPRESS_DEBUG_H diff --git a/engines/lastexpress/detection.cpp b/engines/lastexpress/detection.cpp index 1cf51106c6..bfcb415da1 100644 --- a/engines/lastexpress/detection.cpp +++ b/engines/lastexpress/detection.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "lastexpress/lastexpress.h" @@ -210,7 +207,7 @@ public: LastExpressMetaEngine() : AdvancedMetaEngine(detectionParams) {} const char *getName() const { - return "LastExpress Engine"; + return "Last Express"; } const char *getOriginalCopyright() const { diff --git a/engines/lastexpress/drawable.h b/engines/lastexpress/drawable.h index e273876362..5e77b0343a 100644 --- a/engines/lastexpress/drawable.h +++ b/engines/lastexpress/drawable.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef LASTEXPRESS_DRAWABLE_H diff --git a/engines/lastexpress/entities/abbot.cpp b/engines/lastexpress/entities/abbot.cpp index 717bd8af9b..29bb31b248 100644 --- a/engines/lastexpress/entities/abbot.cpp +++ b/engines/lastexpress/entities/abbot.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "lastexpress/entities/abbot.h" diff --git a/engines/lastexpress/entities/abbot.h b/engines/lastexpress/entities/abbot.h index 7e7b78b3be..462f5a491e 100644 --- a/engines/lastexpress/entities/abbot.h +++ b/engines/lastexpress/entities/abbot.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef LASTEXPRESS_ABBOT_H diff --git a/engines/lastexpress/entities/alexei.cpp b/engines/lastexpress/entities/alexei.cpp index 0df76652f9..d723a5607c 100644 --- a/engines/lastexpress/entities/alexei.cpp +++ b/engines/lastexpress/entities/alexei.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "lastexpress/entities/alexei.h" diff --git a/engines/lastexpress/entities/alexei.h b/engines/lastexpress/entities/alexei.h index 420e6e87fc..262826ae42 100644 --- a/engines/lastexpress/entities/alexei.h +++ b/engines/lastexpress/entities/alexei.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef LASTEXPRESS_ALEXEI_H diff --git a/engines/lastexpress/entities/alouan.cpp b/engines/lastexpress/entities/alouan.cpp index e0a082a100..715622aaab 100644 --- a/engines/lastexpress/entities/alouan.cpp +++ b/engines/lastexpress/entities/alouan.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "lastexpress/entities/alouan.h" diff --git a/engines/lastexpress/entities/alouan.h b/engines/lastexpress/entities/alouan.h index 33d5e2f23d..c6a6beddd9 100644 --- a/engines/lastexpress/entities/alouan.h +++ b/engines/lastexpress/entities/alouan.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef LASTEXPRESS_ALOUAN_H diff --git a/engines/lastexpress/entities/anna.cpp b/engines/lastexpress/entities/anna.cpp index 3071c3d0d7..0bedda41e8 100644 --- a/engines/lastexpress/entities/anna.cpp +++ b/engines/lastexpress/entities/anna.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "lastexpress/entities/anna.h" diff --git a/engines/lastexpress/entities/anna.h b/engines/lastexpress/entities/anna.h index 5297d6f745..72c6db4bd9 100644 --- a/engines/lastexpress/entities/anna.h +++ b/engines/lastexpress/entities/anna.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef LASTEXPRESS_ANNA_H diff --git a/engines/lastexpress/entities/august.cpp b/engines/lastexpress/entities/august.cpp index 27f989d7df..f7e7390b90 100644 --- a/engines/lastexpress/entities/august.cpp +++ b/engines/lastexpress/entities/august.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "lastexpress/entities/august.h" diff --git a/engines/lastexpress/entities/august.h b/engines/lastexpress/entities/august.h index 1a883a0ed5..2cbb31b968 100644 --- a/engines/lastexpress/entities/august.h +++ b/engines/lastexpress/entities/august.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef LASTEXPRESS_AUGUST_H diff --git a/engines/lastexpress/entities/boutarel.cpp b/engines/lastexpress/entities/boutarel.cpp index e306019f32..0b2040897c 100644 --- a/engines/lastexpress/entities/boutarel.cpp +++ b/engines/lastexpress/entities/boutarel.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "lastexpress/entities/boutarel.h" diff --git a/engines/lastexpress/entities/boutarel.h b/engines/lastexpress/entities/boutarel.h index 0ac051df77..5eb264631c 100644 --- a/engines/lastexpress/entities/boutarel.h +++ b/engines/lastexpress/entities/boutarel.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef LASTEXPRESS_BOUTAREL_H diff --git a/engines/lastexpress/entities/chapters.cpp b/engines/lastexpress/entities/chapters.cpp index c2ae52a99e..1252a62d8d 100644 --- a/engines/lastexpress/entities/chapters.cpp +++ b/engines/lastexpress/entities/chapters.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "lastexpress/entities/chapters.h" diff --git a/engines/lastexpress/entities/chapters.h b/engines/lastexpress/entities/chapters.h index 6a31727c23..353d3a6b5b 100644 --- a/engines/lastexpress/entities/chapters.h +++ b/engines/lastexpress/entities/chapters.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef LASTEXPRESS_CHAPTERS_H diff --git a/engines/lastexpress/entities/cooks.cpp b/engines/lastexpress/entities/cooks.cpp index 558401ecfd..336f911800 100644 --- a/engines/lastexpress/entities/cooks.cpp +++ b/engines/lastexpress/entities/cooks.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "lastexpress/entities/cooks.h" diff --git a/engines/lastexpress/entities/cooks.h b/engines/lastexpress/entities/cooks.h index fc3a0cb78c..3ab7d35161 100644 --- a/engines/lastexpress/entities/cooks.h +++ b/engines/lastexpress/entities/cooks.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef LASTEXPRESS_COOKS_H diff --git a/engines/lastexpress/entities/coudert.cpp b/engines/lastexpress/entities/coudert.cpp index 17adce6d58..e74471ebca 100644 --- a/engines/lastexpress/entities/coudert.cpp +++ b/engines/lastexpress/entities/coudert.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "lastexpress/entities/coudert.h" diff --git a/engines/lastexpress/entities/coudert.h b/engines/lastexpress/entities/coudert.h index 13dad6f122..45d13ce9bb 100644 --- a/engines/lastexpress/entities/coudert.h +++ b/engines/lastexpress/entities/coudert.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef LASTEXPRESS_COUDERT_H diff --git a/engines/lastexpress/entities/entity.cpp b/engines/lastexpress/entities/entity.cpp index 38b3dec09f..22750989fb 100644 --- a/engines/lastexpress/entities/entity.cpp +++ b/engines/lastexpress/entities/entity.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "lastexpress/entities/entity.h" diff --git a/engines/lastexpress/entities/entity.h b/engines/lastexpress/entities/entity.h index 8c6cc2bafc..01cf17f791 100644 --- a/engines/lastexpress/entities/entity.h +++ b/engines/lastexpress/entities/entity.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef LASTEXPRESS_ENTITY_H diff --git a/engines/lastexpress/entities/entity39.cpp b/engines/lastexpress/entities/entity39.cpp index d2f7ab0d64..e786d153a0 100644 --- a/engines/lastexpress/entities/entity39.cpp +++ b/engines/lastexpress/entities/entity39.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "lastexpress/entities/entity39.h" diff --git a/engines/lastexpress/entities/entity39.h b/engines/lastexpress/entities/entity39.h index 344cf5b494..4335a9566e 100644 --- a/engines/lastexpress/entities/entity39.h +++ b/engines/lastexpress/entities/entity39.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef LASTEXPRESS_ENTITY39_H diff --git a/engines/lastexpress/entities/entity_intern.h b/engines/lastexpress/entities/entity_intern.h index d196989f1d..43d7f702c9 100644 --- a/engines/lastexpress/entities/entity_intern.h +++ b/engines/lastexpress/entities/entity_intern.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef LASTEXPRESS_ENTITY_INTERN_H diff --git a/engines/lastexpress/entities/francois.cpp b/engines/lastexpress/entities/francois.cpp index 088996c449..86b6820499 100644 --- a/engines/lastexpress/entities/francois.cpp +++ b/engines/lastexpress/entities/francois.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "lastexpress/entities/francois.h" diff --git a/engines/lastexpress/entities/francois.h b/engines/lastexpress/entities/francois.h index c924cf677b..19eca6fb50 100644 --- a/engines/lastexpress/entities/francois.h +++ b/engines/lastexpress/entities/francois.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef LASTEXPRESS_FRANCOIS_H diff --git a/engines/lastexpress/entities/gendarmes.cpp b/engines/lastexpress/entities/gendarmes.cpp index 761ba0740e..f5ae191f9d 100644 --- a/engines/lastexpress/entities/gendarmes.cpp +++ b/engines/lastexpress/entities/gendarmes.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "lastexpress/entities/gendarmes.h" diff --git a/engines/lastexpress/entities/gendarmes.h b/engines/lastexpress/entities/gendarmes.h index 095a74fa44..e8f9cb2c38 100644 --- a/engines/lastexpress/entities/gendarmes.h +++ b/engines/lastexpress/entities/gendarmes.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef LASTEXPRESS_GENDARMES_H diff --git a/engines/lastexpress/entities/hadija.cpp b/engines/lastexpress/entities/hadija.cpp index 6ed93a239c..ce2c9718db 100644 --- a/engines/lastexpress/entities/hadija.cpp +++ b/engines/lastexpress/entities/hadija.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "lastexpress/entities/hadija.h" diff --git a/engines/lastexpress/entities/hadija.h b/engines/lastexpress/entities/hadija.h index bd37a205d9..d2495955e0 100644 --- a/engines/lastexpress/entities/hadija.h +++ b/engines/lastexpress/entities/hadija.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef LASTEXPRESS_HADIJA_H diff --git a/engines/lastexpress/entities/ivo.cpp b/engines/lastexpress/entities/ivo.cpp index ef6bbd32d2..35f4ccfb8c 100644 --- a/engines/lastexpress/entities/ivo.cpp +++ b/engines/lastexpress/entities/ivo.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "lastexpress/entities/ivo.h" diff --git a/engines/lastexpress/entities/ivo.h b/engines/lastexpress/entities/ivo.h index e726c95af0..cd5cb7b6be 100644 --- a/engines/lastexpress/entities/ivo.h +++ b/engines/lastexpress/entities/ivo.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef LASTEXPRESS_IVO_H diff --git a/engines/lastexpress/entities/kahina.cpp b/engines/lastexpress/entities/kahina.cpp index b882688853..6472ce0533 100644 --- a/engines/lastexpress/entities/kahina.cpp +++ b/engines/lastexpress/entities/kahina.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "lastexpress/entities/kahina.h" diff --git a/engines/lastexpress/entities/kahina.h b/engines/lastexpress/entities/kahina.h index 4be9d9fb27..b25053e339 100644 --- a/engines/lastexpress/entities/kahina.h +++ b/engines/lastexpress/entities/kahina.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef LASTEXPRESS_KAHINA_H diff --git a/engines/lastexpress/entities/kronos.cpp b/engines/lastexpress/entities/kronos.cpp index 66ae8be752..925b0967b7 100644 --- a/engines/lastexpress/entities/kronos.cpp +++ b/engines/lastexpress/entities/kronos.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "lastexpress/entities/kronos.h" diff --git a/engines/lastexpress/entities/kronos.h b/engines/lastexpress/entities/kronos.h index f73c245347..4c61b98620 100644 --- a/engines/lastexpress/entities/kronos.h +++ b/engines/lastexpress/entities/kronos.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef LASTEXPRESS_KRONOS_H diff --git a/engines/lastexpress/entities/mahmud.cpp b/engines/lastexpress/entities/mahmud.cpp index 9aa042c1ec..7d30d31a84 100644 --- a/engines/lastexpress/entities/mahmud.cpp +++ b/engines/lastexpress/entities/mahmud.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "lastexpress/data/scene.h" diff --git a/engines/lastexpress/entities/mahmud.h b/engines/lastexpress/entities/mahmud.h index 647d48b8ed..5feb95cba5 100644 --- a/engines/lastexpress/entities/mahmud.h +++ b/engines/lastexpress/entities/mahmud.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef LASTEXPRESS_MAHMUD_H diff --git a/engines/lastexpress/entities/max.cpp b/engines/lastexpress/entities/max.cpp index 1aa391bda0..7e5931322d 100644 --- a/engines/lastexpress/entities/max.cpp +++ b/engines/lastexpress/entities/max.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "lastexpress/entities/max.h" diff --git a/engines/lastexpress/entities/max.h b/engines/lastexpress/entities/max.h index 93eb165a0f..17b58475aa 100644 --- a/engines/lastexpress/entities/max.h +++ b/engines/lastexpress/entities/max.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef LASTEXPRESS_MAX_H diff --git a/engines/lastexpress/entities/mertens.cpp b/engines/lastexpress/entities/mertens.cpp index de844db3e9..91082f487e 100644 --- a/engines/lastexpress/entities/mertens.cpp +++ b/engines/lastexpress/entities/mertens.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "lastexpress/entities/mertens.h" diff --git a/engines/lastexpress/entities/mertens.h b/engines/lastexpress/entities/mertens.h index ccce17795c..31b7a97dcd 100644 --- a/engines/lastexpress/entities/mertens.h +++ b/engines/lastexpress/entities/mertens.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef LASTEXPRESS_MERTENS_H diff --git a/engines/lastexpress/entities/milos.cpp b/engines/lastexpress/entities/milos.cpp index 01f9362f43..587c43cade 100644 --- a/engines/lastexpress/entities/milos.cpp +++ b/engines/lastexpress/entities/milos.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "lastexpress/entities/milos.h" diff --git a/engines/lastexpress/entities/milos.h b/engines/lastexpress/entities/milos.h index 6d44d1c4d9..d58d717f8a 100644 --- a/engines/lastexpress/entities/milos.h +++ b/engines/lastexpress/entities/milos.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef LASTEXPRESS_MILOS_H diff --git a/engines/lastexpress/entities/mmeboutarel.cpp b/engines/lastexpress/entities/mmeboutarel.cpp index 46f7cf40d1..78f2d2fb4b 100644 --- a/engines/lastexpress/entities/mmeboutarel.cpp +++ b/engines/lastexpress/entities/mmeboutarel.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "lastexpress/entities/mmeboutarel.h" diff --git a/engines/lastexpress/entities/mmeboutarel.h b/engines/lastexpress/entities/mmeboutarel.h index 1f1d762dd9..772451ba15 100644 --- a/engines/lastexpress/entities/mmeboutarel.h +++ b/engines/lastexpress/entities/mmeboutarel.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef LASTEXPRESS_MMEBOUTAREL_H diff --git a/engines/lastexpress/entities/pascale.cpp b/engines/lastexpress/entities/pascale.cpp index a75c76e0ca..7cf7f7766e 100644 --- a/engines/lastexpress/entities/pascale.cpp +++ b/engines/lastexpress/entities/pascale.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "lastexpress/entities/pascale.h" diff --git a/engines/lastexpress/entities/pascale.h b/engines/lastexpress/entities/pascale.h index d0098dcf0b..333ebcae3e 100644 --- a/engines/lastexpress/entities/pascale.h +++ b/engines/lastexpress/entities/pascale.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef LASTEXPRESS_PASCALE_H diff --git a/engines/lastexpress/entities/rebecca.cpp b/engines/lastexpress/entities/rebecca.cpp index a1a8b29329..1cb895d8d6 100644 --- a/engines/lastexpress/entities/rebecca.cpp +++ b/engines/lastexpress/entities/rebecca.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "lastexpress/entities/rebecca.h" diff --git a/engines/lastexpress/entities/rebecca.h b/engines/lastexpress/entities/rebecca.h index bdc9fe1d3b..e91ee30d4d 100644 --- a/engines/lastexpress/entities/rebecca.h +++ b/engines/lastexpress/entities/rebecca.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef LASTEXPRESS_REBECCA_H diff --git a/engines/lastexpress/entities/salko.cpp b/engines/lastexpress/entities/salko.cpp index c6be25df7d..4d510bb9bf 100644 --- a/engines/lastexpress/entities/salko.cpp +++ b/engines/lastexpress/entities/salko.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "lastexpress/entities/salko.h" diff --git a/engines/lastexpress/entities/salko.h b/engines/lastexpress/entities/salko.h index f21724d88a..6308211053 100644 --- a/engines/lastexpress/entities/salko.h +++ b/engines/lastexpress/entities/salko.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef LASTEXPRESS_SALKO_H diff --git a/engines/lastexpress/entities/servers0.cpp b/engines/lastexpress/entities/servers0.cpp index 57fa4da189..1fec775659 100644 --- a/engines/lastexpress/entities/servers0.cpp +++ b/engines/lastexpress/entities/servers0.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "lastexpress/entities/servers0.h" diff --git a/engines/lastexpress/entities/servers0.h b/engines/lastexpress/entities/servers0.h index 3e1bd21e0d..2e9165a410 100644 --- a/engines/lastexpress/entities/servers0.h +++ b/engines/lastexpress/entities/servers0.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef LASTEXPRESS_SERVERS0_H diff --git a/engines/lastexpress/entities/servers1.cpp b/engines/lastexpress/entities/servers1.cpp index bb3566802d..cd0a162755 100644 --- a/engines/lastexpress/entities/servers1.cpp +++ b/engines/lastexpress/entities/servers1.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "lastexpress/entities/servers1.h" diff --git a/engines/lastexpress/entities/servers1.h b/engines/lastexpress/entities/servers1.h index 14a6bf09a6..13b30696f0 100644 --- a/engines/lastexpress/entities/servers1.h +++ b/engines/lastexpress/entities/servers1.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef LASTEXPRESS_SERVERS1_H diff --git a/engines/lastexpress/entities/sophie.cpp b/engines/lastexpress/entities/sophie.cpp index 692c112d62..e0c63f7297 100644 --- a/engines/lastexpress/entities/sophie.cpp +++ b/engines/lastexpress/entities/sophie.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "lastexpress/entities/sophie.h" diff --git a/engines/lastexpress/entities/sophie.h b/engines/lastexpress/entities/sophie.h index 24a70188da..c2ca348027 100644 --- a/engines/lastexpress/entities/sophie.h +++ b/engines/lastexpress/entities/sophie.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef LASTEXPRESS_SOPHIE_H diff --git a/engines/lastexpress/entities/tables.cpp b/engines/lastexpress/entities/tables.cpp index 616188d253..c372663c40 100644 --- a/engines/lastexpress/entities/tables.cpp +++ b/engines/lastexpress/entities/tables.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "lastexpress/entities/tables.h" diff --git a/engines/lastexpress/entities/tables.h b/engines/lastexpress/entities/tables.h index e5fe28128b..7fcfc0499e 100644 --- a/engines/lastexpress/entities/tables.h +++ b/engines/lastexpress/entities/tables.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef LASTEXPRESS_TABLES_H diff --git a/engines/lastexpress/entities/tatiana.cpp b/engines/lastexpress/entities/tatiana.cpp index d9c9e8350e..6e25d8c5c7 100644 --- a/engines/lastexpress/entities/tatiana.cpp +++ b/engines/lastexpress/entities/tatiana.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "lastexpress/entities/tatiana.h" diff --git a/engines/lastexpress/entities/tatiana.h b/engines/lastexpress/entities/tatiana.h index 171f7d62d3..c457d49b1e 100644 --- a/engines/lastexpress/entities/tatiana.h +++ b/engines/lastexpress/entities/tatiana.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef LASTEXPRESS_TATIANA_H diff --git a/engines/lastexpress/entities/train.cpp b/engines/lastexpress/entities/train.cpp index 0241931bac..19c6fe279c 100644 --- a/engines/lastexpress/entities/train.cpp +++ b/engines/lastexpress/entities/train.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "lastexpress/entities/train.h" diff --git a/engines/lastexpress/entities/train.h b/engines/lastexpress/entities/train.h index 95cb0f28bd..ea9e1d7a07 100644 --- a/engines/lastexpress/entities/train.h +++ b/engines/lastexpress/entities/train.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef LASTEXPRESS_TRAIN_H diff --git a/engines/lastexpress/entities/vassili.cpp b/engines/lastexpress/entities/vassili.cpp index c203015d13..09fb5b1223 100644 --- a/engines/lastexpress/entities/vassili.cpp +++ b/engines/lastexpress/entities/vassili.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "lastexpress/entities/vassili.h" diff --git a/engines/lastexpress/entities/vassili.h b/engines/lastexpress/entities/vassili.h index 1862069e25..843a065174 100644 --- a/engines/lastexpress/entities/vassili.h +++ b/engines/lastexpress/entities/vassili.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef LASTEXPRESS_VASSILI_H diff --git a/engines/lastexpress/entities/verges.cpp b/engines/lastexpress/entities/verges.cpp index 9d5cf6af85..bc35a105b1 100644 --- a/engines/lastexpress/entities/verges.cpp +++ b/engines/lastexpress/entities/verges.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "lastexpress/entities/verges.h" diff --git a/engines/lastexpress/entities/verges.h b/engines/lastexpress/entities/verges.h index 40a43eac9d..17a3c8ac40 100644 --- a/engines/lastexpress/entities/verges.h +++ b/engines/lastexpress/entities/verges.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef LASTEXPRESS_VERGES_H diff --git a/engines/lastexpress/entities/vesna.cpp b/engines/lastexpress/entities/vesna.cpp index 87742e78a4..8e09dbf7b0 100644 --- a/engines/lastexpress/entities/vesna.cpp +++ b/engines/lastexpress/entities/vesna.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "lastexpress/entities/vesna.h" diff --git a/engines/lastexpress/entities/vesna.h b/engines/lastexpress/entities/vesna.h index 55a9a989c5..a09664096d 100644 --- a/engines/lastexpress/entities/vesna.h +++ b/engines/lastexpress/entities/vesna.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef LASTEXPRESS_VESNA_H diff --git a/engines/lastexpress/entities/yasmin.cpp b/engines/lastexpress/entities/yasmin.cpp index 2eb5c13862..7e8b2f7348 100644 --- a/engines/lastexpress/entities/yasmin.cpp +++ b/engines/lastexpress/entities/yasmin.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "lastexpress/entities/yasmin.h" diff --git a/engines/lastexpress/entities/yasmin.h b/engines/lastexpress/entities/yasmin.h index b35c713f8b..e943a8b158 100644 --- a/engines/lastexpress/entities/yasmin.h +++ b/engines/lastexpress/entities/yasmin.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef LASTEXPRESS_YASMIN_H diff --git a/engines/lastexpress/eventhandler.h b/engines/lastexpress/eventhandler.h index 6f28984d2c..c561d57541 100644 --- a/engines/lastexpress/eventhandler.h +++ b/engines/lastexpress/eventhandler.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef LASTEXPRESS_EVENTHANDLER_H diff --git a/engines/lastexpress/game/action.cpp b/engines/lastexpress/game/action.cpp index d14e295cb3..7540d18ed8 100644 --- a/engines/lastexpress/game/action.cpp +++ b/engines/lastexpress/game/action.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "lastexpress/game/action.h" diff --git a/engines/lastexpress/game/action.h b/engines/lastexpress/game/action.h index 6a2e3eb597..e1a4a53224 100644 --- a/engines/lastexpress/game/action.h +++ b/engines/lastexpress/game/action.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef LASTEXPRESS_ACTION_H diff --git a/engines/lastexpress/game/beetle.cpp b/engines/lastexpress/game/beetle.cpp index 665edb79a5..cb6f0a3306 100644 --- a/engines/lastexpress/game/beetle.cpp +++ b/engines/lastexpress/game/beetle.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "lastexpress/game/beetle.h" diff --git a/engines/lastexpress/game/beetle.h b/engines/lastexpress/game/beetle.h index 661618a251..d3c47f39e5 100644 --- a/engines/lastexpress/game/beetle.h +++ b/engines/lastexpress/game/beetle.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef LASTEXPRESS_BEETLE_H diff --git a/engines/lastexpress/game/entities.cpp b/engines/lastexpress/game/entities.cpp index d124d8cb23..513ad114b0 100644 --- a/engines/lastexpress/game/entities.cpp +++ b/engines/lastexpress/game/entities.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "lastexpress/game/entities.h" diff --git a/engines/lastexpress/game/entities.h b/engines/lastexpress/game/entities.h index 8cc2072c42..eb5eae461f 100644 --- a/engines/lastexpress/game/entities.h +++ b/engines/lastexpress/game/entities.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef LASTEXPRESS_ENTITIES_H diff --git a/engines/lastexpress/game/fight.cpp b/engines/lastexpress/game/fight.cpp index 5777ef470b..ecc43bed2b 100644 --- a/engines/lastexpress/game/fight.cpp +++ b/engines/lastexpress/game/fight.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "lastexpress/game/fight.h" diff --git a/engines/lastexpress/game/fight.h b/engines/lastexpress/game/fight.h index 4484017184..a33cc93a29 100644 --- a/engines/lastexpress/game/fight.h +++ b/engines/lastexpress/game/fight.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef LASTEXPRESS_FIGHT_H diff --git a/engines/lastexpress/game/inventory.cpp b/engines/lastexpress/game/inventory.cpp index 81189ae633..adf6ff772e 100644 --- a/engines/lastexpress/game/inventory.cpp +++ b/engines/lastexpress/game/inventory.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "lastexpress/game/inventory.h" @@ -43,13 +40,13 @@ namespace LastExpress { -Inventory::Inventory(LastExpressEngine *engine) : _engine(engine), _selectedItem(kItemNone), _highlightedItem(kItemNone), _itemsShown(0), +Inventory::Inventory(LastExpressEngine *engine) : _engine(engine), _selectedItem(kItemNone), _highlightedItemIndex(0), _itemsShown(0), _showingHourGlass(false), _blinkingEgg(false), _blinkingTime(0), _blinkingInterval(_defaultBlinkingInterval), _blinkingBrightness(1), - _useMagnifier(false), _flag1(false), _isOpened(false), _eggHightlighted(false), _itemScene(NULL) { + _useMagnifier(false), _portraitHighlighted(false), _isOpened(false), _eggHightlighted(false), _itemScene(NULL) { - _inventoryRect = Common::Rect(0, 0, 32, 32); - _menuRect = Common::Rect(608, 448, 640, 480); - _selectedRect = Common::Rect(44, 0, 76, 32); + //_inventoryRect = Common::Rect(0, 0, 32, 32); + _menuEggRect = Common::Rect(608, 448, 640, 480); + _selectedItemRect = Common::Rect(44, 0, 76, 32); init(); } @@ -127,22 +124,18 @@ void Inventory::init() { _selectedItem = kItemNone; } -// FIXME we need to draw cursors with full background opacity so that whatever is in the background is erased -// this saved us clearing some part of the background when switching between states - -// TODO if we draw inventory objects on screen, we need to load a new scene. -// Signal that the inventory has taken over the screen and stop processing mouse events after we have been called void Inventory::handleMouseEvent(const Common::Event &ev) { _useMagnifier = false; // Egg (menu) - if (!_menuRect.contains(ev.mouse)) { + if (!_menuEggRect.contains(ev.mouse)) { // Remove highlight if needed if (_eggHightlighted) { if (!getGlobalTimer()) { drawItem((CursorStyle)(getMenu()->getGameId() + 39), 608, 448, 1); askForRedraw(); } + _eggHightlighted = false; } } else { @@ -159,7 +152,7 @@ void Inventory::handleMouseEvent(const Common::Event &ev) { // If clicked, show the menu if (ev.type == Common::EVENT_LBUTTONDOWN) { _eggHightlighted = false; - _flag1 = false; + _portraitHighlighted = false; _isOpened = false; getSound()->playSoundWithSubtitles("LIB039.SND", SoundManager::kFlagMenuClock, kEntityPlayer); @@ -178,14 +171,171 @@ void Inventory::handleMouseEvent(const Common::Event &ev) { // Selected item if (ev.mouse.x >= 32) { - // TODO + if (_isOpened) { + // If we are currently inside inventory with the mouse pressed + if (getFlags()->mouseLeftPressed) { + if (_highlightedItemIndex) + drawHighlight(_highlightedItemIndex, true); + } else { + // The user released the mouse button, we need to update the inventory state (clear hightlight and items) + drawItem((CursorStyle)getProgress().portrait, 0, 0, 1); + _engine->getGraphicsManager()->clear(GraphicsManager::kBackgroundInventory, Common::Rect(0, 44, 32, (int16)(40 * _itemsShown + 40))); + _isOpened = false; + askForRedraw(); + + drawSelectedItem(); + + // Load backup scene + if (getState()->sceneUseBackup) { + SceneIndex scene = kSceneNone; + if (getState()->sceneBackup2) { + scene = getState()->sceneBackup2; + getState()->sceneBackup2 = kSceneNone; + + // Load our scene + getScenes()->loadScene(scene); + } else if (!getEvent(kEventKronosBringFirebird) && !getProgress().isEggOpen) { + getState()->sceneUseBackup = false; + scene = getState()->sceneBackup; + + if (getEntities()->getPosition(getScenes()->get(scene)->car, getScenes()->get(scene)->position)) + scene = getScenes()->processIndex(getState()->sceneBackup); + + // Load our scene + getScenes()->loadScene(scene); + } + } + } + } else { + if (_portraitHighlighted) { + drawItem((CursorStyle)getProgress().portrait, 0, 0, 1); + askForRedraw(); + _portraitHighlighted = false; + } + + // Magnifier + if (_selectedItem != kItemNone + && get(_selectedItem)->scene != kSceneNone + && _selectedItemRect.contains(ev.mouse)) { + + if (!getState()->sceneUseBackup || (getState()->sceneBackup2 && getFirstExaminableItem() == _selectedItem)) + _useMagnifier = true; + + if (getFlags()->mouseLeftPressed) { + if (getState()->sceneUseBackup) { + if (getState()->sceneBackup2 + && getFirstExaminableItem() == _selectedItem) { + SceneIndex sceneIndex = getState()->sceneBackup2; + getState()->sceneBackup2 = kSceneNone; + + getScenes()->loadScene(sceneIndex); + } + } else { + getState()->sceneBackup = getState()->scene; + getState()->sceneUseBackup = true; + + getScenes()->loadScene(get(_selectedItem)->scene); + } + } + } + } return; } // Opened inventory if (ev.mouse.y >= 32) { - // TODO + // Draw portrait (darkened) if the inventory is closed (and we are not on top of it) + if (!_isOpened) { + if (_portraitHighlighted) { + drawItem((CursorStyle)getProgress().portrait, 0, 0, 1); + askForRedraw(); + _portraitHighlighted = false; + } + + return; + } + + // Change item highlight on list + if (getFlags()->mouseLeftPressed) { + uint32 index = ev.mouse.y / 40; + + if (_highlightedItemIndex && _highlightedItemIndex != index) + drawHighlight(_highlightedItemIndex, true); + + if (index && index <= _itemsShown && index != _highlightedItemIndex) + drawHighlight(index, false); + + return; + } + + // User released the mouse button, check if we were on a valid item + uint32 index = _highlightedItemIndex ? getItemIndex(_highlightedItemIndex) : 0; + + // Reset items and portrait + drawItem((CursorStyle)getProgress().portrait, 0, 0, 1); + _engine->getGraphicsManager()->clear(GraphicsManager::kBackgroundInventory, Common::Rect(0, 44, 32, (int16)(40 * _itemsShown + 40))); + askForRedraw(); + _highlightedItemIndex = 0; + _itemsShown = 0; + + // Load the scene if an item has been selected + if (index) { + InventoryEntry entry = _entries[index]; + + // If a scene is affected to the item + if (entry.scene) { + if (getState()->sceneUseBackup) { + if (getFirstExaminableItem() && !getState()->sceneBackup2) + getState()->sceneBackup2 = getState()->scene; + } else { + getState()->sceneUseBackup = true; + getState()->sceneBackup = getState()->scene; + } + + getScenes()->loadScene(entry.scene); + } + + if (entry.field_2) + selectItem((InventoryItem)index); + else + drawSelectedItem(); + + // Set inventory as closed (will cause a cleanup on next call) + _isOpened = false; + + return; + } + + // Draw the currently selected item + drawSelectedItem(); + + // Stop processing if we are not looking at an item already + if (!getState()->sceneUseBackup) { + _isOpened = false; + return; + } + + SceneIndex scene = kSceneNone; + if (getState()->sceneBackup2) { + scene = getState()->sceneBackup2; + getState()->sceneBackup2 = kSceneNone; + } else { + if (getEvent(kEventKronosBringFirebird) || getProgress().isEggOpen) { + _isOpened = false; + return; + } + + getState()->sceneUseBackup = false; + scene = getState()->sceneBackup; + + if (getEntities()->getPosition(getScenes()->get(scene)->car, getScenes()->get(scene)->position)) + scene = getScenes()->processIndex(getState()->sceneBackup); + } + + getScenes()->loadScene(scene); + + _isOpened = false; return; } @@ -202,10 +352,10 @@ void Inventory::handleMouseEvent(const Common::Event &ev) { return; } - if (!_flag1 && !_isOpened) { + if (!_portraitHighlighted && !_isOpened) { drawItem((CursorStyle)getProgress().portrait, 0, 0); - _flag1 = true; - } else if (!_isOpened || (ev.type == Common::EVENT_LBUTTONDOWN || ev.type == Common::EVENT_LBUTTONUP)) { + _portraitHighlighted = true; + } else if (!_isOpened || getFlags()->mouseLeftPressed) { // Do nothing } else if (_isOpened) { close(); @@ -239,12 +389,12 @@ void Inventory::handleMouseEvent(const Common::Event &ev) { } } - _flag1 = true; + _portraitHighlighted = true; } // Draw highlighted item - if (_highlightedItem) - drawHighlight(); + if (_highlightedItemIndex) + drawHighlight(_highlightedItemIndex, true); } } @@ -256,7 +406,7 @@ void Inventory::show() { askForRedraw(); // Show portrait (first draw, cannot be highlighted) - drawItem((CursorStyle)getProgress().portrait, 0, 0); + drawItem((CursorStyle)getProgress().portrait, 0, 0, 1); // Show selected item if (_selectedItem != kItemNone) @@ -511,9 +661,27 @@ void Inventory::drawItem(CursorStyle id, uint16 x, uint16 y, int16 brightnessInd _engine->getGraphicsManager()->draw(&icon, GraphicsManager::kBackgroundInventory); } -// Close inventory: clear items and reset icon +void Inventory::drawSelectedItem() { + // Draw the selected item if any + if (!_selectedItem || get(_selectedItem)->manualSelect) { + _selectedItem = getFirstExaminableItem(); + + if (_selectedItem) { + drawItem(get(_selectedItem)->cursor, 44, 0); + } else { + clearSelectedItem(); + } + askForRedraw(); + } +} + +void Inventory::clearSelectedItem() { + _engine->getGraphicsManager()->clear(GraphicsManager::kBackgroundInventory, Common::Rect(44, 0, 44 + 32, 32)); +} + +// Open inventory: show portrait selected and draw contents void Inventory::open() { - _flag1 = false; + _portraitHighlighted = false; _isOpened = true; // Draw highlighted portrait @@ -552,9 +720,18 @@ void Inventory::close() { askForRedraw(); } -void Inventory::drawHighlight() { - int32 count = 0; - uint32 index = 0; +void Inventory::drawHighlight(uint32 currentIndex, bool reset) { + uint32 index = getItemIndex(currentIndex); + + if (index) { + drawItem(_entries[index].cursor, 0, 40 * currentIndex + 4, reset ? 1 : -1); + _highlightedItemIndex = reset ? 0 : currentIndex; + askForRedraw(); + } +} + +uint32 Inventory::getItemIndex(uint32 currentIndex) { + uint32 count = 0; for (uint32 i = 1; i < ARRAYSIZE(_entries); i++) { if (!_entries[i].isPresent) @@ -565,17 +742,13 @@ void Inventory::drawHighlight() { if (count < 11) { ++count; - if (count == _highlightedItem) { - index = i; - break; - } + + if (count == currentIndex) + return i; } } - if (index) { - drawItem(_entries[index].cursor, 0, 40 * _highlightedItem + 4, 1); - _highlightedItem = kItemNone; - } + return 0; } } // End of namespace LastExpress diff --git a/engines/lastexpress/game/inventory.h b/engines/lastexpress/game/inventory.h index 860f8257fe..b1995adce3 100644 --- a/engines/lastexpress/game/inventory.h +++ b/engines/lastexpress/game/inventory.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef LASTEXPRESS_INVENTORY_H @@ -120,7 +117,7 @@ public: // State bool isMagnifierInUse() { return _useMagnifier; } - bool isFlag1() { return _flag1; } + bool isPortraitHighlighted() { return _portraitHighlighted; } bool isOpened() { return _isOpened; } bool isEggHighlighted() { return _eggHightlighted; } @@ -142,7 +139,7 @@ private: InventoryEntry _entries[32]; InventoryItem _selectedItem; - InventoryItem _highlightedItem; + uint32 _highlightedItemIndex; uint32 _itemsShown; @@ -154,27 +151,31 @@ private: // Flags bool _useMagnifier; - bool _flag1; + bool _portraitHighlighted; bool _isOpened; bool _eggHightlighted; Scene *_itemScene; // Important rects - Common::Rect _inventoryRect; - Common::Rect _menuRect; - Common::Rect _selectedRect; + //Common::Rect _inventoryRect; + Common::Rect _menuEggRect; + Common::Rect _selectedItemRect; void init(); void open(); void close(); void examine(InventoryItem item); - void drawHighlight(); + void drawHighlight(uint32 currentIndex, bool reset); + uint32 getItemIndex(uint32 currentIndex); bool isItemSceneParameter(InventoryItem item) const; void drawItem(CursorStyle id, uint16 x, uint16 y, int16 brighnessIndex = -1); + + void drawSelectedItem(); + void clearSelectedItem(); }; } // End of namespace LastExpress diff --git a/engines/lastexpress/game/logic.cpp b/engines/lastexpress/game/logic.cpp index bfed65eb4a..0911c60de0 100644 --- a/engines/lastexpress/game/logic.cpp +++ b/engines/lastexpress/game/logic.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "lastexpress/game/logic.h" @@ -89,7 +86,7 @@ Logic::~Logic() { #define REDRAW_CURSOR() { \ if (getInventory()->isMagnifierInUse()) \ _engine->getCursor()->setStyle(kCursorMagnifier); \ - if (getInventory()->isFlag1() \ + if (getInventory()->isPortraitHighlighted() \ || getInventory()->isOpened() \ || getInventory()->isEggHighlighted()) \ _engine->getCursor()->setStyle(kCursorNormal); \ @@ -104,7 +101,7 @@ void Logic::eventMouse(const Common::Event &ev) { getFlags()->mouseRightClick = false; // Process event flags - if (ev.type == Common::EVENT_LBUTTONUP) { + if (ev.type == Common::EVENT_LBUTTONDOWN) { if (getFlags()->frameInterval) _ignoreFrameInterval = false; @@ -113,7 +110,7 @@ void Logic::eventMouse(const Common::Event &ev) { } if (getFlags()->flag_0) { - if (ev.type == Common::EVENT_LBUTTONUP || ev.type == Common::EVENT_RBUTTONUP) { + if (ev.type == Common::EVENT_LBUTTONDOWN || ev.type == Common::EVENT_RBUTTONDOWN) { getFlags()->flag_0 = false; getFlags()->shouldRedraw = true; updateCursor(true); @@ -143,7 +140,7 @@ void Logic::eventMouse(const Common::Event &ev) { && !getProgress().isEggOpen && !getEntities()->isPlayerPosition(kCarGreenSleeping, 59) && !getEntities()->isPlayerPosition(kCarGreenSleeping, 76) - && !getInventory()->isFlag1() + && !getInventory()->isPortraitHighlighted() && !getInventory()->isOpened() && !getInventory()->isEggHighlighted() && !getInventory()->isMagnifierInUse()) { @@ -173,7 +170,7 @@ void Logic::eventMouse(const Common::Event &ev) { if (getInventory()->getSelectedItem() == kItemMatch && (getEntities()->isPlayerInCar(kCarGreenSleeping) || getEntities()->isPlayerInCar(kCarRedSleeping)) && getProgress().jacket == kJacketGreen - && !getInventory()->isFlag1() + && !getInventory()->isPortraitHighlighted() && !getInventory()->isOpened() && !getInventory()->isEggHighlighted() && !getInventory()->isMagnifierInUse() @@ -198,7 +195,7 @@ void Logic::eventMouse(const Common::Event &ev) { // Handle entity item case EntityIndex entityIndex = getEntities()->canInteractWith(ev.mouse); if (entityIndex - && !getInventory()->isFlag1() + && !getInventory()->isPortraitHighlighted() && !getInventory()->isOpened() && !getInventory()->isEggHighlighted() && !getInventory()->isMagnifierInUse()) { @@ -223,17 +220,17 @@ void Logic::eventMouse(const Common::Event &ev) { ////////////////////////////////////////////////////////////////////////// // Handle standard actions - if (getInventory()->isFlag1() || getInventory()->isOpened() || getInventory()->isEggHighlighted()) + if (getInventory()->isPortraitHighlighted() || getInventory()->isOpened() || getInventory()->isEggHighlighted()) _engine->getCursor()->setStyle(kCursorNormal); - if (hotspotHandled || getInventory()->isFlag1() || getInventory()->isOpened() || getInventory()->isEggHighlighted()) + if (hotspotHandled || getInventory()->isPortraitHighlighted() || getInventory()->isOpened() || getInventory()->isEggHighlighted()) return; // Magnifier in use if (getInventory()->isMagnifierInUse()) { _engine->getCursor()->setStyle(kCursorMagnifier); - if (getInventory()->isFlag1() + if (getInventory()->isPortraitHighlighted() || getInventory()->isOpened() || getInventory()->isEggHighlighted()) _engine->getCursor()->setStyle(kCursorNormal); @@ -518,7 +515,7 @@ void Logic::updateCursor(bool) const { /* the cursor is always updated, even whe || getProgress().isEggOpen || getEntities()->isPlayerPosition(kCarGreenSleeping, 59) || getEntities()->isPlayerPosition(kCarGreenSleeping, 76) - || getInventory()->isFlag1() + || getInventory()->isPortraitHighlighted() || getInventory()->isOpened() || getInventory()->isEggHighlighted() || getInventory()->isMagnifierInUse()) { @@ -526,7 +523,7 @@ void Logic::updateCursor(bool) const { /* the cursor is always updated, even whe if (getInventory()->getSelectedItem() != kItemMatch || (!getEntities()->isPlayerInCar(kCarGreenSleeping) && !getEntities()->isPlayerInCar(kCarRedSleeping)) || getProgress().jacket != kJacketGreen - || getInventory()->isFlag1() + || getInventory()->isPortraitHighlighted() || getInventory()->isOpened() || getInventory()->isEggHighlighted() || getInventory()->isMagnifierInUse() @@ -536,7 +533,7 @@ void Logic::updateCursor(bool) const { /* the cursor is always updated, even whe EntityIndex entity = getEntities()->canInteractWith(getCoords()); if (entity - && !getInventory()->isFlag1() + && !getInventory()->isPortraitHighlighted() && !getInventory()->isOpened() && !getInventory()->isEggHighlighted() && !getInventory()->isMagnifierInUse()) { @@ -550,7 +547,7 @@ void Logic::updateCursor(bool) const { /* the cursor is always updated, even whe } if (!interact - && !getInventory()->isFlag1() + && !getInventory()->isPortraitHighlighted() && !getInventory()->isOpened() && !getInventory()->isEggHighlighted() && !getInventory()->isMagnifierInUse()) { @@ -587,7 +584,7 @@ void Logic::updateCursor(bool) const { /* the cursor is always updated, even whe if (getInventory()->isMagnifierInUse()) style = kCursorMagnifier; - if (getInventory()->isFlag1() || getInventory()->isOpened() || getInventory()->isEggHighlighted()) + if (getInventory()->isPortraitHighlighted() || getInventory()->isOpened() || getInventory()->isEggHighlighted()) style = kCursorNormal; _engine->getCursor()->setStyle(style); diff --git a/engines/lastexpress/game/logic.h b/engines/lastexpress/game/logic.h index fc867d7680..8b7dcef942 100644 --- a/engines/lastexpress/game/logic.h +++ b/engines/lastexpress/game/logic.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef LASTEXPRESS_LOGIC_H diff --git a/engines/lastexpress/game/menu.cpp b/engines/lastexpress/game/menu.cpp index 65b9cd9a91..f9eef26326 100644 --- a/engines/lastexpress/game/menu.cpp +++ b/engines/lastexpress/game/menu.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "lastexpress/game/menu.h" diff --git a/engines/lastexpress/game/menu.h b/engines/lastexpress/game/menu.h index 765a611c41..4b84c065cb 100644 --- a/engines/lastexpress/game/menu.h +++ b/engines/lastexpress/game/menu.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef LASTEXPRESS_MENU_H diff --git a/engines/lastexpress/game/object.cpp b/engines/lastexpress/game/object.cpp index 4f296debcb..a600075953 100644 --- a/engines/lastexpress/game/object.cpp +++ b/engines/lastexpress/game/object.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "lastexpress/game/object.h" diff --git a/engines/lastexpress/game/object.h b/engines/lastexpress/game/object.h index 96af4f07a6..87c9d7d407 100644 --- a/engines/lastexpress/game/object.h +++ b/engines/lastexpress/game/object.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef LASTEXPRESS_OBJECT_H diff --git a/engines/lastexpress/game/savegame.cpp b/engines/lastexpress/game/savegame.cpp index ba9e172b2b..5d06ecab13 100644 --- a/engines/lastexpress/game/savegame.cpp +++ b/engines/lastexpress/game/savegame.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "lastexpress/game/savegame.h" diff --git a/engines/lastexpress/game/savegame.h b/engines/lastexpress/game/savegame.h index 5c0e0e9890..6f0408487f 100644 --- a/engines/lastexpress/game/savegame.h +++ b/engines/lastexpress/game/savegame.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef LASTEXPRESS_SAVELOAD_H diff --git a/engines/lastexpress/game/savepoint.cpp b/engines/lastexpress/game/savepoint.cpp index 30467f8368..7ec7c241e9 100644 --- a/engines/lastexpress/game/savepoint.cpp +++ b/engines/lastexpress/game/savepoint.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "lastexpress/game/savepoint.h" diff --git a/engines/lastexpress/game/savepoint.h b/engines/lastexpress/game/savepoint.h index ca507ab8ab..a3303b4b8a 100644 --- a/engines/lastexpress/game/savepoint.h +++ b/engines/lastexpress/game/savepoint.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef LASTEXPRESS_SAVEPOINT_H diff --git a/engines/lastexpress/game/scenes.cpp b/engines/lastexpress/game/scenes.cpp index 15fe0617d8..e830b1d128 100644 --- a/engines/lastexpress/game/scenes.cpp +++ b/engines/lastexpress/game/scenes.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "lastexpress/game/scenes.h" diff --git a/engines/lastexpress/game/scenes.h b/engines/lastexpress/game/scenes.h index b70526839f..172dde2683 100644 --- a/engines/lastexpress/game/scenes.h +++ b/engines/lastexpress/game/scenes.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef LASTEXPRESS_SCENEMANAGER_H diff --git a/engines/lastexpress/game/sound.cpp b/engines/lastexpress/game/sound.cpp index 5638f75d00..d5e1118105 100644 --- a/engines/lastexpress/game/sound.cpp +++ b/engines/lastexpress/game/sound.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "lastexpress/game/sound.h" @@ -39,6 +36,9 @@ namespace LastExpress { +#define SOUNDCACHE_ENTRY_SIZE 92160 +#define SOUNDCACHE_MAX_SIZE 6 + // Letters & messages const char *messages[24] = { "", @@ -112,6 +112,9 @@ SoundManager::SoundManager(LastExpressEngine *engine) : _engine(engine), _state( memset(&_buffer, 0, sizeof(_buffer)); memset(&_lastWarning, 0, sizeof(_lastWarning)); + // Sound cache + _soundCacheData = malloc(6 * SOUNDCACHE_ENTRY_SIZE); + _drawSubtitles = 0; _currentSubtitle = NULL; } @@ -127,6 +130,8 @@ SoundManager::~SoundManager() { _currentSubtitle = NULL; + free(_soundCacheData); + // Zero passed pointers _engine = NULL; } @@ -157,7 +162,7 @@ void SoundManager::handleTimer() { ////////////////////////////////////////////////////////////////////////// void SoundManager::updateQueue() { // TODO add mutex lock! - //warning("Sound::unknownFunction1: not implemented!"); + warning("Sound::updateQueue: not implemented!"); } void SoundManager::resetQueue(SoundType type1, SoundType type2) { @@ -331,11 +336,65 @@ void SoundManager::setEntryStatus(SoundEntry *entry, FlagType flag) const { entry->status.status = (status | kSoundStatusClear4); } +void SoundManager::setInCache(SoundEntry *entry) { + entry->status.status |= kSoundStatusClear2; +} + bool SoundManager::setupCache(SoundEntry *entry) { - warning("Sound::setupCache: not implemented!"); + if (entry->soundData) + return true; + + if (_cache.size() >= SOUNDCACHE_MAX_SIZE) { + + SoundEntry *cacheEntry = NULL; + uint32 size = 1000; + + for (Common::List<SoundEntry *>::iterator i = _cache.begin(); i != _cache.end(); ++i) { + if (!((*i)->status.status & kSoundStatus_180)) { + uint32 newSize = (*i)->field_4C + ((*i)->status.status & kSoundStatusClear1); + + if (newSize < size) { + cacheEntry = (*i); + size = newSize; + } + } + } + + if (entry->field_4C <= size) + return false; + + if (cacheEntry) + setInCache(cacheEntry); + + // TODO: Wait until the cache entry is ready to be removed + while (!(cacheEntry->status.status1 & 1)) + ; + + if (cacheEntry->soundData) + removeFromCache(cacheEntry); + + _cache.push_back(entry); + entry->soundData = (char *)_soundCacheData + SOUNDCACHE_ENTRY_SIZE * (_cache.size() - 1); + } else { + _cache.push_back(entry); + entry->soundData = (char *)_soundCacheData + SOUNDCACHE_ENTRY_SIZE * (_cache.size() - 1); + } + return true; } +void SoundManager::removeFromCache(SoundEntry *entry) { + for (Common::List<SoundEntry *>::iterator i = _cache.begin(); i != _cache.end(); ++i) { + if ((*i) == entry) { + // Remove sound buffer + entry->soundData = NULL; + + // Remove entry from sound cache + i = _cache.reverse_erase(i); + } + } +} + void SoundManager::clearStatus() { Common::StackLock locker(_mutex); diff --git a/engines/lastexpress/game/sound.h b/engines/lastexpress/game/sound.h index a2c69eb827..08ec767022 100644 --- a/engines/lastexpress/game/sound.h +++ b/engines/lastexpress/game/sound.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef LASTEXPRESS_SOUND_H @@ -209,6 +206,7 @@ private: enum SoundStatus { kSoundStatus_20 = 0x20, kSoundStatus_40 = 0x40, + kSoundStatus_180 = 0x180, kSoundStatusRemoved = 0x200, kSoundStatus_400 = 0x400, @@ -250,8 +248,8 @@ private: SoundType type; // int //int field_8; //int field_C; - //int field_10; - //int fileData; + int processedFrameCount; + void *soundData; //int field_18; int field_1C; uint32 time; @@ -265,7 +263,7 @@ private: int field_40; EntityIndex entity; int field_48; - int field_4C; + uint32 field_4C; Common::String name1; //char[16]; Common::String name2; //char[16]; //int next; // offset to the next structure in the list (not used) @@ -278,6 +276,9 @@ private: status.status = 0; type = kSoundTypeNone; + processedFrameCount = 0; + soundData = NULL; + field_1C = 0; time = 0; @@ -348,6 +349,7 @@ private: // Sound cache Common::List<SoundEntry *> _cache; + void *_soundCacheData; SoundEntry *getEntry(EntityIndex index); SoundEntry *getEntry(Common::String name); @@ -356,7 +358,9 @@ private: void setupEntry(SoundEntry *entry, Common::String name, FlagType flag, int a4); void setEntryType(SoundEntry *entry, FlagType flag); void setEntryStatus(SoundEntry *entry, FlagType flag) const; + void setInCache(SoundEntry *entry); bool setupCache(SoundEntry *entry); + void removeFromCache(SoundEntry *entry); void loadSoundData(SoundEntry *entry, Common::String name); void updateEntry(SoundEntry *entry, uint value) const; diff --git a/engines/lastexpress/game/state.cpp b/engines/lastexpress/game/state.cpp index 45cb2c58ab..0cf2ddba40 100644 --- a/engines/lastexpress/game/state.cpp +++ b/engines/lastexpress/game/state.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "lastexpress/game/state.h" diff --git a/engines/lastexpress/game/state.h b/engines/lastexpress/game/state.h index 4196bfe06a..8f71e7d424 100644 --- a/engines/lastexpress/game/state.h +++ b/engines/lastexpress/game/state.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef LASTEXPRESS_STATE_H @@ -566,6 +563,9 @@ public: bool mouseLeftClick; bool mouseRightClick; + bool mouseLeftPressed; + bool mouseRightPressed; + bool flag_entities_0; bool flag_entities_1; @@ -587,6 +587,9 @@ public: mouseRightClick = false; mouseLeftClick = false; + mouseLeftPressed = false; + mouseRightPressed = false; + flag_entities_0 = false; flag_entities_1 = false; diff --git a/engines/lastexpress/graphics.cpp b/engines/lastexpress/graphics.cpp index c45baba808..abbdf2b766 100644 --- a/engines/lastexpress/graphics.cpp +++ b/engines/lastexpress/graphics.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "lastexpress/graphics.h" diff --git a/engines/lastexpress/graphics.h b/engines/lastexpress/graphics.h index 5231d00f6f..7db7e88989 100644 --- a/engines/lastexpress/graphics.h +++ b/engines/lastexpress/graphics.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef LASTEXPRESS_GRAPHICS_H diff --git a/engines/lastexpress/helpers.h b/engines/lastexpress/helpers.h index f9e61b6fe6..594c8b0400 100644 --- a/engines/lastexpress/helpers.h +++ b/engines/lastexpress/helpers.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef LASTEXPRESS_HELPERS_H diff --git a/engines/lastexpress/lastexpress.cpp b/engines/lastexpress/lastexpress.cpp index 7c08fef627..d195fcfad3 100644 --- a/engines/lastexpress/lastexpress.cpp +++ b/engines/lastexpress/lastexpress.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "lastexpress/lastexpress.h" @@ -40,7 +37,6 @@ #include "common/config-manager.h" #include "common/debug-channels.h" -#include "common/EventRecorder.h" #include "engines/util.h" @@ -52,10 +48,16 @@ const char *g_entityNames[] = { "Player", "Anna", "August", "Mertens", "Coudert" namespace LastExpress { LastExpressEngine::LastExpressEngine(OSystem *syst, const ADGameDescription *gd) : - Engine(syst), _gameDescription(gd), _debugger(NULL), _cursor(NULL), - _font(NULL), _logic(NULL), _menu(NULL), _frameCounter(0), _lastFrameCount(0), - _graphicsMan(NULL), _resMan(NULL), _sceneMan(NULL), _soundMan(NULL), - _eventMouse(NULL), _eventTick(NULL), _eventMouseBackup(NULL), _eventTickBackup(NULL) { + Engine(syst), _gameDescription(gd), + _debugger(NULL), _cursor(NULL), + _font(NULL), _logic(NULL), _menu(NULL), + _frameCounter(0), _lastFrameCount(0), + _graphicsMan(NULL), _resMan(NULL), + _sceneMan(NULL), _soundMan(NULL), + _eventMouse(NULL), _eventTick(NULL), + _eventMouseBackup(NULL), _eventTickBackup(NULL), + _random("lastexpress") + { // Setup mixer syncSoundSettings(); @@ -74,8 +76,6 @@ LastExpressEngine::LastExpressEngine(OSystem *syst, const ADGameDescription *gd) DebugMan.addDebugChannel(kLastExpressDebugLogic, "Logic", "Debug logic"); DebugMan.addDebugChannel(kLastExpressDebugScenes, "Scenes", "Debug scenes & hotspots"); DebugMan.addDebugChannel(kLastExpressDebugUnknown, "Unknown", "Debug unknown data"); - - g_eventRec.registerRandomSource(_random, "lastexpress"); } LastExpressEngine::~LastExpressEngine() { @@ -215,6 +215,7 @@ bool LastExpressEngine::handleEvents() { case Common::EVENT_LBUTTONUP: case Common::EVENT_LBUTTONDOWN: getGameLogic()->getGameState()->getGameFlags()->mouseLeftClick = true; + getGameLogic()->getGameState()->getGameFlags()->mouseLeftPressed = (ev.type == Common::EVENT_LBUTTONDOWN) ? true : false; // Adjust frameInterval flag if (_frameCounter < _lastFrameCount + 30) @@ -228,6 +229,8 @@ bool LastExpressEngine::handleEvents() { case Common::EVENT_RBUTTONUP: case Common::EVENT_RBUTTONDOWN: getGameLogic()->getGameState()->getGameFlags()->mouseRightClick = true; + getGameLogic()->getGameState()->getGameFlags()->mouseRightPressed = (ev.type == Common::EVENT_RBUTTONDOWN) ? true : false; + if (_eventMouse && _eventMouse->isValid()) (*_eventMouse)(ev); break; diff --git a/engines/lastexpress/lastexpress.h b/engines/lastexpress/lastexpress.h index a602e4956b..270ab655a1 100644 --- a/engines/lastexpress/lastexpress.h +++ b/engines/lastexpress/lastexpress.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef LASTEXPRESS_H diff --git a/engines/lastexpress/resource.cpp b/engines/lastexpress/resource.cpp index dff686a503..f376a3a299 100644 --- a/engines/lastexpress/resource.cpp +++ b/engines/lastexpress/resource.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "lastexpress/resource.h" diff --git a/engines/lastexpress/resource.h b/engines/lastexpress/resource.h index ea6508edc3..7dc909ab34 100644 --- a/engines/lastexpress/resource.h +++ b/engines/lastexpress/resource.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef LASTEXPRESS_RESOURCE_H diff --git a/engines/lastexpress/shared.h b/engines/lastexpress/shared.h index 80e227e6a7..8cebe16d87 100644 --- a/engines/lastexpress/shared.h +++ b/engines/lastexpress/shared.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef LASTEXPRESS_SHARED_H diff --git a/engines/lure/animseq.cpp b/engines/lure/animseq.cpp index 9c18cb33aa..8037563677 100644 --- a/engines/lure/animseq.cpp +++ b/engines/lure/animseq.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "lure/animseq.h" diff --git a/engines/lure/animseq.h b/engines/lure/animseq.h index 3609837dba..fde1fab921 100644 --- a/engines/lure/animseq.h +++ b/engines/lure/animseq.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef LURE_ANIMSEQ_H diff --git a/engines/lure/debugger.cpp b/engines/lure/debugger.cpp index fc2029c6c4..9d54bccb49 100644 --- a/engines/lure/debugger.cpp +++ b/engines/lure/debugger.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/config-manager.h" diff --git a/engines/lure/debugger.h b/engines/lure/debugger.h index dd1d8b5fc6..a4d4d689c4 100644 --- a/engines/lure/debugger.h +++ b/engines/lure/debugger.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef LURE_DEBUGGER_H diff --git a/engines/lure/decode.cpp b/engines/lure/decode.cpp index 5ffdcf1884..3e139a10d6 100644 --- a/engines/lure/decode.cpp +++ b/engines/lure/decode.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "lure/decode.h" diff --git a/engines/lure/decode.h b/engines/lure/decode.h index 9cc594df64..93f617af7e 100644 --- a/engines/lure/decode.h +++ b/engines/lure/decode.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef LURE_DECODE_H diff --git a/engines/lure/detection.cpp b/engines/lure/detection.cpp index dd2a702e2a..a69300ee2f 100644 --- a/engines/lure/detection.cpp +++ b/engines/lure/detection.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "base/plugins.h" @@ -208,7 +205,7 @@ public: LureMetaEngine() : AdvancedMetaEngine(detectionParams) {} virtual const char *getName() const { - return "Lure of the Temptress Engine"; + return "Lure of the Temptress"; } virtual const char *getOriginalCopyright() const { diff --git a/engines/lure/disk.cpp b/engines/lure/disk.cpp index f1838e3d67..9212508be0 100644 --- a/engines/lure/disk.cpp +++ b/engines/lure/disk.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ diff --git a/engines/lure/disk.h b/engines/lure/disk.h index 79aaf80bbc..1872fbd055 100644 --- a/engines/lure/disk.h +++ b/engines/lure/disk.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef LURE_DISK_H diff --git a/engines/lure/events.cpp b/engines/lure/events.cpp index f56a57ca34..fe60b56658 100644 --- a/engines/lure/events.cpp +++ b/engines/lure/events.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ diff --git a/engines/lure/events.h b/engines/lure/events.h index f04072aa0f..dd3f82fe19 100644 --- a/engines/lure/events.h +++ b/engines/lure/events.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef LURE_EVENTS_H diff --git a/engines/lure/fights.cpp b/engines/lure/fights.cpp index 983033281a..ab5d992bdb 100644 --- a/engines/lure/fights.cpp +++ b/engines/lure/fights.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "lure/fights.h" diff --git a/engines/lure/fights.h b/engines/lure/fights.h index 0aa44030d2..89f49d8c6d 100644 --- a/engines/lure/fights.h +++ b/engines/lure/fights.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef LURE_FIGHT_H diff --git a/engines/lure/game.cpp b/engines/lure/game.cpp index 7e13cff032..9542c35785 100644 --- a/engines/lure/game.cpp +++ b/engines/lure/game.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "lure/game.h" diff --git a/engines/lure/game.h b/engines/lure/game.h index 123ac0dca7..42818e404b 100644 --- a/engines/lure/game.h +++ b/engines/lure/game.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef LURE_GAME_H diff --git a/engines/lure/hotspots.cpp b/engines/lure/hotspots.cpp index 5644ef798c..97fbaa72ae 100644 --- a/engines/lure/hotspots.cpp +++ b/engines/lure/hotspots.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "lure/hotspots.h" diff --git a/engines/lure/hotspots.h b/engines/lure/hotspots.h index e9f5d56edd..a58a34456e 100644 --- a/engines/lure/hotspots.h +++ b/engines/lure/hotspots.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef LURE_HOTSPOTS_H diff --git a/engines/lure/intro.cpp b/engines/lure/intro.cpp index e054408a49..ce330be7c4 100644 --- a/engines/lure/intro.cpp +++ b/engines/lure/intro.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "lure/lure.h" diff --git a/engines/lure/intro.h b/engines/lure/intro.h index f4713c562a..ad442f1564 100644 --- a/engines/lure/intro.h +++ b/engines/lure/intro.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef LURE_INTRO_H diff --git a/engines/lure/lure.cpp b/engines/lure/lure.cpp index b0968c1956..c6be5c48fe 100644 --- a/engines/lure/lure.cpp +++ b/engines/lure/lure.cpp @@ -18,16 +18,12 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/config-manager.h" #include "common/debug-channels.h" #include "common/system.h" #include "common/savefile.h" -#include "common/EventRecorder.h" #include "engines/util.h" @@ -42,8 +38,8 @@ namespace Lure { static LureEngine *int_engine = NULL; -LureEngine::LureEngine(OSystem *system, const LureGameDescription *gameDesc): Engine(system), _gameDescription(gameDesc) { - g_eventRec.registerRandomSource(_rnd, "lure"); +LureEngine::LureEngine(OSystem *system, const LureGameDescription *gameDesc) + : Engine(system), _gameDescription(gameDesc), _rnd("lure") { DebugMan.addDebugChannel(kLureDebugScripts, "scripts", "Scripts debugging"); DebugMan.addDebugChannel(kLureDebugAnimations, "animations", "Animations debugging"); diff --git a/engines/lure/lure.h b/engines/lure/lure.h index 52b785a09a..53fdb8c713 100644 --- a/engines/lure/lure.h +++ b/engines/lure/lure.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef LURE_H diff --git a/engines/lure/luredefs.h b/engines/lure/luredefs.h index 0ef7a73b7e..91fb650af3 100644 --- a/engines/lure/luredefs.h +++ b/engines/lure/luredefs.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef LUREDEFS_H diff --git a/engines/lure/memory.cpp b/engines/lure/memory.cpp index d3d5067cce..c5c28fa8bc 100644 --- a/engines/lure/memory.cpp +++ b/engines/lure/memory.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "lure/memory.h" diff --git a/engines/lure/memory.h b/engines/lure/memory.h index f51c4fc49e..05bf23a9ab 100644 --- a/engines/lure/memory.h +++ b/engines/lure/memory.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef LURE_MEMORY_H diff --git a/engines/lure/menu.cpp b/engines/lure/menu.cpp index f9a78d8fc8..9919471c76 100644 --- a/engines/lure/menu.cpp +++ b/engines/lure/menu.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "lure/menu.h" diff --git a/engines/lure/menu.h b/engines/lure/menu.h index fcc6308375..b3016f0560 100644 --- a/engines/lure/menu.h +++ b/engines/lure/menu.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef LURE_MENU_H diff --git a/engines/lure/palette.cpp b/engines/lure/palette.cpp index b08ca64dfb..3975561749 100644 --- a/engines/lure/palette.cpp +++ b/engines/lure/palette.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "lure/lure.h" diff --git a/engines/lure/palette.h b/engines/lure/palette.h index 9420079346..2af1f55973 100644 --- a/engines/lure/palette.h +++ b/engines/lure/palette.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef LURE_PALETTE_H diff --git a/engines/lure/res.cpp b/engines/lure/res.cpp index 01b0bd0d4a..31c4efa2aa 100644 --- a/engines/lure/res.cpp +++ b/engines/lure/res.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "lure/res.h" diff --git a/engines/lure/res.h b/engines/lure/res.h index cd6fcde201..a0a908f53d 100644 --- a/engines/lure/res.h +++ b/engines/lure/res.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef LURE_RES_H @@ -117,7 +114,7 @@ public: MemoryBlock *messagesData() { return _messagesData; } uint16 getHotspotScript(uint16 index); HotspotList &activeHotspots() { return _activeHotspots; } - uint16 random() { return _rnd.getRandomNumber(65536) & 0xffff; } + uint16 getRandom() { return _rnd.getRandomNumber(0xffff); } HotspotData *getHotspot(uint16 hotspotId); Hotspot *getActiveHotspot(uint16 hotspotId); HotspotOverrideData *getHotspotOverride(uint16 hotspotId); diff --git a/engines/lure/res_struct.cpp b/engines/lure/res_struct.cpp index 39beb2729e..0d9d75b00b 100644 --- a/engines/lure/res_struct.cpp +++ b/engines/lure/res_struct.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "lure/disk.h" diff --git a/engines/lure/res_struct.h b/engines/lure/res_struct.h index 58ee3f4c02..49b6ef78ba 100644 --- a/engines/lure/res_struct.h +++ b/engines/lure/res_struct.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef LURE_RESSTRUCT_H diff --git a/engines/lure/room.cpp b/engines/lure/room.cpp index 4cefe1fabb..2cb871d73f 100644 --- a/engines/lure/room.cpp +++ b/engines/lure/room.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "lure/room.h" diff --git a/engines/lure/room.h b/engines/lure/room.h index f24136ac42..deafa28a66 100644 --- a/engines/lure/room.h +++ b/engines/lure/room.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef LURE_ROOM_H diff --git a/engines/lure/screen.cpp b/engines/lure/screen.cpp index e02f492ef2..4eb6fd46a3 100644 --- a/engines/lure/screen.cpp +++ b/engines/lure/screen.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "lure/screen.h" diff --git a/engines/lure/screen.h b/engines/lure/screen.h index 94bbab932e..2a2fa6b2f2 100644 --- a/engines/lure/screen.h +++ b/engines/lure/screen.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef LURE_SCREEN_H diff --git a/engines/lure/scripts.cpp b/engines/lure/scripts.cpp index 20cbd328ce..22656dd3fe 100644 --- a/engines/lure/scripts.cpp +++ b/engines/lure/scripts.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "lure/animseq.h" @@ -34,7 +31,6 @@ #include "lure/sound.h" #include "common/stack.h" #include "common/endian.h" -#include "common/EventRecorder.h" namespace Lure { @@ -1131,7 +1127,7 @@ uint16 Script::execute(uint16 startOffset) { break; case S_OPCODE_RANDOM: - param = r.random() >> 8; // make number between 0 to 255 + param = r.getRandom() >> 8; // make number between 0 to 255 break; case S_OPCODE_END: diff --git a/engines/lure/scripts.h b/engines/lure/scripts.h index b5b6140872..7bc8f8c950 100644 --- a/engines/lure/scripts.h +++ b/engines/lure/scripts.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef LURE_SCRIPTS_H diff --git a/engines/lure/sound.cpp b/engines/lure/sound.cpp index da9e136ec3..cf28e0bb74 100644 --- a/engines/lure/sound.cpp +++ b/engines/lure/sound.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "lure/sound.h" diff --git a/engines/lure/sound.h b/engines/lure/sound.h index 7a894d814d..58b4a68966 100644 --- a/engines/lure/sound.h +++ b/engines/lure/sound.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef LURE_SOUND_H diff --git a/engines/lure/strings.cpp b/engines/lure/strings.cpp index 7c3f358080..0c9f4b5352 100644 --- a/engines/lure/strings.cpp +++ b/engines/lure/strings.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "lure/strings.h" diff --git a/engines/lure/strings.h b/engines/lure/strings.h index 8dbca70813..e32921ddb6 100644 --- a/engines/lure/strings.h +++ b/engines/lure/strings.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef LURE_STRINGS_H diff --git a/engines/lure/surface.cpp b/engines/lure/surface.cpp index 783401fde2..106b62b7a4 100644 --- a/engines/lure/surface.cpp +++ b/engines/lure/surface.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "lure/decode.h" diff --git a/engines/lure/surface.h b/engines/lure/surface.h index 9a677cf749..56af37c049 100644 --- a/engines/lure/surface.h +++ b/engines/lure/surface.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef LURE_SURFACE_H diff --git a/engines/m4/actor.cpp b/engines/m4/actor.cpp index c61c6fe7d8..80a3624475 100644 --- a/engines/m4/actor.cpp +++ b/engines/m4/actor.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/system.h" diff --git a/engines/m4/actor.h b/engines/m4/actor.h index 96299ab629..e28c522df8 100644 --- a/engines/m4/actor.h +++ b/engines/m4/actor.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef M4_ACTOR_H diff --git a/engines/m4/animation.cpp b/engines/m4/animation.cpp index 3fe050e604..c89f74bd0a 100644 --- a/engines/m4/animation.cpp +++ b/engines/m4/animation.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/textconsole.h" diff --git a/engines/m4/animation.h b/engines/m4/animation.h index a7a6b57c32..ed6f49786d 100644 --- a/engines/m4/animation.h +++ b/engines/m4/animation.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef M4_ANIMATION_H diff --git a/engines/m4/assets.cpp b/engines/m4/assets.cpp index c4113e00d0..8ffdeb53e0 100644 --- a/engines/m4/assets.cpp +++ b/engines/m4/assets.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "m4/assets.h" diff --git a/engines/m4/assets.h b/engines/m4/assets.h index 940646b5f2..90670dde53 100644 --- a/engines/m4/assets.h +++ b/engines/m4/assets.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef M4_ASSETS_H #define M4_ASSETS_H diff --git a/engines/m4/burger_data.h b/engines/m4/burger_data.h index c053268705..d30e546023 100644 --- a/engines/m4/burger_data.h +++ b/engines/m4/burger_data.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef M4_BURGER_DATA_H diff --git a/engines/m4/compression.cpp b/engines/m4/compression.cpp index 8fe4fbf1eb..4ec9fae32f 100644 --- a/engines/m4/compression.cpp +++ b/engines/m4/compression.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "m4/compression.h" diff --git a/engines/m4/compression.h b/engines/m4/compression.h index 93c7d9af9e..a24a41da3c 100644 --- a/engines/m4/compression.h +++ b/engines/m4/compression.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef M4_COMPRESSION_H diff --git a/engines/m4/console.cpp b/engines/m4/console.cpp index cbcaa04669..6f45f11f5a 100644 --- a/engines/m4/console.cpp +++ b/engines/m4/console.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/textconsole.h" @@ -150,12 +147,12 @@ bool Console::cmdDumpFile(int argc, const char **argv) { DebugPrintf("If uncompress is 1, the file is uncompressed (for MADS games)\n"); } else { if (argc == 2) { - _vm->dumpFile(strdup(argv[1])); + _vm->dumpFile(argv[1], false); } else { if (argc == 3 && atoi(argv[2]) == 1) - _vm->dumpFile(strdup(argv[1]), true); + _vm->dumpFile(argv[1], true); else - _vm->dumpFile(strdup(argv[1])); + _vm->dumpFile(argv[1], false); } } return true; diff --git a/engines/m4/console.h b/engines/m4/console.h index 53a47dada9..fc473b6464 100644 --- a/engines/m4/console.h +++ b/engines/m4/console.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef M4_CONSOLE_H diff --git a/engines/m4/converse.cpp b/engines/m4/converse.cpp index 46c4b35b79..4630d2e2d6 100644 --- a/engines/m4/converse.cpp +++ b/engines/m4/converse.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/array.h" diff --git a/engines/m4/converse.h b/engines/m4/converse.h index 67ecf20424..b47e8d2a6b 100644 --- a/engines/m4/converse.h +++ b/engines/m4/converse.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef M4_CONVERSE_H diff --git a/engines/m4/detection.cpp b/engines/m4/detection.cpp index 4b204996f3..1aefe3d02d 100644 --- a/engines/m4/detection.cpp +++ b/engines/m4/detection.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "base/plugins.h" @@ -44,11 +41,11 @@ uint32 MadsM4Engine::getFeatures() const { return _gameDescription->features; } Common::Language MadsM4Engine::getLanguage() const { return _gameDescription->desc.language; } Common::Platform MadsM4Engine::getPlatform() const { return _gameDescription->desc.platform; } -} +} // End of namespace M4 static const PlainGameDescriptor m4Games[] = { {"m4", "MADS/M4 engine game"}, - {"riddle", "Riddle of Master Lu: Believe it or Not!"}, + {"riddle", "Ripley's Believe It or Not!: The Riddle of Master Lu"}, {"burger", "Orion Burger"}, {"rex", "Rex Nebular and the Cosmic Gender Bender"}, {"dragon", "DragonSphere"}, @@ -380,7 +377,12 @@ static const M4GameDescription gameDescriptions[] = { { AD_TABLE_END_MARKER, 0, 0 } }; -} +} // End of namespace M4 + +static const char *directoryGlobs[] = { + "option1", + 0 +}; static const ADParams detectionParams = { // Pointer to ADGameDescription or its superset structure @@ -402,9 +404,9 @@ static const ADParams detectionParams = { // Additional GUI options (for every game} Common::GUIO_NOMIDI, // Maximum directory depth - 1, + 2, // List of directory globs - 0 + directoryGlobs }; class M4MetaEngine : public AdvancedMetaEngine { @@ -412,7 +414,7 @@ public: M4MetaEngine() : AdvancedMetaEngine(detectionParams) {} virtual const char *getName() const { - return "MADS/M4 engine"; + return "MADS/M4"; } virtual const char *getOriginalCopyright() const { diff --git a/engines/m4/dialogs.cpp b/engines/m4/dialogs.cpp index bc6228658d..afe2692753 100644 --- a/engines/m4/dialogs.cpp +++ b/engines/m4/dialogs.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "m4/dialogs.h" diff --git a/engines/m4/dialogs.h b/engines/m4/dialogs.h index 192ba5c23c..ea3519c9e3 100644 --- a/engines/m4/dialogs.h +++ b/engines/m4/dialogs.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef M4_DIALOGS_H diff --git a/engines/m4/events.cpp b/engines/m4/events.cpp index a9641eb542..f8225fba3e 100644 --- a/engines/m4/events.cpp +++ b/engines/m4/events.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ // TODO: There is a 'please_hyperwalk' variable that gets accessed that is meant to be global, but diff --git a/engines/m4/events.h b/engines/m4/events.h index 1c1418d5f8..6e7cf68555 100644 --- a/engines/m4/events.h +++ b/engines/m4/events.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef M4_EVENTS_H diff --git a/engines/m4/font.cpp b/engines/m4/font.cpp index 582fbaebc7..d4ba714d73 100644 --- a/engines/m4/font.cpp +++ b/engines/m4/font.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "m4/font.h" diff --git a/engines/m4/font.h b/engines/m4/font.h index 64e54f35b5..b00a393811 100644 --- a/engines/m4/font.h +++ b/engines/m4/font.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef M4_FONT_H diff --git a/engines/m4/globals.cpp b/engines/m4/globals.cpp index 3db9934cec..58cadb3c9f 100644 --- a/engines/m4/globals.cpp +++ b/engines/m4/globals.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/textconsole.h" diff --git a/engines/m4/globals.h b/engines/m4/globals.h index 2d90b7ba77..a95e5169be 100644 --- a/engines/m4/globals.h +++ b/engines/m4/globals.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef M4_GLOBALS_H @@ -243,63 +240,6 @@ union DataMapEntry { typedef Common::HashMap<uint16, uint16> DataMapHash; -enum DataMapType {BOOL, UINT16, INT, INT_FN}; - -class DataMapWrapper { - friend class DataMap; -private: - DataMapEntry _value; - DataMapType _type; -public: - DataMapWrapper(bool *v) { _value.boolValue = v; _type = BOOL; } - DataMapWrapper(uint16 *v) { _value.uint16Value = v; _type = UINT16; } - DataMapWrapper(int16 *v) { _value.uint16Value = (uint16 *)v; _type = UINT16; } - DataMapWrapper(int *v) { _value.intValue = v; _type = INT; } - DataMapWrapper(IntFunctionPtr v) { _value.fnPtr = v; _type = INT_FN; } - - uint16 getIntValue() { - if (_type == BOOL) return *_value.boolValue ? 0xffff : 0; - else if (_type == UINT16) return *_value.uint16Value; - else if (_type == INT) return *_value.intValue; - else return _value.fnPtr(); - } - void setIntValue(uint16 v) { - if (_type == BOOL) *_value.boolValue = v != 0; - else if (_type == UINT16) *_value.uint16Value = v; - else if (_type == INT) *_value.intValue = v; - } -}; - -#define MAP_DATA(V) _madsVm->globals()->_dataMap.addMapping(new DataMapWrapper(V)) - -class DataMap { -private: - DataMapHash _data; - Common::Array<DataMapWrapper *> _mapList; -public: - DataMap() { - _mapList.push_back(NULL); - } - ~DataMap() { - for (uint i = 1; i < _mapList.size(); ++i) - delete _mapList[i]; - } - - void addMapping(DataMapWrapper *v) { _mapList.push_back(v); } - uint16 get(uint16 index) { - if (index < _mapList.size()) - return _mapList[index]->getIntValue(); - - return _data[index]; - } - void set(uint16 index, uint16 v) { - if (index < _mapList.size()) - _mapList[index]->setIntValue(v); - else - _data[index] = v; - } -}; - class MadsGlobals : public Globals { private: struct MessageItem { @@ -328,7 +268,7 @@ public: int previousScene; int16 _nextSceneId; uint16 actionNouns[3]; - DataMap _dataMap; + DataMapHash _dataMap; int _difficultyLevel; void loadMadsVocab(); diff --git a/engines/m4/graphics.cpp b/engines/m4/graphics.cpp index 689a6ab8b4..786c975850 100644 --- a/engines/m4/graphics.cpp +++ b/engines/m4/graphics.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/system.h" diff --git a/engines/m4/graphics.h b/engines/m4/graphics.h index 96e81f746e..242857ba1a 100644 --- a/engines/m4/graphics.h +++ b/engines/m4/graphics.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef M4_GRAPHICS_H diff --git a/engines/m4/gui.cpp b/engines/m4/gui.cpp index 56cf96b589..6bedfa7e9b 100644 --- a/engines/m4/gui.cpp +++ b/engines/m4/gui.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/events.h" diff --git a/engines/m4/gui.h b/engines/m4/gui.h index 7e1c8bf070..99b44a3af7 100644 --- a/engines/m4/gui.h +++ b/engines/m4/gui.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef M4_GUI_H diff --git a/engines/m4/hotspot.cpp b/engines/m4/hotspot.cpp index 500464dc09..a585a9af3d 100644 --- a/engines/m4/hotspot.cpp +++ b/engines/m4/hotspot.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "m4/m4.h" diff --git a/engines/m4/hotspot.h b/engines/m4/hotspot.h index f650d5ff54..86fe21bcab 100644 --- a/engines/m4/hotspot.h +++ b/engines/m4/hotspot.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef M4_HOTSPOT_H diff --git a/engines/m4/m4.cpp b/engines/m4/m4.cpp index 1a484322fd..d456accca1 100644 --- a/engines/m4/m4.cpp +++ b/engines/m4/m4.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ //#define SCRIPT_TEST @@ -52,7 +49,6 @@ #include "common/error.h" #include "common/file.h" #include "common/fs.h" -#include "common/EventRecorder.h" #include "common/system.h" #include "common/config-manager.h" #include "common/debug-channels.h" @@ -115,6 +111,7 @@ MadsM4Engine::MadsM4Engine(OSystem *syst, const M4GameDescription *gameDesc) : SearchMan.addSubDirectoryMatching(gameDataDir, "goodstuf"); SearchMan.addSubDirectoryMatching(gameDataDir, "resource"); + SearchMan.addSubDirectoryMatching(gameDataDir, "option1"); DebugMan.addDebugChannel(kDebugScript, "script", "Script debug level"); DebugMan.addDebugChannel(kDebugGraphics, "graphics", "Graphics debug level"); @@ -179,8 +176,7 @@ Common::Error MadsM4Engine::run() { _script = new ScriptInterpreter(this); _ws = new WoodScript(this); //_callbacks = new Callbacks(this); - _random = new Common::RandomSource(); - g_eventRec.registerRandomSource(*_random, "m4"); + _random = new Common::RandomSource("m4"); return Common::kNoError; } @@ -259,7 +255,7 @@ void MadsM4Engine::loadMenu(MenuType menuType, bool loadSaveFromHotkey, bool cal #define DUMP_BUFFER_SIZE 1024 -void MadsM4Engine::dumpFile(const char* filename, bool uncompress) { +void MadsM4Engine::dumpFile(const char *filename, bool uncompress) { Common::DumpFile f; byte buffer[DUMP_BUFFER_SIZE]; Common::SeekableReadStream *fileS = res()->get(filename); diff --git a/engines/m4/m4.h b/engines/m4/m4.h index a43f3e1387..4c9b100117 100644 --- a/engines/m4/m4.h +++ b/engines/m4/m4.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef M4_H @@ -168,7 +165,7 @@ public: ResourceManager *res() const { return _resourceManager; } MidiPlayer *midi() { return _midi; } Common::SaveFileManager *saveManager() { return _saveFileMan; } - void dumpFile(const char* filename, bool uncompress = false); + void dumpFile(const char *filename, bool uncompress); void eventHandler(); bool delay(int duration, bool keyAborts = true, bool clickAborts = true); void loadMenu(MenuType menuType, bool loadSaveFromHotkey = false, diff --git a/engines/m4/m4_menus.cpp b/engines/m4/m4_menus.cpp index a20bb2660b..787d8666f6 100644 --- a/engines/m4/m4_menus.cpp +++ b/engines/m4/m4_menus.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/algorithm.h" // for find() diff --git a/engines/m4/m4_menus.h b/engines/m4/m4_menus.h index ecfd778c95..9abf71e9db 100644 --- a/engines/m4/m4_menus.h +++ b/engines/m4/m4_menus.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef M4_M4_MENUS_H diff --git a/engines/m4/m4_scene.cpp b/engines/m4/m4_scene.cpp index a0d8a503ab..1a2e00e50d 100644 --- a/engines/m4/m4_scene.cpp +++ b/engines/m4/m4_scene.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/system.h" diff --git a/engines/m4/m4_scene.h b/engines/m4/m4_scene.h index 9c2edbc06c..a0ba497cf7 100644 --- a/engines/m4/m4_scene.h +++ b/engines/m4/m4_scene.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef M4_M4_SCENE_H diff --git a/engines/m4/m4_views.cpp b/engines/m4/m4_views.cpp index 83f23edd3d..4eb84a7488 100644 --- a/engines/m4/m4_views.cpp +++ b/engines/m4/m4_views.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/textconsole.h" diff --git a/engines/m4/m4_views.h b/engines/m4/m4_views.h index e390904aae..4ca2a74593 100644 --- a/engines/m4/m4_views.h +++ b/engines/m4/m4_views.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef M4_M4_VIEWS_H diff --git a/engines/m4/mads_anim.cpp b/engines/m4/mads_anim.cpp index e7ca9cb14d..dc2758bedc 100644 --- a/engines/m4/mads_anim.cpp +++ b/engines/m4/mads_anim.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/textconsole.h" diff --git a/engines/m4/mads_anim.h b/engines/m4/mads_anim.h index b33ea24071..411d575d59 100644 --- a/engines/m4/mads_anim.h +++ b/engines/m4/mads_anim.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef M4_MADS_ANIM_H diff --git a/engines/m4/mads_logic.cpp b/engines/m4/mads_logic.cpp index 98a0d06412..a28d38080b 100644 --- a/engines/m4/mads_logic.cpp +++ b/engines/m4/mads_logic.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/textconsole.h" @@ -172,25 +169,81 @@ const char *MadsSceneLogic::_opcodeStrings[] = { * This method sets up the data map with pointers to all the common game objects. This allows the script engine to * convert game specific offsets for various fields in the original game's data segment into a generic data index * that will be common across all the MADS games - */ + void MadsSceneLogic::initialiseDataMap() { // The unique order of these items must be maintained - MAP_DATA((uint16 *)&_madsVm->scene()->_abortTimersMode2); - MAP_DATA(&_madsVm->scene()->_abortTimers); - MAP_DATA(&_madsVm->_player._stepEnabled); - MAP_DATA(&_madsVm->scene()->_nextScene); - MAP_DATA(&_madsVm->scene()->_previousScene); - MAP_DATA(&_madsVm->_player._playerPos.x); - MAP_DATA(&_madsVm->_player._playerPos.y); - MAP_DATA(&_madsVm->_player._direction); - MAP_DATA(&_madsVm->_player._visible); - MAP_DATA(&getActiveAnimationBool); - MAP_DATA(&getAnimationCurrentFrame); +} +*/ +uint32 MadsSceneLogic::getDataValue(int dataId) { + switch (dataId) { + case 1: + return _madsVm->scene()->_abortTimersMode2; + case 2: + return _madsVm->scene()->_abortTimers; + case 3: + return _madsVm->_player._stepEnabled ? 0xffff : 0; + case 4: + return _madsVm->scene()->_nextScene; + case 5: + return _madsVm->scene()->_previousScene; + case 6: + return _madsVm->_player._playerPos.x; + case 7: + return _madsVm->_player._playerPos.y; + case 8: + return _madsVm->_player._direction; + case 9: + return _madsVm->_player._visible ? 0xffff : 0; + case 10: + return getActiveAnimationBool(); + case 11: + return getAnimationCurrentFrame(); + default: + // All other data variables get stored in the hash table + return _madsVm->globals()->_dataMap[dataId]; + break; + } } -DataMap &MadsSceneLogic::dataMap() { - return _madsVm->globals()->_dataMap; +void MadsSceneLogic::setDataValue(int dataId, uint16 dataValue) { + switch (dataId) { + case 1: + _madsVm->scene()->_abortTimersMode2 = (AbortTimerMode)dataValue; + break; + case 2: + _madsVm->scene()->_abortTimers = dataValue; + break; + case 3: + _madsVm->_player._stepEnabled = dataValue != 0; + break; + case 4: + _madsVm->scene()->_nextScene = dataValue; + break; + case 5: + _madsVm->scene()->_previousScene = dataValue; + break; + case 6: + _madsVm->_player._playerPos.x = dataValue; + break; + case 7: + _madsVm->_player._playerPos.y = dataValue; + break; + case 8: + _madsVm->_player._direction = dataValue; + break; + case 9: + _madsVm->_player._visible = dataValue != 0; + break; + case 10: + case 11: + error("Tried to set read only data field %d", dataId); + break; + default: + // All other data variables get stored in the hash table + _madsVm->globals()->_dataMap[dataId] = dataValue; + break; + } } const char *MadsSceneLogic::formAnimName(char sepChar, int16 suffixNum) { @@ -534,7 +587,7 @@ void MadsSceneLogic::execute(uint32 subOffset) { case OP_DLOAD: { // Gets data variable param = getParam(scriptOffset, opcode); - uint16 v = dataMap().get(param); + uint16 v = getDataValue(param); stack.push(ScriptVar(v)); break; } @@ -542,7 +595,7 @@ void MadsSceneLogic::execute(uint32 subOffset) { case OP_DSTORE: { // Stores data variable param = getParam(scriptOffset, opcode); ScriptVar v = stack.pop(); - dataMap().set(param, v.isInt() ? v.get() : 0); + setDataValue(param, v.isInt() ? v.get() : 0); break; } diff --git a/engines/m4/mads_logic.h b/engines/m4/mads_logic.h index adafe6f93d..016adb2ebf 100644 --- a/engines/m4/mads_logic.h +++ b/engines/m4/mads_logic.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * * The MADS game logic is all hard-coded into the games, although for Rex at least * it seems to use only a fairly basic set of instructions and function calls, so it should be * possible @@ -88,14 +85,14 @@ private: void getSceneSpriteSet(); void getAnimName(); - DataMap &dataMap(); + uint32 getDataValue(int dataId); + void setDataValue(int dataId, uint16 dataValue); void getCallParameters(int numParams, Common::Stack<ScriptVar> &stack, ScriptVar *callParams); public: MadsSceneLogic() { _scriptsData = NULL; } ~MadsSceneLogic() { delete _scriptsData; } void initialiseScripts(); - void initialiseDataMap(); void selectScene(int sceneNum); void setupScene(); diff --git a/engines/m4/mads_menus.cpp b/engines/m4/mads_menus.cpp index 437e9d2a6b..a6e2b77253 100644 --- a/engines/m4/mads_menus.cpp +++ b/engines/m4/mads_menus.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/textconsole.h" diff --git a/engines/m4/mads_menus.h b/engines/m4/mads_menus.h index a0fc6fb3bc..766767dc84 100644 --- a/engines/m4/mads_menus.h +++ b/engines/m4/mads_menus.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef M4_MADS_MENUS_H diff --git a/engines/m4/mads_player.cpp b/engines/m4/mads_player.cpp index de09e97640..0b83b54ff5 100644 --- a/engines/m4/mads_player.cpp +++ b/engines/m4/mads_player.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "m4/m4.h" diff --git a/engines/m4/mads_player.h b/engines/m4/mads_player.h index 6a9b7b4ca1..bbeefaf3d5 100644 --- a/engines/m4/mads_player.h +++ b/engines/m4/mads_player.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef M4_MADS_PLAYER_H diff --git a/engines/m4/mads_scene.cpp b/engines/m4/mads_scene.cpp index 7b82480ee2..b305242bbb 100644 --- a/engines/m4/mads_scene.cpp +++ b/engines/m4/mads_scene.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/system.h" diff --git a/engines/m4/mads_scene.h b/engines/m4/mads_scene.h index 743719d954..12d7088a2f 100644 --- a/engines/m4/mads_scene.h +++ b/engines/m4/mads_scene.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef M4_MADS_SCENE_H @@ -113,7 +110,6 @@ public: virtual ~MadsScene(); void initialise() { _sceneLogic.initialiseScripts(); - _sceneLogic.initialiseDataMap(); } // Methods that differ between engines diff --git a/engines/m4/mads_views.cpp b/engines/m4/mads_views.cpp index 33c679c9bd..7628c0d650 100644 --- a/engines/m4/mads_views.cpp +++ b/engines/m4/mads_views.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "m4/m4_views.h" diff --git a/engines/m4/mads_views.h b/engines/m4/mads_views.h index ce5ba9c4e5..72a70cfbc0 100644 --- a/engines/m4/mads_views.h +++ b/engines/m4/mads_views.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef M4_MADS_VIEWS_H diff --git a/engines/m4/midi.cpp b/engines/m4/midi.cpp index 24ac60c22e..bfe77828da 100644 --- a/engines/m4/midi.cpp +++ b/engines/m4/midi.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ // FIXME: This is cribbed together from the SAGA music player. It needs cleanup diff --git a/engines/m4/midi.h b/engines/m4/midi.h index a544fb72aa..6eef907ce3 100644 --- a/engines/m4/midi.h +++ b/engines/m4/midi.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ // Music class diff --git a/engines/m4/rails.cpp b/engines/m4/rails.cpp index 39cba9ab84..d706af8ef1 100644 --- a/engines/m4/rails.cpp +++ b/engines/m4/rails.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ /* diff --git a/engines/m4/rails.h b/engines/m4/rails.h index e3183c243f..ccc9e00536 100644 --- a/engines/m4/rails.h +++ b/engines/m4/rails.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef M4_RAILS_H diff --git a/engines/m4/resource.cpp b/engines/m4/resource.cpp index 1946797f75..2ae29ca0bb 100644 --- a/engines/m4/resource.cpp +++ b/engines/m4/resource.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "m4/m4.h" diff --git a/engines/m4/resource.h b/engines/m4/resource.h index eed6e6dcd9..00c54a3680 100644 --- a/engines/m4/resource.h +++ b/engines/m4/resource.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef M4_RESOURCE_H diff --git a/engines/m4/saveload.cpp b/engines/m4/saveload.cpp index 85f0ee9947..aa35385bfe 100644 --- a/engines/m4/saveload.cpp +++ b/engines/m4/saveload.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/file.h" diff --git a/engines/m4/saveload.h b/engines/m4/saveload.h index 132cb93f00..9b76054e65 100644 --- a/engines/m4/saveload.h +++ b/engines/m4/saveload.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef M4_SAVELOAD_H diff --git a/engines/m4/scene.cpp b/engines/m4/scene.cpp index c0cbd879b2..a38be20086 100644 --- a/engines/m4/scene.cpp +++ b/engines/m4/scene.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/system.h" diff --git a/engines/m4/scene.h b/engines/m4/scene.h index e0b28e6454..5086cc0db0 100644 --- a/engines/m4/scene.h +++ b/engines/m4/scene.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef M4_SCENE_H diff --git a/engines/m4/script.cpp b/engines/m4/script.cpp index cc60ec310d..026c025f45 100644 --- a/engines/m4/script.cpp +++ b/engines/m4/script.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/system.h" diff --git a/engines/m4/script.h b/engines/m4/script.h index 32b5701419..22f07fd062 100644 --- a/engines/m4/script.h +++ b/engines/m4/script.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef M4_SCRIPT_H diff --git a/engines/m4/sound.cpp b/engines/m4/sound.cpp index fb90cea5cc..d10dea5cad 100644 --- a/engines/m4/sound.cpp +++ b/engines/m4/sound.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "m4/m4.h" diff --git a/engines/m4/sound.h b/engines/m4/sound.h index 8962e67dfd..99a2292d83 100644 --- a/engines/m4/sound.h +++ b/engines/m4/sound.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ // Sound class diff --git a/engines/m4/sprite.cpp b/engines/m4/sprite.cpp index cef9917381..1a3228d1bb 100644 --- a/engines/m4/sprite.cpp +++ b/engines/m4/sprite.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/rect.h" diff --git a/engines/m4/sprite.h b/engines/m4/sprite.h index d4e5502efd..af49d8cbaf 100644 --- a/engines/m4/sprite.h +++ b/engines/m4/sprite.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef M4_SPRITE_H diff --git a/engines/m4/staticres.cpp b/engines/m4/staticres.cpp index fc49998adb..520c0ad58e 100644 --- a/engines/m4/staticres.cpp +++ b/engines/m4/staticres.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "m4/staticres.h" diff --git a/engines/m4/staticres.h b/engines/m4/staticres.h index 80fc69fc80..e3ead3398b 100644 --- a/engines/m4/staticres.h +++ b/engines/m4/staticres.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef M4_STATICRES_H diff --git a/engines/m4/viewmgr.cpp b/engines/m4/viewmgr.cpp index 46b4b5af9d..8eb40f0f17 100644 --- a/engines/m4/viewmgr.cpp +++ b/engines/m4/viewmgr.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ // TODO: Views have a _coords rect, so I'm not sure if x/y is needed in the onRefresh diff --git a/engines/m4/viewmgr.h b/engines/m4/viewmgr.h index 211e6087f4..bb4f76cfaa 100644 --- a/engines/m4/viewmgr.h +++ b/engines/m4/viewmgr.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef M4_VIEWMGR_H diff --git a/engines/m4/woodscript.cpp b/engines/m4/woodscript.cpp index dc24548f84..42f4fbce98 100644 --- a/engines/m4/woodscript.cpp +++ b/engines/m4/woodscript.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "m4/woodscript.h" diff --git a/engines/m4/woodscript.h b/engines/m4/woodscript.h index a9a884a4b0..95033b9179 100644 --- a/engines/m4/woodscript.h +++ b/engines/m4/woodscript.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef M4_WOODSCRIPT_H diff --git a/engines/m4/ws_machine.cpp b/engines/m4/ws_machine.cpp index 3a25e3c622..18a8af76a8 100644 --- a/engines/m4/ws_machine.cpp +++ b/engines/m4/ws_machine.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "m4/woodscript.h" diff --git a/engines/m4/ws_sequence.cpp b/engines/m4/ws_sequence.cpp index 3ee496da0d..01776ef6ec 100644 --- a/engines/m4/ws_sequence.cpp +++ b/engines/m4/ws_sequence.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "m4/woodscript.h" diff --git a/engines/made/console.cpp b/engines/made/console.cpp index abf849d560..c835988788 100644 --- a/engines/made/console.cpp +++ b/engines/made/console.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "made/console.h" diff --git a/engines/made/console.h b/engines/made/console.h index 6dc7541f53..8b8484cb5c 100644 --- a/engines/made/console.h +++ b/engines/made/console.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef MADE_CONSOLE_H diff --git a/engines/made/database.cpp b/engines/made/database.cpp index 4e7a0467b1..6e5a3228f3 100644 --- a/engines/made/database.cpp +++ b/engines/made/database.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/system.h" diff --git a/engines/made/database.h b/engines/made/database.h index a71ba925c1..94acef98cd 100644 --- a/engines/made/database.h +++ b/engines/made/database.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef MADE_DATABASE_H diff --git a/engines/made/detection.cpp b/engines/made/detection.cpp index 6a6a70cb30..4576e2b5ce 100644 --- a/engines/made/detection.cpp +++ b/engines/made/detection.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "base/plugins.h" @@ -558,7 +555,7 @@ public: MadeMetaEngine() : AdvancedMetaEngine(detectionParams) {} virtual const char *getName() const { - return "MADE Engine"; + return "MADE"; } virtual const char *getOriginalCopyright() const { diff --git a/engines/made/graphics.cpp b/engines/made/graphics.cpp index 388ff60aa8..3ac73617c1 100644 --- a/engines/made/graphics.cpp +++ b/engines/made/graphics.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/debug.h" diff --git a/engines/made/graphics.h b/engines/made/graphics.h index bf5ec288ff..691f1127c2 100644 --- a/engines/made/graphics.h +++ b/engines/made/graphics.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef MADE_GRAPHICS_H diff --git a/engines/made/made.cpp b/engines/made/made.cpp index c791b657e7..a9c4587b4c 100644 --- a/engines/made/made.cpp +++ b/engines/made/made.cpp @@ -18,13 +18,9 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/events.h" -#include "common/EventRecorder.h" #include "common/keyboard.h" #include "common/config-manager.h" #include "common/stream.h" @@ -75,8 +71,7 @@ MadeEngine::MadeEngine(OSystem *syst, const MadeGameDescription *gameDesc) : Eng if (!scumm_stricmp(g->gameid, gameid)) _gameId = g->id; - _rnd = new Common::RandomSource(); - g_eventRec.registerRandomSource(*_rnd, "made"); + _rnd = new Common::RandomSource("made"); _console = new MadeConsole(this); diff --git a/engines/made/made.h b/engines/made/made.h index 780f59e442..e9673eed3c 100644 --- a/engines/made/made.h +++ b/engines/made/made.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef MADE_H diff --git a/engines/made/music.cpp b/engines/made/music.cpp index e5bbbc3b42..146d8d6371 100644 --- a/engines/made/music.cpp +++ b/engines/made/music.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ // FIXME: This code is taken from SAGA and needs more work (e.g. setVolume). diff --git a/engines/made/music.h b/engines/made/music.h index f8f70cdad6..1a5bae3040 100644 --- a/engines/made/music.h +++ b/engines/made/music.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ // Music class diff --git a/engines/made/pmvplayer.cpp b/engines/made/pmvplayer.cpp index 5ab24c1984..386d618273 100644 --- a/engines/made/pmvplayer.cpp +++ b/engines/made/pmvplayer.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "made/pmvplayer.h" diff --git a/engines/made/pmvplayer.h b/engines/made/pmvplayer.h index 8014a5a0f1..58b6eafd2b 100644 --- a/engines/made/pmvplayer.h +++ b/engines/made/pmvplayer.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef MADE_PMVPLAYER_H diff --git a/engines/made/redreader.cpp b/engines/made/redreader.cpp index 2fcd7f43da..a18c719110 100644 --- a/engines/made/redreader.cpp +++ b/engines/made/redreader.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "made/redreader.h" diff --git a/engines/made/redreader.h b/engines/made/redreader.h index a6e72c4e00..84181fb722 100644 --- a/engines/made/redreader.h +++ b/engines/made/redreader.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef MADE_REDREADER_H diff --git a/engines/made/resource.cpp b/engines/made/resource.cpp index 403520bec3..246241561c 100644 --- a/engines/made/resource.cpp +++ b/engines/made/resource.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/debug.h" diff --git a/engines/made/resource.h b/engines/made/resource.h index f1aeb7a87c..8ffebfef50 100644 --- a/engines/made/resource.h +++ b/engines/made/resource.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef MADE_RESOURCE_H diff --git a/engines/made/screen.cpp b/engines/made/screen.cpp index 4a73ba8e38..7a8b4603dc 100644 --- a/engines/made/screen.cpp +++ b/engines/made/screen.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "made/made.h" diff --git a/engines/made/screen.h b/engines/made/screen.h index e9292240a1..8485c1c4d7 100644 --- a/engines/made/screen.h +++ b/engines/made/screen.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef MADE_SCREEN_H diff --git a/engines/made/screenfx.cpp b/engines/made/screenfx.cpp index 7d1c3ed0a7..bdc36c87d7 100644 --- a/engines/made/screenfx.cpp +++ b/engines/made/screenfx.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "made/made.h" diff --git a/engines/made/screenfx.h b/engines/made/screenfx.h index 912eb8e0f7..793fcba2d6 100644 --- a/engines/made/screenfx.h +++ b/engines/made/screenfx.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef MADE_SCREENFX_H diff --git a/engines/made/script.cpp b/engines/made/script.cpp index de196f30e0..85e1a6ec6b 100644 --- a/engines/made/script.cpp +++ b/engines/made/script.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/endian.h" diff --git a/engines/made/script.h b/engines/made/script.h index be719eba5f..0a7cf8e974 100644 --- a/engines/made/script.h +++ b/engines/made/script.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef MADE_SCRIPT_H diff --git a/engines/made/scriptfuncs.cpp b/engines/made/scriptfuncs.cpp index c0a723438e..98cfb647ac 100644 --- a/engines/made/scriptfuncs.cpp +++ b/engines/made/scriptfuncs.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/util.h" diff --git a/engines/made/scriptfuncs.h b/engines/made/scriptfuncs.h index b8b2a87d19..481c131248 100644 --- a/engines/made/scriptfuncs.h +++ b/engines/made/scriptfuncs.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef MADE_SCRIPTFUNCS_H diff --git a/engines/made/sound.cpp b/engines/made/sound.cpp index 5ff1f73b05..54333eb3d4 100644 --- a/engines/made/sound.cpp +++ b/engines/made/sound.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/endian.h" diff --git a/engines/made/sound.h b/engines/made/sound.h index 0766c1040c..8358d279cf 100644 --- a/engines/made/sound.h +++ b/engines/made/sound.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef MADE_SOUND_H diff --git a/engines/metaengine.h b/engines/metaengine.h index ef34506991..8eb8044b34 100644 --- a/engines/metaengine.h +++ b/engines/metaengine.h @@ -17,9 +17,6 @@ * 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. - * - * $URL$ - * $Id$ */ #ifndef ENGINES_METAENGINE_H diff --git a/engines/mohawk/bitmap.cpp b/engines/mohawk/bitmap.cpp index 02548d58fc..d54e2dac6b 100644 --- a/engines/mohawk/bitmap.cpp +++ b/engines/mohawk/bitmap.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "mohawk/bitmap.h" diff --git a/engines/mohawk/bitmap.h b/engines/mohawk/bitmap.h index ea8a130dfc..74218882e8 100644 --- a/engines/mohawk/bitmap.h +++ b/engines/mohawk/bitmap.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef MOHAWK_BITMAP_H diff --git a/engines/mohawk/console.cpp b/engines/mohawk/console.cpp index 93cbe87e55..4e5b7186ff 100644 --- a/engines/mohawk/console.cpp +++ b/engines/mohawk/console.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "mohawk/console.h" diff --git a/engines/mohawk/console.h b/engines/mohawk/console.h index cb0e8501cd..cdb4e1bedf 100644 --- a/engines/mohawk/console.h +++ b/engines/mohawk/console.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef MOHAWK_CONSOLE_H diff --git a/engines/mohawk/cstime.cpp b/engines/mohawk/cstime.cpp index 46faae08f5..59bc5ad661 100644 --- a/engines/mohawk/cstime.cpp +++ b/engines/mohawk/cstime.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "mohawk/cstime.h" @@ -35,15 +32,14 @@ #include "common/config-manager.h" #include "common/error.h" #include "common/events.h" -#include "common/EventRecorder.h" #include "common/fs.h" #include "common/textconsole.h" +#include "common/system.h" namespace Mohawk { MohawkEngine_CSTime::MohawkEngine_CSTime(OSystem *syst, const MohawkGameDescription *gamedesc) : MohawkEngine(syst, gamedesc) { - _rnd = new Common::RandomSource(); - g_eventRec.registerRandomSource(*_rnd, "cstime"); + _rnd = new Common::RandomSource("cstime"); // If the user just copied the CD contents, the fonts are in a subdirectory. const Common::FSNode gameDataDir(ConfMan.get("path")); diff --git a/engines/mohawk/cstime.h b/engines/mohawk/cstime.h index 40293916db..3a1de6a137 100644 --- a/engines/mohawk/cstime.h +++ b/engines/mohawk/cstime.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef MOHAWK_CSTIME_H diff --git a/engines/mohawk/cstime_cases.cpp b/engines/mohawk/cstime_cases.cpp index c4801f822c..c0a8dfc0e3 100644 --- a/engines/mohawk/cstime_cases.cpp +++ b/engines/mohawk/cstime_cases.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "mohawk/cstime_cases.h" diff --git a/engines/mohawk/cstime_cases.h b/engines/mohawk/cstime_cases.h index 6f7630648e..1ac9abf87e 100644 --- a/engines/mohawk/cstime_cases.h +++ b/engines/mohawk/cstime_cases.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef MOHAWK_CSTIME_CASES_H diff --git a/engines/mohawk/cstime_game.cpp b/engines/mohawk/cstime_game.cpp index 66dce1da92..2e21111025 100644 --- a/engines/mohawk/cstime_game.cpp +++ b/engines/mohawk/cstime_game.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "mohawk/cstime_game.h" diff --git a/engines/mohawk/cstime_game.h b/engines/mohawk/cstime_game.h index 661fdbaa41..88e813c999 100644 --- a/engines/mohawk/cstime_game.h +++ b/engines/mohawk/cstime_game.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef MOHAWK_CSTIME_GAME_H diff --git a/engines/mohawk/cstime_ui.cpp b/engines/mohawk/cstime_ui.cpp index 106f7ea319..ee08384590 100644 --- a/engines/mohawk/cstime_ui.cpp +++ b/engines/mohawk/cstime_ui.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "mohawk/cstime_game.h" diff --git a/engines/mohawk/cstime_ui.h b/engines/mohawk/cstime_ui.h index 3ec38492d7..27df7cac3e 100644 --- a/engines/mohawk/cstime_ui.h +++ b/engines/mohawk/cstime_ui.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef MOHAWK_CSTIME_UI_H diff --git a/engines/mohawk/cstime_view.cpp b/engines/mohawk/cstime_view.cpp index 12d641a9ff..37c418f416 100644 --- a/engines/mohawk/cstime_view.cpp +++ b/engines/mohawk/cstime_view.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "mohawk/cstime_game.h" // debugging.. diff --git a/engines/mohawk/cstime_view.h b/engines/mohawk/cstime_view.h index 8db8794ce5..ae3283771d 100644 --- a/engines/mohawk/cstime_view.h +++ b/engines/mohawk/cstime_view.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef MOHAWK_CSTIME_VIEW_H diff --git a/engines/mohawk/cursors.cpp b/engines/mohawk/cursors.cpp index 66669e35c9..f95084de8e 100644 --- a/engines/mohawk/cursors.cpp +++ b/engines/mohawk/cursors.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "mohawk/cursors.h" @@ -29,9 +26,11 @@ #include "common/macresman.h" #include "common/system.h" +#include "common/textconsole.h" #include "common/winexe_ne.h" #include "common/winexe_pe.h" #include "graphics/cursorman.h" +#include "graphics/maccursor.h" #include "graphics/wincursor.h" #ifdef ENABLE_MYST @@ -41,11 +40,6 @@ namespace Mohawk { -static const byte s_bwPalette[] = { - 0x00, 0x00, 0x00, // Black - 0xFF, 0xFF, 0xFF // White -}; - void CursorManager::showCursor() { CursorMan.showMouse(true); } @@ -78,8 +72,13 @@ void CursorManager::setDefaultCursor() { 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0 }; + static const byte bwPalette[] = { + 0x00, 0x00, 0x00, // Black + 0xFF, 0xFF, 0xFF // White + }; + CursorMan.replaceCursor(defaultCursor, 12, 20, 0, 0, 0); - CursorMan.replaceCursorPalette(s_bwPalette, 1, 2); + CursorMan.replaceCursorPalette(bwPalette, 1, 2); } void CursorManager::setCursor(uint16 id) { @@ -87,35 +86,24 @@ void CursorManager::setCursor(uint16 id) { setDefaultCursor(); } -void CursorManager::setMacXorCursor(Common::SeekableReadStream *stream) { +void CursorManager::setMacCursor(Common::SeekableReadStream *stream) { assert(stream); - byte cursorBitmap[16 * 16]; + Graphics::MacCursor *macCursor = new Graphics::MacCursor(); - // Get black and white data - for (int i = 0; i < 32; i++) { - byte imageByte = stream->readByte(); - for (int b = 0; b < 8; b++) - cursorBitmap[i * 8 + b] = (imageByte & (0x80 >> b)) ? 1 : 2; - } + if (!macCursor->readFromStream(*stream)) + error("Could not parse Mac cursor"); - // Apply mask data - for (int i = 0; i < 32; i++) { - byte imageByte = stream->readByte(); - for (int b = 0; b < 8; b++) - if ((imageByte & (0x80 >> b)) == 0) - cursorBitmap[i * 8 + b] = 0; - } - - uint16 hotspotY = stream->readUint16BE(); - uint16 hotspotX = stream->readUint16BE(); + CursorMan.replaceCursor(macCursor->getSurface(), macCursor->getWidth(), macCursor->getHeight(), + macCursor->getHotspotX(), macCursor->getHotspotY(), macCursor->getKeyColor()); + CursorMan.replaceCursorPalette(macCursor->getPalette(), 0, 256); - CursorMan.replaceCursor(cursorBitmap, 16, 16, hotspotX, hotspotY, 0); - CursorMan.replaceCursorPalette(s_bwPalette, 1, 2); + delete macCursor; + delete stream; } void DefaultCursorManager::setCursor(uint16 id) { - setMacXorCursor(_vm->getResource(_tag, id)); + setMacCursor(_vm->getResource(_tag, id)); } #ifdef ENABLE_MYST @@ -139,6 +127,13 @@ void MystCursorManager::hideCursor() { } void MystCursorManager::setCursor(uint16 id) { + // Zero means empty cursor + if (id == 0) { + static const byte emptyCursor = 0; + CursorMan.replaceCursor(&emptyCursor, 1, 1, 0, 0, 0); + return; + } + // Both Myst and Myst ME use the "MystBitmap" format for cursor images. MohawkSurface *mhkSurface = _bmpDecoder->decodeImage(_vm->getResource(ID_WDIB, id)); Graphics::Surface *surface = mhkSurface->getSurface(); @@ -223,26 +218,12 @@ void MacCursorManager::setCursor(uint16 id) { // Try a color cursor first Common::SeekableReadStream *stream = _resFork->getResource(MKTAG('c','r','s','r'), id); - if (stream) { - byte *cursor, *palette; - int width, height, hotspotX, hotspotY, keyColor, palSize; - - _resFork->convertCrsrCursor(stream, &cursor, width, height, hotspotX, hotspotY, keyColor, true, &palette, palSize); - - CursorMan.replaceCursor(cursor, width, height, hotspotX, hotspotY, keyColor); - CursorMan.replaceCursorPalette(palette, 0, palSize); - - delete[] cursor; - delete[] palette; - delete stream; - return; - } - - // Fall back to b&w cursors - stream = _resFork->getResource(MKTAG('C','U','R','S'), id); + // Fall back to monochrome cursors + if (!stream) + stream = _resFork->getResource(MKTAG('C','U','R','S'), id); if (stream) { - setMacXorCursor(stream); + setMacCursor(stream); delete stream; } else { setDefaultCursor(); @@ -265,7 +246,7 @@ LivingBooksCursorManager_v2::~LivingBooksCursorManager_v2() { void LivingBooksCursorManager_v2::setCursor(uint16 id) { if (_sysArchive && _sysArchive->hasResource(ID_TCUR, id)) { - setMacXorCursor(_sysArchive->getResource(ID_TCUR, id)); + setMacCursor(_sysArchive->getResource(ID_TCUR, id)); } else { // TODO: Handle generated cursors } diff --git a/engines/mohawk/cursors.h b/engines/mohawk/cursors.h index 1fb8b35714..d92b6b4285 100644 --- a/engines/mohawk/cursors.h +++ b/engines/mohawk/cursors.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef MOHAWK_CURSORS_H @@ -63,8 +60,8 @@ public: virtual bool hasSource() const { return false; } protected: - // Set a Mac XOR/AND map cursor to the screen - void setMacXorCursor(Common::SeekableReadStream *stream); + // Set a Mac CURS/crsr cursor to the screen + void setMacCursor(Common::SeekableReadStream *stream); }; // The default Mohawk cursor manager diff --git a/engines/mohawk/detection.cpp b/engines/mohawk/detection.cpp index c14d3327d0..6a73b28246 100644 --- a/engines/mohawk/detection.cpp +++ b/engines/mohawk/detection.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "base/plugins.h" @@ -191,7 +188,7 @@ public: MohawkMetaEngine() : AdvancedMetaEngine(detectionParams) {} virtual const char *getName() const { - return "Mohawk Engine"; + return "Mohawk"; } virtual const char *getOriginalCopyright() const { diff --git a/engines/mohawk/detection_tables.h b/engines/mohawk/detection_tables.h index 36dbcbde7b..5510643d04 100644 --- a/engines/mohawk/detection_tables.h +++ b/engines/mohawk/detection_tables.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ namespace Mohawk { diff --git a/engines/mohawk/dialogs.cpp b/engines/mohawk/dialogs.cpp index 4c7e52f02f..6cb455917e 100644 --- a/engines/mohawk/dialogs.cpp +++ b/engines/mohawk/dialogs.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "mohawk/mohawk.h" @@ -82,7 +79,9 @@ void PauseDialog::handleKeyDown(Common::KeyState state) { enum { kZipCmd = 'ZIPM', kTransCmd = 'TRAN', - kWaterCmd = 'WATR' + kWaterCmd = 'WATR', + kDropCmd = 'DROP', + kMapCmd = 'SMAP' }; #ifdef ENABLE_MYST @@ -90,6 +89,13 @@ enum { MystOptionsDialog::MystOptionsDialog(MohawkEngine_Myst* vm) : GUI::OptionsDialog("", 120, 120, 360, 200), _vm(vm) { _zipModeCheckbox = new GUI::CheckboxWidget(this, 15, 10, 300, 15, _("~Z~ip Mode Activated"), 0, kZipCmd); _transitionsCheckbox = new GUI::CheckboxWidget(this, 15, 30, 300, 15, _("~T~ransitions Enabled"), 0, kTransCmd); + _dropPageButton = new GUI::ButtonWidget(this, 15, 60, 100, 25, _("~D~rop Page"), 0, kDropCmd); + + // Myst ME only has maps + if (_vm->getFeatures() & GF_ME) + _showMapButton = new GUI::ButtonWidget(this, 15, 95, 100, 25, _("~S~how Map"), 0, kMapCmd); + else + _showMapButton = 0; new GUI::ButtonWidget(this, 95, 160, 120, 25, _("~O~K"), 0, GUI::kOKCmd); new GUI::ButtonWidget(this, 225, 160, 120, 25, _("~C~ancel"), 0, GUI::kCloseCmd); @@ -101,6 +107,12 @@ MystOptionsDialog::~MystOptionsDialog() { void MystOptionsDialog::open() { Dialog::open(); + _dropPageButton->setEnabled(_vm->_gameState->_globals.heldPage != 0); + + if (_showMapButton) + _showMapButton->setEnabled(_vm->_scriptParser && + _vm->_scriptParser->getMap()); + _zipModeCheckbox->setState(_vm->_gameState->_globals.zipMode); _transitionsCheckbox->setState(_vm->_gameState->_globals.transitions); } @@ -113,6 +125,14 @@ void MystOptionsDialog::handleCommand(GUI::CommandSender *sender, uint32 cmd, ui case kTransCmd: _vm->_gameState->_globals.transitions = _transitionsCheckbox->getState(); break; + case kDropCmd: + _vm->_needsPageDrop = true; + close(); + break; + case kMapCmd: + _vm->_needsShowMap = true; + close(); + break; case GUI::kCloseCmd: close(); break; diff --git a/engines/mohawk/dialogs.h b/engines/mohawk/dialogs.h index 106a1566fc..853ff30813 100644 --- a/engines/mohawk/dialogs.h +++ b/engines/mohawk/dialogs.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef MOHAWK_DIALOGS_H @@ -84,6 +81,8 @@ private: MohawkEngine_Myst *_vm; GUI::CheckboxWidget *_zipModeCheckbox; GUI::CheckboxWidget *_transitionsCheckbox; + GUI::ButtonWidget *_dropPageButton; + GUI::ButtonWidget *_showMapButton; }; #endif diff --git a/engines/mohawk/graphics.cpp b/engines/mohawk/graphics.cpp index a1bcb55f7b..b3653b1fdf 100644 --- a/engines/mohawk/graphics.cpp +++ b/engines/mohawk/graphics.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "mohawk/resource.h" @@ -296,6 +293,9 @@ MystGraphics::MystGraphics(MohawkEngine_Myst* vm) : GraphicsManager(), _vm(vm) { // Initialize our buffer _backBuffer = new Graphics::Surface(); _backBuffer->create(_vm->_system->getWidth(), _vm->_system->getHeight(), _pixelFormat); + + _nextAllowedDrawTime = _vm->_system->getMillis(); + _enableDrawingTimeSimulation = 0; } MystGraphics::~MystGraphics() { @@ -447,6 +447,8 @@ void MystGraphics::copyImageSectionToScreen(uint16 image, Common::Rect src, Comm debug(3, "\twidth: %d", width); debug(3, "\theight: %d", height); + simulatePreviousDrawDelay(dest); + _vm->_system->copyRectToScreen((byte *)surface->getBasePtr(src.left, top), surface->pitch, dest.left, dest.top, width, height); } @@ -502,10 +504,18 @@ void MystGraphics::copyImageToBackBuffer(uint16 image, Common::Rect dest) { void MystGraphics::copyBackBufferToScreen(Common::Rect r) { r.clip(_viewport); + + simulatePreviousDrawDelay(r); + _vm->_system->copyRectToScreen((byte *)_backBuffer->getBasePtr(r.left, r.top), _backBuffer->pitch, r.left, r.top, r.width(), r.height()); } void MystGraphics::runTransition(uint16 type, Common::Rect rect, uint16 steps, uint16 delay) { + + // Do not artificially delay during transitions + int oldEnableDrawingTimeSimulation = _enableDrawingTimeSimulation; + _enableDrawingTimeSimulation = 0; + switch (type) { case 0: { debugC(kDebugScript, "Left to Right"); @@ -607,6 +617,8 @@ void MystGraphics::runTransition(uint16 type, Common::Rect rect, uint16 steps, u _vm->_system->updateScreen(); break; } + + _enableDrawingTimeSimulation = oldEnableDrawingTimeSimulation; } void MystGraphics::drawRect(Common::Rect rect, RectState state) { @@ -632,6 +644,34 @@ void MystGraphics::drawLine(const Common::Point &p1, const Common::Point &p2, ui _backBuffer->drawLine(p1.x, p1.y, p2.x, p2.y, color); } +void MystGraphics::enableDrawingTimeSimulation(bool enable) { + if (enable) + _enableDrawingTimeSimulation++; + else + _enableDrawingTimeSimulation--; + + if (_enableDrawingTimeSimulation < 0) + _enableDrawingTimeSimulation = 0; +} + +void MystGraphics::simulatePreviousDrawDelay(const Common::Rect &dest) { + uint32 time = 0; + + if (_enableDrawingTimeSimulation) { + time = _vm->_system->getMillis(); + + // Do not draw anything new too quickly after the previous draw call + // so that images stay at least a little while on screen + // This is enabled only for scripted draw calls + if (time < _nextAllowedDrawTime) + _vm->_system->delayMillis(_nextAllowedDrawTime - time); + } + + // Next draw call allowed at DELAY + AERA * COEFF milliseconds from now + time = _vm->_system->getMillis(); + _nextAllowedDrawTime = time + _constantDrawDelay + dest.height() * dest.width() / _proportionalDrawDelay; +} + #endif // ENABLE_MYST #ifdef ENABLE_RIVEN diff --git a/engines/mohawk/graphics.h b/engines/mohawk/graphics.h index c7e9b98d49..d7057f48cf 100644 --- a/engines/mohawk/graphics.h +++ b/engines/mohawk/graphics.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef MOHAWK_GRAPHICS_H @@ -131,10 +128,12 @@ public: void runTransition(uint16 type, Common::Rect rect, uint16 steps, uint16 delay); void drawRect(Common::Rect rect, RectState state); void drawLine(const Common::Point &p1, const Common::Point &p2, uint32 color); + void enableDrawingTimeSimulation(bool enable); protected: MohawkSurface *decodeImage(uint16 id); MohawkEngine *getVM() { return (MohawkEngine *)_vm; } + void simulatePreviousDrawDelay(const Common::Rect &dest); private: MohawkEngine_Myst *_vm; @@ -159,6 +158,11 @@ private: Graphics::Surface *_backBuffer; Graphics::PixelFormat _pixelFormat; Common::Rect _viewport; + + int _enableDrawingTimeSimulation; + uint32 _nextAllowedDrawTime; + static const uint _constantDrawDelay = 10; // ms + static const uint _proportionalDrawDelay = 500; // pixels per ms }; #endif // ENABLE_MYST diff --git a/engines/mohawk/installer_archive.cpp b/engines/mohawk/installer_archive.cpp index 5079375896..83796158a6 100644 --- a/engines/mohawk/installer_archive.cpp +++ b/engines/mohawk/installer_archive.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "mohawk/installer_archive.h" diff --git a/engines/mohawk/installer_archive.h b/engines/mohawk/installer_archive.h index d33fbe5bcd..27877d69f9 100644 --- a/engines/mohawk/installer_archive.h +++ b/engines/mohawk/installer_archive.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/archive.h" diff --git a/engines/mohawk/livingbooks.cpp b/engines/mohawk/livingbooks.cpp index 2475965812..a4e7f0349c 100644 --- a/engines/mohawk/livingbooks.cpp +++ b/engines/mohawk/livingbooks.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "mohawk/livingbooks.h" @@ -31,10 +28,10 @@ #include "common/config-manager.h" #include "common/error.h" #include "common/events.h" -#include "common/EventRecorder.h" #include "common/fs.h" #include "common/archive.h" #include "common/textconsole.h" +#include "common/system.h" #include "graphics/palette.h" @@ -128,8 +125,7 @@ MohawkEngine_LivingBooks::MohawkEngine_LivingBooks(OSystem *syst, const MohawkGa _alreadyShowedIntro = false; - _rnd = new Common::RandomSource(); - g_eventRec.registerRandomSource(*_rnd, "livingbooks"); + _rnd = new Common::RandomSource("livingbooks"); _page = NULL; @@ -293,6 +289,15 @@ void MohawkEngine_LivingBooks::loadBookInfo(const Common::String &filename) { // - fUse254ColorPalette (always true?) // - nKBRequired (4096, RAM requirement?) // - fDebugWindow (always 0?) + + if (_bookInfoFile.hasSection("Globals")) { + const Common::ConfigFile::SectionKeyList globals = _bookInfoFile.getKeys("Globals"); + for (Common::ConfigFile::SectionKeyList::const_iterator i = globals.begin(); i != globals.end(); i++) { + Common::String command = Common::String::format("%s = %s", i->key.c_str(), i->value.c_str()); + debug("global: %s", command.c_str()); + // TODO: run command + } + } } Common::String MohawkEngine_LivingBooks::stringForMode(LBMode mode) { @@ -746,6 +751,9 @@ void LBPage::loadBITL(uint16 resourceId) { case kLBMiniGameItem: res = new LBMiniGameItem(_vm, this, rect); break; + case kLBProxyItem: + res = new LBProxyItem(_vm, this, rect); + break; default: warning("Unknown item type %04x", type); case 3: // often used for buttons @@ -2700,10 +2708,20 @@ int LBItem::runScriptEntry(LBScriptEntry *entry) { break; case kLBOpLoad: + // FIXME + warning("ignoring kLBOpLoad (event 0x%04x, param 0x%04x, target '%s')", + entry->event, entry->param, target->_desc.c_str()); + break; + case kLBOpPreload: + // FIXME + warning("ignoring kLBOpPreload (event 0x%04x, param 0x%04x, target '%s')", + entry->event, entry->param, target->_desc.c_str()); + break; + case kLBOpUnload: // FIXME - warning("ignoring kLBOpLoad/Preload/Unload (event 0x%04x, param 0x%04x, target '%s')", + warning("ignoring kLBOpUnload (event 0x%04x, param 0x%04x, target '%s')", entry->event, entry->param, target->_desc.c_str()); break; @@ -3748,4 +3766,35 @@ bool LBMiniGameItem::togglePlaying(bool playing, bool restart) { return false; } +LBProxyItem::LBProxyItem(MohawkEngine_LivingBooks *vm, LBPage *page, Common::Rect rect) : LBItem(vm, page, rect) { + debug(3, "new LBProxyItem"); + + _page = NULL; +} + +LBProxyItem::~LBProxyItem() { + delete _page; +} + +void LBProxyItem::init() { + Common::String leftover; + Common::String filename = _vm->getFileNameFromConfig("Proxies", _desc.c_str(), leftover); + if (!leftover.empty()) + error("LBProxyItem tried loading proxy '%s' but got leftover '%s'", _desc.c_str(), leftover.c_str()); + uint16 baseId; + for (uint i = 0; i < filename.size(); i++) { + if (filename[i] == ';') { + baseId = atoi(filename.c_str() + i + 1); + filename = Common::String(filename.c_str(), i); + } + } + + debug(1, "LBProxyItem loading archive '%s' with id %d", filename.c_str(), baseId); + MohawkArchive *pageArchive = _vm->createMohawkArchive(); + if (!pageArchive->open(filename)) + error("failed to open archive '%s' (for proxy '%s')", filename.c_str(), _desc.c_str()); + _page = new LBPage(_vm); + _page->open(pageArchive, baseId); +} + } // End of namespace Mohawk diff --git a/engines/mohawk/livingbooks.h b/engines/mohawk/livingbooks.h index cd3b206d57..de84b0f13f 100644 --- a/engines/mohawk/livingbooks.h +++ b/engines/mohawk/livingbooks.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef MOHAWK_LIVINGBOOKS_H @@ -574,6 +571,17 @@ public: bool togglePlaying(bool playing, bool restart); }; +class LBProxyItem : public LBItem { +public: + LBProxyItem(MohawkEngine_LivingBooks *_vm, LBPage *page, Common::Rect rect); + ~LBProxyItem(); + + void init(); + +protected: + class LBPage *_page; +}; + struct NotifyEvent { NotifyEvent(uint t, uint p) : type(t), param(p), newUnknown(0), newMode(0), newPage(0), newSubpage(0) { } uint type; diff --git a/engines/mohawk/livingbooks_code.cpp b/engines/mohawk/livingbooks_code.cpp index 4237c712d9..165ca4a328 100644 --- a/engines/mohawk/livingbooks_code.cpp +++ b/engines/mohawk/livingbooks_code.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "mohawk/livingbooks.h" @@ -609,7 +606,7 @@ CodeCommandInfo generalCommandInfo[NUM_GENERAL_COMMANDS] = { { "move", 0 }, { 0, 0 }, { 0, 0 }, - { "setDragParams", 0 }, + { "setDragParams", &LBCode::cmdSetDragParams }, { "resetDragParams", 0 }, { "enableRollover", &LBCode::cmdUnimplemented /* FIXME */ }, { "setCursor", 0 }, @@ -804,6 +801,10 @@ void LBCode::cmdRight(const Common::Array<LBValue> ¶ms) { _stack.push(rect.right); } +void LBCode::cmdSetDragParams(const Common::Array<LBValue> ¶ms) { + warning("ignoring setDragParams"); +} + void LBCode::cmdSetPlayParams(const Common::Array<LBValue> ¶ms) { if (params.size() > 8) error("too many parameters (%d) to setPlayParams", params.size()); @@ -878,7 +879,7 @@ CodeCommandInfo itemCommandInfo[NUM_ITEM_COMMANDS] = { { "isLoaded", 0 }, { "isDragging", 0 }, { "load", 0 }, - { "moveTo", 0 }, + { "moveTo", &LBCode::itemMoveTo }, { "mute", 0 }, { "play", 0 }, { "seek", 0 }, @@ -913,6 +914,10 @@ void LBCode::itemIsPlaying(const Common::Array<LBValue> ¶ms) { _stack.push(0); } +void LBCode::itemMoveTo(const Common::Array<LBValue> ¶ms) { + warning("ignoring moveTo"); +} + void LBCode::itemSetParent(const Common::Array<LBValue> ¶ms) { if (params.size() > 2) error("incorrect number of parameters (%d) to setParent", params.size()); diff --git a/engines/mohawk/livingbooks_code.h b/engines/mohawk/livingbooks_code.h index cd9ac1004a..9602e2d22d 100644 --- a/engines/mohawk/livingbooks_code.h +++ b/engines/mohawk/livingbooks_code.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef MOHAWK_LIVINGBOOKS_CODE_H @@ -225,12 +222,14 @@ public: void cmdLeft(const Common::Array<LBValue> ¶ms); void cmdBottom(const Common::Array<LBValue> ¶ms); void cmdRight(const Common::Array<LBValue> ¶ms); + void cmdSetDragParams(const Common::Array<LBValue> ¶ms); void cmdSetPlayParams(const Common::Array<LBValue> ¶ms); void cmdSetKeyEvent(const Common::Array<LBValue> ¶ms); void cmdSetHitTest(const Common::Array<LBValue> ¶ms); void cmdKey(const Common::Array<LBValue> ¶ms); void itemSetParent(const Common::Array<LBValue> ¶ms); + void itemMoveTo(const Common::Array<LBValue> ¶ms); void itemIsPlaying(const Common::Array<LBValue> ¶ms); }; diff --git a/engines/mohawk/mohawk.cpp b/engines/mohawk/mohawk.cpp index f63645f1ac..faf52595b7 100644 --- a/engines/mohawk/mohawk.cpp +++ b/engines/mohawk/mohawk.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/scummsys.h" diff --git a/engines/mohawk/mohawk.h b/engines/mohawk/mohawk.h index 8a853d151e..b189f82040 100644 --- a/engines/mohawk/mohawk.h +++ b/engines/mohawk/mohawk.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef MOHAWK_H diff --git a/engines/mohawk/myst.cpp b/engines/mohawk/myst.cpp index 655a38b578..4f9c3a893e 100644 --- a/engines/mohawk/myst.cpp +++ b/engines/mohawk/myst.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/config-manager.h" @@ -74,7 +71,8 @@ MohawkEngine_Myst::MohawkEngine_Myst(OSystem *syst, const MohawkGameDescription // original, including bugs, missing bits etc. :) _tweaksEnabled = true; - _currentCursor = _mainCursor = kDefaultMystCursor; + _currentCursor = 0; + _mainCursor = kDefaultMystCursor; _showResourceRects = false; _curCard = 0; _needsUpdate = false; @@ -258,7 +256,10 @@ Common::Error MohawkEngine_Myst::run() { _loadDialog->setSaveMode(false); _optionsDialog = new MystOptionsDialog(this); _cursor = new MystCursorManager(this); - _rnd = new Common::RandomSource(); + _rnd = new Common::RandomSource("myst"); + + // Cursor is visible by default + _cursor->showCursor(); // Load game from launcher/command line if requested if (ConfMan.hasKey("save_slot") && canLoadGameStateCurrently()) { @@ -288,9 +289,6 @@ Common::Error MohawkEngine_Myst::run() { // Test Load Function... loadHelp(10000); - // Set the cursor - _cursor->setCursor(_currentCursor); - Common::Event event; while (!shouldQuit()) { // Update any background videos @@ -343,7 +341,20 @@ Common::Error MohawkEngine_Myst::run() { drawResourceRects(); break; case Common::KEYCODE_F5: + _needsPageDrop = false; + _needsShowMap = false; + runDialog(*_optionsDialog); + + if (_needsPageDrop) { + dropPage(); + _needsPageDrop = false; + } + + if (_needsShowMap) { + _scriptParser->showMap(); + _needsShowMap = false; + } break; default: break; @@ -405,6 +416,11 @@ void MohawkEngine_Myst::changeToStack(uint16 stack, uint16 card, uint16 linkSrcS _curStack = stack; + // Fill screen with black and empty cursor + _cursor->setCursor(0); + _system->fillScreen(_system->getScreenFormat().RGBToColor(0, 0, 0)); + _system->updateScreen(); + _sound->stopSound(); _sound->stopBackgroundMyst(); if (linkSrcSound) @@ -553,7 +569,7 @@ uint16 MohawkEngine_Myst::getCardBackgroundId() { } void MohawkEngine_Myst::drawCardBackground() { - _gfx->copyImageToBackBuffer(getCardBackgroundId(), Common::Rect(0, 0, 544, 333)); + _gfx->copyImageToBackBuffer(getCardBackgroundId(), Common::Rect(0, 0, 544, 332)); } void MohawkEngine_Myst::changeToCard(uint16 card, bool updateScreen) { @@ -631,18 +647,18 @@ void MohawkEngine_Myst::changeToCard(uint16 card, bool updateScreen) { // TODO: Handle Script Resources - // Make sure we have the right cursor showing - _dragResource = 0; - _hoverResource = 0; - _curResource = -1; - checkCurrentResource(); - // Make sure the screen is updated if (updateScreen) { _gfx->copyBackBufferToScreen(Common::Rect(544, 333)); _system->updateScreen(); } + // Make sure we have the right cursor showing + _dragResource = 0; + _hoverResource = 0; + _curResource = -1; + checkCurrentResource(); + // Debug: Show resource rects if (_showResourceRects) drawResourceRects(); @@ -1181,4 +1197,42 @@ bool MohawkEngine_Myst::canSaveGameStateCurrently() { return false; } +void MohawkEngine_Myst::dropPage() { + uint16 page = _gameState->_globals.heldPage; + bool whitePage = page == 13; + bool bluePage = page - 1 < 6; + bool redPage = page - 7 < 6; + + // Play drop page sound + _sound->replaceSoundMyst(800); + + // Drop page + _gameState->_globals.heldPage = 0; + + // Redraw page area + if (whitePage && _gameState->_globals.currentAge == 2) { + redrawArea(41); + } else if (bluePage) { + if (page == 6) { + if (_gameState->_globals.currentAge == 2) + redrawArea(24); + } else { + redrawArea(103); + } + } else if (redPage) { + if (page == 12) { + if (_gameState->_globals.currentAge == 2) + redrawArea(25); + } else if (page == 10) { + if (_gameState->_globals.currentAge == 1) + redrawArea(35); + } else { + redrawArea(102); + } + } + + setMainCursor(kDefaultMystCursor); + checkCursorHints(); +} + } // End of namespace Mohawk diff --git a/engines/mohawk/myst.h b/engines/mohawk/myst.h index 47e8a6562c..5edf774ed0 100644 --- a/engines/mohawk/myst.h +++ b/engines/mohawk/myst.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef MOHAWK_MYST_H @@ -168,6 +165,8 @@ public: bool _tweaksEnabled; bool _needsUpdate; + bool _needsPageDrop; + bool _needsShowMap; MystView _view; MystGraphics *_gfx; @@ -210,6 +209,8 @@ private: bool _runExitScript; + void dropPage(); + void loadCard(); void unloadCard(); void runInitScript(); diff --git a/engines/mohawk/myst_areas.cpp b/engines/mohawk/myst_areas.cpp index dc00bff923..294fcea2f1 100644 --- a/engines/mohawk/myst_areas.cpp +++ b/engines/mohawk/myst_areas.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "mohawk/graphics.h" diff --git a/engines/mohawk/myst_areas.h b/engines/mohawk/myst_areas.h index aa06d1a5b4..136356ea4f 100644 --- a/engines/mohawk/myst_areas.h +++ b/engines/mohawk/myst_areas.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "mohawk/myst.h" diff --git a/engines/mohawk/myst_scripts.cpp b/engines/mohawk/myst_scripts.cpp index 71c408ed37..be5b7e1c76 100644 --- a/engines/mohawk/myst_scripts.cpp +++ b/engines/mohawk/myst_scripts.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "mohawk/cursors.h" @@ -148,6 +145,7 @@ void MystScriptParser::setupCommonOpcodes() { OPCODE(44, o_restoreMainCursor); // Opcode 45 Not Present OPCODE(46, o_soundWaitStop); + OPCODE(51, o_exitMap); // Opcodes 47 to 99 Not Present OPCODE(0xFFFF, NOP); @@ -157,6 +155,11 @@ void MystScriptParser::setupCommonOpcodes() { void MystScriptParser::runScript(MystScript script, MystResource *invokingResource) { debugC(kDebugScript, "Script Size: %d", script->size()); + + // Scripted drawing takes more time to simulate older hardware + // This way opcodes can't overwrite what the previous ones drew too quickly + _vm->_gfx->enableDrawingTimeSimulation(true); + for (uint16 i = 0; i < script->size(); i++) { MystScriptEntry &entry = script->operator[](i); debugC(kDebugScript, "\tOpcode %d: %d", i, entry.opcode); @@ -168,6 +171,8 @@ void MystScriptParser::runScript(MystScript script, MystResource *invokingResour runOpcode(entry.opcode, entry.var, entry.argc, entry.argv); } + + _vm->_gfx->enableDrawingTimeSimulation(false); } void MystScriptParser::runOpcode(uint16 op, uint16 var, uint16 argc, uint16 *argv) { @@ -918,4 +923,15 @@ void MystScriptParser::o_quit(uint16 op, uint16 var, uint16 argc, uint16 *argv) _vm->quitGame(); } +void MystScriptParser::showMap() { + if (_vm->getCurCard() != getMap()) { + _savedMapCardId = _vm->getCurCard(); + _vm->changeToCard(getMap(), true); + } +} + +void MystScriptParser::o_exitMap(uint16 op, uint16 var, uint16 argc, uint16 *argv) { + _vm->changeToCard(_savedMapCardId, true); +} + } // End of namespace Mohawk diff --git a/engines/mohawk/myst_scripts.h b/engines/mohawk/myst_scripts.h index e4f4cc3cfe..18f5b27a6d 100644 --- a/engines/mohawk/myst_scripts.h +++ b/engines/mohawk/myst_scripts.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef MYST_SCRIPTS_H @@ -79,6 +76,9 @@ public: virtual void toggleVar(uint16 var); virtual bool setVarValue(uint16 var, uint16 value); + virtual uint16 getMap() { return 0; } + void showMap(); + void animatedUpdate(uint16 argc, uint16 *argv, uint16 delay); DECLARE_OPCODE(unknown); @@ -122,6 +122,7 @@ public: DECLARE_OPCODE(o_saveMainCursor); DECLARE_OPCODE(o_restoreMainCursor); DECLARE_OPCODE(o_soundWaitStop); + DECLARE_OPCODE(o_exitMap); // Used in multiple stacks DECLARE_OPCODE(o_quit); @@ -147,6 +148,7 @@ protected: MystResource *_invokingResource; uint16 _savedCardId; + uint16 _savedMapCardId; uint16 _savedCursorId; int16 _tempVar; // Generic temp var used by the scripts uint32 _startTime; // Generic start time used by the scripts diff --git a/engines/mohawk/myst_stacks/channelwood.cpp b/engines/mohawk/myst_stacks/channelwood.cpp index cba2583a50..0dd69a673a 100644 --- a/engines/mohawk/myst_stacks/channelwood.cpp +++ b/engines/mohawk/myst_stacks/channelwood.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "mohawk/cursors.h" @@ -333,7 +330,7 @@ void Channelwood::o_drawImageChangeCardAndVolume(uint16 op, uint16 var, uint16 a _vm->_gfx->copyImageToScreen(imageId, Common::Rect(0, 0, 544, 333)); _vm->_system->updateScreen(); - _vm->_system->delayMillis(10); + _vm->changeToCard(cardId, true); if (argc == 3) { @@ -351,7 +348,6 @@ void Channelwood::o_waterTankValveOpen(uint16 op, uint16 var, uint16 argc, uint1 for (uint16 imageId = 3601; imageId >= 3595; imageId--) { _vm->_gfx->copyImageToScreen(imageId, rect); _vm->_system->updateScreen(); - _vm->_system->delayMillis(5); } pipeChangeValve(true, 0x80); @@ -666,7 +662,6 @@ void Channelwood::o_waterTankValveClose(uint16 op, uint16 var, uint16 argc, uint for (uint16 imageId = 3595; imageId <= 3601; imageId++) { _vm->_gfx->copyImageToScreen(imageId, rect); _vm->_system->updateScreen(); - _vm->_system->delayMillis(5); } pipeChangeValve(false, 0x80); diff --git a/engines/mohawk/myst_stacks/channelwood.h b/engines/mohawk/myst_stacks/channelwood.h index 5eeaa63e23..a3ea406003 100644 --- a/engines/mohawk/myst_stacks/channelwood.h +++ b/engines/mohawk/myst_stacks/channelwood.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef MYST_SCRIPTS_CHANNELWOOD_H @@ -52,6 +49,8 @@ private: void toggleVar(uint16 var); bool setVarValue(uint16 var, uint16 value); + virtual uint16 getMap() { return 9932; } + DECLARE_OPCODE(o_bridgeToggle); DECLARE_OPCODE(o_pipeExtend); DECLARE_OPCODE(o_drawImageChangeCardAndVolume); diff --git a/engines/mohawk/myst_stacks/credits.cpp b/engines/mohawk/myst_stacks/credits.cpp index bb8397fd09..ad593e3542 100644 --- a/engines/mohawk/myst_stacks/credits.cpp +++ b/engines/mohawk/myst_stacks/credits.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "mohawk/myst.h" diff --git a/engines/mohawk/myst_stacks/credits.h b/engines/mohawk/myst_stacks/credits.h index 4f9eaa2944..a1f8b0a7d8 100644 --- a/engines/mohawk/myst_stacks/credits.h +++ b/engines/mohawk/myst_stacks/credits.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef MYST_SCRIPTS_CREDITS_H diff --git a/engines/mohawk/myst_stacks/demo.cpp b/engines/mohawk/myst_stacks/demo.cpp index a2dd148b22..53d946dd66 100644 --- a/engines/mohawk/myst_stacks/demo.cpp +++ b/engines/mohawk/myst_stacks/demo.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "mohawk/myst.h" diff --git a/engines/mohawk/myst_stacks/demo.h b/engines/mohawk/myst_stacks/demo.h index 054dc7befe..4f8d68759b 100644 --- a/engines/mohawk/myst_stacks/demo.h +++ b/engines/mohawk/myst_stacks/demo.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef MYST_SCRIPTS_DEMO_H diff --git a/engines/mohawk/myst_stacks/dni.cpp b/engines/mohawk/myst_stacks/dni.cpp index e2a11eb94f..cf28945c71 100644 --- a/engines/mohawk/myst_stacks/dni.cpp +++ b/engines/mohawk/myst_stacks/dni.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "mohawk/myst.h" diff --git a/engines/mohawk/myst_stacks/dni.h b/engines/mohawk/myst_stacks/dni.h index b50f018d3e..7f04287082 100644 --- a/engines/mohawk/myst_stacks/dni.h +++ b/engines/mohawk/myst_stacks/dni.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef MYST_SCRIPTS_DNI_H diff --git a/engines/mohawk/myst_stacks/intro.cpp b/engines/mohawk/myst_stacks/intro.cpp index 0d8f67a85b..7d3179fa24 100644 --- a/engines/mohawk/myst_stacks/intro.cpp +++ b/engines/mohawk/myst_stacks/intro.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "mohawk/myst.h" diff --git a/engines/mohawk/myst_stacks/intro.h b/engines/mohawk/myst_stacks/intro.h index 0ecd9e6883..9fe3920e53 100644 --- a/engines/mohawk/myst_stacks/intro.h +++ b/engines/mohawk/myst_stacks/intro.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef MYST_SCRIPTS_INTRO_H diff --git a/engines/mohawk/myst_stacks/makingof.cpp b/engines/mohawk/myst_stacks/makingof.cpp index e639092ed4..b5ad647381 100644 --- a/engines/mohawk/myst_stacks/makingof.cpp +++ b/engines/mohawk/myst_stacks/makingof.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "mohawk/myst.h" diff --git a/engines/mohawk/myst_stacks/makingof.h b/engines/mohawk/myst_stacks/makingof.h index 3033bb851e..d4bc0fd9f2 100644 --- a/engines/mohawk/myst_stacks/makingof.h +++ b/engines/mohawk/myst_stacks/makingof.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef MYST_SCRIPTS_MAKINGOF_H diff --git a/engines/mohawk/myst_stacks/mechanical.cpp b/engines/mohawk/myst_stacks/mechanical.cpp index c5c11026f5..d6dd1b5407 100644 --- a/engines/mohawk/myst_stacks/mechanical.cpp +++ b/engines/mohawk/myst_stacks/mechanical.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "mohawk/cursors.h" @@ -54,11 +51,26 @@ Mechanical::~Mechanical() { void Mechanical::setupOpcodes() { // "Stack-Specific" Opcodes OPCODE(100, o_throneEnablePassage); + OPCODE(101, o_birdCrankStart); + OPCODE(102, NOP); + OPCODE(103, o_birdCrankStop); OPCODE(104, o_snakeBoxTrigger); OPCODE(105, o_fortressStaircaseMovie); OPCODE(106, o_elevatorRotationStart); OPCODE(107, o_elevatorRotationMove); OPCODE(108, o_elevatorRotationStop); + OPCODE(109, o_fortressRotationSpeedStart); + OPCODE(110, o_fortressRotationSpeedMove); + OPCODE(111, o_fortressRotationSpeedStop); + OPCODE(112, o_fortressRotationBrakeStart); + OPCODE(113, o_fortressRotationBrakeMove); + OPCODE(114, o_fortressRotationBrakeStop); + OPCODE(115, o_fortressSimulationSpeedStart); + OPCODE(116, o_fortressSimulationSpeedMove); + OPCODE(117, o_fortressSimulationSpeedStop); + OPCODE(118, o_fortressSimulationBrakeStart); + OPCODE(119, o_fortressSimulationBrakeMove); + OPCODE(120, o_fortressSimulationBrakeStop); OPCODE(121, o_elevatorWindowMovie); OPCODE(122, o_elevatorGoMiddle); OPCODE(123, o_elevatorTopMovie); @@ -75,12 +87,12 @@ void Mechanical::setupOpcodes() { // "Init" Opcodes OPCODE(200, o_throne_init); OPCODE(201, o_fortressStaircase_init); - OPCODE(202, opcode_202); + OPCODE(202, o_bird_init); OPCODE(203, o_snakeBox_init); OPCODE(204, o_elevatorRotation_init); - OPCODE(205, opcode_205); - OPCODE(206, opcode_206); - OPCODE(209, opcode_209); + OPCODE(205, o_fortressRotation_init); + OPCODE(206, o_fortressSimulation_init); + OPCODE(209, o_fortressSimulationStartup_init); // "Exit" Opcodes OPCODE(300, NOP); @@ -89,15 +101,15 @@ void Mechanical::setupOpcodes() { #undef OPCODE void Mechanical::disablePersistentScripts() { - opcode_202_disable(); - opcode_205_disable(); - opcode_206_disable(); - opcode_209_disable(); + _fortressSimulationRunning = false; _elevatorGoingMiddle = false; + _birdSinging = false; + _fortressRotationRunning = false; } void Mechanical::runPersistentScripts() { - opcode_202_run(); + if (_birdSinging) + birdSing_run(); if (_elevatorRotationLeverMoving) elevatorRotation_run(); @@ -105,9 +117,11 @@ void Mechanical::runPersistentScripts() { if (_elevatorGoingMiddle) elevatorGoMiddle_run(); - opcode_205_run(); - opcode_206_run(); - opcode_209_run(); + if (_fortressRotationRunning) + fortressRotation_run(); + + if (_fortressSimulationRunning) + fortressSimulation_run(); } uint16 Mechanical::getVar(uint16 var) { @@ -245,6 +259,38 @@ void Mechanical::o_throneEnablePassage(uint16 op, uint16 var, uint16 argc, uint1 _vm->_resources[argv[0]]->setEnabled(getVar(var)); } +void Mechanical::o_birdCrankStart(uint16 op, uint16 var, uint16 argc, uint16 *argv) { + debugC(kDebugScript, "Opcode %d: Mechanical bird crank start", op); + + MystResourceType11 *crank = static_cast<MystResourceType11 *>(_invokingResource); + + uint16 crankSoundId = crank->getList2(0); + _vm->_sound->replaceSoundMyst(crankSoundId, Audio::Mixer::kMaxChannelVolume, true); + + _birdSingEndTime = 0; + _birdCrankStartTime = _vm->_system->getMillis(); + + MystResourceType6 *crankMovie = static_cast<MystResourceType6 *>(crank->getSubResource(0)); + crankMovie->playMovie(); +} + +void Mechanical::o_birdCrankStop(uint16 op, uint16 var, uint16 argc, uint16 *argv) { + debugC(kDebugScript, "Opcode %d: Mechanical bird crank stop", op); + + MystResourceType11 *crank = static_cast<MystResourceType11 *>(_invokingResource); + + MystResourceType6 *crankMovie = static_cast<MystResourceType6 *>(crank->getSubResource(0)); + crankMovie->pauseMovie(true); + + uint16 crankSoundId = crank->getList2(1); + _vm->_sound->replaceSoundMyst(crankSoundId); + + _birdSingEndTime = 2 * _vm->_system->getMillis() - _birdCrankStartTime; + _birdSinging = true; + + _bird->playMovie(); +} + void Mechanical::o_snakeBoxTrigger(uint16 op, uint16 var, uint16 argc, uint16 *argv) { debugC(kDebugScript, "Opcode %d: Trigger Playing Of Snake Movie", op); @@ -346,6 +392,164 @@ void Mechanical::o_elevatorRotationStop(uint16 op, uint16 var, uint16 argc, uint _vm->checkCursorHints(); } +void Mechanical::o_fortressRotationSpeedStart(uint16 op, uint16 var, uint16 argc, uint16 *argv) { + debugC(kDebugScript, "Opcode %d Fortress rotation speed lever start", op); + + _vm->_cursor->setCursor(700); + + MystResourceType12 *lever = static_cast<MystResourceType12 *>(_invokingResource); + lever->drawFrame(0); +} + +void Mechanical::o_fortressRotationSpeedMove(uint16 op, uint16 var, uint16 argc, uint16 *argv) { + debugC(kDebugScript, "Opcode %d Fortress rotation speed lever move", op); + + const Common::Point &mouse = _vm->_system->getEventManager()->getMousePos(); + MystResourceType12 *lever = static_cast<MystResourceType12 *>(_invokingResource); + + // Make the handle follow the mouse + int16 maxStep = lever->getNumFrames() - 1; + Common::Rect rect = lever->getRect(); + int16 step = ((rect.top + 65 - mouse.y) * lever->getNumFrames()) / 65; + step = CLIP<int16>(step, 0, maxStep); + + _fortressRotationSpeed = step; + + // Draw current frame + lever->drawFrame(step); +} + +void Mechanical::o_fortressRotationSpeedStop(uint16 op, uint16 var, uint16 argc, uint16 *argv) { + debugC(kDebugScript, "Opcode %d Fortress rotation speed lever stop", op); + + MystResourceType12 *lever = static_cast<MystResourceType12 *>(_invokingResource); + + // Release lever + for (int i = _fortressRotationSpeed; i >= 0; i--) { + lever->drawFrame(i); + _vm->_system->delayMillis(10); + } + + _fortressRotationSpeed = 0; + + _vm->checkCursorHints(); +} + +void Mechanical::o_fortressRotationBrakeStart(uint16 op, uint16 var, uint16 argc, uint16 *argv) { + debugC(kDebugScript, "Opcode %d Fortress rotation brake lever start", op); + + _vm->_cursor->setCursor(700); + + MystResourceType12 *lever = static_cast<MystResourceType12 *>(_invokingResource); + lever->drawFrame(_fortressRotationBrake); +} + +void Mechanical::o_fortressRotationBrakeMove(uint16 op, uint16 var, uint16 argc, uint16 *argv) { + debugC(kDebugScript, "Opcode %d Fortress rotation brake lever move", op); + + const Common::Point &mouse = _vm->_system->getEventManager()->getMousePos(); + MystResourceType12 *lever = static_cast<MystResourceType12 *>(_invokingResource); + + // Make the handle follow the mouse + int16 maxStep = lever->getNumFrames() - 1; + Common::Rect rect = lever->getRect(); + int16 step = ((rect.top + 65 - mouse.y) * lever->getNumFrames()) / 65; + step = CLIP<int16>(step, 0, maxStep); + + _fortressRotationBrake = step; + + // Draw current frame + lever->drawFrame(step); +} + +void Mechanical::o_fortressRotationBrakeStop(uint16 op, uint16 var, uint16 argc, uint16 *argv) { + debugC(kDebugScript, "Opcode %d Fortress rotation brake lever stop", op); + + MystResourceType12 *lever = static_cast<MystResourceType12 *>(_invokingResource); + lever->drawFrame(_fortressRotationBrake); + + _vm->checkCursorHints(); +} + +void Mechanical::o_fortressSimulationSpeedStart(uint16 op, uint16 var, uint16 argc, uint16 *argv) { + debugC(kDebugScript, "Opcode %d Fortress rotation simulator speed lever start", op); + + _vm->_cursor->setCursor(700); + + MystResourceType12 *lever = static_cast<MystResourceType12 *>(_invokingResource); + lever->drawFrame(0); +} + +void Mechanical::o_fortressSimulationSpeedMove(uint16 op, uint16 var, uint16 argc, uint16 *argv) { + debugC(kDebugScript, "Opcode %d Fortress rotation simulator speed lever move", op); + + const Common::Point &mouse = _vm->_system->getEventManager()->getMousePos(); + MystResourceType12 *lever = static_cast<MystResourceType12 *>(_invokingResource); + + // Make the handle follow the mouse + int16 maxStep = lever->getNumFrames() - 1; + Common::Rect rect = lever->getRect(); + int16 step = ((rect.bottom - mouse.y) * lever->getNumFrames()) / rect.height(); + step = CLIP<int16>(step, 0, maxStep); + + _fortressSimulationSpeed = step; + + // Draw current frame + lever->drawFrame(step); +} + +void Mechanical::o_fortressSimulationSpeedStop(uint16 op, uint16 var, uint16 argc, uint16 *argv) { + debugC(kDebugScript, "Opcode %d Fortress rotation simulator speed lever stop", op); + + MystResourceType12 *lever = static_cast<MystResourceType12 *>(_invokingResource); + + // Release lever + for (int i = _fortressSimulationSpeed; i >= 0; i--) { + lever->drawFrame(i); + _vm->_system->delayMillis(10); + } + + _fortressSimulationSpeed = 0; + + _vm->checkCursorHints(); +} + +void Mechanical::o_fortressSimulationBrakeStart(uint16 op, uint16 var, uint16 argc, uint16 *argv) { + debugC(kDebugScript, "Opcode %d Fortress rotation simulator brake lever start", op); + + _vm->_cursor->setCursor(700); + + MystResourceType12 *lever = static_cast<MystResourceType12 *>(_invokingResource); + lever->drawFrame(_fortressSimulationBrake); +} + +void Mechanical::o_fortressSimulationBrakeMove(uint16 op, uint16 var, uint16 argc, uint16 *argv) { + debugC(kDebugScript, "Opcode %d Fortress rotation simulator brake lever move", op); + + const Common::Point &mouse = _vm->_system->getEventManager()->getMousePos(); + MystResourceType12 *lever = static_cast<MystResourceType12 *>(_invokingResource); + + // Make the handle follow the mouse + int16 maxStep = lever->getNumFrames() - 1; + Common::Rect rect = lever->getRect(); + int16 step = ((rect.bottom - mouse.y) * lever->getNumFrames()) / rect.height(); + step = CLIP<int16>(step, 0, maxStep); + + _fortressSimulationBrake = step; + + // Draw current frame + lever->drawFrame(step); +} + +void Mechanical::o_fortressSimulationBrakeStop(uint16 op, uint16 var, uint16 argc, uint16 *argv) { + debugC(kDebugScript, "Opcode %d Fortress rotation simulator brake lever stop", op); + + MystResourceType12 *lever = static_cast<MystResourceType12 *>(_invokingResource); + lever->drawFrame(_fortressSimulationBrake); + + _vm->checkCursorHints(); +} + void Mechanical::o_elevatorWindowMovie(uint16 op, uint16 var, uint16 argc, uint16 *argv) { uint16 startTime = argv[0]; uint16 endTime = argv[1]; @@ -515,25 +719,21 @@ void Mechanical::o_fortressStaircase_init(uint16 op, uint16 var, uint16 argc, ui _vm->_resources[argv[2]]->setEnabled(_state.staircaseState); } -static struct { - bool enabled; -} g_opcode202Parameters; - -void Mechanical::opcode_202_run() { +void Mechanical::birdSing_run() { // Used for Card 6220 (Sirrus' Mechanical Bird) - // TODO: Fill in Function + uint32 time = _vm->_system->getMillis(); + if (_birdSingEndTime < time) { + _bird->pauseMovie(true); + _birdSinging = false; + } } -void Mechanical::opcode_202_disable() { - g_opcode202Parameters.enabled = false; -} +void Mechanical::o_bird_init(uint16 op, uint16 var, uint16 argc, uint16 *argv) { + debugC(kDebugScript, "Opcode %d: Mechanical bird init", op); -void Mechanical::opcode_202(uint16 op, uint16 var, uint16 argc, uint16 *argv) { - // Used for Card 6220 (Sirrus' Mechanical Bird) - if (argc == 0) - g_opcode202Parameters.enabled = true; - else - unknown(op, var, argc, argv); + _birdSinging = false; + _birdSingEndTime = 0; + _bird = static_cast<MystResourceType6 *>(_invokingResource); } void Mechanical::o_snakeBox_init(uint16 op, uint16 var, uint16 argc, uint16 *argv) { @@ -567,101 +767,53 @@ void Mechanical::o_elevatorRotation_init(uint16 op, uint16 var, uint16 argc, uin _elevatorRotationLeverMoving = false; } -static struct { - uint16 soundIdPosition[4]; - - bool enabled; -} g_opcode205Parameters; - -void Mechanical::opcode_205_run() { +void Mechanical::fortressRotation_run() { // Used for Card 6156 (Fortress Rotation Controls) // TODO: Fill in function... - // g_opcode205Parameters.soundIdPosition[4] -} - -void Mechanical::opcode_205_disable() { - g_opcode205Parameters.enabled = false; -} - -void Mechanical::opcode_205(uint16 op, uint16 var, uint16 argc, uint16 *argv) { - varUnusedCheck(op, var); - - // Used for Card 6156 (Fortress Rotation Controls) - - if (argc == 4) { - g_opcode205Parameters.soundIdPosition[0] = argv[0]; - g_opcode205Parameters.soundIdPosition[1] = argv[1]; - g_opcode205Parameters.soundIdPosition[2] = argv[2]; - g_opcode205Parameters.soundIdPosition[3] = argv[3]; - - g_opcode205Parameters.enabled = true; - } else - unknown(op, var, argc, argv); } -static struct { - uint16 soundIdStart[2]; - uint16 soundIdPosition[4]; +void Mechanical::o_fortressRotation_init(uint16 op, uint16 var, uint16 argc, uint16 *argv) { + debugC(kDebugScript, "Opcode %d: Fortress rotation init", op); - bool enabled; -} g_opcode206Parameters; + _fortressRotationGears = static_cast<MystResourceType6 *>(_invokingResource); -void Mechanical::opcode_206_run() { - if (g_opcode206Parameters.enabled) { - // Used for Card 6044 (Fortress Rotation Simulator) + _fortressRotationSounds[0] = argv[0]; + _fortressRotationSounds[1] = argv[1]; + _fortressRotationSounds[2] = argv[2]; + _fortressRotationSounds[3] = argv[3]; - // g_opcode206Parameters.soundIdStart[2] - // g_opcode206Parameters.soundIdPosition[4] + _fortressRotationBrake = 0; - // TODO: Fill in function... - } + _fortressRotationRunning = true; } -void Mechanical::opcode_206_disable() { - g_opcode206Parameters.enabled = false; -} - -void Mechanical::opcode_206(uint16 op, uint16 var, uint16 argc, uint16 *argv) { - varUnusedCheck(op, var); - +void Mechanical::fortressSimulation_run() { // Used for Card 6044 (Fortress Rotation Simulator) - if (argc == 6) { - g_opcode206Parameters.soundIdStart[0] = argv[0]; - g_opcode206Parameters.soundIdStart[1] = argv[1]; - g_opcode206Parameters.soundIdPosition[0] = argv[2]; - g_opcode206Parameters.soundIdPosition[1] = argv[3]; - g_opcode206Parameters.soundIdPosition[2] = argv[4]; - g_opcode206Parameters.soundIdPosition[3] = argv[5]; - - g_opcode206Parameters.enabled = true; - } else - unknown(op, var, argc, argv); + // TODO: Fill in function... } +void Mechanical::o_fortressSimulation_init(uint16 op, uint16 var, uint16 argc, uint16 *argv) { + debugC(kDebugScript, "Opcode %d: Fortress rotation simulator init", op); -static struct { - bool enabled; -} g_opcode209Parameters; + _fortressSimulationHolo = static_cast<MystResourceType6 *>(_invokingResource); -void Mechanical::opcode_209_run() { - // Used for Card 6044 (Fortress Rotation Simulator) + _fortressSimulationStartSound1 = argv[0]; + _fortressSimulationStartSound2 = argv[1]; - // TODO: Implement Function For Secret Panel State as - // per Opcode 200 function (Mechanical) -} + _fortressRotationSounds[0] = argv[2]; + _fortressRotationSounds[1] = argv[3]; + _fortressRotationSounds[2] = argv[4]; + _fortressRotationSounds[3] = argv[5]; + + _fortressSimulationBrake = 0; -void Mechanical::opcode_209_disable() { - g_opcode209Parameters.enabled = false; + _fortressSimulationRunning = true; } -void Mechanical::opcode_209(uint16 op, uint16 var, uint16 argc, uint16 *argv) { - varUnusedCheck(op, var); +void Mechanical::o_fortressSimulationStartup_init(uint16 op, uint16 var, uint16 argc, uint16 *argv) { + debugC(kDebugScript, "Opcode %d: Fortress rotation simulator startup init", op); - // Used for Card 6044 (Fortress Rotation Simulator) - if (argc == 0) - g_opcode209Parameters.enabled = true; - else - unknown(op, var, argc, argv); + _fortressSimulationStartup = static_cast<MystResourceType6 *>(_invokingResource); } } // End of namespace MystStacks diff --git a/engines/mohawk/myst_stacks/mechanical.h b/engines/mohawk/myst_stacks/mechanical.h index 6a0aa30f5c..3bd7f2d71b 100644 --- a/engines/mohawk/myst_stacks/mechanical.h +++ b/engines/mohawk/myst_stacks/mechanical.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef MYST_SCRIPTS_MECHANICAL_H @@ -52,23 +49,34 @@ private: void toggleVar(uint16 var); bool setVarValue(uint16 var, uint16 value); - void opcode_202_run(); - void opcode_202_disable(); + virtual uint16 getMap() { return 9931; } + + void birdSing_run(); void elevatorRotation_run(); void elevatorGoMiddle_run(); - void opcode_205_run(); - void opcode_205_disable(); - void opcode_206_run(); - void opcode_206_disable(); - void opcode_209_run(); - void opcode_209_disable(); + void fortressRotation_run(); + void fortressSimulation_run(); DECLARE_OPCODE(o_throneEnablePassage); + DECLARE_OPCODE(o_birdCrankStart); + DECLARE_OPCODE(o_birdCrankStop); DECLARE_OPCODE(o_snakeBoxTrigger); DECLARE_OPCODE(o_fortressStaircaseMovie); DECLARE_OPCODE(o_elevatorRotationStart); DECLARE_OPCODE(o_elevatorRotationMove); DECLARE_OPCODE(o_elevatorRotationStop); + DECLARE_OPCODE(o_fortressRotationSpeedStart); + DECLARE_OPCODE(o_fortressRotationSpeedMove); + DECLARE_OPCODE(o_fortressRotationSpeedStop); + DECLARE_OPCODE(o_fortressRotationBrakeStart); + DECLARE_OPCODE(o_fortressRotationBrakeMove); + DECLARE_OPCODE(o_fortressRotationBrakeStop); + DECLARE_OPCODE(o_fortressSimulationSpeedStart); + DECLARE_OPCODE(o_fortressSimulationSpeedMove); + DECLARE_OPCODE(o_fortressSimulationSpeedStop); + DECLARE_OPCODE(o_fortressSimulationBrakeStart); + DECLARE_OPCODE(o_fortressSimulationBrakeMove); + DECLARE_OPCODE(o_fortressSimulationBrakeStop); DECLARE_OPCODE(o_elevatorWindowMovie); DECLARE_OPCODE(o_elevatorGoMiddle); DECLARE_OPCODE(o_elevatorTopMovie); @@ -84,18 +92,31 @@ private: DECLARE_OPCODE(o_throne_init); DECLARE_OPCODE(o_fortressStaircase_init); - DECLARE_OPCODE(opcode_202); + DECLARE_OPCODE(o_bird_init); DECLARE_OPCODE(o_snakeBox_init); DECLARE_OPCODE(o_elevatorRotation_init); - DECLARE_OPCODE(opcode_205); - DECLARE_OPCODE(opcode_206); - DECLARE_OPCODE(opcode_209); + DECLARE_OPCODE(o_fortressRotation_init); + DECLARE_OPCODE(o_fortressSimulation_init); + DECLARE_OPCODE(o_fortressSimulationStartup_init); MystGameState::Mechanical &_state; bool _mystStaircaseState; // 76 + bool _fortressRotationRunning; + uint16 _fortressRotationSpeed; // 78 + uint16 _fortressRotationBrake; // 80 uint16 _fortressPosition; // 82 + uint16 _fortressRotationSounds[4]; // 86 to 92 + MystResourceType6 *_fortressRotationGears; // 172 + + bool _fortressSimulationRunning; + uint16 _fortressSimulationSpeed; // 96 + uint16 _fortressSimulationBrake; // 98 + uint16 _fortressSimulationStartSound1; // 102 + uint16 _fortressSimulationStartSound2; // 100 + MystResourceType6 *_fortressSimulationHolo; // 160 + MystResourceType6 *_fortressSimulationStartup; // 164 uint16 _elevatorGoingDown; // 112 @@ -113,6 +134,12 @@ private: uint16 _crystalLit; // 130 + bool _birdSinging; // 144 + uint32 _birdCrankStartTime; // 136 + uint32 _birdSingEndTime; // 140 + MystResourceType6 *_bird; // 152 + + MystResourceType6 *_snakeBox; // 156 }; diff --git a/engines/mohawk/myst_stacks/myst.cpp b/engines/mohawk/myst_stacks/myst.cpp index 2b8ef94442..f77ae753d9 100644 --- a/engines/mohawk/myst_stacks/myst.cpp +++ b/engines/mohawk/myst_stacks/myst.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "mohawk/cursors.h" @@ -862,7 +859,6 @@ void Myst::o_fireplaceToggleButton(uint16 op, uint16 var, uint16 argc, uint16 *a for (uint i = 4795; i >= 4779; i--) { _vm->_gfx->copyImageToScreen(i, _invokingResource->getRect()); _vm->_system->updateScreen(); - _vm->_system->delayMillis(1); } _fireplaceLines[var - 17] &= ~bitmask; } else { @@ -870,7 +866,6 @@ void Myst::o_fireplaceToggleButton(uint16 op, uint16 var, uint16 argc, uint16 *a for (uint i = 4779; i <= 4795; i++) { _vm->_gfx->copyImageToScreen(i, _invokingResource->getRect()); _vm->_system->updateScreen(); - _vm->_system->delayMillis(1); } _fireplaceLines[var - 17] |= bitmask; } diff --git a/engines/mohawk/myst_stacks/myst.h b/engines/mohawk/myst_stacks/myst.h index 51dffd0abe..9510d371d7 100644 --- a/engines/mohawk/myst_stacks/myst.h +++ b/engines/mohawk/myst_stacks/myst.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef MYST_SCRIPTS_MYST_H @@ -52,6 +49,8 @@ private: void toggleVar(uint16 var); bool setVarValue(uint16 var, uint16 value); + virtual uint16 getMap() { return 9934; } + void towerRotationMap_run(); void libraryBookcaseTransform_run(); void generatorControlRoom_run(); diff --git a/engines/mohawk/myst_stacks/preview.cpp b/engines/mohawk/myst_stacks/preview.cpp index fddf6290fb..37b749f100 100644 --- a/engines/mohawk/myst_stacks/preview.cpp +++ b/engines/mohawk/myst_stacks/preview.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "mohawk/myst.h" diff --git a/engines/mohawk/myst_stacks/preview.h b/engines/mohawk/myst_stacks/preview.h index 870e4b9272..7e4e418eef 100644 --- a/engines/mohawk/myst_stacks/preview.h +++ b/engines/mohawk/myst_stacks/preview.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef MYST_SCRIPTS_PREVIEW_H diff --git a/engines/mohawk/myst_stacks/selenitic.cpp b/engines/mohawk/myst_stacks/selenitic.cpp index c670cb6a48..1473742259 100644 --- a/engines/mohawk/myst_stacks/selenitic.cpp +++ b/engines/mohawk/myst_stacks/selenitic.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "mohawk/cursors.h" diff --git a/engines/mohawk/myst_stacks/selenitic.h b/engines/mohawk/myst_stacks/selenitic.h index 4ec92b9869..d314c4d810 100644 --- a/engines/mohawk/myst_stacks/selenitic.h +++ b/engines/mohawk/myst_stacks/selenitic.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef MYST_SCRIPTS_SELENITIC_H @@ -53,6 +50,8 @@ private: void toggleVar(uint16 var); bool setVarValue(uint16 var, uint16 value); + virtual uint16 getMap() { return 9930; } + DECLARE_OPCODE(o_mazeRunnerMove); DECLARE_OPCODE(o_mazeRunnerSoundRepeat); DECLARE_OPCODE(o_soundReceiverSigma); diff --git a/engines/mohawk/myst_stacks/slides.cpp b/engines/mohawk/myst_stacks/slides.cpp index 4057edd9c9..72b299ee6d 100644 --- a/engines/mohawk/myst_stacks/slides.cpp +++ b/engines/mohawk/myst_stacks/slides.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "mohawk/myst.h" diff --git a/engines/mohawk/myst_stacks/slides.h b/engines/mohawk/myst_stacks/slides.h index 1e0504a665..8bc61d0e24 100644 --- a/engines/mohawk/myst_stacks/slides.h +++ b/engines/mohawk/myst_stacks/slides.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef MYST_SCRIPTS_SLIDES_H diff --git a/engines/mohawk/myst_stacks/stoneship.cpp b/engines/mohawk/myst_stacks/stoneship.cpp index 07701c273e..e0c374a926 100644 --- a/engines/mohawk/myst_stacks/stoneship.cpp +++ b/engines/mohawk/myst_stacks/stoneship.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "mohawk/cursors.h" diff --git a/engines/mohawk/myst_stacks/stoneship.h b/engines/mohawk/myst_stacks/stoneship.h index 091fdcd169..4125412b4d 100644 --- a/engines/mohawk/myst_stacks/stoneship.h +++ b/engines/mohawk/myst_stacks/stoneship.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef MYST_SCRIPTS_STONESHIP_H @@ -52,6 +49,8 @@ private: void toggleVar(uint16 var); bool setVarValue(uint16 var, uint16 value); + virtual uint16 getMap() { return 9933; } + DECLARE_OPCODE(o_pumpTurnOff); DECLARE_OPCODE(o_brotherDoorOpen); DECLARE_OPCODE(o_cabinBookMovie); diff --git a/engines/mohawk/myst_state.cpp b/engines/mohawk/myst_state.cpp index de71dcf382..bab4b8dd51 100644 --- a/engines/mohawk/myst_state.cpp +++ b/engines/mohawk/myst_state.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "mohawk/cursors.h" @@ -103,6 +100,9 @@ bool MystGameState::load(const Common::String &filename) { syncGameState(s, size == 664); delete loadFile; + // Switch us back to the intro stack, to the linking book + _vm->changeToStack(kIntroStack, 5, 0, 0); + // Set our default cursor if (_globals.heldPage == 0 || _globals.heldPage > 13) _vm->setMainCursor(kDefaultMystCursor); @@ -113,9 +113,6 @@ bool MystGameState::load(const Common::String &filename) { else // if (globals.heldPage == 13) _vm->setMainCursor(kWhitePageCursor); - // Switch us back to the intro stack, to the linking book - _vm->changeToStack(kIntroStack, 5, 0, 0); - return true; } diff --git a/engines/mohawk/myst_state.h b/engines/mohawk/myst_state.h index 074c3e5f10..c7a6c0b4ac 100644 --- a/engines/mohawk/myst_state.h +++ b/engines/mohawk/myst_state.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef MYST_SAVELOAD_H diff --git a/engines/mohawk/resource.cpp b/engines/mohawk/resource.cpp index 62250b75f2..3a95b83199 100644 --- a/engines/mohawk/resource.cpp +++ b/engines/mohawk/resource.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "mohawk/resource.h" diff --git a/engines/mohawk/resource.h b/engines/mohawk/resource.h index 07c727951c..cabce04e38 100644 --- a/engines/mohawk/resource.h +++ b/engines/mohawk/resource.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/scummsys.h" diff --git a/engines/mohawk/resource_cache.cpp b/engines/mohawk/resource_cache.cpp index 75f608f5fd..e73d8c43d3 100644 --- a/engines/mohawk/resource_cache.cpp +++ b/engines/mohawk/resource_cache.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/debug.h" diff --git a/engines/mohawk/resource_cache.h b/engines/mohawk/resource_cache.h index 32e345cf4b..b7eac9ebd7 100644 --- a/engines/mohawk/resource_cache.h +++ b/engines/mohawk/resource_cache.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef RESOURCE_CACHE_H diff --git a/engines/mohawk/riven.cpp b/engines/mohawk/riven.cpp index 3d496d0f38..f407e650f6 100644 --- a/engines/mohawk/riven.cpp +++ b/engines/mohawk/riven.cpp @@ -18,16 +18,13 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/config-manager.h" #include "common/events.h" -#include "common/EventRecorder.h" #include "common/keyboard.h" #include "common/translation.h" +#include "common/system.h" #include "mohawk/cursors.h" #include "mohawk/graphics.h" @@ -121,8 +118,7 @@ Common::Error MohawkEngine_Riven::run() { _optionsDialog = new RivenOptionsDialog(this); _scriptMan = new RivenScriptManager(this); - _rnd = new Common::RandomSource(); - g_eventRec.registerRandomSource(*_rnd, "riven"); + _rnd = new Common::RandomSource("riven"); // Create the cursor manager if (Common::File::exists("rivendmo.exe")) diff --git a/engines/mohawk/riven.h b/engines/mohawk/riven.h index 3aba5643db..e01e03895c 100644 --- a/engines/mohawk/riven.h +++ b/engines/mohawk/riven.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef MOHAWK_RIVEN_H diff --git a/engines/mohawk/riven_external.cpp b/engines/mohawk/riven_external.cpp index dc0d66f19b..8ad05ded13 100644 --- a/engines/mohawk/riven_external.cpp +++ b/engines/mohawk/riven_external.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "mohawk/cursors.h" diff --git a/engines/mohawk/riven_external.h b/engines/mohawk/riven_external.h index 034cd662f6..5f5d0cb0b2 100644 --- a/engines/mohawk/riven_external.h +++ b/engines/mohawk/riven_external.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef RIVEN_EXTERNAL_H diff --git a/engines/mohawk/riven_saveload.cpp b/engines/mohawk/riven_saveload.cpp index 35ce7aad84..35d82d4aa0 100644 --- a/engines/mohawk/riven_saveload.cpp +++ b/engines/mohawk/riven_saveload.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "mohawk/resource.h" diff --git a/engines/mohawk/riven_saveload.h b/engines/mohawk/riven_saveload.h index fbd9f7cb36..c1b3fc639e 100644 --- a/engines/mohawk/riven_saveload.h +++ b/engines/mohawk/riven_saveload.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef MOHAWK_SAVELOAD_H diff --git a/engines/mohawk/riven_scripts.cpp b/engines/mohawk/riven_scripts.cpp index b8f86f993a..b3d5369a84 100644 --- a/engines/mohawk/riven_scripts.cpp +++ b/engines/mohawk/riven_scripts.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "mohawk/cursors.h" diff --git a/engines/mohawk/riven_scripts.h b/engines/mohawk/riven_scripts.h index 2ac805c366..75d4592e55 100644 --- a/engines/mohawk/riven_scripts.h +++ b/engines/mohawk/riven_scripts.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef RIVEN_SCRIPTS_H diff --git a/engines/mohawk/riven_vars.cpp b/engines/mohawk/riven_vars.cpp index 7f06a67a1d..946e2e0496 100644 --- a/engines/mohawk/riven_vars.cpp +++ b/engines/mohawk/riven_vars.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/str.h" diff --git a/engines/mohawk/sound.cpp b/engines/mohawk/sound.cpp index fba87808d2..6144c89e21 100644 --- a/engines/mohawk/sound.cpp +++ b/engines/mohawk/sound.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "mohawk/sound.h" @@ -619,9 +616,16 @@ Audio::SoundHandle *Sound::replaceBackgroundMyst(uint16 id, uint16 volume) { Common::String name = _vm->getResourceName(ID_MSND, convertMystID(id)); + // Only the first eight characters need to be the same to have a match + Common::String prefix; + if (name.size() >= 8) + prefix = Common::String(name.c_str(), name.c_str() + 8); + else + prefix = name; + // Check if sound is already playing if (_mystBackgroundSound.type == kUsedHandle && _vm->_mixer->isSoundHandleActive(_mystBackgroundSound.handle) - && name.equals(_vm->getResourceName(ID_MSND, convertMystID(_mystBackgroundSound.id)))) + && _vm->getResourceName(ID_MSND, convertMystID(_mystBackgroundSound.id)).hasPrefix(prefix)) return &_mystBackgroundSound.handle; // Stop old background sound diff --git a/engines/mohawk/sound.h b/engines/mohawk/sound.h index 702c6f61f3..593f2fcd0b 100644 --- a/engines/mohawk/sound.h +++ b/engines/mohawk/sound.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef MOHAWK_SOUND_H diff --git a/engines/mohawk/video.cpp b/engines/mohawk/video.cpp index 8f57d61cc4..0a74d058c9 100644 --- a/engines/mohawk/video.cpp +++ b/engines/mohawk/video.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "mohawk/mohawk.h" diff --git a/engines/mohawk/video.h b/engines/mohawk/video.h index e65629a1ec..efa81edfbd 100644 --- a/engines/mohawk/video.h +++ b/engines/mohawk/video.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef MOHAWK_VIDEO_H diff --git a/engines/mohawk/view.cpp b/engines/mohawk/view.cpp index e5a44122ea..36e8f8466e 100644 --- a/engines/mohawk/view.cpp +++ b/engines/mohawk/view.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "mohawk/view.h" diff --git a/engines/mohawk/view.h b/engines/mohawk/view.h index 14a47eebe4..06ffe605a3 100644 --- a/engines/mohawk/view.h +++ b/engines/mohawk/view.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef MOHAWK_VIEW_H diff --git a/engines/parallaction/balloons.cpp b/engines/parallaction/balloons.cpp index 2cf6eebf2a..f74eef18e1 100644 --- a/engines/parallaction/balloons.cpp +++ b/engines/parallaction/balloons.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "parallaction/graphics.h" diff --git a/engines/parallaction/callables_br.cpp b/engines/parallaction/callables_br.cpp index 0bc6f6762c..ac5ff88560 100644 --- a/engines/parallaction/callables_br.cpp +++ b/engines/parallaction/callables_br.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "parallaction/parallaction.h" diff --git a/engines/parallaction/callables_ns.cpp b/engines/parallaction/callables_ns.cpp index cfe6ad8954..77f54fcc98 100644 --- a/engines/parallaction/callables_ns.cpp +++ b/engines/parallaction/callables_ns.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ diff --git a/engines/parallaction/debug.cpp b/engines/parallaction/debug.cpp index bebbab968b..72f26cb6b9 100644 --- a/engines/parallaction/debug.cpp +++ b/engines/parallaction/debug.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ diff --git a/engines/parallaction/detection.cpp b/engines/parallaction/detection.cpp index 8e3c2cbeb8..c3719bcd51 100644 --- a/engines/parallaction/detection.cpp +++ b/engines/parallaction/detection.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "base/plugins.h" @@ -253,7 +250,7 @@ public: ParallactionMetaEngine() : AdvancedMetaEngine(detectionParams) {} virtual const char *getName() const { - return "Parallaction engine"; + return "Parallaction"; } virtual const char *getOriginalCopyright() const { diff --git a/engines/parallaction/dialogue.cpp b/engines/parallaction/dialogue.cpp index 944d9f4b55..880d41a8a3 100644 --- a/engines/parallaction/dialogue.cpp +++ b/engines/parallaction/dialogue.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/events.h" diff --git a/engines/parallaction/disk.cpp b/engines/parallaction/disk.cpp index d996b72e90..61172d0896 100644 --- a/engines/parallaction/disk.cpp +++ b/engines/parallaction/disk.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/iff_container.h" diff --git a/engines/parallaction/disk.h b/engines/parallaction/disk.h index 9af189af68..d1171c3179 100644 --- a/engines/parallaction/disk.h +++ b/engines/parallaction/disk.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef PARALLACTION_DISK_H diff --git a/engines/parallaction/disk_br.cpp b/engines/parallaction/disk_br.cpp index cea4091ee9..f9e368ab39 100644 --- a/engines/parallaction/disk_br.cpp +++ b/engines/parallaction/disk_br.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "graphics/iff.h" diff --git a/engines/parallaction/disk_ns.cpp b/engines/parallaction/disk_ns.cpp index e695fa8798..05ea60f510 100644 --- a/engines/parallaction/disk_ns.cpp +++ b/engines/parallaction/disk_ns.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/config-manager.h" diff --git a/engines/parallaction/exec.cpp b/engines/parallaction/exec.cpp index 434c4f6ae6..8594d02641 100644 --- a/engines/parallaction/exec.cpp +++ b/engines/parallaction/exec.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "parallaction/exec.h" diff --git a/engines/parallaction/exec.h b/engines/parallaction/exec.h index df642e0fed..4ca3947514 100644 --- a/engines/parallaction/exec.h +++ b/engines/parallaction/exec.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ diff --git a/engines/parallaction/exec_br.cpp b/engines/parallaction/exec_br.cpp index c879745f65..0ec1675c48 100644 --- a/engines/parallaction/exec_br.cpp +++ b/engines/parallaction/exec_br.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "parallaction/exec.h" diff --git a/engines/parallaction/exec_ns.cpp b/engines/parallaction/exec_ns.cpp index ee357576d2..d8fbdea971 100644 --- a/engines/parallaction/exec_ns.cpp +++ b/engines/parallaction/exec_ns.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "parallaction/exec.h" diff --git a/engines/parallaction/font.cpp b/engines/parallaction/font.cpp index a459e6a600..cc7f320e1c 100644 --- a/engines/parallaction/font.cpp +++ b/engines/parallaction/font.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/endian.h" diff --git a/engines/parallaction/gfxbase.cpp b/engines/parallaction/gfxbase.cpp index ca99624ecd..24544f46dd 100644 --- a/engines/parallaction/gfxbase.cpp +++ b/engines/parallaction/gfxbase.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ diff --git a/engines/parallaction/graphics.cpp b/engines/parallaction/graphics.cpp index d33e733677..cf0cf13333 100644 --- a/engines/parallaction/graphics.cpp +++ b/engines/parallaction/graphics.cpp @@ -19,9 +19,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/system.h" diff --git a/engines/parallaction/graphics.h b/engines/parallaction/graphics.h index d6732e6fe4..2f86f3693b 100644 --- a/engines/parallaction/graphics.h +++ b/engines/parallaction/graphics.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef PARALLACTION_GRAPHICS_H diff --git a/engines/parallaction/gui.cpp b/engines/parallaction/gui.cpp index db70ebb432..aa9c29ac57 100644 --- a/engines/parallaction/gui.cpp +++ b/engines/parallaction/gui.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/textconsole.h" diff --git a/engines/parallaction/gui.h b/engines/parallaction/gui.h index dc6d1bc71b..95c5653220 100644 --- a/engines/parallaction/gui.h +++ b/engines/parallaction/gui.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef PARALLACTION_GUI_H diff --git a/engines/parallaction/gui_br.cpp b/engines/parallaction/gui_br.cpp index 41e3082464..c520ad4f25 100644 --- a/engines/parallaction/gui_br.cpp +++ b/engines/parallaction/gui_br.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/system.h" diff --git a/engines/parallaction/gui_ns.cpp b/engines/parallaction/gui_ns.cpp index 6b863cc808..ef1a8a6e7e 100644 --- a/engines/parallaction/gui_ns.cpp +++ b/engines/parallaction/gui_ns.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/system.h" diff --git a/engines/parallaction/input.cpp b/engines/parallaction/input.cpp index 3a47b14deb..453bf9849d 100644 --- a/engines/parallaction/input.cpp +++ b/engines/parallaction/input.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/events.h" diff --git a/engines/parallaction/input.h b/engines/parallaction/input.h index 77adf7e74e..a815469ec3 100644 --- a/engines/parallaction/input.h +++ b/engines/parallaction/input.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef PARALLACTION_INPUT_H diff --git a/engines/parallaction/inventory.cpp b/engines/parallaction/inventory.cpp index 2412cc6445..8fd9f56802 100644 --- a/engines/parallaction/inventory.cpp +++ b/engines/parallaction/inventory.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "parallaction/input.h" diff --git a/engines/parallaction/inventory.h b/engines/parallaction/inventory.h index e4bb935672..91c06d1e93 100644 --- a/engines/parallaction/inventory.h +++ b/engines/parallaction/inventory.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef PARALLACTION_INVENTORY_H diff --git a/engines/parallaction/objects.cpp b/engines/parallaction/objects.cpp index e1306dc956..3750602076 100644 --- a/engines/parallaction/objects.cpp +++ b/engines/parallaction/objects.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/textconsole.h" diff --git a/engines/parallaction/objects.h b/engines/parallaction/objects.h index 5260dcbfe8..387e7af088 100644 --- a/engines/parallaction/objects.h +++ b/engines/parallaction/objects.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef PARALLACTION_ZONE_H diff --git a/engines/parallaction/parallaction.cpp b/engines/parallaction/parallaction.cpp index 516d465671..9bbc7d0c57 100644 --- a/engines/parallaction/parallaction.cpp +++ b/engines/parallaction/parallaction.cpp @@ -18,13 +18,9 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/debug-channels.h" -#include "common/EventRecorder.h" #include "common/system.h" #include "common/textconsole.h" @@ -48,7 +44,7 @@ uint32 _globalFlags = 0; Parallaction::Parallaction(OSystem *syst, const PARALLACTIONGameDescription *gameDesc) : Engine(syst), _gameDescription(gameDesc), _location(getGameType()), - _dialogueMan(0) { + _dialogueMan(0), _rnd("parallaction") { // Setup mixer syncSoundSettings(); @@ -63,8 +59,6 @@ Parallaction::Parallaction(OSystem *syst, const PARALLACTIONGameDescription *gam DebugMan.addDebugChannel(kDebugAudio, "audio", "Audio debug level"); DebugMan.addDebugChannel(kDebugMenu, "menu", "Menu debug level"); DebugMan.addDebugChannel(kDebugInventory, "inventory", "Inventory debug level"); - - g_eventRec.registerRandomSource(_rnd, "parallaction"); } Parallaction::~Parallaction() { diff --git a/engines/parallaction/parallaction.h b/engines/parallaction/parallaction.h index b0b1145d2e..5554eff3c5 100644 --- a/engines/parallaction/parallaction.h +++ b/engines/parallaction/parallaction.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef PARALLACTION_H diff --git a/engines/parallaction/parallaction_br.cpp b/engines/parallaction/parallaction_br.cpp index ca344792cf..44a8899304 100644 --- a/engines/parallaction/parallaction_br.cpp +++ b/engines/parallaction/parallaction_br.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/system.h" diff --git a/engines/parallaction/parallaction_ns.cpp b/engines/parallaction/parallaction_ns.cpp index ffc0412b1d..64cf1b437d 100644 --- a/engines/parallaction/parallaction_ns.cpp +++ b/engines/parallaction/parallaction_ns.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/system.h" diff --git a/engines/parallaction/parser.cpp b/engines/parallaction/parser.cpp index a7b926e485..5d61c2988c 100644 --- a/engines/parallaction/parser.cpp +++ b/engines/parallaction/parser.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/textconsole.h" diff --git a/engines/parallaction/parser.h b/engines/parallaction/parser.h index 812cf6f7c3..1cf8e2f7ff 100644 --- a/engines/parallaction/parser.h +++ b/engines/parallaction/parser.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef PARALLACTION_PARSER_H diff --git a/engines/parallaction/parser_br.cpp b/engines/parallaction/parser_br.cpp index f8818def9a..e4be53022e 100644 --- a/engines/parallaction/parser_br.cpp +++ b/engines/parallaction/parser_br.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/textconsole.h" diff --git a/engines/parallaction/parser_ns.cpp b/engines/parallaction/parser_ns.cpp index 6c9afe3d85..69763affc8 100644 --- a/engines/parallaction/parser_ns.cpp +++ b/engines/parallaction/parser_ns.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/textconsole.h" diff --git a/engines/parallaction/saveload.cpp b/engines/parallaction/saveload.cpp index 4c77aa3e02..673c613485 100644 --- a/engines/parallaction/saveload.cpp +++ b/engines/parallaction/saveload.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/savefile.h" diff --git a/engines/parallaction/saveload.h b/engines/parallaction/saveload.h index a8f1697a9d..3976ee1290 100644 --- a/engines/parallaction/saveload.h +++ b/engines/parallaction/saveload.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef PARALLACTION_SAVELOAD_H diff --git a/engines/parallaction/sound.h b/engines/parallaction/sound.h index 455189d1fc..baca5a7213 100644 --- a/engines/parallaction/sound.h +++ b/engines/parallaction/sound.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef PARALLACTION_MUSIC_H diff --git a/engines/parallaction/sound_br.cpp b/engines/parallaction/sound_br.cpp index abfaa4bf5d..16ffd24a82 100644 --- a/engines/parallaction/sound_br.cpp +++ b/engines/parallaction/sound_br.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/stream.h" diff --git a/engines/parallaction/sound_ns.cpp b/engines/parallaction/sound_ns.cpp index 5123695ebc..917d310738 100644 --- a/engines/parallaction/sound_ns.cpp +++ b/engines/parallaction/sound_ns.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/file.h" diff --git a/engines/parallaction/staticres.cpp b/engines/parallaction/staticres.cpp index 84db3af9a4..73e78cae3c 100644 --- a/engines/parallaction/staticres.cpp +++ b/engines/parallaction/staticres.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ diff --git a/engines/parallaction/walk.cpp b/engines/parallaction/walk.cpp index 3084707ba8..21ee5ee5d9 100644 --- a/engines/parallaction/walk.cpp +++ b/engines/parallaction/walk.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "parallaction/exec.h" diff --git a/engines/parallaction/walk.h b/engines/parallaction/walk.h index 655c476106..6796991f9d 100644 --- a/engines/parallaction/walk.h +++ b/engines/parallaction/walk.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef PARALLACTION_WALK_H diff --git a/engines/queen/bankman.cpp b/engines/queen/bankman.cpp index 69329efa51..ea823773dc 100644 --- a/engines/queen/bankman.cpp +++ b/engines/queen/bankman.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ diff --git a/engines/queen/bankman.h b/engines/queen/bankman.h index ad9610e93b..9e1e726fbf 100644 --- a/engines/queen/bankman.h +++ b/engines/queen/bankman.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef QUEEN_BANKMAN_H diff --git a/engines/queen/command.cpp b/engines/queen/command.cpp index 87b24735a8..4f86d1f7ec 100644 --- a/engines/queen/command.cpp +++ b/engines/queen/command.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ diff --git a/engines/queen/command.h b/engines/queen/command.h index 5d2f91d9a9..772d6cb0f1 100644 --- a/engines/queen/command.h +++ b/engines/queen/command.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef QUEEN_COMMAND_H diff --git a/engines/queen/credits.cpp b/engines/queen/credits.cpp index 029ed7d0a8..d503562601 100644 --- a/engines/queen/credits.cpp +++ b/engines/queen/credits.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ diff --git a/engines/queen/credits.h b/engines/queen/credits.h index 059c651ca7..b89d029a59 100644 --- a/engines/queen/credits.h +++ b/engines/queen/credits.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef QUEEN_CREDITS_H diff --git a/engines/queen/cutaway.cpp b/engines/queen/cutaway.cpp index 6fb48c7fb0..70d8252299 100644 --- a/engines/queen/cutaway.cpp +++ b/engines/queen/cutaway.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/textconsole.h" diff --git a/engines/queen/cutaway.h b/engines/queen/cutaway.h index c395aa4fa2..a7e3646a59 100644 --- a/engines/queen/cutaway.h +++ b/engines/queen/cutaway.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef QUEEN_CUTAWAY_H diff --git a/engines/queen/debug.cpp b/engines/queen/debug.cpp index a7cf70fbb2..d09c5d4469 100644 --- a/engines/queen/debug.cpp +++ b/engines/queen/debug.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/scummsys.h" diff --git a/engines/queen/debug.h b/engines/queen/debug.h index 9b08ce83e8..01da4a35d6 100644 --- a/engines/queen/debug.h +++ b/engines/queen/debug.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef QUEEN_DEBUG_H diff --git a/engines/queen/defs.h b/engines/queen/defs.h index 5b3475d400..3d06485ef5 100644 --- a/engines/queen/defs.h +++ b/engines/queen/defs.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef QUEEN_DEFS_H diff --git a/engines/queen/display.cpp b/engines/queen/display.cpp index c78fd8ebcc..83dc1a9f60 100644 --- a/engines/queen/display.cpp +++ b/engines/queen/display.cpp @@ -18,14 +18,10 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/system.h" -#include "common/EventRecorder.h" #include "common/events.h" #include "graphics/cursorman.h" @@ -41,7 +37,7 @@ namespace Queen { Display::Display(QueenEngine *vm, OSystem *system) : _fullscreen(true), _horizontalScroll(0), _bdWidth(0), _bdHeight(0), - _system(system), _vm(vm) { + _system(system), _vm(vm), _rnd("queenDisplay") { initFont(); @@ -76,7 +72,6 @@ Display::Display(QueenEngine *vm, OSystem *system) memset(&_dynalum, 0, sizeof(_dynalum)); setupInkColors(); - g_eventRec.registerRandomSource(_rnd, "queenDisplay"); } Display::~Display() { diff --git a/engines/queen/display.h b/engines/queen/display.h index e7a2ecd4a1..ffb4479426 100644 --- a/engines/queen/display.h +++ b/engines/queen/display.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef QUEEN_DISPLAY_H diff --git a/engines/queen/graphics.cpp b/engines/queen/graphics.cpp index c86f679765..d9a8a10d70 100644 --- a/engines/queen/graphics.cpp +++ b/engines/queen/graphics.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ diff --git a/engines/queen/graphics.h b/engines/queen/graphics.h index ad9a728cfe..9c719ba22c 100644 --- a/engines/queen/graphics.h +++ b/engines/queen/graphics.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef QUEEN_GRAPHICS_H diff --git a/engines/queen/grid.cpp b/engines/queen/grid.cpp index 306b32bc8b..82b98c0150 100644 --- a/engines/queen/grid.cpp +++ b/engines/queen/grid.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ diff --git a/engines/queen/grid.h b/engines/queen/grid.h index 7003311a98..f905e3f4fe 100644 --- a/engines/queen/grid.h +++ b/engines/queen/grid.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef QUEEN_GRID_H diff --git a/engines/queen/input.cpp b/engines/queen/input.cpp index eac855a0cd..5a04b0f8a4 100644 --- a/engines/queen/input.cpp +++ b/engines/queen/input.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ diff --git a/engines/queen/input.h b/engines/queen/input.h index 43a57729c6..93e2bde638 100644 --- a/engines/queen/input.h +++ b/engines/queen/input.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef QUEEN_INPUT_H diff --git a/engines/queen/journal.cpp b/engines/queen/journal.cpp index 4200168f07..704019641b 100644 --- a/engines/queen/journal.cpp +++ b/engines/queen/journal.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ diff --git a/engines/queen/journal.h b/engines/queen/journal.h index 123299c6e9..a9b9ccb2b8 100644 --- a/engines/queen/journal.h +++ b/engines/queen/journal.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef QUEEN_JOURNAL_H diff --git a/engines/queen/logic.cpp b/engines/queen/logic.cpp index e99a739726..db496bee39 100644 --- a/engines/queen/logic.cpp +++ b/engines/queen/logic.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ diff --git a/engines/queen/logic.h b/engines/queen/logic.h index e6924b3e41..608c19e71e 100644 --- a/engines/queen/logic.h +++ b/engines/queen/logic.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef QUEEN_LOGIC_H diff --git a/engines/queen/midiadlib.cpp b/engines/queen/midiadlib.cpp index af52f7ed2b..83853cba92 100644 --- a/engines/queen/midiadlib.cpp +++ b/engines/queen/midiadlib.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/endian.h" diff --git a/engines/queen/music.cpp b/engines/queen/music.cpp index 58ecfa6d16..858692703c 100644 --- a/engines/queen/music.cpp +++ b/engines/queen/music.cpp @@ -18,14 +18,10 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/config-manager.h" #include "common/events.h" -#include "common/EventRecorder.h" #include "queen/music.h" #include "queen/queen.h" @@ -40,7 +36,9 @@ namespace Queen { extern MidiDriver *C_Player_CreateAdLibMidiDriver(Audio::Mixer *); MidiMusic::MidiMusic(QueenEngine *vm) - : _isPlaying(false), _isLooping(false), _randomLoop(false), _masterVolume(192), _buf(0) { + : _isPlaying(false), _isLooping(false), + _randomLoop(false), _masterVolume(192), + _buf(0), _rnd("queenMusic") { memset(_channelsTable, 0, sizeof(_channelsTable)); _queuePos = _lastSong = _currentSong = 0; @@ -92,15 +90,13 @@ MidiMusic::MidiMusic(QueenEngine *vm) _parser = MidiParser::createParser_SMF(); _parser->setMidiDriver(this); _parser->setTimerRate(_driver->getBaseTempo()); - - g_eventRec.registerRandomSource(_rnd, "queenMusic"); } MidiMusic::~MidiMusic() { _driver->setTimerCallback(0, 0); _parser->unloadMusic(); - _driver->close(); delete _parser; + _driver->close(); delete _driver; delete[] _buf; delete[] _musicData; diff --git a/engines/queen/music.h b/engines/queen/music.h index 3e8fc585ca..ea6affcbe5 100644 --- a/engines/queen/music.h +++ b/engines/queen/music.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef QUEEN_MUSIC_H diff --git a/engines/queen/musicdata.cpp b/engines/queen/musicdata.cpp index 865f4cd21d..afcc54d2e6 100644 --- a/engines/queen/musicdata.cpp +++ b/engines/queen/musicdata.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ diff --git a/engines/queen/queen.cpp b/engines/queen/queen.cpp index 0dde5c7b42..97f757c418 100644 --- a/engines/queen/queen.cpp +++ b/engines/queen/queen.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "base/plugins.h" @@ -31,7 +28,6 @@ #include "common/savefile.h" #include "common/system.h" #include "common/events.h" -#include "common/EventRecorder.h" #include "common/textconsole.h" #include "engines/util.h" @@ -196,8 +192,7 @@ Common::Error QueenMetaEngine::createInstance(OSystem *syst, Engine **engine) co namespace Queen { QueenEngine::QueenEngine(OSystem *syst) - : Engine(syst), _debugger(0) { - g_eventRec.registerRandomSource(randomizer, "queen"); + : Engine(syst), _debugger(0), randomizer("queen") { } QueenEngine::~QueenEngine() { diff --git a/engines/queen/queen.h b/engines/queen/queen.h index 6098a9f5c2..5affe8e01a 100644 --- a/engines/queen/queen.h +++ b/engines/queen/queen.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef QUEEN_H diff --git a/engines/queen/resource.cpp b/engines/queen/resource.cpp index 62b13e290c..d837a63cb5 100644 --- a/engines/queen/resource.cpp +++ b/engines/queen/resource.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/debug.h" diff --git a/engines/queen/resource.h b/engines/queen/resource.h index 63720a0755..5c6746e92f 100644 --- a/engines/queen/resource.h +++ b/engines/queen/resource.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef QUEEN_RESOURCE_H diff --git a/engines/queen/restables.cpp b/engines/queen/restables.cpp index d4c30c7bea..bc828164b0 100644 --- a/engines/queen/restables.cpp +++ b/engines/queen/restables.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "queen/resource.h" diff --git a/engines/queen/sound.cpp b/engines/queen/sound.cpp index afb77f3969..ac58dda728 100644 --- a/engines/queen/sound.cpp +++ b/engines/queen/sound.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ diff --git a/engines/queen/sound.h b/engines/queen/sound.h index a89e345791..2aabb0d73b 100644 --- a/engines/queen/sound.h +++ b/engines/queen/sound.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef QUEEN_SOUND_H diff --git a/engines/queen/state.cpp b/engines/queen/state.cpp index 4dcf7a8cd1..a07e68045b 100644 --- a/engines/queen/state.cpp +++ b/engines/queen/state.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ diff --git a/engines/queen/state.h b/engines/queen/state.h index bdf5e6da51..1a6725c800 100644 --- a/engines/queen/state.h +++ b/engines/queen/state.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef QUEEN_STATE_H diff --git a/engines/queen/structs.h b/engines/queen/structs.h index 6b852aaa9c..b0a26ed4ba 100644 --- a/engines/queen/structs.h +++ b/engines/queen/structs.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef QUEEN_STRUCTS_H diff --git a/engines/queen/talk.cpp b/engines/queen/talk.cpp index 18c712b799..b83bf60435 100644 --- a/engines/queen/talk.cpp +++ b/engines/queen/talk.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ diff --git a/engines/queen/talk.h b/engines/queen/talk.h index 036dfadbcd..68196784b1 100644 --- a/engines/queen/talk.h +++ b/engines/queen/talk.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef QUEEN_TALK_H diff --git a/engines/queen/walk.cpp b/engines/queen/walk.cpp index a778ea5b05..c5cfbb7d5f 100644 --- a/engines/queen/walk.cpp +++ b/engines/queen/walk.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/textconsole.h" diff --git a/engines/queen/walk.h b/engines/queen/walk.h index 0f746213ab..e5257b7afa 100644 --- a/engines/queen/walk.h +++ b/engines/queen/walk.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef QUEEN_WALK_H diff --git a/engines/saga/actor.cpp b/engines/saga/actor.cpp index 8e2ce4fcc6..86606855e3 100644 --- a/engines/saga/actor.cpp +++ b/engines/saga/actor.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "saga/saga.h" diff --git a/engines/saga/actor.h b/engines/saga/actor.h index 01feacb75b..451497986d 100644 --- a/engines/saga/actor.h +++ b/engines/saga/actor.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ // Actor management module header file diff --git a/engines/saga/actor_path.cpp b/engines/saga/actor_path.cpp index df117841f3..3e10aba6b6 100644 --- a/engines/saga/actor_path.cpp +++ b/engines/saga/actor_path.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "saga/saga.h" diff --git a/engines/saga/actor_walk.cpp b/engines/saga/actor_walk.cpp index 6aabf27311..5607fcdd66 100644 --- a/engines/saga/actor_walk.cpp +++ b/engines/saga/actor_walk.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "saga/saga.h" diff --git a/engines/saga/animation.cpp b/engines/saga/animation.cpp index 4aee111aa7..7ec4a59398 100644 --- a/engines/saga/animation.cpp +++ b/engines/saga/animation.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ // Background animation management module diff --git a/engines/saga/animation.h b/engines/saga/animation.h index c27909115e..2c42cb7253 100644 --- a/engines/saga/animation.h +++ b/engines/saga/animation.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ // Background animation management module private header diff --git a/engines/saga/console.cpp b/engines/saga/console.cpp index 228febfe9c..771925a321 100644 --- a/engines/saga/console.cpp +++ b/engines/saga/console.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ // Console module diff --git a/engines/saga/console.h b/engines/saga/console.h index c2e563e019..b93638467b 100644 --- a/engines/saga/console.h +++ b/engines/saga/console.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ // Console module header file diff --git a/engines/saga/detection.cpp b/engines/saga/detection.cpp index b1bcc99295..b23baf4cc3 100644 --- a/engines/saga/detection.cpp +++ b/engines/saga/detection.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ // Game detection, general game parameters @@ -134,7 +131,7 @@ public: SagaMetaEngine() : AdvancedMetaEngine(detectionParams) {} virtual const char *getName() const { - return "Saga engine [" + return "SAGA [" #if defined(ENABLE_IHNM) && defined(ENABLE_SAGA2) "all games" diff --git a/engines/saga/detection_tables.h b/engines/saga/detection_tables.h index e5796e813b..f63efd206b 100644 --- a/engines/saga/detection_tables.h +++ b/engines/saga/detection_tables.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ // Game detection information and MD5s diff --git a/engines/saga/displayinfo.h b/engines/saga/displayinfo.h index b29f709323..70c36bafd5 100644 --- a/engines/saga/displayinfo.h +++ b/engines/saga/displayinfo.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ // Interface widget display information diff --git a/engines/saga/events.cpp b/engines/saga/events.cpp index cf27ad7559..35f41e30ab 100644 --- a/engines/saga/events.cpp +++ b/engines/saga/events.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ // Event management module diff --git a/engines/saga/events.h b/engines/saga/events.h index 135c0beb55..581abe17b0 100644 --- a/engines/saga/events.h +++ b/engines/saga/events.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ // Event management module header file diff --git a/engines/saga/font.cpp b/engines/saga/font.cpp index 2434f7aad8..a5363909ff 100644 --- a/engines/saga/font.cpp +++ b/engines/saga/font.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ // Font management and font drawing module diff --git a/engines/saga/font.h b/engines/saga/font.h index 6f66545756..75d5fa95b9 100644 --- a/engines/saga/font.h +++ b/engines/saga/font.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ // Font management and font drawing header file diff --git a/engines/saga/font_map.cpp b/engines/saga/font_map.cpp index 6abaeea151..936c8e779c 100644 --- a/engines/saga/font_map.cpp +++ b/engines/saga/font_map.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ // Font module character mapping table ( MS CP-850 to ISO 8859-1 ) diff --git a/engines/saga/gfx.cpp b/engines/saga/gfx.cpp index 4930718b67..ab0c0f3e4c 100644 --- a/engines/saga/gfx.cpp +++ b/engines/saga/gfx.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ // Misc. graphics routines diff --git a/engines/saga/gfx.h b/engines/saga/gfx.h index 56d9104371..c677b76324 100644 --- a/engines/saga/gfx.h +++ b/engines/saga/gfx.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ // Graphics maniuplation routines - private header file diff --git a/engines/saga/image.cpp b/engines/saga/image.cpp index ac9fe94f2f..3434d46b42 100644 --- a/engines/saga/image.cpp +++ b/engines/saga/image.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ // SAGA Image resource management routines diff --git a/engines/saga/input.cpp b/engines/saga/input.cpp index e3a3b49396..69a353da9f 100644 --- a/engines/saga/input.cpp +++ b/engines/saga/input.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "saga/saga.h" diff --git a/engines/saga/interface.cpp b/engines/saga/interface.cpp index c3773b2cb2..08c5ddc6f9 100644 --- a/engines/saga/interface.cpp +++ b/engines/saga/interface.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ // Game interface module diff --git a/engines/saga/interface.h b/engines/saga/interface.h index 09631bf0e8..84533705fe 100644 --- a/engines/saga/interface.h +++ b/engines/saga/interface.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ // Game interface module private header file diff --git a/engines/saga/introproc_ihnm.cpp b/engines/saga/introproc_ihnm.cpp index 2053c7158f..364c4cf306 100644 --- a/engines/saga/introproc_ihnm.cpp +++ b/engines/saga/introproc_ihnm.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifdef ENABLE_IHNM diff --git a/engines/saga/introproc_ite.cpp b/engines/saga/introproc_ite.cpp index ae7dedefa5..87fd48e2d2 100644 --- a/engines/saga/introproc_ite.cpp +++ b/engines/saga/introproc_ite.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ // Intro sequence scene procedures diff --git a/engines/saga/introproc_saga2.cpp b/engines/saga/introproc_saga2.cpp index 7f04474c61..80d53a2794 100644 --- a/engines/saga/introproc_saga2.cpp +++ b/engines/saga/introproc_saga2.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifdef ENABLE_SAGA2 diff --git a/engines/saga/isomap.cpp b/engines/saga/isomap.cpp index 6450af268a..adea59ca9a 100644 --- a/engines/saga/isomap.cpp +++ b/engines/saga/isomap.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ // Isometric level module diff --git a/engines/saga/isomap.h b/engines/saga/isomap.h index 7dc7dff8cd..b35f79b1af 100644 --- a/engines/saga/isomap.h +++ b/engines/saga/isomap.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ // Isometric level module - private header diff --git a/engines/saga/itedata.cpp b/engines/saga/itedata.cpp index ab0aa12d18..44aa48ccee 100644 --- a/engines/saga/itedata.cpp +++ b/engines/saga/itedata.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ // Actor and Object data tables diff --git a/engines/saga/itedata.h b/engines/saga/itedata.h index f0f626a51a..73f0a2aa21 100644 --- a/engines/saga/itedata.h +++ b/engines/saga/itedata.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ // Actor data table header file diff --git a/engines/saga/music.cpp b/engines/saga/music.cpp index eb0a911555..21f3cc489e 100644 --- a/engines/saga/music.cpp +++ b/engines/saga/music.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ // MIDI and digital music class diff --git a/engines/saga/music.h b/engines/saga/music.h index 465d61e366..5a4e662af4 100644 --- a/engines/saga/music.h +++ b/engines/saga/music.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ // Music class diff --git a/engines/saga/objectmap.cpp b/engines/saga/objectmap.cpp index 9799edc34a..b9594625e1 100644 --- a/engines/saga/objectmap.cpp +++ b/engines/saga/objectmap.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ // Object map / Object click-area module diff --git a/engines/saga/objectmap.h b/engines/saga/objectmap.h index 9e7c004fc0..3f71c8f95d 100644 --- a/engines/saga/objectmap.h +++ b/engines/saga/objectmap.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ // Object map / Object click-area module header file diff --git a/engines/saga/palanim.cpp b/engines/saga/palanim.cpp index b0b76fc947..1fefad93ab 100644 --- a/engines/saga/palanim.cpp +++ b/engines/saga/palanim.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ // Palette animation module diff --git a/engines/saga/palanim.h b/engines/saga/palanim.h index 2d2c3f1399..9959d08e2f 100644 --- a/engines/saga/palanim.h +++ b/engines/saga/palanim.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ // Palette animation module header file diff --git a/engines/saga/puzzle.cpp b/engines/saga/puzzle.cpp index 0e08c84e43..d5d83c706f 100644 --- a/engines/saga/puzzle.cpp +++ b/engines/saga/puzzle.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "saga/saga.h" diff --git a/engines/saga/puzzle.h b/engines/saga/puzzle.h index 312f0d71b1..0f9bd8aeff 100644 --- a/engines/saga/puzzle.h +++ b/engines/saga/puzzle.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ // ITE puzzle scene diff --git a/engines/saga/render.cpp b/engines/saga/render.cpp index 837a9e5879..757374a3a3 100644 --- a/engines/saga/render.cpp +++ b/engines/saga/render.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ // Main rendering loop diff --git a/engines/saga/render.h b/engines/saga/render.h index f0241e8ecf..5694bacb35 100644 --- a/engines/saga/render.h +++ b/engines/saga/render.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ // Main rendering loop - private header diff --git a/engines/saga/resource.cpp b/engines/saga/resource.cpp index 578ce2d5ab..72b021309c 100644 --- a/engines/saga/resource.cpp +++ b/engines/saga/resource.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ // RSC Resource file management module diff --git a/engines/saga/resource.h b/engines/saga/resource.h index a21f636f25..2124f3e29f 100644 --- a/engines/saga/resource.h +++ b/engines/saga/resource.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ // RSC Resource file management header file diff --git a/engines/saga/resource_hrs.cpp b/engines/saga/resource_hrs.cpp index 21cf0ef4c1..ac16e21c12 100644 --- a/engines/saga/resource_hrs.cpp +++ b/engines/saga/resource_hrs.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifdef ENABLE_SAGA2 diff --git a/engines/saga/resource_res.cpp b/engines/saga/resource_res.cpp index 2cc12747af..4fec9da662 100644 --- a/engines/saga/resource_res.cpp +++ b/engines/saga/resource_res.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ // RSC Resource file management module (SAGA 1, used in IHNM) diff --git a/engines/saga/resource_rsc.cpp b/engines/saga/resource_rsc.cpp index 089757ca27..bc66e9e30a 100644 --- a/engines/saga/resource_rsc.cpp +++ b/engines/saga/resource_rsc.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ // RSC Resource file management module (SAGA 1, used in ITE) diff --git a/engines/saga/saga.cpp b/engines/saga/saga.cpp index 62493f5eac..15bd2aff72 100644 --- a/engines/saga/saga.cpp +++ b/engines/saga/saga.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/file.h" @@ -28,7 +25,6 @@ #include "common/config-manager.h" #include "common/system.h" #include "common/events.h" -#include "common/EventRecorder.h" #include "audio/mixer.h" @@ -59,7 +55,7 @@ namespace Saga { #define MAX_TIME_DELTA 100 SagaEngine::SagaEngine(OSystem *syst, const SAGAGameDescription *gameDesc) - : Engine(syst), _gameDescription(gameDesc) { + : Engine(syst), _gameDescription(gameDesc), _rnd("saga") { _framesEsc = 0; @@ -136,7 +132,6 @@ SagaEngine::SagaEngine(OSystem *syst, const SAGAGameDescription *gameDesc) SearchMan.addSubDirectoryMatching(gameDataDir, "video"); _displayClip.left = _displayClip.top = 0; - g_eventRec.registerRandomSource(_rnd, "saga"); } SagaEngine::~SagaEngine() { diff --git a/engines/saga/saga.h b/engines/saga/saga.h index 4df44a2e18..6d33979028 100644 --- a/engines/saga/saga.h +++ b/engines/saga/saga.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef SAGA_H diff --git a/engines/saga/saveload.cpp b/engines/saga/saveload.cpp index 27300377e9..8d7b718c09 100644 --- a/engines/saga/saveload.cpp +++ b/engines/saga/saveload.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/savefile.h" diff --git a/engines/saga/scene.cpp b/engines/saga/scene.cpp index 8e9e4463ba..66ee8f4504 100644 --- a/engines/saga/scene.cpp +++ b/engines/saga/scene.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ // Scene management module diff --git a/engines/saga/scene.h b/engines/saga/scene.h index 156705986d..adac3b622a 100644 --- a/engines/saga/scene.h +++ b/engines/saga/scene.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ // Scene management module private header file diff --git a/engines/saga/script.cpp b/engines/saga/script.cpp index bd1d6e5d84..9502631f37 100644 --- a/engines/saga/script.cpp +++ b/engines/saga/script.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ // Scripting module: Script resource handling functions diff --git a/engines/saga/script.h b/engines/saga/script.h index fba71edfba..227b58a298 100644 --- a/engines/saga/script.h +++ b/engines/saga/script.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ // Scripting module private header diff --git a/engines/saga/sfuncs.cpp b/engines/saga/sfuncs.cpp index 1e34362dc4..70f987a129 100644 --- a/engines/saga/sfuncs.cpp +++ b/engines/saga/sfuncs.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ // Scripting module script function component diff --git a/engines/saga/sfuncs_ihnm.cpp b/engines/saga/sfuncs_ihnm.cpp index dd6bbbe6f8..1a73677846 100644 --- a/engines/saga/sfuncs_ihnm.cpp +++ b/engines/saga/sfuncs_ihnm.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifdef ENABLE_IHNM diff --git a/engines/saga/shorten.cpp b/engines/saga/shorten.cpp index 8f0baa9d53..39af7aa3db 100644 --- a/engines/saga/shorten.cpp +++ b/engines/saga/shorten.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/scummsys.h" diff --git a/engines/saga/shorten.h b/engines/saga/shorten.h index f320e1dcc5..f2114bedeb 100644 --- a/engines/saga/shorten.h +++ b/engines/saga/shorten.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ // The code in this file is currently only used in SAGA2. diff --git a/engines/saga/sndres.cpp b/engines/saga/sndres.cpp index 46b13727a0..2433c93e93 100644 --- a/engines/saga/sndres.cpp +++ b/engines/saga/sndres.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ // Sound resource management class diff --git a/engines/saga/sndres.h b/engines/saga/sndres.h index e4bae1b143..9b0eebc834 100644 --- a/engines/saga/sndres.h +++ b/engines/saga/sndres.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ // Sound resource class header diff --git a/engines/saga/sound.cpp b/engines/saga/sound.cpp index 8ffce4e6cd..3408125f73 100644 --- a/engines/saga/sound.cpp +++ b/engines/saga/sound.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/config-manager.h" diff --git a/engines/saga/sound.h b/engines/saga/sound.h index 15003b515c..15624a9da5 100644 --- a/engines/saga/sound.h +++ b/engines/saga/sound.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ // Sound class diff --git a/engines/saga/sprite.cpp b/engines/saga/sprite.cpp index bc3646e898..81893c7480 100644 --- a/engines/saga/sprite.cpp +++ b/engines/saga/sprite.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ // Sprite management module diff --git a/engines/saga/sprite.h b/engines/saga/sprite.h index 2ffb940ccc..0375d8c63f 100644 --- a/engines/saga/sprite.h +++ b/engines/saga/sprite.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ // Sprite management module private header file diff --git a/engines/saga/sthread.cpp b/engines/saga/sthread.cpp index 0b59f3ba17..ec81d8d733 100644 --- a/engines/saga/sthread.cpp +++ b/engines/saga/sthread.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ // Scripting module thread management component diff --git a/engines/savestate.cpp b/engines/savestate.cpp index bed19ba3e5..9ed8356d3b 100644 --- a/engines/savestate.cpp +++ b/engines/savestate.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "engines/savestate.h" diff --git a/engines/savestate.h b/engines/savestate.h index 9b64a96aee..ce78bc4ba3 100644 --- a/engines/savestate.h +++ b/engines/savestate.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef ENGINES_SAVESTATE_H diff --git a/engines/sci/console.cpp b/engines/sci/console.cpp index 60bd129efc..5f5af195b5 100644 --- a/engines/sci/console.cpp +++ b/engines/sci/console.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ // Console module @@ -1532,7 +1529,7 @@ bool Console::cmdUndither(int argc, const char **argv) { } bool flag = atoi(argv[1]) ? true : false; - _engine->_gfxScreen->debugUnditherSetState(flag); + _engine->_gfxScreen->enableUndithering(flag); if (flag) DebugPrintf("undithering ENABLED\n"); else @@ -3775,7 +3772,7 @@ int Console::printObject(reg_t pos) { DebugPrintf(" -- member variables:\n"); for (i = 0; (uint)i < obj->getVarCount(); i++) { DebugPrintf(" "); - if (i < var_container->getVarCount()) { + if (var_container && i < var_container->getVarCount()) { uint16 varSelector = var_container->getVarSelector(i); DebugPrintf("[%03x] %s = ", varSelector, _engine->getKernel()->getSelectorName(varSelector).c_str()); } else diff --git a/engines/sci/console.h b/engines/sci/console.h index 93ccc45503..1e2ebe4ba2 100644 --- a/engines/sci/console.h +++ b/engines/sci/console.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ // Console module header file diff --git a/engines/sci/debug.h b/engines/sci/debug.h index 8ddbbd0d45..765ceca07d 100644 --- a/engines/sci/debug.h +++ b/engines/sci/debug.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef SCI_DEBUG_H diff --git a/engines/sci/decompressor.cpp b/engines/sci/decompressor.cpp index c122fceeb0..03a06d240d 100644 --- a/engines/sci/decompressor.cpp +++ b/engines/sci/decompressor.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ // Resource library diff --git a/engines/sci/decompressor.h b/engines/sci/decompressor.h index 8b6f955ddb..37a5b5d7cb 100644 --- a/engines/sci/decompressor.h +++ b/engines/sci/decompressor.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef SCI_DECOMPRESSOR_H diff --git a/engines/sci/detection.cpp b/engines/sci/detection.cpp index 6db6cf8353..61e6cc9d09 100644 --- a/engines/sci/detection.cpp +++ b/engines/sci/detection.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "engines/advancedDetector.h" @@ -405,7 +402,7 @@ public: SciMetaEngine() : AdvancedMetaEngine(detectionParams) {} virtual const char *getName() const { - return "SCI Engine [SCI0, SCI01, SCI10, SCI11" + return "SCI [SCI0, SCI01, SCI10, SCI11" #ifdef ENABLE_SCI32 ", SCI32" #endif diff --git a/engines/sci/detection_tables.h b/engines/sci/detection_tables.h index 829831d3a6..d56d8f03cd 100644 --- a/engines/sci/detection_tables.h +++ b/engines/sci/detection_tables.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ namespace Sci { diff --git a/engines/sci/engine/features.cpp b/engines/sci/engine/features.cpp index 964097f57d..a5c1b970f1 100644 --- a/engines/sci/engine/features.cpp +++ b/engines/sci/engine/features.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "sci/engine/features.h" diff --git a/engines/sci/engine/features.h b/engines/sci/engine/features.h index 8237d43714..07ba626d15 100644 --- a/engines/sci/engine/features.h +++ b/engines/sci/engine/features.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef SCI_INCLUDE_FEATURES_H diff --git a/engines/sci/engine/gc.cpp b/engines/sci/engine/gc.cpp index e395eeab94..2d71878bda 100644 --- a/engines/sci/engine/gc.cpp +++ b/engines/sci/engine/gc.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "sci/engine/gc.h" diff --git a/engines/sci/engine/gc.h b/engines/sci/engine/gc.h index 48e1c6b482..97aa6513b6 100644 --- a/engines/sci/engine/gc.h +++ b/engines/sci/engine/gc.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ diff --git a/engines/sci/engine/kernel.cpp b/engines/sci/engine/kernel.cpp index ea6fa31d05..8fb6322f55 100644 --- a/engines/sci/engine/kernel.cpp +++ b/engines/sci/engine/kernel.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "sci/sci.h" diff --git a/engines/sci/engine/kernel.h b/engines/sci/engine/kernel.h index 9a55ef630b..68b1601580 100644 --- a/engines/sci/engine/kernel.h +++ b/engines/sci/engine/kernel.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef SCI_ENGINE_KERNEL_H diff --git a/engines/sci/engine/kernel_tables.h b/engines/sci/engine/kernel_tables.h index 16d56d10a8..31ef64d109 100644 --- a/engines/sci/engine/kernel_tables.h +++ b/engines/sci/engine/kernel_tables.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef SCI_ENGINE_KERNEL_TABLES_H diff --git a/engines/sci/engine/kevent.cpp b/engines/sci/engine/kevent.cpp index 725b78341b..2cd6b198de 100644 --- a/engines/sci/engine/kevent.cpp +++ b/engines/sci/engine/kevent.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/system.h" diff --git a/engines/sci/engine/kfile.cpp b/engines/sci/engine/kfile.cpp index 0e2f64257a..39e15aa84e 100644 --- a/engines/sci/engine/kfile.cpp +++ b/engines/sci/engine/kfile.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/archive.h" diff --git a/engines/sci/engine/kgraphics.cpp b/engines/sci/engine/kgraphics.cpp index c7a2a26c3d..75f8c25ed2 100644 --- a/engines/sci/engine/kgraphics.cpp +++ b/engines/sci/engine/kgraphics.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/system.h" diff --git a/engines/sci/engine/klists.cpp b/engines/sci/engine/klists.cpp index 38cd6ef023..68469f5c9a 100644 --- a/engines/sci/engine/klists.cpp +++ b/engines/sci/engine/klists.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "sci/engine/features.h" diff --git a/engines/sci/engine/kmath.cpp b/engines/sci/engine/kmath.cpp index 9baf9f5a54..ef795d7e2f 100644 --- a/engines/sci/engine/kmath.cpp +++ b/engines/sci/engine/kmath.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "sci/engine/state.h" diff --git a/engines/sci/engine/kmenu.cpp b/engines/sci/engine/kmenu.cpp index 3986966a71..02aa1d3ece 100644 --- a/engines/sci/engine/kmenu.cpp +++ b/engines/sci/engine/kmenu.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "sci/sci.h" diff --git a/engines/sci/engine/kmisc.cpp b/engines/sci/engine/kmisc.cpp index 80425224bf..daed248db1 100644 --- a/engines/sci/engine/kmisc.cpp +++ b/engines/sci/engine/kmisc.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/system.h" diff --git a/engines/sci/engine/kmovement.cpp b/engines/sci/engine/kmovement.cpp index f4392df8f2..31715f19d3 100644 --- a/engines/sci/engine/kmovement.cpp +++ b/engines/sci/engine/kmovement.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "sci/sci.h" diff --git a/engines/sci/engine/kparse.cpp b/engines/sci/engine/kparse.cpp index 09cf7744b2..59694cb6ee 100644 --- a/engines/sci/engine/kparse.cpp +++ b/engines/sci/engine/kparse.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ /* String and parser handling */ diff --git a/engines/sci/engine/kpathing.cpp b/engines/sci/engine/kpathing.cpp index 7786f9b093..0a4e2380a8 100644 --- a/engines/sci/engine/kpathing.cpp +++ b/engines/sci/engine/kpathing.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "sci/sci.h" diff --git a/engines/sci/engine/kscripts.cpp b/engines/sci/engine/kscripts.cpp index b9baa3540a..b48de1c7ea 100644 --- a/engines/sci/engine/kscripts.cpp +++ b/engines/sci/engine/kscripts.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "sci/sci.h" @@ -262,7 +259,7 @@ reg_t kDisposeScript(EngineState *s, int argc, reg_t *argv) { SegmentId id = s->_segMan->getScriptSegment(script); Script *scr = s->_segMan->getScriptIfLoaded(id); - if (scr) { + if (scr && !scr->isMarkedAsDeleted()) { if (s->_executionStack.back().addr.pc.segment != id) scr->setLockers(1); } diff --git a/engines/sci/engine/ksound.cpp b/engines/sci/engine/ksound.cpp index 7fb6ac296e..33bef58e52 100644 --- a/engines/sci/engine/ksound.cpp +++ b/engines/sci/engine/ksound.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "sci/sci.h" diff --git a/engines/sci/engine/kstring.cpp b/engines/sci/engine/kstring.cpp index e79af70158..c3f2b4dee2 100644 --- a/engines/sci/engine/kstring.cpp +++ b/engines/sci/engine/kstring.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ /* String and parser handling */ diff --git a/engines/sci/engine/kvideo.cpp b/engines/sci/engine/kvideo.cpp index a8d4437148..9a60f39c85 100644 --- a/engines/sci/engine/kvideo.cpp +++ b/engines/sci/engine/kvideo.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "engines/util.h" diff --git a/engines/sci/engine/message.cpp b/engines/sci/engine/message.cpp index ff2d96e804..f30f4e923e 100644 --- a/engines/sci/engine/message.cpp +++ b/engines/sci/engine/message.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ diff --git a/engines/sci/engine/message.h b/engines/sci/engine/message.h index 43ddb29d78..4444ede3bb 100644 --- a/engines/sci/engine/message.h +++ b/engines/sci/engine/message.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef SCI_ENGINE_MESSAGE_H diff --git a/engines/sci/engine/object.cpp b/engines/sci/engine/object.cpp index 267ba35e3c..aee93ffaa7 100644 --- a/engines/sci/engine/object.cpp +++ b/engines/sci/engine/object.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ diff --git a/engines/sci/engine/object.h b/engines/sci/engine/object.h index 8ae06f2707..7e07fb2f6d 100644 --- a/engines/sci/engine/object.h +++ b/engines/sci/engine/object.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef SCI_ENGINE_OBJECT_H diff --git a/engines/sci/engine/savegame.cpp b/engines/sci/engine/savegame.cpp index 43d00ebc15..65b5e602ff 100644 --- a/engines/sci/engine/savegame.cpp +++ b/engines/sci/engine/savegame.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/stream.h" diff --git a/engines/sci/engine/savegame.h b/engines/sci/engine/savegame.h index 778b0bf137..ff5bc5204b 100644 --- a/engines/sci/engine/savegame.h +++ b/engines/sci/engine/savegame.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef SCI_ENGINE_SAVEGAME_H diff --git a/engines/sci/engine/script.cpp b/engines/sci/engine/script.cpp index 25bf91c3ad..eae2dd674c 100644 --- a/engines/sci/engine/script.cpp +++ b/engines/sci/engine/script.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "sci/sci.h" @@ -383,6 +380,7 @@ void Script::relocateSci3(reg_t block) { } void Script::incrementLockers() { + assert(!_markedAsDeleted); _lockers++; } @@ -396,6 +394,7 @@ int Script::getLockers() const { } void Script::setLockers(int lockers) { + assert(lockers == 0 || !_markedAsDeleted); _lockers = lockers; } diff --git a/engines/sci/engine/script.h b/engines/sci/engine/script.h index 18d7157747..13744b6f93 100644 --- a/engines/sci/engine/script.h +++ b/engines/sci/engine/script.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef SCI_ENGINE_SCRIPT_H diff --git a/engines/sci/engine/script_patches.cpp b/engines/sci/engine/script_patches.cpp index 06540e6f43..2d3d8f6155 100644 --- a/engines/sci/engine/script_patches.cpp +++ b/engines/sci/engine/script_patches.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "sci/sci.h" @@ -865,6 +862,7 @@ const byte qfg3DialogCrash[] = { 0x34, 0xe7, 0x03, // ldi 3e7 (999) 0x22, // lt? 0x33, // jmp [back] ---> BUG! Infinite loop + 0 }; const uint16 qfg3PatchDialogCrash[] = { @@ -874,50 +872,9 @@ const uint16 qfg3PatchDialogCrash[] = { PATCH_END }; -// Part of script 47 that handles the barter icon checks for the wrong local. -// The local is supposed to contain the value returned by a previous kDisplay -// call, but since the wrong one is checked, it contains junk instead. We -// remove that check here (this doesn't affect the game at all). This occurs -// when attempting to purchase something from a vendor and the barter button is -// available (e.g. when buying the robe or meat from the associated vendors). -// Fixes bug #3292251. -const byte qfg3BarterCrash[] = { - 22, - 0x83, 0x10, // lal 10 ---> BUG! Wrong local - 0x30, 0x11, 0x00, // bnt 0011 ---> the accumulator will now contain garbage, so this check fails - 0x35, 0x00, // ldi 00 - 0xa5, 0x00, // sat 00 - 0x39, 0x03, // pushi 03 - 0x5b, 0x04, 0x00, // lea 04 00 - 0x36, // push - 0x39, 0x6c, // pushi 6c - 0x8b, 0x10, // lsl 10 ---> local 10 contains garbage, so the call below will fail - 0x43, 0x1b, 0x06 // callk Display[1b] 06 -}; - -// Same as above, but for local 0x11 -const byte qfg3BarterCrash2[] = { - 18, - 0x83, 0x11, // lal 11 ---> BUG! Wrong local - 0x30, 0x0d, 0x00, // bnt 000d ---> the accumulator will now contain garbage, so this check fails - 0x39, 0x03, // pushi 03 - 0x5b, 0x04, 0x00, // lea 04 00 - 0x36, // push - 0x39, 0x6c, // pushi 6c - 0x8b, 0x11, // lsl 11 ---> local 11 contains garbage, so the call below will fail - 0x43, 0x1b, 0x06 // callk Display[1b] 06 -}; - -const uint16 qfg3PatchBarterCrash[] = { - 0x35, 0x00, // ldi 00 ---> the accumulator will always be zero, so the problematic code won't run - PATCH_END -}; - // script, description, magic DWORD, adjust const SciScriptSignature qfg3Signatures[] = { { 23, "dialog crash", 1, PATCH_MAGICDWORD(0xe7, 0x03, 0x22, 0x33), -1, qfg3DialogCrash, qfg3PatchDialogCrash }, - { 47, "barter crash", 1, PATCH_MAGICDWORD(0x83, 0x10, 0x30, 0x11), 0, qfg3BarterCrash, qfg3PatchBarterCrash }, - { 47, "barter crash 2", 1, PATCH_MAGICDWORD(0x83, 0x11, 0x30, 0x0d), 0, qfg3BarterCrash2, qfg3PatchBarterCrash }, { 944, "import dialog continuous calls", 1, PATCH_MAGICDWORD(0x2a, 0x31, 0x0b, 0x7a), -1, qfg3SignatureImportDialog, qfg3PatchImportDialog }, SCI_SIGNATUREENTRY_TERMINATOR }; diff --git a/engines/sci/engine/scriptdebug.cpp b/engines/sci/engine/scriptdebug.cpp index 596494d61b..16098ab275 100644 --- a/engines/sci/engine/scriptdebug.cpp +++ b/engines/sci/engine/scriptdebug.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ // Script debugger functionality. Absolutely not threadsafe. @@ -34,6 +31,10 @@ namespace Sci { +// This table is only used for debugging. Don't include it for devices +// with not enough available memory (e.g. phones), where REDUCE_MEMORY_USAGE +// is defined +#ifndef REDUCE_MEMORY_USAGE const char *opcodeNames[] = { "bnot", "add", "sub", "mul", "div", "mod", "shr", "shl", "xor", "and", @@ -62,6 +63,7 @@ const char *opcodeNames[] = { "-agi", "-ali", "-ati", "-api", "-sgi", "-sli", "-sti", "-spi" }; +#endif // REDUCE_MEMORY_USAGE // Disassembles one command from the heap, returns address of next command or 0 if a ret was encountered. reg_t disassemble(EngineState *s, reg_t pos, bool printBWTag, bool printBytecode) { @@ -113,7 +115,9 @@ reg_t disassemble(EngineState *s, reg_t pos, bool printBWTag, bool printBytecode if (printBWTag) debugN("[%c] ", opsize ? 'B' : 'W'); +#ifndef REDUCE_MEMORY_USAGE debugN("%s", opcodeNames[opcode]); +#endif i = 0; while (g_opcode_formats[opcode][i]) { diff --git a/engines/sci/engine/seg_manager.cpp b/engines/sci/engine/seg_manager.cpp index 0dc245a991..b28e8cd450 100644 --- a/engines/sci/engine/seg_manager.cpp +++ b/engines/sci/engine/seg_manager.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "sci/sci.h" diff --git a/engines/sci/engine/seg_manager.h b/engines/sci/engine/seg_manager.h index d402afbf1a..a579ba10e1 100644 --- a/engines/sci/engine/seg_manager.h +++ b/engines/sci/engine/seg_manager.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef SCI_ENGINE_SEGMAN_H diff --git a/engines/sci/engine/segment.cpp b/engines/sci/engine/segment.cpp index 2bb77c707a..5d8a81a7f1 100644 --- a/engines/sci/engine/segment.cpp +++ b/engines/sci/engine/segment.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/endian.h" diff --git a/engines/sci/engine/segment.h b/engines/sci/engine/segment.h index 947953e8c3..f5c5e2289d 100644 --- a/engines/sci/engine/segment.h +++ b/engines/sci/engine/segment.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef SCI_ENGINE_SEGMENT_H diff --git a/engines/sci/engine/selector.cpp b/engines/sci/engine/selector.cpp index 957a836e3e..2edbea9676 100644 --- a/engines/sci/engine/selector.cpp +++ b/engines/sci/engine/selector.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "sci/sci.h" diff --git a/engines/sci/engine/selector.h b/engines/sci/engine/selector.h index 8a47984204..dae1ea9266 100644 --- a/engines/sci/engine/selector.h +++ b/engines/sci/engine/selector.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef SCI_ENGINE_SELECTOR_H diff --git a/engines/sci/engine/state.cpp b/engines/sci/engine/state.cpp index f9d6c70389..e094ed3bd7 100644 --- a/engines/sci/engine/state.cpp +++ b/engines/sci/engine/state.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/system.h" diff --git a/engines/sci/engine/state.h b/engines/sci/engine/state.h index cd6d56500a..dcffe6dbb3 100644 --- a/engines/sci/engine/state.h +++ b/engines/sci/engine/state.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef SCI_INCLUDE_ENGINE_H diff --git a/engines/sci/engine/static_selectors.cpp b/engines/sci/engine/static_selectors.cpp index 23241de330..6526eff2db 100644 --- a/engines/sci/engine/static_selectors.cpp +++ b/engines/sci/engine/static_selectors.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ // We place selector vocab name tables here for any game that doesn't have diff --git a/engines/sci/engine/vm.cpp b/engines/sci/engine/vm.cpp index b441815014..499574957e 100644 --- a/engines/sci/engine/vm.cpp +++ b/engines/sci/engine/vm.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/debug.h" @@ -117,7 +114,9 @@ static bool validate_variable(reg_t *r, reg_t *stack_base, int type, int max, in return true; } +#ifndef REDUCE_MEMORY_USAGE extern const char *opcodeNames[]; // from scriptdebug.cpp +#endif static reg_t read_var(EngineState *s, int type, int index) { if (validate_variable(s->variables[type], s->stack_base, type, s->variablesMax[type], index)) { diff --git a/engines/sci/engine/vm.h b/engines/sci/engine/vm.h index 5947579aa3..36eadfa1c2 100644 --- a/engines/sci/engine/vm.h +++ b/engines/sci/engine/vm.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef SCI_ENGINE_VM_H diff --git a/engines/sci/engine/vm_types.cpp b/engines/sci/engine/vm_types.cpp index e606fa1f86..71a28a9761 100644 --- a/engines/sci/engine/vm_types.cpp +++ b/engines/sci/engine/vm_types.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "sci/sci.h" diff --git a/engines/sci/engine/vm_types.h b/engines/sci/engine/vm_types.h index b927df339e..dc87cf758a 100644 --- a/engines/sci/engine/vm_types.h +++ b/engines/sci/engine/vm_types.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef SCI_ENGINE_VM_TYPES_H diff --git a/engines/sci/engine/workarounds.cpp b/engines/sci/engine/workarounds.cpp index 20d6cd0dd0..aba2e66eff 100644 --- a/engines/sci/engine/workarounds.cpp +++ b/engines/sci/engine/workarounds.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "sci/engine/kernel.h" @@ -213,6 +210,8 @@ const SciWorkaroundEntry kDisplay_workarounds[] = { { GID_PQ2, 23, 23, 0, "rm23Script", "elements", 0x4ae, 0, { WORKAROUND_IGNORE, 0 } }, // when looking at the 2nd page of pate's file - 0x75 as id { GID_PQ2, 23, 23, 0, "rm23Script", "elements", 0x4c1, 0, { WORKAROUND_IGNORE, 0 } }, // when looking at the 2nd page of pate's file - 0x75 as id (another pq2 version, bug #3043904) { GID_QFG1, 11, 11, 0, "battle", "<noname90>", -1, 0, { WORKAROUND_IGNORE, 0 } }, // DEMO: When entering battle, 0x75 as id + { GID_QFG3, -1, 47, 0, "barterWin", "open", 0x1426, 0, { WORKAROUND_IGNORE, 0 } }, // sometimes when talking with a vendor that can be bartered with, the wrong local variable is checked and the variable contents are wrong - bug #3292251 + { GID_QFG3, -1, 47, 0, "barterIcon", "show", 0x135c, 0, { WORKAROUND_IGNORE, 0 } }, // sometimes when talking with a vendor that can be bartered with, the wrong local variable is checked and the variable contents are wrong - bug #3292251 { GID_SQ1, -1, 700, 0, "arcadaRegion", "doit", -1, 0, { WORKAROUND_IGNORE, 0 } }, // restoring in some rooms of the arcada (right at the start) { GID_SQ4, 397, 0, 0, "", "export 12", -1, 0, { WORKAROUND_IGNORE, 0 } }, // FLOPPY: when going into the computer store (bug #3044044) { GID_SQ4, 391, 391, 0, "doCatalog", "mode", 0x84, 0, { WORKAROUND_IGNORE, 0 } }, // CD: clicking on catalog in roboter sale - a parameter is an object @@ -230,7 +229,7 @@ const SciWorkaroundEntry kDirLoop_workarounds[] = { const SciWorkaroundEntry kDisposeScript_workarounds[] = { { GID_LAURABOW, 777, 777, 0, "myStab", "changeState", -1, 0, { WORKAROUND_IGNORE, 0 } }, // DEMO: after the will is signed, parameter 0 is an object - bug #3034907 { GID_QFG1, -1, 64, 0, "rm64", "dispose", -1, 0, { WORKAROUND_IGNORE, 0 } }, // when leaving graveyard, parameter 0 is an object - { GID_SQ4, 150, 151, 0, "fightScript", "dispose", -1, 0, { WORKAROUND_IGNORE, 0 } }, // during fight with vohaul, parameter 0 is an object + { GID_SQ4, 150, 151, 0, "fightScript", "dispose", -1, 0, { WORKAROUND_IGNORE, 0 } }, // during fight with Vohaul, parameter 0 is an object { GID_SQ4, 150, 152, 0, "driveCloseUp", "dispose", -1, 0, { WORKAROUND_IGNORE, 0 } }, // when choosing "beam download", parameter 0 is an object SCI_WORKAROUNDENTRY_TERMINATOR }; diff --git a/engines/sci/engine/workarounds.h b/engines/sci/engine/workarounds.h index c7721aa787..59054ae552 100644 --- a/engines/sci/engine/workarounds.h +++ b/engines/sci/engine/workarounds.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef SCI_ENGINE_WORKAROUNDS_H diff --git a/engines/sci/event.cpp b/engines/sci/event.cpp index 6b5ea64fc4..b015a6df7f 100644 --- a/engines/sci/event.cpp +++ b/engines/sci/event.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/system.h" diff --git a/engines/sci/event.h b/engines/sci/event.h index be0322f2a4..930001160a 100644 --- a/engines/sci/event.h +++ b/engines/sci/event.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef SCI_EVENT_H diff --git a/engines/sci/graphics/animate.cpp b/engines/sci/graphics/animate.cpp index d8f3fa09b0..f72f9a78cc 100644 --- a/engines/sci/graphics/animate.cpp +++ b/engines/sci/graphics/animate.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/util.h" diff --git a/engines/sci/graphics/animate.h b/engines/sci/graphics/animate.h index b2aadcbead..5e2e39ea1a 100644 --- a/engines/sci/graphics/animate.h +++ b/engines/sci/graphics/animate.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef SCI_GRAPHICS_ANIMATE_H diff --git a/engines/sci/graphics/cache.cpp b/engines/sci/graphics/cache.cpp index 25475c727f..d2bd76ac99 100644 --- a/engines/sci/graphics/cache.cpp +++ b/engines/sci/graphics/cache.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/util.h" diff --git a/engines/sci/graphics/cache.h b/engines/sci/graphics/cache.h index 140c96ecd0..c090cda7d7 100644 --- a/engines/sci/graphics/cache.h +++ b/engines/sci/graphics/cache.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef SCI_GRAPHICS_CACHE_H diff --git a/engines/sci/graphics/compare.cpp b/engines/sci/graphics/compare.cpp index db926f2962..1dbe279f8a 100644 --- a/engines/sci/graphics/compare.cpp +++ b/engines/sci/graphics/compare.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/util.h" diff --git a/engines/sci/graphics/compare.h b/engines/sci/graphics/compare.h index 1079f5f98c..83b4f49c08 100644 --- a/engines/sci/graphics/compare.h +++ b/engines/sci/graphics/compare.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef SCI_GRAPHICS_GFX_H diff --git a/engines/sci/graphics/controls.cpp b/engines/sci/graphics/controls.cpp index f42946fbea..0289735c0a 100644 --- a/engines/sci/graphics/controls.cpp +++ b/engines/sci/graphics/controls.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/util.h" diff --git a/engines/sci/graphics/controls.h b/engines/sci/graphics/controls.h index 9beaebe532..17e7c39318 100644 --- a/engines/sci/graphics/controls.h +++ b/engines/sci/graphics/controls.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef SCI_GRAPHICS_CONTROLS_H diff --git a/engines/sci/graphics/coordadjuster.cpp b/engines/sci/graphics/coordadjuster.cpp index bbeade87b5..2952d4da7b 100644 --- a/engines/sci/graphics/coordadjuster.cpp +++ b/engines/sci/graphics/coordadjuster.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/util.h" diff --git a/engines/sci/graphics/coordadjuster.h b/engines/sci/graphics/coordadjuster.h index 59afd1dcb7..1b8a3e2679 100644 --- a/engines/sci/graphics/coordadjuster.h +++ b/engines/sci/graphics/coordadjuster.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef SCI_GRAPHICS_COORDADJUSTER_H diff --git a/engines/sci/graphics/cursor.cpp b/engines/sci/graphics/cursor.cpp index 3b95a5c955..6ad2cb3cb3 100644 --- a/engines/sci/graphics/cursor.cpp +++ b/engines/sci/graphics/cursor.cpp @@ -18,18 +18,15 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/config-manager.h" #include "common/events.h" -#include "common/macresman.h" #include "common/memstream.h" #include "common/system.h" #include "common/util.h" #include "graphics/cursorman.h" +#include "graphics/maccursor.h" #include "sci/sci.h" #include "sci/event.h" @@ -473,49 +470,19 @@ void GfxCursor::kernelSetMacCursor(GuiResourceId viewNum, int loopNum, int celNu assert(resource); - if (resource->size == 32 * 2 + 4) { - // Mac CURS cursor - // See http://developer.apple.com/legacy/mac/library/documentation/mac/QuickDraw/QuickDraw-402.html - // for more information. - byte *cursorBitmap = new byte[16 * 16]; - byte *data = resource->data; - - // Get B&W data - for (byte i = 0; i < 32; i++) { - byte imageByte = *data++; - for (byte b = 0; b < 8; b++) - cursorBitmap[i * 8 + b] = (byte)((imageByte & (0x80 >> b)) > 0 ? 1 : 2); - } - - // Apply mask data - for (byte i = 0; i < 32; i++) { - byte imageByte = *data++; - for (byte b = 0; b < 8; b++) - if ((imageByte & (0x80 >> b)) == 0) - cursorBitmap[i * 8 + b] = 0; // Doesn't matter, just is transparent - } - - uint16 hotspotY = READ_BE_UINT16(data); - uint16 hotspotX = READ_BE_UINT16(data + 2); - - static const byte cursorPalette[] = { 0x00, 0x00, 0x00, 0xff, 0xff, 0xff }; + Common::MemoryReadStream resStream(resource->data, resource->size); + Graphics::MacCursor *macCursor = new Graphics::MacCursor(); - CursorMan.replaceCursor(cursorBitmap, 16, 16, hotspotX, hotspotY, 0); - CursorMan.replaceCursorPalette(cursorPalette, 1, 2); - - delete[] cursorBitmap; - } else { - // Mac crsr cursor - byte *cursorBitmap, *palette; - int width, height, hotspotX, hotspotY, palSize, keycolor; - Common::MemoryReadStream resStream(resource->data, resource->size); - Common::MacResManager::convertCrsrCursor(&resStream, &cursorBitmap, width, height, hotspotX, hotspotY, keycolor, true, &palette, palSize); - CursorMan.replaceCursor(cursorBitmap, width, height, hotspotX, hotspotY, keycolor); - CursorMan.replaceCursorPalette(palette, 0, palSize); - delete[] cursorBitmap; - delete[] palette; + if (!macCursor->readFromStream(resStream)) { + warning("Failed to load Mac cursor %d", viewNum); + return; } + CursorMan.replaceCursor(macCursor->getSurface(), macCursor->getWidth(), macCursor->getHeight(), + macCursor->getHotspotX(), macCursor->getHotspotY(), macCursor->getKeyColor()); + CursorMan.replaceCursorPalette(macCursor->getPalette(), 0, 256); + + delete macCursor; kernelShow(); } diff --git a/engines/sci/graphics/cursor.h b/engines/sci/graphics/cursor.h index 271cf507e0..25109b3920 100644 --- a/engines/sci/graphics/cursor.h +++ b/engines/sci/graphics/cursor.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef SCI_GRAPHICS_CURSOR_H diff --git a/engines/sci/graphics/font.cpp b/engines/sci/graphics/font.cpp index 760f4158ea..fcdd057509 100644 --- a/engines/sci/graphics/font.cpp +++ b/engines/sci/graphics/font.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "sci/sci.h" diff --git a/engines/sci/graphics/font.h b/engines/sci/graphics/font.h index 9d2b37c1f2..8e5c980e2c 100644 --- a/engines/sci/graphics/font.h +++ b/engines/sci/graphics/font.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef SCI_GRAPHICS_FONT_H diff --git a/engines/sci/graphics/fontsjis.cpp b/engines/sci/graphics/fontsjis.cpp index 73229a6e93..ac58c55423 100644 --- a/engines/sci/graphics/fontsjis.cpp +++ b/engines/sci/graphics/fontsjis.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "sci/sci.h" diff --git a/engines/sci/graphics/fontsjis.h b/engines/sci/graphics/fontsjis.h index 5538b5c2c5..c4ae4ab580 100644 --- a/engines/sci/graphics/fontsjis.h +++ b/engines/sci/graphics/fontsjis.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef SCI_GRAPHICS_FONTSJIS_H diff --git a/engines/sci/graphics/frameout.cpp b/engines/sci/graphics/frameout.cpp index 7fafe843fd..11948d5d38 100644 --- a/engines/sci/graphics/frameout.cpp +++ b/engines/sci/graphics/frameout.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/algorithm.h" diff --git a/engines/sci/graphics/frameout.h b/engines/sci/graphics/frameout.h index 347ecb9424..7e5b1a5006 100644 --- a/engines/sci/graphics/frameout.h +++ b/engines/sci/graphics/frameout.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef SCI_GRAPHICS_FRAMEOUT_H diff --git a/engines/sci/graphics/helpers.h b/engines/sci/graphics/helpers.h index 343f3c7e6e..773f83a00e 100644 --- a/engines/sci/graphics/helpers.h +++ b/engines/sci/graphics/helpers.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef SCI_GRAPHICS_HELPERS_H diff --git a/engines/sci/graphics/maciconbar.cpp b/engines/sci/graphics/maciconbar.cpp index 6cf4f269a7..bff145ad53 100644 --- a/engines/sci/graphics/maciconbar.cpp +++ b/engines/sci/graphics/maciconbar.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "sci/sci.h" diff --git a/engines/sci/graphics/maciconbar.h b/engines/sci/graphics/maciconbar.h index 72609d19ab..43de37a904 100644 --- a/engines/sci/graphics/maciconbar.h +++ b/engines/sci/graphics/maciconbar.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef SCI_GRAPHICS_MACICONBAR_H diff --git a/engines/sci/graphics/menu.cpp b/engines/sci/graphics/menu.cpp index 50ba77e832..9d4ab3f589 100644 --- a/engines/sci/graphics/menu.cpp +++ b/engines/sci/graphics/menu.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/util.h" diff --git a/engines/sci/graphics/menu.h b/engines/sci/graphics/menu.h index a6ac4d1d4c..aa3550da4e 100644 --- a/engines/sci/graphics/menu.h +++ b/engines/sci/graphics/menu.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef SCI_GRAPHICS_MENU_H diff --git a/engines/sci/graphics/paint.cpp b/engines/sci/graphics/paint.cpp index 27a0bdfc44..7befa99afe 100644 --- a/engines/sci/graphics/paint.cpp +++ b/engines/sci/graphics/paint.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "graphics/primitives.h" diff --git a/engines/sci/graphics/paint.h b/engines/sci/graphics/paint.h index a79e8993c2..efeaa38875 100644 --- a/engines/sci/graphics/paint.h +++ b/engines/sci/graphics/paint.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef SCI_GRAPHICS_PAINT_H diff --git a/engines/sci/graphics/paint16.cpp b/engines/sci/graphics/paint16.cpp index 5172f7cdc0..75fef0a3ec 100644 --- a/engines/sci/graphics/paint16.cpp +++ b/engines/sci/graphics/paint16.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "sci/sci.h" diff --git a/engines/sci/graphics/paint16.h b/engines/sci/graphics/paint16.h index 69ddf09ea6..31916599ba 100644 --- a/engines/sci/graphics/paint16.h +++ b/engines/sci/graphics/paint16.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef SCI_GRAPHICS_PAINT16_H diff --git a/engines/sci/graphics/paint32.cpp b/engines/sci/graphics/paint32.cpp index f277436631..a9590c829a 100644 --- a/engines/sci/graphics/paint32.cpp +++ b/engines/sci/graphics/paint32.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "sci/sci.h" diff --git a/engines/sci/graphics/paint32.h b/engines/sci/graphics/paint32.h index e412bdf1c4..dd4246c507 100644 --- a/engines/sci/graphics/paint32.h +++ b/engines/sci/graphics/paint32.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef SCI_GRAPHICS_PAINT32_H diff --git a/engines/sci/graphics/palette.cpp b/engines/sci/graphics/palette.cpp index 42551e9369..899ef10b33 100644 --- a/engines/sci/graphics/palette.cpp +++ b/engines/sci/graphics/palette.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/file.h" diff --git a/engines/sci/graphics/palette.h b/engines/sci/graphics/palette.h index d2e5151d6a..9b0c45baf6 100644 --- a/engines/sci/graphics/palette.h +++ b/engines/sci/graphics/palette.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef SCI_GRAPHICS_PALETTE_H diff --git a/engines/sci/graphics/picture.cpp b/engines/sci/graphics/picture.cpp index 82aae5399f..6529a6ae64 100644 --- a/engines/sci/graphics/picture.cpp +++ b/engines/sci/graphics/picture.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/stack.h" @@ -509,10 +506,12 @@ void GfxPicture::drawVectorData(byte *data, int dataSize) { memcpy(&EGApriority, &vector_defaultEGApriority, sizeof(vector_defaultEGApriority)); if (g_sci->getGameId() == GID_ICEMAN) { - // WORKAROUND: we remove certain visual&priority lines in underwater rooms of iceman, when not dithering the - // picture. Normally those lines aren't shown, because they share the same color as the dithered - // fill color combination. When not dithering, those lines would appear and get distracting. - if ((_screen->getUnditherState()) && ((_resourceId >= 53 && _resourceId <= 58) || (_resourceId == 61))) + // WORKAROUND: we remove certain visual&priority lines in underwater + // rooms of iceman, when not dithering the picture. Normally those + // lines aren't shown, because they share the same color as the + // dithered fill color combination. When not dithering, those lines + // would appear and get distracting. + if ((_screen->isUnditheringEnabled()) && ((_resourceId >= 53 && _resourceId <= 58) || (_resourceId == 61))) icemanDrawFix = true; } if (g_sci->getGameId() == GID_KQ5) { @@ -618,14 +617,17 @@ void GfxPicture::drawVectorData(byte *data, int dataSize) { } break; - // Pattern opcodes are handled in sierra sci1.1+ as actual NOPs and normally they definitely should not occur - // inside picture data for such games + // Pattern opcodes are handled in sierra sci1.1+ as actual NOPs and + // normally they definitely should not occur inside picture data for + // such games. case PIC_OP_SET_PATTERN: if (_resourceType >= SCI_PICTURE_TYPE_SCI11) { if (g_sci->getGameId() == GID_SQ4) { - // WORKAROUND: For SQ4 / for some pictures handle this like a terminator - // This picture includes garbage data, first a set pattern w/o parameter and then short pattern - // I guess that garbage is a left over from the sq4-floppy (sci1) to sq4-cd (sci1.1) conversion + // WORKAROUND: For SQ4 / for some pictures handle this like + // a terminator. This picture includes garbage data, first a + // set pattern w/o parameter and then short pattern. I guess + // that garbage is a left over from the sq4-floppy (sci1) to + // sq4-cd (sci1.1) conversion. switch (_resourceId) { case 35: case 381: @@ -857,7 +859,8 @@ void GfxPicture::vectorGetPatternTexture(byte *data, int &curPos, int16 pattern_ } } -// Do not replace w/ some generic code. This algo really needs to behave exactly as the one from sierra +// WARNING: Do not replace the following code with something else, like generic +// code. This algo really needs to behave exactly as the one from sierra. void GfxPicture::vectorFloodFill(int16 x, int16 y, byte color, byte priority, byte control) { Port *curPort = _ports->getPort(); Common::Stack<Common::Point> stack; diff --git a/engines/sci/graphics/picture.h b/engines/sci/graphics/picture.h index 7cd0d71b67..78623d5e09 100644 --- a/engines/sci/graphics/picture.h +++ b/engines/sci/graphics/picture.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef SCI_GRAPHICS_PICTURE_H diff --git a/engines/sci/graphics/portrait.cpp b/engines/sci/graphics/portrait.cpp index 3f9ebaa07a..8cd8cdb033 100644 --- a/engines/sci/graphics/portrait.cpp +++ b/engines/sci/graphics/portrait.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/archive.h" diff --git a/engines/sci/graphics/portrait.h b/engines/sci/graphics/portrait.h index 7da9425c9d..75baa9a56b 100644 --- a/engines/sci/graphics/portrait.h +++ b/engines/sci/graphics/portrait.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef SCI_GRAPHICS_PORTRAITS_H diff --git a/engines/sci/graphics/ports.cpp b/engines/sci/graphics/ports.cpp index cc206bd5b9..9412976d5b 100644 --- a/engines/sci/graphics/ports.cpp +++ b/engines/sci/graphics/ports.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/util.h" diff --git a/engines/sci/graphics/ports.h b/engines/sci/graphics/ports.h index 31ed671daf..1818eaddb3 100644 --- a/engines/sci/graphics/ports.h +++ b/engines/sci/graphics/ports.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef SCI_GRAPHICS_PORTS_H diff --git a/engines/sci/graphics/screen.cpp b/engines/sci/graphics/screen.cpp index f619780c7c..2446ea545e 100644 --- a/engines/sci/graphics/screen.cpp +++ b/engines/sci/graphics/screen.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/timer.h" @@ -111,7 +108,7 @@ GfxScreen::GfxScreen(ResourceManager *resMan) : _resMan(resMan) { _picNotValid = 0; _picNotValidSci11 = 0; - _unditherState = true; + _unditheringEnabled = true; _fontIsUpscaled = false; if (_resMan->getViewType() != kViewEga) { @@ -560,7 +557,7 @@ void GfxScreen::dither(bool addToFlag) { byte *visualPtr = _visualScreen; byte *displayPtr = _displayScreen; - if (!_unditherState) { + if (!_unditheringEnabled) { // Do dithering on visual and display-screen for (y = 0; y < _height; y++) { for (x = 0; x < _width; x++) { @@ -624,13 +621,13 @@ void GfxScreen::ditherForceDitheredColor(byte color) { _ditheredPicColors[color] = 256; } -void GfxScreen::debugUnditherSetState(bool flag) { - _unditherState = flag; +void GfxScreen::enableUndithering(bool flag) { + _unditheringEnabled = flag; } int16 *GfxScreen::unditherGetDitheredBgColors() { - if (_unditherState) - return (int16 *)&_ditheredPicColors; + if (_unditheringEnabled) + return _ditheredPicColors; else return NULL; } diff --git a/engines/sci/graphics/screen.h b/engines/sci/graphics/screen.h index 89ad52e0ac..73ea596ba1 100644 --- a/engines/sci/graphics/screen.h +++ b/engines/sci/graphics/screen.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef SCI_GRAPHICS_SCREEN_H @@ -95,9 +92,10 @@ public: return _upscaledHires; } - bool getUnditherState() const { - return _unditherState; + bool isUnditheringEnabled() const { + return _unditheringEnabled; } + void enableUndithering(bool flag); void putKanjiChar(Graphics::FontSJIS *commonFont, int16 x, int16 y, uint16 chr, byte color); byte getVisual(int x, int y); @@ -119,7 +117,6 @@ public: // Force a color combination as a dithered color void ditherForceDitheredColor(byte color); - void debugUnditherSetState(bool flag); int16 *unditherGetDitheredBgColors(); void debugShowMap(int mapNo); @@ -151,7 +148,10 @@ private: void setVerticalShakePos(uint16 shakePos); - bool _unditherState; + /** + * If this flag is true, undithering is enabled, otherwise disabled. + */ + bool _unditheringEnabled; int16 _ditheredPicColors[DITHERED_BG_COLORS_SIZE]; // These screens have the real resolution of the game engine (320x200 for @@ -161,13 +161,13 @@ private: byte *_priorityScreen; byte *_controlScreen; - // This screen is the one that is actually displayed to the user. It may be - // 640x400 for japanese SCI1 games. SCI0 games may be undithered in here. - // Only read from this buffer for Save/ShowBits usage. + /** + * This screen is the one that is actually displayed to the user. It may be + * 640x400 for japanese SCI1 games. SCI0 games may be undithered in here. + * Only read from this buffer for Save/ShowBits usage. + */ byte *_displayScreen; - Common::Rect getScaledRect(Common::Rect rect); - ResourceManager *_resMan; /** @@ -176,16 +176,22 @@ private: */ byte *_activeScreen; - // This variable defines, if upscaled hires is active and what upscaled mode - // is used. + /** + * This variable defines, if upscaled hires is active and what upscaled mode + * is used. + */ GfxScreenUpscaledMode _upscaledHires; - // This here holds a translation for vertical coordinates between native - // (visual) and actual (display) screen. + /** + * This here holds a translation for vertical coordinates between native + * (visual) and actual (display) screen. + */ int _upscaledMapping[SCI_SCREEN_UPSCALEDMAXHEIGHT + 1]; - // This defines whether or not the font we're drawing is already scaled - // to the screen size (and we therefore should not upscale it ourselves). + /** + * This defines whether or not the font we're drawing is already scaled + * to the screen size (and we therefore should not upscale it ourselves). + */ bool _fontIsUpscaled; uint16 getLowResScreenHeight(); diff --git a/engines/sci/graphics/text16.cpp b/engines/sci/graphics/text16.cpp index 6269a58492..459be7fcf7 100644 --- a/engines/sci/graphics/text16.cpp +++ b/engines/sci/graphics/text16.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/util.h" diff --git a/engines/sci/graphics/text16.h b/engines/sci/graphics/text16.h index 3ed2361497..b33c2c4df0 100644 --- a/engines/sci/graphics/text16.h +++ b/engines/sci/graphics/text16.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef SCI_GRAPHICS_TEXT16_H diff --git a/engines/sci/graphics/transitions.cpp b/engines/sci/graphics/transitions.cpp index dde1be13ab..1256db8969 100644 --- a/engines/sci/graphics/transitions.cpp +++ b/engines/sci/graphics/transitions.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/events.h" diff --git a/engines/sci/graphics/transitions.h b/engines/sci/graphics/transitions.h index a8f0ca6f07..246f681690 100644 --- a/engines/sci/graphics/transitions.h +++ b/engines/sci/graphics/transitions.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef SCI_GRAPHICS_TRANSITIONS_H diff --git a/engines/sci/graphics/view.cpp b/engines/sci/graphics/view.cpp index f31cbacb22..5c8e9c3d2e 100644 --- a/engines/sci/graphics/view.cpp +++ b/engines/sci/graphics/view.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "sci/sci.h" diff --git a/engines/sci/graphics/view.h b/engines/sci/graphics/view.h index 36914f916c..19ef2e62f8 100644 --- a/engines/sci/graphics/view.h +++ b/engines/sci/graphics/view.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef SCI_GRAPHICS_VIEW_H diff --git a/engines/sci/parser/grammar.cpp b/engines/sci/parser/grammar.cpp index b330a432e3..6e02eb75e3 100644 --- a/engines/sci/parser/grammar.cpp +++ b/engines/sci/parser/grammar.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ /* Functionality to transform the context-free SCI grammar rules into diff --git a/engines/sci/parser/said.cpp b/engines/sci/parser/said.cpp index 666a235cf9..827e28073a 100644 --- a/engines/sci/parser/said.cpp +++ b/engines/sci/parser/said.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "sci/engine/state.h" diff --git a/engines/sci/parser/vocabulary.cpp b/engines/sci/parser/vocabulary.cpp index 25043401cc..a5c4686b3b 100644 --- a/engines/sci/parser/vocabulary.cpp +++ b/engines/sci/parser/vocabulary.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ // Main vocabulary support functions and word lookup @@ -395,9 +392,11 @@ void Vocabulary::lookupWord(ResultWordList& retval, const char *word, int word_l // SCI01 was the first version to support // multiple matches, so no need to look further // in earlier versions. - if (getSciVersion() < SCI_VERSION_01) - return; + // In versions that do support multiple matches, it seems + // that SSCI also aborts early when it finds an exact match in the + // dictionary. + return; } // Now try all suffixes diff --git a/engines/sci/parser/vocabulary.h b/engines/sci/parser/vocabulary.h index 6d3e0b301e..e4a7e41b3c 100644 --- a/engines/sci/parser/vocabulary.h +++ b/engines/sci/parser/vocabulary.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef SCI_SCICORE_VOCABULARY_H diff --git a/engines/sci/resource.cpp b/engines/sci/resource.cpp index a48ae0fad7..308bd92ef4 100644 --- a/engines/sci/resource.cpp +++ b/engines/sci/resource.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ // Resource library diff --git a/engines/sci/resource.h b/engines/sci/resource.h index e941f666d9..f450f1b397 100644 --- a/engines/sci/resource.h +++ b/engines/sci/resource.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef SCI_RESOURCE_H diff --git a/engines/sci/resource_audio.cpp b/engines/sci/resource_audio.cpp index 1e0b9c0ddf..588ea76ea5 100644 --- a/engines/sci/resource_audio.cpp +++ b/engines/sci/resource_audio.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ // Resource library diff --git a/engines/sci/resource_intern.h b/engines/sci/resource_intern.h index 969e250e62..e8e66503d8 100644 --- a/engines/sci/resource_intern.h +++ b/engines/sci/resource_intern.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef SCI_RESOURCE_INTERN_H diff --git a/engines/sci/sci.cpp b/engines/sci/sci.cpp index 85c2eced19..cf46d41382 100644 --- a/engines/sci/sci.cpp +++ b/engines/sci/sci.cpp @@ -18,16 +18,11 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/system.h" #include "common/config-manager.h" #include "common/debug-channels.h" -#include "common/EventRecorder.h" -#include "common/file.h" // for Common::File::exists() #include "engines/advancedDetector.h" #include "engines/util.h" @@ -78,7 +73,7 @@ SciEngine *g_sci = 0; class GfxDriver; SciEngine::SciEngine(OSystem *syst, const ADGameDescription *desc, SciGameId gameId) - : Engine(syst), _gameDescription(desc), _gameId(gameId) { + : Engine(syst), _gameDescription(desc), _gameId(gameId), _rng("sci") { assert(g_sci == 0); g_sci = this; @@ -186,8 +181,6 @@ SciEngine::~SciEngine() { extern void showScummVMDialog(const Common::String &message); Common::Error SciEngine::run() { - g_eventRec.registerRandomSource(_rng, "sci"); - // Assign default values to the config manager, in case settings are missing ConfMan.registerDefault("sci_originalsaveload", "false"); ConfMan.registerDefault("native_fb01", "false"); @@ -218,7 +211,7 @@ Common::Error SciEngine::run() { // Initialize the game screen _gfxScreen = new GfxScreen(_resMan); - _gfxScreen->debugUnditherSetState(ConfMan.getBool("disable_dithering")); + _gfxScreen->enableUndithering(ConfMan.getBool("disable_dithering")); // Create debugger console. It requires GFX to be initialized _console = new Console(this); diff --git a/engines/sci/sci.h b/engines/sci/sci.h index cd50b2402c..a340447354 100644 --- a/engines/sci/sci.h +++ b/engines/sci/sci.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef SCI_H diff --git a/engines/sci/sound/audio.cpp b/engines/sci/sound/audio.cpp index 53311b4252..592caa5814 100644 --- a/engines/sci/sound/audio.cpp +++ b/engines/sci/sound/audio.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "sci/resource.h" diff --git a/engines/sci/sound/audio.h b/engines/sci/sound/audio.h index 4cc8575a21..e0ba234b12 100644 --- a/engines/sci/sound/audio.h +++ b/engines/sci/sound/audio.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ /* Sound engine */ diff --git a/engines/sci/sound/drivers/adlib.cpp b/engines/sci/sound/drivers/adlib.cpp index f00c99d5b5..add3d8851f 100644 --- a/engines/sci/sound/drivers/adlib.cpp +++ b/engines/sci/sound/drivers/adlib.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "sci/sci.h" diff --git a/engines/sci/sound/drivers/amigamac.cpp b/engines/sci/sound/drivers/amigamac.cpp index 7ee8d21f86..158b4b08fb 100644 --- a/engines/sci/sound/drivers/amigamac.cpp +++ b/engines/sci/sound/drivers/amigamac.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "audio/softsynth/emumidi.h" diff --git a/engines/sci/sound/drivers/cms.cpp b/engines/sci/sound/drivers/cms.cpp index 47c59a1e3d..ace96ba499 100644 --- a/engines/sci/sound/drivers/cms.cpp +++ b/engines/sci/sound/drivers/cms.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "sci/sound/drivers/mididriver.h" diff --git a/engines/sci/sound/drivers/fb01.cpp b/engines/sci/sound/drivers/fb01.cpp index f217738bb2..9f3945bbec 100644 --- a/engines/sci/sound/drivers/fb01.cpp +++ b/engines/sci/sound/drivers/fb01.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "sci/sci.h" diff --git a/engines/sci/sound/drivers/gm_names.h b/engines/sci/sound/drivers/gm_names.h index b7883494f6..bfe5ff88c7 100644 --- a/engines/sci/sound/drivers/gm_names.h +++ b/engines/sci/sound/drivers/gm_names.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef SCI_SOUND_DRIVERS_GM_NAMES_H @@ -28,6 +25,11 @@ namespace Sci { +// These tables are only used for debugging. Don't include them for devices +// with not enough available memory (e.g. phones), where REDUCE_MEMORY_USAGE +// is defined +#ifndef REDUCE_MEMORY_USAGE + static const char *GmInstrumentNames[] = { /*000*/ "Acoustic Grand Piano", /*001*/ "Bright Acoustic Piano", @@ -215,6 +217,8 @@ static const char *GmPercussionNames[] = { /*81*/ "Open Triangle" }; +#endif // REDUCE_MEMORY_USAGE + } // End of namespace Sci #endif // SCI_SOUND_DRIVERS_GM_NAMES_H diff --git a/engines/sci/sound/drivers/map-mt32-to-gm.h b/engines/sci/sound/drivers/map-mt32-to-gm.h index f7a6256ba4..12a36aa51c 100644 --- a/engines/sci/sound/drivers/map-mt32-to-gm.h +++ b/engines/sci/sound/drivers/map-mt32-to-gm.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef SCI_SOUND_DRIVERS_MAP_MT32_TO_GM_H diff --git a/engines/sci/sound/drivers/midi.cpp b/engines/sci/sound/drivers/midi.cpp index f36aac3a2a..93a2308410 100644 --- a/engines/sci/sound/drivers/midi.cpp +++ b/engines/sci/sound/drivers/midi.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "sci/sci.h" @@ -819,11 +816,13 @@ void MidiPlayer_Midi::mapMt32ToGm(byte *data, size_t size) { if (_patchMap[i] == MIDI_UNMAPPED) { debugC(kDebugLevelSound, "[Unmapped]"); } else { +#ifndef REDUCE_MEMORY_USAGE if (_patchMap[i] >= 128) { debugC(kDebugLevelSound, "%s [Rhythm]", GmPercussionNames[_patchMap[i] - 128]); } else { debugC(kDebugLevelSound, "%s", GmInstrumentNames[_patchMap[i]]); } +#endif } _keyShift[i] = CLIP<uint8>(keyshift, 0, 48) - 24; @@ -855,10 +854,12 @@ void MidiPlayer_Midi::mapMt32ToGm(byte *data, size_t size) { } } +#ifndef REDUCE_MEMORY_USAGE if (_percussionMap[ins] == MIDI_UNMAPPED) debugC(kDebugLevelSound, "[Unmapped]"); else debugC(kDebugLevelSound, "%s", GmPercussionNames[_percussionMap[ins]]); +#endif _percussionVelocityScale[ins] = *(data + pos + 4 * i + 3) * 127 / 100; } diff --git a/engines/sci/sound/drivers/mididriver.h b/engines/sci/sound/drivers/mididriver.h index 2038725dbe..ec66984bd4 100644 --- a/engines/sci/sound/drivers/mididriver.h +++ b/engines/sci/sound/drivers/mididriver.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef SCI_SFX_SOFTSEQ_MIDIDRIVER_H diff --git a/engines/sci/sound/drivers/pcjr.cpp b/engines/sci/sound/drivers/pcjr.cpp index 4b1efb3c87..1d823b643d 100644 --- a/engines/sci/sound/drivers/pcjr.cpp +++ b/engines/sci/sound/drivers/pcjr.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "sci/sound/drivers/mididriver.h" diff --git a/engines/sci/sound/midiparser_sci.cpp b/engines/sci/sound/midiparser_sci.cpp index 0b9d7617b8..95b165468d 100644 --- a/engines/sci/sound/midiparser_sci.cpp +++ b/engines/sci/sound/midiparser_sci.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "sci/engine/kernel.h" @@ -224,6 +221,7 @@ byte *MidiParser_SCI::midiFilterChannels(int channelMask) { byte command = 0, lastCommand = 0; int delta = 0; int midiParamCount = 0; + bool containsMidiData = false; _mixedData = outData; @@ -250,6 +248,9 @@ byte *MidiParser_SCI::midiFilterChannels(int channelMask) { } } if ((1 << curChannel) & channelMask) { + if (curChannel != 0xF) + containsMidiData = true; + if (command != kEndOfTrack) { // Write delta while (delta > 240) { @@ -307,6 +308,11 @@ byte *MidiParser_SCI::midiFilterChannels(int channelMask) { *outData++ = 0x00; *outData++ = 0x00; + // This occurs in the music tracks of LB1 Amiga, when using the MT-32 + // driver (bug #3297881) + if (!containsMidiData) + warning("MIDI parser: the requested SCI0 sound has no MIDI note data for the currently selected sound driver"); + return _mixedData; } diff --git a/engines/sci/sound/midiparser_sci.h b/engines/sci/sound/midiparser_sci.h index 39de425e18..82f34070a4 100644 --- a/engines/sci/sound/midiparser_sci.h +++ b/engines/sci/sound/midiparser_sci.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef SCI_MIDIPARSER_H diff --git a/engines/sci/sound/music.cpp b/engines/sci/sound/music.cpp index c7743ac587..96cbf135ed 100644 --- a/engines/sci/sound/music.cpp +++ b/engines/sci/sound/music.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "audio/audiostream.h" diff --git a/engines/sci/sound/music.h b/engines/sci/sound/music.h index dfe5ad1586..8577ed7313 100644 --- a/engines/sci/sound/music.h +++ b/engines/sci/sound/music.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef SCI_MUSIC_H diff --git a/engines/sci/sound/soundcmd.cpp b/engines/sci/sound/soundcmd.cpp index a2b09eab4c..4ea290ff9e 100644 --- a/engines/sci/sound/soundcmd.cpp +++ b/engines/sci/sound/soundcmd.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/config-manager.h" diff --git a/engines/sci/sound/soundcmd.h b/engines/sci/sound/soundcmd.h index cae72e2cdb..a542a8b384 100644 --- a/engines/sci/sound/soundcmd.h +++ b/engines/sci/sound/soundcmd.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef SCI_SOUNDCMD_H diff --git a/engines/sci/util.cpp b/engines/sci/util.cpp index f346adddeb..4f09bb7a55 100644 --- a/engines/sci/util.cpp +++ b/engines/sci/util.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/endian.h" diff --git a/engines/sci/util.h b/engines/sci/util.h index 7a2abb1873..0da5063a69 100644 --- a/engines/sci/util.h +++ b/engines/sci/util.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef SCI_UTIL_H diff --git a/engines/sci/video/robot_decoder.cpp b/engines/sci/video/robot_decoder.cpp index debc75dffd..d394fd0b2b 100644 --- a/engines/sci/video/robot_decoder.cpp +++ b/engines/sci/video/robot_decoder.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/archive.h" diff --git a/engines/sci/video/robot_decoder.h b/engines/sci/video/robot_decoder.h index aeb638e019..3f93582418 100644 --- a/engines/sci/video/robot_decoder.h +++ b/engines/sci/video/robot_decoder.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef SCI_VIDEO_ROBOT_DECODER_H diff --git a/engines/sci/video/seq_decoder.cpp b/engines/sci/video/seq_decoder.cpp index 7168496893..abd64911a7 100644 --- a/engines/sci/video/seq_decoder.cpp +++ b/engines/sci/video/seq_decoder.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/endian.h" diff --git a/engines/sci/video/seq_decoder.h b/engines/sci/video/seq_decoder.h index 70d3985ec5..f5e8ad9b05 100644 --- a/engines/sci/video/seq_decoder.h +++ b/engines/sci/video/seq_decoder.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef SCI_VIDEO_SEQ_DECODER_H diff --git a/engines/scumm/actor.cpp b/engines/scumm/actor.cpp index 13581c4b45..25a26f6cf2 100644 --- a/engines/scumm/actor.cpp +++ b/engines/scumm/actor.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/system.h" // for setFocusRectangle/clearFocusRectangle @@ -177,9 +174,21 @@ void Actor::setBox(int box) { } void Actor_v3::setupActorScale() { - // TODO: The following could probably be removed - _scalex = 0xFF; - _scaley = 0xFF; + // WORKAROUND bug #1463598: Under certain circumstances, it is possible + // for Henry Sr. to reach the front side of Castle Brunwald (following + // Indy there). But it seems the game has no small costume for Henry, + // hence he is shown as a giant, triple in size compared to Indy. + // To workaround this, we override the scale of Henry. Since V3 games + // like Indy3 don't use the costume scale otherwise, this works fine. + // The scale factor 0x50 was determined by some guess work. + if (_number == 2 && _costume == 7 && _vm->_game.id == GID_INDY3 && _vm->_currentRoom == 12) { + _scalex = 0x50; + _scaley = 0x50; + } else { + // TODO: The following could probably be removed + _scalex = 0xFF; + _scaley = 0xFF; + } } void Actor::setupActorScale() { diff --git a/engines/scumm/actor.h b/engines/scumm/actor.h index 8e699b5a49..1584d0a78b 100644 --- a/engines/scumm/actor.h +++ b/engines/scumm/actor.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ diff --git a/engines/scumm/actor_he.h b/engines/scumm/actor_he.h index bb7bbb6487..24b632d00e 100644 --- a/engines/scumm/actor_he.h +++ b/engines/scumm/actor_he.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ diff --git a/engines/scumm/akos.cpp b/engines/scumm/akos.cpp index 8acbb8058e..b6acf01050 100644 --- a/engines/scumm/akos.cpp +++ b/engines/scumm/akos.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "scumm/scumm.h" @@ -30,6 +27,7 @@ #include "scumm/imuse/imuse.h" #include "scumm/imuse_digi/dimuse.h" #include "scumm/he/intern_he.h" +#include "scumm/resource.h" #include "scumm/scumm_v7.h" #include "scumm/sound.h" #include "scumm/util.h" diff --git a/engines/scumm/akos.h b/engines/scumm/akos.h index 9f4f09d4dc..bd42aedcbd 100644 --- a/engines/scumm/akos.h +++ b/engines/scumm/akos.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef SCUMM_AKOS_H diff --git a/engines/scumm/base-costume.cpp b/engines/scumm/base-costume.cpp index 2aecb3dfdd..46c68c81b0 100644 --- a/engines/scumm/base-costume.cpp +++ b/engines/scumm/base-costume.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ diff --git a/engines/scumm/base-costume.h b/engines/scumm/base-costume.h index d586b211f3..652655c24e 100644 --- a/engines/scumm/base-costume.h +++ b/engines/scumm/base-costume.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef SCUMM_BASE_COSTUME_H diff --git a/engines/scumm/bomp.cpp b/engines/scumm/bomp.cpp index 18db89be1f..845cf70722 100644 --- a/engines/scumm/bomp.cpp +++ b/engines/scumm/bomp.cpp @@ -17,9 +17,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ diff --git a/engines/scumm/bomp.h b/engines/scumm/bomp.h index 8f64b54f7c..b2d042daae 100644 --- a/engines/scumm/bomp.h +++ b/engines/scumm/bomp.h @@ -17,9 +17,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef SCUMM_BOMP_H diff --git a/engines/scumm/boxes.cpp b/engines/scumm/boxes.cpp index 15d5f04ed5..ba4dedfbd3 100644 --- a/engines/scumm/boxes.cpp +++ b/engines/scumm/boxes.cpp @@ -18,14 +18,12 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "scumm/scumm.h" #include "scumm/actor.h" #include "scumm/boxes.h" +#include "scumm/resource.h" #include "scumm/scumm_v0.h" #include "scumm/scumm_v6.h" #include "scumm/util.h" diff --git a/engines/scumm/boxes.h b/engines/scumm/boxes.h index a93c9f4919..e554aea1b5 100644 --- a/engines/scumm/boxes.h +++ b/engines/scumm/boxes.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef SCUMM_BOXES_H diff --git a/engines/scumm/camera.cpp b/engines/scumm/camera.cpp index c12c956134..4b48acfbdb 100644 --- a/engines/scumm/camera.cpp +++ b/engines/scumm/camera.cpp @@ -17,9 +17,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "scumm/scumm.h" diff --git a/engines/scumm/charset-fontdata.cpp b/engines/scumm/charset-fontdata.cpp index 7f2bbd05b4..29465584f8 100644 --- a/engines/scumm/charset-fontdata.cpp +++ b/engines/scumm/charset-fontdata.cpp @@ -17,9 +17,6 @@ * 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. - * - * $URL$ - * $Id$ */ diff --git a/engines/scumm/charset.cpp b/engines/scumm/charset.cpp index 9fb76d9d63..dce6c9c144 100644 --- a/engines/scumm/charset.cpp +++ b/engines/scumm/charset.cpp @@ -17,9 +17,6 @@ * 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. - * - * $URL$ - * $Id$ */ diff --git a/engines/scumm/charset.h b/engines/scumm/charset.h index 4b2e053c6d..4c657b475e 100644 --- a/engines/scumm/charset.h +++ b/engines/scumm/charset.h @@ -17,9 +17,6 @@ * 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. - * - * $URL$ - * $Id$ */ #ifndef SCUMM_CHARSET_H diff --git a/engines/scumm/costume.cpp b/engines/scumm/costume.cpp index d0a3ec6e11..75cde5e33a 100644 --- a/engines/scumm/costume.cpp +++ b/engines/scumm/costume.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ diff --git a/engines/scumm/costume.h b/engines/scumm/costume.h index 367b86839d..3acf2a1f6c 100644 --- a/engines/scumm/costume.h +++ b/engines/scumm/costume.h @@ -17,9 +17,6 @@ * 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. - * - * $URL$ - * $Id$ */ #ifndef SCUMM_COSTUME_H diff --git a/engines/scumm/cursor.cpp b/engines/scumm/cursor.cpp index 820605924c..e9b5260eca 100644 --- a/engines/scumm/cursor.cpp +++ b/engines/scumm/cursor.cpp @@ -17,9 +17,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/system.h" diff --git a/engines/scumm/debugger.cpp b/engines/scumm/debugger.cpp index 4c1942b865..9cfdfbccc9 100644 --- a/engines/scumm/debugger.cpp +++ b/engines/scumm/debugger.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/debug-channels.h" @@ -34,6 +31,7 @@ #include "scumm/debugger.h" #include "scumm/imuse/imuse.h" #include "scumm/object.h" +#include "scumm/resource.h" #include "scumm/scumm.h" #include "scumm/sound.h" @@ -376,8 +374,8 @@ bool ScummDebugger::Cmd_Actor(int argc, const char **argv) { DebugPrintf("Actor[%d]._elevation = %d\n", actnum, a->getElevation()); _vm->_fullRedraw = true; } else if (!strcmp(argv[2], "costume")) { - if (value >= _vm->_res->num[rtCostume]) - DebugPrintf("Costume not changed as %d exceeds max of %d\n", value, _vm->_res->num[rtCostume]); + if (value >= (int)_vm->_res->_types[rtCostume].size()) + DebugPrintf("Costume not changed as %d exceeds max of %d\n", value, _vm->_res->_types[rtCostume].size()); else { a->setActorCostume(value); _vm->_fullRedraw = true; @@ -401,14 +399,15 @@ bool ScummDebugger::Cmd_PrintActor(int argc, const char **argv) { int i; Actor *a; - DebugPrintf("+-----------------------------------------------------------+\n"); - DebugPrintf("|# | x | y | w |elev|cos|box|mov| zp|frm|scl|dir| cls |\n"); - DebugPrintf("+--+----+----+---+----+---+---+---+---+---+---+---+---------+\n"); + DebugPrintf("+---------------------------------------------------------------+\n"); + DebugPrintf("|# | x | y | w | h |elev|cos|box|mov| zp|frm|scl|dir| cls |\n"); + DebugPrintf("+--+----+----+---+---+----+---+---+---+---+---+---+---+---------+\n"); for (i = 1; i < _vm->_numActors; i++) { a = _vm->_actors[i]; if (a->_visible) - DebugPrintf("|%2d|%4d|%4d|%3d|%4d|%3d|%3d|%3d|%3d|%3d|%3d|%3d|$%08x|\n", - a->_number, a->getRealPos().x, a->getRealPos().y, a->_width, a->getElevation(), + DebugPrintf("|%2d|%4d|%4d|%3d|%3d|%4d|%3d|%3d|%3d|%3d|%3d|%3d|%3d|$%08x|\n", + a->_number, a->getRealPos().x, a->getRealPos().y, a->_width, a->_bottom - a->_top, + a->getElevation(), a->_costume, a->_walkbox, a->_moving, a->_forceClip, a->_frame, a->_scalex, a->getFacing(), _vm->_classData[a->_number]); } diff --git a/engines/scumm/debugger.h b/engines/scumm/debugger.h index 9a85493bbe..a9b340d691 100644 --- a/engines/scumm/debugger.h +++ b/engines/scumm/debugger.h @@ -17,9 +17,6 @@ * 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. - * - * $URL$ - * $Id$ */ #ifndef SCUMM_DEBUGGER_H diff --git a/engines/scumm/detection.cpp b/engines/scumm/detection.cpp index 51b46b033c..bba26961c7 100644 --- a/engines/scumm/detection.cpp +++ b/engines/scumm/detection.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ // FIXME: Avoid using printf @@ -43,6 +40,7 @@ #include "scumm/scumm_v8.h" #include "scumm/file.h" #include "scumm/file_nes.h" +#include "scumm/resource.h" #include "engines/metaengine.h" @@ -70,7 +68,7 @@ static const MD5Table *findInMD5Table(const char *md5) { } Common::String ScummEngine::generateFilename(const int room) const { - const int diskNumber = (room > 0) ? _res->roomno[rtRoom][room] : 0; + const int diskNumber = (room > 0) ? _res->_types[rtRoom][room]._roomno : 0; char buf[128]; if (_game.version == 4) { @@ -112,7 +110,7 @@ Common::String ScummEngine_v60he::generateFilename(const int room) const { if (room < 0) { id = '0' - room; } else { - const int diskNumber = (room > 0) ? _res->roomno[rtRoom][room] : 0; + const int diskNumber = (room > 0) ? _res->_types[rtRoom][room]._roomno : 0; id = diskNumber + '0'; } @@ -1039,6 +1037,7 @@ Common::Error ScummMetaEngine::createInstance(OSystem *syst, Engine **engine) co // Simply use the first match DetectorResult res(*(results.begin())); debug(1, "Using gameid %s, variant %s, extra %s", res.game.gameid, res.game.variant, res.extra); + debug(1, " SCUMM version %d, HE version %d", res.game.version, res.game.heversion); // Print the MD5 of the game; either verbose using printf, in case of an // unknown MD5, or with a medium debug level in case of a known MD5 (for @@ -1157,7 +1156,7 @@ Common::Error ScummMetaEngine::createInstance(OSystem *syst, Engine **engine) co } const char *ScummMetaEngine::getName() const { - return "SCUMM Engine [" + return "SCUMM [" #if defined(ENABLE_SCUMM_7_8) && defined(ENABLE_HE) "all games" diff --git a/engines/scumm/detection.h b/engines/scumm/detection.h index 9b4ff929e2..720c4bb750 100644 --- a/engines/scumm/detection.h +++ b/engines/scumm/detection.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef SCUMM_DETECTION_H diff --git a/engines/scumm/detection_tables.h b/engines/scumm/detection_tables.h index 952abdb39a..7eb1e80132 100644 --- a/engines/scumm/detection_tables.h +++ b/engines/scumm/detection_tables.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef SCUMM_DETECTION_TABLES_H @@ -187,6 +184,8 @@ using Common::GUIO_NOLAUNCHLOAD; using Common::GUIO_NOMIDI; using Common::GUIO_NOSPEECH; using Common::GUIO_MIDITOWNS; +using Common::GUIO_MIDIADLIB; +using Common::GUIO_MIDIMT32; // The following table contains information about variants of our various // games. We index into it with help of md5table (from scumm-md5.h), to find @@ -245,11 +244,11 @@ static const GameSettings gameVariantsTable[] = { {"monkey", "SEGA", 0, GID_MONKEY, 5, 0, MDT_NONE, GF_AUDIOTRACKS, Common::kPlatformSegaCD, GUIO_NOSPEECH | GUIO_NOMIDI}, {"monkey2", "", 0, GID_MONKEY2, 5, 0, MDT_ADLIB | MDT_MIDI | MDT_PREFER_MT32, 0, UNK, GUIO_NOSPEECH}, - {"monkey2", "FM-TOWNS", 0, GID_MONKEY2, 5, 0, MDT_TOWNS | MDT_ADLIB | MDT_MIDI | MDT_PREFER_MT32, 0, Common::kPlatformFMTowns, GUIO_NOSPEECH}, + {"monkey2", "FM-TOWNS", 0, GID_MONKEY2, 5, 0, MDT_TOWNS | MDT_ADLIB | MDT_MIDI | MDT_PREFER_MT32, 0, Common::kPlatformFMTowns, GUIO_NOSPEECH | GUIO_MIDITOWNS | GUIO_MIDIADLIB | GUIO_MIDIMT32}, {"atlantis", "", 0, GID_INDY4, 5, 0, MDT_ADLIB | MDT_MIDI | MDT_PREFER_MT32, 0, UNK, GUIO_NONE}, {"atlantis", "Floppy", 0, GID_INDY4, 5, 0, MDT_ADLIB | MDT_MIDI | MDT_PREFER_MT32, 0, UNK, GUIO_NOSPEECH}, - {"atlantis", "FM-TOWNS", 0, GID_INDY4, 5, 0, MDT_TOWNS | MDT_ADLIB | MDT_MIDI | MDT_PREFER_MT32, 0, Common::kPlatformFMTowns, GUIO_NONE}, + {"atlantis", "FM-TOWNS", 0, GID_INDY4, 5, 0, MDT_TOWNS | MDT_ADLIB | MDT_MIDI | MDT_PREFER_MT32, 0, Common::kPlatformFMTowns, GUIO_MIDITOWNS | GUIO_MIDIADLIB | GUIO_MIDIMT32}, {"tentacle", "", 0, GID_TENTACLE, 6, 0, MDT_ADLIB | MDT_MIDI | MDT_PREFER_GM, GF_USE_KEY, UNK, GUIO_NONE}, {"tentacle", "Floppy", 0, GID_TENTACLE, 6, 0, MDT_ADLIB | MDT_MIDI | MDT_PREFER_GM, GF_USE_KEY, UNK, GUIO_NOSPEECH}, diff --git a/engines/scumm/dialogs.cpp b/engines/scumm/dialogs.cpp index e396d37e30..f7f0c7d7ec 100644 --- a/engines/scumm/dialogs.cpp +++ b/engines/scumm/dialogs.cpp @@ -17,9 +17,6 @@ * 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. - * - * $URL$ - * $Id$ */ #include "common/config-manager.h" diff --git a/engines/scumm/dialogs.h b/engines/scumm/dialogs.h index 40e549471b..c26aa9f414 100644 --- a/engines/scumm/dialogs.h +++ b/engines/scumm/dialogs.h @@ -17,9 +17,6 @@ * 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. - * - * $URL$ - * $Id$ */ #ifndef SCUMM_DIALOGS_H diff --git a/engines/scumm/file.cpp b/engines/scumm/file.cpp index 20050e5d4c..9c161ff1cc 100644 --- a/engines/scumm/file.cpp +++ b/engines/scumm/file.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "scumm/file.h" diff --git a/engines/scumm/file.h b/engines/scumm/file.h index 8a25277ded..d6dbc06ddc 100644 --- a/engines/scumm/file.h +++ b/engines/scumm/file.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef SCUMM_FILE_H diff --git a/engines/scumm/file_nes.cpp b/engines/scumm/file_nes.cpp index 47704d6eaf..0e7130973e 100644 --- a/engines/scumm/file_nes.cpp +++ b/engines/scumm/file_nes.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "scumm/file_nes.h" diff --git a/engines/scumm/file_nes.h b/engines/scumm/file_nes.h index f2ce3e19fd..2dfb6c54b3 100644 --- a/engines/scumm/file_nes.h +++ b/engines/scumm/file_nes.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef SCUMM_FILE_NES_H diff --git a/engines/scumm/gfx.cpp b/engines/scumm/gfx.cpp index e7abd5610e..08ae9fdd96 100644 --- a/engines/scumm/gfx.cpp +++ b/engines/scumm/gfx.cpp @@ -17,9 +17,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/system.h" @@ -221,6 +218,10 @@ Gdi::Gdi(ScummEngine *vm) : _vm(vm) { Gdi::~Gdi() { } +GdiHE::GdiHE(ScummEngine *vm) : Gdi(vm), _tmskPtr(0) { +} + + GdiNES::GdiNES(ScummEngine *vm) : Gdi(vm) { memset(&_NES, 0, sizeof(_NES)); } @@ -1503,6 +1504,15 @@ void Gdi::prepareDrawBitmap(const byte *ptr, VirtScreen *vs, // Do nothing by default } +void GdiHE::prepareDrawBitmap(const byte *ptr, VirtScreen *vs, + const int x, const int y, const int width, const int height, + int stripnr, int numstrip) { + if (_vm->_game.heversion >= 72) { + _tmskPtr = _vm->findResource(MKTAG('T','M','S','K'), ptr); + } else + _tmskPtr = 0; +} + void GdiV1::prepareDrawBitmap(const byte *ptr, VirtScreen *vs, const int x, const int y, const int width, const int height, int stripnr, int numstrip) { @@ -1748,11 +1758,6 @@ void Gdi::drawBitmap(const byte *ptr, VirtScreen *vs, int x, const int y, const numzbuf = getZPlanes(ptr, zplane_list, false); - const byte *tmsk_ptr = NULL; - if (_vm->_game.heversion >= 72) { - tmsk_ptr = _vm->findResource(MKTAG('T','M','S','K'), ptr); - } - if (y + height > vs->h) { warning("Gdi::drawBitmap, strip drawn to %d below window bottom %d", y + height, vs->h); } @@ -1815,7 +1820,7 @@ void Gdi::drawBitmap(const byte *ptr, VirtScreen *vs, int x, const int y, const clear8Col(frontBuf, vs->pitch, height, vs->format.bytesPerPixel); } - decodeMask(x, y, width, height, stripnr, numzbuf, zplane_list, transpStrip, flag, tmsk_ptr); + decodeMask(x, y, width, height, stripnr, numzbuf, zplane_list, transpStrip, flag); #if 0 // HACK: blit mask(s) onto normal screen. Useful to debug masking @@ -1904,7 +1909,7 @@ bool GdiV2::drawStrip(byte *dstPtr, VirtScreen *vs, int x, int y, const int widt void Gdi::decodeMask(int x, int y, const int width, const int height, int stripnr, int numzbuf, const byte *zplane_list[9], - bool transpStrip, byte flag, const byte *tmsk_ptr) { + bool transpStrip, byte flag) { int i; byte *mask_ptr; const byte *z_plane_ptr; @@ -1960,10 +1965,7 @@ void Gdi::decodeMask(int x, int y, const int width, const int height, if (offs) { z_plane_ptr = zplane_list[i] + offs; - if (tmsk_ptr) { - const byte *tmsk = tmsk_ptr + READ_LE_UINT16(tmsk_ptr + stripnr * 2 + 8); - decompressTMSK(mask_ptr, tmsk, z_plane_ptr, height); - } else if (transpStrip && (flag & dbAllowMaskOr)) { + if (transpStrip && (flag & dbAllowMaskOr)) { decompressMaskImgOr(mask_ptr, z_plane_ptr, height); } else { decompressMaskImg(mask_ptr, z_plane_ptr, height); @@ -1978,9 +1980,46 @@ void Gdi::decodeMask(int x, int y, const int width, const int height, } } +void GdiHE::decodeMask(int x, int y, const int width, const int height, + int stripnr, int numzbuf, const byte *zplane_list[9], + bool transpStrip, byte flag) { + int i; + byte *mask_ptr; + const byte *z_plane_ptr; + + for (i = 1; i < numzbuf; i++) { + uint32 offs; + + if (!zplane_list[i]) + continue; + + offs = READ_LE_UINT16(zplane_list[i] + stripnr * 2 + 8); + + mask_ptr = getMaskBuffer(x, y, i); + + if (offs) { + z_plane_ptr = zplane_list[i] + offs; + + if (_tmskPtr) { + const byte *tmsk = _tmskPtr + READ_LE_UINT16(_tmskPtr + stripnr * 2 + 8); + decompressTMSK(mask_ptr, tmsk, z_plane_ptr, height); + } else if (transpStrip && (flag & dbAllowMaskOr)) { + decompressMaskImgOr(mask_ptr, z_plane_ptr, height); + } else { + decompressMaskImg(mask_ptr, z_plane_ptr, height); + } + + } else { + if (!(transpStrip && (flag & dbAllowMaskOr))) + for (int h = 0; h < height; h++) + mask_ptr[h * _numStrips] = 0; + } + } +} + void GdiNES::decodeMask(int x, int y, const int width, const int height, int stripnr, int numzbuf, const byte *zplane_list[9], - bool transpStrip, byte flag, const byte *tmsk_ptr) { + bool transpStrip, byte flag) { byte *mask_ptr = getMaskBuffer(x, y, 1); drawStripNESMask(mask_ptr, stripnr, y, height); } @@ -1988,7 +2027,7 @@ void GdiNES::decodeMask(int x, int y, const int width, const int height, #ifdef USE_RGB_COLOR void GdiPCEngine::decodeMask(int x, int y, const int width, const int height, int stripnr, int numzbuf, const byte *zplane_list[9], - bool transpStrip, byte flag, const byte *tmsk_ptr) { + bool transpStrip, byte flag) { byte *mask_ptr = getMaskBuffer(x, y, 1); drawStripPCEngineMask(mask_ptr, stripnr, y, height); } @@ -1996,14 +2035,14 @@ void GdiPCEngine::decodeMask(int x, int y, const int width, const int height, void GdiV1::decodeMask(int x, int y, const int width, const int height, int stripnr, int numzbuf, const byte *zplane_list[9], - bool transpStrip, byte flag, const byte *tmsk_ptr) { + bool transpStrip, byte flag) { byte *mask_ptr = getMaskBuffer(x, y, 1); drawStripC64Mask(mask_ptr, stripnr, width, height); } void GdiV2::decodeMask(int x, int y, const int width, const int height, int stripnr, int numzbuf, const byte *zplane_list[9], - bool transpStrip, byte flag, const byte *tmsk_ptr) { + bool transpStrip, byte flag) { // Do nothing here for V2 games - zplane was already handled. } @@ -2371,7 +2410,7 @@ void Gdi::decompressMaskImg(byte *dst, const byte *src, int height) const { } } -void Gdi::decompressTMSK(byte *dst, const byte *tmsk, const byte *src, int height) const { +void GdiHE::decompressTMSK(byte *dst, const byte *tmsk, const byte *src, int height) const { byte srcbits = 0; byte srcFlag = 0; byte maskFlag = 0; diff --git a/engines/scumm/gfx.h b/engines/scumm/gfx.h index 3f69d75efd..6da07efd18 100644 --- a/engines/scumm/gfx.h +++ b/engines/scumm/gfx.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef SCUMM_GFX_H @@ -224,7 +221,6 @@ protected: virtual void writeRoomColor(byte *dst, byte color) const; /* Mask decompressors */ - void decompressTMSK(byte *dst, const byte *tmsk, const byte *src, int height) const; void decompressMaskImgOr(byte *dst, const byte *src, int height) const; void decompressMaskImg(byte *dst, const byte *src, int height) const; @@ -237,7 +233,7 @@ protected: virtual void decodeMask(int x, int y, const int width, const int height, int stripnr, int numzbuf, const byte *zplane_list[9], - bool transpStrip, byte flag, const byte *tmsk_ptr); + bool transpStrip, byte flag); virtual void prepareDrawBitmap(const byte *ptr, VirtScreen *vs, const int x, const int y, const int width, const int height, @@ -273,6 +269,24 @@ public: }; }; +class GdiHE : public Gdi { +protected: + const byte *_tmskPtr; + +protected: + void decompressTMSK(byte *dst, const byte *tmsk, const byte *src, int height) const; + + virtual void decodeMask(int x, int y, const int width, const int height, + int stripnr, int numzbuf, const byte *zplane_list[9], + bool transpStrip, byte flag); + + virtual void prepareDrawBitmap(const byte *ptr, VirtScreen *vs, + const int x, const int y, const int width, const int height, + int stripnr, int numstrip); +public: + GdiHE(ScummEngine *vm); +}; + class GdiNES : public Gdi { protected: struct { @@ -296,7 +310,7 @@ protected: virtual void decodeMask(int x, int y, const int width, const int height, int stripnr, int numzbuf, const byte *zplane_list[9], - bool transpStrip, byte flag, const byte *tmsk_ptr); + bool transpStrip, byte flag); virtual void prepareDrawBitmap(const byte *ptr, VirtScreen *vs, const int x, const int y, const int width, const int height, @@ -339,7 +353,7 @@ protected: virtual void decodeMask(int x, int y, const int width, const int height, int stripnr, int numzbuf, const byte *zplane_list[9], - bool transpStrip, byte flag, const byte *tmsk_ptr); + bool transpStrip, byte flag); virtual void prepareDrawBitmap(const byte *ptr, VirtScreen *vs, const int x, const int y, const int width, const int height, @@ -376,7 +390,7 @@ protected: virtual void decodeMask(int x, int y, const int width, const int height, int stripnr, int numzbuf, const byte *zplane_list[9], - bool transpStrip, byte flag, const byte *tmsk_ptr); + bool transpStrip, byte flag); virtual void prepareDrawBitmap(const byte *ptr, VirtScreen *vs, const int x, const int y, const int width, const int height, @@ -402,7 +416,7 @@ protected: virtual void decodeMask(int x, int y, const int width, const int height, int stripnr, int numzbuf, const byte *zplane_list[9], - bool transpStrip, byte flag, const byte *tmsk_ptr); + bool transpStrip, byte flag); virtual void prepareDrawBitmap(const byte *ptr, VirtScreen *vs, const int x, const int y, const int width, const int height, diff --git a/engines/scumm/gfxARM.s b/engines/scumm/gfxARM.s index 9f7c2949b3..92f8951466 100644 --- a/engines/scumm/gfxARM.s +++ b/engines/scumm/gfxARM.s @@ -18,9 +18,6 @@ @ along with this program@ if not, write to the Free Software @ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. @ -@ $URL$ -@ $Id$ -@ @ @author Robin Watts (robin@wss.co.uk) .text diff --git a/engines/scumm/gfx_towns.cpp b/engines/scumm/gfx_towns.cpp index 78c7ef23f1..82bb32cdfb 100644 --- a/engines/scumm/gfx_towns.cpp +++ b/engines/scumm/gfx_towns.cpp @@ -17,9 +17,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/endian.h" diff --git a/engines/scumm/he/animation_he.cpp b/engines/scumm/he/animation_he.cpp index e3e25c161c..74183c24d3 100644 --- a/engines/scumm/he/animation_he.cpp +++ b/engines/scumm/he/animation_he.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifdef ENABLE_HE diff --git a/engines/scumm/he/animation_he.h b/engines/scumm/he/animation_he.h index f5000bca59..b3405fead0 100644 --- a/engines/scumm/he/animation_he.h +++ b/engines/scumm/he/animation_he.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #if !defined(SCUMM_HE_ANIMATION_H) && defined(ENABLE_HE) diff --git a/engines/scumm/he/cup_player_he.cpp b/engines/scumm/he/cup_player_he.cpp index 5cd75a5c62..84562c12d5 100644 --- a/engines/scumm/he/cup_player_he.cpp +++ b/engines/scumm/he/cup_player_he.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifdef ENABLE_HE diff --git a/engines/scumm/he/cup_player_he.h b/engines/scumm/he/cup_player_he.h index 93146fdf85..15bc6b46ba 100644 --- a/engines/scumm/he/cup_player_he.h +++ b/engines/scumm/he/cup_player_he.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ diff --git a/engines/scumm/he/floodfill_he.cpp b/engines/scumm/he/floodfill_he.cpp index 026a848828..f9d53c6b12 100644 --- a/engines/scumm/he/floodfill_he.cpp +++ b/engines/scumm/he/floodfill_he.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifdef ENABLE_HE diff --git a/engines/scumm/he/floodfill_he.h b/engines/scumm/he/floodfill_he.h index cfc672436c..3f62cc9b81 100644 --- a/engines/scumm/he/floodfill_he.h +++ b/engines/scumm/he/floodfill_he.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #if !defined(SCUMM_HE_FLOODFILL_HE_H) && defined(ENABLE_HE) diff --git a/engines/scumm/he/intern_he.h b/engines/scumm/he/intern_he.h index 830e940322..c49217b650 100644 --- a/engines/scumm/he/intern_he.h +++ b/engines/scumm/he/intern_he.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef SCUMM_HE_INTERN_HE_H @@ -132,8 +129,8 @@ public: protected: virtual void allocateArrays(); - virtual int readResTypeList(int id); - virtual uint32 getResourceRoomOffset(int type, int idx); + virtual int readResTypeList(ResType type); + virtual uint32 getResourceRoomOffset(ResType type, ResId idx); virtual void setupOpcodes(); virtual void setupScummVars(); @@ -268,7 +265,7 @@ protected: virtual void resetScummVars(); virtual void readArrayFromIndexFile(); - virtual byte *getStringAddress(int i); + virtual byte *getStringAddress(ResId idx); virtual void readMAXS(int blockSize); virtual void redrawBGAreas(); @@ -292,7 +289,7 @@ protected: void copyScriptString(byte *dst, int dstSize); int findObject(int x, int y, int num, int *args); - int getSoundResourceSize(int id); + int getSoundResourceSize(ResId idx); virtual bool handleNextCharsetCode(Actor *a, int *c); virtual int convertMessageToString(const byte *msg, byte *dst, int dstSize); @@ -557,7 +554,8 @@ protected: class ScummEngine_v100he : public ScummEngine_v99he { protected: - int32 _heResId, _heResType; + ResType _heResType; + int32 _heResId; byte _debugInputBuffer[256]; public: diff --git a/engines/scumm/he/logic_he.cpp b/engines/scumm/he/logic_he.cpp index 297c2992db..a7d808e316 100644 --- a/engines/scumm/he/logic_he.cpp +++ b/engines/scumm/he/logic_he.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifdef ENABLE_HE diff --git a/engines/scumm/he/logic_he.h b/engines/scumm/he/logic_he.h index d097d37e75..e05a05f310 100644 --- a/engines/scumm/he/logic_he.h +++ b/engines/scumm/he/logic_he.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #if !defined(SCUMM_HE_LOGIC_HE_H) && defined(ENABLE_HE) diff --git a/engines/scumm/he/palette_he.cpp b/engines/scumm/he/palette_he.cpp index 49e43a040b..44ba841644 100644 --- a/engines/scumm/he/palette_he.cpp +++ b/engines/scumm/he/palette_he.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifdef ENABLE_HE diff --git a/engines/scumm/he/resource_he.cpp b/engines/scumm/he/resource_he.cpp index ecb094f29b..6b195bec84 100644 --- a/engines/scumm/he/resource_he.cpp +++ b/engines/scumm/he/resource_he.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "scumm/scumm.h" @@ -32,6 +29,7 @@ #include "audio/decoders/wave.h" #include "graphics/cursorman.h" +#include "graphics/maccursor.h" #include "graphics/wincursor.h" #include "common/archive.h" @@ -172,11 +170,49 @@ bool MacResExtractor::extractResource(int id, CachedCursor *cc) { if (!dataStream) return false; - int keyColor; // HACK: key color is ignored - _resMgr->convertCrsrCursor(dataStream, &cc->bitmap, cc->width, cc->height, cc->hotspotX, cc->hotspotY, - keyColor, _vm->_system->hasFeature(OSystem::kFeatureCursorHasPalette), - &cc->palette, cc->palSize); + // If we don't have a cursor palette, force monochrome cursors + bool forceMonochrome = !_vm->_system->hasFeature(OSystem::kFeatureCursorHasPalette); + + Graphics::MacCursor *macCursor = new Graphics::MacCursor(); + + if (!macCursor->readFromStream(*dataStream, forceMonochrome)) { + delete dataStream; + delete macCursor; + return false; + } + + cc->bitmap = new byte[macCursor->getWidth() * macCursor->getHeight()]; + cc->width = macCursor->getWidth(); + cc->height = macCursor->getHeight(); + cc->hotspotX = macCursor->getHotspotX(); + cc->hotspotY = macCursor->getHotspotY(); + + if (forceMonochrome) { + // Convert to the SCUMM palette + const byte *srcBitmap = macCursor->getSurface(); + + for (int i = 0; i < macCursor->getWidth() * macCursor->getHeight(); i++) { + if (srcBitmap[i] == macCursor->getKeyColor()) // Transparent + cc->bitmap[i] = 255; + else if (srcBitmap[i] == 0) // Black + cc->bitmap[i] = 253; + else // White + cc->bitmap[i] = 254; + } + } else { + // Copy data and palette + // Sanity check. This code assumes that the key color is the same + assert(macCursor->getKeyColor() == 255); + + memcpy(cc->bitmap, macCursor->getSurface(), macCursor->getWidth() * macCursor->getHeight()); + + cc->palette = new byte[256 * 3]; + cc->palSize = 256; + memcpy(cc->palette, macCursor->getPalette(), 256 * 3); + } + + delete macCursor; delete dataStream; return true; } @@ -190,7 +226,7 @@ void ScummEngine_v70he::readRoomsOffsets() { num = READ_LE_UINT16(_heV7RoomOffsets); ptr = _heV7RoomOffsets + 2; for (i = 0; i < num; i++) { - _res->roomoffs[rtRoom][i] = READ_LE_UINT32(ptr); + _res->_types[rtRoom][i]._roomoffs = READ_LE_UINT32(ptr); ptr += 4; } } @@ -217,8 +253,6 @@ void ScummEngine_v70he::readGlobalObjects() { #ifdef ENABLE_HE void ScummEngine_v99he::readMAXS(int blockSize) { if (blockSize == 52) { - debug(0, "ScummEngine_v99he readMAXS: MAXS has blocksize %d", blockSize); - _numVariables = _fileHandle->readUint16LE(); _fileHandle->readUint16LE(); _numRoomVariables = _fileHandle->readUint16LE(); @@ -251,8 +285,6 @@ void ScummEngine_v99he::readMAXS(int blockSize) { void ScummEngine_v90he::readMAXS(int blockSize) { if (blockSize == 46) { - debug(0, "ScummEngine_v90he readMAXS: MAXS has blocksize %d", blockSize); - _numVariables = _fileHandle->readUint16LE(); _fileHandle->readUint16LE(); _numRoomVariables = _fileHandle->readUint16LE(); @@ -285,8 +317,6 @@ void ScummEngine_v90he::readMAXS(int blockSize) { void ScummEngine_v72he::readMAXS(int blockSize) { if (blockSize == 40) { - debug(0, "ScummEngine_v72he readMAXS: MAXS has blocksize %d", blockSize); - _numVariables = _fileHandle->readUint16LE(); _fileHandle->readUint16LE(); _numBitVariables = _numRoomVariables = _fileHandle->readUint16LE(); @@ -311,14 +341,14 @@ void ScummEngine_v72he::readMAXS(int blockSize) { ScummEngine_v6::readMAXS(blockSize); } -byte *ScummEngine_v72he::getStringAddress(int i) { - byte *addr = getResourceAddress(rtString, i); +byte *ScummEngine_v72he::getStringAddress(ResId idx) { + byte *addr = getResourceAddress(rtString, idx); if (addr == NULL) return NULL; return ((ScummEngine_v72he::ArrayHeader *)addr)->data; } -int ScummEngine_v72he::getSoundResourceSize(int id) { +int ScummEngine_v72he::getSoundResourceSize(ResId id) { const byte *ptr; int offs, size; diff --git a/engines/scumm/he/resource_he.h b/engines/scumm/he/resource_he.h index 5d7c70db76..9978869ffc 100644 --- a/engines/scumm/he/resource_he.h +++ b/engines/scumm/he/resource_he.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef SCUMM_HE_RESOURCE_HE_H diff --git a/engines/scumm/he/script_v100he.cpp b/engines/scumm/he/script_v100he.cpp index 69063a1837..e057ab524a 100644 --- a/engines/scumm/he/script_v100he.cpp +++ b/engines/scumm/he/script_v100he.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifdef ENABLE_HE @@ -2353,10 +2350,10 @@ void ScummEngine_v100he::o100_debugInput() { void ScummEngine_v100he::o100_isResourceLoaded() { // Reports percentage of resource loaded by queue - int type; + ResType type; byte subOp = fetchScriptByte(); - /* int idx = */ pop(); + int idx = pop(); switch (subOp) { case 25: @@ -2377,13 +2374,15 @@ void ScummEngine_v100he::o100_isResourceLoaded() { default: error("o100_isResourceLoaded: default case %d", subOp); } + debug(7, "o100_isResourceLoaded(%d,%d)", type, idx); push(100); } void ScummEngine_v100he::o100_getResourceSize() { const byte *ptr; - int size, type; + int size; + ResType type; int resid = pop(); byte subOp = fetchScriptByte(); @@ -2402,7 +2401,7 @@ void ScummEngine_v100he::o100_getResourceSize() { type = rtScript; break; case 72: - push (getSoundResourceSize(resid)); + push(getSoundResourceSize(resid)); return; default: error("o100_getResourceSize: default type %d", subOp); diff --git a/engines/scumm/he/script_v60he.cpp b/engines/scumm/he/script_v60he.cpp index 7ecabd55e1..fb070b3e27 100644 --- a/engines/scumm/he/script_v60he.cpp +++ b/engines/scumm/he/script_v60he.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/archive.h" diff --git a/engines/scumm/he/script_v70he.cpp b/engines/scumm/he/script_v70he.cpp index 9b160151b0..adb2fcac2e 100644 --- a/engines/scumm/he/script_v70he.cpp +++ b/engines/scumm/he/script_v70he.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/config-manager.h" @@ -364,10 +361,10 @@ void ScummEngine_v70he::o70_getStringLen() { void ScummEngine_v70he::o70_isResourceLoaded() { // Reports percentage of resource loaded by queue - int type; + ResType type; byte subOp = fetchScriptByte(); - /* int idx = */ pop(); + int idx = pop(); switch (subOp) { case 18: @@ -388,6 +385,7 @@ void ScummEngine_v70he::o70_isResourceLoaded() { default: error("o70_isResourceLoaded: default case %d", subOp); } + debug(7, "o70_isResourceLoaded(%d,%d)", type, idx); push(100); } diff --git a/engines/scumm/he/script_v71he.cpp b/engines/scumm/he/script_v71he.cpp index a800a7d85c..3ad9220ac5 100644 --- a/engines/scumm/he/script_v71he.cpp +++ b/engines/scumm/he/script_v71he.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifdef ENABLE_HE diff --git a/engines/scumm/he/script_v72he.cpp b/engines/scumm/he/script_v72he.cpp index 17bd29d826..8f16bf0f3a 100644 --- a/engines/scumm/he/script_v72he.cpp +++ b/engines/scumm/he/script_v72he.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifdef ENABLE_HE @@ -624,15 +621,15 @@ void ScummEngine_v72he::o72_getArrayDimSize() { } void ScummEngine_v72he::o72_getNumFreeArrays() { - byte **addr = _res->address[rtString]; + const ResourceManager::ResTypeData &rtd = _res->_types[rtString]; int i, num = 0; for (i = 1; i < _numArray; i++) { - if (!addr[i]) + if (!rtd[i]._address) num++; } - push (num); + push(num); } void ScummEngine_v72he::o72_roomOps() { @@ -1914,7 +1911,8 @@ void ScummEngine_v72he::o72_writeINI() { void ScummEngine_v72he::o72_getResourceSize() { const byte *ptr; - int size, type; + int size; + ResType type; int resid = pop(); if (_game.heversion == 72) { @@ -1926,7 +1924,7 @@ void ScummEngine_v72he::o72_getResourceSize() { switch (subOp) { case 13: - push (getSoundResourceSize(resid)); + push(getSoundResourceSize(resid)); return; case 14: type = rtRoomImage; diff --git a/engines/scumm/he/script_v80he.cpp b/engines/scumm/he/script_v80he.cpp index c225be4b6c..7970d7806f 100644 --- a/engines/scumm/he/script_v80he.cpp +++ b/engines/scumm/he/script_v80he.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifdef ENABLE_HE diff --git a/engines/scumm/he/script_v90he.cpp b/engines/scumm/he/script_v90he.cpp index 1a38a99f17..6b632d8ff2 100644 --- a/engines/scumm/he/script_v90he.cpp +++ b/engines/scumm/he/script_v90he.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifdef ENABLE_HE diff --git a/engines/scumm/he/sound_he.cpp b/engines/scumm/he/sound_he.cpp index 4fd7caebf5..5c15a85929 100644 --- a/engines/scumm/he/sound_he.cpp +++ b/engines/scumm/he/sound_he.cpp @@ -18,14 +18,12 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "scumm/actor.h" #include "scumm/file.h" #include "scumm/imuse/imuse.h" +#include "scumm/resource.h" #include "scumm/scumm.h" #include "scumm/he/sound_he.h" #include "scumm/he/intern_he.h" @@ -304,13 +302,13 @@ void SoundHE::setOverrideFreq(int freq) { } void SoundHE::setupHEMusicFile() { - int i, total_size; + int i; Common::File musicFile; Common::String buf(_vm->generateFilename(-4)); if (musicFile.open(buf) == true) { musicFile.seek(4, SEEK_SET); - total_size = musicFile.readUint32BE(); + /*int total_size =*/ musicFile.readUint32BE(); musicFile.seek(16, SEEK_SET); _heMusicTracks = musicFile.readUint32LE(); debug(5, "Total music tracks %d", _heMusicTracks); diff --git a/engines/scumm/he/sound_he.h b/engines/scumm/he/sound_he.h index f3a881972e..f487acc7da 100644 --- a/engines/scumm/he/sound_he.h +++ b/engines/scumm/he/sound_he.h @@ -17,9 +17,6 @@ * 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. - * - * $URL$ - * $Id$ */ #ifndef SCUMM_HE_SOUND_HE_H diff --git a/engines/scumm/he/sprite_he.cpp b/engines/scumm/he/sprite_he.cpp index c66eed6ae6..0b37673e4a 100644 --- a/engines/scumm/he/sprite_he.cpp +++ b/engines/scumm/he/sprite_he.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifdef ENABLE_HE diff --git a/engines/scumm/he/sprite_he.h b/engines/scumm/he/sprite_he.h index 73a05af579..d28c9f1944 100644 --- a/engines/scumm/he/sprite_he.h +++ b/engines/scumm/he/sprite_he.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #if !defined(SCUMM_HE_SPRITE_HE_H) && defined(ENABLE_HE) diff --git a/engines/scumm/he/wiz_he.cpp b/engines/scumm/he/wiz_he.cpp index 16cbadd65b..4107034fe6 100644 --- a/engines/scumm/he/wiz_he.cpp +++ b/engines/scumm/he/wiz_he.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifdef ENABLE_HE diff --git a/engines/scumm/he/wiz_he.h b/engines/scumm/he/wiz_he.h index c255e27d14..ce3fbc27c6 100644 --- a/engines/scumm/he/wiz_he.h +++ b/engines/scumm/he/wiz_he.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #if !defined(SCUMM_HE_WIZ_HE_H) && defined(ENABLE_HE) diff --git a/engines/scumm/help.cpp b/engines/scumm/help.cpp index a3bb85ab42..59bf79658e 100644 --- a/engines/scumm/help.cpp +++ b/engines/scumm/help.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ diff --git a/engines/scumm/help.h b/engines/scumm/help.h index 152dc99c3e..9763da8c00 100644 --- a/engines/scumm/help.h +++ b/engines/scumm/help.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef SCUMM_HELP_H diff --git a/engines/scumm/imuse/imuse.cpp b/engines/scumm/imuse/imuse.cpp index 07fd99c809..fe23b88e52 100644 --- a/engines/scumm/imuse/imuse.cpp +++ b/engines/scumm/imuse/imuse.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ @@ -33,6 +30,7 @@ #include "scumm/imuse/imuse.h" #include "scumm/imuse/imuse_internal.h" #include "scumm/imuse/instrument.h" +#include "scumm/resource.h" #include "scumm/saveload.h" #include "scumm/scumm.h" @@ -50,7 +48,6 @@ _enable_gs(false), _sc55(false), _midi_adlib(NULL), _midi_native(NULL), -_base_sounds(NULL), _sysex(NULL), _paused(false), _initialized(false), @@ -103,11 +100,9 @@ IMuseInternal::~IMuseInternal() { } byte *IMuseInternal::findStartOfSound(int sound) { - byte *ptr = NULL; int32 size, pos; - if (_base_sounds) - ptr = _base_sounds[sound]; + byte *ptr = g_scumm->_res->_types[rtSound][sound]._address; if (ptr == NULL) { debug(1, "IMuseInternal::findStartOfSound(): Sound %d doesn't exist", sound); @@ -115,12 +110,12 @@ byte *IMuseInternal::findStartOfSound(int sound) { } // Check for old-style headers first, like 'RO' - if (ptr[4] == 'R' && ptr[5] == 'O'&& ptr[6] != 'L') + if (ptr[0] == 'R' && ptr[1] == 'O'&& ptr[2] != 'L') + return ptr; + if (ptr[4] == 'S' && ptr[5] == 'O') return ptr + 4; - if (ptr[8] == 'S' && ptr[9] == 'O') - return ptr + 8; - ptr += 8; + ptr += 4; size = READ_BE_UINT32(ptr); ptr += 4; @@ -139,16 +134,11 @@ byte *IMuseInternal::findStartOfSound(int sound) { } bool IMuseInternal::isMT32(int sound) { - byte *ptr = NULL; - uint32 tag; - - if (_base_sounds) - ptr = _base_sounds[sound]; - + byte *ptr = g_scumm->_res->_types[rtSound][sound]._address; if (ptr == NULL) return false; - tag = READ_BE_UINT32(ptr + 4); + uint32 tag = READ_BE_UINT32(ptr); switch (tag) { case MKTAG('A','D','L',' '): case MKTAG('A','S','F','X'): // Special AD class for old AdLib sound effects @@ -167,17 +157,17 @@ bool IMuseInternal::isMT32(int sound) { case MKTAG('M','I','D','I'): // Occurs in Sam & Max // HE games use Roland music - if (ptr[12] == 'H' && ptr[13] == 'S') + if (ptr[8] == 'H' && ptr[9] == 'S') return true; else return false; } // Old style 'RO' has equivalent properties to 'ROL' - if (ptr[4] == 'R' && ptr[5] == 'O') + if (ptr[0] == 'R' && ptr[1] == 'O') return true; // Euphony tracks show as 'SO' and have equivalent properties to 'ADL' - if (ptr[8] == 'S' && ptr[9] == 'O') + if (ptr[4] == 'S' && ptr[5] == 'O') return false; error("Unknown music type: '%c%c%c%c'", (char)tag >> 24, (char)tag >> 16, (char)tag >> 8, (char)tag); @@ -186,16 +176,11 @@ bool IMuseInternal::isMT32(int sound) { } bool IMuseInternal::isMIDI(int sound) { - byte *ptr = NULL; - uint32 tag; - - if (_base_sounds) - ptr = _base_sounds[sound]; - + byte *ptr = g_scumm->_res->_types[rtSound][sound]._address; if (ptr == NULL) return false; - tag = READ_BE_UINT32(ptr + 4); + uint32 tag = READ_BE_UINT32(ptr); switch (tag) { case MKTAG('A','D','L',' '): case MKTAG('A','S','F','X'): // Special AD class for old AdLib sound effects @@ -215,11 +200,11 @@ bool IMuseInternal::isMIDI(int sound) { } // Old style 'RO' has equivalent properties to 'ROL' - if (ptr[4] == 'R' && ptr[5] == 'O') + if (ptr[0] == 'R' && ptr[1] == 'O') return true; // Euphony tracks show as 'SO' and have equivalent properties to 'ADL' // FIXME: Right now we're pretending it's GM. - if (ptr[8] == 'S' && ptr[9] == 'O') + if (ptr[4] == 'S' && ptr[5] == 'O') return true; error("Unknown music type: '%c%c%c%c'", (char)tag >> 24, (char)tag >> 16, (char)tag >> 8, (char)tag); @@ -426,11 +411,6 @@ int32 IMuseInternal::doCommand(int numargs, int a[]) { return doCommand_internal(numargs, a); } -void IMuseInternal::setBase(byte **base) { - Common::StackLock lock(_mutex, "IMuseInternal::setBase()"); - _base_sounds = base; -} - uint32 IMuseInternal::property(int prop, uint32 value) { Common::StackLock lock(_mutex, "IMuseInternal::property()"); switch (prop) { @@ -645,6 +625,7 @@ int IMuseInternal::stopSound_internal(int sound) { } int IMuseInternal::stopAllSounds_internal() { + clear_queue(); Player *player = _players; for (int i = ARRAYSIZE(_players); i; i--, player++) { if (player->isActive()) @@ -945,54 +926,22 @@ void IMuseInternal::sequencer_timers(MidiDriver *midi) { } void IMuseInternal::handle_marker(uint id, byte data) { - uint16 *p = 0; - uint pos; - - if (_queue_adding && _queue_sound == id && data == _queue_marker) + if ((_queue_end == _queue_pos) || (_queue_adding && _queue_sound == id && data == _queue_marker)) return; - // Fix for bug #733401, revised for bug #761637: - // It would seem that sometimes a marker is in the queue - // but not at the head position. In the case of our bug, - // this seems to be the result of commands in the queue - // for songs that are no longer playing. So we skip - // ahead to the appropriate marker, effectively chomping - // anything in the queue before it. This fixes the FOA - // end credits music, but needs to be tested for inappopriate - // behavior elsewhere. - pos = _queue_end; - while (pos != _queue_pos) { - p = _cmd_queue[pos].array; - if (p[0] == TRIGGER_ID && p[1] == id && p[2] == data) - break; - pos = (pos + 1) % ARRAYSIZE(_cmd_queue); - } - - if (pos == _queue_pos) + uint16 *p = _cmd_queue[_queue_end].array; + if (p[0] != TRIGGER_ID || id != p[1] || data != p[2]) return; - if (pos != _queue_end) - debug(0, "Skipping entries in iMuse command queue to reach marker"); - _trigger_count--; _queue_cleared = false; - do { - pos = (pos + 1) % ARRAYSIZE(_cmd_queue); - if (_queue_pos == pos) - break; - p = _cmd_queue[pos].array; - if (*p++ != COMMAND_ID) - break; - _queue_end = pos; - - doCommand_internal(p[0], p[1], p[2], p[3], p[4], p[5], p[6], 0); - - if (_queue_cleared) - return; - pos = _queue_end; - } while (1); - - _queue_end = pos; + _queue_end = (_queue_end + 1) % ARRAYSIZE(_cmd_queue); + + while (_queue_end != _queue_pos && _cmd_queue[_queue_end].array[0] == COMMAND_ID && !_queue_cleared) { + p = _cmd_queue[_queue_end].array; + doCommand_internal(p[1], p[2], p[3], p[4], p[5], p[6], p[7], 0); + _queue_end = (_queue_end + 1) % ARRAYSIZE(_cmd_queue); + } } int IMuseInternal::get_channel_volume(uint a) { diff --git a/engines/scumm/imuse/imuse.h b/engines/scumm/imuse/imuse.h index 1e3b0fd756..8014b13409 100644 --- a/engines/scumm/imuse/imuse.h +++ b/engines/scumm/imuse/imuse.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef SCUMM_IMUSE_H @@ -68,7 +65,6 @@ public: virtual bool get_sound_active(int sound) const = 0; virtual int32 doCommand(int numargs, int args[]) = 0; virtual int clear_queue() = 0; - virtual void setBase(byte **base) = 0; virtual uint32 property(int prop, uint32 value) = 0; virtual void addSysexHandler (byte mfgID, sysexfunc handler) = 0; diff --git a/engines/scumm/imuse/imuse_internal.h b/engines/scumm/imuse/imuse_internal.h index 7d46650d2e..ec60b22509 100644 --- a/engines/scumm/imuse/imuse_internal.h +++ b/engines/scumm/imuse/imuse_internal.h @@ -17,9 +17,6 @@ * 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. - * - * $URL$ - * $Id$ */ #ifndef SCUMM_IMUSE_INTERNAL @@ -397,7 +394,6 @@ protected: TimerCallbackInfo _timer_info_native; uint32 _game_id; - byte **_base_sounds; // Plug-in SysEx handling. Right now this only supports one // custom SysEx handler for the hardcoded IMUSE_SYSEX_ID @@ -513,7 +509,6 @@ public: int save_or_load(Serializer *ser, ScummEngine *scumm); bool get_sound_active(int sound) const; int32 doCommand(int numargs, int args[]); - void setBase(byte **base); uint32 property(int prop, uint32 value); virtual void addSysexHandler(byte mfgID, sysexfunc handler); diff --git a/engines/scumm/imuse/imuse_part.cpp b/engines/scumm/imuse/imuse_part.cpp index 487429c294..808af23dde 100644 --- a/engines/scumm/imuse/imuse_part.cpp +++ b/engines/scumm/imuse/imuse_part.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ diff --git a/engines/scumm/imuse/imuse_player.cpp b/engines/scumm/imuse/imuse_player.cpp index 4d185d94d7..e7ee935130 100644 --- a/engines/scumm/imuse/imuse_player.cpp +++ b/engines/scumm/imuse/imuse_player.cpp @@ -17,9 +17,6 @@ * 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. - * - * $URL$ - * $Id$ */ diff --git a/engines/scumm/imuse/instrument.cpp b/engines/scumm/imuse/instrument.cpp index 02996c53d3..955700fc2b 100644 --- a/engines/scumm/imuse/instrument.cpp +++ b/engines/scumm/imuse/instrument.cpp @@ -17,9 +17,6 @@ * 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. - * - * $URL$ - * $Id$ */ diff --git a/engines/scumm/imuse/instrument.h b/engines/scumm/imuse/instrument.h index f6108daf16..3555d319e6 100644 --- a/engines/scumm/imuse/instrument.h +++ b/engines/scumm/imuse/instrument.h @@ -17,9 +17,6 @@ * 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. - * - * $URL$ - * $Id$ */ #ifndef SCUMM_IMUSE_INSTRUMENT_H diff --git a/engines/scumm/imuse/sysex.h b/engines/scumm/imuse/sysex.h index bff80de9e7..7dd38e785e 100644 --- a/engines/scumm/imuse/sysex.h +++ b/engines/scumm/imuse/sysex.h @@ -17,9 +17,6 @@ * 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. - * - * $URL$ - * $Id$ */ #ifndef SCUMM_IMUSE_SYSEX_H diff --git a/engines/scumm/imuse/sysex_samnmax.cpp b/engines/scumm/imuse/sysex_samnmax.cpp index cdae767abf..4c4219e7bb 100644 --- a/engines/scumm/imuse/sysex_samnmax.cpp +++ b/engines/scumm/imuse/sysex_samnmax.cpp @@ -17,9 +17,6 @@ * 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. - * - * $URL$ - * $Id$ */ diff --git a/engines/scumm/imuse/sysex_scumm.cpp b/engines/scumm/imuse/sysex_scumm.cpp index 78028c6056..6ab71c2fa5 100644 --- a/engines/scumm/imuse/sysex_scumm.cpp +++ b/engines/scumm/imuse/sysex_scumm.cpp @@ -17,9 +17,6 @@ * 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. - * - * $URL$ - * $Id$ */ @@ -75,6 +72,7 @@ void sysexHandler_Scumm(Player *player, const byte *msg, uint16 len) { part->volume((p[5] & 0x0F) << 4 |(p[6] & 0x0F)); part->set_pan((p[7] & 0x0F) << 4 | (p[8] & 0x0F)); part->_percussion = player->_isMIDI ? ((p[9] & 0x08) > 0) : false; + part->set_detune((p[11] & 0x0F) << 4 | (p[12] & 0x0F)); part->pitchBendFactor((p[13] & 0x0F) << 4 | (p[14] & 0x0F)); if (part->_percussion) { if (part->_mc) { diff --git a/engines/scumm/imuse_digi/dimuse.cpp b/engines/scumm/imuse_digi/dimuse.cpp index 3831689def..23f57a01b9 100644 --- a/engines/scumm/imuse_digi/dimuse.cpp +++ b/engines/scumm/imuse_digi/dimuse.cpp @@ -17,9 +17,6 @@ * 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. - * - * $URL$ - * $Id$ */ #include "common/system.h" diff --git a/engines/scumm/imuse_digi/dimuse.h b/engines/scumm/imuse_digi/dimuse.h index 1e96aa8827..d940b6897f 100644 --- a/engines/scumm/imuse_digi/dimuse.h +++ b/engines/scumm/imuse_digi/dimuse.h @@ -17,9 +17,6 @@ * 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. - * - * $URL$ - * $Id$ */ #if !defined(SCUMM_IMUSE_DIGI_H) && defined(ENABLE_SCUMM_7_8) diff --git a/engines/scumm/imuse_digi/dimuse_bndmgr.cpp b/engines/scumm/imuse_digi/dimuse_bndmgr.cpp index cb894d77cc..d6e07bd0ec 100644 --- a/engines/scumm/imuse_digi/dimuse_bndmgr.cpp +++ b/engines/scumm/imuse_digi/dimuse_bndmgr.cpp @@ -17,9 +17,6 @@ * 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. - * - * $URL$ - * $Id$ */ diff --git a/engines/scumm/imuse_digi/dimuse_bndmgr.h b/engines/scumm/imuse_digi/dimuse_bndmgr.h index bed1ac6549..21d3110f8b 100644 --- a/engines/scumm/imuse_digi/dimuse_bndmgr.h +++ b/engines/scumm/imuse_digi/dimuse_bndmgr.h @@ -17,9 +17,6 @@ * 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. - * - * $URL$ - * $Id$ */ #ifndef SCUMM_IMUSE_DIGI_BUNDLE_MGR_H diff --git a/engines/scumm/imuse_digi/dimuse_codecs.cpp b/engines/scumm/imuse_digi/dimuse_codecs.cpp index c78e313fc2..69cd89320c 100644 --- a/engines/scumm/imuse_digi/dimuse_codecs.cpp +++ b/engines/scumm/imuse_digi/dimuse_codecs.cpp @@ -17,9 +17,6 @@ * 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. - * - * $URL$ - * $Id$ */ #include "common/scummsys.h" @@ -209,7 +206,7 @@ int32 decompressADPCM(byte *compInput, byte *compOutput, int channels) { int32 destPos; int16 firstWord; byte initialTablePos[MAX_CHANNELS] = {0, 0}; - int32 initialimcTableEntry[MAX_CHANNELS] = {7, 7}; + //int32 initialimcTableEntry[MAX_CHANNELS] = {7, 7}; int32 initialOutputWord[MAX_CHANNELS] = {0, 0}; int32 totalBitOffset, curTablePos, outputWord; byte *dst; @@ -248,7 +245,7 @@ int32 decompressADPCM(byte *compInput, byte *compOutput, int channels) { for (i = 0; i < channels; i++) { initialTablePos[i] = *src; src += 1; - initialimcTableEntry[i] = READ_BE_UINT32(src); + //initialimcTableEntry[i] = READ_BE_UINT32(src); src += 4; initialOutputWord[i] = READ_BE_UINT32(src); src += 4; diff --git a/engines/scumm/imuse_digi/dimuse_codecs.h b/engines/scumm/imuse_digi/dimuse_codecs.h index 71fd24c3ac..a38f7234dd 100644 --- a/engines/scumm/imuse_digi/dimuse_codecs.h +++ b/engines/scumm/imuse_digi/dimuse_codecs.h @@ -17,9 +17,6 @@ * 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. - * - * $URL$ - * $Id$ */ #ifndef SCUMM_IMUSE_DIGI_CODECS_H diff --git a/engines/scumm/imuse_digi/dimuse_music.cpp b/engines/scumm/imuse_digi/dimuse_music.cpp index 5c28917756..adf2560142 100644 --- a/engines/scumm/imuse_digi/dimuse_music.cpp +++ b/engines/scumm/imuse_digi/dimuse_music.cpp @@ -17,9 +17,6 @@ * 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. - * - * $URL$ - * $Id$ */ diff --git a/engines/scumm/imuse_digi/dimuse_script.cpp b/engines/scumm/imuse_digi/dimuse_script.cpp index 02395eed4d..bc030cc242 100644 --- a/engines/scumm/imuse_digi/dimuse_script.cpp +++ b/engines/scumm/imuse_digi/dimuse_script.cpp @@ -17,9 +17,6 @@ * 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. - * - * $URL$ - * $Id$ */ diff --git a/engines/scumm/imuse_digi/dimuse_sndmgr.cpp b/engines/scumm/imuse_digi/dimuse_sndmgr.cpp index 2cd90c4f2b..abd0d68e56 100644 --- a/engines/scumm/imuse_digi/dimuse_sndmgr.cpp +++ b/engines/scumm/imuse_digi/dimuse_sndmgr.cpp @@ -17,9 +17,6 @@ * 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. - * - * $URL$ - * $Id$ */ @@ -31,6 +28,7 @@ #include "audio/decoders/vorbis.h" #include "audio/decoders/mp3.h" +#include "scumm/resource.h" #include "scumm/scumm.h" #include "scumm/util.h" #include "scumm/imuse_digi/dimuse.h" diff --git a/engines/scumm/imuse_digi/dimuse_sndmgr.h b/engines/scumm/imuse_digi/dimuse_sndmgr.h index 7ae9fdccb0..f869c62eb5 100644 --- a/engines/scumm/imuse_digi/dimuse_sndmgr.h +++ b/engines/scumm/imuse_digi/dimuse_sndmgr.h @@ -17,9 +17,6 @@ * 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. - * - * $URL$ - * $Id$ */ #ifndef SCUMM_IMUSE_DIGI_SNDMGR_H diff --git a/engines/scumm/imuse_digi/dimuse_tables.cpp b/engines/scumm/imuse_digi/dimuse_tables.cpp index a7ee35b0df..c27138b765 100644 --- a/engines/scumm/imuse_digi/dimuse_tables.cpp +++ b/engines/scumm/imuse_digi/dimuse_tables.cpp @@ -17,9 +17,6 @@ * 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. - * - * $URL$ - * $Id$ */ diff --git a/engines/scumm/imuse_digi/dimuse_tables.h b/engines/scumm/imuse_digi/dimuse_tables.h index 942acd721f..a74941dfea 100644 --- a/engines/scumm/imuse_digi/dimuse_tables.h +++ b/engines/scumm/imuse_digi/dimuse_tables.h @@ -17,9 +17,6 @@ * 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. - * - * $URL$ - * $Id$ */ #if !defined(SCUMM_IMUSE_DIGI_TABLES_H) && defined(ENABLE_SCUMM_7_8) diff --git a/engines/scumm/imuse_digi/dimuse_track.cpp b/engines/scumm/imuse_digi/dimuse_track.cpp index 2a08d56163..0896f9af7d 100644 --- a/engines/scumm/imuse_digi/dimuse_track.cpp +++ b/engines/scumm/imuse_digi/dimuse_track.cpp @@ -17,9 +17,6 @@ * 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. - * - * $URL$ - * $Id$ */ #include "common/config-manager.h" diff --git a/engines/scumm/imuse_digi/dimuse_track.h b/engines/scumm/imuse_digi/dimuse_track.h index 8c6625cad1..420db4bb06 100644 --- a/engines/scumm/imuse_digi/dimuse_track.h +++ b/engines/scumm/imuse_digi/dimuse_track.h @@ -17,9 +17,6 @@ * 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. - * - * $URL$ - * $Id$ */ #if !defined(SCUMM_IMUSE_DIGI_TRACK_H) && defined(ENABLE_SCUMM_7_8) diff --git a/engines/scumm/input.cpp b/engines/scumm/input.cpp index ab5357f1dd..1a4ed91f1c 100644 --- a/engines/scumm/input.cpp +++ b/engines/scumm/input.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/config-manager.h" @@ -38,6 +35,7 @@ #include "scumm/he/intern_he.h" #include "scumm/he/logic_he.h" #endif +#include "scumm/resource.h" #include "scumm/scumm_v0.h" #include "scumm/scumm_v6.h" #include "scumm/scumm_v8.h" diff --git a/engines/scumm/insane/insane.cpp b/engines/scumm/insane/insane.cpp index a82c0ae408..b8089ff226 100644 --- a/engines/scumm/insane/insane.cpp +++ b/engines/scumm/insane/insane.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ @@ -31,6 +28,7 @@ #include "scumm/actor.h" #include "scumm/file.h" +#include "scumm/resource.h" #include "scumm/scumm_v7.h" #include "scumm/sound.h" diff --git a/engines/scumm/insane/insane.h b/engines/scumm/insane/insane.h index 499eb70a90..12d44c57f4 100644 --- a/engines/scumm/insane/insane.h +++ b/engines/scumm/insane/insane.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #if !defined(SCUMM_INSANE_H) && defined(ENABLE_SCUMM_7_8) diff --git a/engines/scumm/insane/insane_ben.cpp b/engines/scumm/insane/insane_ben.cpp index 05775f1585..48aaab505a 100644 --- a/engines/scumm/insane/insane_ben.cpp +++ b/engines/scumm/insane/insane_ben.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ diff --git a/engines/scumm/insane/insane_enemy.cpp b/engines/scumm/insane/insane_enemy.cpp index e8d97d3875..68766ab72c 100644 --- a/engines/scumm/insane/insane_enemy.cpp +++ b/engines/scumm/insane/insane_enemy.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ @@ -91,14 +88,13 @@ int32 Insane::enemyHandler(int num, int32 actor1, int32 actor2, int32 probabilit } int32 Insane::enemy0handler(int32 actor1, int32 actor2, int32 probability) { - int32 act1damage, act2damage, act1x, act2x, retval; int32 dist; - retval = 0; - act1damage = _actor[actor1].damage; // ebx - act2damage = _actor[actor2].damage; // ebp - act1x = _actor[actor1].x; // esi - act2x = _actor[actor2].x; // edi + int32 retval = 0; + int32 act1damage = _actor[actor1].damage; // ebx + int32 act2damage = _actor[actor2].damage; // ebp + int32 act1x = _actor[actor1].x; // esi + int32 act2x = _actor[actor2].x; // edi if (!_actor[actor1].defunct) { if (_enHdlVar[EN_ROTT1][1] > _enHdlVar[EN_ROTT1][2]) { @@ -255,14 +251,13 @@ int32 Insane::enemy0initializer(int32 actor1, int32 actor2, int32 probability) { } int32 Insane::enemy1handler(int32 actor1, int32 actor2, int32 probability) { - int32 act1damage, act2damage, act1x, act2x, retval; int32 dist; - retval = 0; - act1damage = _actor[actor1].damage; // ebx - act2damage = _actor[actor2].damage; // ebp - act1x = _actor[actor1].x; // esi - act2x = _actor[actor2].x; // edi + int32 retval = 0; + int32 act1damage = _actor[actor1].damage; // ebx + int32 act2damage = _actor[actor2].damage; // ebp + int32 act1x = _actor[actor1].x; // esi + int32 act2x = _actor[actor2].x; // edi if (!_actor[actor1].defunct) { if (_enHdlVar[EN_ROTT2][1] > _enHdlVar[EN_ROTT2][2]) { @@ -400,14 +395,13 @@ int32 Insane::enemy1initializer(int32 actor1, int32 actor2, int32 probability) { } int32 Insane::enemy2handler(int32 actor1, int32 actor2, int32 probability) { - int32 act1damage, act2damage, act1x, act2x, retval; int32 dist; - retval = 0; - act1damage = _actor[actor1].damage; // ebx - act2damage = _actor[actor2].damage; // ebp - act1x = _actor[actor1].x; // esi - act2x = _actor[actor2].x; // edi + int32 retval = 0; + int32 act1damage = _actor[actor1].damage; // ebx + int32 act2damage = _actor[actor2].damage; // ebp + int32 act1x = _actor[actor1].x; // esi + int32 act2x = _actor[actor2].x; // edi if (!_actor[actor1].defunct) { if (_enHdlVar[EN_ROTT3][1] > _enHdlVar[EN_ROTT3][2]) { @@ -549,14 +543,13 @@ int32 Insane::enemy2initializer(int32 actor1, int32 actor2, int32 probability) { } int32 Insane::enemy3handler(int32 actor1, int32 actor2, int32 probability) { - int32 act1damage, act2damage, act1x, act2x, retval; int32 dist; - retval = 0; - act1damage = _actor[actor1].damage; // ebx - act2damage = _actor[actor2].damage; // ebp - act1x = _actor[actor1].x; // esi - act2x = _actor[actor2].x; // edi + int32 retval = 0; + int32 act1damage = _actor[actor1].damage; // ebx + int32 act2damage = _actor[actor2].damage; // ebp + int32 act1x = _actor[actor1].x; // esi + int32 act2x = _actor[actor2].x; // edi if (!_actor[actor1].defunct) { if (_enHdlVar[EN_VULTF1][1] > _enHdlVar[EN_VULTF1][2]) { @@ -706,14 +699,13 @@ int32 Insane::enemy3initializer(int32 actor1, int32 actor2, int32 probability) { } int32 Insane::enemy4handler(int32 actor1, int32 actor2, int32 probability) { - int32 act1damage, act2damage, act1x, act2x, retval; int32 dist; - retval = 0; - act1damage = _actor[actor1].damage; // ebx - act2damage = _actor[actor2].damage; // ebp - act1x = _actor[actor1].x; // esi - act2x = _actor[actor2].x; // edi + int32 retval = 0; + int32 act1damage = _actor[actor1].damage; // ebx + int32 act2damage = _actor[actor2].damage; // ebp + int32 act1x = _actor[actor1].x; // esi + int32 act2x = _actor[actor2].x; // edi if (!_actor[actor1].defunct) { if (_enHdlVar[EN_VULTM1][1] > _enHdlVar[EN_VULTM1][2]) { @@ -876,15 +868,12 @@ int32 Insane::enemy4initializer(int32 actor1, int32 actor2, int32 probability) { } int32 Insane::enemy5handler(int32 actor1, int32 actor2, int32 probability) { - int32 act1damage, act1x, act2x, retval; - int32 dist; + int32 retval = 0; + int32 act1damage = _actor[actor1].damage; // ebx + int32 act1x = _actor[actor1].x; // esi + int32 act2x = _actor[actor2].x; // ebp - retval = 0; - act1damage = _actor[actor1].damage; // ebx - act1x = _actor[actor1].x; // esi - act2x = _actor[actor2].x; // ebp - - dist = ABS(act1x - act2x); + int32 dist = ABS(act1x - act2x); if (weaponMaxRange(actor1) >= dist) { if (!_enHdlVar[EN_VULTF2][2]) @@ -1022,19 +1011,16 @@ int32 Insane::enemy5initializer(int32 actor1, int32 actor2, int32 probability) { } int32 Insane::enemy6handler(int32 actor1, int32 actor2, int32 probability) { - int32 act1damage, act2damage, act1x, act2x, retval; - int32 dist; - - retval = 0; - act1damage = _actor[actor1].damage; // ebx //ebx - act2damage = _actor[actor2].damage; // ebp // edi - act1x = _actor[actor1].x; // esi - act2x = _actor[actor2].x; // edi + int32 retval = 0; + int32 act1damage = _actor[actor1].damage; // ebx //ebx + //int32 act2damage = _actor[actor2].damage; // ebp // edi + int32 act1x = _actor[actor1].x; // esi + int32 act2x = _actor[actor2].x; // edi if (_actor[actor2].weapon == INV_CHAINSAW) retval = 1; - dist = ABS(act1x - act2x); + int32 dist = ABS(act1x - act2x); if (_actor[actor1].defunct) { /* scenePropIdx[18] */ @@ -1163,15 +1149,12 @@ int32 Insane::enemy6initializer(int32 actor1, int32 actor2, int32 probability) { } int32 Insane::enemy7handler(int32 actor1, int32 actor2, int32 probability) { - int32 act1damage, act1x, act2x, retval; - int32 dist; - - retval = 0; - act1damage = _actor[actor1].damage; // ebx - act1x = _actor[actor1].x; // ebp, esi - act2x = _actor[actor2].x; // edi + int32 retval = 0; + int32 act1damage = _actor[actor1].damage; // ebx + int32 act1x = _actor[actor1].x; // ebp, esi + int32 act2x = _actor[actor2].x; // edi - dist = ABS(act1x - act2x); + int32 dist = ABS(act1x - act2x); if (_enHdlVar[EN_CAVEFISH][1] >= 600) { _enHdlVar[EN_CAVEFISH][2] = 1; diff --git a/engines/scumm/insane/insane_iact.cpp b/engines/scumm/insane/insane_iact.cpp index 265931ecc2..3592d67c18 100644 --- a/engines/scumm/insane/insane_iact.cpp +++ b/engines/scumm/insane/insane_iact.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "scumm/scumm_v7.h" diff --git a/engines/scumm/insane/insane_scenes.cpp b/engines/scumm/insane/insane_scenes.cpp index 36a3f5a8b7..841fedafe2 100644 --- a/engines/scumm/insane/insane_scenes.cpp +++ b/engines/scumm/insane/insane_scenes.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ diff --git a/engines/scumm/midiparser_ro.cpp b/engines/scumm/midiparser_ro.cpp index be77e4fd66..1a31d1ca82 100644 --- a/engines/scumm/midiparser_ro.cpp +++ b/engines/scumm/midiparser_ro.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ diff --git a/engines/scumm/music.h b/engines/scumm/music.h index 6285412ffd..a527c77b72 100644 --- a/engines/scumm/music.h +++ b/engines/scumm/music.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef SCUMM_MUSIC_H diff --git a/engines/scumm/nut_renderer.cpp b/engines/scumm/nut_renderer.cpp index 7f250e45e0..048b29d68b 100644 --- a/engines/scumm/nut_renderer.cpp +++ b/engines/scumm/nut_renderer.cpp @@ -17,9 +17,6 @@ * 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. - * - * $URL$ - * $Id$ */ diff --git a/engines/scumm/nut_renderer.h b/engines/scumm/nut_renderer.h index 5783646d11..acccf161fa 100644 --- a/engines/scumm/nut_renderer.h +++ b/engines/scumm/nut_renderer.h @@ -17,9 +17,6 @@ * 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. - * - * $URL$ - * $Id$ */ #if !defined(SCUMM_NUT_RENDERER_H) && defined(ENABLE_SCUMM_7_8) diff --git a/engines/scumm/object.cpp b/engines/scumm/object.cpp index c2547f74f4..fb99d6ce7d 100644 --- a/engines/scumm/object.cpp +++ b/engines/scumm/object.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "scumm/actor.h" @@ -195,8 +192,11 @@ void ScummEngine::clearOwnerOf(int obj) { if (!_inventory[i] && _inventory[i+1]) { _inventory[i] = _inventory[i+1]; _inventory[i+1] = 0; - _res->address[rtInventory][i] = _res->address[rtInventory][i + 1]; - _res->address[rtInventory][i + 1] = NULL; + // FIXME FIXME FIXME: This is incomplete, as we do not touch flags, status... BUG + _res->_types[rtInventory][i]._address = _res->_types[rtInventory][i + 1]._address; + _res->_types[rtInventory][i]._size = _res->_types[rtInventory][i + 1]._size; + _res->_types[rtInventory][i + 1]._address = NULL; + _res->_types[rtInventory][i + 1]._size = 0; } } break; @@ -1799,7 +1799,7 @@ int ScummEngine::findLocalObjectSlot() { int ScummEngine::findFlObjectSlot() { int i; for (i = 1; i < _numFlObject; i++) { - if (_res->address[rtFlObject][i] == NULL) + if (_res->_types[rtFlObject][i]._address == NULL) return i; } error("findFlObjectSlot: Out of FLObject slots"); diff --git a/engines/scumm/object.h b/engines/scumm/object.h index 2a817b2b88..cdf8b09e6f 100644 --- a/engines/scumm/object.h +++ b/engines/scumm/object.h @@ -17,9 +17,6 @@ * 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. - * - * $URL$ - * $Id$ */ #ifndef SCUMM_OBJECT_H diff --git a/engines/scumm/palette.cpp b/engines/scumm/palette.cpp index b0786c924d..b85771e897 100644 --- a/engines/scumm/palette.cpp +++ b/engines/scumm/palette.cpp @@ -17,9 +17,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/system.h" @@ -1009,9 +1006,6 @@ void ScummEngine::setPalColor(int idx, int r, int g, int b) { } void ScummEngine::setCurrentPalette(int palindex) { - // TODO: This method could almost be moved to ScummEngin_v6, the only - // problem is that it is called by ScummEngine::resetRoomSubBlocks(). - // But it should be possible to get rid of that, too (with some care). const byte *pals; _curPalIndex = palindex; diff --git a/engines/scumm/player_mod.cpp b/engines/scumm/player_mod.cpp index 657595fab1..6411f0a17a 100644 --- a/engines/scumm/player_mod.cpp +++ b/engines/scumm/player_mod.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ diff --git a/engines/scumm/player_mod.h b/engines/scumm/player_mod.h index 3f97c4cab9..619d83541d 100644 --- a/engines/scumm/player_mod.h +++ b/engines/scumm/player_mod.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef SCUMM_PLAYER_MOD_H diff --git a/engines/scumm/player_nes.cpp b/engines/scumm/player_nes.cpp index 5f792401e0..3f8bcef8b7 100644 --- a/engines/scumm/player_nes.cpp +++ b/engines/scumm/player_nes.cpp @@ -18,9 +18,6 @@ * aint32 with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef DISABLE_NES_APU diff --git a/engines/scumm/player_nes.h b/engines/scumm/player_nes.h index 402eea7bf8..be1617e0f6 100644 --- a/engines/scumm/player_nes.h +++ b/engines/scumm/player_nes.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef SCUMM_PLAYER_NES_H diff --git a/engines/scumm/player_pce.cpp b/engines/scumm/player_pce.cpp index 46d976773d..786971c683 100644 --- a/engines/scumm/player_pce.cpp +++ b/engines/scumm/player_pce.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ /* diff --git a/engines/scumm/player_pce.h b/engines/scumm/player_pce.h index 42153e8abc..eb6afd892a 100644 --- a/engines/scumm/player_pce.h +++ b/engines/scumm/player_pce.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef SCUMM_PLAYER_PCE_H diff --git a/engines/scumm/player_sid.cpp b/engines/scumm/player_sid.cpp index 11468f3097..f0f60a3924 100644 --- a/engines/scumm/player_sid.cpp +++ b/engines/scumm/player_sid.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef DISABLE_SID diff --git a/engines/scumm/player_sid.h b/engines/scumm/player_sid.h index 71497cc6f4..baeb7bbef0 100644 --- a/engines/scumm/player_sid.h +++ b/engines/scumm/player_sid.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef SCUMM_PLAYER_SID_H diff --git a/engines/scumm/player_towns.cpp b/engines/scumm/player_towns.cpp index 8922ff1730..5d49478cb0 100644 --- a/engines/scumm/player_towns.cpp +++ b/engines/scumm/player_towns.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ @@ -29,10 +26,8 @@ namespace Scumm { -Player_Towns::Player_Towns(ScummEngine *vm, bool isVersion2) : _vm(vm), _v2(isVersion2), _numSoundMax(isVersion2 ? 256 : 200) { +Player_Towns::Player_Towns(ScummEngine *vm, bool isVersion2) : _vm(vm), _v2(isVersion2), _intf(0), _numSoundMax(isVersion2 ? 256 : 200), _unkFlags(0x33) { memset(_pcmCurrentSound, 0, sizeof(_pcmCurrentSound)); - _unkFlags = 0x33; - _intf = 0; } void Player_Towns::setSfxVolume(int vol) { @@ -505,15 +500,15 @@ void Player_Towns_v1::playEuphonyTrack(int sound, const uint8 *data) { const uint8 *trackData = src + 150; for (int i = 0; i < 32; i++) - _driver->chanEnable(i, *src++); + _driver->configChan_enable(i, *src++); for (int i = 0; i < 32; i++) - _driver->chanMode(i, 0xff); + _driver->configChan_setMode(i, 0xff); for (int i = 0; i < 32; i++) - _driver->chanOrdr(i, *src++); + _driver->configChan_remap(i, *src++); for (int i = 0; i < 32; i++) - _driver->chanVolumeShift(i, *src++); + _driver->configChan_adjustVolume(i, *src++); for (int i = 0; i < 32; i++) - _driver->chanNoteShift(i, *src++); + _driver->configChan_setTranspose(i, *src++); src += 8; for (int i = 0; i < 6; i++) @@ -579,15 +574,15 @@ void Player_Towns_v1::playCdaTrack(int sound, const uint8 *data, bool skipTrackV _cdaCurrentSound = sound; } -Player_Towns_v2::Player_Towns_v2(ScummEngine *vm, IMuse *imuse, Audio::Mixer *mixer, bool disposeIMuse) : Player_Towns(vm, true), _imuse(imuse), _imuseDispose(disposeIMuse) { +Player_Towns_v2::Player_Towns_v2(ScummEngine *vm, Audio::Mixer *mixer, IMuse *imuse, bool disposeIMuse) : Player_Towns(vm, true), _imuse(imuse), _imuseDispose(disposeIMuse), _sblData(0) { _soundOverride = new SoundOvrParameters[_numSoundMax]; memset(_soundOverride, 0, _numSoundMax * sizeof(SoundOvrParameters)); - _sblData = 0; _intf = new TownsAudioInterface(mixer, 0); } Player_Towns_v2::~Player_Towns_v2() { delete _intf; + _intf = 0; if (_imuseDispose) delete _imuse; diff --git a/engines/scumm/player_towns.h b/engines/scumm/player_towns.h index fda8bd4042..470020d621 100644 --- a/engines/scumm/player_towns.h +++ b/engines/scumm/player_towns.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef SCUMM_PLAYER_TOWNS_H @@ -29,6 +26,7 @@ #include "scumm/scumm.h" #include "scumm/imuse/imuse.h" #include "audio/softsynth/fmtowns_pc98/towns_euphony.h" +#include "audio/softsynth/fmtowns_pc98/towns_midi.h" namespace Scumm { @@ -144,7 +142,7 @@ private: class Player_Towns_v2 : public Player_Towns { public: - Player_Towns_v2(ScummEngine *vm, IMuse *imuse, Audio::Mixer *mixer, bool disposeIMuse); + Player_Towns_v2(ScummEngine *vm, Audio::Mixer *mixer, IMuse *imuse, bool disposeIMuse); ~Player_Towns_v2(); bool init(); @@ -172,6 +170,7 @@ private: SoundOvrParameters *_soundOverride; uint8 *_sblData; + IMuse *_imuse; const bool _imuseDispose; }; diff --git a/engines/scumm/player_v1.cpp b/engines/scumm/player_v1.cpp index f2487c0a57..8afede8c5a 100644 --- a/engines/scumm/player_v1.cpp +++ b/engines/scumm/player_v1.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ diff --git a/engines/scumm/player_v1.h b/engines/scumm/player_v1.h index acba13e475..9e6063adc9 100644 --- a/engines/scumm/player_v1.h +++ b/engines/scumm/player_v1.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef SCUMM_PLAYER_V1_H diff --git a/engines/scumm/player_v2.cpp b/engines/scumm/player_v2.cpp index a66e248ecc..6910f5e0db 100644 --- a/engines/scumm/player_v2.cpp +++ b/engines/scumm/player_v2.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "scumm/player_v2.h" diff --git a/engines/scumm/player_v2.h b/engines/scumm/player_v2.h index 6a0b3d6d5e..14a0b9c1e0 100644 --- a/engines/scumm/player_v2.h +++ b/engines/scumm/player_v2.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef SCUMM_PLAYER_V2_H diff --git a/engines/scumm/player_v2a.cpp b/engines/scumm/player_v2a.cpp index cee77024ca..ed97c4098f 100644 --- a/engines/scumm/player_v2a.cpp +++ b/engines/scumm/player_v2a.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "engines/engine.h" diff --git a/engines/scumm/player_v2a.h b/engines/scumm/player_v2a.h index d60040bd76..719d5491ea 100644 --- a/engines/scumm/player_v2a.h +++ b/engines/scumm/player_v2a.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef SCUMM_PLAYER_V2A_H diff --git a/engines/scumm/player_v2base.cpp b/engines/scumm/player_v2base.cpp index 61c91aae85..0d3ad4b1b3 100644 --- a/engines/scumm/player_v2base.cpp +++ b/engines/scumm/player_v2base.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "scumm/player_v2base.h" diff --git a/engines/scumm/player_v2base.h b/engines/scumm/player_v2base.h index bd910b8a78..2f048070ad 100644 --- a/engines/scumm/player_v2base.h +++ b/engines/scumm/player_v2base.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef SCUMM_PLAYER_V2BASE_H diff --git a/engines/scumm/player_v2cms.cpp b/engines/scumm/player_v2cms.cpp index b081a68428..21e7f193b5 100644 --- a/engines/scumm/player_v2cms.cpp +++ b/engines/scumm/player_v2cms.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "scumm/player_v2cms.h" diff --git a/engines/scumm/player_v2cms.h b/engines/scumm/player_v2cms.h index fd939d8505..f7dc0c16b1 100644 --- a/engines/scumm/player_v2cms.h +++ b/engines/scumm/player_v2cms.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef SCUMM_PLAYER_V2CMS_H diff --git a/engines/scumm/player_v3a.cpp b/engines/scumm/player_v3a.cpp index cffbd729ea..472cd1252b 100644 --- a/engines/scumm/player_v3a.cpp +++ b/engines/scumm/player_v3a.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ diff --git a/engines/scumm/player_v3a.h b/engines/scumm/player_v3a.h index d3d1e5eeb5..9449664e9b 100644 --- a/engines/scumm/player_v3a.h +++ b/engines/scumm/player_v3a.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef SCUMM_PLAYER_V3A_H diff --git a/engines/scumm/player_v4a.cpp b/engines/scumm/player_v4a.cpp index 53c9e6b93c..e791736f0e 100644 --- a/engines/scumm/player_v4a.cpp +++ b/engines/scumm/player_v4a.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "engines/engine.h" diff --git a/engines/scumm/player_v4a.h b/engines/scumm/player_v4a.h index 458a39b5fe..b51ca2f993 100644 --- a/engines/scumm/player_v4a.h +++ b/engines/scumm/player_v4a.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef SCUMM_PLAYER_V4A_H diff --git a/engines/scumm/proc3ARM.s b/engines/scumm/proc3ARM.s index 5acfa86c29..5833bcf90b 100644 --- a/engines/scumm/proc3ARM.s +++ b/engines/scumm/proc3ARM.s @@ -18,9 +18,6 @@ @ along with this program@ if not, write to the Free Software @ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. @ -@ $URL$ -@ $Id$ -@ @ @author Robin Watts (robin@wss.co.uk) .text diff --git a/engines/scumm/resource.cpp b/engines/scumm/resource.cpp index c872a83d14..0448f60593 100644 --- a/engines/scumm/resource.cpp +++ b/engines/scumm/resource.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/str.h" @@ -55,7 +52,7 @@ enum { -extern const char *resTypeFromId(int id); +extern const char *nameOfResType(ResType type); static uint16 newTag2Old(uint32 newTag); static const byte *findResourceSmall(uint32 tag, const byte *searchin); @@ -86,8 +83,8 @@ void ScummEngine::openRoom(const int room) { // Load the disk numer / room offs (special case for room 0 exists because // room 0 contains the data which is used to create the roomno / roomoffs // tables -- hence obviously we mustn't use those when loading room 0. - const uint32 diskNumber = room ? _res->roomno[rtRoom][room] : 0; - const uint32 room_offs = room ? _res->roomoffs[rtRoom][room] : 0; + const uint32 diskNumber = room ? _res->_types[rtRoom][room]._roomno : 0; + const uint32 room_offs = room ? _res->_types[rtRoom][room]._roomoffs : 0; // FIXME: Since room_offs is const, clearly the following loop either // is never entered, or loops forever (if it wasn't for the return/error @@ -97,7 +94,7 @@ void ScummEngine::openRoom(const int room) { while (room_offs != RES_INVALID_OFFSET) { if (room_offs != 0 && room != 0 && _game.heversion < 98) { - _fileOffset = _res->roomoffs[rtRoom][room]; + _fileOffset = _res->_types[rtRoom][room]._roomoffs; return; } @@ -125,7 +122,7 @@ void ScummEngine::openRoom(const int room) { return; deleteRoomOffsets(); readRoomsOffsets(); - _fileOffset = _res->roomoffs[rtRoom][room]; + _fileOffset = _res->_types[rtRoom][room]._roomoffs; if (_fileOffset != 8) return; @@ -160,15 +157,13 @@ void ScummEngine::closeRoom() { /** Delete the currently loaded room offsets. */ void ScummEngine::deleteRoomOffsets() { for (int i = 0; i < _numRooms; i++) { - if (_res->roomoffs[rtRoom][i] != RES_INVALID_OFFSET) - _res->roomoffs[rtRoom][i] = 0; + if (_res->_types[rtRoom][i]._roomoffs != RES_INVALID_OFFSET) + _res->_types[rtRoom][i]._roomoffs = 0; } } /** Read room offsets */ void ScummEngine::readRoomsOffsets() { - debug(9, "readRoomOffsets()"); - if (_game.features & GF_SMALL_HEADER) { _fileHandle->seek(12, SEEK_SET); // Directly searching for the room offset block would be more generic... } else { @@ -179,8 +174,8 @@ void ScummEngine::readRoomsOffsets() { while (num--) { int room = _fileHandle->readByte(); int offset = _fileHandle->readUint32LE(); - if (_res->roomoffs[rtRoom][room] != RES_INVALID_OFFSET) { - _res->roomoffs[rtRoom][room] = offset; + if (_res->_types[rtRoom][room]._roomoffs != RES_INVALID_OFFSET) { + _res->_types[rtRoom][room]._roomoffs = offset; } } } @@ -303,6 +298,7 @@ void ScummEngine::readIndexFile() { break; numblock++; + debug(2, "Reading index block of type '%s', size %d", tag2str(blocktype), itemsize); readIndexBlock(blocktype, itemsize); } @@ -352,7 +348,6 @@ void ScummEngine_v7::readIndexBlock(uint32 blocktype, uint32 itemsize) { char *ptr; switch (blocktype) { case MKTAG('A','N','A','M'): // Used by: The Dig, FT - debug(9, "found ANAM block, reading audio names"); num = _fileHandle->readUint16LE(); ptr = (char*)malloc(num * 9); _fileHandle->read(ptr, num * 9); @@ -421,7 +416,6 @@ void ScummEngine::readIndexBlock(uint32 blocktype, uint32 itemsize) { break; case MKTAG('D','O','B','J'): - debug(9, "found DOBJ block, reading object table"); readGlobalObjects(); break; @@ -488,73 +482,78 @@ void ScummEngine::readArrayFromIndexFile() { error("readArrayFromIndexFile() not supported in pre-V6 games"); } -int ScummEngine::readResTypeList(int id) { - int num; - int i; - - debug(9, "readResTypeList(%s)", resTypeFromId(id)); +int ScummEngine::readResTypeList(ResType type) { + uint num; + ResId idx; if (_game.version == 8) num = _fileHandle->readUint32LE(); else num = _fileHandle->readUint16LE(); - if (num != _res->num[id]) { - error("Invalid number of %ss (%d) in directory", resTypeFromId(id), num); + if (num != _res->_types[type].size()) { + error("Invalid number of %ss (%d) in directory", nameOfResType(type), num); } - for (i = 0; i < num; i++) { - _res->roomno[id][i] = _fileHandle->readByte(); + debug(2, " readResTypeList(%s): %d entries", nameOfResType(type), num); + + + for (idx = 0; idx < num; idx++) { + _res->_types[type][idx]._roomno = _fileHandle->readByte(); } - for (i = 0; i < num; i++) { - _res->roomoffs[id][i] = _fileHandle->readUint32LE(); + for (idx = 0; idx < num; idx++) { + _res->_types[type][idx]._roomoffs = _fileHandle->readUint32LE(); } return num; } -int ScummEngine_v70he::readResTypeList(int id) { - int num; - int i; +int ScummEngine_v70he::readResTypeList(ResType type) { + uint num; + ResId idx; - num = ScummEngine::readResTypeList(id); + num = ScummEngine::readResTypeList(type); - if (id == rtRoom) - for (i = 0; i < num; i++) { - _heV7RoomIntOffsets[i] = _res->roomoffs[rtRoom][i]; + if (type == rtRoom) + for (idx = 0; idx < num; idx++) { + _heV7RoomIntOffsets[idx] = _res->_types[rtRoom][idx]._roomoffs; } - for (i = 0; i < num; i++) { - _res->globsize[id][i] = _fileHandle->readUint32LE(); + for (idx = 0; idx < num; idx++) { + // The globsize is currently not being used + /*_res->_types[type][idx]._globsize =*/ _fileHandle->readUint32LE(); } return num; } -void ResourceManager::allocResTypeData(int id, uint32 tag, int num_, const char *name_, int mode_) { - debug(9, "allocResTypeData(%s/%s,%s,%d,%d)", resTypeFromId(id), name_, tag2str(TO_BE_32(tag)), num_, mode_); - assert(id >= 0 && id < (int)(ARRAYSIZE(this->mode))); +void ResourceManager::allocResTypeData(ResType type, uint32 tag, int num, ResTypeMode mode) { + debug(2, "allocResTypeData(%s,%s,%d,%d)", nameOfResType(type), tag2str(TO_BE_32(tag)), num, mode); + assert(type >= 0 && type < (int)(ARRAYSIZE(_types))); - if (num_ >= 8000) - error("Too many %ss (%d) in directory", name_, num_); + if (num >= 8000) + error("Too many %s resources (%d) in directory", nameOfResType(type), num); - mode[id] = mode_; - num[id] = num_; - tags[id] = tag; - name[id] = name_; - address[id] = (byte **)calloc(num_, sizeof(void *)); - flags[id] = (byte *)calloc(num_, sizeof(byte)); - status[id] = (byte *)calloc(num_, sizeof(byte)); + _types[type]._mode = mode; + _types[type]._tag = tag; - if (mode_) { - roomno[id] = (byte *)calloc(num_, sizeof(byte)); - roomoffs[id] = (uint32 *)calloc(num_, sizeof(uint32)); + // If there was data in there, let's clear it out completely. This is important + // in case we are restarting the game. + _types[type].clear(); + _types[type].resize(num); + +/* + TODO: Use multiple Resource subclasses, one for each res mode; then, + given them serializability. + if (mode) { + _types[type].roomno = (byte *)calloc(num, sizeof(byte)); + _types[type].roomoffs = (uint32 *)calloc(num, sizeof(uint32)); } if (_vm->_game.heversion >= 70) { - globsize[id] = (uint32 *)calloc(num_, sizeof(uint32)); + _types[type].globsize = (uint32 *)calloc(num, sizeof(uint32)); } - +*/ } void ScummEngine::loadCharset(int no) { @@ -588,16 +587,14 @@ void ScummEngine::nukeCharset(int i) { _res->nukeResource(rtCharset, i); } -void ScummEngine::ensureResourceLoaded(int type, int i) { - void *addr = NULL; - - debugC(DEBUG_RESOURCE, "ensureResourceLoaded(%s,%d)", resTypeFromId(type), i); +void ScummEngine::ensureResourceLoaded(ResType type, ResId idx) { + debugC(DEBUG_RESOURCE, "ensureResourceLoaded(%s,%d)", nameOfResType(type), idx); - if ((type == rtRoom) && i > 0x7F && _game.version < 7 && _game.heversion <= 71) { - i = _resourceMapper[i & 0x7F]; + if ((type == rtRoom) && idx > 0x7F && _game.version < 7 && _game.heversion <= 71) { + idx = _resourceMapper[idx & 0x7F]; } - // FIXME: This check used to be "i==0". However, that causes + // FIXME: This check used to be "idx==0". However, that causes // problems when using this function to ensure charset 0 is loaded. // This is done for many games, e.g. Zak256 or Indy3 (EGA and VGA). // For now we restrict the check to anything which is not a charset. @@ -608,27 +605,24 @@ void ScummEngine::ensureResourceLoaded(int type, int i) { // our code base? After all we also have to add special cases for many // of our script opcodes that check for the (invalid) actor 0... so // maybe both issues are related... - if (type != rtCharset && i == 0) + if (type != rtCharset && idx == 0) return; - if (i <= _res->num[type]) - addr = _res->address[type][i]; - - if (addr) + if (idx <= _res->_types[type].size() && _res->_types[type][idx]._address) return; - loadResource(type, i); + loadResource(type, idx); - if (_game.version == 5 && type == rtRoom && i == _roomResource) + if (_game.version == 5 && type == rtRoom && (int)idx == _roomResource) VAR(VAR_ROOM_FLAG) = 1; } -int ScummEngine::loadResource(int type, int idx) { +int ScummEngine::loadResource(ResType type, ResId idx) { int roomNr; uint32 fileOffs; uint32 size, tag; - debugC(DEBUG_RESOURCE, "loadResource(%s,%d)", resTypeFromId(type), idx); + debugC(DEBUG_RESOURCE, "loadResource(%s,%d)", nameOfResType(type), idx); if (type == rtCharset && (_game.features & GF_SMALL_HEADER)) { loadCharset(idx); @@ -637,8 +631,8 @@ int ScummEngine::loadResource(int type, int idx) { roomNr = getResourceRoomNr(type, idx); - if (idx >= _res->num[type]) - error("%s %d undefined %d %d", _res->name[type], idx, _res->num[type], roomNr); + if (idx >= _res->_types[type].size()) + error("%s %d undefined %d %d", nameOfResType(type), idx, _res->_types[type].size(), roomNr); if (roomNr == 0) roomNr = _roomResource; @@ -672,11 +666,19 @@ int ScummEngine::loadResource(int type, int idx) { return readSoundResource(idx); } + // Sanity check: Is this the right tag for this resource type? + // + // Currently disabled for newer HE games because they use different + // tags. For example, for rtRoom, 'ROOM' changed to 'RMDA'; and for + // rtImage, 'AWIZ' and 'MULT' can both occur simultaneously. + // On the long run, it would be preferable to not turn this check off, + // but instead to explicitly support the variations in the HE games. tag = _fileHandle->readUint32BE(); - - if (tag != _res->tags[type] && _game.heversion < 70) { - error("%s %d not in room %d at %d+%d in file %s", - _res->name[type], idx, roomNr, + if (tag != _res->_types[type]._tag && _game.heversion < 70) { + error("Unknown res tag '%s' encountered (expected '%s') " + "while trying to load res (%s,%d) in room %d at %d+%d in file %s", + tag2str(tag), tag2str(_res->_types[type]._tag), + nameOfResType(type), idx, roomNr, _fileOffset, fileOffs, _fileHandle->getName()); } @@ -697,35 +699,33 @@ int ScummEngine::loadResource(int type, int idx) { return 1; } -int ScummEngine::getResourceRoomNr(int type, int idx) { +int ScummEngine::getResourceRoomNr(ResType type, ResId idx) { if (type == rtRoom && _game.heversion < 70) return idx; - return _res->roomno[type][idx]; + return _res->_types[type][idx]._roomno; } -uint32 ScummEngine::getResourceRoomOffset(int type, int idx) { +uint32 ScummEngine::getResourceRoomOffset(ResType type, ResId idx) { if (type == rtRoom) { return (_game.version == 8) ? 8 : 0; } - return _res->roomoffs[type][idx]; + return _res->_types[type][idx]._roomoffs; } -uint32 ScummEngine_v70he::getResourceRoomOffset(int type, int idx) { +uint32 ScummEngine_v70he::getResourceRoomOffset(ResType type, ResId idx) { if (type == rtRoom) { return _heV7RoomIntOffsets[idx]; } - return _res->roomoffs[type][idx]; + return _res->_types[type][idx]._roomoffs; } -int ScummEngine::getResourceSize(int type, int idx) { +int ScummEngine::getResourceSize(ResType type, ResId idx) { byte *ptr = getResourceAddress(type, idx); assert(ptr); - MemBlkHeader *hdr = (MemBlkHeader *)(ptr - sizeof(MemBlkHeader)); - - return hdr->size; + return _res->_types[type][idx]._size; } -byte *ScummEngine::getResourceAddress(int type, int idx) { +byte *ScummEngine::getResourceAddress(ResType type, ResId idx) { byte *ptr; if (_game.heversion >= 80 && type == rtString) @@ -734,33 +734,30 @@ byte *ScummEngine::getResourceAddress(int type, int idx) { if (!_res->validateResource("getResourceAddress", type, idx)) return NULL; - if (!_res->address[type]) { - debugC(DEBUG_RESOURCE, "getResourceAddress(%s,%d), _res->address[type] == NULL", resTypeFromId(type), idx); - return NULL; - } - - if (_res->mode[type] && !_res->address[type][idx]) { + // If the resource is missing, but loadable from the game data files, try to do so. + if (!_res->_types[type][idx]._address && _res->_types[type]._mode != kDynamicResTypeMode) { ensureResourceLoaded(type, idx); } - if (!(ptr = (byte *)_res->address[type][idx])) { - debugC(DEBUG_RESOURCE, "getResourceAddress(%s,%d) == NULL", resTypeFromId(type), idx); + ptr = (byte *)_res->_types[type][idx]._address; + if (!ptr) { + debugC(DEBUG_RESOURCE, "getResourceAddress(%s,%d) == NULL", nameOfResType(type), idx); return NULL; } _res->setResourceCounter(type, idx, 1); - debugC(DEBUG_RESOURCE, "getResourceAddress(%s,%d) == %p", resTypeFromId(type), idx, ptr + sizeof(MemBlkHeader)); - return ptr + sizeof(MemBlkHeader); + debugC(DEBUG_RESOURCE, "getResourceAddress(%s,%d) == %p", nameOfResType(type), idx, ptr); + return ptr; } -byte *ScummEngine::getStringAddress(int i) { - byte *addr = getResourceAddress(rtString, i); +byte *ScummEngine::getStringAddress(ResId idx) { + byte *addr = getResourceAddress(rtString, idx); return addr; } -byte *ScummEngine_v6::getStringAddress(int i) { - byte *addr = getResourceAddress(rtString, i); +byte *ScummEngine_v6::getStringAddress(ResId idx) { + byte *addr = getResourceAddress(rtString, idx); if (addr == NULL) return NULL; // Skip over the ArrayHeader @@ -772,35 +769,42 @@ byte *ScummEngine::getStringAddressVar(int i) { } void ResourceManager::increaseExpireCounter() { - if (!(++_expireCounter)) { - increaseResourceCounter(); + ++_expireCounter; + if (_expireCounter == 0) { // overflow? + increaseResourceCounters(); } } -void ResourceManager::increaseResourceCounter() { - int i, j; - byte counter; - - for (i = rtFirst; i <= rtLast; i++) { - for (j = num[i]; --j >= 0;) { - counter = flags[i][j] & RF_USAGE; +void ResourceManager::increaseResourceCounters() { + for (ResType type = rtFirst; type <= rtLast; type = ResType(type + 1)) { + ResId idx = _types[type].size(); + while (idx-- > 0) { + byte counter = _types[type][idx].getResourceCounter(); if (counter && counter < RF_USAGE_MAX) { - setResourceCounter(i, j, counter + 1); + setResourceCounter(type, idx, counter + 1); } } } } -void ResourceManager::setResourceCounter(int type, int idx, byte flag) { - flags[type][idx] &= ~RF_USAGE; - flags[type][idx] |= flag; +void ResourceManager::setResourceCounter(ResType type, ResId idx, byte counter) { + _types[type][idx].setResourceCounter(counter); +} + +void ResourceManager::Resource::setResourceCounter(byte counter) { + _flags &= RF_LOCK; // Clear lower 7 bits, preserve the lock bit. + _flags |= counter; // Update the usage counter +} + +byte ResourceManager::Resource::getResourceCounter() const { + return _flags & RF_USAGE; } /* 2 bytes safety area to make "precaching" of bytes in the gdi drawer easier */ #define SAFETY_AREA 2 -byte *ResourceManager::createResource(int type, int idx, uint32 size) { - debugC(DEBUG_RESOURCE, "_res->createResource(%s,%d,%d)", resTypeFromId(type), idx, size); +byte *ResourceManager::createResource(ResType type, ResId idx, uint32 size) { + debugC(DEBUG_RESOURCE, "_res->createResource(%s,%d,%d)", nameOfResType(type), idx, size); if (!validateResource("allocating", type, idx)) return NULL; @@ -810,31 +814,62 @@ byte *ResourceManager::createResource(int type, int idx, uint32 size) { // cases. For instance, Zak tries to reload the intro music // while it's playing. See bug #1253171. - if (address[type][idx] && (type == rtSound || type == rtScript || type == rtCostume)) - return address[type][idx] + sizeof(MemBlkHeader); + if (_types[type][idx]._address && (type == rtSound || type == rtScript || type == rtCostume)) + return _types[type][idx]._address; } nukeResource(type, idx); expireResources(size); - void *ptr = calloc(size + sizeof(MemBlkHeader) + SAFETY_AREA, 1); + byte *ptr = (byte *)calloc(size + SAFETY_AREA, 1); if (ptr == NULL) { - error("createResource(%s,%d): Out of memory while allocating %d", resTypeFromId(type), idx, size); + error("createResource(%s,%d): Out of memory while allocating %d", nameOfResType(type), idx, size); } _allocatedSize += size; - address[type][idx] = (byte *)ptr; - ((MemBlkHeader *)ptr)->size = size; + _types[type][idx]._address = ptr; + _types[type][idx]._size = size; setResourceCounter(type, idx, 1); - return (byte *)ptr + sizeof(MemBlkHeader); /* skip header */ + return ptr; +} + +ResourceManager::Resource::Resource() { + _address = 0; + _size = 0; + _flags = 0; + _status = 0; + _roomno = 0; + _roomoffs = 0; +} + +ResourceManager::Resource::~Resource() { + delete _address; + _address = 0; } -ResourceManager::ResourceManager(ScummEngine *vm) { - memset(this, 0, sizeof(ResourceManager)); - _vm = vm; -// _allocatedSize = 0; +void ResourceManager::Resource::nuke() { + delete _address; + _address = 0; + _size = 0; + _flags = 0; + _status &= ~RS_MODIFIED; +} + +ResourceManager::ResTypeData::ResTypeData() { + _mode = kDynamicResTypeMode; + _tag = 0; +} + +ResourceManager::ResTypeData::~ResTypeData() { +} + +ResourceManager::ResourceManager(ScummEngine *vm) : _vm(vm) { + _allocatedSize = 0; + _maxHeapThreshold = 0; + _minHeapThreshold = 0; + _expireCounter = 0; } ResourceManager::~ResourceManager() { @@ -848,30 +883,20 @@ void ResourceManager::setHeapThreshold(int min, int max) { _minHeapThreshold = min; } -bool ResourceManager::validateResource(const char *str, int type, int idx) const { - if (type < rtFirst || type > rtLast || (uint) idx >= (uint)num[type]) { - error("%s Illegal Glob type %s (%d) num %d", str, resTypeFromId(type), type, idx); +bool ResourceManager::validateResource(const char *str, ResType type, ResId idx) const { + if (type < rtFirst || type > rtLast || (uint)idx >= (uint)_types[type].size()) { + error("%s Illegal Glob type %s (%d) num %d", str, nameOfResType(type), type, idx); return false; } return true; } -void ResourceManager::nukeResource(int type, int idx) { - byte *ptr; - - if (!address[type]) - return; - - assert(idx >= 0 && idx < num[type]); - - ptr = address[type][idx]; +void ResourceManager::nukeResource(ResType type, ResId idx) { + byte *ptr = _types[type][idx]._address; if (ptr != NULL) { - debugC(DEBUG_RESOURCE, "nukeResource(%s,%d)", resTypeFromId(type), idx); - address[type][idx] = 0; - flags[type][idx] = 0; - status[type][idx] &= ~RS_MODIFIED; - _allocatedSize -= ((MemBlkHeader *)ptr)->size; - free(ptr); + debugC(DEBUG_RESOURCE, "nukeResource(%s,%d)", nameOfResType(type), idx); + _allocatedSize -= _types[type][idx]._size; + _types[type][idx].nuke(); } } @@ -900,77 +925,96 @@ int ScummEngine::getResourceDataSize(const byte *ptr) const { return READ_BE_UINT32(ptr - 4) - _resourceHeaderSize; } -void ResourceManager::lock(int type, int i) { - if (!validateResource("Locking", type, i)) +void ResourceManager::lock(ResType type, ResId idx) { + if (!validateResource("Locking", type, idx)) return; - flags[type][i] |= RF_LOCK; + _types[type][idx].lock(); } -void ResourceManager::unlock(int type, int i) { - if (!validateResource("Unlocking", type, i)) +void ResourceManager::unlock(ResType type, ResId idx) { + if (!validateResource("Unlocking", type, idx)) return; - flags[type][i] &= ~RF_LOCK; + _types[type][idx].unlock(); } -bool ResourceManager::isLocked(int type, int i) const { - if (!validateResource("isLocked", type, i)) +bool ResourceManager::isLocked(ResType type, ResId idx) const { + if (!validateResource("isLocked", type, idx)) return false; - return (flags[type][i] & RF_LOCK) != 0; + return _types[type][idx].isLocked(); +} + +void ResourceManager::Resource::lock() { + _flags |= RF_LOCK; +} + +void ResourceManager::Resource::unlock() { + _flags &= ~RF_LOCK; } -bool ScummEngine::isResourceInUse(int type, int i) const { - if (!_res->validateResource("isResourceInUse", type, i)) +bool ResourceManager::Resource::isLocked() const { + return (_flags & RF_LOCK) != 0; +} + +bool ScummEngine::isResourceInUse(ResType type, ResId idx) const { + if (!_res->validateResource("isResourceInUse", type, idx)) return false; switch (type) { case rtRoom: - return _roomResource == (byte)i; + return _roomResource == (byte)idx; case rtRoomImage: - return _roomResource == (byte)i; + return _roomResource == (byte)idx; case rtRoomScripts: - return _roomResource == (byte)i; + return _roomResource == (byte)idx; case rtScript: - return isScriptInUse(i); + return isScriptInUse(idx); case rtCostume: - return isCostumeInUse(i); + return isCostumeInUse(idx); case rtSound: // Sound resource 1 is used for queued speech - if (_game.heversion >= 60 && i == 1) + if (_game.heversion >= 60 && idx == 1) return true; else - return _sound->isSoundInUse(i); + return _sound->isSoundInUse(idx); case rtCharset: - return _charset->getCurID() == i; + return _charset->getCurID() == (int)idx; case rtImage: - return _res->isModified(type, i) != 0; + return _res->isModified(type, idx) != 0; case rtSpoolBuffer: - return _sound->isSoundRunning(10000 + i) != 0; + return _sound->isSoundRunning(10000 + idx) != 0; default: return false; } } -void ResourceManager::setModified(int type, int i) { - if (!validateResource("Modified", type, i)) +void ResourceManager::setModified(ResType type, ResId idx) { + if (!validateResource("Modified", type, idx)) return; - status[type][i] |= RS_MODIFIED; + _types[type][idx].setModified(); } -bool ResourceManager::isModified(int type, int i) const { - if (!validateResource("isModified", type, i)) +bool ResourceManager::isModified(ResType type, ResId idx) const { + if (!validateResource("isModified", type, idx)) return false; - return (status[type][i] & RS_MODIFIED) != 0; + return _types[type][idx].isModified(); +} + +void ResourceManager::Resource::setModified() { + _status |= RS_MODIFIED; +} + +bool ResourceManager::Resource::isModified() const { + return (_status & RS_MODIFIED) != 0; } void ResourceManager::expireResources(uint32 size) { - int i, j; - byte flag; byte best_counter; - int best_type, best_res = 0; + ResType best_type; + int best_res = 0; uint32 oldAllocatedSize; if (_expireCounter != 0xFF) { _expireCounter = 0xFF; - increaseResourceCounter(); + increaseResourceCounters(); } if (size + _allocatedSize < _maxHeapThreshold) @@ -979,60 +1023,58 @@ void ResourceManager::expireResources(uint32 size) { oldAllocatedSize = _allocatedSize; do { - best_type = 0; + best_type = rtInvalid; best_counter = 2; - for (i = rtFirst; i <= rtLast; i++) - if (mode[i]) { - for (j = num[i]; --j >= 0;) { - flag = flags[i][j]; - if (!(flag & RF_LOCK) && flag >= best_counter && address[i][j] && !_vm->isResourceInUse(i, j)) { - best_counter = flag; - best_type = i; - best_res = j; + for (ResType type = rtFirst; type <= rtLast; type = ResType(type + 1)) { + if (_types[type]._mode != kDynamicResTypeMode) { + // Resources of this type can be reloaded from the data files, + // so we can potentially unload them to free memory. + ResId idx = _types[type].size(); + while (idx-- > 0) { + Resource &tmp = _types[type][idx]; + byte counter = tmp.getResourceCounter(); + if (!tmp.isLocked() && counter >= best_counter && tmp._address && !_vm->isResourceInUse(type, idx)) { + best_counter = counter; + best_type = type; + best_res = idx; } } } + } if (!best_type) break; nukeResource(best_type, best_res); } while (size + _allocatedSize > _minHeapThreshold); - increaseResourceCounter(); + increaseResourceCounters(); debugC(DEBUG_RESOURCE, "Expired resources, mem %d -> %d", oldAllocatedSize, _allocatedSize); } void ResourceManager::freeResources() { - int i, j; - for (i = rtFirst; i <= rtLast; i++) { - for (j = num[i]; --j >= 0;) { - if (isResourceLoaded(i, j)) - nukeResource(i, j); + for (ResType type = rtFirst; type <= rtLast; type = ResType(type + 1)) { + ResId idx = _types[type].size(); + while (idx-- > 0) { + if (isResourceLoaded(type, idx)) + nukeResource(type, idx); } - free(address[i]); - free(flags[i]); - free(status[i]); - free(roomno[i]); - free(roomoffs[i]); - - free(globsize[i]); + _types[type].clear(); } } -void ScummEngine::loadPtrToResource(int type, int resindex, const byte *source) { +void ScummEngine::loadPtrToResource(ResType type, ResId idx, const byte *source) { byte *alloced; int len; - _res->nukeResource(type, resindex); + _res->nukeResource(type, idx); len = resStrLen(source) + 1; - if (len <= 0) return; - alloced = _res->createResource(type, resindex, len); + alloced = _res->createResource(type, idx, len); if (!source) { // Need to refresh the script pointer, since createResource may @@ -1045,32 +1087,30 @@ void ScummEngine::loadPtrToResource(int type, int resindex, const byte *source) } } -bool ResourceManager::isResourceLoaded(int type, int idx) const { +bool ResourceManager::isResourceLoaded(ResType type, ResId idx) const { if (!validateResource("isResourceLoaded", type, idx)) return false; - return address[type][idx] != NULL; + return _types[type][idx]._address != NULL; } void ResourceManager::resourceStats() { - int i, j; uint32 lockedSize = 0, lockedNum = 0; - byte flag; - for (i = rtFirst; i <= rtLast; i++) - for (j = num[i]; --j >= 0;) { - flag = flags[i][j]; - if (flag & RF_LOCK && address[i][j]) { - lockedSize += ((MemBlkHeader *)address[i][j])->size; + for (ResType type = rtFirst; type <= rtLast; type = ResType(type + 1)) { + ResId idx = _types[type].size(); + while (idx-- > 0) { + Resource &tmp = _types[type][idx]; + if (tmp.isLocked() && tmp._address) { + lockedSize += tmp._size; lockedNum++; } } + } debug(1, "Total allocated size=%d, locked=%d(%d)", _allocatedSize, lockedSize, lockedNum); } void ScummEngine_v5::readMAXS(int blockSize) { - debug(9, "ScummEngine_v5 readMAXS: MAXS has blocksize %d", blockSize); - _numVariables = _fileHandle->readUint16LE(); // 800 _fileHandle->readUint16LE(); // 16 _numBitVariables = _fileHandle->readUint16LE(); // 2048 @@ -1099,8 +1139,6 @@ void ScummEngine_v5::readMAXS(int blockSize) { #ifdef ENABLE_SCUMM_7_8 void ScummEngine_v8::readMAXS(int blockSize) { - debug(9, "ScummEngine_v8 readMAXS: MAXS has blocksize %d", blockSize); - _fileHandle->seek(50, SEEK_CUR); // Skip over SCUMM engine version _fileHandle->seek(50, SEEK_CUR); // Skip over data file version _numVariables = _fileHandle->readUint32LE(); // 1500 @@ -1129,8 +1167,6 @@ void ScummEngine_v8::readMAXS(int blockSize) { } void ScummEngine_v7::readMAXS(int blockSize) { - debug(9, "ScummEngine_v7 readMAXS: MAXS has blocksize %d", blockSize); - _fileHandle->seek(50, SEEK_CUR); // Skip over SCUMM engine version _fileHandle->seek(50, SEEK_CUR); // Skip over data file version _numVariables = _fileHandle->readUint16LE(); @@ -1164,8 +1200,6 @@ void ScummEngine_v7::readMAXS(int blockSize) { void ScummEngine_v6::readMAXS(int blockSize) { if (blockSize == 38) { - debug(0, "ScummEngine_v6 readMAXS: MAXS has blocksize %d", blockSize); - _numVariables = _fileHandle->readUint16LE(); _fileHandle->readUint16LE(); _numBitVariables = _fileHandle->readUint16LE(); @@ -1288,35 +1322,35 @@ void ScummEngine::allocateArrays() { } _res->allocResTypeData(rtCostume, (_game.features & GF_NEW_COSTUMES) ? MKTAG('A','K','O','S') : MKTAG('C','O','S','T'), - _numCostumes, "costume", 1); - _res->allocResTypeData(rtRoom, MKTAG('R','O','O','M'), _numRooms, "room", 1); - _res->allocResTypeData(rtRoomImage, MKTAG('R','M','I','M'), _numRooms, "room image", 1); - _res->allocResTypeData(rtRoomScripts, MKTAG('R','M','S','C'), _numRooms, "room script", 1); - _res->allocResTypeData(rtSound, MKTAG('S','O','U','N'), _numSounds, "sound", 2); - _res->allocResTypeData(rtScript, MKTAG('S','C','R','P'), _numScripts, "script", 1); - _res->allocResTypeData(rtCharset, MKTAG('C','H','A','R'), _numCharsets, "charset", 1); - _res->allocResTypeData(rtObjectName, 0, _numNewNames, "new name", 0); - _res->allocResTypeData(rtInventory, 0, _numInventory, "inventory", 0); - _res->allocResTypeData(rtTemp, 0, 10, "temp", 0); - _res->allocResTypeData(rtScaleTable, 0, 5, "scale table", 0); - _res->allocResTypeData(rtActorName, 0, _numActors, "actor name", 0); - _res->allocResTypeData(rtVerb, 0, _numVerbs, "verb", 0); - _res->allocResTypeData(rtString, 0, _numArray, "array", 0); - _res->allocResTypeData(rtFlObject, 0, _numFlObject, "flobject", 0); - _res->allocResTypeData(rtMatrix, 0, 10, "boxes", 0); - _res->allocResTypeData(rtImage, MKTAG('A','W','I','Z'), _numImages, "images", 1); - _res->allocResTypeData(rtTalkie, MKTAG('T','L','K','E'), _numTalkies, "talkie", 1); + _numCostumes, kStaticResTypeMode); + _res->allocResTypeData(rtRoom, MKTAG('R','O','O','M'), _numRooms, kStaticResTypeMode); + _res->allocResTypeData(rtRoomImage, MKTAG('R','M','I','M'), _numRooms, kStaticResTypeMode); + _res->allocResTypeData(rtRoomScripts, MKTAG('R','M','S','C'), _numRooms, kStaticResTypeMode); + _res->allocResTypeData(rtSound, MKTAG('S','O','U','N'), _numSounds, kSoundResTypeMode); + _res->allocResTypeData(rtScript, MKTAG('S','C','R','P'), _numScripts, kStaticResTypeMode); + _res->allocResTypeData(rtCharset, MKTAG('C','H','A','R'), _numCharsets, kStaticResTypeMode); + _res->allocResTypeData(rtObjectName, 0, _numNewNames, kDynamicResTypeMode); + _res->allocResTypeData(rtInventory, 0, _numInventory, kDynamicResTypeMode); + _res->allocResTypeData(rtTemp, 0, 10, kDynamicResTypeMode); + _res->allocResTypeData(rtScaleTable, 0, 5, kDynamicResTypeMode); + _res->allocResTypeData(rtActorName, 0, _numActors, kDynamicResTypeMode); + _res->allocResTypeData(rtVerb, 0, _numVerbs, kDynamicResTypeMode); + _res->allocResTypeData(rtString, 0, _numArray, kDynamicResTypeMode); + _res->allocResTypeData(rtFlObject, 0, _numFlObject, kDynamicResTypeMode); + _res->allocResTypeData(rtMatrix, 0, 10, kDynamicResTypeMode); + _res->allocResTypeData(rtImage, MKTAG('A','W','I','Z'), _numImages, kStaticResTypeMode); + _res->allocResTypeData(rtTalkie, MKTAG('T','L','K','E'), _numTalkies, kStaticResTypeMode); } void ScummEngine_v70he::allocateArrays() { ScummEngine::allocateArrays(); - _res->allocResTypeData(rtSpoolBuffer, 0, 9, "spool buffer", 1); + _res->allocResTypeData(rtSpoolBuffer, 0, 9, kStaticResTypeMode); _heV7RoomIntOffsets = (uint32 *)calloc(_numRooms, sizeof(uint32)); } -void ScummEngine::dumpResource(const char *tag, int idx, const byte *ptr, int length) { +void ScummEngine::dumpResource(const char *tag, int id, const byte *ptr, int length) { char buf[256]; Common::DumpFile out; @@ -1330,7 +1364,7 @@ void ScummEngine::dumpResource(const char *tag, int idx, const byte *ptr, int le else size = READ_BE_UINT32(ptr + 4); - sprintf(buf, "dumps/%s%d.dmp", tag, idx); + sprintf(buf, "dumps/%s%d.dmp", tag, id); out.open(buf); if (out.isOpen() == false) @@ -1499,10 +1533,10 @@ uint16 newTag2Old(uint32 newTag) { } } -const char *resTypeFromId(int id) { +const char *nameOfResType(ResType type) { static char buf[100]; - switch (id) { + switch (type) { case rtRoom: return "Room"; case rtScript: @@ -1545,10 +1579,8 @@ const char *resTypeFromId(int id) { return "Talkie"; case rtSpoolBuffer: return "SpoolBuffer"; - case rtNumTypes: - return "NumTypes"; default: - sprintf(buf, "%d", id); + sprintf(buf, "rt%d", type); return buf; } } diff --git a/engines/scumm/resource.h b/engines/scumm/resource.h index a14b7173a2..e8b0c1eaae 100644 --- a/engines/scumm/resource.h +++ b/engines/scumm/resource.h @@ -17,14 +17,14 @@ * 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. - * - * $URL$ - * $Id$ */ #ifndef SCUMM_RESOURCE_H #define SCUMM_RESOURCE_H +#include "common/array.h" +#include "scumm/scumm.h" // for ResType + namespace Scumm { enum { @@ -44,6 +44,185 @@ public: const byte *findNext(uint32 tag); }; +enum { + RES_INVALID_OFFSET = 0xFFFFFFFF +}; + +class ScummEngine; + +/** + * The mode of a resource type indicates whether the resource can be restored + * from the game data files or not. + * This affects for example whether the resource is stored in savestates. + * + * Note that we treat sound resources somewhat differently: On the one hand, + * these behave mostly like a kStaticResTypeMode res type. However, when we + * create a savestate, we do save *some* information about them: Namely, which + * sound resources are loaded in memory at the time the save is made. And when + * loading, we invoke ensureResourceLoaded() for each sound resource that was + * marked in this way. + */ +enum ResTypeMode { + kDynamicResTypeMode = 0, ///!< Resource is generated during runtime and may change + kStaticResTypeMode = 1, ///!< Resource comes from data files, does not change + kSoundResTypeMode = 2 ///!< Resource comes from data files, but may change +}; + +/** + * The 'resource manager' class. Currently doesn't really deserve to be called + * a 'class', at least until somebody gets around to OOfying this more. + */ +class ResourceManager { + //friend class ScummDebugger; + //friend class ScummEngine; +protected: + ScummEngine *_vm; + +public: + class Resource { + public: + /** + * Pointer to the data contained in this resource + */ + byte *_address; + + /** + * Size of this resource, i.e. of the data contained in it. + */ + uint32 _size; + + protected: + /** + * The uppermost bit indicates whether the resources is locked. + * The lower 7 bits contain a counter. This counter measures roughly + * how old the resource is; it starts out with a count of 1 and can go + * as high as 127. When memory falls low resp. when the engine decides + * that it should throw out some unused stuff, then it begins by + * removing the resources with the highest counter (excluding locked + * resources and resources that are known to be in use). + */ + byte _flags; + + /** + * The status of the resource. Currently only one bit is used, which + * indicates whether the resource is modified. + */ + byte _status; + + public: + /** + * The id of the room (resp. the disk) the resource is contained in. + */ + byte _roomno; + + /** + * The offset (in bytes) where the data for this resources can be found + * in the game data file(s), relative to the start of the room the + * resource is contained in. + * + * A value of RES_INVALID_OFFSET indicates a resources that is not contained + * in the game data files. + */ + uint32 _roomoffs; + + public: + Resource(); + ~Resource(); + + void nuke(); + + inline void setResourceCounter(byte counter); + inline byte getResourceCounter() const; + + void lock(); + void unlock(); + bool isLocked() const; + + void setModified(); + bool isModified() const; + }; + + /** + * This struct represents a resource type and all resource of that type. + */ + class ResTypeData : public Common::Array<Resource> { + friend class ResourceManager; + public: + /** + * The mode of this res type. + */ + ResTypeMode _mode; + + /** + * The 4-byte tag or chunk type associated to this resource type, if any. + * Only applies to resources that are loaded from the game data files. + * This value is only used for debugging purposes. + */ + uint32 _tag; + + public: + ResTypeData(); + ~ResTypeData(); + }; + ResTypeData _types[rtLast + 1]; + +protected: + uint32 _allocatedSize; + uint32 _maxHeapThreshold, _minHeapThreshold; + byte _expireCounter; + +public: + ResourceManager(ScummEngine *vm); + ~ResourceManager(); + + void setHeapThreshold(int min, int max); + + void allocResTypeData(ResType type, uint32 tag, int num, ResTypeMode mode); + void freeResources(); + + byte *createResource(ResType type, ResId idx, uint32 size); + void nukeResource(ResType type, ResId idx); + +// inline Resource &getRes(ResType type, ResId idx) { return _types[type][idx]; } +// inline const Resource &getRes(ResType type, ResId idx) const { return _types[type][idx]; } + + bool isResourceLoaded(ResType type, ResId idx) const; + + void lock(ResType type, ResId idx); + void unlock(ResType type, ResId idx); + bool isLocked(ResType type, ResId idx) const; + + void setModified(ResType type, ResId idx); + bool isModified(ResType type, ResId idx) const; + + /** + * This method increments the _expireCounter, and if it overflows (which happens + * after at most 256 calls), it calls increaseResourceCounter. + * It is invoked in the engine's main loop ScummEngine::scummLoop(). + */ + void increaseExpireCounter(); + + /** + * Update the specified resource's counter. + */ + void setResourceCounter(ResType type, ResId idx, byte counter); + + /** + * Increment the counter of all unlocked loaded resources. + * The maximal count is 255. + * This is called by increaseExpireCounter and expireResources, + * but also by ScummEngine::startScene. + */ + void increaseResourceCounters(); + + void resourceStats(); + +//protected: + bool validateResource(const char *str, ResType type, ResId idx) const; +protected: + void expireResources(uint32 size); +}; + } // End of namespace Scumm #endif diff --git a/engines/scumm/resource_v2.cpp b/engines/scumm/resource_v2.cpp index 3dc3b4d14e..927ee676a5 100644 --- a/engines/scumm/resource_v2.cpp +++ b/engines/scumm/resource_v2.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "scumm/file.h" @@ -87,40 +84,40 @@ void ScummEngine_v2::readClassicIndexFile() { } for (i = 0; i < _numRooms; i++) { - _res->roomno[rtRoom][i] = i; + _res->_types[rtRoom][i]._roomno = i; } _fileHandle->seek(_numRooms, SEEK_CUR); for (i = 0; i < _numRooms; i++) { - _res->roomoffs[rtRoom][i] = _fileHandle->readUint16LE(); - if (_res->roomoffs[rtRoom][i] == 0xFFFF) - _res->roomoffs[rtRoom][i] = (uint32)RES_INVALID_OFFSET; + _res->_types[rtRoom][i]._roomoffs = _fileHandle->readUint16LE(); + if (_res->_types[rtRoom][i]._roomoffs == 0xFFFF) + _res->_types[rtRoom][i]._roomoffs = (uint32)RES_INVALID_OFFSET; } for (i = 0; i < _numCostumes; i++) { - _res->roomno[rtCostume][i] = _fileHandle->readByte(); + _res->_types[rtCostume][i]._roomno = _fileHandle->readByte(); } for (i = 0; i < _numCostumes; i++) { - _res->roomoffs[rtCostume][i] = _fileHandle->readUint16LE(); - if (_res->roomoffs[rtCostume][i] == 0xFFFF) - _res->roomoffs[rtCostume][i] = (uint32)RES_INVALID_OFFSET; + _res->_types[rtCostume][i]._roomoffs = _fileHandle->readUint16LE(); + if (_res->_types[rtCostume][i]._roomoffs == 0xFFFF) + _res->_types[rtCostume][i]._roomoffs = (uint32)RES_INVALID_OFFSET; } for (i = 0; i < _numScripts; i++) { - _res->roomno[rtScript][i] = _fileHandle->readByte(); + _res->_types[rtScript][i]._roomno = _fileHandle->readByte(); } for (i = 0; i < _numScripts; i++) { - _res->roomoffs[rtScript][i] = _fileHandle->readUint16LE(); - if (_res->roomoffs[rtScript][i] == 0xFFFF) - _res->roomoffs[rtScript][i] = (uint32)RES_INVALID_OFFSET; + _res->_types[rtScript][i]._roomoffs = _fileHandle->readUint16LE(); + if (_res->_types[rtScript][i]._roomoffs == 0xFFFF) + _res->_types[rtScript][i]._roomoffs = (uint32)RES_INVALID_OFFSET; } for (i = 0; i < _numSounds; i++) { - _res->roomno[rtSound][i] = _fileHandle->readByte(); + _res->_types[rtSound][i]._roomno = _fileHandle->readByte(); } for (i = 0; i < _numSounds; i++) { - _res->roomoffs[rtSound][i] = _fileHandle->readUint16LE(); - if (_res->roomoffs[rtSound][i] == 0xFFFF) - _res->roomoffs[rtSound][i] = (uint32)RES_INVALID_OFFSET; + _res->_types[rtSound][i]._roomoffs = _fileHandle->readUint16LE(); + if (_res->_types[rtSound][i]._roomoffs == 0xFFFF) + _res->_types[rtSound][i]._roomoffs = (uint32)RES_INVALID_OFFSET; } } diff --git a/engines/scumm/resource_v3.cpp b/engines/scumm/resource_v3.cpp index 5f23720ce9..55e42e389c 100644 --- a/engines/scumm/resource_v3.cpp +++ b/engines/scumm/resource_v3.cpp @@ -18,44 +18,42 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "scumm/scumm_v3.h" #include "scumm/file.h" +#include "scumm/resource.h" #include "scumm/util.h" namespace Scumm { -extern const char *resTypeFromId(int id); +extern const char *nameOfResType(ResType type); -int ScummEngine_v3old::readResTypeList(int id) { - int num; - int i; +int ScummEngine_v3old::readResTypeList(ResType type) { + uint num; + ResId idx; - debug(9, "readResTypeList(%s)", resTypeFromId(id)); + debug(9, "readResTypeList(%s)", nameOfResType(type)); num = _fileHandle->readByte(); if (num >= 0xFF) { - error("Too many %ss (%d) in directory", resTypeFromId(id), num); + error("Too many %ss (%d) in directory", nameOfResType(type), num); } - if (id == rtRoom) { - for (i = 0; i < num; i++) - _res->roomno[id][i] = i; + if (type == rtRoom) { + for (idx = 0; idx < num; idx++) + _res->_types[type][idx]._roomno = idx; _fileHandle->seek(num, SEEK_CUR); } else { - for (i = 0; i < num; i++) - _res->roomno[id][i] = _fileHandle->readByte(); + for (idx = 0; idx < num; idx++) + _res->_types[type][idx]._roomno = _fileHandle->readByte(); } - for (i = 0; i < num; i++) { - _res->roomoffs[id][i] = _fileHandle->readUint16LE(); - if (_res->roomoffs[id][i] == 0xFFFF) - _res->roomoffs[id][i] = (uint32)RES_INVALID_OFFSET; + for (idx = 0; idx < num; idx++) { + _res->_types[type][idx]._roomoffs = _fileHandle->readUint16LE(); + if (_res->_types[type][idx]._roomoffs == 0xFFFF) + _res->_types[type][idx]._roomoffs = (uint32)RES_INVALID_OFFSET; } return num; diff --git a/engines/scumm/resource_v4.cpp b/engines/scumm/resource_v4.cpp index b1d98494d4..6215e86b89 100644 --- a/engines/scumm/resource_v4.cpp +++ b/engines/scumm/resource_v4.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ @@ -31,23 +28,22 @@ namespace Scumm { -extern const char *resTypeFromId(int id); +extern const char *nameOfResType(ResType type); -int ScummEngine_v4::readResTypeList(int id) { - int num; - int i; +int ScummEngine_v4::readResTypeList(ResType type) { + uint num; - debug(9, "readResTypeList(%s)", resTypeFromId(id)); + debug(9, "readResTypeList(%s)", nameOfResType(type)); num = _fileHandle->readUint16LE(); - if (num != _res->num[id]) { - error("Invalid number of %ss (%d) in directory", resTypeFromId(id), num); + if (num != _res->_types[type].size()) { + error("Invalid number of %ss (%d) in directory", nameOfResType(type), num); } - for (i = 0; i < num; i++) { - _res->roomno[id][i] = _fileHandle->readByte(); - _res->roomoffs[id][i] = _fileHandle->readUint32LE(); + for (ResId idx = 0; idx < num; idx++) { + _res->_types[type][idx]._roomno = _fileHandle->readByte(); + _res->_types[type][idx]._roomoffs = _fileHandle->readUint32LE(); } return num; diff --git a/engines/scumm/room.cpp b/engines/scumm/room.cpp index 06fa0f2c39..8962a0e971 100644 --- a/engines/scumm/room.cpp +++ b/engines/scumm/room.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ @@ -118,7 +115,7 @@ void ScummEngine::startScene(int room, Actor *a, int objectNr) { VAR(VAR_ROOM) = room; _fullRedraw = true; - _res->increaseResourceCounter(); + _res->increaseResourceCounters(); _currentRoom = room; VAR(VAR_ROOM) = room; @@ -468,7 +465,7 @@ void ScummEngine::setupRoomSubBlocks() { * So it is not appropriate to call it after loading a savegame. */ void ScummEngine::resetRoomSubBlocks() { - int i; + ResId i; const byte *ptr; byte *roomptr; @@ -528,14 +525,14 @@ void ScummEngine::resetRoomSubBlocks() { // // Load scale data // - for (i = 1; i < _res->num[rtScaleTable]; i++) + for (i = 1; i < _res->_types[rtScaleTable].size(); i++) _res->nukeResource(rtScaleTable, i); ptr = findResourceData(MKTAG('S','C','A','L'), roomptr); if (ptr) { int s1, s2, y1, y2; if (_game.version == 8) { - for (i = 1; i < _res->num[rtScaleTable]; i++, ptr += 16) { + for (i = 1; i < _res->_types[rtScaleTable].size(); i++, ptr += 16) { s1 = READ_LE_UINT32(ptr); y1 = READ_LE_UINT32(ptr + 4); s2 = READ_LE_UINT32(ptr + 8); @@ -543,7 +540,7 @@ void ScummEngine::resetRoomSubBlocks() { setScaleSlot(i, 0, y1, s1, 0, y2, s2); } } else { - for (i = 1; i < _res->num[rtScaleTable]; i++, ptr += 8) { + for (i = 1; i < _res->_types[rtScaleTable].size(); i++, ptr += 8) { s1 = READ_LE_UINT16(ptr); y1 = READ_LE_UINT16(ptr + 2); s2 = READ_LE_UINT16(ptr + 4); @@ -715,7 +712,6 @@ void ScummEngine_v3old::setupRoomSubBlocks() { } void ScummEngine_v3old::resetRoomSubBlocks() { - int i; const byte *ptr; byte *roomptr; @@ -772,7 +768,7 @@ void ScummEngine_v3old::resetRoomSubBlocks() { size = 0; // Compute matrix size - for (i = 0; i < numOfBoxes; i++) { + for (int i = 0; i < numOfBoxes; i++) { while (*tmp != 0xFF) { size++; tmp++; @@ -797,8 +793,8 @@ void ScummEngine_v3old::resetRoomSubBlocks() { // // No scale data in old bundle games // - for (i = 1; i < _res->num[rtScaleTable]; i++) - _res->nukeResource(rtScaleTable, i); + for (ResId id = 1; id < _res->_types[rtScaleTable].size(); id++) + _res->nukeResource(rtScaleTable, id); } diff --git a/engines/scumm/saveload.cpp b/engines/scumm/saveload.cpp index 3bfe51a77b..f5d219c721 100644 --- a/engines/scumm/saveload.cpp +++ b/engines/scumm/saveload.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/config-manager.h" @@ -314,7 +311,6 @@ static bool loadSaveGameHeader(Common::SeekableReadStream *in, SaveGameHeader &h bool ScummEngine::loadState(int slot, bool compat) { Common::String filename; Common::SeekableReadStream *in; - int i, j; SaveGameHeader hdr; int sb, sh; @@ -429,10 +425,10 @@ bool ScummEngine::loadState(int slot, bool compat) { memset(gfxUsageBits, 0, sizeof(gfxUsageBits)); // Nuke all resources - for (i = rtFirst; i <= rtLast; i++) - if (i != rtTemp && i != rtBuffer && (i != rtSound || _saveSound || !compat)) - for (j = 0; j < _res->num[i]; j++) { - _res->nukeResource(i, j); + for (ResType type = rtFirst; type <= rtLast; type = ResType(type + 1)) + if (type != rtTemp && type != rtBuffer && (type != rtSound || _saveSound || !compat)) + for (ResId idx = 0; idx < _res->_types[type].size(); idx++) { + _res->nukeResource(type, idx); } resetScummVars(); @@ -520,8 +516,8 @@ bool ScummEngine::loadState(int slot, bool compat) { // loading such an old save game, try to upgrade the old to new format. if (hdr.ver < VER(22)) { // Convert all rtScaleTable resources to matching scale items - for (i = 1; i < _res->num[rtScaleTable]; i++) { - convertScaleTableToScaleSlot(i); + for (ResId idx = 1; idx < _res->_types[rtScaleTable].size(); idx++) { + convertScaleTableToScaleSlot(idx); } } @@ -1119,7 +1115,7 @@ void ScummEngine::saveOrLoad(Serializer *s) { MKEND() }; - int i, j; + int i; int var120Backup; int var98Backup; uint8 md5Backup[16]; @@ -1137,9 +1133,9 @@ void ScummEngine::saveOrLoad(Serializer *s) { // MD5 Operations: Backup on load, compare, and reset. if (s->isLoading()) { char md5str1[32+1], md5str2[32+1]; - for (j = 0; j < 16; j++) { - sprintf(md5str1 + j*2, "%02x", (int)_gameMD5[j]); - sprintf(md5str2 + j*2, "%02x", (int)md5Backup[j]); + for (i = 0; i < 16; i++) { + sprintf(md5str1 + i*2, "%02x", (int)_gameMD5[i]); + sprintf(md5str2 + i*2, "%02x", (int)md5Backup[i]); } debug(2, "Save version: %d", s->getVersion()); @@ -1239,18 +1235,19 @@ void ScummEngine::saveOrLoad(Serializer *s) { // // Save/load resources // - int type, idx; + ResType type; + ResId idx; if (s->getVersion() >= VER(26)) { // New, more robust resource save/load system. This stores the type // and index of each resource. Thus if we increase e.g. the maximum // number of script resources, savegames won't break. if (s->isSaving()) { - for (type = rtFirst; type <= rtLast; type++) { - if (_res->mode[type] != 1 && type != rtTemp && type != rtBuffer) { + for (type = rtFirst; type <= rtLast; type = ResType(type + 1)) { + if (_res->_types[type]._mode != kStaticResTypeMode && type != rtTemp && type != rtBuffer) { s->saveUint16(type); // Save the res type... - for (idx = 0; idx < _res->num[type]; idx++) { + for (idx = 0; idx < _res->_types[type].size(); idx++) { // Only save resources which actually exist... - if (_res->address[type][idx]) { + if (_res->_types[type][idx]._address) { s->saveUint16(idx); // Save the index of the resource saveResource(s, type, idx); } @@ -1260,9 +1257,9 @@ void ScummEngine::saveOrLoad(Serializer *s) { } s->saveUint16(0xFFFF); // End marker } else { - while ((type = s->loadUint16()) != 0xFFFF) { + while ((type = (ResType)s->loadUint16()) != 0xFFFF) { while ((idx = s->loadUint16()) != 0xFFFF) { - assert(0 <= idx && idx < _res->num[type]); + assert(idx < _res->_types[type].size()); loadResource(s, type, idx); } } @@ -1271,15 +1268,15 @@ void ScummEngine::saveOrLoad(Serializer *s) { // Old, fragile resource save/load system. Doesn't save resources // with index 0, and breaks whenever we change the limit on a given // resource type. - for (type = rtFirst; type <= rtLast; type++) - if (_res->mode[type] != 1 && type != rtTemp && type != rtBuffer) { + for (type = rtFirst; type <= rtLast; type = ResType(type + 1)) + if (_res->_types[type]._mode != kStaticResTypeMode && type != rtTemp && type != rtBuffer) { // For V1-V5 games, there used to be no object name resources. // At some point this changed. But since old savegames rely on // unchanged resource counts, we have to hard code the following check if (_game.version < 6 && type == rtObjectName) continue; - for (idx = 1; idx < _res->num[type]; idx++) - saveLoadResource(s, type, idx); + for (idx = 1; idx < _res->_types[type].size(); idx++) + loadResourceOLD(s, type, idx); } } @@ -1390,18 +1387,18 @@ void ScummEngine::saveOrLoad(Serializer *s) { // Save/load a list of the locked objects // if (s->isSaving()) { - for (i = rtFirst; i <= rtLast; i++) - for (j = 1; j < _res->num[i]; j++) { - if (_res->isLocked(i, j)) { - s->saveByte(i); - s->saveUint16(j); + for (type = rtFirst; type <= rtLast; type = ResType(type + 1)) + for (idx = 1; idx < _res->_types[type].size(); idx++) { + if (_res->isLocked(type, idx)) { + s->saveByte(type); + s->saveUint16(idx); } } s->saveByte(0xFF); } else { - while ((i = s->loadByte()) != 0xFF) { - j = s->loadUint16(); - _res->lock(i, j); + while ((type = (ResType)s->loadByte()) != 0xFF) { + idx = s->loadUint16(); + _res->lock(type, idx); } } @@ -1636,69 +1633,44 @@ void ScummEngine_v100he::saveOrLoad(Serializer *s) { } #endif -void ScummEngine::saveLoadResource(Serializer *ser, int type, int idx) { - byte *ptr; +void ScummEngine::loadResourceOLD(Serializer *ser, ResType type, ResId idx) { uint32 size; - if (!_res->mode[type]) { - if (ser->isSaving()) { - ptr = _res->address[type][idx]; - if (ptr == NULL) { - ser->saveUint32(0); - return; - } - - size = ((MemBlkHeader *)ptr)->size; - - ser->saveUint32(size); - ser->saveBytes(ptr + sizeof(MemBlkHeader), size); - + if (type == rtSound && ser->getVersion() >= VER(23)) { + // Save/load only a list of resource numbers that need to be reloaded. + if (ser->loadUint16()) + ensureResourceLoaded(rtSound, idx); + } else if (_res->_types[type]._mode == kDynamicResTypeMode) { + size = ser->loadUint32(); + if (size) { + _res->createResource(type, idx, size); + ser->loadBytes(getResourceAddress(type, idx), size); if (type == rtInventory) { - ser->saveUint16(_inventory[idx]); + _inventory[idx] = ser->loadUint16(); } if (type == rtObjectName && ser->getVersion() >= VER(25)) { - ser->saveUint16(_newNames[idx]); - } - } else { - size = ser->loadUint32(); - if (size) { - _res->createResource(type, idx, size); - ser->loadBytes(getResourceAddress(type, idx), size); - if (type == rtInventory) { - _inventory[idx] = ser->loadUint16(); - } - if (type == rtObjectName && ser->getVersion() >= VER(25)) { - // Paranoia: We increased the possible number of new names - // to fix bugs #933610 and #936323. The savegame format - // didn't change, but at least during the transition - // period there is a slight chance that we try to load - // more names than we have allocated space for. If so, - // discard them. - if (idx < _numNewNames) - _newNames[idx] = ser->loadUint16(); - } + // Paranoia: We increased the possible number of new names + // to fix bugs #933610 and #936323. The savegame format + // didn't change, but at least during the transition + // period there is a slight chance that we try to load + // more names than we have allocated space for. If so, + // discard them. + if (idx < _numNewNames) + _newNames[idx] = ser->loadUint16(); } } - } else if (_res->mode[type] == 2 && ser->getVersion() >= VER(23)) { - // Save/load only a list of resource numbers that need to be reloaded. - if (ser->isSaving()) { - ser->saveUint16(_res->address[type][idx] ? 1 : 0); - } else { - if (ser->loadUint16()) - ensureResourceLoaded(type, idx); - } } } -void ScummEngine::saveResource(Serializer *ser, int type, int idx) { - assert(_res->address[type][idx]); +void ScummEngine::saveResource(Serializer *ser, ResType type, ResId idx) { + assert(_res->_types[type][idx]._address); - if (_res->mode[type] == 0) { - byte *ptr = _res->address[type][idx]; - uint32 size = ((MemBlkHeader *)ptr)->size; + if (_res->_types[type]._mode == kDynamicResTypeMode) { + byte *ptr = _res->_types[type][idx]._address; + uint32 size = _res->_types[type][idx]._size; ser->saveUint32(size); - ser->saveBytes(ptr + sizeof(MemBlkHeader), size); + ser->saveBytes(ptr, size); if (type == rtInventory) { ser->saveUint16(_inventory[idx]); @@ -1709,18 +1681,24 @@ void ScummEngine::saveResource(Serializer *ser, int type, int idx) { } } -void ScummEngine::loadResource(Serializer *ser, int type, int idx) { +void ScummEngine::loadResource(Serializer *ser, ResType type, ResId idx) { if (_game.heversion >= 60 && ser->getVersion() <= VER(65) && ((type == rtSound && idx == 1) || (type == rtSpoolBuffer))) { uint32 size = ser->loadUint32(); assert(size); _res->createResource(type, idx, size); ser->loadBytes(getResourceAddress(type, idx), size); - } else if (_res->mode[type] == 0) { + } else if (type == rtSound) { + // HE Games use sound resource 1 for speech + if (_game.heversion >= 60 && idx == 1) + return; + + ensureResourceLoaded(rtSound, idx); + } else if (_res->_types[type]._mode == kDynamicResTypeMode) { uint32 size = ser->loadUint32(); assert(size); - _res->createResource(type, idx, size); - ser->loadBytes(getResourceAddress(type, idx), size); + byte *ptr = _res->createResource(type, idx, size); + ser->loadBytes(ptr, size); if (type == rtInventory) { _inventory[idx] = ser->loadUint16(); @@ -1728,12 +1706,6 @@ void ScummEngine::loadResource(Serializer *ser, int type, int idx) { if (type == rtObjectName) { _newNames[idx] = ser->loadUint16(); } - } else if (_res->mode[type] == 2) { - // HE Games use sound resource 1 for speech - if (_game.heversion >= 60 && idx == 1) - return; - - ensureResourceLoaded(type, idx); } } diff --git a/engines/scumm/saveload.h b/engines/scumm/saveload.h index eead241b90..776f40e12b 100644 --- a/engines/scumm/saveload.h +++ b/engines/scumm/saveload.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef SCUMM_SAVELOAD_H diff --git a/engines/scumm/script.cpp b/engines/scumm/script.cpp index 9e02f126cd..cfc4b3c419 100644 --- a/engines/scumm/script.cpp +++ b/engines/scumm/script.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/config-manager.h" @@ -39,7 +36,7 @@ namespace Scumm { /* Start executing script 'script' with the given parameters */ void ScummEngine::runScript(int script, bool freezeResistant, bool recursive, int *lvarptr, int cycle) { ScriptSlot *s; - byte *scriptPtr; + //byte *scriptPtr; uint32 scriptOffs; byte scriptType; int slot; @@ -51,7 +48,8 @@ void ScummEngine::runScript(int script, bool freezeResistant, bool recursive, in stopScript(script); if (script < _numGlobalScripts) { - scriptPtr = getResourceAddress(rtScript, script); + // Call getResourceAddress to ensure the resource is loaded & its usage count reset + /*scriptPtr =*/ getResourceAddress(rtScript, script); scriptOffs = _resourceHeaderSize; scriptType = WIO_GLOBAL; @@ -393,26 +391,26 @@ void ScummEngine::getScriptBaseAddress() { break; _scriptOrgPointer = getResourceAddress(rtInventory, idx); assert(idx < _numInventory); - _lastCodePtr = &_res->address[rtInventory][idx]; + _lastCodePtr = &_res->_types[rtInventory][idx]._address; break; case WIO_LOCAL: case WIO_ROOM: /* room script */ if (_game.version == 8) { _scriptOrgPointer = getResourceAddress(rtRoomScripts, _roomResource); - assert(_roomResource < _res->num[rtRoomScripts]); - _lastCodePtr = &_res->address[rtRoomScripts][_roomResource]; + assert(_roomResource < (int)_res->_types[rtRoomScripts].size()); + _lastCodePtr = &_res->_types[rtRoomScripts][_roomResource]._address; } else { _scriptOrgPointer = getResourceAddress(rtRoom, _roomResource); assert(_roomResource < _numRooms); - _lastCodePtr = &_res->address[rtRoom][_roomResource]; + _lastCodePtr = &_res->_types[rtRoom][_roomResource]._address; } break; case WIO_GLOBAL: /* global script */ _scriptOrgPointer = getResourceAddress(rtScript, ss->number); assert(ss->number < _numScripts); - _lastCodePtr = &_res->address[rtScript][ss->number]; + _lastCodePtr = &_res->_types[rtScript][ss->number]._address; break; case WIO_FLOBJECT: /* flobject script */ @@ -421,7 +419,7 @@ void ScummEngine::getScriptBaseAddress() { idx = _objs[idx].fl_object_index; _scriptOrgPointer = getResourceAddress(rtFlObject, idx); assert(idx < _numFlObject); - _lastCodePtr = &_res->address[rtFlObject][idx]; + _lastCodePtr = &_res->_types[rtFlObject][idx]._address; break; default: error("Bad type while getting base address"); @@ -448,7 +446,7 @@ void ScummEngine::resetScriptPointer() { * collected by ResourceManager::expireResources. */ void ScummEngine::refreshScriptPointer() { - if (*_lastCodePtr + sizeof(MemBlkHeader) != _scriptOrgPointer) { + if (*_lastCodePtr != _scriptOrgPointer) { long oldoffs = _scriptPointer - _scriptOrgPointer; getScriptBaseAddress(); _scriptPointer = _scriptOrgPointer + oldoffs; @@ -496,7 +494,11 @@ void ScummEngine::executeOpcode(byte i) { } const char *ScummEngine::getOpcodeDesc(byte i) { +#ifndef REDUCE_MEMORY_USAGE return _opcodes[i].desc; +#else + return ""; +#endif } byte ScummEngine::fetchScriptByte() { @@ -1102,7 +1104,7 @@ void ScummEngine::checkAndRunSentenceScript() { // For now we assume that if there are more than 460 scripts, then // the pair 29/104 is used, else the pair 28/103. - if (_res->num[rtScript] > 460) { + if (_res->_types[rtScript].size() > 460) { if (sentenceScript == 104) sentenceScript = 29; } else { diff --git a/engines/scumm/script.h b/engines/scumm/script.h index 39d5d802b4..7b2c625144 100644 --- a/engines/scumm/script.h +++ b/engines/scumm/script.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef SCUMM_SCRIPT_H @@ -30,14 +27,19 @@ namespace Scumm { - typedef Common::Functor0<void> Opcode; struct OpcodeEntry : Common::NonCopyable { Opcode *proc; +#ifndef REDUCE_MEMORY_USAGE const char *desc; +#endif +#ifndef REDUCE_MEMORY_USAGE OpcodeEntry() : proc(0), desc(0) {} +#else + OpcodeEntry() : proc(0) {} +#endif ~OpcodeEntry() { setProc(0, 0); } @@ -47,7 +49,9 @@ struct OpcodeEntry : Common::NonCopyable { delete proc; proc = p; } +#ifndef REDUCE_MEMORY_USAGE desc = d; +#endif } }; diff --git a/engines/scumm/script_v0.cpp b/engines/scumm/script_v0.cpp index 7c3964a326..1ef16d7106 100644 --- a/engines/scumm/script_v0.cpp +++ b/engines/scumm/script_v0.cpp @@ -18,15 +18,13 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "scumm/actor.h" #include "scumm/charset.h" #include "scumm/object.h" +#include "scumm/resource.h" #include "scumm/scumm_v0.h" #include "scumm/verbs.h" diff --git a/engines/scumm/script_v2.cpp b/engines/scumm/script_v2.cpp index d7ff8950f8..7f02e899b4 100644 --- a/engines/scumm/script_v2.cpp +++ b/engines/scumm/script_v2.cpp @@ -18,14 +18,12 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "scumm/actor.h" #include "scumm/charset.h" #include "scumm/object.h" +#include "scumm/resource.h" #include "scumm/scumm_v2.h" #include "scumm/sound.h" #include "scumm/util.h" @@ -740,23 +738,23 @@ void ScummEngine_v2::o2_drawObject() { } void ScummEngine_v2::o2_resourceRoutines() { - const ResTypes resTypes[] = { - rtNumTypes, // Invalid - rtNumTypes, // Invalid + const ResType resTypes[] = { + rtInvalid, + rtInvalid, rtCostume, rtRoom, - rtNumTypes, // Invalid + rtInvalid, rtScript, rtSound }; int resid = getVarOrDirectByte(PARAM_1); int opcode = fetchScriptByte(); - ResTypes type = rtNumTypes; + ResType type = rtInvalid; if (0 <= (opcode >> 4) && (opcode >> 4) < (int)ARRAYSIZE(resTypes)) type = resTypes[opcode >> 4]; - if ((opcode & 0x0f) == 0 || type == rtNumTypes) + if ((opcode & 0x0f) == 0 || type == rtInvalid) return; // HACK V2 Maniac Mansion tries to load an invalid sound resource in demo script. diff --git a/engines/scumm/script_v3.cpp b/engines/scumm/script_v3.cpp index 176eefdeef..b28d831101 100644 --- a/engines/scumm/script_v3.cpp +++ b/engines/scumm/script_v3.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "scumm/scumm_v3.h" diff --git a/engines/scumm/script_v4.cpp b/engines/scumm/script_v4.cpp index 98001e6854..1302c8c28d 100644 --- a/engines/scumm/script_v4.cpp +++ b/engines/scumm/script_v4.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "scumm/scumm_v4.h" diff --git a/engines/scumm/script_v5.cpp b/engines/scumm/script_v5.cpp index ee790f7876..b8f3b4b3b3 100644 --- a/engines/scumm/script_v5.cpp +++ b/engines/scumm/script_v5.cpp @@ -18,14 +18,12 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "scumm/actor.h" #include "scumm/charset.h" #include "scumm/object.h" +#include "scumm/resource.h" #include "scumm/scumm_v3.h" #include "scumm/scumm_v5.h" #include "scumm/sound.h" @@ -1492,7 +1490,7 @@ void ScummEngine_v5::o5_systemOps() { } void ScummEngine_v5::o5_resourceRoutines() { - const ResTypes resType[4] = { rtScript, rtSound, rtCostume, rtRoom }; + const ResType resType[4] = { rtScript, rtSound, rtCostume, rtRoom }; int resid = 0; int foo, bar; diff --git a/engines/scumm/script_v6.cpp b/engines/scumm/script_v6.cpp index b2df1d0baa..decd34222d 100644 --- a/engines/scumm/script_v6.cpp +++ b/engines/scumm/script_v6.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/config-manager.h" @@ -360,11 +357,11 @@ void ScummEngine_v6::nukeArray(int a) { } int ScummEngine_v6::findFreeArrayId() { - byte **addr = _res->address[rtString]; + const ResourceManager::ResTypeData &rtd = _res->_types[rtString]; int i; for (i = 1; i < _numArray; i++) { - if (!addr[i]) + if (!rtd[i]._address) return i; } error("Out of array pointers, %d max", _numArray); diff --git a/engines/scumm/script_v8.cpp b/engines/scumm/script_v8.cpp index 1250a82d33..c8b92be3c8 100644 --- a/engines/scumm/script_v8.cpp +++ b/engines/scumm/script_v8.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/config-manager.h" diff --git a/engines/scumm/scumm.cpp b/engines/scumm/scumm.cpp index f43aed53f7..e8dd6cb548 100644 --- a/engines/scumm/scumm.cpp +++ b/engines/scumm/scumm.cpp @@ -18,16 +18,12 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/config-manager.h" #include "common/debug-channels.h" #include "common/md5.h" #include "common/events.h" -#include "common/EventRecorder.h" #include "common/system.h" #include "common/translation.h" @@ -65,6 +61,7 @@ #include "scumm/player_v2a.h" #include "scumm/player_v3a.h" #include "scumm/player_v4a.h" +#include "scumm/resource.h" #include "scumm/he/resource_he.h" #include "scumm/scumm_v0.h" #include "scumm/scumm_v8.h" @@ -113,9 +110,13 @@ ScummEngine::ScummEngine(OSystem *syst, const DetectorResult &dr) _language(dr.language), _debugger(0), _currentScript(0xFF), // Let debug() work on init stage - _messageDialog(0), _pauseDialog(0), _versionDialog(0) { + _messageDialog(0), _pauseDialog(0), _versionDialog(0), + _rnd("scumm") + { - if (_game.platform == Common::kPlatformNES) { + if (_game.heversion > 0) { + _gdi = new GdiHE(this); + } else if (_game.platform == Common::kPlatformNES) { _gdi = new GdiNES(this); #ifdef USE_RGB_COLOR } else if (_game.features & GF_16BIT_COLOR) { @@ -574,8 +575,6 @@ ScummEngine::ScummEngine(OSystem *syst, const DetectorResult &dr) assert(!_mainMenuDialog); _mainMenuDialog = new ScummMenuDialog(this); #endif - - g_eventRec.registerRandomSource(_rnd, "scumm"); } @@ -1184,10 +1183,6 @@ Common::Error ScummEngine::init() { resetScumm(); resetScummVars(); - if (_imuse) { - _imuse->setBase(_res->address[rtSound]); - } - if (_game.version >= 5 && _game.version <= 7) _sound->setupSound(); @@ -1233,7 +1228,7 @@ void ScummEngine::setupScumm() { requestLoad(ConfMan.getInt("save_slot")); } - _res->allocResTypeData(rtBuffer, 0, 10, "buffer", 0); + _res->allocResTypeData(rtBuffer, 0, 10, kDynamicResTypeMode); setupScummVars(); @@ -1833,22 +1828,22 @@ void ScummEngine::setupMusic(int midi) { MidiDriver *nativeMidiDriver = 0; MidiDriver *adlibMidiDriver = 0; - if (_musicType != MDT_ADLIB) + if (_musicType != MDT_ADLIB && _musicType != MDT_TOWNS) nativeMidiDriver = MidiDriver::createMidi(dev); if (nativeMidiDriver != NULL && _native_mt32) nativeMidiDriver->property(MidiDriver::PROP_CHANNEL_MASK, 0x03FE); bool multi_midi = ConfMan.getBool("multi_midi") && _musicType != MDT_NONE && (midi & MDT_ADLIB); - if (_musicType == MDT_ADLIB || multi_midi) { - adlibMidiDriver = MidiDriver::createMidi(MidiDriver::detectDevice(MDT_ADLIB)); + if (_musicType == MDT_ADLIB || MDT_TOWNS || multi_midi) { + adlibMidiDriver = MidiDriver::createMidi(MidiDriver::detectDevice(_musicType == MDT_TOWNS ? MDT_TOWNS : MDT_ADLIB)); adlibMidiDriver->property(MidiDriver::PROP_OLD_ADLIB, (_game.features & GF_SMALL_HEADER) ? 1 : 0); } _imuse = IMuse::create(_system, nativeMidiDriver, adlibMidiDriver); if (_game.platform == Common::kPlatformFMTowns) { - _musicEngine = _townsPlayer = new Player_Towns_v2(this, _imuse, _mixer, true); + _musicEngine = _townsPlayer = new Player_Towns_v2(this, _mixer, _imuse, true); if (!_townsPlayer->init()) - error("Failed to initialize FM-Towns audio driver"); + error("ScummEngine::setupMusic(): Failed to initialize FM-Towns audio driver"); } else { _musicEngine = _imuse; } @@ -1860,7 +1855,6 @@ void ScummEngine::setupMusic(int midi) { _imuse->property(IMuse::PROP_GAME_ID, _game.id); if (ConfMan.hasKey("tempo")) _imuse->property(IMuse::PROP_TEMPO_BASE, ConfMan.getInt("tempo")); - // YM2162 driver can't handle midi->getPercussionChannel(), NULL shouldn't init MT-32/GM/GS if (midi != MDT_NONE) { _imuse->property(IMuse::PROP_NATIVE_MT32, _native_mt32); if (MidiDriver::getMusicType(dev) != MT_MT32) // MT-32 Emulation shouldn't be GM/GS initialized @@ -2422,13 +2416,16 @@ void ScummEngine::pauseGame() { } void ScummEngine::restart() { -// TODO: Check this function - we should probably be reinitting a lot more stuff, and I suspect -// this leaks memory like a sieve + // FIXME: This function *leaks memory*, and quite a lot so. For example, + // we re-init the resource manager, which causes readMAXS() to be called + // again, which allocates some memory. There are many other leaks, though. + + // TODO: We should also probably be reinitting a lot more stuff. -// Fingolfin seez: An alternate way to implement restarting would be to create -// a save state right after startup ... to this end we could introduce a SaveFile -// subclass which is implemented using a memory buffer (i.e. no actual file is -// created). Then to restart we just have to load that pseudo save state. + // Fingolfin seez: An alternate way to implement restarting would be to create + // a save state right after startup ... to this end we could introduce a SaveFile + // subclass which is implemented using a memory buffer (i.e. no actual file is + // created). Then to restart we just have to load that pseudo save state. int i; @@ -2448,23 +2445,12 @@ void ScummEngine::restart() { for (i = 1; i < _numGlobalObjects; i++) clearOwnerOf(i); - // Reallocate arrays - // FIXME: This should already be called by readIndexFile. - // FIXME: regardless of that, allocateArrays and allocResTypeData leaks - // heavily, which should be fixed. - allocateArrays(); - - // Reread index (reset objectstate etc) readIndexFile(); // Reinit scumm variables resetScumm(); resetScummVars(); - if (_imuse) { - _imuse->setBase(_res->address[rtSound]); - } - // Reinit sound engine if (_game.version >= 5 && _game.version <= 7) _sound->setupSound(); diff --git a/engines/scumm/scumm.h b/engines/scumm/scumm.h index 62c6c70e5a..636c909911 100644 --- a/engines/scumm/scumm.h +++ b/engines/scumm/scumm.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef SCUMM_H @@ -171,17 +168,6 @@ enum { DEBUG_SMUSH = 1 << 10 // Track SMUSH }; -/** - * Internal header for any memory block allocated by the resource manager. - * - * @todo Hide MemBlkHeader; no code outside the resource manager should - * have to use it, ever. Currently script code needs it to detect whether - * some scripts have moved (in fetchScriptByte()). - */ -struct MemBlkHeader { - uint32 size; -}; - struct VerbSlot; struct ObjectData; @@ -322,7 +308,8 @@ struct SaveStateMetaInfos { * WARNING: Do not change the order of these, as the savegame format relies * on it; any change made here will break savegame compatibility! */ -enum ResTypes { +enum ResType { + rtInvalid = 0, rtFirst = 1, rtRoom = 1, rtScript = 2, @@ -345,75 +332,12 @@ enum ResTypes { rtImage = 19, rtTalkie = 20, rtSpoolBuffer = 21, - rtLast = 21, - rtNumTypes = 22 + rtLast = 21 }; -enum { - RES_INVALID_OFFSET = 0xFFFFFFFF -}; - -/** - * The 'resource manager' class. Currently doesn't really deserve to be called - * a 'class', at least until somebody gets around to OOfying this more. - */ -class ResourceManager { - //friend class ScummDebugger; - //friend class ScummEngine; -protected: - ScummEngine *_vm; - -public: - byte mode[rtNumTypes]; - uint16 num[rtNumTypes]; - uint32 tags[rtNumTypes]; - const char *name[rtNumTypes]; - byte **address[rtNumTypes]; -protected: - byte *flags[rtNumTypes]; - byte *status[rtNumTypes]; -public: - byte *roomno[rtNumTypes]; - uint32 *roomoffs[rtNumTypes]; - uint32 *globsize[rtNumTypes]; - -protected: - uint32 _allocatedSize; - uint32 _maxHeapThreshold, _minHeapThreshold; - byte _expireCounter; - -public: - ResourceManager(ScummEngine *vm); - ~ResourceManager(); - - void setHeapThreshold(int min, int max); - - void allocResTypeData(int id, uint32 tag, int num, const char *name, int mode); - void freeResources(); - - byte *createResource(int type, int index, uint32 size); - void nukeResource(int type, int i); +typedef uint16 ResId; - bool isResourceLoaded(int type, int index) const; - - void lock(int type, int i); - void unlock(int type, int i); - bool isLocked(int type, int i) const; - - void setModified(int type, int i); - bool isModified(int type, int i) const; - - void increaseExpireCounter(); - void setResourceCounter(int type, int index, byte flag); - void increaseResourceCounter(); - - void resourceStats(); - -//protected: - bool validateResource(const char *str, int type, int index) const; -protected: - void expireResources(uint32 size); -}; +class ResourceManager; /** * Base class for all SCUMM engines. @@ -654,9 +578,9 @@ protected: bool saveState(int slot, bool compat); bool loadState(int slot, bool compat); virtual void saveOrLoad(Serializer *s); - void saveLoadResource(Serializer *ser, int type, int index); // "Obsolete" - void saveResource(Serializer *ser, int type, int index); - void loadResource(Serializer *ser, int type, int index); + void saveResource(Serializer *ser, ResType type, ResId idx); + void loadResource(Serializer *ser, ResType type, ResId idx); + void loadResourceOLD(Serializer *ser, ResType type, ResId idx); // "Obsolete" Common::String makeSavegameName(int slot, bool temporary) const { return makeSavegameName(_targetName, slot, temporary); @@ -689,9 +613,11 @@ protected: protected: /* Script VM - should be in Script class */ uint32 _localScriptOffsets[1024]; - const byte *_scriptPointer, *_scriptOrgPointer; - byte _opcode, _currentScript; + const byte *_scriptPointer; + const byte *_scriptOrgPointer; const byte * const *_lastCodePtr; + byte _opcode; + byte _currentScript; int _scummStackPos; int _vmStack[150]; @@ -787,26 +713,26 @@ protected: void askForDisk(const char *filename, int disknum); // TODO: Use Common::String bool openResourceFile(const Common::String &filename, byte encByte); // TODO: Use Common::String - void loadPtrToResource(int type, int i, const byte *ptr); - virtual int readResTypeList(int id); -// void allocResTypeData(int id, uint32 tag, int num, const char *name, int mode); + void loadPtrToResource(ResType type, ResId idx, const byte *ptr); + virtual int readResTypeList(ResType type); +// void allocResTypeData(ResType type, uint32 tag, int num, int mode); // byte *createResource(int type, int index, uint32 size); - int loadResource(int type, int i); -// void nukeResource(int type, int i); - int getResourceRoomNr(int type, int idx); - virtual uint32 getResourceRoomOffset(int type, int idx); - int getResourceSize(int type, int idx); + int loadResource(ResType type, ResId idx); +// void nukeResource(ResType type, ResId idx); + int getResourceRoomNr(ResType type, ResId idx); + virtual uint32 getResourceRoomOffset(ResType type, ResId idx); + int getResourceSize(ResType type, ResId idx); public: - byte *getResourceAddress(int type, int i); - virtual byte *getStringAddress(int i); + byte *getResourceAddress(ResType type, ResId idx); + virtual byte *getStringAddress(ResId idx); byte *getStringAddressVar(int i); - void ensureResourceLoaded(int type, int i); + void ensureResourceLoaded(ResType type, ResId idx); protected: - int readSoundResource(int index); - int readSoundResourceSmallHeader(int index); - bool isResourceInUse(int type, int i) const; + int readSoundResource(ResId idx); + int readSoundResourceSmallHeader(ResId idx); + bool isResourceInUse(ResType type, ResId idx) const; virtual void setupRoomSubBlocks(); virtual void resetRoomSubBlocks(); diff --git a/engines/scumm/scumm_v0.h b/engines/scumm/scumm_v0.h index 9ffb19a959..9c492663dc 100644 --- a/engines/scumm/scumm_v0.h +++ b/engines/scumm/scumm_v0.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef SCUMM_SCRIPT_V0_H diff --git a/engines/scumm/scumm_v2.h b/engines/scumm/scumm_v2.h index 687ccd6ab3..47c5fa2626 100644 --- a/engines/scumm/scumm_v2.h +++ b/engines/scumm/scumm_v2.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef SCUMM_SCRIPT_V2_H diff --git a/engines/scumm/scumm_v3.h b/engines/scumm/scumm_v3.h index 6e8d593a35..f11ca16a50 100644 --- a/engines/scumm/scumm_v3.h +++ b/engines/scumm/scumm_v3.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef SCUMM_SCRIPT_V3_H @@ -62,7 +59,7 @@ public: ScummEngine_v3old(OSystem *syst, const DetectorResult &dr); protected: - virtual int readResTypeList(int id); + virtual int readResTypeList(ResType type); virtual void readIndexFile(); virtual void setupRoomSubBlocks(); virtual void resetRoomSubBlocks(); diff --git a/engines/scumm/scumm_v4.h b/engines/scumm/scumm_v4.h index 653cfc228e..e21e4b26ae 100644 --- a/engines/scumm/scumm_v4.h +++ b/engines/scumm/scumm_v4.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef SCUMM_SCRIPT_V4_H @@ -59,7 +56,7 @@ protected: virtual void scummLoop_handleSaveLoad(); - virtual int readResTypeList(int id); + virtual int readResTypeList(ResType type); virtual void readIndexFile(); virtual void loadCharset(int no); virtual void resetRoomObjects(); diff --git a/engines/scumm/scumm_v5.h b/engines/scumm/scumm_v5.h index 71222470f4..b8a61c1677 100644 --- a/engines/scumm/scumm_v5.h +++ b/engines/scumm/scumm_v5.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef SCUMM_SCRIPT_V5_H diff --git a/engines/scumm/scumm_v6.h b/engines/scumm/scumm_v6.h index eb55b83596..c42a49a9f5 100644 --- a/engines/scumm/scumm_v6.h +++ b/engines/scumm/scumm_v6.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef SCUMM_SCRIPT_V6_H @@ -110,7 +107,7 @@ protected: virtual void decodeParseString(int a, int b); virtual void readArrayFromIndexFile(); - virtual byte *getStringAddress(int i); + virtual byte *getStringAddress(ResId idx); virtual void readMAXS(int blockSize); virtual void palManipulateInit(int resID, int start, int end, int time); diff --git a/engines/scumm/scumm_v7.h b/engines/scumm/scumm_v7.h index c4bb3525be..81bb25e0b5 100644 --- a/engines/scumm/scumm_v7.h +++ b/engines/scumm/scumm_v7.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef SCUMM_SCRIPT_V7_H diff --git a/engines/scumm/scumm_v8.h b/engines/scumm/scumm_v8.h index 94619eb7ac..43bfad1fc9 100644 --- a/engines/scumm/scumm_v8.h +++ b/engines/scumm/scumm_v8.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef SCUMM_SCRIPT_V8_H diff --git a/engines/scumm/smush/channel.cpp b/engines/scumm/smush/channel.cpp index 95b7653262..7f71d0549b 100644 --- a/engines/scumm/smush/channel.cpp +++ b/engines/scumm/smush/channel.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ diff --git a/engines/scumm/smush/channel.h b/engines/scumm/smush/channel.h index 717a294d96..839aeaa970 100644 --- a/engines/scumm/smush/channel.h +++ b/engines/scumm/smush/channel.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef SCUMM_SMUSH_CHANNEL_H diff --git a/engines/scumm/smush/codec1.cpp b/engines/scumm/smush/codec1.cpp index d0d92fcd79..79d97d2ce3 100644 --- a/engines/scumm/smush/codec1.cpp +++ b/engines/scumm/smush/codec1.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ diff --git a/engines/scumm/smush/codec37.cpp b/engines/scumm/smush/codec37.cpp index 9dbbc6816f..dcc8ee3c19 100644 --- a/engines/scumm/smush/codec37.cpp +++ b/engines/scumm/smush/codec37.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ diff --git a/engines/scumm/smush/codec37.h b/engines/scumm/smush/codec37.h index 96033ade31..bcb858b0b5 100644 --- a/engines/scumm/smush/codec37.h +++ b/engines/scumm/smush/codec37.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef SCUMM_SMUSH_CODEC37_H diff --git a/engines/scumm/smush/codec47.cpp b/engines/scumm/smush/codec47.cpp index 47286ba4fc..4b503a0a38 100644 --- a/engines/scumm/smush/codec47.cpp +++ b/engines/scumm/smush/codec47.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ diff --git a/engines/scumm/smush/codec47.h b/engines/scumm/smush/codec47.h index cfa467de4e..0e5156db5c 100644 --- a/engines/scumm/smush/codec47.h +++ b/engines/scumm/smush/codec47.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef SCUMM_SMUSH_CODEC_47_H diff --git a/engines/scumm/smush/codec47ARM.s b/engines/scumm/smush/codec47ARM.s index 73341c117f..a91f932558 100644 --- a/engines/scumm/smush/codec47ARM.s +++ b/engines/scumm/smush/codec47ARM.s @@ -18,9 +18,6 @@ @ along with this program@ if not, write to the Free Software @ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. @ -@ $URL$ -@ $Id$ -@ @ @author Robin Watts (robin@wss.co.uk) @ @ This file, provides an ARM optimised version of sections of codec47.cpp. diff --git a/engines/scumm/smush/imuse_channel.cpp b/engines/scumm/smush/imuse_channel.cpp index 32fa99a870..f2c4f993e4 100644 --- a/engines/scumm/smush/imuse_channel.cpp +++ b/engines/scumm/smush/imuse_channel.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ diff --git a/engines/scumm/smush/saud_channel.cpp b/engines/scumm/smush/saud_channel.cpp index f730acf804..2f1ca512f0 100644 --- a/engines/scumm/smush/saud_channel.cpp +++ b/engines/scumm/smush/saud_channel.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ diff --git a/engines/scumm/smush/smush_font.cpp b/engines/scumm/smush/smush_font.cpp index 75abe9a772..7765bf1292 100644 --- a/engines/scumm/smush/smush_font.cpp +++ b/engines/scumm/smush/smush_font.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ diff --git a/engines/scumm/smush/smush_font.h b/engines/scumm/smush/smush_font.h index 312d6dbc78..5de4a725c6 100644 --- a/engines/scumm/smush/smush_font.h +++ b/engines/scumm/smush/smush_font.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef SCUMM_SMUSH_FONT_H diff --git a/engines/scumm/smush/smush_mixer.cpp b/engines/scumm/smush/smush_mixer.cpp index 4ab0d7c733..d2b4b5a482 100644 --- a/engines/scumm/smush/smush_mixer.cpp +++ b/engines/scumm/smush/smush_mixer.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ diff --git a/engines/scumm/smush/smush_mixer.h b/engines/scumm/smush/smush_mixer.h index 3d62fdc722..75a8889242 100644 --- a/engines/scumm/smush/smush_mixer.h +++ b/engines/scumm/smush/smush_mixer.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef SCUMM_SMUSH_MIXER_H diff --git a/engines/scumm/smush/smush_player.cpp b/engines/scumm/smush/smush_player.cpp index 2e39558372..66502572de 100644 --- a/engines/scumm/smush/smush_player.cpp +++ b/engines/scumm/smush/smush_player.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "engines/engine.h" diff --git a/engines/scumm/smush/smush_player.h b/engines/scumm/smush/smush_player.h index af7942c193..5a2024060e 100644 --- a/engines/scumm/smush/smush_player.h +++ b/engines/scumm/smush/smush_player.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #if !defined(SCUMM_SMUSH_PLAYER_H) && defined(ENABLE_SCUMM_7_8) diff --git a/engines/scumm/sound.cpp b/engines/scumm/sound.cpp index a38119584f..c22da8e7c7 100644 --- a/engines/scumm/sound.cpp +++ b/engines/scumm/sound.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/config-manager.h" @@ -32,6 +29,7 @@ #include "scumm/imuse/imuse.h" #include "scumm/imuse_digi/dimuse.h" #include "scumm/player_towns.h" +#include "scumm/resource.h" #include "scumm/scumm.h" #include "scumm/sound.h" #include "scumm/util.h" @@ -1066,7 +1064,7 @@ void Sound::saveLoadWithSerializer(Serializer *ser) { #pragma mark --- Sound resource handling --- #pragma mark - -static void convertMac0Resource(ResourceManager *res, int idx, byte *src_ptr, int size); +static void convertMac0Resource(ResourceManager *res, ResId idx, byte *src_ptr, int size); /* @@ -1076,7 +1074,7 @@ static void convertMac0Resource(ResourceManager *res, int idx, byte *src_ptr, in * could stand a thorough cleanup! */ -int ScummEngine::readSoundResource(int idx) { +int ScummEngine::readSoundResource(ResId idx) { uint32 pos, total_size, size, tag, basetag, max_total_size; int pri, best_pri; uint32 best_size = 0, best_offs = 0; @@ -1120,7 +1118,7 @@ int ScummEngine::readSoundResource(int idx) { break; case MKTAG('A','D','L',' '): pri = 1; - if (_musicType == MDT_ADLIB) + if (_musicType == MDT_ADLIB || _musicType == MDT_TOWNS) pri = 10; break; case MKTAG('A','M','I',' '): @@ -1226,7 +1224,7 @@ int ScummEngine::readSoundResource(int idx) { if (!dmuFile.open(buffer)) { error("Can't open music file %s", buffer); - _res->roomoffs[rtSound][idx] = RES_INVALID_OFFSET; + _res->_types[rtSound][idx]._roomoffs = RES_INVALID_OFFSET; return 0; } dmuFile.seek(4, SEEK_SET); @@ -1250,7 +1248,7 @@ int ScummEngine::readSoundResource(int idx) { } error("Unrecognized base tag 0x%08x in sound %d", basetag, idx); } - _res->roomoffs[rtSound][idx] = RES_INVALID_OFFSET; + _res->_types[rtSound][idx]._roomoffs = RES_INVALID_OFFSET; return 0; } @@ -1429,7 +1427,7 @@ static byte Mac0ToGMInstrument(uint32 type, int &transpose) { } } -static void convertMac0Resource(ResourceManager *res, int idx, byte *src_ptr, int size) { +static void convertMac0Resource(ResourceManager *res, ResId idx, byte *src_ptr, int size) { /* From Markus Magnuson (superqult) we got this information: Mac0 @@ -1620,7 +1618,7 @@ static void convertMac0Resource(ResourceManager *res, int idx, byte *src_ptr, in #endif } -static void convertADResource(ResourceManager *res, const GameSettings& game, int idx, byte *src_ptr, int size) { +static void convertADResource(ResourceManager *res, const GameSettings& game, ResId idx, byte *src_ptr, int size) { // We will ignore the PPQN in the original resource, because // it's invalid anyway. We use a constant PPQN of 480. const int ppqn = 480; @@ -2003,7 +2001,7 @@ static void convertADResource(ResourceManager *res, const GameSettings& game, in } -int ScummEngine::readSoundResourceSmallHeader(int idx) { +int ScummEngine::readSoundResourceSmallHeader(ResId idx) { uint32 pos, total_size, size, tag; uint32 ad_size = 0, ad_offs = 0; uint32 ro_size = 0, ro_offs = 0; @@ -2125,7 +2123,7 @@ int ScummEngine::readSoundResourceSmallHeader(int idx) { _fileHandle->read(_res->createResource(rtSound, idx, ro_size - 4), ro_size - 4); return 1; } - _res->roomoffs[rtSound][idx] = RES_INVALID_OFFSET; + _res->_types[rtSound][idx]._roomoffs = RES_INVALID_OFFSET; return 0; } diff --git a/engines/scumm/sound.h b/engines/scumm/sound.h index 39b4af805d..03659ceff1 100644 --- a/engines/scumm/sound.h +++ b/engines/scumm/sound.h @@ -17,9 +17,6 @@ * 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. - * - * $URL$ - * $Id$ */ #ifndef SCUMM_SOUND_H diff --git a/engines/scumm/string.cpp b/engines/scumm/string.cpp index 2dfa9da723..c27b6d5e1c 100644 --- a/engines/scumm/string.cpp +++ b/engines/scumm/string.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ @@ -35,6 +32,7 @@ #ifdef ENABLE_HE #include "scumm/he/intern_he.h" #endif +#include "scumm/resource.h" #include "scumm/scumm.h" #include "scumm/scumm_v6.h" #include "scumm/scumm_v8.h" @@ -354,7 +352,7 @@ bool ScummEngine::handleNextCharsetCode(Actor *a, int *code) { bool ScummEngine_v72he::handleNextCharsetCode(Actor *a, int *code) { const int charsetCode = (_game.heversion >= 80) ? 127 : 64; uint32 talk_sound_a = 0; - uint32 talk_sound_b = 0; + //uint32 talk_sound_b = 0; int i, c = 0; char value[32]; bool endLoop = false; @@ -385,7 +383,7 @@ bool ScummEngine_v72he::handleNextCharsetCode(Actor *a, int *code) { i++; } value[i] = 0; - talk_sound_b = atoi(value); + //talk_sound_b = atoi(value); ((SoundHE *)_sound)->startHETalkSound(talk_sound_a); break; case 104: @@ -408,7 +406,7 @@ bool ScummEngine_v72he::handleNextCharsetCode(Actor *a, int *code) { } value[i] = 0; talk_sound_a = atoi(value); - talk_sound_b = 0; + //talk_sound_b = 0; ((SoundHE *)_sound)->startHETalkSound(talk_sound_a); break; case 119: diff --git a/engines/scumm/usage_bits.cpp b/engines/scumm/usage_bits.cpp index da262defc9..10645fea10 100644 --- a/engines/scumm/usage_bits.cpp +++ b/engines/scumm/usage_bits.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ diff --git a/engines/scumm/usage_bits.h b/engines/scumm/usage_bits.h index b3d582f7b9..3da1e791ea 100644 --- a/engines/scumm/usage_bits.h +++ b/engines/scumm/usage_bits.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef SCUMM_USAGE_BITS_H diff --git a/engines/scumm/util.cpp b/engines/scumm/util.cpp index 5c3e4c9d0c..47a6bad6ec 100644 --- a/engines/scumm/util.cpp +++ b/engines/scumm/util.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "scumm/util.h" diff --git a/engines/scumm/util.h b/engines/scumm/util.h index 0d33987c31..f8f999624c 100644 --- a/engines/scumm/util.h +++ b/engines/scumm/util.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef SCUMM_UTIL_H diff --git a/engines/scumm/vars.cpp b/engines/scumm/vars.cpp index 48fe0a20ed..56f8de2ad1 100644 --- a/engines/scumm/vars.cpp +++ b/engines/scumm/vars.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ diff --git a/engines/scumm/verbs.cpp b/engines/scumm/verbs.cpp index 6d5eb3fad7..69caceb53a 100644 --- a/engines/scumm/verbs.cpp +++ b/engines/scumm/verbs.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "scumm/actor.h" diff --git a/engines/scumm/verbs.h b/engines/scumm/verbs.h index 83e924edac..fb4dc969e2 100644 --- a/engines/scumm/verbs.h +++ b/engines/scumm/verbs.h @@ -17,9 +17,6 @@ * 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. - * - * $URL$ - * $Id$ */ #ifndef SCUMM_VERBS_H diff --git a/engines/sky/autoroute.cpp b/engines/sky/autoroute.cpp index d6974837c6..5273b21807 100644 --- a/engines/sky/autoroute.cpp +++ b/engines/sky/autoroute.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ diff --git a/engines/sky/autoroute.h b/engines/sky/autoroute.h index c40cf647d5..2d01be01ec 100644 --- a/engines/sky/autoroute.h +++ b/engines/sky/autoroute.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef SKY_AUTOROUTE_H diff --git a/engines/sky/compact.cpp b/engines/sky/compact.cpp index 672fb38ca9..66ce92f8fc 100644 --- a/engines/sky/compact.cpp +++ b/engines/sky/compact.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ diff --git a/engines/sky/compact.h b/engines/sky/compact.h index 4861273146..a7b8520539 100644 --- a/engines/sky/compact.h +++ b/engines/sky/compact.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef SKY_COMPACT_H diff --git a/engines/sky/control.cpp b/engines/sky/control.cpp index f31f0f6ba9..9efa6ce769 100644 --- a/engines/sky/control.cpp +++ b/engines/sky/control.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ diff --git a/engines/sky/control.h b/engines/sky/control.h index e4428c1876..6aa7a41c62 100644 --- a/engines/sky/control.h +++ b/engines/sky/control.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef SKY_CONTROL_H diff --git a/engines/sky/debug.cpp b/engines/sky/debug.cpp index df55966a9a..ebc1ee377d 100644 --- a/engines/sky/debug.cpp +++ b/engines/sky/debug.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ diff --git a/engines/sky/debug.h b/engines/sky/debug.h index ff94cbc8ad..71b2083385 100644 --- a/engines/sky/debug.h +++ b/engines/sky/debug.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef SKY_DEBUG_H diff --git a/engines/sky/detection.cpp b/engines/sky/detection.cpp index 6871fc9604..21921f2154 100644 --- a/engines/sky/detection.cpp +++ b/engines/sky/detection.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "sky/control.h" diff --git a/engines/sky/disk.cpp b/engines/sky/disk.cpp index 3795c4166d..a06c5c9be8 100644 --- a/engines/sky/disk.cpp +++ b/engines/sky/disk.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ diff --git a/engines/sky/disk.h b/engines/sky/disk.h index 0cdcbb4d0f..320c38eebd 100644 --- a/engines/sky/disk.h +++ b/engines/sky/disk.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef SKY_DISK_H diff --git a/engines/sky/grid.cpp b/engines/sky/grid.cpp index e2a96ebf1e..6a9dc502a7 100644 --- a/engines/sky/grid.cpp +++ b/engines/sky/grid.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "sky/compact.h" diff --git a/engines/sky/grid.h b/engines/sky/grid.h index 823462f8dd..6e0e9aabaa 100644 --- a/engines/sky/grid.h +++ b/engines/sky/grid.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef SKY_GRID_H diff --git a/engines/sky/hufftext.cpp b/engines/sky/hufftext.cpp index 677ea4817e..0592f094d9 100644 --- a/engines/sky/hufftext.cpp +++ b/engines/sky/hufftext.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "sky/text.h" diff --git a/engines/sky/intro.cpp b/engines/sky/intro.cpp index 506a6699c1..f1ea4d2df2 100644 --- a/engines/sky/intro.cpp +++ b/engines/sky/intro.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ diff --git a/engines/sky/intro.h b/engines/sky/intro.h index d7a55b95bb..98af6e3664 100644 --- a/engines/sky/intro.h +++ b/engines/sky/intro.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef SKY_INTRO_H diff --git a/engines/sky/logic.cpp b/engines/sky/logic.cpp index f9ebd0fb64..de081bb631 100644 --- a/engines/sky/logic.cpp +++ b/engines/sky/logic.cpp @@ -18,14 +18,10 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/endian.h" #include "common/rect.h" -#include "common/EventRecorder.h" #include "common/textconsole.h" #include "sky/autoroute.h" @@ -71,8 +67,8 @@ void Logic::setupLogicTable() { _logicTable = logicTable; } -Logic::Logic(SkyCompact *skyCompact, Screen *skyScreen, Disk *skyDisk, Text *skyText, MusicBase *skyMusic, Mouse *skyMouse, Sound *skySound) { - g_eventRec.registerRandomSource(_rnd, "sky"); +Logic::Logic(SkyCompact *skyCompact, Screen *skyScreen, Disk *skyDisk, Text *skyText, MusicBase *skyMusic, Mouse *skyMouse, Sound *skySound) + : _rnd("sky") { _skyCompact = skyCompact; _skyScreen = skyScreen; diff --git a/engines/sky/logic.h b/engines/sky/logic.h index da1d9ed997..9f8df25870 100644 --- a/engines/sky/logic.h +++ b/engines/sky/logic.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef SKY_LOGIC_H diff --git a/engines/sky/mouse.cpp b/engines/sky/mouse.cpp index 611010fa46..98f942889e 100644 --- a/engines/sky/mouse.cpp +++ b/engines/sky/mouse.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ diff --git a/engines/sky/mouse.h b/engines/sky/mouse.h index 6237b9fd29..1ba0167fb5 100644 --- a/engines/sky/mouse.h +++ b/engines/sky/mouse.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef SKY_MOUSE_H diff --git a/engines/sky/music/adlibchannel.cpp b/engines/sky/music/adlibchannel.cpp index 9b3c4338ab..896b58aa22 100644 --- a/engines/sky/music/adlibchannel.cpp +++ b/engines/sky/music/adlibchannel.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ diff --git a/engines/sky/music/adlibchannel.h b/engines/sky/music/adlibchannel.h index cbcf722e4e..44ac0d79d0 100644 --- a/engines/sky/music/adlibchannel.h +++ b/engines/sky/music/adlibchannel.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef SKY_MUSIC_ADLIBCHANNEL_H diff --git a/engines/sky/music/adlibmusic.cpp b/engines/sky/music/adlibmusic.cpp index da46964ef9..1b5518fcb1 100644 --- a/engines/sky/music/adlibmusic.cpp +++ b/engines/sky/music/adlibmusic.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ diff --git a/engines/sky/music/adlibmusic.h b/engines/sky/music/adlibmusic.h index 848c8eaf29..2782a07be6 100644 --- a/engines/sky/music/adlibmusic.h +++ b/engines/sky/music/adlibmusic.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef SKY_MUSIC_ADLIBMUSIC_H diff --git a/engines/sky/music/gmchannel.cpp b/engines/sky/music/gmchannel.cpp index be0afa8894..215d6490b9 100644 --- a/engines/sky/music/gmchannel.cpp +++ b/engines/sky/music/gmchannel.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "gmchannel.h" diff --git a/engines/sky/music/gmchannel.h b/engines/sky/music/gmchannel.h index e831b03424..f16de401db 100644 --- a/engines/sky/music/gmchannel.h +++ b/engines/sky/music/gmchannel.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef SKY_MUSIC_GMCHANNEL_H diff --git a/engines/sky/music/gmmusic.cpp b/engines/sky/music/gmmusic.cpp index 6a8529f287..d0ba1505cb 100644 --- a/engines/sky/music/gmmusic.cpp +++ b/engines/sky/music/gmmusic.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "sky/music/gmmusic.h" diff --git a/engines/sky/music/gmmusic.h b/engines/sky/music/gmmusic.h index baabf2c9ea..0f54a930e4 100644 --- a/engines/sky/music/gmmusic.h +++ b/engines/sky/music/gmmusic.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef SKY_MUSIC_GMMUSIC_H diff --git a/engines/sky/music/mt32music.cpp b/engines/sky/music/mt32music.cpp index 4f47e511c7..d068a221b2 100644 --- a/engines/sky/music/mt32music.cpp +++ b/engines/sky/music/mt32music.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "sky/music/mt32music.h" diff --git a/engines/sky/music/mt32music.h b/engines/sky/music/mt32music.h index 0b5573ffff..74962daac3 100644 --- a/engines/sky/music/mt32music.h +++ b/engines/sky/music/mt32music.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef SKY_MUSIC_MT32MUSIC_H diff --git a/engines/sky/music/musicbase.cpp b/engines/sky/music/musicbase.cpp index 748637f9d0..60d0f352e7 100644 --- a/engines/sky/music/musicbase.cpp +++ b/engines/sky/music/musicbase.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "sky/music/musicbase.h" diff --git a/engines/sky/music/musicbase.h b/engines/sky/music/musicbase.h index 1ad78b2cf7..c175876380 100644 --- a/engines/sky/music/musicbase.h +++ b/engines/sky/music/musicbase.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef SKY_MUSIC_MUSICBASE_H diff --git a/engines/sky/rnc_deco.cpp b/engines/sky/rnc_deco.cpp index eb8307764d..27fae03514 100644 --- a/engines/sky/rnc_deco.cpp +++ b/engines/sky/rnc_deco.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ diff --git a/engines/sky/rnc_deco.h b/engines/sky/rnc_deco.h index 38429383a3..96a75a9750 100644 --- a/engines/sky/rnc_deco.h +++ b/engines/sky/rnc_deco.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef SKY_RNC_DECO_H diff --git a/engines/sky/screen.cpp b/engines/sky/screen.cpp index a209571b37..2797ed2fea 100644 --- a/engines/sky/screen.cpp +++ b/engines/sky/screen.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ diff --git a/engines/sky/screen.h b/engines/sky/screen.h index 5e226c49ed..bf8b69a95a 100644 --- a/engines/sky/screen.h +++ b/engines/sky/screen.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef SKY_SCREEN_H diff --git a/engines/sky/sky.cpp b/engines/sky/sky.cpp index f10ec1083a..72abc26f32 100644 --- a/engines/sky/sky.cpp +++ b/engines/sky/sky.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/config-manager.h" diff --git a/engines/sky/sky.h b/engines/sky/sky.h index 58ac3ed26e..0b5f4c5c1c 100644 --- a/engines/sky/sky.h +++ b/engines/sky/sky.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef SKY_H diff --git a/engines/sky/skydefs.h b/engines/sky/skydefs.h index e3f3f3101f..070e185d55 100644 --- a/engines/sky/skydefs.h +++ b/engines/sky/skydefs.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef SKY_DEFS_H diff --git a/engines/sky/sound.cpp b/engines/sky/sound.cpp index 7191f6cd00..c6bcb2a4c4 100644 --- a/engines/sky/sound.cpp +++ b/engines/sky/sound.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ diff --git a/engines/sky/sound.h b/engines/sky/sound.h index ce060ce689..da0d91911b 100644 --- a/engines/sky/sound.h +++ b/engines/sky/sound.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef SKY_SOUND_H diff --git a/engines/sky/struc.h b/engines/sky/struc.h index 987f074ed1..c2ebf1bad0 100644 --- a/engines/sky/struc.h +++ b/engines/sky/struc.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef SKY_STRUC_H diff --git a/engines/sky/text.cpp b/engines/sky/text.cpp index 2464d93581..3e119b3b20 100644 --- a/engines/sky/text.cpp +++ b/engines/sky/text.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ diff --git a/engines/sky/text.h b/engines/sky/text.h index 06aabf5094..cf0d707ce9 100644 --- a/engines/sky/text.h +++ b/engines/sky/text.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef SKY_TEXT_H diff --git a/engines/sword1/animation.cpp b/engines/sword1/animation.cpp index 7c17befcff..b66cc6b5a7 100644 --- a/engines/sword1/animation.cpp +++ b/engines/sword1/animation.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/file.h" @@ -129,7 +126,7 @@ bool MoviePlayer::load(uint32 id) { continue; } - _movieTexts.push_back(new MovieText(startFrame, endFrame, ptr)); + _movieTexts.push_back(MovieText(startFrame, endFrame, ptr)); lastEnd = endFrame; } f.close(); @@ -164,8 +161,7 @@ void MoviePlayer::play() { _textMan->releaseText(2, false); - while (!_movieTexts.empty()) - delete _movieTexts.remove_at(_movieTexts.size() - 1); + _movieTexts.clear(); while (_snd->isSoundHandleActive(*_bgSoundHandle)) _system->delayMillis(100); @@ -182,8 +178,8 @@ void MoviePlayer::play() { void MoviePlayer::performPostProcessing(byte *screen) { if (!_movieTexts.empty()) { - if (_decoder->getCurFrame() == _movieTexts[0]->_startFrame) { - _textMan->makeTextSprite(2, (uint8 *)_movieTexts[0]->_text, 600, LETTER_COL); + if (_decoder->getCurFrame() == _movieTexts.front()._startFrame) { + _textMan->makeTextSprite(2, (const uint8 *)_movieTexts.front()._text.c_str(), 600, LETTER_COL); FrameHeader *frame = _textMan->giveSpriteData(2); _textWidth = frame->width; @@ -191,9 +187,9 @@ void MoviePlayer::performPostProcessing(byte *screen) { _textX = 320 - _textWidth / 2; _textY = 420 - _textHeight; } - if (_decoder->getCurFrame() == _movieTexts[0]->_endFrame) { + if (_decoder->getCurFrame() == _movieTexts.front()._endFrame) { _textMan->releaseText(2, false); - delete _movieTexts.remove_at(0); + _movieTexts.pop_front(); } } diff --git a/engines/sword1/animation.h b/engines/sword1/animation.h index 7bfd839826..fc3061bbf9 100644 --- a/engines/sword1/animation.h +++ b/engines/sword1/animation.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef SWORD1_ANIMATION_H @@ -30,7 +27,7 @@ #include "video/smk_decoder.h" #include "video/video_decoder.h" -#include "common/array.h" +#include "common/list.h" #include "audio/audiostream.h" @@ -48,14 +45,11 @@ class MovieText { public: uint16 _startFrame; uint16 _endFrame; - char *_text; - MovieText(int startFrame, int endFrame, const char *text) { + Common::String _text; + MovieText(int startFrame, int endFrame, const Common::String &text) { _startFrame = startFrame; _endFrame = endFrame; - _text = strdup(text); - } - ~MovieText() { - free(_text); + _text = text; } }; @@ -83,7 +77,7 @@ protected: Text *_textMan; Audio::Mixer *_snd; OSystem *_system; - Common::Array<MovieText *> _movieTexts; + Common::List<MovieText> _movieTexts; int _textX, _textY, _textWidth, _textHeight; byte _white, _black; DecoderType _decoderType; diff --git a/engines/sword1/collision.h b/engines/sword1/collision.h index 4079136da1..9a9eeec429 100644 --- a/engines/sword1/collision.h +++ b/engines/sword1/collision.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef SWORD1_COLLISION_H diff --git a/engines/sword1/console.cpp b/engines/sword1/console.cpp index 79792c2208..603efd308e 100644 --- a/engines/sword1/console.cpp +++ b/engines/sword1/console.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "sword1/console.h" diff --git a/engines/sword1/console.h b/engines/sword1/console.h index 7ee8d2935f..260fe95d52 100644 --- a/engines/sword1/console.h +++ b/engines/sword1/console.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef SWORD1_CONSOLE_H diff --git a/engines/sword1/control.cpp b/engines/sword1/control.cpp index d8ddd53e2e..86947db8ae 100644 --- a/engines/sword1/control.cpp +++ b/engines/sword1/control.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/file.h" diff --git a/engines/sword1/control.h b/engines/sword1/control.h index db910f521f..6c0cf8b1ef 100644 --- a/engines/sword1/control.h +++ b/engines/sword1/control.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef SWORD1_CONTROL_H diff --git a/engines/sword1/debug.cpp b/engines/sword1/debug.cpp index 39f280748c..6f82d0f49a 100644 --- a/engines/sword1/debug.cpp +++ b/engines/sword1/debug.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/debug.h" diff --git a/engines/sword1/debug.h b/engines/sword1/debug.h index 444d68b399..e4f004dc63 100644 --- a/engines/sword1/debug.h +++ b/engines/sword1/debug.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef SWORD1_DEBUG_H diff --git a/engines/sword1/detection.cpp b/engines/sword1/detection.cpp index fa8277033c..9fb6cbb76e 100644 --- a/engines/sword1/detection.cpp +++ b/engines/sword1/detection.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "sword1/sword1.h" diff --git a/engines/sword1/eventman.cpp b/engines/sword1/eventman.cpp index 9200e6a229..d95adebd86 100644 --- a/engines/sword1/eventman.cpp +++ b/engines/sword1/eventman.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ diff --git a/engines/sword1/eventman.h b/engines/sword1/eventman.h index 7a50b9a297..25cb886a34 100644 --- a/engines/sword1/eventman.h +++ b/engines/sword1/eventman.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef SWORD1_EVENTMAN_H diff --git a/engines/sword1/logic.cpp b/engines/sword1/logic.cpp index 3da3c457d0..00f7112c05 100644 --- a/engines/sword1/logic.cpp +++ b/engines/sword1/logic.cpp @@ -18,14 +18,10 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/endian.h" #include "common/util.h" -#include "common/EventRecorder.h" #include "common/textconsole.h" #include "sword1/logic.h" @@ -53,8 +49,8 @@ namespace Sword1 { uint32 Logic::_scriptVars[NUM_SCRIPT_VARS]; -Logic::Logic(SwordEngine *vm, ObjectMan *pObjMan, ResMan *resMan, Screen *pScreen, Mouse *pMouse, Sound *pSound, Music *pMusic, Menu *pMenu, OSystem *system, Audio::Mixer *mixer) { - g_eventRec.registerRandomSource(_rnd, "sword1"); +Logic::Logic(SwordEngine *vm, ObjectMan *pObjMan, ResMan *resMan, Screen *pScreen, Mouse *pMouse, Sound *pSound, Music *pMusic, Menu *pMenu, OSystem *system, Audio::Mixer *mixer) + : _rnd("sword1") { _vm = vm; _objMan = pObjMan; diff --git a/engines/sword1/logic.h b/engines/sword1/logic.h index 989b852e77..13ddbc989b 100644 --- a/engines/sword1/logic.h +++ b/engines/sword1/logic.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef SWORD1_LOGIC_H @@ -33,6 +30,8 @@ #include "common/random.h" #include "audio/mixer.h" +class OSystem; + namespace Sword1 { #define NON_ZERO_SCRIPT_VARS 95 diff --git a/engines/sword1/memman.cpp b/engines/sword1/memman.cpp index f315895eb0..9fd763084a 100644 --- a/engines/sword1/memman.cpp +++ b/engines/sword1/memman.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ diff --git a/engines/sword1/memman.h b/engines/sword1/memman.h index b489eae2f9..3f822189eb 100644 --- a/engines/sword1/memman.h +++ b/engines/sword1/memman.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef SWORD1_MEMMAN_H diff --git a/engines/sword1/menu.cpp b/engines/sword1/menu.cpp index 582bea82f8..3a99602fec 100644 --- a/engines/sword1/menu.cpp +++ b/engines/sword1/menu.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ diff --git a/engines/sword1/menu.h b/engines/sword1/menu.h index f45f59a1e0..ea062f1a49 100644 --- a/engines/sword1/menu.h +++ b/engines/sword1/menu.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef SWORD1_MENU_H diff --git a/engines/sword1/mouse.cpp b/engines/sword1/mouse.cpp index 87e476e504..cbf951aebc 100644 --- a/engines/sword1/mouse.cpp +++ b/engines/sword1/mouse.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/system.h" diff --git a/engines/sword1/mouse.h b/engines/sword1/mouse.h index 3a7ea747fb..44a6f76ad7 100644 --- a/engines/sword1/mouse.h +++ b/engines/sword1/mouse.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef SWORD1_MOUSE_H diff --git a/engines/sword1/music.cpp b/engines/sword1/music.cpp index 49f9f7271b..a291d80f85 100644 --- a/engines/sword1/music.cpp +++ b/engines/sword1/music.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ diff --git a/engines/sword1/music.h b/engines/sword1/music.h index 7a3d1e5de6..104bc1c536 100644 --- a/engines/sword1/music.h +++ b/engines/sword1/music.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef SWORD1_MUSIC_H diff --git a/engines/sword1/object.h b/engines/sword1/object.h index 58aefc2775..5a6fd49c0b 100644 --- a/engines/sword1/object.h +++ b/engines/sword1/object.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef SWORD1_OBJECT_H diff --git a/engines/sword1/objectman.cpp b/engines/sword1/objectman.cpp index dde1498591..8de29615d5 100644 --- a/engines/sword1/objectman.cpp +++ b/engines/sword1/objectman.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ diff --git a/engines/sword1/objectman.h b/engines/sword1/objectman.h index f4b8fe8906..23047c14ea 100644 --- a/engines/sword1/objectman.h +++ b/engines/sword1/objectman.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ // this is the object manager. our equivalent to protocol.c and coredata.c diff --git a/engines/sword1/resman.cpp b/engines/sword1/resman.cpp index f7b9eb8908..807679a40e 100644 --- a/engines/sword1/resman.cpp +++ b/engines/sword1/resman.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ diff --git a/engines/sword1/resman.h b/engines/sword1/resman.h index ee1d55cd14..82074e5740 100644 --- a/engines/sword1/resman.h +++ b/engines/sword1/resman.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef SWORD1_RESMAN_H diff --git a/engines/sword1/router.cpp b/engines/sword1/router.cpp index 3694ed2459..e3b6ab3343 100644 --- a/engines/sword1/router.cpp +++ b/engines/sword1/router.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/debug.h" diff --git a/engines/sword1/router.h b/engines/sword1/router.h index 97fa42488b..31c4291eed 100644 --- a/engines/sword1/router.h +++ b/engines/sword1/router.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef SWORD1_ROUTER_H diff --git a/engines/sword1/screen.cpp b/engines/sword1/screen.cpp index de96f6e7b4..1da89a1091 100644 --- a/engines/sword1/screen.cpp +++ b/engines/sword1/screen.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ diff --git a/engines/sword1/screen.h b/engines/sword1/screen.h index 88326a730e..ece37b0ecc 100644 --- a/engines/sword1/screen.h +++ b/engines/sword1/screen.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef SWORD1_SCREEN_H diff --git a/engines/sword1/sound.cpp b/engines/sword1/sound.cpp index c970e72748..f7ab9ca1de 100644 --- a/engines/sword1/sound.cpp +++ b/engines/sword1/sound.cpp @@ -18,16 +18,12 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/endian.h" #include "common/util.h" -#include "common/EventRecorder.h" #include "common/memstream.h" #include "common/textconsole.h" @@ -49,8 +45,8 @@ namespace Sword1 { #define SOUND_SPEECH_ID 1 #define SPEECH_FLAGS (Audio::FLAG_16BITS | Audio::FLAG_LITTLE_ENDIAN) -Sound::Sound(const char *searchPath, Audio::Mixer *mixer, ResMan *pResMan) { - g_eventRec.registerRandomSource(_rnd, "sword1sound"); +Sound::Sound(const char *searchPath, Audio::Mixer *mixer, ResMan *pResMan) + : _rnd("sword1sound") { strcpy(_filePath, searchPath); _mixer = mixer; _resMan = pResMan; diff --git a/engines/sword1/sound.h b/engines/sword1/sound.h index b6fcd6706f..a6313f85eb 100644 --- a/engines/sword1/sound.h +++ b/engines/sword1/sound.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef SWORD1_SOUND_H diff --git a/engines/sword1/staticres.cpp b/engines/sword1/staticres.cpp index 84f1dc9d45..402e349576 100644 --- a/engines/sword1/staticres.cpp +++ b/engines/sword1/staticres.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ diff --git a/engines/sword1/sword1.cpp b/engines/sword1/sword1.cpp index 3b3eaaf8b9..23dff4dec2 100644 --- a/engines/sword1/sword1.cpp +++ b/engines/sword1/sword1.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "sword1/sword1.h" diff --git a/engines/sword1/sword1.h b/engines/sword1/sword1.h index dbb683cd74..c83cb76461 100644 --- a/engines/sword1/sword1.h +++ b/engines/sword1/sword1.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef SWORD1_H diff --git a/engines/sword1/sworddefs.h b/engines/sword1/sworddefs.h index 26c155dc4c..460b4dd2d1 100644 --- a/engines/sword1/sworddefs.h +++ b/engines/sword1/sworddefs.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef SWORD1_SWORDDEFS_H diff --git a/engines/sword1/swordres.h b/engines/sword1/swordres.h index 7f6a6352ad..384c240283 100644 --- a/engines/sword1/swordres.h +++ b/engines/sword1/swordres.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef SWORD1_SWORDRES_H diff --git a/engines/sword1/text.cpp b/engines/sword1/text.cpp index 7c65533067..2d4b07020f 100644 --- a/engines/sword1/text.cpp +++ b/engines/sword1/text.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ @@ -76,7 +73,7 @@ uint32 Text::lowTextManager(uint8 *ascii, int32 width, uint8 pen) { return textObjId; } -void Text::makeTextSprite(uint8 slot, uint8 *text, uint16 maxWidth, uint8 pen) { +void Text::makeTextSprite(uint8 slot, const uint8 *text, uint16 maxWidth, uint8 pen) { LineInfo lines[MAX_LINES]; uint16 numLines = analyzeSentence(text, maxWidth, lines); @@ -118,7 +115,7 @@ uint16 Text::charWidth(uint8 ch) { return _resMan->getUint16(_resMan->fetchFrame(_font, ch - SPACE)->width); } -uint16 Text::analyzeSentence(uint8 *text, uint16 maxWidth, LineInfo *line) { +uint16 Text::analyzeSentence(const uint8 *text, uint16 maxWidth, LineInfo *line) { uint16 lineNo = 0; bool firstWord = true; diff --git a/engines/sword1/text.h b/engines/sword1/text.h index 9bfc88fce0..2224fbcac5 100644 --- a/engines/sword1/text.h +++ b/engines/sword1/text.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef SWORD1_TEXT_H @@ -52,11 +49,11 @@ public: ~Text(); FrameHeader *giveSpriteData(uint32 textTarget); uint32 lowTextManager(uint8 *text, int32 width, uint8 pen); - void makeTextSprite(uint8 slot, uint8 *text, uint16 maxWidth, uint8 pen); + void makeTextSprite(uint8 slot, const uint8 *text, uint16 maxWidth, uint8 pen); void releaseText(uint32 id, bool updateCount = true); private: - uint16 analyzeSentence(uint8 *text, uint16 maxWidth, LineInfo *info); + uint16 analyzeSentence(const uint8 *text, uint16 maxWidth, LineInfo *info); uint16 charWidth(uint8 ch); uint16 copyChar(uint8 ch, uint8 *sprPtr, uint16 sprWidth, uint8 pen); uint8 *_font; diff --git a/engines/sword2/animation.cpp b/engines/sword2/animation.cpp index a5a2499b01..5c5ff6c7ee 100644 --- a/engines/sword2/animation.cpp +++ b/engines/sword2/animation.cpp @@ -20,9 +20,6 @@ * 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. - * - * $URL$ - * $Id$ */ #include "common/file.h" diff --git a/engines/sword2/animation.h b/engines/sword2/animation.h index afe7dfcc68..1f5fced03b 100644 --- a/engines/sword2/animation.h +++ b/engines/sword2/animation.h @@ -20,9 +20,6 @@ * 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. - * - * $URL$ - * $Id$ */ #ifndef SWORD2_ANIMATION_H diff --git a/engines/sword2/anims.cpp b/engines/sword2/anims.cpp index 7fd36fcc86..91a68e0044 100644 --- a/engines/sword2/anims.cpp +++ b/engines/sword2/anims.cpp @@ -20,9 +20,6 @@ * 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. - * - * $URL$ - * $Id$ */ // --------------------------------------------------------------------------- diff --git a/engines/sword2/console.cpp b/engines/sword2/console.cpp index bca3cd6184..8d95670308 100644 --- a/engines/sword2/console.cpp +++ b/engines/sword2/console.cpp @@ -20,9 +20,6 @@ * 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. - * - * $URL$ - * $Id$ */ diff --git a/engines/sword2/console.h b/engines/sword2/console.h index 2de8299780..09e456564d 100644 --- a/engines/sword2/console.h +++ b/engines/sword2/console.h @@ -20,9 +20,6 @@ * 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. - * - * $URL$ - * $Id$ */ #ifndef SWORD2_CONSOLE_H diff --git a/engines/sword2/controls.cpp b/engines/sword2/controls.cpp index 4332f2811c..d37edf3082 100644 --- a/engines/sword2/controls.cpp +++ b/engines/sword2/controls.cpp @@ -20,9 +20,6 @@ * 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. - * - * $URL$ - * $Id$ */ diff --git a/engines/sword2/controls.h b/engines/sword2/controls.h index 043330c178..ca41867462 100644 --- a/engines/sword2/controls.h +++ b/engines/sword2/controls.h @@ -20,9 +20,6 @@ * 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. - * - * $URL$ - * $Id$ */ #ifndef SWORD2_CONTROL_H diff --git a/engines/sword2/debug.cpp b/engines/sword2/debug.cpp index cb3c3b6a30..b3d28e90c2 100644 --- a/engines/sword2/debug.cpp +++ b/engines/sword2/debug.cpp @@ -20,9 +20,6 @@ * 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. - * - * $URL$ - * $Id$ */ diff --git a/engines/sword2/debug.h b/engines/sword2/debug.h index 768f339dbd..90d9b6b63c 100644 --- a/engines/sword2/debug.h +++ b/engines/sword2/debug.h @@ -20,9 +20,6 @@ * 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. - * - * $URL$ - * $Id$ */ #ifndef SWORD2_DEBUG_H diff --git a/engines/sword2/defs.h b/engines/sword2/defs.h index c729ff0287..dbd4d23d00 100644 --- a/engines/sword2/defs.h +++ b/engines/sword2/defs.h @@ -20,9 +20,6 @@ * 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. - * - * $URL$ - * $Id$ */ #ifndef SWORD2_DEFS_H diff --git a/engines/sword2/events.cpp b/engines/sword2/events.cpp index 24101e271c..1310c04b82 100644 --- a/engines/sword2/events.cpp +++ b/engines/sword2/events.cpp @@ -20,9 +20,6 @@ * 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. - * - * $URL$ - * $Id$ */ diff --git a/engines/sword2/function.cpp b/engines/sword2/function.cpp index e0990ea120..60ee6176a4 100644 --- a/engines/sword2/function.cpp +++ b/engines/sword2/function.cpp @@ -20,9 +20,6 @@ * 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. - * - * $URL$ - * $Id$ */ diff --git a/engines/sword2/header.cpp b/engines/sword2/header.cpp index 6ab88d159d..9c50db90d4 100644 --- a/engines/sword2/header.cpp +++ b/engines/sword2/header.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "sword2/header.h" diff --git a/engines/sword2/header.h b/engines/sword2/header.h index ed63c806bc..ceecdd1a92 100644 --- a/engines/sword2/header.h +++ b/engines/sword2/header.h @@ -20,9 +20,6 @@ * 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. - * - * $URL$ - * $Id$ */ #ifndef SWORD2_HEADER_H diff --git a/engines/sword2/icons.cpp b/engines/sword2/icons.cpp index 8336178ae5..f179f3c899 100644 --- a/engines/sword2/icons.cpp +++ b/engines/sword2/icons.cpp @@ -20,9 +20,6 @@ * 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. - * - * $URL$ - * $Id$ */ diff --git a/engines/sword2/interpreter.cpp b/engines/sword2/interpreter.cpp index a3804366d4..7f340df171 100644 --- a/engines/sword2/interpreter.cpp +++ b/engines/sword2/interpreter.cpp @@ -20,9 +20,6 @@ * 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. - * - * $URL$ - * $Id$ */ diff --git a/engines/sword2/interpreter.h b/engines/sword2/interpreter.h index 1eb66cfa3c..ec19034962 100644 --- a/engines/sword2/interpreter.h +++ b/engines/sword2/interpreter.h @@ -20,9 +20,6 @@ * 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. - * - * $URL$ - * $Id$ */ #ifndef SWORD2_INTERPRETER_H diff --git a/engines/sword2/layers.cpp b/engines/sword2/layers.cpp index 47cc3ec232..ad65336c0f 100644 --- a/engines/sword2/layers.cpp +++ b/engines/sword2/layers.cpp @@ -20,9 +20,6 @@ * 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. - * - * $URL$ - * $Id$ */ // high level layer initialising diff --git a/engines/sword2/logic.cpp b/engines/sword2/logic.cpp index c27bd76ff4..f634737d4e 100644 --- a/engines/sword2/logic.cpp +++ b/engines/sword2/logic.cpp @@ -20,9 +20,6 @@ * 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. - * - * $URL$ - * $Id$ */ diff --git a/engines/sword2/logic.h b/engines/sword2/logic.h index e40a12bba3..87c0395221 100644 --- a/engines/sword2/logic.h +++ b/engines/sword2/logic.h @@ -20,9 +20,6 @@ * 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. - * - * $URL$ - * $Id$ */ // logic management diff --git a/engines/sword2/maketext.cpp b/engines/sword2/maketext.cpp index fda30981c8..dc88f6e68e 100644 --- a/engines/sword2/maketext.cpp +++ b/engines/sword2/maketext.cpp @@ -20,9 +20,6 @@ * 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. - * - * $URL$ - * $Id$ */ // MAKETEXT - Constructs a single-frame text sprite: returns a handle to a diff --git a/engines/sword2/maketext.h b/engines/sword2/maketext.h index 52740d9de9..db5833ac55 100644 --- a/engines/sword2/maketext.h +++ b/engines/sword2/maketext.h @@ -20,9 +20,6 @@ * 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. - * - * $URL$ - * $Id$ */ #ifndef SWORD2_MAKETEXT_H diff --git a/engines/sword2/memory.cpp b/engines/sword2/memory.cpp index 2b3784164e..5fd2d4e78e 100644 --- a/engines/sword2/memory.cpp +++ b/engines/sword2/memory.cpp @@ -20,9 +20,6 @@ * 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. - * - * $URL$ - * $Id$ */ // The new memory manager, now only used by the resource manager. The original diff --git a/engines/sword2/memory.h b/engines/sword2/memory.h index e00eacb032..3f511dd5db 100644 --- a/engines/sword2/memory.h +++ b/engines/sword2/memory.h @@ -20,9 +20,6 @@ * 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. - * - * $URL$ - * $Id$ */ #ifndef SWORD2_MEMORY_H diff --git a/engines/sword2/menu.cpp b/engines/sword2/menu.cpp index 921a3c77b5..4d63c4cce8 100644 --- a/engines/sword2/menu.cpp +++ b/engines/sword2/menu.cpp @@ -20,9 +20,6 @@ * 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. - * - * $URL$ - * $Id$ */ diff --git a/engines/sword2/mouse.cpp b/engines/sword2/mouse.cpp index 3a26ab17b7..c5fed49347 100644 --- a/engines/sword2/mouse.cpp +++ b/engines/sword2/mouse.cpp @@ -20,9 +20,6 @@ * 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. - * - * $URL$ - * $Id$ */ diff --git a/engines/sword2/mouse.h b/engines/sword2/mouse.h index a45d786088..dc4bd5fc0a 100644 --- a/engines/sword2/mouse.h +++ b/engines/sword2/mouse.h @@ -20,9 +20,6 @@ * 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. - * - * $URL$ - * $Id$ */ #ifndef SWORD2_MOUSE_H diff --git a/engines/sword2/music.cpp b/engines/sword2/music.cpp index 233d9369d2..63116e954a 100644 --- a/engines/sword2/music.cpp +++ b/engines/sword2/music.cpp @@ -20,9 +20,6 @@ * 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. - * - * $URL$ - * $Id$ */ // One feature still missing is the original's DipMusic() function which, as @@ -53,40 +50,6 @@ namespace Sword2 { -/** - * This class behaves like SeekableSubReadStream, except it remembers where the - * previous read() or seek() took it, so that it can continue from that point - * the next time. This is because we're frequently streaming two pieces of - * music from the same file. - */ -class SafeSubReadStream : public Common::SeekableSubReadStream { -protected: - uint32 _previousPos; -public: - SafeSubReadStream(SeekableReadStream *parentStream, uint32 begin, uint32 end); - virtual uint32 read(void *dataPtr, uint32 dataSize); - virtual bool seek(int32 offset, int whence = SEEK_SET); -}; - -SafeSubReadStream::SafeSubReadStream(SeekableReadStream *parentStream, uint32 begin, uint32 end) - : SeekableSubReadStream(parentStream, begin, end, DisposeAfterUse::NO) { - _previousPos = 0; -} - -uint32 SafeSubReadStream::read(void *dataPtr, uint32 dataSize) { - uint32 result; - SeekableSubReadStream::seek(_previousPos); - result = SeekableSubReadStream::read(dataPtr, dataSize); - _previousPos = pos(); - return result; -} - -bool SafeSubReadStream::seek(int32 offset, int whence) { - bool result = SeekableSubReadStream::seek(offset, whence); - _previousPos = pos(); - return result; -} - static Audio::AudioStream *makeCLUStream(Common::File *fp, int size); static Audio::AudioStream *makePSXCLUStream(Common::File *fp, int size); @@ -197,19 +160,19 @@ static Audio::AudioStream *getAudioStream(SoundFileHandle *fh, const char *base, return makeCLUStream(&fh->file, enc_len); #ifdef USE_MAD case kMP3Mode: { - SafeSubReadStream *tmp = new SafeSubReadStream(&fh->file, pos, pos + enc_len); + Common::SafeSubReadStream *tmp = new Common::SafeSubReadStream(&fh->file, pos, pos + enc_len); return Audio::makeMP3Stream(tmp, DisposeAfterUse::YES); } #endif #ifdef USE_VORBIS case kVorbisMode: { - SafeSubReadStream *tmp = new SafeSubReadStream(&fh->file, pos, pos + enc_len); + Common::SafeSubReadStream *tmp = new Common::SafeSubReadStream(&fh->file, pos, pos + enc_len); return Audio::makeVorbisStream(tmp, DisposeAfterUse::YES); } #endif #ifdef USE_FLAC case kFLACMode: { - SafeSubReadStream *tmp = new SafeSubReadStream(&fh->file, pos, pos + enc_len); + Common::SafeSubReadStream *tmp = new Common::SafeSubReadStream(&fh->file, pos, pos + enc_len); return Audio::makeFLACStream(tmp, DisposeAfterUse::YES); } #endif diff --git a/engines/sword2/object.h b/engines/sword2/object.h index 94a968e58d..32d9701e27 100644 --- a/engines/sword2/object.h +++ b/engines/sword2/object.h @@ -20,9 +20,6 @@ * 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. - * - * $URL$ - * $Id$ */ #ifndef SWORD2_OBJECT_H diff --git a/engines/sword2/palette.cpp b/engines/sword2/palette.cpp index a52160db25..c3a3d24075 100644 --- a/engines/sword2/palette.cpp +++ b/engines/sword2/palette.cpp @@ -20,9 +20,6 @@ * 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. - * - * $URL$ - * $Id$ */ diff --git a/engines/sword2/protocol.cpp b/engines/sword2/protocol.cpp index 3d16e4ea4c..caa1a21798 100644 --- a/engines/sword2/protocol.cpp +++ b/engines/sword2/protocol.cpp @@ -20,9 +20,6 @@ * 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. - * - * $URL$ - * $Id$ */ #include "common/file.h" diff --git a/engines/sword2/render.cpp b/engines/sword2/render.cpp index a47f8abe0d..e3bce7d27f 100644 --- a/engines/sword2/render.cpp +++ b/engines/sword2/render.cpp @@ -20,9 +20,6 @@ * 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. - * - * $URL$ - * $Id$ */ diff --git a/engines/sword2/resman.cpp b/engines/sword2/resman.cpp index 36280cfda2..a0561641d7 100644 --- a/engines/sword2/resman.cpp +++ b/engines/sword2/resman.cpp @@ -20,9 +20,6 @@ * 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. - * - * $URL$ - * $Id$ */ diff --git a/engines/sword2/resman.h b/engines/sword2/resman.h index 75748e1568..494e64dae6 100644 --- a/engines/sword2/resman.h +++ b/engines/sword2/resman.h @@ -20,9 +20,6 @@ * 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. - * - * $URL$ - * $Id$ */ #ifndef SWORD2_RESMAN_H diff --git a/engines/sword2/router.cpp b/engines/sword2/router.cpp index c2b4d2e67f..fa5a677b86 100644 --- a/engines/sword2/router.cpp +++ b/engines/sword2/router.cpp @@ -20,9 +20,6 @@ * 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. - * - * $URL$ - * $Id$ */ diff --git a/engines/sword2/router.h b/engines/sword2/router.h index 1ad3dd74c4..ec711bcc40 100644 --- a/engines/sword2/router.h +++ b/engines/sword2/router.h @@ -20,9 +20,6 @@ * 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. - * - * $URL$ - * $Id$ */ #ifndef SWORD2_ROUTER_H diff --git a/engines/sword2/saveload.cpp b/engines/sword2/saveload.cpp index 94ef8975b4..870170e378 100644 --- a/engines/sword2/saveload.cpp +++ b/engines/sword2/saveload.cpp @@ -20,9 +20,6 @@ * 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. - * - * $URL$ - * $Id$ */ // --------------------------------------------------------------------------- diff --git a/engines/sword2/saveload.h b/engines/sword2/saveload.h index ceaa9712a4..f74b7ba493 100644 --- a/engines/sword2/saveload.h +++ b/engines/sword2/saveload.h @@ -20,9 +20,6 @@ * 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. - * - * $URL$ - * $Id$ */ #ifndef SWORD2_SAVELOAD_H diff --git a/engines/sword2/screen.cpp b/engines/sword2/screen.cpp index a83e581fd4..cae719c1d4 100644 --- a/engines/sword2/screen.cpp +++ b/engines/sword2/screen.cpp @@ -20,9 +20,6 @@ * 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. - * - * $URL$ - * $Id$ */ // --------------------------------------------------------------------------- diff --git a/engines/sword2/screen.h b/engines/sword2/screen.h index 9ef4f28049..2d15692299 100644 --- a/engines/sword2/screen.h +++ b/engines/sword2/screen.h @@ -20,9 +20,6 @@ * 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. - * - * $URL$ - * $Id$ */ #ifndef SWORD2_SCREEN_H diff --git a/engines/sword2/scroll.cpp b/engines/sword2/scroll.cpp index 11ba546cf3..cc864eb493 100644 --- a/engines/sword2/scroll.cpp +++ b/engines/sword2/scroll.cpp @@ -20,9 +20,6 @@ * 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. - * - * $URL$ - * $Id$ */ diff --git a/engines/sword2/sound.cpp b/engines/sword2/sound.cpp index 3cf8523113..19e244e61c 100644 --- a/engines/sword2/sound.cpp +++ b/engines/sword2/sound.cpp @@ -20,9 +20,6 @@ * 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. - * - * $URL$ - * $Id$ */ // --------------------------------------------------------------------------- diff --git a/engines/sword2/sound.h b/engines/sword2/sound.h index c37e006b76..9a59ef27a8 100644 --- a/engines/sword2/sound.h +++ b/engines/sword2/sound.h @@ -20,9 +20,6 @@ * 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. - * - * $URL$ - * $Id$ */ /***************************************************************************** diff --git a/engines/sword2/speech.cpp b/engines/sword2/speech.cpp index ec8e198377..cdc86a1e39 100644 --- a/engines/sword2/speech.cpp +++ b/engines/sword2/speech.cpp @@ -20,9 +20,6 @@ * 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. - * - * $URL$ - * $Id$ */ diff --git a/engines/sword2/sprite.cpp b/engines/sword2/sprite.cpp index 9a25812178..8d260947f1 100644 --- a/engines/sword2/sprite.cpp +++ b/engines/sword2/sprite.cpp @@ -20,9 +20,6 @@ * 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. - * - * $URL$ - * $Id$ */ #include "common/endian.h" diff --git a/engines/sword2/startup.cpp b/engines/sword2/startup.cpp index ea1751eb5f..b39141fe32 100644 --- a/engines/sword2/startup.cpp +++ b/engines/sword2/startup.cpp @@ -20,9 +20,6 @@ * 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. - * - * $URL$ - * $Id$ */ diff --git a/engines/sword2/sword2.cpp b/engines/sword2/sword2.cpp index 58f3547ff7..47c9b1616e 100644 --- a/engines/sword2/sword2.cpp +++ b/engines/sword2/sword2.cpp @@ -20,9 +20,6 @@ * 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. - * - * $URL$ - * $Id$ */ #include "base/plugins.h" @@ -31,7 +28,6 @@ #include "common/file.h" #include "common/fs.h" #include "common/events.h" -#include "common/EventRecorder.h" #include "common/savefile.h" #include "common/system.h" #include "common/textconsole.h" @@ -255,7 +251,7 @@ Common::Error Sword2MetaEngine::createInstance(OSystem *syst, Engine **engine) c namespace Sword2 { -Sword2Engine::Sword2Engine(OSystem *syst) : Engine(syst) { +Sword2Engine::Sword2Engine(OSystem *syst) : Engine(syst), _rnd("sword2") { // Add default file directories const Common::FSNode gameDataDir(ConfMan.get("path")); SearchMan.addSubDirectoryMatching(gameDataDir, "clusters"); @@ -295,8 +291,6 @@ Sword2Engine::Sword2Engine(OSystem *syst) : Engine(syst) { _gameSpeed = 1; _gmmLoadSlot = -1; // Used to manage GMM Loading - - g_eventRec.registerRandomSource(_rnd, "sword2"); } Sword2Engine::~Sword2Engine() { diff --git a/engines/sword2/sword2.h b/engines/sword2/sword2.h index e741c51ce1..27cbd9e49d 100644 --- a/engines/sword2/sword2.h +++ b/engines/sword2/sword2.h @@ -20,9 +20,6 @@ * 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. - * - * $URL$ - * $Id$ */ #ifndef SWORD2_H diff --git a/engines/sword2/sync.cpp b/engines/sword2/sync.cpp index ee4c6b2238..12e3c35698 100644 --- a/engines/sword2/sync.cpp +++ b/engines/sword2/sync.cpp @@ -20,9 +20,6 @@ * 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. - * - * $URL$ - * $Id$ */ diff --git a/engines/sword2/walker.cpp b/engines/sword2/walker.cpp index 7971299818..89ee6e18cc 100644 --- a/engines/sword2/walker.cpp +++ b/engines/sword2/walker.cpp @@ -20,9 +20,6 @@ * 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. - * - * $URL$ - * $Id$ */ // WALKER.CPP by James (14nov96) diff --git a/engines/sword25/console.cpp b/engines/sword25/console.cpp index 902d9a5b72..5d15f189ab 100644 --- a/engines/sword25/console.cpp +++ b/engines/sword25/console.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "sword25/console.h" diff --git a/engines/sword25/console.h b/engines/sword25/console.h index dcf8082d3c..9e2516ccf0 100644 --- a/engines/sword25/console.h +++ b/engines/sword25/console.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef SWORD25_CONSOLE_H diff --git a/engines/sword25/detection.cpp b/engines/sword25/detection.cpp index fe24675f8a..caa1cf51ac 100644 --- a/engines/sword25/detection.cpp +++ b/engines/sword25/detection.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "base/plugins.h" @@ -105,7 +102,7 @@ public: Sword25MetaEngine() : AdvancedMetaEngine(detectionParams) {} virtual const char *getName() const { - return "The Broken Sword 2.5 Engine"; + return "Broken Sword 2.5"; } virtual const char *getOriginalCopyright() const { diff --git a/engines/sword25/fmv/movieplayer.cpp b/engines/sword25/fmv/movieplayer.cpp index 975f08be22..d267506ae2 100644 --- a/engines/sword25/fmv/movieplayer.cpp +++ b/engines/sword25/fmv/movieplayer.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ /* @@ -49,7 +46,7 @@ namespace Sword25 { #define FLT_EPSILON 1.192092896e-07F /* smallest such that 1.0+FLT_EPSILON != 1.0 */ #ifdef USE_THEORADEC -MoviePlayer::MoviePlayer(Kernel *pKernel) : Service(pKernel), _decoder(g_system->getMixer()) { +MoviePlayer::MoviePlayer(Kernel *pKernel) : Service(pKernel), _decoder() { if (!registerScriptBindings()) error("Script bindings could not be registered."); else @@ -122,21 +119,23 @@ bool MoviePlayer::pause() { void MoviePlayer::update() { if (_decoder.isVideoLoaded()) { - const Graphics::Surface *s = _decoder.decodeNextFrame(); - if (s) { - // Transfer the next frame - assert(s->format.bytesPerPixel == 4); + if (_decoder.endOfVideo()) { + // Movie complete, so unload the movie + unloadMovie(); + } else { + const Graphics::Surface *s = _decoder.decodeNextFrame(); + if (s) { + // Transfer the next frame + assert(s->format.bytesPerPixel == 4); #ifdef THEORA_INDIRECT_RENDERING - byte *frameData = (byte *)s->getBasePtr(0, 0); - _outputBitmap->setContent(frameData, s->pitch * s->h, 0, s->pitch); + byte *frameData = (byte *)s->getBasePtr(0, 0); + _outputBitmap->setContent(frameData, s->pitch * s->h, 0, s->pitch); #else - g_system->copyRectToScreen((byte *)s->getBasePtr(0, 0), s->pitch, _outX, _outY, MIN(s->w, _backSurface->w), MIN(s->h, _backSurface->h)); - g_system->updateScreen(); + g_system->copyRectToScreen((byte *)s->getBasePtr(0, 0), s->pitch, _outX, _outY, MIN(s->w, _backSurface->w), MIN(s->h, _backSurface->h)); + g_system->updateScreen(); #endif - } else { - // Movie complete, so unload the movie - unloadMovie(); + } } } } diff --git a/engines/sword25/fmv/movieplayer.h b/engines/sword25/fmv/movieplayer.h index df0792c8a8..1d256e56ba 100644 --- a/engines/sword25/fmv/movieplayer.h +++ b/engines/sword25/fmv/movieplayer.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ /* diff --git a/engines/sword25/fmv/movieplayer_script.cpp b/engines/sword25/fmv/movieplayer_script.cpp index dce9048438..8359059b85 100644 --- a/engines/sword25/fmv/movieplayer_script.cpp +++ b/engines/sword25/fmv/movieplayer_script.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ /* diff --git a/engines/sword25/fmv/theora_decoder.cpp b/engines/sword25/fmv/theora_decoder.cpp index 86236fbd21..07cb56356d 100644 --- a/engines/sword25/fmv/theora_decoder.cpp +++ b/engines/sword25/fmv/theora_decoder.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ /* @@ -42,7 +39,8 @@ #ifdef USE_THEORADEC #include "common/system.h" #include "common/textconsole.h" -#include "graphics/conversion.h" +#include "common/util.h" +#include "graphics/yuv_to_rgb.h" #include "audio/decoders/raw.h" #include "sword25/kernel/common.h" @@ -54,7 +52,7 @@ static double rint(double v) { return floor(v + 0.5); } -TheoraDecoder::TheoraDecoder(Audio::Mixer *mixer, Audio::Mixer::SoundType soundType) : _mixer(mixer) { +TheoraDecoder::TheoraDecoder(Audio::Mixer::SoundType soundType) { _fileStream = 0; _surface = 0; @@ -62,7 +60,7 @@ TheoraDecoder::TheoraDecoder(Audio::Mixer *mixer, Audio::Mixer::SoundType soundT _vorbisPacket = 0; _theoraDecode = 0; _theoraSetup = 0; - _stateFlag = false; + _nextFrameStartTime = 0.0; _soundType = soundType; _audStream = 0; @@ -70,7 +68,7 @@ TheoraDecoder::TheoraDecoder(Audio::Mixer *mixer, Audio::Mixer::SoundType soundT ogg_sync_init(&_oggSync); - _curFrame = 0; + _curFrame = -1; _audiobuf = (ogg_int16_t *)malloc(AUDIOFD_FRAGSIZE * sizeof(ogg_int16_t)); reset(); @@ -103,6 +101,8 @@ int TheoraDecoder::bufferData() { bool TheoraDecoder::loadStream(Common::SeekableReadStream *stream) { close(); + _endOfAudio = false; + _endOfVideo = false; _fileStream = stream; // start up Ogg stream synchronization layer @@ -118,7 +118,8 @@ bool TheoraDecoder::loadStream(Common::SeekableReadStream *stream) { // Ogg file open; parse the headers // Only interested in Vorbis/Theora streams - while (!_stateFlag) { + bool foundHeader = false; + while (!foundHeader) { int ret = bufferData(); if (ret == 0) @@ -131,7 +132,7 @@ bool TheoraDecoder::loadStream(Common::SeekableReadStream *stream) { if (!ogg_page_bos(&_oggPage)) { // don't leak the page; get it into the appropriate stream queuePage(&_oggPage); - _stateFlag = true; + foundHeader = true; break; } @@ -275,23 +276,34 @@ bool TheoraDecoder::loadStream(Common::SeekableReadStream *stream) { vorbis_block_init(&_vorbisDSP, &_vorbisBlock); debug(3, "Ogg logical stream %lx is Vorbis %d channel %ld Hz audio.", _vorbisOut.serialno, _vorbisInfo.channels, _vorbisInfo.rate); + + _audStream = Audio::makeQueuingAudioStream(_vorbisInfo.rate, _vorbisInfo.channels); + + // Get enough audio data to start us off + while (_audStream->numQueuedStreams() == 0) { + // Queue more data + bufferData(); + while (ogg_sync_pageout(&_oggSync, &_oggPage) > 0) + queuePage(&_oggPage); + + queueAudio(); + } + + if (_audStream) + g_system->getMixer()->playStream(Audio::Mixer::kPlainSoundType, _audHandle, _audStream); } else { // tear down the partial vorbis setup vorbis_info_clear(&_vorbisInfo); vorbis_comment_clear(&_vorbisComment); - } - - // open audio - if (_vorbisPacket) { - _audStream = createAudioStream(); - if (_audStream && _mixer) - _mixer->playStream(_soundType, _audHandle, _audStream); + _endOfAudio = true; } _surface = new Graphics::Surface(); - _surface->create(_theoraInfo.frame_width, _theoraInfo.frame_height, g_system->getScreenFormat()); + // Set the frame rate + _frameRate = Common::Rational(_theoraInfo.fps_numerator, _theoraInfo.fps_denominator); + return true; } @@ -303,8 +315,8 @@ void TheoraDecoder::close() { vorbis_comment_clear(&_vorbisComment); vorbis_info_clear(&_vorbisInfo); - if (_mixer) - _mixer->stopHandle(*_audHandle); + g_system->getMixer()->stopHandle(*_audHandle); + _audStream = 0; _vorbisPacket = false; } @@ -333,49 +345,8 @@ void TheoraDecoder::close() { } const Graphics::Surface *TheoraDecoder::decodeNextFrame() { - int i, j; - - // we want a video and audio frame ready to go at all times. If - // we have to buffer incoming, buffer the compressed data (ie, let - // ogg do the buffering) - while (_vorbisPacket && !_audiobufReady) { - int ret; - float **pcm; - - // if there's pending, decoded audio, grab it - if ((ret = vorbis_synthesis_pcmout(&_vorbisDSP, &pcm)) > 0) { - int count = _audiobufFill / 2; - int maxsamples = ((AUDIOFD_FRAGSIZE - _audiobufFill) / _vorbisInfo.channels) >> 1; - for (i = 0; i < ret && i < maxsamples; i++) - for (j = 0; j < _vorbisInfo.channels; j++) { - int val = CLIP((int)rint(pcm[j][i] * 32767.f), -32768, 32767); - _audiobuf[count++] = val; - } - - vorbis_synthesis_read(&_vorbisDSP, i); - _audiobufFill += (i * _vorbisInfo.channels) << 1; - - if (_audiobufFill == AUDIOFD_FRAGSIZE) - _audiobufReady = true; - -#if ENABLE_THEORA_SEEKING - if (_vorbisDSP.granulepos >= 0) - _audiobufGranulePos = _vorbisDSP.granulepos - ret + i; - else - _audiobufGranulePos += i; -#endif - } else { - - // no pending audio; is there a pending packet to decode? - if (ogg_stream_packetout(&_vorbisOut, &_oggPacket) > 0) { - if (vorbis_synthesis(&_vorbisBlock, &_oggPacket) == 0) // test for success! - vorbis_synthesis_blockin(&_vorbisDSP, &_vorbisBlock); - } else // we need more data; break out to suck in another page - break; - } - } - - while (_theoraPacket && !_videobufReady) { + // First, let's get our frame + while (_theoraPacket) { // theora is one in, one out... if (ogg_stream_packetout(&_theoraOut, &_oggPacket) > 0) { @@ -385,85 +356,120 @@ const Graphics::Surface *TheoraDecoder::decodeNextFrame() { _ppInc = 0; } -#if ENABLE_THEORA_SEEKING - // HACK: This should be set after a seek or a gap, but we might not have - // a granulepos for the first packet (we only have them for the last - // packet on a page), so we just set it as often as we get it. - // To do this right, we should back-track from the last packet on the - // page and compute the correct granulepos for the first packet after - // a seek or a gap. - if (_oggPacket.granulepos >= 0) { - th_decode_ctl(_theoraDecode, TH_DECCTL_SET_GRANPOS, &_oggPacket.granulepos, sizeof(_oggPacket.granulepos)); - } - - if (th_decode_packetin(_theoraDecode, &_oggPacket, &_videobufGranulePos) == 0) { - _videobufTime = th_granule_time(_theoraDecode, _videobufGranulePos); -#else if (th_decode_packetin(_theoraDecode, &_oggPacket, NULL) == 0) { -#endif _curFrame++; - _videobufReady = true; + + // Convert YUV data to RGB data + th_ycbcr_buffer yuv; + th_decode_ycbcr_out(_theoraDecode, yuv); + translateYUVtoRGBA(yuv); + + if (_curFrame == 0) + _startTime = g_system->getMillis(); + + double time = th_granule_time(_theoraDecode, _oggPacket.granulepos); + + // We need to calculate when the next frame should be shown + // This is all in floating point because that's what the Ogg code gives us + // Ogg is a lossy container format, so it doesn't always list the time to the + // next frame. In such cases, we need to calculate it ourselves. + if (time == -1.0) + _nextFrameStartTime += _frameRate.getInverse().toDouble(); + else + _nextFrameStartTime = time; + + // break out + break; } - } else - break; - } + } else { + // If we can't get any more frames, we're done. + if (_theoraOut.e_o_s || _fileStream->eos()) { + _endOfVideo = true; + break; + } + + // Queue more data + bufferData(); + while (ogg_sync_pageout(&_oggSync, &_oggPage) > 0) + queuePage(&_oggPage); + } - if (!_videobufReady && !_audiobufReady && _fileStream->eos()) { - return NULL; + // Update audio if we can + queueAudio(); } - if (!_videobufReady || !_audiobufReady) { - // no data yet for somebody. Grab another page + // Force at least some audio to be buffered + // TODO: 5 is very arbitrary. We probably should do something like QuickTime does. + while (!_endOfAudio && _audStream->numQueuedStreams() < 5) { bufferData(); - while (ogg_sync_pageout(&_oggSync, &_oggPage) > 0) { + while (ogg_sync_pageout(&_oggSync, &_oggPage) > 0) queuePage(&_oggPage); + + bool queuedAudio = queueAudio(); + if ((_vorbisOut.e_o_s || _fileStream->eos()) && !queuedAudio) { + _endOfAudio = true; + break; } } - // If playback has begun, top audio buffer off immediately. - if (_stateFlag && _audiobufReady) { - _audStream->queueBuffer((byte *)_audiobuf, AUDIOFD_FRAGSIZE, DisposeAfterUse::NO, Audio::FLAG_16BITS | Audio::FLAG_LITTLE_ENDIAN | Audio::FLAG_STEREO); + return _surface; +} - // The audio mixer is now responsible for the old audio buffer. - // We need to create a new one. - _audiobuf = (ogg_int16_t *)malloc(AUDIOFD_FRAGSIZE * sizeof(ogg_int16_t)); - _audiobufFill = 0; - _audiobufReady = false; - } +bool TheoraDecoder::queueAudio() { + if (!_audStream) + return false; - // are we at or past time for this video frame? - if (_stateFlag && _videobufReady) { - th_ycbcr_buffer yuv; + bool queuedAudio = false; - th_decode_ycbcr_out(_theoraDecode, yuv); + for (;;) { + float **pcm; - // Convert YUV data to RGB data - translateYUVtoRGBA(yuv, (byte *)_surface->getBasePtr(0, 0)); - - _videobufReady = false; - } + // if there's pending, decoded audio, grab it + int ret = vorbis_synthesis_pcmout(&_vorbisDSP, &pcm); + if (ret > 0) { + int count = _audiobufFill / 2; + int maxsamples = ((AUDIOFD_FRAGSIZE - _audiobufFill) / _vorbisInfo.channels) >> 1; + int i; + for (i = 0; i < ret && i < maxsamples; i++) + for (int j = 0; j < _vorbisInfo.channels; j++) { + int val = CLIP((int)rint(pcm[j][i] * 32767.f), -32768, 32767); + _audiobuf[count++] = val; + } - // if our buffers either don't exist or are ready to go, - // we can begin playback - if ((!_theoraPacket || _videobufReady) && - (!_vorbisPacket || _audiobufReady)) - _stateFlag = true; + vorbis_synthesis_read(&_vorbisDSP, i); + _audiobufFill += (i * _vorbisInfo.channels) << 1; - // same if we've run out of input - if (_fileStream->eos()) - _stateFlag = true; + if (_audiobufFill == AUDIOFD_FRAGSIZE) { + _audStream->queueBuffer((byte *)_audiobuf, AUDIOFD_FRAGSIZE, DisposeAfterUse::NO, Audio::FLAG_16BITS | Audio::FLAG_LITTLE_ENDIAN | Audio::FLAG_STEREO); - return _surface; + // The audio mixer is now responsible for the old audio buffer. + // We need to create a new one. + _audiobuf = (ogg_int16_t *)malloc(AUDIOFD_FRAGSIZE * sizeof(ogg_int16_t)); + _audiobufFill = 0; + queuedAudio = true; + } + } else { + // no pending audio; is there a pending packet to decode? + if (ogg_stream_packetout(&_vorbisOut, &_oggPacket) > 0) { + if (vorbis_synthesis(&_vorbisBlock, &_oggPacket) == 0) // test for success! + vorbis_synthesis_blockin(&_vorbisDSP, &_vorbisBlock); + } else // we've buffered all we have, break out for now + return queuedAudio; + } + } + + // Unreachable + return false; } void TheoraDecoder::reset() { - FixedRateVideoDecoder::reset(); + VideoDecoder::reset(); + + // FIXME: This does a rewind() instead of a reset()! if (_fileStream) _fileStream->seek(0); - _videobufReady = false; - #if ENABLE_THEORA_SEEKING _videobufGranulePos = -1; _audiobufGranulePos = 0; @@ -473,36 +479,39 @@ void TheoraDecoder::reset() { _audiobufFill = 0; _audiobufReady = false; - _curFrame = 0; + _curFrame = -1; _theoraPacket = 0; _vorbisPacket = 0; - _stateFlag = false; } bool TheoraDecoder::endOfVideo() const { - return !isVideoLoaded(); + return !isVideoLoaded() || (_endOfVideo && (!_audStream || (_audStream->endOfData() && _endOfAudio))); } +uint32 TheoraDecoder::getTimeToNextFrame() const { + if (endOfVideo() || _curFrame < 0) + return 0; -uint32 TheoraDecoder::getElapsedTime() const { - if (_audStream && _mixer) - return _mixer->getSoundElapsedTime(*_audHandle); + uint32 elapsedTime = getElapsedTime(); + uint32 nextFrameStartTime = (uint32)(_nextFrameStartTime * 1000); + + if (nextFrameStartTime <= elapsedTime) + return 0; - return FixedRateVideoDecoder::getElapsedTime(); + return nextFrameStartTime - elapsedTime; } -Audio::QueuingAudioStream *TheoraDecoder::createAudioStream() { - return Audio::makeQueuingAudioStream(_vorbisInfo.rate, _vorbisInfo.channels); +uint32 TheoraDecoder::getElapsedTime() const { + if (_audStream) + return g_system->getMixer()->getSoundElapsedTime(*_audHandle); + + return VideoDecoder::getElapsedTime(); } -static void convertYUVtoBGRA(int y, int u, int v, byte *dst) { - byte r, g, b; - Graphics::YUV2RGB(y, u, v, r, g, b); - *(dst + 0) = b; - *(dst + 1) = g; - *(dst + 2) = r; - *(dst + 3) = 0xFF; +void TheoraDecoder::pauseVideoIntern(bool pause) { + if (_audStream) + g_system->getMixer()->pauseHandle(*_audHandle, pause); } enum TheoraYUVBuffers { @@ -511,7 +520,7 @@ enum TheoraYUVBuffers { kBufferV = 2 }; -void TheoraDecoder::translateYUVtoRGBA(th_ycbcr_buffer &YUVBuffer, byte *pixelData) { +void TheoraDecoder::translateYUVtoRGBA(th_ycbcr_buffer &YUVBuffer) { // Width and height of all buffers have to be divisible by 2. assert((YUVBuffer[kBufferY].width & 1) == 0); assert((YUVBuffer[kBufferY].height & 1) == 0); @@ -524,40 +533,7 @@ void TheoraDecoder::translateYUVtoRGBA(th_ycbcr_buffer &YUVBuffer, byte *pixelDa assert(YUVBuffer[kBufferU].height == YUVBuffer[kBufferY].height >> 1); assert(YUVBuffer[kBufferV].height == YUVBuffer[kBufferY].height >> 1); - const byte *ySrc = YUVBuffer[kBufferY].data; - const byte *uSrc = YUVBuffer[kBufferU].data; - const byte *vSrc = YUVBuffer[kBufferV].data; - byte *dst = pixelData; - int u = 0, v = 0; - - const int blockSize = YUVBuffer[kBufferY].width << 2; - const int halfHeight = YUVBuffer[kBufferY].height >> 1; - const int halfWidth = YUVBuffer[kBufferY].width >> 1; - const int yStep = (YUVBuffer[kBufferY].stride << 1) - YUVBuffer[kBufferY].width; - // The UV step is usually 0, since in most cases stride == width. - // The asserts at the top ensure that the U and V steps are equal - // (and they must always be equal) - const int uvStep = YUVBuffer[kBufferU].stride - YUVBuffer[kBufferU].width; - const int stride = YUVBuffer[kBufferY].stride; - - for (int h = 0; h < halfHeight; ++h) { - for (int w = 0; w < halfWidth; ++w) { - u = *uSrc++; - v = *vSrc++; - - for (int i = 0; i <= 1; i++) { - convertYUVtoBGRA(*ySrc, u, v, dst); - convertYUVtoBGRA(*(ySrc + stride), u, v, dst + blockSize); - ySrc++; - dst += 4; // BGRA - } - } - - dst += blockSize; - ySrc += yStep; - uSrc += uvStep; - vSrc += uvStep; - } + Graphics::convertYUV420ToRGB(_surface, YUVBuffer[kBufferY].data, YUVBuffer[kBufferU].data, YUVBuffer[kBufferV].data, YUVBuffer[kBufferY].width, YUVBuffer[kBufferY].height, YUVBuffer[kBufferY].stride, YUVBuffer[kBufferU].stride); } } // End of namespace Sword25 diff --git a/engines/sword25/fmv/theora_decoder.h b/engines/sword25/fmv/theora_decoder.h index 4ed2af5f98..10a05647c3 100644 --- a/engines/sword25/fmv/theora_decoder.h +++ b/engines/sword25/fmv/theora_decoder.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef SWORD25_THEORADECODER_H @@ -44,8 +41,6 @@ namespace Common { class SeekableReadStream; } -//#define ENABLE_THEORA_SEEKING // enables the extra calculations used for video seeking - namespace Sword25 { /** @@ -54,9 +49,9 @@ namespace Sword25 { * Video decoder used in engines: * - sword25 */ -class TheoraDecoder : public Video::FixedRateVideoDecoder { +class TheoraDecoder : public Video::VideoDecoder { public: - TheoraDecoder(Audio::Mixer *mixer = 0, Audio::Mixer::SoundType soundType = Audio::Mixer::kMusicSoundType); + TheoraDecoder(Audio::Mixer::SoundType soundType = Audio::Mixer::kMusicSoundType); virtual ~TheoraDecoder(); /** @@ -74,51 +69,39 @@ public: */ const Graphics::Surface *decodeNextFrame(); - bool isVideoLoaded() const { - return _fileStream != 0; - } - bool isPaused() const { - return (FixedRateVideoDecoder::isPaused() || !isVideoLoaded()); - } + bool isVideoLoaded() const { return _fileStream != 0; } + uint16 getWidth() const { return _surface->w; } + uint16 getHeight() const { return _surface->h; } - uint16 getWidth() const { - return _surface->w; - } - uint16 getHeight() const { - return _surface->h; - } uint32 getFrameCount() const { // It is not possible to get frame count easily // I.e. seeking is required assert(0); return 0; } - Graphics::PixelFormat getPixelFormat() const { - return Graphics::PixelFormat(4, 8, 8, 8, 8, 16, 8, 0, 24); - } + Graphics::PixelFormat getPixelFormat() const { return _surface->format; } uint32 getElapsedTime() const; + uint32 getTimeToNextFrame() const; bool endOfVideo() const; protected: - Common::Rational getFrameRate() const { - return _frameRate; - } + void pauseVideoIntern(bool pause); private: void queuePage(ogg_page *page); + bool queueAudio(); int bufferData(); - Audio::QueuingAudioStream *createAudioStream(); - void translateYUVtoRGBA(th_ycbcr_buffer &YUVBuffer, byte *pixelData); + void translateYUVtoRGBA(th_ycbcr_buffer &YUVBuffer); -private: Common::SeekableReadStream *_fileStream; Graphics::Surface *_surface; Common::Rational _frameRate; - uint32 _frameCount; + double _nextFrameStartTime; + bool _endOfVideo; + bool _endOfAudio; - Audio::Mixer *_mixer; Audio::Mixer::SoundType _soundType; Audio::SoundHandle *_audHandle; Audio::QueuingAudioStream *_audStream; @@ -139,25 +122,15 @@ private: int _theoraPacket; int _vorbisPacket; - bool _stateFlag; int _ppLevelMax; int _ppLevel; int _ppInc; - // single frame video buffering - bool _videobufReady; - // single audio fragment audio buffering int _audiobufFill; bool _audiobufReady; ogg_int16_t *_audiobuf; - -#if ENABLE_THEORA_SEEKING - double _videobufTime; - ogg_int64_t _videobufGranulePos; - ogg_int64_t _audiobufGranulePos; // time position of last sample -#endif }; } // End of namespace Sword25 diff --git a/engines/sword25/gfx/animation.cpp b/engines/sword25/gfx/animation.cpp index 5b56d708cb..22a4dfb71b 100644 --- a/engines/sword25/gfx/animation.cpp +++ b/engines/sword25/gfx/animation.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ /* diff --git a/engines/sword25/gfx/animation.h b/engines/sword25/gfx/animation.h index a530c02b12..55deacd333 100644 --- a/engines/sword25/gfx/animation.h +++ b/engines/sword25/gfx/animation.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ /* diff --git a/engines/sword25/gfx/animationdescription.cpp b/engines/sword25/gfx/animationdescription.cpp index 68ba7b63a6..da0a660df9 100644 --- a/engines/sword25/gfx/animationdescription.cpp +++ b/engines/sword25/gfx/animationdescription.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ /* diff --git a/engines/sword25/gfx/animationdescription.h b/engines/sword25/gfx/animationdescription.h index 88cbb23503..3b11686bb9 100644 --- a/engines/sword25/gfx/animationdescription.h +++ b/engines/sword25/gfx/animationdescription.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ /* diff --git a/engines/sword25/gfx/animationresource.cpp b/engines/sword25/gfx/animationresource.cpp index f9347e3dad..a9c9cf9c29 100644 --- a/engines/sword25/gfx/animationresource.cpp +++ b/engines/sword25/gfx/animationresource.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ /* diff --git a/engines/sword25/gfx/animationresource.h b/engines/sword25/gfx/animationresource.h index 0cbaf0a507..2a1e3ce882 100644 --- a/engines/sword25/gfx/animationresource.h +++ b/engines/sword25/gfx/animationresource.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ /* diff --git a/engines/sword25/gfx/animationtemplate.cpp b/engines/sword25/gfx/animationtemplate.cpp index 835ae09fe8..19924302b9 100644 --- a/engines/sword25/gfx/animationtemplate.cpp +++ b/engines/sword25/gfx/animationtemplate.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ /* diff --git a/engines/sword25/gfx/animationtemplate.h b/engines/sword25/gfx/animationtemplate.h index 06be94719d..b61ecfcf54 100644 --- a/engines/sword25/gfx/animationtemplate.h +++ b/engines/sword25/gfx/animationtemplate.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ /* diff --git a/engines/sword25/gfx/animationtemplateregistry.cpp b/engines/sword25/gfx/animationtemplateregistry.cpp index c41a7cde55..43c099c89d 100644 --- a/engines/sword25/gfx/animationtemplateregistry.cpp +++ b/engines/sword25/gfx/animationtemplateregistry.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ /* diff --git a/engines/sword25/gfx/animationtemplateregistry.h b/engines/sword25/gfx/animationtemplateregistry.h index 574ccce136..d3d02b2ac8 100644 --- a/engines/sword25/gfx/animationtemplateregistry.h +++ b/engines/sword25/gfx/animationtemplateregistry.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ /* diff --git a/engines/sword25/gfx/bitmap.cpp b/engines/sword25/gfx/bitmap.cpp index 9010a9c981..593a426975 100644 --- a/engines/sword25/gfx/bitmap.cpp +++ b/engines/sword25/gfx/bitmap.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ /* diff --git a/engines/sword25/gfx/bitmap.h b/engines/sword25/gfx/bitmap.h index 741269c423..caa1238558 100644 --- a/engines/sword25/gfx/bitmap.h +++ b/engines/sword25/gfx/bitmap.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ /* diff --git a/engines/sword25/gfx/bitmapresource.h b/engines/sword25/gfx/bitmapresource.h index 9feca82184..f1278f3885 100644 --- a/engines/sword25/gfx/bitmapresource.h +++ b/engines/sword25/gfx/bitmapresource.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ /* diff --git a/engines/sword25/gfx/dynamicbitmap.cpp b/engines/sword25/gfx/dynamicbitmap.cpp index 46c2af55d7..137d943575 100644 --- a/engines/sword25/gfx/dynamicbitmap.cpp +++ b/engines/sword25/gfx/dynamicbitmap.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ /* diff --git a/engines/sword25/gfx/dynamicbitmap.h b/engines/sword25/gfx/dynamicbitmap.h index 1737bdf5fc..35ed9a9341 100644 --- a/engines/sword25/gfx/dynamicbitmap.h +++ b/engines/sword25/gfx/dynamicbitmap.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ /* diff --git a/engines/sword25/gfx/fontresource.cpp b/engines/sword25/gfx/fontresource.cpp index 0f0496e9ab..f99987fc91 100644 --- a/engines/sword25/gfx/fontresource.cpp +++ b/engines/sword25/gfx/fontresource.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ /* diff --git a/engines/sword25/gfx/fontresource.h b/engines/sword25/gfx/fontresource.h index 47aa581a9e..511f485658 100644 --- a/engines/sword25/gfx/fontresource.h +++ b/engines/sword25/gfx/fontresource.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ /* diff --git a/engines/sword25/gfx/graphicengine.cpp b/engines/sword25/gfx/graphicengine.cpp index 8bdf2a4a6e..6b1c2bc514 100644 --- a/engines/sword25/gfx/graphicengine.cpp +++ b/engines/sword25/gfx/graphicengine.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ /* @@ -86,7 +83,6 @@ GraphicEngine::GraphicEngine(Kernel *pKernel) : GraphicEngine::~GraphicEngine() { unregisterScriptBindings(); _backSurface.free(); - _frameBuffer.free(); delete _thumbnail; } @@ -115,7 +111,6 @@ bool GraphicEngine::init(int width, int height, int bitDepth, int backbufferCoun const Graphics::PixelFormat format = g_system->getScreenFormat(); _backSurface.create(width, height, format); - _frameBuffer.create(width, height, format); // Standardmäßig ist Vsync an. setVsync(true); @@ -151,18 +146,6 @@ bool GraphicEngine::endFrame() { _renderObjectManagerPtr->render(); - // FIXME: The following hack doesn't really work (all the thumbnails are empty) -#if 0 - // HACK: The frame buffer surface is only used as the base for creating thumbnails when saving the - // game, since the _backSurface is blanked. Currently I'm doing a slightly hacky check and only - // copying the back surface if line 50 (the first line after the interface area) is non-blank - if (READ_LE_UINT32((byte *)_backSurface.pixels + (_backSurface.pitch * 50)) & 0xffffff) { - // Make a copy of the current frame into the frame buffer - Common::copy((byte *)_backSurface.pixels, (byte *)_backSurface.pixels + - (_backSurface.pitch * _backSurface.h), (byte *)_frameBuffer.pixels); - } -#endif - g_system->updateScreen(); return true; @@ -239,10 +222,6 @@ bool GraphicEngine::fill(const Common::Rect *fillRectPtr, uint color) { return true; } -Graphics::Surface *GraphicEngine::getScreenshot() { - return &_frameBuffer; -} - // ----------------------------------------------------------------------------- // RESOURCE MANAGING // ----------------------------------------------------------------------------- @@ -270,8 +249,9 @@ Resource *GraphicEngine::loadResource(const Common::String &filename) { return pResource; } - // Load sprite image - if (filename.hasSuffix(".png") || filename.hasSuffix(".b25s")) { + // Load sprite image. Savegame thumbnails are also loaded here. + if (filename.hasSuffix(".png") || filename.hasSuffix(".b25s") || + filename.hasPrefix("/saves")) { bool result = false; RenderedImage *pImage = new RenderedImage(filename, result); if (!result) { @@ -358,7 +338,8 @@ bool GraphicEngine::canLoadResource(const Common::String &filename) { filename.hasSuffix("_ani.xml") || filename.hasSuffix("_fnt.xml") || filename.hasSuffix(".swf") || - filename.hasSuffix(".b25s"); + filename.hasSuffix(".b25s") || + filename.hasPrefix("/saves"); } void GraphicEngine::updateLastFrameDuration() { @@ -387,7 +368,9 @@ bool GraphicEngine::saveThumbnailScreenshot(const Common::String &filename) { // Note: In ScumMVM, rather than saivng the thumbnail to a file, we store it in memory // until needed when creating savegame files delete _thumbnail; - _thumbnail = Screenshot::createThumbnail(&_frameBuffer); + + _thumbnail = Screenshot::createThumbnail(&_backSurface); + return true; } diff --git a/engines/sword25/gfx/graphicengine.h b/engines/sword25/gfx/graphicengine.h index 38eecaa60f..04826c2e5a 100644 --- a/engines/sword25/gfx/graphicengine.h +++ b/engines/sword25/gfx/graphicengine.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ /* @@ -146,17 +143,6 @@ public: */ bool saveThumbnailScreenshot(const Common::String &filename); - /** - * Reads the current contents of the frame buffer - * Notes: This method is for creating screenshots. It is not very optimised. It should only be called - * after a call to EndFrame(), and before the next call to StartFrame(). - * @param Width Returns the width of the frame buffer - * @param Height Returns the height of the frame buffer - * @param Data Returns the raw data of the frame buffer as an array of 32-bit color values. - */ - Graphics::Surface *getScreenshot(); - - RenderObjectPtr<Panel> getMainPanel(); /** @@ -246,9 +232,6 @@ public: Graphics::Surface _backSurface; Graphics::Surface *getSurface() { return &_backSurface; } - Graphics::Surface _frameBuffer; - Graphics::Surface *getFrameBuffer() { return &_frameBuffer; } - Common::SeekableReadStream *_thumbnail; Common::SeekableReadStream *getThumbnail() { return _thumbnail; } diff --git a/engines/sword25/gfx/graphicengine_script.cpp b/engines/sword25/gfx/graphicengine_script.cpp index d8daaab32c..b4334195a1 100644 --- a/engines/sword25/gfx/graphicengine_script.cpp +++ b/engines/sword25/gfx/graphicengine_script.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ /* diff --git a/engines/sword25/gfx/image/art.cpp b/engines/sword25/gfx/image/art.cpp index 69f9425a53..cd7cfb6b69 100644 --- a/engines/sword25/gfx/image/art.cpp +++ b/engines/sword25/gfx/image/art.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ /* diff --git a/engines/sword25/gfx/image/art.h b/engines/sword25/gfx/image/art.h index fe3bbd4982..bfeb31cc30 100644 --- a/engines/sword25/gfx/image/art.h +++ b/engines/sword25/gfx/image/art.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ /* diff --git a/engines/sword25/gfx/image/image.h b/engines/sword25/gfx/image/image.h index 7029402c4a..f1934656da 100644 --- a/engines/sword25/gfx/image/image.h +++ b/engines/sword25/gfx/image/image.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ /* diff --git a/engines/sword25/gfx/image/pngloader.cpp b/engines/sword25/gfx/image/pngloader.cpp index f6c00b6968..6f370d8861 100644 --- a/engines/sword25/gfx/image/pngloader.cpp +++ b/engines/sword25/gfx/image/pngloader.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ /* @@ -32,9 +29,6 @@ * */ -// Define to use ScummVM's PNG decoder, instead of libpng -#define USE_INTERNAL_PNG_DECODER - #ifndef USE_INTERNAL_PNG_DECODER // Disable symbol overrides so that we can use png.h #define FORBIDDEN_SYMBOL_ALLOW_ALL @@ -52,51 +46,6 @@ namespace Sword25 { -/** - * Load a NULL-terminated string from the given stream. - */ -static Common::String loadString(Common::ReadStream &in, uint maxSize = 999) { - Common::String result; - - while (!in.eos() && (result.size() < maxSize)) { - char ch = (char)in.readByte(); - if (ch == '\0') - break; - - result += ch; - } - - return result; -} - -/** - * Check if the given data is a savegame, and if so, locate the - * offset to the image data. - * @return offset to image data if fileDataPtr contains a savegame; 0 otherwise - */ -static uint findEmbeddedPNG(const byte *fileDataPtr, uint fileSize) { - if (fileSize < 100) - return 0; - if (memcmp(fileDataPtr, "BS25SAVEGAME", 12)) - return 0; - - // Read in the header - Common::MemoryReadStream stream(fileDataPtr, fileSize); - stream.seek(0, SEEK_SET); - - // Read header information of savegame - uint compressedGamedataSize; - loadString(stream); // Marker - loadString(stream); // Version - loadString(stream); // Description - Common::String gameSize = loadString(stream); - compressedGamedataSize = atoi(gameSize.c_str()); - loadString(stream); - - // Return the offset of where the thumbnail starts - return static_cast<uint>(stream.pos() + compressedGamedataSize); -} - #ifndef USE_INTERNAL_PNG_DECODER static void png_user_read_data(png_structp png_ptr, png_bytep data, png_size_t length) { const byte **ref = (const byte **)png_get_io_ptr(png_ptr); @@ -238,12 +187,11 @@ bool PNGLoader::doDecodeImage(const byte *fileDataPtr, uint fileSize, byte *&unc } bool PNGLoader::decodeImage(const byte *fileDataPtr, uint fileSize, byte *&uncompressedDataPtr, int &width, int &height, int &pitch) { - uint pngOffset = findEmbeddedPNG(fileDataPtr, fileSize); - return doDecodeImage(fileDataPtr + pngOffset, fileSize - pngOffset, uncompressedDataPtr, width, height, pitch); + return doDecodeImage(fileDataPtr, fileSize, uncompressedDataPtr, width, height, pitch); } -bool PNGLoader::doImageProperties(const byte *fileDataPtr, uint fileSize, int &width, int &height) { #ifndef USE_INTERNAL_PNG_DECODER +bool PNGLoader::doImageProperties(const byte *fileDataPtr, uint fileSize, int &width, int &height) { // Check for valid PNG signature if (!doIsCorrectImageFormat(fileDataPtr, fileSize)) return false; @@ -280,17 +228,18 @@ bool PNGLoader::doImageProperties(const byte *fileDataPtr, uint fileSize, int &w // Destroy libpng structures png_destroy_read_struct(&png_ptr, &info_ptr, NULL); -#else - // We don't need to read the image properties here... -#endif + return true; } bool PNGLoader::imageProperties(const byte *fileDataPtr, uint fileSize, int &width, int &height) { - uint pngOffset = findEmbeddedPNG(fileDataPtr, fileSize); - return doImageProperties(fileDataPtr + pngOffset, fileSize - pngOffset, width, height); + return doImageProperties(fileDataPtr, fileSize, width, height); } +#else + // We don't need to read the image properties here... +#endif + } // End of namespace Sword25 diff --git a/engines/sword25/gfx/image/pngloader.h b/engines/sword25/gfx/image/pngloader.h index e0d68ff8b9..6b5f65ff57 100644 --- a/engines/sword25/gfx/image/pngloader.h +++ b/engines/sword25/gfx/image/pngloader.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ /* @@ -40,6 +37,9 @@ namespace Sword25 { +// Define to use ScummVM's PNG decoder, instead of libpng +#define USE_INTERNAL_PNG_DECODER + /** * Class for loading PNG files, and PNG data embedded into savegames. * @@ -50,7 +50,9 @@ protected: PNGLoader() {} // Protected constructor to prevent instances static bool doDecodeImage(const byte *fileDataPtr, uint fileSize, byte *&uncompressedDataPtr, int &width, int &height, int &pitch); +#ifndef USE_INTERNAL_PNG_DECODER static bool doImageProperties(const byte *fileDataPtr, uint fileSize, int &width, int &height); +#endif public: @@ -72,6 +74,8 @@ public: byte *&pUncompressedData, int &width, int &height, int &pitch); + +#ifndef USE_INTERNAL_PNG_DECODER /** * Extract the properties of an image. * @param[in] fileDatePtr pointer to the image data @@ -86,6 +90,8 @@ public: static bool imageProperties(const byte *fileDatePtr, uint fileSize, int &width, int &height); +#endif + }; } // End of namespace Sword25 diff --git a/engines/sword25/gfx/image/renderedimage.cpp b/engines/sword25/gfx/image/renderedimage.cpp index 806d9b27ad..23bf2623ad 100644 --- a/engines/sword25/gfx/image/renderedimage.cpp +++ b/engines/sword25/gfx/image/renderedimage.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ /* @@ -36,6 +33,7 @@ // INCLUDES // ----------------------------------------------------------------------------- +#include "common/savefile.h" #include "sword25/package/packagemanager.h" #include "sword25/gfx/image/pngloader.h" #include "sword25/gfx/image/renderedimage.h" @@ -44,10 +42,88 @@ namespace Sword25 { +// Duplicated from kernel/persistenceservice.cpp +static Common::String generateSavegameFilename(uint slotID) { + char buffer[100]; + // NOTE: This is hardcoded to sword25 + snprintf(buffer, 100, "%s.%.3d", "sword25", slotID); + return Common::String(buffer); +} + // ----------------------------------------------------------------------------- // CONSTRUCTION / DESTRUCTION // ----------------------------------------------------------------------------- +/** + * Load a NULL-terminated string from the given stream. + */ +static Common::String loadString(Common::SeekableReadStream &in, uint maxSize = 999) { + Common::String result; + + while (!in.eos() && (result.size() < maxSize)) { + char ch = (char)in.readByte(); + if (ch == '\0') + break; + + result += ch; + } + + return result; +} + +static byte *readSavegameThumbnail(const Common::String &filename, uint &fileSize, bool &isPNG) { + byte *pFileData; + Common::SaveFileManager *sfm = g_system->getSavefileManager(); + int slotNum = atoi(filename.c_str() + filename.size() - 3); + Common::InSaveFile *file = sfm->openForLoading(generateSavegameFilename(slotNum)); + + // Seek to the actual PNG image + loadString(*file); // Marker (BS25SAVEGAME) + loadString(*file); // Version + loadString(*file); // Description + uint32 compressedGamedataSize = atoi(loadString(*file).c_str()); + loadString(*file); // Uncompressed game data size + file->skip(compressedGamedataSize); // Skip the game data and move to the thumbnail itself + uint32 thumbnailStart = file->pos(); + + fileSize = file->size() - thumbnailStart; + + // Check if the thumbnail is in our own format, or a PNG file. + uint32 header = file->readUint32BE(); + isPNG = (header != MKTAG('S','C','R','N')); + file->seek(-4, SEEK_CUR); + + pFileData = new byte[fileSize]; + file->read(pFileData, fileSize); + delete file; + + return pFileData; +} + +// TODO: Move this method into a more generic image loading class, together with the PNG reading code +static bool decodeThumbnail(const byte *pFileData, uint fileSize, byte *&pUncompressedData, int &width, int &height, int &pitch) { + const byte *src = pFileData + 4; // skip header + width = READ_LE_UINT16(src); src += 2; + height = READ_LE_UINT16(src); src += 2; + src++; // version, ignored for now + pitch = width * 4; + + uint32 totalSize = pitch * height; + pUncompressedData = new byte[totalSize]; + uint32 *dst = (uint32 *)pUncompressedData; // treat as uint32, for pixelformat output + const Graphics::PixelFormat format = Graphics::PixelFormat(4, 8, 8, 8, 8, 16, 8, 0, 24); + byte r, g, b; + + for (uint32 i = 0; i < totalSize / 4; i++) { + r = *src++; + g = *src++; + b = *src++; + *dst++ = format.RGBToColor(r, g, b); + } + + return true; +} + RenderedImage::RenderedImage(const Common::String &filename, bool &result) : _data(0), _width(0), @@ -62,22 +138,37 @@ RenderedImage::RenderedImage(const Common::String &filename, bool &result) : // Load file byte *pFileData; uint fileSize; - pFileData = pPackage->getFile(filename, &fileSize); + + bool isPNG = true; + + if (filename.hasPrefix("/saves")) { + pFileData = readSavegameThumbnail(filename, fileSize, isPNG); + } else { + pFileData = pPackage->getFile(filename, &fileSize); + } + if (!pFileData) { error("File \"%s\" could not be loaded.", filename.c_str()); return; } +#ifndef USE_INTERNAL_PNG_DECODER // Determine image properties - int pitch; if (!PNGLoader::imageProperties(pFileData, fileSize, _width, _height)) { error("Could not read image properties."); delete[] pFileData; return; } +#endif // Uncompress the image - if (!PNGLoader::decodeImage(pFileData, fileSize, _data, _width, _height, pitch)) { + int pitch; + if (isPNG) + result = PNGLoader::decodeImage(pFileData, fileSize, _data, _width, _height, pitch); + else + result = decodeThumbnail(pFileData, fileSize, _data, _width, _height, pitch); + + if (!result) { error("Could not decode image."); delete[] pFileData; return; @@ -88,7 +179,6 @@ RenderedImage::RenderedImage(const Common::String &filename, bool &result) : _doCleanup = true; - result = true; return; } diff --git a/engines/sword25/gfx/image/renderedimage.h b/engines/sword25/gfx/image/renderedimage.h index e3f23747da..f92a5b39b4 100644 --- a/engines/sword25/gfx/image/renderedimage.h +++ b/engines/sword25/gfx/image/renderedimage.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ /* diff --git a/engines/sword25/gfx/image/swimage.cpp b/engines/sword25/gfx/image/swimage.cpp index 3b9b939eb3..92d47368b2 100644 --- a/engines/sword25/gfx/image/swimage.cpp +++ b/engines/sword25/gfx/image/swimage.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ /* @@ -56,14 +53,16 @@ SWImage::SWImage(const Common::String &filename, bool &result) : return; } +#ifndef USE_INTERNAL_PNG_DECODER // Determine image properties - int pitch; if (!PNGLoader::imageProperties(pFileData, fileSize, _width, _height)) { error("Could not read image properties."); return; } +#endif // Uncompress the image + int pitch; byte *pUncompressedData; if (!PNGLoader::decodeImage(pFileData, fileSize, pUncompressedData, _width, _height, pitch)) { error("Could not decode image."); diff --git a/engines/sword25/gfx/image/swimage.h b/engines/sword25/gfx/image/swimage.h index a914c4f41f..5f348958b2 100644 --- a/engines/sword25/gfx/image/swimage.h +++ b/engines/sword25/gfx/image/swimage.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ /* diff --git a/engines/sword25/gfx/image/vectorimage.cpp b/engines/sword25/gfx/image/vectorimage.cpp index 241e80bad3..9235ec2fcf 100644 --- a/engines/sword25/gfx/image/vectorimage.cpp +++ b/engines/sword25/gfx/image/vectorimage.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ /* diff --git a/engines/sword25/gfx/image/vectorimage.h b/engines/sword25/gfx/image/vectorimage.h index 79a7519dda..959f251c14 100644 --- a/engines/sword25/gfx/image/vectorimage.h +++ b/engines/sword25/gfx/image/vectorimage.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ /* diff --git a/engines/sword25/gfx/image/vectorimagerenderer.cpp b/engines/sword25/gfx/image/vectorimagerenderer.cpp index 99a47015fb..97dad3346d 100644 --- a/engines/sword25/gfx/image/vectorimagerenderer.cpp +++ b/engines/sword25/gfx/image/vectorimagerenderer.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ /* diff --git a/engines/sword25/gfx/panel.cpp b/engines/sword25/gfx/panel.cpp index 955c317399..34ab4876ea 100644 --- a/engines/sword25/gfx/panel.cpp +++ b/engines/sword25/gfx/panel.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ /* diff --git a/engines/sword25/gfx/panel.h b/engines/sword25/gfx/panel.h index 6fe96369a6..cbf04ce40f 100644 --- a/engines/sword25/gfx/panel.h +++ b/engines/sword25/gfx/panel.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ /* diff --git a/engines/sword25/gfx/renderobject.cpp b/engines/sword25/gfx/renderobject.cpp index b044d906f3..a977eb80ba 100644 --- a/engines/sword25/gfx/renderobject.cpp +++ b/engines/sword25/gfx/renderobject.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ /* diff --git a/engines/sword25/gfx/renderobject.h b/engines/sword25/gfx/renderobject.h index 7b7b9047f7..0b54ccc24b 100644 --- a/engines/sword25/gfx/renderobject.h +++ b/engines/sword25/gfx/renderobject.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ /* diff --git a/engines/sword25/gfx/renderobjectmanager.cpp b/engines/sword25/gfx/renderobjectmanager.cpp index 1f7938f41f..38289991eb 100644 --- a/engines/sword25/gfx/renderobjectmanager.cpp +++ b/engines/sword25/gfx/renderobjectmanager.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ /* diff --git a/engines/sword25/gfx/renderobjectmanager.h b/engines/sword25/gfx/renderobjectmanager.h index 8511382d6e..9e7efd8e60 100644 --- a/engines/sword25/gfx/renderobjectmanager.h +++ b/engines/sword25/gfx/renderobjectmanager.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ /* diff --git a/engines/sword25/gfx/renderobjectptr.h b/engines/sword25/gfx/renderobjectptr.h index c22c6e83e7..7b7f190a01 100644 --- a/engines/sword25/gfx/renderobjectptr.h +++ b/engines/sword25/gfx/renderobjectptr.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ /* diff --git a/engines/sword25/gfx/renderobjectregistry.h b/engines/sword25/gfx/renderobjectregistry.h index 988b676aa8..92d8c9b830 100644 --- a/engines/sword25/gfx/renderobjectregistry.h +++ b/engines/sword25/gfx/renderobjectregistry.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ /* diff --git a/engines/sword25/gfx/rootrenderobject.h b/engines/sword25/gfx/rootrenderobject.h index e4e3fba3c8..4782fad175 100644 --- a/engines/sword25/gfx/rootrenderobject.h +++ b/engines/sword25/gfx/rootrenderobject.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ /* diff --git a/engines/sword25/gfx/screenshot.cpp b/engines/sword25/gfx/screenshot.cpp index 6ea2b574d6..8306d9ce6f 100644 --- a/engines/sword25/gfx/screenshot.cpp +++ b/engines/sword25/gfx/screenshot.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ /* @@ -39,83 +36,31 @@ #include "common/textconsole.h" #include "sword25/gfx/screenshot.h" #include "sword25/kernel/filesystemutil.h" -#include <png.h> namespace Sword25 { -#include "common/pack-start.h" -struct RGB_PIXEL { - byte red; - byte green; - byte blue; -} PACKED_STRUCT; -#include "common/pack-end.h" - -void userWriteFn(png_structp png_ptr, png_bytep data, png_size_t length) { - static_cast<Common::WriteStream *>(png_get_io_ptr(png_ptr))->write(data, length); -} - -void userFlushFn(png_structp png_ptr) { -} +#define THUMBNAIL_VERSION 1 bool Screenshot::saveToFile(Graphics::Surface *data, Common::WriteStream *stream) { - // Reserve buffer space - RGB_PIXEL *pixelBuffer = new RGB_PIXEL[data->w * data->h]; - // Convert the RGBA data to RGB const byte *pSrc = (const byte *)data->getBasePtr(0, 0); - RGB_PIXEL *pDest = pixelBuffer; + + // Write our own custom header + stream->writeUint32BE(MKTAG('S','C','R','N')); // SCRN, short for "Screenshot" + stream->writeUint16LE(data->w); + stream->writeUint16LE(data->h); + stream->writeByte(THUMBNAIL_VERSION); for (uint y = 0; y < data->h; y++) { for (uint x = 0; x < data->w; x++) { uint32 srcPixel = READ_LE_UINT32(pSrc); pSrc += sizeof(uint32); - pDest->red = (srcPixel >> 16) & 0xff; - pDest->green = (srcPixel >> 8) & 0xff; - pDest->blue = srcPixel & 0xff; - ++pDest; + stream->writeByte((srcPixel >> 16) & 0xff); // R + stream->writeByte((srcPixel >> 8) & 0xff); // G + stream->writeByte(srcPixel & 0xff); // B } } - png_structp png_ptr = png_create_write_struct(PNG_LIBPNG_VER_STRING, NULL, NULL, NULL); - if (!png_ptr) - error("Could not create PNG write-struct."); - - png_infop info_ptr = png_create_info_struct(png_ptr); - if (!info_ptr) - error("Could not create PNG info-struct."); - - // The compression buffer must be large enough to the entire image. - // This ensures that only an IDAT chunk is created. - // When buffer size is used 110% of the raw data size to be sure. - png_set_compression_buffer_size(png_ptr, (data->w * data->h * 3 * 110) / 100); - - // Initialise PNG-Info structure - png_set_IHDR(png_ptr, info_ptr, - data->w, // Width - data->h, // Height - 8, // Bits depth - PNG_COLOR_TYPE_RGB, // Color type - PNG_INTERLACE_NONE, // No interlacing - PNG_COMPRESSION_TYPE_DEFAULT, // Compression type - PNG_FILTER_TYPE_DEFAULT); // Filter Type - - // Rowpointer erstellen - png_bytep *rowPointers = new png_bytep[data->h]; - for (uint i = 0; i < data->h; i++) { - rowPointers[i] = (png_bytep)&pixelBuffer[data->w * i]; - } - png_set_rows(png_ptr, info_ptr, &rowPointers[0]); - - // Write out the png data to the file - png_set_write_fn(png_ptr, (void *)stream, userWriteFn, userFlushFn); - png_write_png(png_ptr, info_ptr, PNG_TRANSFORM_IDENTITY, NULL); - - png_destroy_write_struct(&png_ptr, &info_ptr); - - delete[] pixelBuffer; - delete[] rowPointers; - return true; } diff --git a/engines/sword25/gfx/screenshot.h b/engines/sword25/gfx/screenshot.h index a0f615f9e6..e2e2dfc7f5 100644 --- a/engines/sword25/gfx/screenshot.h +++ b/engines/sword25/gfx/screenshot.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ /* diff --git a/engines/sword25/gfx/staticbitmap.cpp b/engines/sword25/gfx/staticbitmap.cpp index 2e8d1ba071..60ad94e20f 100644 --- a/engines/sword25/gfx/staticbitmap.cpp +++ b/engines/sword25/gfx/staticbitmap.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ /* diff --git a/engines/sword25/gfx/staticbitmap.h b/engines/sword25/gfx/staticbitmap.h index b5b4c4f5a2..e66ede02b4 100644 --- a/engines/sword25/gfx/staticbitmap.h +++ b/engines/sword25/gfx/staticbitmap.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ /* diff --git a/engines/sword25/gfx/text.cpp b/engines/sword25/gfx/text.cpp index b1c1708565..8e18d2936d 100644 --- a/engines/sword25/gfx/text.cpp +++ b/engines/sword25/gfx/text.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ /* diff --git a/engines/sword25/gfx/text.h b/engines/sword25/gfx/text.h index 42c1cd7c5d..a0d668014f 100644 --- a/engines/sword25/gfx/text.h +++ b/engines/sword25/gfx/text.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ /* diff --git a/engines/sword25/gfx/timedrenderobject.cpp b/engines/sword25/gfx/timedrenderobject.cpp index e3b4d1990c..e35b0ae95b 100644 --- a/engines/sword25/gfx/timedrenderobject.cpp +++ b/engines/sword25/gfx/timedrenderobject.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ /* diff --git a/engines/sword25/gfx/timedrenderobject.h b/engines/sword25/gfx/timedrenderobject.h index 6fee19882a..44c3b40528 100644 --- a/engines/sword25/gfx/timedrenderobject.h +++ b/engines/sword25/gfx/timedrenderobject.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ /* diff --git a/engines/sword25/input/inputengine.cpp b/engines/sword25/input/inputengine.cpp index 769baafeed..bb9c2c8b40 100644 --- a/engines/sword25/input/inputengine.cpp +++ b/engines/sword25/input/inputengine.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ /* diff --git a/engines/sword25/input/inputengine.h b/engines/sword25/input/inputengine.h index 40f801dde2..a84c215076 100644 --- a/engines/sword25/input/inputengine.h +++ b/engines/sword25/input/inputengine.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ /* diff --git a/engines/sword25/input/inputengine_script.cpp b/engines/sword25/input/inputengine_script.cpp index d4f2719b62..db2619294c 100644 --- a/engines/sword25/input/inputengine_script.cpp +++ b/engines/sword25/input/inputengine_script.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ /* diff --git a/engines/sword25/kernel/common.h b/engines/sword25/kernel/common.h index 487bfc5c78..8cfc81e981 100644 --- a/engines/sword25/kernel/common.h +++ b/engines/sword25/kernel/common.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ /* diff --git a/engines/sword25/kernel/filesystemutil.cpp b/engines/sword25/kernel/filesystemutil.cpp index e5ec6c15db..281e7986df 100644 --- a/engines/sword25/kernel/filesystemutil.cpp +++ b/engines/sword25/kernel/filesystemutil.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ /* diff --git a/engines/sword25/kernel/filesystemutil.h b/engines/sword25/kernel/filesystemutil.h index b75454c1c8..bb100123d9 100644 --- a/engines/sword25/kernel/filesystemutil.h +++ b/engines/sword25/kernel/filesystemutil.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ /* diff --git a/engines/sword25/kernel/inputpersistenceblock.cpp b/engines/sword25/kernel/inputpersistenceblock.cpp index 26c924dc82..c1cd771e39 100644 --- a/engines/sword25/kernel/inputpersistenceblock.cpp +++ b/engines/sword25/kernel/inputpersistenceblock.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ /* diff --git a/engines/sword25/kernel/inputpersistenceblock.h b/engines/sword25/kernel/inputpersistenceblock.h index f6ab256460..f643b06bc1 100644 --- a/engines/sword25/kernel/inputpersistenceblock.h +++ b/engines/sword25/kernel/inputpersistenceblock.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ /* diff --git a/engines/sword25/kernel/kernel.cpp b/engines/sword25/kernel/kernel.cpp index 99fec52040..f45137ce02 100644 --- a/engines/sword25/kernel/kernel.cpp +++ b/engines/sword25/kernel/kernel.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ /* @@ -57,7 +54,8 @@ Kernel::Kernel() : _input(0), _package(0), _script(0), - _fmv(0) + _fmv(0), + _rnd("sword25") { _instance = this; diff --git a/engines/sword25/kernel/kernel.h b/engines/sword25/kernel/kernel.h index 3abf43d239..a0c2927fdc 100644 --- a/engines/sword25/kernel/kernel.h +++ b/engines/sword25/kernel/kernel.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ /* diff --git a/engines/sword25/kernel/kernel_script.cpp b/engines/sword25/kernel/kernel_script.cpp index 458f6b2deb..27a221d45f 100644 --- a/engines/sword25/kernel/kernel_script.cpp +++ b/engines/sword25/kernel/kernel_script.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ /* @@ -42,45 +39,9 @@ namespace Sword25 { -static int disconnectService(lua_State *L) { - // This function apparently is not used by the game scripts - lua_pushboolean(L, true); - - return 1; -} - -static int getActiveServiceIdentifier(lua_State *L) { - // This function apparently is not used by the game scripts - lua_pushstring(L, "QUUX"); - - return 1; -} - -static int getSuperclassCount(lua_State *L) { - // This function is only used by a single function in system/kernel.lua which is never called. - lua_pushnumber(L, 0); - - return 1; -} - -static int getSuperclassIdentifier(lua_State *L) { - // This function is only used by a single function in system/kernel.lua which is never called. - lua_pushstring(L, "FOO"); - - return 1; -} - -static int getServiceCount(lua_State *L) { - // This function is only used by a single function in system/kernel.lua which is never called. - lua_pushnumber(L, 0); - - return 1; -} - -static int getServiceIdentifier(lua_State *L) { - // This function is only used by a single function in system/kernel.lua which is never called. - lua_pushstring(L, "BAR"); - +// Marks a function that should never be used +static int dummyFuncError(lua_State *L) { + error("Dummy function invoked by LUA"); return 1; } @@ -177,12 +138,12 @@ static int getUsedMemory(lua_State *L) { static const char *KERNEL_LIBRARY_NAME = "Kernel"; static const luaL_reg KERNEL_FUNCTIONS[] = { - {"DisconnectService", disconnectService}, - {"GetActiveServiceIdentifier", getActiveServiceIdentifier}, - {"GetSuperclassCount", getSuperclassCount}, - {"GetSuperclassIdentifier", getSuperclassIdentifier}, - {"GetServiceCount", getServiceCount}, - {"GetServiceIdentifier", getServiceIdentifier}, + {"DisconnectService", dummyFuncError}, + {"GetActiveServiceIdentifier", dummyFuncError}, + {"GetSuperclassCount", dummyFuncError}, + {"GetSuperclassIdentifier", dummyFuncError}, + {"GetServiceCount", dummyFuncError}, + {"GetServiceIdentifier", dummyFuncError}, {"GetMilliTicks", getMilliTicks}, {"GetTimer", getTimer}, {"StartService", startService}, @@ -241,20 +202,6 @@ static int setY(lua_State *L) { return 0; } -static int getClientX(lua_State *L) { - // This function apparently is not used by the game scripts - lua_pushnumber(L, 0); - - return 1; -} - -static int getClientY(lua_State *L) { - // This function apparently is not used by the game scripts - lua_pushnumber(L, 0); - - return 1; -} - static int getWidth(lua_State *L) { // This function apparently is not used by the game scripts lua_pushnumber(L, 800); @@ -332,20 +279,6 @@ static int closeWanted(lua_State *L) { return 1; } -static int waitForFocus(lua_State *L) { - // This function apparently is not used by the game scripts - lua_pushbooleancpp(L, true); - - return 1; -} - -static int hasFocus(lua_State *L) { - // This function apparently is not used by the game scripts - lua_pushbooleancpp(L, true); - - return 1; -} - static const char *WINDOW_LIBRARY_NAME = "Window"; static const luaL_reg WINDOW_FUNCTIONS[] = { @@ -355,8 +288,8 @@ static const luaL_reg WINDOW_FUNCTIONS[] = { {"SetX", setX}, {"GetY", getY}, {"SetY", setY}, - {"GetClientX", getClientX}, - {"GetClientY", getClientY}, + {"GetClientX", dummyFuncError}, + {"GetClientY", dummyFuncError}, {"GetWidth", getWidth}, {"GetHeight", getHeight}, {"SetWidth", setWidth}, @@ -365,8 +298,8 @@ static const luaL_reg WINDOW_FUNCTIONS[] = { {"SetTitle", setTitle}, {"ProcessMessages", processMessages}, {"CloseWanted", closeWanted}, - {"WaitForFocus", waitForFocus}, - {"HasFocus", hasFocus}, + {"WaitForFocus", dummyFuncError}, + {"HasFocus", dummyFuncError}, {0, 0} }; @@ -436,29 +369,6 @@ static int emptyCache(lua_State *L) { return 0; } -static int isLogCacheMiss(lua_State *L) { - Kernel *pKernel = Kernel::getInstance(); - assert(pKernel); - ResourceManager *pResource = pKernel->getResourceManager(); - assert(pResource); - - // This isn't used in any script - lua_pushbooleancpp(L, false); - - return 1; -} - -static int setLogCacheMiss(lua_State *L) { - Kernel *pKernel = Kernel::getInstance(); - assert(pKernel); - ResourceManager *pResource = pKernel->getResourceManager(); - assert(pResource); - - // This isn't used in any script - - return 0; -} - static int dumpLockedResources(lua_State *L) { Kernel *pKernel = Kernel::getInstance(); assert(pKernel); @@ -478,8 +388,8 @@ static const luaL_reg RESOURCE_FUNCTIONS[] = { {"GetMaxMemoryUsage", getMaxMemoryUsage}, {"SetMaxMemoryUsage", setMaxMemoryUsage}, {"EmptyCache", emptyCache}, - {"IsLogCacheMiss", isLogCacheMiss}, - {"SetLogCacheMiss", setLogCacheMiss}, + {"IsLogCacheMiss", dummyFuncError}, + {"SetLogCacheMiss", dummyFuncError}, {"DumpLockedResources", dumpLockedResources}, {0, 0} }; diff --git a/engines/sword25/kernel/objectregistry.h b/engines/sword25/kernel/objectregistry.h index 69d961ae91..d9a7c353f7 100644 --- a/engines/sword25/kernel/objectregistry.h +++ b/engines/sword25/kernel/objectregistry.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ /* diff --git a/engines/sword25/kernel/outputpersistenceblock.cpp b/engines/sword25/kernel/outputpersistenceblock.cpp index a8a39cb822..cf28ea401f 100644 --- a/engines/sword25/kernel/outputpersistenceblock.cpp +++ b/engines/sword25/kernel/outputpersistenceblock.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ /* diff --git a/engines/sword25/kernel/outputpersistenceblock.h b/engines/sword25/kernel/outputpersistenceblock.h index 71dbe68a52..12351d22e2 100644 --- a/engines/sword25/kernel/outputpersistenceblock.h +++ b/engines/sword25/kernel/outputpersistenceblock.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ /* diff --git a/engines/sword25/kernel/persistable.h b/engines/sword25/kernel/persistable.h index 25cf70fda0..1807211847 100644 --- a/engines/sword25/kernel/persistable.h +++ b/engines/sword25/kernel/persistable.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ /* diff --git a/engines/sword25/kernel/persistenceblock.h b/engines/sword25/kernel/persistenceblock.h index 4a64eff11b..d8440faa50 100644 --- a/engines/sword25/kernel/persistenceblock.h +++ b/engines/sword25/kernel/persistenceblock.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ /* diff --git a/engines/sword25/kernel/persistenceservice.cpp b/engines/sword25/kernel/persistenceservice.cpp index 506eef3c57..a6c71433a7 100644 --- a/engines/sword25/kernel/persistenceservice.cpp +++ b/engines/sword25/kernel/persistenceservice.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ /* @@ -37,6 +34,7 @@ #include "common/fs.h" #include "common/savefile.h" +#include "common/zlib.h" #include "sword25/kernel/kernel.h" #include "sword25/kernel/persistenceservice.h" #include "sword25/kernel/inputpersistenceblock.h" @@ -47,7 +45,6 @@ #include "sword25/input/inputengine.h" #include "sword25/math/regionregistry.h" #include "sword25/script/script.h" -#include <zlib.h> namespace Sword25 { @@ -105,7 +102,6 @@ struct SavegameInformation { bool isOccupied; bool isCompatible; Common::String description; - Common::String filename; uint gamedataLength; uint gamedataOffset; uint gamedataUncompressedLength; @@ -118,7 +114,6 @@ struct SavegameInformation { isOccupied = false; isCompatible = false; description = ""; - filename = ""; gamedataLength = 0; gamedataOffset = 0; gamedataUncompressedLength = 0; @@ -133,18 +128,18 @@ struct PersistenceService::Impl { } void reloadSlots() { - // Über alle Spielstanddateien iterieren und deren Infos einlesen. + // Iterate through all the saved games, and read their thumbnails. for (uint i = 0; i < SLOT_COUNT; ++i) { readSlotSavegameInformation(i); } } void readSlotSavegameInformation(uint slotID) { - // Aktuelle Slotinformationen in den Ausgangszustand versetzen, er wird im Folgenden neu gefüllt. + // Get the information corresponding to the requested save slot. SavegameInformation &curSavegameInfo = _savegameInformations[slotID]; curSavegameInfo.clear(); - // Den Dateinamen für den Spielstand des Slots generieren. + // Generate the save slot file name. Common::String filename = generateSavegameFilename(slotID); // Try to open the savegame for loading @@ -163,16 +158,15 @@ struct PersistenceService::Impl { // If the header can be read in and is detected to be valid, we will have a valid file if (storedMarker == FILE_MARKER) { - // Der Slot wird als belegt markiert. + // The slot is marked as occupied. curSavegameInfo.isOccupied = true; - // Speichern, ob der Spielstand kompatibel mit der aktuellen Engine-Version ist. + // Check if the saved game is compatible with the current engine version. curSavegameInfo.isCompatible = (storedVersionID == Common::String(VERSIONID)); - // Dateinamen des Spielstandes speichern. - curSavegameInfo.filename = generateSavegameFilename(slotID); - // Die Beschreibung des Spielstandes besteht aus einer textuellen Darstellung des Änderungsdatums der Spielstanddatei. + // Load the save game description. curSavegameInfo.description = gameDescription; - // Den Offset zu den gespeicherten Spieldaten innerhalb der Datei speichern. - // Dieses entspricht der aktuellen Position, da nach der letzten Headerinformation noch ein Leerzeichen als trenner folgt. + // The offset to the stored save game data within the file. + // This reflects the current position, as the header information + // is still followed by a space as separator. curSavegameInfo.gamedataOffset = static_cast<uint>(file->pos()); } @@ -244,10 +238,11 @@ Common::String &PersistenceService::getSavegameDescription(uint slotID) { } Common::String &PersistenceService::getSavegameFilename(uint slotID) { - static Common::String emptyString; + static Common::String result; if (!checkslotID(slotID)) - return emptyString; - return _impl->_savegameInformations[slotID].filename; + return result; + result = generateSavegameFilename(slotID); + return result; } bool PersistenceService::saveGame(uint slotID, const Common::String &screenshotFilename) { @@ -293,34 +288,22 @@ bool PersistenceService::saveGame(uint slotID, const Common::String &screenshotF error("Unable to persist modules for savegame file \"%s\".", filename.c_str()); } - // Daten komprimieren. - uLongf compressedLength = writer.getDataSize() + (writer.getDataSize() + 500) / 1000 + 12; - Bytef *compressionBuffer = new Bytef[compressedLength]; - - if (compress2(&compressionBuffer[0], &compressedLength, reinterpret_cast<const Bytef *>(writer.getData()), writer.getDataSize(), 6) != Z_OK) { - error("Unable to compress savegame data in savegame file \"%s\".", filename.c_str()); - } - - // Länge der komprimierten Daten und der unkomprimierten Daten in die Datei schreiben. + // Write the save game data uncompressed, since the final saved game will be + // compressed anyway. char sBuffer[10]; - snprintf(sBuffer, 10, "%ld", compressedLength); + snprintf(sBuffer, 10, "%u", writer.getDataSize()); file->writeString(sBuffer); file->writeByte(0); snprintf(sBuffer, 10, "%u", writer.getDataSize()); file->writeString(sBuffer); file->writeByte(0); - - // Komprimierte Daten in die Datei schreiben. - file->write(reinterpret_cast<char *>(&compressionBuffer[0]), compressedLength); - if (file->err()) { - error("Unable to write game data to savegame file \"%s\".", filename.c_str()); - } + file->write(writer.getData(), writer.getDataSize()); // Get the screenshot Common::SeekableReadStream *thumbnail = Kernel::getInstance()->getGfx()->getThumbnail(); if (thumbnail) { - byte *buffer = new Byte[FILE_COPY_BUFFER_SIZE]; + byte *buffer = new byte[FILE_COPY_BUFFER_SIZE]; while (!thumbnail->eos()) { int bytesRead = thumbnail->read(&buffer[0], FILE_COPY_BUFFER_SIZE); file->write(&buffer[0], bytesRead); @@ -333,11 +316,13 @@ bool PersistenceService::saveGame(uint slotID, const Common::String &screenshotF file->finalize(); delete file; - delete[] compressionBuffer; // Savegameinformationen für diesen Slot aktualisieren. _impl->readSlotSavegameInformation(slotID); + // Empty the cache, to remove old thumbnails + Kernel::getInstance()->getResourceManager()->emptyThumbnailCache(); + // Erfolg signalisieren. return true; } @@ -371,28 +356,35 @@ bool PersistenceService::loadGame(uint slotID) { #endif byte *compressedDataBuffer = new byte[curSavegameInfo.gamedataLength]; - byte *uncompressedDataBuffer = new Bytef[curSavegameInfo.gamedataUncompressedLength]; - - file = sfm->openForLoading(generateSavegameFilename(slotID)); + byte *uncompressedDataBuffer = new byte[curSavegameInfo.gamedataUncompressedLength]; + Common::String filename = generateSavegameFilename(slotID); + file = sfm->openForLoading(filename); file->seek(curSavegameInfo.gamedataOffset); file->read(reinterpret_cast<char *>(&compressedDataBuffer[0]), curSavegameInfo.gamedataLength); if (file->err()) { - error("Unable to load the gamedata from the savegame file \"%s\".", curSavegameInfo.filename.c_str()); + error("Unable to load the gamedata from the savegame file \"%s\".", filename.c_str()); delete[] compressedDataBuffer; delete[] uncompressedDataBuffer; return false; } - // Spieldaten dekomprimieren. - uLongf uncompressedBufferSize = curSavegameInfo.gamedataUncompressedLength; - if (uncompress(reinterpret_cast<Bytef *>(&uncompressedDataBuffer[0]), &uncompressedBufferSize, - reinterpret_cast<Bytef *>(&compressedDataBuffer[0]), curSavegameInfo.gamedataLength) != Z_OK) { - error("Unable to decompress the gamedata from savegame file \"%s\".", curSavegameInfo.filename.c_str()); - delete[] uncompressedDataBuffer; - delete[] compressedDataBuffer; - delete file; - return false; + // Uncompress game data, if needed. + unsigned long uncompressedBufferSize = curSavegameInfo.gamedataUncompressedLength; + + if (uncompressedBufferSize > curSavegameInfo.gamedataLength) { + // Older saved game, where the game data was compressed again. + if (!Common::uncompress(reinterpret_cast<byte *>(&uncompressedDataBuffer[0]), &uncompressedBufferSize, + reinterpret_cast<byte *>(&compressedDataBuffer[0]), curSavegameInfo.gamedataLength)) { + error("Unable to decompress the gamedata from savegame file \"%s\".", filename.c_str()); + delete[] uncompressedDataBuffer; + delete[] compressedDataBuffer; + delete file; + return false; + } + } else { + // Newer saved game with uncompressed game data, copy it as-is. + memcpy(uncompressedDataBuffer, compressedDataBuffer, uncompressedBufferSize); } InputPersistenceBlock reader(&uncompressedDataBuffer[0], curSavegameInfo.gamedataUncompressedLength); @@ -411,7 +403,7 @@ bool PersistenceService::loadGame(uint slotID) { delete file; if (!success) { - error("Unable to unpersist the gamedata from savegame file \"%s\".", curSavegameInfo.filename.c_str()); + error("Unable to unpersist the gamedata from savegame file \"%s\".", filename.c_str()); return false; } diff --git a/engines/sword25/kernel/persistenceservice.h b/engines/sword25/kernel/persistenceservice.h index 0db109d1b0..f73962892c 100644 --- a/engines/sword25/kernel/persistenceservice.h +++ b/engines/sword25/kernel/persistenceservice.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ /* diff --git a/engines/sword25/kernel/resmanager.cpp b/engines/sword25/kernel/resmanager.cpp index 8b446e69d1..cc3316250a 100644 --- a/engines/sword25/kernel/resmanager.cpp +++ b/engines/sword25/kernel/resmanager.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ /* @@ -147,6 +144,21 @@ void ResourceManager::emptyCache() { } } +void ResourceManager::emptyThumbnailCache() { + // Scan through the resource list + Common::List<Resource *>::iterator iter = _resources.begin(); + while (iter != _resources.end()) { + if ((*iter)->getFileName().hasPrefix("/saves")) { + // Unlock the thumbnail + while ((*iter)->getLockCount() > 0) + (*iter)->release(); + // Delete the thumbnail + iter = deleteResource(*iter); + } else + ++iter; + } +} + /** * Returns a requested resource. If any error occurs, returns NULL * @param FileName Filename of resource diff --git a/engines/sword25/kernel/resmanager.h b/engines/sword25/kernel/resmanager.h index 5b2bfd395f..6b95a45b6e 100644 --- a/engines/sword25/kernel/resmanager.h +++ b/engines/sword25/kernel/resmanager.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ /* @@ -82,6 +79,11 @@ public: void emptyCache(); /** + * Removes all the savegame thumbnails from the cache + **/ + void emptyThumbnailCache(); + + /** * Writes the names of all currently locked resources to the log file */ void dumpLockedResources(); diff --git a/engines/sword25/kernel/resource.cpp b/engines/sword25/kernel/resource.cpp index f16cb3aaf2..656355cc17 100644 --- a/engines/sword25/kernel/resource.cpp +++ b/engines/sword25/kernel/resource.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ /* diff --git a/engines/sword25/kernel/resource.h b/engines/sword25/kernel/resource.h index 5c6108a281..7c8175c9c9 100644 --- a/engines/sword25/kernel/resource.h +++ b/engines/sword25/kernel/resource.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ /* diff --git a/engines/sword25/kernel/resservice.h b/engines/sword25/kernel/resservice.h index 65b2dc4b36..69b0688e32 100644 --- a/engines/sword25/kernel/resservice.h +++ b/engines/sword25/kernel/resservice.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ /* diff --git a/engines/sword25/kernel/service.h b/engines/sword25/kernel/service.h index ef8858bb7d..576776bb5f 100644 --- a/engines/sword25/kernel/service.h +++ b/engines/sword25/kernel/service.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ /* diff --git a/engines/sword25/math/geometry.h b/engines/sword25/math/geometry.h index 60898df635..bdbd5b2052 100644 --- a/engines/sword25/math/geometry.h +++ b/engines/sword25/math/geometry.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ /* diff --git a/engines/sword25/math/geometry_script.cpp b/engines/sword25/math/geometry_script.cpp index 4b5e0550fe..70798f7692 100644 --- a/engines/sword25/math/geometry_script.cpp +++ b/engines/sword25/math/geometry_script.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ /* diff --git a/engines/sword25/math/line.h b/engines/sword25/math/line.h index d57fce68f7..9eaa2d3c8c 100644 --- a/engines/sword25/math/line.h +++ b/engines/sword25/math/line.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ /* diff --git a/engines/sword25/math/polygon.cpp b/engines/sword25/math/polygon.cpp index e8385c60c8..fe2fc84cad 100644 --- a/engines/sword25/math/polygon.cpp +++ b/engines/sword25/math/polygon.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ /* diff --git a/engines/sword25/math/polygon.h b/engines/sword25/math/polygon.h index 4bb28f827a..eac19d7900 100644 --- a/engines/sword25/math/polygon.h +++ b/engines/sword25/math/polygon.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ /* diff --git a/engines/sword25/math/region.cpp b/engines/sword25/math/region.cpp index 5d08b0c14e..8790860a55 100644 --- a/engines/sword25/math/region.cpp +++ b/engines/sword25/math/region.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ /* diff --git a/engines/sword25/math/region.h b/engines/sword25/math/region.h index fa65b4b7ad..f9a3f50b3f 100644 --- a/engines/sword25/math/region.h +++ b/engines/sword25/math/region.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ /* diff --git a/engines/sword25/math/regionregistry.cpp b/engines/sword25/math/regionregistry.cpp index 978a1807f7..dff8560205 100644 --- a/engines/sword25/math/regionregistry.cpp +++ b/engines/sword25/math/regionregistry.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ /* diff --git a/engines/sword25/math/regionregistry.h b/engines/sword25/math/regionregistry.h index db3e021e25..9e0a28bea7 100644 --- a/engines/sword25/math/regionregistry.h +++ b/engines/sword25/math/regionregistry.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ /* diff --git a/engines/sword25/math/vertex.cpp b/engines/sword25/math/vertex.cpp index 3746ec9410..b486d35e7e 100644 --- a/engines/sword25/math/vertex.cpp +++ b/engines/sword25/math/vertex.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ /* diff --git a/engines/sword25/math/vertex.h b/engines/sword25/math/vertex.h index 0e6d14502c..817f48e760 100644 --- a/engines/sword25/math/vertex.h +++ b/engines/sword25/math/vertex.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ /* diff --git a/engines/sword25/math/walkregion.cpp b/engines/sword25/math/walkregion.cpp index 8306553f7b..3eea689877 100644 --- a/engines/sword25/math/walkregion.cpp +++ b/engines/sword25/math/walkregion.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ /* diff --git a/engines/sword25/math/walkregion.h b/engines/sword25/math/walkregion.h index e8bf40becc..7dded1980b 100644 --- a/engines/sword25/math/walkregion.h +++ b/engines/sword25/math/walkregion.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ /* diff --git a/engines/sword25/package/packagemanager.cpp b/engines/sword25/package/packagemanager.cpp index 7a64fe2e29..5c869203c6 100644 --- a/engines/sword25/package/packagemanager.cpp +++ b/engines/sword25/package/packagemanager.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ /* diff --git a/engines/sword25/package/packagemanager.h b/engines/sword25/package/packagemanager.h index 3a976b32fa..3c4c4e89c5 100644 --- a/engines/sword25/package/packagemanager.h +++ b/engines/sword25/package/packagemanager.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ /* diff --git a/engines/sword25/package/packagemanager_script.cpp b/engines/sword25/package/packagemanager_script.cpp index eab66f7531..229ec37459 100644 --- a/engines/sword25/package/packagemanager_script.cpp +++ b/engines/sword25/package/packagemanager_script.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ /* diff --git a/engines/sword25/script/lua_extensions.cpp b/engines/sword25/script/lua_extensions.cpp index 5ba38afc36..bf502d719e 100644 --- a/engines/sword25/script/lua_extensions.cpp +++ b/engines/sword25/script/lua_extensions.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ /* diff --git a/engines/sword25/script/luabindhelper.cpp b/engines/sword25/script/luabindhelper.cpp index 03a1802a04..8fbbe7e272 100644 --- a/engines/sword25/script/luabindhelper.cpp +++ b/engines/sword25/script/luabindhelper.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ /* diff --git a/engines/sword25/script/luabindhelper.h b/engines/sword25/script/luabindhelper.h index 94f52743f3..0cb6d37bdc 100644 --- a/engines/sword25/script/luabindhelper.h +++ b/engines/sword25/script/luabindhelper.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ /* diff --git a/engines/sword25/script/luacallback.cpp b/engines/sword25/script/luacallback.cpp index 809676796e..cee0531b8a 100644 --- a/engines/sword25/script/luacallback.cpp +++ b/engines/sword25/script/luacallback.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ /* diff --git a/engines/sword25/script/luacallback.h b/engines/sword25/script/luacallback.h index e097f5b499..796af8598b 100644 --- a/engines/sword25/script/luacallback.h +++ b/engines/sword25/script/luacallback.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ /* diff --git a/engines/sword25/script/luascript.cpp b/engines/sword25/script/luascript.cpp index cce01d58c7..7fd3d1b658 100644 --- a/engines/sword25/script/luascript.cpp +++ b/engines/sword25/script/luascript.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ /* diff --git a/engines/sword25/script/luascript.h b/engines/sword25/script/luascript.h index b66c32176a..f3530d68ed 100644 --- a/engines/sword25/script/luascript.h +++ b/engines/sword25/script/luascript.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ /* diff --git a/engines/sword25/script/script.h b/engines/sword25/script/script.h index 9ca146026e..e4ce846b66 100644 --- a/engines/sword25/script/script.h +++ b/engines/sword25/script/script.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ /* diff --git a/engines/sword25/sfx/soundengine.cpp b/engines/sword25/sfx/soundengine.cpp index 08f0f5b4ae..20622b2098 100644 --- a/engines/sword25/sfx/soundengine.cpp +++ b/engines/sword25/sfx/soundengine.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ /* @@ -154,13 +151,17 @@ bool SoundEngine::playSound(const Common::String &fileName, SOUND_TYPES type, fl uint SoundEngine::playSoundEx(const Common::String &fileName, SOUND_TYPES type, float volume, float pan, bool loop, int loopStart, int loopEnd, uint layer) { Common::SeekableReadStream *in = Kernel::getInstance()->getPackage()->getStream(fileName); +#ifdef USE_VORBIS Audio::SeekableAudioStream *stream = Audio::makeVorbisStream(in, DisposeAfterUse::YES); +#endif uint id; SndHandle *handle = getHandle(&id); debugC(1, kDebugSound, "SoundEngine::playSoundEx(%s, %d, %f, %f, %d, %d, %d, %d)", fileName.c_str(), type, volume, pan, loop, loopStart, loopEnd, layer); +#ifdef USE_VORBIS _mixer->playStream(getType(type), &(handle->handle), stream, -1, (byte)(volume * 255), (int8)(pan * 127)); +#endif return id; } diff --git a/engines/sword25/sfx/soundengine.h b/engines/sword25/sfx/soundengine.h index 576582b478..c087392570 100644 --- a/engines/sword25/sfx/soundengine.h +++ b/engines/sword25/sfx/soundengine.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ /* diff --git a/engines/sword25/sfx/soundengine_script.cpp b/engines/sword25/sfx/soundengine_script.cpp index d347cf5eb4..d7771967a3 100644 --- a/engines/sword25/sfx/soundengine_script.cpp +++ b/engines/sword25/sfx/soundengine_script.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ /* diff --git a/engines/sword25/sword25.cpp b/engines/sword25/sword25.cpp index 38c1c89109..93666fed39 100644 --- a/engines/sword25/sword25.cpp +++ b/engines/sword25/sword25.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ /* diff --git a/engines/sword25/sword25.h b/engines/sword25/sword25.h index 5bd27b311f..5d11aa69e5 100644 --- a/engines/sword25/sword25.h +++ b/engines/sword25/sword25.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef SWORD25_H diff --git a/engines/sword25/util/lua/lauxlib.cpp b/engines/sword25/util/lua/lauxlib.cpp index 53c0556625..526b1c84ab 100644 --- a/engines/sword25/util/lua/lauxlib.cpp +++ b/engines/sword25/util/lua/lauxlib.cpp @@ -6,7 +6,6 @@ #include <ctype.h> -#include <errno.h> #include <stdarg.h> #include <stdio.h> #include <stdlib.h> @@ -541,11 +540,7 @@ static const char *getF (lua_State *L, void *ud, size_t *size) { static int errfile (lua_State *L, const char *what, int fnameindex) { - const char *serr = strerror(errno); - const char *filename = lua_tostring(L, fnameindex) + 1; - lua_pushfstring(L, "cannot %s %s: %s", what, filename, serr); - lua_remove(L, fnameindex); - return LUA_ERRFILE; + return luaL_error(L, "LUA function errfile has been removed in ScummVM"); } diff --git a/engines/sword25/util/lua/liolib.cpp b/engines/sword25/util/lua/liolib.cpp index aa44dcafa3..f9bad30aed 100644 --- a/engines/sword25/util/lua/liolib.cpp +++ b/engines/sword25/util/lua/liolib.cpp @@ -5,7 +5,6 @@ */ -#include <errno.h> #include <stdio.h> #include <stdlib.h> #include <string.h> @@ -28,25 +27,12 @@ static const char *const fnames[] = {"input", "output"}; static int pushresult (lua_State *L, int i, const char *filename) { - int en = errno; /* calls to Lua API may change this value */ - if (i) { - lua_pushboolean(L, 1); - return 1; - } - else { - lua_pushnil(L); - if (filename) - lua_pushfstring(L, "%s: %s", filename, strerror(en)); - else - lua_pushfstring(L, "%s", strerror(en)); - lua_pushinteger(L, en); - return 3; - } + return luaL_error(L, "LUA file I/O functions have been removed in ScummVM"); } static void fileerror (lua_State *L, int arg, const char *filename) { - lua_pushfstring(L, "%s: %s", filename, strerror(errno)); + lua_pushfstring(L, "%s: %s", filename, "LUA I/O error descriptions have been removed in ScummVM"); luaL_argerror(L, arg, lua_tostring(L, -1)); } @@ -392,7 +378,7 @@ static int io_readline (lua_State *L) { luaL_error(L, "file is already closed"); sucess = read_line(L, f); if (ferror(f)) - return luaL_error(L, "%s", strerror(errno)); + return luaL_error(L, "%s", "LUA I/O error descriptions have been removed in ScummVM"); if (sucess) return 1; else { /* EOF */ if (lua_toboolean(L, lua_upvalueindex(2))) { /* generator created file? */ diff --git a/engines/sword25/util/lua/llex.cpp b/engines/sword25/util/lua/llex.cpp index fdde2b8e5f..87eafea45a 100644 --- a/engines/sword25/util/lua/llex.cpp +++ b/engines/sword25/util/lua/llex.cpp @@ -6,7 +6,6 @@ #include <ctype.h> -#include <locale.h> #include <string.h> #define llex_c @@ -176,9 +175,11 @@ static void buffreplace (LexState *ls, char from, char to) { static void trydecpoint (LexState *ls, SemInfo *seminfo) { /* format error: try to update decimal point separator */ - struct lconv *cv = localeconv(); + // Non-portable call to update the decimal point separator. + // It has been simplified in ScummVM to not use any system locale + // information, as it's not used in sword25. char old = ls->decpoint; - ls->decpoint = (cv ? cv->decimal_point[0] : '.'); + ls->decpoint = '.'; buffreplace(ls, old, ls->decpoint); /* try updated decimal separator */ if (!luaO_str2d(luaZ_buffer(ls->buff), &seminfo->r)) { /* format error with correct decimal point: no more options */ diff --git a/engines/sword25/util/lua/loslib.cpp b/engines/sword25/util/lua/loslib.cpp index 035925ceb5..578a7cb09a 100644 --- a/engines/sword25/util/lua/loslib.cpp +++ b/engines/sword25/util/lua/loslib.cpp @@ -5,8 +5,6 @@ */ -#include <errno.h> -#include <locale.h> #include <stdlib.h> #include <string.h> #include <time.h> @@ -20,21 +18,6 @@ #include "lualib.h" -static int os_pushresult (lua_State *L, int i, const char *filename) { - int en = errno; /* calls to Lua API may change this value */ - if (i) { - lua_pushboolean(L, 1); - return 1; - } - else { - lua_pushnil(L); - lua_pushfstring(L, "%s: %s", filename, strerror(en)); - lua_pushinteger(L, en); - return 3; - } -} - - static int os_execute (lua_State *L) { lua_pushinteger(L, system(luaL_optstring(L, 1, NULL))); return 1; @@ -42,15 +25,18 @@ static int os_execute (lua_State *L) { static int os_remove (lua_State *L) { - const char *filename = luaL_checkstring(L, 1); - return os_pushresult(L, remove(filename) == 0, filename); + // Non-portable call that deletes a file. Removed in ScummVM. + // This call is invoked in sword25 when loading games in order to remove the + // temporary savegame thumbnail that the original engine code created. We + // embed the thumbnail in the savegame instead, so this call is not needed at + // all. + return 1; } static int os_rename (lua_State *L) { - const char *fromname = luaL_checkstring(L, 1); - const char *toname = luaL_checkstring(L, 2); - return os_pushresult(L, rename(fromname, toname) == 0, fromname); + // Removed in ScummVM, does nothing. + return 1; } @@ -196,13 +182,8 @@ static int os_difftime (lua_State *L) { static int os_setlocale (lua_State *L) { - static const int cat[] = {LC_ALL, LC_COLLATE, LC_CTYPE, LC_MONETARY, - LC_NUMERIC, LC_TIME}; - static const char *const catnames[] = {"all", "collate", "ctype", "monetary", - "numeric", "time", NULL}; - const char *l = luaL_optstring(L, 1, NULL); - int op = luaL_checkoption(L, 2, "all", catnames); - lua_pushstring(L, setlocale(cat[op], l)); + // Non-portable call to set the numeric locale. Removed in ScummVM, as it's + // not used in sword25. return 1; } diff --git a/engines/sword25/util/lua/luaconf.h b/engines/sword25/util/lua/luaconf.h index 669b0e7a49..29411d5af1 100644 --- a/engines/sword25/util/lua/luaconf.h +++ b/engines/sword25/util/lua/luaconf.h @@ -18,6 +18,14 @@ ** =================================================================== */ +#if defined(__ANDROID__) +/* Android is missing strcoll(). +** For more information, refer to: +** http://www.damonkohler.com/2008/12/lua-on-android.html +*/ +#define strcoll strcmp +#endif + /* @@ LUA_ANSI controls the use of non-ansi features. @@ -183,7 +191,11 @@ #define LUAI_DATA /* empty */ #elif defined(__GNUC__) && ((__GNUC__*100 + __GNUC_MINOR__) >= 302) && \ - defined(__ELF__) + defined(__ELF__) && !defined(__PLAYSTATION2__) +/* +** The PS2 gcc compiler doesn't like the visibility attribute, so +** we use the normal "extern" definitions in the block below +*/ #define LUAI_FUNC __attribute__((visibility("hidden"))) extern #define LUAI_DATA LUAI_FUNC @@ -634,33 +646,6 @@ union luai_Cast { double l_d; long l_l; }; /* -@@ lua_tmpnam is the function that the OS library uses to create a -@* temporary name. -@@ LUA_TMPNAMBUFSIZE is the maximum size of a name created by lua_tmpnam. -** CHANGE them if you have an alternative to tmpnam (which is considered -** insecure) or if you want the original tmpnam anyway. By default, Lua -** uses tmpnam except when POSIX is available, where it uses mkstemp. -*/ -#if defined(loslib_c) || defined(luaall_c) - -#if defined(LUA_USE_MKSTEMP) -#include <unistd.h> -#define LUA_TMPNAMBUFSIZE 32 -#define lua_tmpnam(b,e) { \ - strcpy(b, "/tmp/lua_XXXXXX"); \ - e = mkstemp(b); \ - if (e != -1) close(e); \ - e = (e == -1); } - -#else -#define LUA_TMPNAMBUFSIZE L_tmpnam -#define lua_tmpnam(b,e) { e = (tmpnam(b) == NULL); } -#endif - -#endif - - -/* @@ lua_popen spawns a new process connected to the current one through @* the file streams. ** CHANGE it if you have a way to implement it in your system. diff --git a/engines/teenagent/actor.cpp b/engines/teenagent/actor.cpp index 9dd30f43c3..717c022c38 100644 --- a/engines/teenagent/actor.cpp +++ b/engines/teenagent/actor.cpp @@ -17,9 +17,6 @@ * 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. - * - * $URL$ - * $Id$ */ #include "teenagent/actor.h" @@ -34,10 +31,9 @@ namespace TeenAgent { Actor::Actor() : head_index(0), idle_type(0) {} //idle animation lists at dseg: 0x6540 -Common::Rect Actor::renderIdle(Graphics::Surface *surface, const Common::Point &position, uint8 orientation, int delta_frame, uint zoom) { - static Common::RandomSource random; +Common::Rect Actor::renderIdle(Graphics::Surface *surface, const Common::Point &position, uint8 orientation, int delta_frame, uint zoom, Common::RandomSource &rnd) { if (index == 0) { - idle_type = random.getRandomNumber(2); + idle_type = rnd.getRandomNumber(2); debug(0, "switched to idle animation %u", idle_type); } @@ -47,7 +43,7 @@ Common::Rect Actor::renderIdle(Graphics::Surface *surface, const Common::Point & frames_idle = res->dseg.ptr(res->dseg.get_word(0x6540 + idle_type * 2)) + index; index += delta_frame; if (*frames_idle == 0) { - idle_type = random.getRandomNumber(2); + idle_type = rnd.getRandomNumber(2); debug(0, "switched to idle animation %u[loop]", idle_type); index = 3; //put 4th frame (base 1) if idle animation loops } diff --git a/engines/teenagent/actor.h b/engines/teenagent/actor.h index 1afe2c3d33..9a7d395547 100644 --- a/engines/teenagent/actor.h +++ b/engines/teenagent/actor.h @@ -17,14 +17,15 @@ * 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. - * - * $URL$ - * $Id$ */ #include "teenagent/animation.h" #include "common/rect.h" +namespace Common { +class RandomSource; +} + namespace TeenAgent { class Actor : public Animation { @@ -33,7 +34,7 @@ class Actor : public Animation { public: Actor(); Common::Rect render(Graphics::Surface *surface, const Common::Point &position, uint8 orientation, int delta_frame, bool head, uint zoom); - Common::Rect renderIdle(Graphics::Surface *surface, const Common::Point &position, uint8 orientation, int delta_frame, uint zoom); + Common::Rect renderIdle(Graphics::Surface *surface, const Common::Point &position, uint8 orientation, int delta_frame, uint zoom, Common::RandomSource &rnd); }; } // End of namespace TeenAgent diff --git a/engines/teenagent/animation.cpp b/engines/teenagent/animation.cpp index 623966f265..af54bca6a4 100644 --- a/engines/teenagent/animation.cpp +++ b/engines/teenagent/animation.cpp @@ -17,9 +17,6 @@ * 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. - * - * $URL$ - * $Id$ */ #include "teenagent/animation.h" diff --git a/engines/teenagent/animation.h b/engines/teenagent/animation.h index 31c3fa7eaf..e98bb42ea0 100644 --- a/engines/teenagent/animation.h +++ b/engines/teenagent/animation.h @@ -17,9 +17,6 @@ * 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. - * - * $URL$ - * $Id$ */ #ifndef TEENAGENT_ANIMATION_H diff --git a/engines/teenagent/callbacks.cpp b/engines/teenagent/callbacks.cpp index f4be917eac..ae498478a4 100644 --- a/engines/teenagent/callbacks.cpp +++ b/engines/teenagent/callbacks.cpp @@ -17,9 +17,6 @@ * 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. - * - * $URL$ - * $Id$ */ #include "teenagent/scene.h" @@ -39,7 +36,7 @@ namespace TeenAgent { void TeenAgentEngine::rejectMessage() { Resources * res = Resources::instance(); //random reject message: - uint i = random.getRandomNumber(3); + uint i = _rnd.getRandomNumber(3); //debug(0, "reject message: %s", (const char *)res->dseg.ptr(res->dseg.get_word(0x339e + 2 * i))); displayMessage(res->dseg.get_word(0x339e + 2 * i)); } @@ -3007,7 +3004,7 @@ bool TeenAgentEngine::processCallback(uint16 addr) { moveTo(153, 163, 4); playActorAnimation(973); if (CHECK_FLAG(0xDBC1, 0)) { - SET_FLAG(0xDBC1, random.getRandomNumber(5) + 1); + SET_FLAG(0xDBC1, _rnd.getRandomNumber(5) + 1); } loadScene(30, 18, 159, 2); return true; diff --git a/engines/teenagent/console.cpp b/engines/teenagent/console.cpp index 60f7854f09..2f4d7cc9c3 100644 --- a/engines/teenagent/console.cpp +++ b/engines/teenagent/console.cpp @@ -17,9 +17,6 @@ * 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. - * - * $URL$ - * $Id$ */ #include "teenagent/console.h" diff --git a/engines/teenagent/console.h b/engines/teenagent/console.h index d6c24d4d8f..ab2f068520 100644 --- a/engines/teenagent/console.h +++ b/engines/teenagent/console.h @@ -17,9 +17,6 @@ * 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. - * - * $URL$ - * $Id$ */ #ifndef TEENAGENT_CONSOLE_H diff --git a/engines/teenagent/detection.cpp b/engines/teenagent/detection.cpp index d741039e8d..4784e2fb7e 100644 --- a/engines/teenagent/detection.cpp +++ b/engines/teenagent/detection.cpp @@ -17,9 +17,6 @@ * 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. - * - * $URL$ - * $Id$ */ #include "common/system.h" @@ -116,7 +113,7 @@ public: } virtual const char *getName() const { - return "Teen Agent Engine"; + return "Teen Agent"; } virtual const char *getOriginalCopyright() const { diff --git a/engines/teenagent/dialog.cpp b/engines/teenagent/dialog.cpp index 2479da42a1..400bd7cec2 100644 --- a/engines/teenagent/dialog.cpp +++ b/engines/teenagent/dialog.cpp @@ -17,9 +17,6 @@ * 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. - * - * $URL$ - * $Id$ */ #include "teenagent/dialog.h" diff --git a/engines/teenagent/dialog.h b/engines/teenagent/dialog.h index 51597db6d9..3bb7d818c1 100644 --- a/engines/teenagent/dialog.h +++ b/engines/teenagent/dialog.h @@ -17,9 +17,6 @@ * 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. - * - * $URL$ - * $Id$ */ #ifndef TEENAGENT_DIALOG_H diff --git a/engines/teenagent/font.cpp b/engines/teenagent/font.cpp index 2d98ae9de7..f7558b60f2 100644 --- a/engines/teenagent/font.cpp +++ b/engines/teenagent/font.cpp @@ -17,9 +17,6 @@ * 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. - * - * $URL$ - * $Id$ */ #include "teenagent/font.h" diff --git a/engines/teenagent/font.h b/engines/teenagent/font.h index 29a8121435..773edaf4e2 100644 --- a/engines/teenagent/font.h +++ b/engines/teenagent/font.h @@ -17,9 +17,6 @@ * 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. - * - * $URL$ - * $Id$ */ #ifndef TEENAGENT_FONT_H diff --git a/engines/teenagent/inventory.cpp b/engines/teenagent/inventory.cpp index 4d18d68502..0f9766d2ca 100644 --- a/engines/teenagent/inventory.cpp +++ b/engines/teenagent/inventory.cpp @@ -17,9 +17,6 @@ * 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. - * - * $URL$ - * $Id$ */ #include "common/memstream.h" diff --git a/engines/teenagent/inventory.h b/engines/teenagent/inventory.h index ad73ff25a9..23a2e8daaa 100644 --- a/engines/teenagent/inventory.h +++ b/engines/teenagent/inventory.h @@ -17,9 +17,6 @@ * 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. - * - * $URL$ - * $Id$ */ #ifndef TEENAGENT_INVENTORY_H diff --git a/engines/teenagent/music.cpp b/engines/teenagent/music.cpp index f0be5165f6..0f70f4b082 100644 --- a/engines/teenagent/music.cpp +++ b/engines/teenagent/music.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "teenagent/music.h" diff --git a/engines/teenagent/music.h b/engines/teenagent/music.h index 52a347bf10..bf36ac7057 100644 --- a/engines/teenagent/music.h +++ b/engines/teenagent/music.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef TEEN_MUSIC_H diff --git a/engines/teenagent/objects.cpp b/engines/teenagent/objects.cpp index e6442d3809..74e3a4944d 100644 --- a/engines/teenagent/objects.cpp +++ b/engines/teenagent/objects.cpp @@ -17,9 +17,6 @@ * 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. - * - * $URL$ - * $Id$ */ #include "common/debug.h" diff --git a/engines/teenagent/objects.h b/engines/teenagent/objects.h index 59e9d732fc..d1e4388a15 100644 --- a/engines/teenagent/objects.h +++ b/engines/teenagent/objects.h @@ -17,9 +17,6 @@ * 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. - * - * $URL$ - * $Id$ */ diff --git a/engines/teenagent/pack.cpp b/engines/teenagent/pack.cpp index 8584e05807..aada922f7d 100644 --- a/engines/teenagent/pack.cpp +++ b/engines/teenagent/pack.cpp @@ -17,9 +17,6 @@ * 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. - * - * $URL$ - * $Id$ */ #include "teenagent/pack.h" diff --git a/engines/teenagent/pack.h b/engines/teenagent/pack.h index a24091e153..09168676e2 100644 --- a/engines/teenagent/pack.h +++ b/engines/teenagent/pack.h @@ -17,9 +17,6 @@ * 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. - * - * $URL$ - * $Id$ */ diff --git a/engines/teenagent/resources.cpp b/engines/teenagent/resources.cpp index 69908239ab..9e69383215 100644 --- a/engines/teenagent/resources.cpp +++ b/engines/teenagent/resources.cpp @@ -17,9 +17,6 @@ * 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. - * - * $URL$ - * $Id$ */ #include "teenagent/resources.h" diff --git a/engines/teenagent/resources.h b/engines/teenagent/resources.h index d49602c3c5..c2eb32dbd4 100644 --- a/engines/teenagent/resources.h +++ b/engines/teenagent/resources.h @@ -17,9 +17,6 @@ * 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. - * - * $URL$ - * $Id$ */ #ifndef TEENAGENT_RESOURCES_H diff --git a/engines/teenagent/scene.cpp b/engines/teenagent/scene.cpp index ee431b2ab5..ef18b95f5a 100644 --- a/engines/teenagent/scene.cpp +++ b/engines/teenagent/scene.cpp @@ -17,9 +17,6 @@ * 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. - * - * $URL$ - * $Id$ */ #include "common/config-manager.h" @@ -807,7 +804,7 @@ bool Scene::render(bool tick_game, bool tick_mark, uint32 delta) { if (_idle_timer < 50) actor_animation_position = teenagent.render(surface, position, orientation, 0, actor_talking, zoom); else - actor_animation_position = teenagent_idle.renderIdle(surface, position, orientation, mark_delta, zoom); + actor_animation_position = teenagent_idle.renderIdle(surface, position, orientation, mark_delta, zoom, _engine->_rnd); } } diff --git a/engines/teenagent/scene.h b/engines/teenagent/scene.h index 28def3a064..bc101847fa 100644 --- a/engines/teenagent/scene.h +++ b/engines/teenagent/scene.h @@ -17,9 +17,6 @@ * 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. - * - * $URL$ - * $Id$ */ #ifndef TEENAGENT_SCENE_H diff --git a/engines/teenagent/segment.cpp b/engines/teenagent/segment.cpp index 829c84765d..cb17190da7 100644 --- a/engines/teenagent/segment.cpp +++ b/engines/teenagent/segment.cpp @@ -17,9 +17,6 @@ * 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. - * - * $URL$ - * $Id$ */ #include "teenagent/segment.h" diff --git a/engines/teenagent/segment.h b/engines/teenagent/segment.h index 98bd9ca0c9..303198b071 100644 --- a/engines/teenagent/segment.h +++ b/engines/teenagent/segment.h @@ -17,9 +17,6 @@ * 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. - * - * $URL$ - * $Id$ */ #ifndef TEENAGENT_SEGMENT_H diff --git a/engines/teenagent/surface.cpp b/engines/teenagent/surface.cpp index 545b0f75f0..2e23c7a8ed 100644 --- a/engines/teenagent/surface.cpp +++ b/engines/teenagent/surface.cpp @@ -17,9 +17,6 @@ * 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. - * - * $URL$ - * $Id$ */ #include "teenagent/surface.h" diff --git a/engines/teenagent/surface.h b/engines/teenagent/surface.h index 82c13c84bd..5f74176c68 100644 --- a/engines/teenagent/surface.h +++ b/engines/teenagent/surface.h @@ -17,9 +17,6 @@ * 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. - * - * $URL$ - * $Id$ */ #ifndef TEENAGENT_SURFACE_H diff --git a/engines/teenagent/surface_list.cpp b/engines/teenagent/surface_list.cpp index 972c7a4186..e98153a935 100644 --- a/engines/teenagent/surface_list.cpp +++ b/engines/teenagent/surface_list.cpp @@ -17,9 +17,6 @@ * 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. - * - * $URL$ - * $Id$ */ #include "teenagent/surface.h" diff --git a/engines/teenagent/surface_list.h b/engines/teenagent/surface_list.h index 23e0ff423a..d949a722d6 100644 --- a/engines/teenagent/surface_list.h +++ b/engines/teenagent/surface_list.h @@ -17,9 +17,6 @@ * 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. - * - * $URL$ - * $Id$ */ #ifndef TEENAGENT_SURFACE_LIST_H__ diff --git a/engines/teenagent/teenagent.cpp b/engines/teenagent/teenagent.cpp index ec1e945f8d..f076dbc0a1 100644 --- a/engines/teenagent/teenagent.cpp +++ b/engines/teenagent/teenagent.cpp @@ -17,9 +17,6 @@ * 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. - * - * $URL$ - * $Id$ */ #include "common/config-manager.h" @@ -50,7 +47,9 @@ namespace TeenAgent { -TeenAgentEngine::TeenAgentEngine(OSystem *system, const ADGameDescription *gd) : Engine(system), action(kActionNone), _gameDescription(gd) { +TeenAgentEngine::TeenAgentEngine(OSystem *system, const ADGameDescription *gd) + : Engine(system), action(kActionNone), _gameDescription(gd), + _rnd("teenagent") { music = new MusicPlayer(); console = 0; @@ -399,8 +398,8 @@ bool TeenAgentEngine::showMetropolis() { //generate colors matrix memmove(colors + 320, colors + 480, 8480); for(uint c = 0; c < 17; ++c) { - byte x = (random.getRandomNumber(184) + 5) & 0xff; - uint offset = 8800 + random.getRandomNumber(158); + byte x = (_rnd.getRandomNumber(184) + 5) & 0xff; + uint offset = 8800 + _rnd.getRandomNumber(158); colors[offset++] = x; colors[offset++] = x; } diff --git a/engines/teenagent/teenagent.h b/engines/teenagent/teenagent.h index a43ee68f56..bc802da8bc 100644 --- a/engines/teenagent/teenagent.h +++ b/engines/teenagent/teenagent.h @@ -17,9 +17,6 @@ * 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. - * - * $URL$ - * $Id$ */ #ifndef TEENAGENT_ENGINE_H @@ -50,7 +47,7 @@ class Scene; class MusicPlayer; class Console; -class TeenAgentEngine: public Engine { +class TeenAgentEngine : public Engine { public: enum Action { kActionNone, kActionExamine, kActionUse }; @@ -120,7 +117,7 @@ public: void fadeOut(); void wait(uint16 frames); - Common::RandomSource random; + Common::RandomSource _rnd; Scene *scene; Inventory *inventory; diff --git a/engines/testbed/config-params.cpp b/engines/testbed/config-params.cpp index c9f3932539..9a5062185b 100644 --- a/engines/testbed/config-params.cpp +++ b/engines/testbed/config-params.cpp @@ -17,9 +17,6 @@ * 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. - * - * $URL$ - * $Id$ */ #include "common/config-manager.h" diff --git a/engines/testbed/config-params.h b/engines/testbed/config-params.h index 7a0e1cf5f2..e982f62c72 100644 --- a/engines/testbed/config-params.h +++ b/engines/testbed/config-params.h @@ -17,9 +17,6 @@ * 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. - * - * $URL$ - * $Id$ */ #ifndef TESTBED_CONFIG_PARAMS_H diff --git a/engines/testbed/config.cpp b/engines/testbed/config.cpp index 4f871db8d2..6adf82952f 100644 --- a/engines/testbed/config.cpp +++ b/engines/testbed/config.cpp @@ -17,9 +17,6 @@ * 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. - * - * $URL$ - * $Id$ */ #include "common/stream.h" diff --git a/engines/testbed/config.h b/engines/testbed/config.h index cf1948b412..c0df65ad32 100644 --- a/engines/testbed/config.h +++ b/engines/testbed/config.h @@ -17,9 +17,6 @@ * 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. - * - * $URL$ - * $Id$ */ #ifndef TESTBED_CONFIG_H diff --git a/engines/testbed/detection.cpp b/engines/testbed/detection.cpp index b08cca291a..91518b2b8e 100644 --- a/engines/testbed/detection.cpp +++ b/engines/testbed/detection.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "engines/advancedDetector.h" diff --git a/engines/testbed/events.cpp b/engines/testbed/events.cpp index 37b0a7ead4..78de87e133 100644 --- a/engines/testbed/events.cpp +++ b/engines/testbed/events.cpp @@ -17,9 +17,6 @@ * 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. - * - * $URL$ - * $Id$ */ #include "common/events.h" diff --git a/engines/testbed/events.h b/engines/testbed/events.h index 607bba79d5..00a659bd33 100644 --- a/engines/testbed/events.h +++ b/engines/testbed/events.h @@ -17,9 +17,6 @@ * 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. - * - * $URL$ - * $Id$ */ #ifndef TESTBED_EVENTS_H diff --git a/engines/testbed/fs.cpp b/engines/testbed/fs.cpp index f951224910..e2bedb1898 100644 --- a/engines/testbed/fs.cpp +++ b/engines/testbed/fs.cpp @@ -17,9 +17,6 @@ * 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. - * - * $URL$ - * $Id$ */ #include "common/config-manager.h" diff --git a/engines/testbed/fs.h b/engines/testbed/fs.h index c51d898c9d..1cb7b3a871 100644 --- a/engines/testbed/fs.h +++ b/engines/testbed/fs.h @@ -17,9 +17,6 @@ * 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. - * - * $URL$ - * $Id$ */ #ifndef TESTBED_FS_H diff --git a/engines/testbed/graphics.cpp b/engines/testbed/graphics.cpp index c8558e30f4..b38b83f222 100644 --- a/engines/testbed/graphics.cpp +++ b/engines/testbed/graphics.cpp @@ -17,9 +17,6 @@ * 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. - * - * $URL$ - * $Id$ */ #include "common/events.h" diff --git a/engines/testbed/graphics.h b/engines/testbed/graphics.h index a4e698b44c..7fa8f9d708 100644 --- a/engines/testbed/graphics.h +++ b/engines/testbed/graphics.h @@ -17,9 +17,6 @@ * 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. - * - * $URL$ - * $Id$ */ #ifndef TESTBED_GRAPHICS_H diff --git a/engines/testbed/midi.cpp b/engines/testbed/midi.cpp index 7ec24aa670..54be866b4c 100644 --- a/engines/testbed/midi.cpp +++ b/engines/testbed/midi.cpp @@ -17,9 +17,6 @@ * 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. - * - * $URL$ - * $Id$ */ #include "common/archive.h" diff --git a/engines/testbed/midi.h b/engines/testbed/midi.h index 676229570e..02550a6eb2 100644 --- a/engines/testbed/midi.h +++ b/engines/testbed/midi.h @@ -17,9 +17,6 @@ * 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. - * - * $URL$ - * $Id$ */ #ifndef TESTBED_MIDI_H diff --git a/engines/testbed/misc.cpp b/engines/testbed/misc.cpp index 36687f570e..35b3c6bfe2 100644 --- a/engines/testbed/misc.cpp +++ b/engines/testbed/misc.cpp @@ -17,9 +17,6 @@ * 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. - * - * $URL$ - * $Id$ */ #include "testbed/misc.h" diff --git a/engines/testbed/misc.h b/engines/testbed/misc.h index 395955c7fe..415fe82903 100644 --- a/engines/testbed/misc.h +++ b/engines/testbed/misc.h @@ -17,9 +17,6 @@ * 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. - * - * $URL$ - * $Id$ */ #ifndef TESTBED_MISC_H diff --git a/engines/testbed/savegame.cpp b/engines/testbed/savegame.cpp index 0ffd3672fa..b19c8e3872 100644 --- a/engines/testbed/savegame.cpp +++ b/engines/testbed/savegame.cpp @@ -17,9 +17,6 @@ * 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. - * - * $URL$ - * $Id$ */ #include "common/savefile.h" diff --git a/engines/testbed/savegame.h b/engines/testbed/savegame.h index dc41ff9b65..2c9ec83470 100644 --- a/engines/testbed/savegame.h +++ b/engines/testbed/savegame.h @@ -17,9 +17,6 @@ * 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. - * - * $URL$ - * $Id$ */ #ifndef TESTBED_SAVEGAME_H diff --git a/engines/testbed/sound.cpp b/engines/testbed/sound.cpp index dca116368e..bb7ae2c055 100644 --- a/engines/testbed/sound.cpp +++ b/engines/testbed/sound.cpp @@ -17,9 +17,6 @@ * 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. - * - * $URL$ - * $Id$ */ #include "audio/softsynth/pcspk.h" diff --git a/engines/testbed/sound.h b/engines/testbed/sound.h index b797ecb2b0..76d0c7bb61 100644 --- a/engines/testbed/sound.h +++ b/engines/testbed/sound.h @@ -17,9 +17,6 @@ * 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. - * - * $URL$ - * $Id$ */ #ifndef TESTBED_SOUND_H diff --git a/engines/testbed/template.h b/engines/testbed/template.h index 849d157a03..847777f34b 100644 --- a/engines/testbed/template.h +++ b/engines/testbed/template.h @@ -17,9 +17,6 @@ * 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. - * - * $URL$ - * $Id$ */ #ifndef TESTBED_TEMPLATE_H diff --git a/engines/testbed/testbed.cpp b/engines/testbed/testbed.cpp index 179be2bb8b..41a705e292 100644 --- a/engines/testbed/testbed.cpp +++ b/engines/testbed/testbed.cpp @@ -17,9 +17,6 @@ * 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. - * - * $URL$ - * $Id$ */ #include "common/debug-channels.h" diff --git a/engines/testbed/testbed.h b/engines/testbed/testbed.h index ca803a4cec..6933efa0f0 100644 --- a/engines/testbed/testbed.h +++ b/engines/testbed/testbed.h @@ -17,9 +17,6 @@ * 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. - * - * $URL$ - * $Id$ */ #ifndef TESTBED_H diff --git a/engines/testbed/testsuite.cpp b/engines/testbed/testsuite.cpp index fa8764e869..77211b3e64 100644 --- a/engines/testbed/testsuite.cpp +++ b/engines/testbed/testsuite.cpp @@ -17,9 +17,6 @@ * 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. - * - * $URL$ - * $Id$ */ #include "common/config-manager.h" diff --git a/engines/testbed/testsuite.h b/engines/testbed/testsuite.h index 94b3d70fd4..3a3a78b9bb 100644 --- a/engines/testbed/testsuite.h +++ b/engines/testbed/testsuite.h @@ -17,9 +17,6 @@ * 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. - * - * $URL$ - * $Id$ */ #ifndef TESTBED_TESTSUITE_H diff --git a/engines/tinsel/actors.cpp b/engines/tinsel/actors.cpp index 9ec253e512..9caa12d320 100644 --- a/engines/tinsel/actors.cpp +++ b/engines/tinsel/actors.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * * Handles things to do with actors, delegates much moving actor stuff. */ diff --git a/engines/tinsel/actors.h b/engines/tinsel/actors.h index 2be42b00e6..e707db77ba 100644 --- a/engines/tinsel/actors.h +++ b/engines/tinsel/actors.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * * Prototypes of actor functions */ diff --git a/engines/tinsel/adpcm.cpp b/engines/tinsel/adpcm.cpp index 530395d754..4ea835586b 100644 --- a/engines/tinsel/adpcm.cpp +++ b/engines/tinsel/adpcm.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/stream.h" diff --git a/engines/tinsel/adpcm.h b/engines/tinsel/adpcm.h index 79d537eef6..3e899d94c3 100644 --- a/engines/tinsel/adpcm.h +++ b/engines/tinsel/adpcm.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef TINSEL_ADPCM_H diff --git a/engines/tinsel/anim.cpp b/engines/tinsel/anim.cpp index 61c8b67624..034296ccc7 100644 --- a/engines/tinsel/anim.cpp +++ b/engines/tinsel/anim.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * * This file contains utilities to handle object animation. */ diff --git a/engines/tinsel/anim.h b/engines/tinsel/anim.h index 97065f6a54..0c60cf84d4 100644 --- a/engines/tinsel/anim.h +++ b/engines/tinsel/anim.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * * Object animation definitions */ diff --git a/engines/tinsel/background.cpp b/engines/tinsel/background.cpp index dfff093c09..5e2ebaafdc 100644 --- a/engines/tinsel/background.cpp +++ b/engines/tinsel/background.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * * Background handling code. */ @@ -152,7 +149,7 @@ int PlayfieldGetCenterX(int which) { * @param which Which playfield */ -OBJECT *GetPlayfieldList(int which) { +OBJECT **GetPlayfieldList(int which) { PLAYFIELD *pPlayfield; // pointer to relavent playfield // make sure there is a background @@ -165,7 +162,7 @@ OBJECT *GetPlayfieldList(int which) { pPlayfield = pCurBgnd->fieldArray + which; // return the display list pointer for this playfield - return (OBJECT *)&pPlayfield->pDispList; + return &pPlayfield->pDispList; } /** @@ -205,10 +202,10 @@ void DrawBackgnd() { pPlay->bMoved = true; // sort the display list for this background - just in case somebody has changed object Z positions - SortObjectList((OBJECT *)&pPlay->pDispList); + SortObjectList(&pPlay->pDispList); // generate clipping rects for all objects that have moved etc. - FindMovingObjects((OBJECT *)&pPlay->pDispList, &ptWin, + FindMovingObjects(&pPlay->pDispList, &ptWin, &pPlay->rcClip, false, pPlay->bMoved); // clear playfield moved flag @@ -235,8 +232,7 @@ void DrawBackgnd() { if (IntersectRectangle(rcPlayClip, pPlay->rcClip, *r)) // redraw all objects within this clipping rect - UpdateClipRect((OBJECT *)&pPlay->pDispList, - &ptWin, &rcPlayClip); + UpdateClipRect(&pPlay->pDispList, &ptWin, &rcPlayClip); } } diff --git a/engines/tinsel/background.h b/engines/tinsel/background.h index 06789e50bf..37ab4d4d5c 100644 --- a/engines/tinsel/background.h +++ b/engines/tinsel/background.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * * Data structures used for handling backgrounds */ @@ -96,7 +93,7 @@ void PlayfieldGetPos( // Returns the xy position of the specified playfield in int PlayfieldGetCenterX( // Returns the xy position of the specified playfield in the current background int which); // which playfield -OBJECT *GetPlayfieldList( // Returns the display list for the specified playfield +OBJECT **GetPlayfieldList( // Returns the display list for the specified playfield int which); // which playfield void KillPlayfieldList( // Kills all the objects on the display list for the specified playfield diff --git a/engines/tinsel/bg.cpp b/engines/tinsel/bg.cpp index 0e67c3a06e..e5618afc5c 100644 --- a/engines/tinsel/bg.cpp +++ b/engines/tinsel/bg.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * * Plays the background film of a scene. */ diff --git a/engines/tinsel/bmv.cpp b/engines/tinsel/bmv.cpp index 793febdc21..db56c5bbba 100644 --- a/engines/tinsel/bmv.cpp +++ b/engines/tinsel/bmv.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * * The movie player. */ diff --git a/engines/tinsel/bmv.h b/engines/tinsel/bmv.h index d90d68fc13..02ba6d100f 100644 --- a/engines/tinsel/bmv.h +++ b/engines/tinsel/bmv.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * * Plays films within a scene, takes into account the actor in each 'column'. */ diff --git a/engines/tinsel/cliprect.cpp b/engines/tinsel/cliprect.cpp index 5f287d3eab..f8d8011b12 100644 --- a/engines/tinsel/cliprect.cpp +++ b/engines/tinsel/cliprect.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * * This file contains the clipping rectangle code. */ @@ -108,10 +105,10 @@ static bool LooseIntersectRectangle(const Common::Rect &pSrc1, const Common::Rec * @param bNoVelocity When reset, objects pos is updated with velocity * @param bScrolled) When set, playfield has scrolled */ -void FindMovingObjects(OBJECT *pObjList, Common::Point *pWin, Common::Rect *pClip, bool bNoVelocity, bool bScrolled) { +void FindMovingObjects(OBJECT **pObjList, Common::Point *pWin, Common::Rect *pClip, bool bNoVelocity, bool bScrolled) { OBJECT *pObj; // object list traversal pointer - for (pObj = pObjList->pNext; pObj != NULL; pObj = pObj->pNext) { + for (pObj = *pObjList; pObj != NULL; pObj = pObj->pNext) { if (!bNoVelocity) { // we want to add velocities to objects position @@ -206,7 +203,7 @@ void MergeClipRect() { * @param pWin Window top left position * @param pClip Pointer to clip rectangle */ -void UpdateClipRect(OBJECT *pObjList, Common::Point *pWin, Common::Rect *pClip) { +void UpdateClipRect(OBJECT **pObjList, Common::Point *pWin, Common::Rect *pClip) { int x, y, right, bottom; // object corners int hclip, vclip; // total size of object clipping DRAWOBJECT currentObj; // filled in to draw the current object in list @@ -215,7 +212,7 @@ void UpdateClipRect(OBJECT *pObjList, Common::Point *pWin, Common::Rect *pClip) // Initialise the fields of the drawing object to empty memset(¤tObj, 0, sizeof(DRAWOBJECT)); - for (pObj = pObjList->pNext; pObj != NULL; pObj = pObj->pNext) { + for (pObj = *pObjList; pObj != NULL; pObj = pObj->pNext) { if (pObj->flags & DMA_ABS) { // object position is absolute x = fracToInt(pObj->xPos); diff --git a/engines/tinsel/cliprect.h b/engines/tinsel/cliprect.h index 7bbb6bdc25..101289b837 100644 --- a/engines/tinsel/cliprect.h +++ b/engines/tinsel/cliprect.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * * Clipping rectangle defines */ @@ -58,7 +55,7 @@ bool UnionRectangle( // Creates the union of two rectangles const Common::Rect &pSrc2); // a source rectangle void FindMovingObjects( // Creates clipping rectangles for all the objects that have moved on the specified object list - OBJECT *pObjList, // playfield display list to draw + OBJECT **pObjList, // playfield display list to draw Common::Point *pWin, // playfield window top left position Common::Rect *pClip, // playfield clipping rectangle bool bVelocity, // when set, objects pos is updated with velocity @@ -67,7 +64,7 @@ void FindMovingObjects( // Creates clipping rectangles for all the objects that void MergeClipRect(); // Merges any clipping rectangles that overlap void UpdateClipRect( // Redraws all objects within this clipping rectangle - OBJECT *pObjList, // object list to draw + OBJECT **pObjList, // object list to draw Common::Point *pWin, // window top left position Common::Rect *pClip); // pointer to clip rectangle diff --git a/engines/tinsel/config.cpp b/engines/tinsel/config.cpp index a206ebf03b..fd278db972 100644 --- a/engines/tinsel/config.cpp +++ b/engines/tinsel/config.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * * This file contains configuration functionality */ diff --git a/engines/tinsel/config.h b/engines/tinsel/config.h index dcfaf47b0c..8b6b675766 100644 --- a/engines/tinsel/config.h +++ b/engines/tinsel/config.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef TINSEL_CONFIG_H diff --git a/engines/tinsel/coroutine.cpp b/engines/tinsel/coroutine.cpp index b568cb4a46..998d98b52a 100644 --- a/engines/tinsel/coroutine.cpp +++ b/engines/tinsel/coroutine.cpp @@ -17,9 +17,6 @@ * 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. - * - * $URL$ - * $Id$ */ #include "tinsel/coroutine.h" diff --git a/engines/tinsel/coroutine.h b/engines/tinsel/coroutine.h index b14030c708..b62c40b4e5 100644 --- a/engines/tinsel/coroutine.h +++ b/engines/tinsel/coroutine.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef TINSEL_COROUTINE_H diff --git a/engines/tinsel/cursor.cpp b/engines/tinsel/cursor.cpp index 66dc47df1f..6e04feff57 100644 --- a/engines/tinsel/cursor.cpp +++ b/engines/tinsel/cursor.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * * Cursor and cursor trails. */ diff --git a/engines/tinsel/cursor.h b/engines/tinsel/cursor.h index 71e846297c..4e32aa3a19 100644 --- a/engines/tinsel/cursor.h +++ b/engines/tinsel/cursor.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * * Clipping rectangle defines */ diff --git a/engines/tinsel/debugger.cpp b/engines/tinsel/debugger.cpp index ed877587c7..1261326032 100644 --- a/engines/tinsel/debugger.cpp +++ b/engines/tinsel/debugger.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "tinsel/tinsel.h" diff --git a/engines/tinsel/debugger.h b/engines/tinsel/debugger.h index e803f16566..ff4ccd519f 100644 --- a/engines/tinsel/debugger.h +++ b/engines/tinsel/debugger.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef TINSEL_DEBUGGER_H diff --git a/engines/tinsel/detection.cpp b/engines/tinsel/detection.cpp index 70bf398baf..27b16c5b93 100644 --- a/engines/tinsel/detection.cpp +++ b/engines/tinsel/detection.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "base/plugins.h" @@ -107,7 +104,7 @@ public: TinselMetaEngine() : AdvancedMetaEngine(detectionParams) {} virtual const char *getName() const { - return "Tinsel Engine"; + return "Tinsel"; } virtual const char *getOriginalCopyright() const { diff --git a/engines/tinsel/detection_tables.h b/engines/tinsel/detection_tables.h index 6894cd0c47..c86db9e438 100644 --- a/engines/tinsel/detection_tables.h +++ b/engines/tinsel/detection_tables.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ namespace Tinsel { diff --git a/engines/tinsel/dialogs.cpp b/engines/tinsel/dialogs.cpp index 281dd2da55..6deeab27cd 100644 --- a/engines/tinsel/dialogs.cpp +++ b/engines/tinsel/dialogs.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * * Handles the inventory and conversation windows. * * And the save/load game windows. Some of this will be platform diff --git a/engines/tinsel/dialogs.h b/engines/tinsel/dialogs.h index f81a59a0b7..8c48eb8b76 100644 --- a/engines/tinsel/dialogs.h +++ b/engines/tinsel/dialogs.h @@ -19,9 +19,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * * Inventory related functions */ diff --git a/engines/tinsel/drives.cpp b/engines/tinsel/drives.cpp index d252e45cf5..5977d3b718 100644 --- a/engines/tinsel/drives.cpp +++ b/engines/tinsel/drives.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * * CD/drive handling functions */ diff --git a/engines/tinsel/drives.h b/engines/tinsel/drives.h index 709c0d2392..907071d2f8 100644 --- a/engines/tinsel/drives.h +++ b/engines/tinsel/drives.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * * CD/drive handling functions */ diff --git a/engines/tinsel/dw.h b/engines/tinsel/dw.h index aed4c50408..21f6db946e 100644 --- a/engines/tinsel/dw.h +++ b/engines/tinsel/dw.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef TINSEL_DW_H diff --git a/engines/tinsel/effect.cpp b/engines/tinsel/effect.cpp index 95785e5840..22027b0f02 100644 --- a/engines/tinsel/effect.cpp +++ b/engines/tinsel/effect.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ // Handles effect polygons. diff --git a/engines/tinsel/events.cpp b/engines/tinsel/events.cpp index 4e61a6ef29..e701ddca99 100644 --- a/engines/tinsel/events.cpp +++ b/engines/tinsel/events.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * * Main purpose is to process user events. * Also provides a couple of utility functions. */ diff --git a/engines/tinsel/events.h b/engines/tinsel/events.h index a491f1e036..f2b4d7f663 100644 --- a/engines/tinsel/events.h +++ b/engines/tinsel/events.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * * User events processing and utility functions */ diff --git a/engines/tinsel/faders.cpp b/engines/tinsel/faders.cpp index 99a8b9ff14..86d117af81 100644 --- a/engines/tinsel/faders.cpp +++ b/engines/tinsel/faders.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * * Palette Fader and Flasher processes. */ diff --git a/engines/tinsel/faders.h b/engines/tinsel/faders.h index b30a26d893..dc0b903d7e 100644 --- a/engines/tinsel/faders.h +++ b/engines/tinsel/faders.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * * Data structures used by the fader and flasher processes */ diff --git a/engines/tinsel/film.h b/engines/tinsel/film.h index 231fbf28db..edb8dc268d 100644 --- a/engines/tinsel/film.h +++ b/engines/tinsel/film.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef TINSEL_FILM_H // prevent multiple includes diff --git a/engines/tinsel/font.cpp b/engines/tinsel/font.cpp index f57a6d5d54..e857dca509 100644 --- a/engines/tinsel/font.cpp +++ b/engines/tinsel/font.cpp @@ -17,9 +17,6 @@ * 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. - * - * $URL$ - * $Id$ */ #include "tinsel/actors.h" diff --git a/engines/tinsel/font.h b/engines/tinsel/font.h index e5f5ece201..83bc12354e 100644 --- a/engines/tinsel/font.h +++ b/engines/tinsel/font.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef TINSEL_FONT_H // prevent multiple includes diff --git a/engines/tinsel/graphics.cpp b/engines/tinsel/graphics.cpp index bdcd3207f9..6a5d626de8 100644 --- a/engines/tinsel/graphics.cpp +++ b/engines/tinsel/graphics.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * * Low level graphics interface. */ diff --git a/engines/tinsel/graphics.h b/engines/tinsel/graphics.h index de16082441..d34f069f6a 100644 --- a/engines/tinsel/graphics.h +++ b/engines/tinsel/graphics.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * * Low level graphics interface. */ diff --git a/engines/tinsel/handle.cpp b/engines/tinsel/handle.cpp index 6f5f92c969..092d282b01 100644 --- a/engines/tinsel/handle.cpp +++ b/engines/tinsel/handle.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * * This file contains the handle based Memory Manager code */ diff --git a/engines/tinsel/handle.h b/engines/tinsel/handle.h index c3c303a1e9..e681bfc131 100644 --- a/engines/tinsel/handle.h +++ b/engines/tinsel/handle.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * * Graphics Memory Manager data structures */ diff --git a/engines/tinsel/heapmem.cpp b/engines/tinsel/heapmem.cpp index e8c4ed23ee..2376583222 100644 --- a/engines/tinsel/heapmem.cpp +++ b/engines/tinsel/heapmem.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * * This file contains the handle based Memory Manager code. */ diff --git a/engines/tinsel/heapmem.h b/engines/tinsel/heapmem.h index 95cc0285f2..277463e4ef 100644 --- a/engines/tinsel/heapmem.h +++ b/engines/tinsel/heapmem.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * * This file contains the handle based Memory Manager defines */ diff --git a/engines/tinsel/mareels.cpp b/engines/tinsel/mareels.cpp index 5d9672972a..bd267a2c65 100644 --- a/engines/tinsel/mareels.cpp +++ b/engines/tinsel/mareels.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * * Functions to set up moving actors' reels. */ diff --git a/engines/tinsel/mareels.h b/engines/tinsel/mareels.h index c31ceafbf4..2ff5ca906e 100644 --- a/engines/tinsel/mareels.h +++ b/engines/tinsel/mareels.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef TINSEL_MAREELS_H // prevent multiple includes diff --git a/engines/tinsel/move.cpp b/engines/tinsel/move.cpp index 5fc555f9b0..d6b96fee7b 100644 --- a/engines/tinsel/move.cpp +++ b/engines/tinsel/move.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * * Handles walking and use of the path system. * * Contains the dodgiest code in the whole system. diff --git a/engines/tinsel/move.h b/engines/tinsel/move.h index 027a89f67e..a307e5c081 100644 --- a/engines/tinsel/move.h +++ b/engines/tinsel/move.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef TINSEL_MOVE_H // prevent multiple includes diff --git a/engines/tinsel/multiobj.cpp b/engines/tinsel/multiobj.cpp index 9a7dac5929..4a9d4b65d4 100644 --- a/engines/tinsel/multiobj.cpp +++ b/engines/tinsel/multiobj.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * * This file contains utilities to handle multi-part objects. */ @@ -93,7 +90,7 @@ OBJECT *MultiInitObject(const MULTI_INIT *pInitTbl) { */ -void MultiInsertObject(OBJECT *pObjList, OBJECT *pInsObj) { +void MultiInsertObject(OBJECT **pObjList, OBJECT *pInsObj) { // validate object pointer assert(isValidObject(pInsObj)); @@ -114,7 +111,7 @@ void MultiInsertObject(OBJECT *pObjList, OBJECT *pInsObj) { * @param pMultiObj Multi-part object to be deleted */ -void MultiDeleteObject(OBJECT *pObjList, OBJECT *pMultiObj) { +void MultiDeleteObject(OBJECT **pObjList, OBJECT *pMultiObj) { // validate object pointer assert(isValidObject(pMultiObj)); diff --git a/engines/tinsel/multiobj.h b/engines/tinsel/multiobj.h index b94d63e79f..a467fac425 100644 --- a/engines/tinsel/multiobj.h +++ b/engines/tinsel/multiobj.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * * Multi-part object definitions */ @@ -60,11 +57,11 @@ OBJECT *MultiInitObject( // Initialise a multi-part object const MULTI_INIT *pInitTbl); // pointer to multi-object initialisation table void MultiInsertObject( // Insert a multi-part object onto a object list - OBJECT *pObjList, // list to insert multi-part object onto + OBJECT **pObjList, // list to insert multi-part object onto OBJECT *pInsObj); // head of multi-part object to insert void MultiDeleteObject( // Delete all the pieces of a multi-part object - OBJECT *pObjList, // list to delete multi-part object from + OBJECT **pObjList, // list to delete multi-part object from OBJECT *pMultiObj); // multi-part object to be deleted void MultiHideObject( // Hide a multi-part object diff --git a/engines/tinsel/music.cpp b/engines/tinsel/music.cpp index 12bcff829b..d6478f5cae 100644 --- a/engines/tinsel/music.cpp +++ b/engines/tinsel/music.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ // FIXME: This code is taken from MADE and may need more work (e.g. setVolume). diff --git a/engines/tinsel/music.h b/engines/tinsel/music.h index 9003e60078..d43fed268d 100644 --- a/engines/tinsel/music.h +++ b/engines/tinsel/music.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ // Music class diff --git a/engines/tinsel/object.cpp b/engines/tinsel/object.cpp index ad02a614a5..b1090058d1 100644 --- a/engines/tinsel/object.cpp +++ b/engines/tinsel/object.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * * This file contains the Object Manager code. */ @@ -165,13 +162,13 @@ void CopyObject(OBJECT *pDest, OBJECT *pSrc) { * @param pInsObj Object to insert */ -void InsertObject(OBJECT *pObjList, OBJECT *pInsObj) { - OBJECT *pPrev, *pObj; // object list traversal pointers +void InsertObject(OBJECT **pObjList, OBJECT *pInsObj) { + OBJECT **pAnchor, *pObj; // object list traversal pointers // validate object pointer assert(isValidObject(pInsObj)); - for (pPrev = pObjList, pObj = pObjList->pNext; pObj != NULL; pPrev = pObj, pObj = pObj->pNext) { + for (pAnchor = pObjList, pObj = *pAnchor; pObj != NULL; pAnchor = &pObj->pNext, pObj = *pAnchor) { // check Z order if (pInsObj->zPos < pObj->zPos) { // object Z is lower than list Z - insert here @@ -185,9 +182,9 @@ void InsertObject(OBJECT *pObjList, OBJECT *pInsObj) { } } - // insert obj between pPrev and pObj + // insert obj between pAnchor and pObj pInsObj->pNext = pObj; - pPrev->pNext = pInsObj; + *pAnchor = pInsObj; } @@ -197,8 +194,8 @@ void InsertObject(OBJECT *pObjList, OBJECT *pInsObj) { * @param pObjList List to delete object from * @param pDelObj Object to delete */ -void DelObject(OBJECT *pObjList, OBJECT *pDelObj) { - OBJECT *pPrev, *pObj; // object list traversal pointers +void DelObject(OBJECT **pObjList, OBJECT *pDelObj) { + OBJECT **pAnchor, *pObj; // object list traversal pointers const Common::Rect rcScreen(0, 0, SCREEN_WIDTH, SCREEN_HEIGHT); // validate object pointer @@ -210,7 +207,7 @@ void DelObject(OBJECT *pObjList, OBJECT *pDelObj) { assert(numObj >= 0); #endif - for (pPrev = pObjList, pObj = pObjList->pNext; pObj != NULL; pPrev = pObj, pObj = pObj->pNext) { + for (pAnchor = pObjList, pObj = *pAnchor; pObj != NULL; pAnchor = &pObj->pNext, pObj = *pAnchor) { if (pObj == pDelObj) { // found object to delete @@ -220,7 +217,7 @@ void DelObject(OBJECT *pObjList, OBJECT *pDelObj) { } // make PREV next = OBJ next - removes OBJ from list - pPrev->pNext = pObj->pNext; + *pAnchor = pObj->pNext; // place free list in OBJ next pObj->pNext = pFreeObjects; @@ -248,12 +245,12 @@ void DelObject(OBJECT *pObjList, OBJECT *pDelObj) { * Sort the specified object list in Z Y order. * @param pObjList List to sort */ -void SortObjectList(OBJECT *pObjList) { +void SortObjectList(OBJECT **pObjList) { OBJECT *pPrev, *pObj; // object list traversal pointers OBJECT head; // temporary head of list - because pObjList is not usually a OBJECT // put at head of list - head.pNext = pObjList->pNext; + head.pNext = *pObjList; // set head of list dummy OBJ Z Y values to lowest possible head.yPos = intToFrac(MIN_INT16); diff --git a/engines/tinsel/object.h b/engines/tinsel/object.h index 9f10c06cd2..5644ddf19c 100644 --- a/engines/tinsel/object.h +++ b/engines/tinsel/object.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * * Object Manager data structures */ @@ -137,24 +134,15 @@ void CopyObject( // copy one object to another OBJECT *pSrc); // source object void InsertObject( // insert a object onto a sorted object list - OBJECT *pObjList, // list to insert object onto + OBJECT **pObjList, // list to insert object onto OBJECT *pInsObj); // object to insert void DelObject( // delete a object from a object list and add to free list - OBJECT *pObjList, // list to delete object from + OBJECT **pObjList, // list to delete object from OBJECT *pDelObj); // object to delete void SortObjectList( // re-sort an object list - OBJECT *pObjList); // list to sort - -OBJECT *GetNextObject( // object list iterator - returns next obj in list - OBJECT *pObjList, // which object list - OBJECT *pStrtObj); // object to start from - when NULL will start from beginning of list - -OBJECT *FindObject( // Searches the specified obj list for a object matching the specified OID - OBJECT *pObjList, // object list to search - int oidDesired, // object identifer of object to find - int oidMask); // mask to apply to object identifiers before comparison + OBJECT **pObjList); // list to sort void GetAniOffset( // returns the anim offsets of a image, takes into account orientation SCNHANDLE hImg, // image to get animation offset of diff --git a/engines/tinsel/palette.cpp b/engines/tinsel/palette.cpp index 0877337603..f2437bd17e 100644 --- a/engines/tinsel/palette.cpp +++ b/engines/tinsel/palette.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * * Palette Allocator for IBM PC. */ diff --git a/engines/tinsel/palette.h b/engines/tinsel/palette.h index 694eff504d..af58a7ffbd 100644 --- a/engines/tinsel/palette.h +++ b/engines/tinsel/palette.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * * Palette Allocator Definitions */ diff --git a/engines/tinsel/pcode.cpp b/engines/tinsel/pcode.cpp index a1cc02a832..39423813bf 100644 --- a/engines/tinsel/pcode.cpp +++ b/engines/tinsel/pcode.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * * Virtual processor. */ diff --git a/engines/tinsel/pcode.h b/engines/tinsel/pcode.h index f31f2eb5c6..eedf9fb827 100644 --- a/engines/tinsel/pcode.h +++ b/engines/tinsel/pcode.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * * Virtual processor definitions */ diff --git a/engines/tinsel/pdisplay.cpp b/engines/tinsel/pdisplay.cpp index 5022f4757a..7439c6f77d 100644 --- a/engines/tinsel/pdisplay.cpp +++ b/engines/tinsel/pdisplay.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * * CursorPositionProcess() * TagProcess() * PointProcess() diff --git a/engines/tinsel/pdisplay.h b/engines/tinsel/pdisplay.h index 4e19f1a78a..aefaf015bd 100644 --- a/engines/tinsel/pdisplay.h +++ b/engines/tinsel/pdisplay.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * * Tag related methods */ diff --git a/engines/tinsel/pid.h b/engines/tinsel/pid.h index d6f87bdf98..4f63045cb4 100644 --- a/engines/tinsel/pid.h +++ b/engines/tinsel/pid.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * * List of all process identifiers */ diff --git a/engines/tinsel/play.cpp b/engines/tinsel/play.cpp index 145634b9dd..71e07721a6 100644 --- a/engines/tinsel/play.cpp +++ b/engines/tinsel/play.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * * Plays films within a scene, takes into account the actor in each 'column'. | */ diff --git a/engines/tinsel/play.h b/engines/tinsel/play.h index 2e981b1e2e..041b7096a8 100644 --- a/engines/tinsel/play.h +++ b/engines/tinsel/play.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * * Plays films within a scene, takes into account the actor in each 'column'. */ diff --git a/engines/tinsel/polygons.cpp b/engines/tinsel/polygons.cpp index f49dddeef4..26a861f692 100644 --- a/engines/tinsel/polygons.cpp +++ b/engines/tinsel/polygons.cpp @@ -17,9 +17,6 @@ * 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. - * - * $URL$ - * $Id$ */ #include "tinsel/actors.h" diff --git a/engines/tinsel/polygons.h b/engines/tinsel/polygons.h index cf8f9e98c2..6d36d555d8 100644 --- a/engines/tinsel/polygons.h +++ b/engines/tinsel/polygons.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * * Definition of POLYGON structure and functions in POLYGONS.C */ diff --git a/engines/tinsel/rince.cpp b/engines/tinsel/rince.cpp index 38ac0a2ce6..ca196aac92 100644 --- a/engines/tinsel/rince.cpp +++ b/engines/tinsel/rince.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * * Should really be called "moving actors.c" */ diff --git a/engines/tinsel/rince.h b/engines/tinsel/rince.h index 5d09a1e945..93fd191172 100644 --- a/engines/tinsel/rince.h +++ b/engines/tinsel/rince.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * * Should really be called "moving actors.h" */ diff --git a/engines/tinsel/saveload.cpp b/engines/tinsel/saveload.cpp index b6935d41ab..caaf9a13f8 100644 --- a/engines/tinsel/saveload.cpp +++ b/engines/tinsel/saveload.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * * Save and restore scene and game. */ @@ -165,8 +162,7 @@ static bool syncSaveGameHeader(Common::Serializer &s, SaveGameHeader &hdr) { } static void syncSavedMover(Common::Serializer &s, SAVED_MOVER &sm) { - SCNHANDLE *pList[3] = { (SCNHANDLE *)&sm.walkReels, - (SCNHANDLE *)&sm.standReels, (SCNHANDLE *)&sm.talkReels }; + int i, j; s.syncAsUint32LE(sm.bActive); s.syncAsSint32LE(sm.actorID); @@ -174,11 +170,21 @@ static void syncSavedMover(Common::Serializer &s, SAVED_MOVER &sm) { s.syncAsSint32LE(sm.objY); s.syncAsUint32LE(sm.hLastfilm); - for (int pIndex = 0; pIndex < 3; ++pIndex) { - SCNHANDLE *p = pList[pIndex]; - for (int i = 0; i < TOTAL_SCALES * 4; ++i) - s.syncAsUint32LE(*p++); - } + // Sync walk reels + for (i = 0; i < TOTAL_SCALES; ++i) + for (j = 0; j < 4; ++j) + s.syncAsUint32LE(sm.walkReels[i][j]); + + // Sync stand reels + for (i = 0; i < TOTAL_SCALES; ++i) + for (j = 0; j < 4; ++j) + s.syncAsUint32LE(sm.standReels[i][j]); + + // Sync talk reels + for (i = 0; i < TOTAL_SCALES; ++i) + for (j = 0; j < 4; ++j) + s.syncAsUint32LE(sm.talkReels[i][j]); + if (TinselV2) { s.syncAsByte(sm.bHidden); diff --git a/engines/tinsel/savescn.cpp b/engines/tinsel/savescn.cpp index aa359d281f..7be24cc964 100644 --- a/engines/tinsel/savescn.cpp +++ b/engines/tinsel/savescn.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * * Save and restore scene and game. */ diff --git a/engines/tinsel/savescn.h b/engines/tinsel/savescn.h index 271cdd5eb1..27840876f2 100644 --- a/engines/tinsel/savescn.h +++ b/engines/tinsel/savescn.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * * Should really be called "moving actors.h" */ diff --git a/engines/tinsel/scene.cpp b/engines/tinsel/scene.cpp index b82bac32cc..f2c3bff1d5 100644 --- a/engines/tinsel/scene.cpp +++ b/engines/tinsel/scene.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * * Starts up new scenes. */ diff --git a/engines/tinsel/scene.h b/engines/tinsel/scene.h index 2ef7da1289..baaff27a3e 100644 --- a/engines/tinsel/scene.h +++ b/engines/tinsel/scene.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * * Scene parsing defines */ diff --git a/engines/tinsel/sched.cpp b/engines/tinsel/sched.cpp index 37c04abd22..b24d6bf9b8 100644 --- a/engines/tinsel/sched.cpp +++ b/engines/tinsel/sched.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * * Process scheduler. */ diff --git a/engines/tinsel/sched.h b/engines/tinsel/sched.h index bfeaa8750a..a1eafcdc47 100644 --- a/engines/tinsel/sched.h +++ b/engines/tinsel/sched.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * * Data structures used by the process scheduler */ diff --git a/engines/tinsel/scn.cpp b/engines/tinsel/scn.cpp index 20d75b6b93..70093447ff 100644 --- a/engines/tinsel/scn.cpp +++ b/engines/tinsel/scn.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * * A (some would say very) small collection of utility functions. */ diff --git a/engines/tinsel/scn.h b/engines/tinsel/scn.h index c9cafd9eea..2e3a02cdda 100644 --- a/engines/tinsel/scn.h +++ b/engines/tinsel/scn.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef TINSEL_SCN_H // prevent multiple includes diff --git a/engines/tinsel/scroll.cpp b/engines/tinsel/scroll.cpp index 3da970915f..7637664163 100644 --- a/engines/tinsel/scroll.cpp +++ b/engines/tinsel/scroll.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * * Handles scrolling */ diff --git a/engines/tinsel/scroll.h b/engines/tinsel/scroll.h index 438b049069..62562b20b2 100644 --- a/engines/tinsel/scroll.h +++ b/engines/tinsel/scroll.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef TINSEL_SCROLL_H // prevent multiple includes diff --git a/engines/tinsel/sound.cpp b/engines/tinsel/sound.cpp index ec42ca5da4..bf48dd1511 100644 --- a/engines/tinsel/sound.cpp +++ b/engines/tinsel/sound.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * * sound functionality */ diff --git a/engines/tinsel/sound.h b/engines/tinsel/sound.h index 2b0ef4599e..d7083b3b21 100644 --- a/engines/tinsel/sound.h +++ b/engines/tinsel/sound.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * * This file contains the Sound Driver data structures etc. */ diff --git a/engines/tinsel/strres.cpp b/engines/tinsel/strres.cpp index 2dc0e833d1..f3a7278993 100644 --- a/engines/tinsel/strres.cpp +++ b/engines/tinsel/strres.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * * String resource managment routines */ diff --git a/engines/tinsel/strres.h b/engines/tinsel/strres.h index 497259584c..a63824a863 100644 --- a/engines/tinsel/strres.h +++ b/engines/tinsel/strres.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * * String resource managment routines */ diff --git a/engines/tinsel/sysvar.cpp b/engines/tinsel/sysvar.cpp index ad795fd219..aa3fdeead8 100644 --- a/engines/tinsel/sysvar.cpp +++ b/engines/tinsel/sysvar.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * * System variable handling. */ diff --git a/engines/tinsel/sysvar.h b/engines/tinsel/sysvar.h index 4cdb1364b4..65bf558433 100644 --- a/engines/tinsel/sysvar.h +++ b/engines/tinsel/sysvar.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * * System variable handling. */ diff --git a/engines/tinsel/text.cpp b/engines/tinsel/text.cpp index 3652d6ed3e..ecb1e153f3 100644 --- a/engines/tinsel/text.cpp +++ b/engines/tinsel/text.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * * Text utilities. */ @@ -107,7 +104,7 @@ int JustifyText(char *szStr, int xPos, const FONT *pFont, int mode) { * @param mode Mode flags for the string * @param sleepTime Sleep time between each character (if non-zero) */ -OBJECT *ObjectTextOut(OBJECT *pList, char *szStr, int color, +OBJECT *ObjectTextOut(OBJECT **pList, char *szStr, int color, int xPos, int yPos, SCNHANDLE hFont, int mode, int sleepTime) { int xJustify; // x position of text after justification int yOffset; // offset to next line of text diff --git a/engines/tinsel/text.h b/engines/tinsel/text.h index ea804f58d7..4c80300c46 100644 --- a/engines/tinsel/text.h +++ b/engines/tinsel/text.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * * Text utility defines */ @@ -98,7 +95,7 @@ struct TEXTOUT { * @param mode mode flags for the string * @param sleepTime Sleep time between each character (if non-zero) */ -OBJECT *ObjectTextOut(OBJECT *pList, char *szStr, int color, +OBJECT *ObjectTextOut(OBJECT **pList, char *szStr, int color, int xPos, int yPos, SCNHANDLE hFont, int mode, int sleepTime = 0); OBJECT *ObjectTextOutIndirect( // output a string of text diff --git a/engines/tinsel/timers.cpp b/engines/tinsel/timers.cpp index c1a4cd0ff5..1c3ff9b260 100644 --- a/engines/tinsel/timers.cpp +++ b/engines/tinsel/timers.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * * Handles timers. * * Note: As part of the transition to ScummVM, the ticks field of a timer has been changed diff --git a/engines/tinsel/timers.h b/engines/tinsel/timers.h index 1456d9a1d5..9bf85d9c35 100644 --- a/engines/tinsel/timers.h +++ b/engines/tinsel/timers.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * * Handles timers. */ diff --git a/engines/tinsel/tinlib.cpp b/engines/tinsel/tinlib.cpp index afd409ce27..a5a0c73395 100644 --- a/engines/tinsel/tinlib.cpp +++ b/engines/tinsel/tinlib.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * * Glitter library functions. * * In the main called only from PCODE.C diff --git a/engines/tinsel/tinlib.h b/engines/tinsel/tinlib.h index 7bd2a19d55..7c8c2ffbf6 100644 --- a/engines/tinsel/tinlib.h +++ b/engines/tinsel/tinlib.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * * Text utility defines */ diff --git a/engines/tinsel/tinsel.cpp b/engines/tinsel/tinsel.cpp index 20d4f1d31a..84a8ea8eb3 100644 --- a/engines/tinsel/tinsel.cpp +++ b/engines/tinsel/tinsel.cpp @@ -18,16 +18,12 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/debug-channels.h" #include "common/endian.h" #include "common/error.h" #include "common/events.h" -#include "common/EventRecorder.h" #include "common/keyboard.h" #include "common/fs.h" #include "common/config-manager.h" @@ -818,7 +814,7 @@ const char *TinselEngine::_textFiles[][3] = { TinselEngine::TinselEngine(OSystem *syst, const TinselGameDescription *gameDesc) : - Engine(syst), _gameDescription(gameDesc) { + Engine(syst), _gameDescription(gameDesc), _random("tinsel") { _vm = this; _config = new Config(this); @@ -909,8 +905,6 @@ Common::Error TinselEngine::run() { _screenSurface.create(320, 200, Graphics::PixelFormat::createFormatCLUT8()); } - g_eventRec.registerRandomSource(_random, "tinsel"); - _console = new Console(); _scheduler = new Scheduler(); diff --git a/engines/tinsel/tinsel.h b/engines/tinsel/tinsel.h index 35ea43074c..d0875f9fdf 100644 --- a/engines/tinsel/tinsel.h +++ b/engines/tinsel/tinsel.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef TINSEL_H diff --git a/engines/tinsel/token.cpp b/engines/tinsel/token.cpp index fe152edcaa..c7490a100b 100644 --- a/engines/tinsel/token.cpp +++ b/engines/tinsel/token.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * * To ensure exclusive use of resources and exclusive control responsibilities. */ diff --git a/engines/tinsel/token.h b/engines/tinsel/token.h index b750b92ae4..8169ef1c7a 100644 --- a/engines/tinsel/token.h +++ b/engines/tinsel/token.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef TINSEL_TOKEN_H diff --git a/engines/toon/anim.cpp b/engines/toon/anim.cpp index 856acbd986..23bd0f6487 100644 --- a/engines/toon/anim.cpp +++ b/engines/toon/anim.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/debug.h" diff --git a/engines/toon/anim.h b/engines/toon/anim.h index dfb6842b0e..13c501b910 100644 --- a/engines/toon/anim.h +++ b/engines/toon/anim.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef TOON_ANIM_H diff --git a/engines/toon/audio.cpp b/engines/toon/audio.cpp index 026450d3c9..46b96286b3 100644 --- a/engines/toon/audio.cpp +++ b/engines/toon/audio.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/debug.h" diff --git a/engines/toon/audio.h b/engines/toon/audio.h index 5feae9c5a1..52ca21b075 100644 --- a/engines/toon/audio.h +++ b/engines/toon/audio.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef TOON_AUDIO_H diff --git a/engines/toon/character.cpp b/engines/toon/character.cpp index 29a61ffd78..06c6e21d21 100644 --- a/engines/toon/character.cpp +++ b/engines/toon/character.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * -* $URL$ -* $Id$ -* */ #include "common/debug.h" diff --git a/engines/toon/character.h b/engines/toon/character.h index e870d81813..b48991732c 100644 --- a/engines/toon/character.h +++ b/engines/toon/character.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * -* $URL$ -* $Id$ -* */ #ifndef TOON_CHARACTER_H diff --git a/engines/toon/console.cpp b/engines/toon/console.cpp index 3c34792580..8037dca4cb 100644 --- a/engines/toon/console.cpp +++ b/engines/toon/console.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "toon/console.h" diff --git a/engines/toon/console.h b/engines/toon/console.h index 0662f20533..25ce7627a1 100644 --- a/engines/toon/console.h +++ b/engines/toon/console.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef TOON_CONSOLE_H diff --git a/engines/toon/conversation.cpp b/engines/toon/conversation.cpp index fc846288ef..01ee1efaed 100644 --- a/engines/toon/conversation.cpp +++ b/engines/toon/conversation.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * -* $URL$ -* $Id$ -* */ #include "toon/conversation.h" diff --git a/engines/toon/conversation.h b/engines/toon/conversation.h index 0380210e02..3e459a9734 100644 --- a/engines/toon/conversation.h +++ b/engines/toon/conversation.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * -* $URL$ -* $Id$ -* */ #ifndef TOON_CONVERSATION_H diff --git a/engines/toon/detection.cpp b/engines/toon/detection.cpp index ef023564bc..1056f6ec0d 100644 --- a/engines/toon/detection.cpp +++ b/engines/toon/detection.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/config-manager.h" @@ -150,7 +147,7 @@ public: ToonMetaEngine() : AdvancedMetaEngine(detectionParams) {} virtual const char *getName() const { - return "Toon Engine"; + return "Toon"; } virtual const char *getOriginalCopyright() const { diff --git a/engines/toon/drew.cpp b/engines/toon/drew.cpp index 77333c4a9f..89438fb35c 100644 --- a/engines/toon/drew.cpp +++ b/engines/toon/drew.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/debug.h" diff --git a/engines/toon/drew.h b/engines/toon/drew.h index f248e4aa51..3357b99846 100644 --- a/engines/toon/drew.h +++ b/engines/toon/drew.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * -* $URL$ -* $Id$ -* */ #ifndef TOON_DREW_H diff --git a/engines/toon/flux.cpp b/engines/toon/flux.cpp index 833fdbf5ce..b752e65c82 100644 --- a/engines/toon/flux.cpp +++ b/engines/toon/flux.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * -* $URL$ -* $Id$ -* */ #include "common/debug.h" diff --git a/engines/toon/flux.h b/engines/toon/flux.h index 136dedd415..c208bc5bda 100644 --- a/engines/toon/flux.h +++ b/engines/toon/flux.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * -* $URL$ -* $Id$ -* */ #ifndef TOON_FLUX_H diff --git a/engines/toon/font.cpp b/engines/toon/font.cpp index 9367d79036..4c491ae2b3 100644 --- a/engines/toon/font.cpp +++ b/engines/toon/font.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * -* $URL$ -* $Id$ -* */ #include "common/debug.h" diff --git a/engines/toon/font.h b/engines/toon/font.h index 739d215e36..168c61f27e 100644 --- a/engines/toon/font.h +++ b/engines/toon/font.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * -* $URL$ -* $Id$ -* */ #ifndef TOON_FONT_H diff --git a/engines/toon/hotspot.cpp b/engines/toon/hotspot.cpp index 1c1e23e39e..62458ad800 100644 --- a/engines/toon/hotspot.cpp +++ b/engines/toon/hotspot.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * -* $URL$ -* $Id$ -* */ #include "common/debug.h" diff --git a/engines/toon/hotspot.h b/engines/toon/hotspot.h index aabcd531fe..49ac1a4af8 100644 --- a/engines/toon/hotspot.h +++ b/engines/toon/hotspot.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * -* $URL$ -* $Id$ -* */ #ifndef TOON_HOTSPOT_H diff --git a/engines/toon/movie.cpp b/engines/toon/movie.cpp index 64b80c29b3..2318eaaac7 100644 --- a/engines/toon/movie.cpp +++ b/engines/toon/movie.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * -* $URL$ -* $Id$ -* */ #include "common/debug.h" diff --git a/engines/toon/movie.h b/engines/toon/movie.h index bed2ceceae..7e443fd8ab 100644 --- a/engines/toon/movie.h +++ b/engines/toon/movie.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * -* $URL$ -* $Id$ -* */ #ifndef TOON_MOVIE_H diff --git a/engines/toon/path.cpp b/engines/toon/path.cpp index 26355863f6..c116d63663 100644 --- a/engines/toon/path.cpp +++ b/engines/toon/path.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * -* $URL$ -* $Id$ -* */ #include "common/debug.h" diff --git a/engines/toon/path.h b/engines/toon/path.h index 03d2b188e5..329127c9ce 100644 --- a/engines/toon/path.h +++ b/engines/toon/path.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * -* $URL$ -* $Id$ -* */ #ifndef TOON_PATH_H diff --git a/engines/toon/picture.cpp b/engines/toon/picture.cpp index ce28f9c68b..0257964fb5 100644 --- a/engines/toon/picture.cpp +++ b/engines/toon/picture.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * -* $URL$ -* $Id$ -* */ #include "toon/picture.h" diff --git a/engines/toon/picture.h b/engines/toon/picture.h index 6aca408364..23edbc91da 100644 --- a/engines/toon/picture.h +++ b/engines/toon/picture.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * -* $URL$ -* $Id$ -* */ #ifndef TOON_PICTURE_H diff --git a/engines/toon/resource.cpp b/engines/toon/resource.cpp index f9f65b423b..cef916c7de 100644 --- a/engines/toon/resource.cpp +++ b/engines/toon/resource.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * -* $URL$ -* $Id$ -* */ #include "toon/resource.h" diff --git a/engines/toon/resource.h b/engines/toon/resource.h index d6ed29b81b..0cecad8187 100644 --- a/engines/toon/resource.h +++ b/engines/toon/resource.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * -* $URL$ -* $Id$ -* */ #ifndef TOON_RESOURCE_H diff --git a/engines/toon/script.cpp b/engines/toon/script.cpp index 8703666781..eed781295a 100644 --- a/engines/toon/script.cpp +++ b/engines/toon/script.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * -* $URL$ -* $Id$ -* */ #include "common/debug.h" diff --git a/engines/toon/script.h b/engines/toon/script.h index b6d28e1171..9dd00dca80 100644 --- a/engines/toon/script.h +++ b/engines/toon/script.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * -* $URL$ -* $Id$ -* */ #ifndef TOON_SCRIPT_H diff --git a/engines/toon/script_func.cpp b/engines/toon/script_func.cpp index 8f75097bd4..693f308707 100644 --- a/engines/toon/script_func.cpp +++ b/engines/toon/script_func.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * -* $URL$ -* $Id$ -* */ #include "common/debug.h" diff --git a/engines/toon/script_func.h b/engines/toon/script_func.h index 76b7b0ada1..ef1cb59f47 100644 --- a/engines/toon/script_func.h +++ b/engines/toon/script_func.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * -* $URL$ -* $Id$ -* */ #ifndef SCRIPT_FUNC_H diff --git a/engines/toon/state.cpp b/engines/toon/state.cpp index af37ea9e68..8e4abbd709 100644 --- a/engines/toon/state.cpp +++ b/engines/toon/state.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * -* $URL$ -* $Id$ -* */ #include "common/debug.h" diff --git a/engines/toon/state.h b/engines/toon/state.h index 63505fd5fb..4004b8b4f0 100644 --- a/engines/toon/state.h +++ b/engines/toon/state.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * -* $URL$ -* $Id$ -* */ #ifndef TOON_STATE_H diff --git a/engines/toon/text.cpp b/engines/toon/text.cpp index 94a3ea5aa7..0f72d58b3b 100644 --- a/engines/toon/text.cpp +++ b/engines/toon/text.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * -* $URL$ -* $Id$ -* */ #include "common/debug.h" diff --git a/engines/toon/text.h b/engines/toon/text.h index 9a35471e4f..b8f4a96a6a 100644 --- a/engines/toon/text.h +++ b/engines/toon/text.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * -* $URL$ -* $Id$ -* */ #ifndef TOON_TEXT_H diff --git a/engines/toon/tools.cpp b/engines/toon/tools.cpp index ff72e69543..c9aa470deb 100644 --- a/engines/toon/tools.cpp +++ b/engines/toon/tools.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * -* $URL$ -* $Id$ -* */ #include "common/debug.h" diff --git a/engines/toon/tools.h b/engines/toon/tools.h index 1434ca26c7..44c0fc4644 100644 --- a/engines/toon/tools.h +++ b/engines/toon/tools.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * -* $URL$ -* $Id$ -* */ #ifndef TOON_TOOLS_H diff --git a/engines/toon/toon.cpp b/engines/toon/toon.cpp index 81c4d313e4..44c747c4c4 100644 --- a/engines/toon/toon.cpp +++ b/engines/toon/toon.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * -* $URL$ -* $Id$ -* */ #include "common/system.h" @@ -28,7 +25,6 @@ #include "common/debug-channels.h" #include "common/archive.h" #include "common/config-manager.h" -#include "common/EventRecorder.h" #include "common/savefile.h" #include "common/memstream.h" @@ -783,8 +779,6 @@ Common::Error ToonEngine::run() { if (!loadToonDat()) return Common::kUnknownError; - g_eventRec.registerRandomSource(_rnd, "toon"); - initGraphics(TOON_SCREEN_WIDTH, TOON_SCREEN_HEIGHT, true); init(); @@ -818,7 +812,8 @@ Common::Error ToonEngine::run() { } ToonEngine::ToonEngine(OSystem *syst, const ADGameDescription *gameDescription) - : Engine(syst), _gameDescription(gameDescription), _language(gameDescription->language) { + : Engine(syst), _gameDescription(gameDescription), + _language(gameDescription->language), _rnd("toon") { _system = syst; _tickLength = 16; _currentPicture = NULL; @@ -2860,7 +2855,7 @@ void ToonEngine::playSFX(int32 id, int32 volume) { } void ToonEngine::playSoundWrong() { - _audioManager->playSFX(rand() & 7, 128, true); + _audioManager->playSFX(randRange(0,7), 128, true); } void ToonEngine::getTextPosition(int32 characterId, int32 *retX, int32 *retY) { diff --git a/engines/toon/toon.h b/engines/toon/toon.h index 373437d658..1eaa5022a9 100644 --- a/engines/toon/toon.h +++ b/engines/toon/toon.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * -* $URL$ -* $Id$ -* */ #ifndef TOON_TOON_H diff --git a/engines/touche/console.cpp b/engines/touche/console.cpp index adcabb2fc5..51ef5fc639 100644 --- a/engines/touche/console.cpp +++ b/engines/touche/console.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "touche/console.h" diff --git a/engines/touche/console.h b/engines/touche/console.h index de14867b32..e3cdc9d48b 100644 --- a/engines/touche/console.h +++ b/engines/touche/console.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef TOUCHE_CONSOLE_H diff --git a/engines/touche/detection.cpp b/engines/touche/detection.cpp index 06d15664a5..b7f9c092aa 100644 --- a/engines/touche/detection.cpp +++ b/engines/touche/detection.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/config-manager.h" @@ -159,7 +156,7 @@ public: ToucheMetaEngine() : AdvancedMetaEngine(detectionParams) {} virtual const char *getName() const { - return "Touche Engine"; + return "Touche"; } virtual const char *getOriginalCopyright() const { diff --git a/engines/touche/graphics.cpp b/engines/touche/graphics.cpp index ab711beba0..6e565327ba 100644 --- a/engines/touche/graphics.cpp +++ b/engines/touche/graphics.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/endian.h" diff --git a/engines/touche/graphics.h b/engines/touche/graphics.h index 9c928f983c..4b769b0a66 100644 --- a/engines/touche/graphics.h +++ b/engines/touche/graphics.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef TOUCHE_GRAPHICS_H diff --git a/engines/touche/menu.cpp b/engines/touche/menu.cpp index eb10c61893..f469a95803 100644 --- a/engines/touche/menu.cpp +++ b/engines/touche/menu.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ diff --git a/engines/touche/midi.cpp b/engines/touche/midi.cpp index c89375d876..da14baa484 100644 --- a/engines/touche/midi.cpp +++ b/engines/touche/midi.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/config-manager.h" diff --git a/engines/touche/midi.h b/engines/touche/midi.h index bde4950b93..24f9da0474 100644 --- a/engines/touche/midi.h +++ b/engines/touche/midi.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef TOUCHE_MIDI_H diff --git a/engines/touche/opcodes.cpp b/engines/touche/opcodes.cpp index 5df0ca3548..18677eae26 100644 --- a/engines/touche/opcodes.cpp +++ b/engines/touche/opcodes.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ diff --git a/engines/touche/resource.cpp b/engines/touche/resource.cpp index 93406dcb8b..8f4752e912 100644 --- a/engines/touche/resource.cpp +++ b/engines/touche/resource.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ diff --git a/engines/touche/saveload.cpp b/engines/touche/saveload.cpp index 42b68d015c..82ed03ad45 100644 --- a/engines/touche/saveload.cpp +++ b/engines/touche/saveload.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ diff --git a/engines/touche/staticres.cpp b/engines/touche/staticres.cpp index 74aa7954de..f7b1482f80 100644 --- a/engines/touche/staticres.cpp +++ b/engines/touche/staticres.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ diff --git a/engines/touche/touche.cpp b/engines/touche/touche.cpp index 15a2b1c53a..81d6adf581 100644 --- a/engines/touche/touche.cpp +++ b/engines/touche/touche.cpp @@ -18,16 +18,12 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/config-manager.h" #include "common/debug-channels.h" #include "common/events.h" -#include "common/EventRecorder.h" #include "common/fs.h" #include "common/system.h" #include "common/archive.h" @@ -48,7 +44,7 @@ namespace Touche { ToucheEngine::ToucheEngine(OSystem *system, Common::Language language) - : Engine(system), _midiPlayer(0), _language(language) { + : Engine(system), _midiPlayer(0), _language(language), _rnd("touche") { _saveLoadCurrentPage = 0; _saveLoadCurrentSlot = 0; _hideInventoryTexts = false; @@ -87,8 +83,6 @@ ToucheEngine::ToucheEngine(OSystem *system, Common::Language language) DebugMan.addDebugChannel(kDebugMenu, "Menu", "Menu debug level"); _console = new ToucheConsole(this); - - g_eventRec.registerRandomSource(_rnd, "touche"); } ToucheEngine::~ToucheEngine() { diff --git a/engines/touche/touche.h b/engines/touche/touche.h index 1580d072e6..c8d7504754 100644 --- a/engines/touche/touche.h +++ b/engines/touche/touche.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef TOUCHE_ENGINE_H diff --git a/engines/tsage/blueforce_logic.cpp b/engines/tsage/blueforce_logic.cpp new file mode 100644 index 0000000000..9813bef6f7 --- /dev/null +++ b/engines/tsage/blueforce_logic.cpp @@ -0,0 +1,120 @@ +/* ScummVM - Graphic Adventure Engine + * + * ScummVM is the legal property of its developers, whose names + * are too numerous to list here. Please refer to the COPYRIGHT + * file distributed with this source distribution. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + * + */ + +#include "tsage/blueforce_logic.h" +#include "tsage/scenes.h" +#include "tsage/tsage.h" +#include "tsage/staticres.h" + +namespace tSage { + +void BlueForceGame::start() { + // Start the game + _globals->_sceneManager.changeScene(20); + + _globals->_events.setCursor(CURSOR_WALK); +} + +Scene *BlueForceGame::createScene(int sceneNumber) { + switch (sceneNumber) { + case 20: + case 50: + case 60: + error("Scene group 0 not implemented"); + case 100: + case 109: + case 110: + case 114: + case 115: + case 125: + case 140: + case 150: + case 160: + case 180: + case 190: + error("Scene group 1 not implemented"); + case 200: + case 210: + case 220: + case 225: + case 265: + case 270: + case 271: + case 280: + error("Scene group 2 not implemented"); + case 300: + case 315: + case 325: + case 330: + case 340: + case 342: + case 350: + case 355: + case 360: + case 370: + case 380: + case 385: + case 390: + error("Scene group 3 not implemented"); + case 410: + case 415: + case 440: + case 450: + error("Scene group 4 not implemented"); + case 550: + case 551: + case 560: + case 570: + case 580: + case 590: + error("Scene group 5 not implemented"); + case 600: + case 620: + case 666: + case 690: + error("Scene group 6 not implemented"); + case 710: + error("Scene group 7 not implemented"); + case 800: + case 810: + case 820: + case 830: + case 840: + case 850: + case 860: + case 870: + case 880: + error("Scene group 8 not implemented"); + case 900: + case 910: + case 920: + case 930: + case 935: + case 940: + error("Scene group 9 not implemented"); + default: + error("Unknown scene number - %d", sceneNumber); + break; + } +} + +} // End of namespace tSage diff --git a/engines/tsage/blueforce_logic.h b/engines/tsage/blueforce_logic.h new file mode 100644 index 0000000000..9237e50a13 --- /dev/null +++ b/engines/tsage/blueforce_logic.h @@ -0,0 +1,42 @@ +/* ScummVM - Graphic Adventure Engine + * + * ScummVM is the legal property of its developers, whose names + * are too numerous to list here. Please refer to the COPYRIGHT + * file distributed with this source distribution. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + * + */ + +#ifndef TSAGE_BLUEFORCE_LOGIC_H +#define TSAGE_BLUEFORCE_LOGIC_H + +#include "common/scummsys.h" +#include "tsage/events.h" +#include "tsage/core.h" +#include "tsage/scenes.h" +#include "tsage/globals.h" + +namespace tSage { + +class BlueForceGame: public Game { +public: + virtual void start(); + virtual Scene *createScene(int sceneNumber); +}; + +} // End of namespace tSage + +#endif diff --git a/engines/tsage/converse.cpp b/engines/tsage/converse.cpp index 8e36acf2b6..5fa36142e7 100644 --- a/engines/tsage/converse.cpp +++ b/engines/tsage/converse.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/str-array.h" @@ -52,8 +49,9 @@ void SequenceManager::setup() { _sceneObject = _objectList[0]; } -void SequenceManager::synchronise(Serialiser &s) { - Action::synchronise(s); +void SequenceManager::synchronize(Serializer &s) { + if (s.getVersion() >= 2) + Action::synchronize(s); s.syncAsSint32LE(_resNum); s.syncAsSint32LE(_sequenceOffset); @@ -348,17 +346,19 @@ void SequenceManager::setMessage(int resNum, int lineNum, int color, const Commo // Get the display message Common::String msg = _resourceManager->getMessage(resNum, lineNum); - // Get the needed rect, and move it to the desired position - Rect textRect; - _globals->gfxManager().getStringBounds(msg.c_str(), textRect, width); + // Set the text message + _sceneText.setup(msg); + + // Move the text to the correct position + Rect textRect = _sceneText._bounds; Rect sceneBounds = _globals->_sceneManager._scene->_sceneBounds; sceneBounds.collapse(4, 2); textRect.moveTo(pt); textRect.contain(sceneBounds); - // Set the text message - _sceneText.setup(msg); _sceneText.setPosition(Common::Point(textRect.left, textRect.top)); + + // Draw the text _sceneText.fixPriority(255); _sceneText.show(); @@ -418,8 +418,10 @@ int ConversationChoiceDialog::execute(const Common::StringArray &choiceList) { Event event; while (!_vm->getEventManager()->shouldQuit()) { while (!_globals->_events.getEvent(event, EVENT_KEYPRESS | EVENT_BUTTON_DOWN | EVENT_MOUSE_MOVE) && - !_vm->getEventManager()->shouldQuit()) - ; + !_vm->getEventManager()->shouldQuit()) { + g_system->delayMillis(10); + g_system->updateScreen(); + } if (_vm->getEventManager()->shouldQuit()) break; @@ -511,12 +513,12 @@ void Obj44::load(const byte *dataP) { _speakerOffset = READ_LE_UINT16(dataP + 0x42); } -void Obj44::synchronise(Serialiser &s) { +void Obj44::synchronize(Serializer &s) { s.syncAsSint32LE(_id); for (int idx = 0; idx < OBJ44_LIST_SIZE; ++idx) s.syncAsSint32LE(_field2[idx]); for (int idx = 0; idx < OBJ44_LIST_SIZE; ++idx) - _list[idx].synchronise(s); + _list[idx].synchronize(s); s.syncAsUint32LE(_speakerOffset); } @@ -589,26 +591,27 @@ void StripManager::load() { DEALLOCATE(obj44List); } -void StripManager::synchronise(Serialiser &s) { - Action::synchronise(s); +void StripManager::synchronize(Serializer &s) { + if (s.getVersion() >= 2) + Action::synchronize(s); s.syncAsSint32LE(_stripNum); s.syncAsSint32LE(_obj44Index); s.syncAsSint32LE(_field20); s.syncAsSint32LE(_sceneNumber); - _sceneBounds.synchronise(s); + _sceneBounds.synchronize(s); SYNC_POINTER(_activeSpeaker); s.syncAsByte(_textShown); s.syncAsByte(_field2E6); s.syncAsSint32LE(_field2E8); - // Synchronise the item list + // Synchronize the item list int arrSize = _obj44List.size(); s.syncAsUint16LE(arrSize); if (s.isLoading()) _obj44List.resize(arrSize); for (int i = 0; i < arrSize; ++i) - _obj44List[i].synchronise(s); + _obj44List[i].synchronize(s); // Synhcronise script data int scriptSize = _script.size(); @@ -739,8 +742,8 @@ void StripManager::process(Event &event) { if ((event.eventType == EVENT_KEYPRESS) && (event.kbd.keycode == Common::KEYCODE_ESCAPE)) { if (_obj44Index != 10000) { int currIndex = _obj44Index; - while (!_obj44List[_obj44Index + 1]._id) { - _obj44Index = getNewIndex(_obj44List[_obj44Index]._id); + while (!_obj44List[_obj44Index]._list[1]._id) { + _obj44Index = getNewIndex(_obj44List[_obj44Index]._list[0]._id); if ((_obj44Index < 0) || (_obj44Index == 10000)) break; currIndex = _obj44Index; @@ -803,15 +806,16 @@ Speaker::Speaker() : EventHandler() { _speakerName = "SPEAKER"; } -void Speaker::synchronise(Serialiser &s) { - EventHandler::synchronise(s); +void Speaker::synchronize(Serializer &s) { + if (s.getVersion() >= 2) + EventHandler::synchronize(s); - _fieldA.synchronise(s); + _fieldA.synchronize(s); SYNC_POINTER(_field18); s.syncString(_speakerName); s.syncAsSint32LE(_newSceneNumber); s.syncAsSint32LE(_oldSceneNumber); - _sceneBounds.synchronise(s); + _sceneBounds.synchronize(s); s.syncAsSint32LE(_textWidth); s.syncAsSint16LE(_textPos.x); s.syncAsSint16LE(_textPos.y); s.syncAsSint32LE(_fontNumber); diff --git a/engines/tsage/converse.h b/engines/tsage/converse.h index fd2abcd872..6876fa41cb 100644 --- a/engines/tsage/converse.h +++ b/engines/tsage/converse.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef TSAGE_CONVERSE_H @@ -58,7 +55,7 @@ public: SequenceManager(); virtual Common::String getClassName() { return "SequenceManager"; } - virtual void synchronise(Serialiser &s); + virtual void synchronize(Serializer &s); virtual void remove(); virtual void signal(); virtual void process(Event &event); @@ -86,7 +83,7 @@ public: Speaker(); virtual Common::String getClassName() { return "Speaker"; } - virtual void synchronise(Serialiser &s); + virtual void synchronize(Serializer &s); virtual void remove(); virtual void proc12(Action *action); virtual void setText(const Common::String &msg); @@ -168,7 +165,7 @@ public: int _id; uint _scriptOffset; - virtual void synchronise(Serialiser &s) { + virtual void synchronize(Serializer &s) { s.syncAsSint32LE(_id); s.syncAsUint32LE(_scriptOffset); } @@ -184,7 +181,7 @@ public: uint _speakerOffset; public: void load(const byte *dataP); - virtual void synchronise(Serialiser &s); + virtual void synchronize(Serializer &s); }; class StripManager : public Action { @@ -212,7 +209,7 @@ public: StripManager(); virtual ~StripManager(); - virtual void synchronise(Serialiser &s); + virtual void synchronize(Serializer &s); virtual void remove(); virtual void signal(); virtual void process(Event &event); diff --git a/engines/tsage/core.cpp b/engines/tsage/core.cpp index eab5efbce0..7534abdec7 100644 --- a/engines/tsage/core.cpp +++ b/engines/tsage/core.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/system.h" @@ -73,8 +70,8 @@ InvObjectList::InvObjectList() { _selectedItem = NULL; } -void InvObjectList::synchronise(Serialiser &s) { - SavedObject::synchronise(s); +void InvObjectList::synchronize(Serializer &s) { + SavedObject::synchronize(s); SYNC_POINTER(_selectedItem); } @@ -108,8 +105,10 @@ Action::Action() { _attached = false; } -void Action::synchronise(Serialiser &s) { - EventHandler::synchronise(s); +void Action::synchronize(Serializer &s) { + EventHandler::synchronize(s); + if (s.getVersion() == 1) + remove(); SYNC_POINTER(_owner); s.syncAsSint32LE(_actionIndex); @@ -180,8 +179,8 @@ ObjectMover::~ObjectMover() { _sceneObject->_mover = NULL; } -void ObjectMover::synchronise(Serialiser &s) { - EventHandler::synchronise(s); +void ObjectMover::synchronize(Serializer &s) { + EventHandler::synchronize(s); s.syncAsSint16LE(_destPosition.x); s.syncAsSint16LE(_destPosition.y); s.syncAsSint16LE(_moveDelta.x); s.syncAsSint16LE(_moveDelta.y); @@ -326,8 +325,8 @@ ObjectMover2::ObjectMover2() : ObjectMover() { _destObject = NULL; } -void ObjectMover2::synchronise(Serialiser &s) { - ObjectMover::synchronise(s); +void ObjectMover2::synchronize(Serializer &s) { + ObjectMover::synchronize(s); SYNC_POINTER(_destObject); s.syncAsSint32LE(_minArea); @@ -402,8 +401,8 @@ void NpcMover::startMove(SceneObject *sceneObj, va_list va) { /*--------------------------------------------------------------------------*/ -void PlayerMover::synchronise(Serialiser &s) { - NpcMover::synchronise(s); +void PlayerMover::synchronize(Serializer &s) { + NpcMover::synchronize(s); s.syncAsSint16LE(_finalDest.x); s.syncAsSint16LE(_finalDest.y); s.syncAsSint32LE(_routeIndex); @@ -924,8 +923,9 @@ bool PlayerMover::sub_F8E5(const Common::Point &pt1, const Common::Point &pt2, c /*--------------------------------------------------------------------------*/ -void PlayerMover2::synchronise(Serialiser &s) { - PlayerMover::synchronise(s); +void PlayerMover2::synchronize(Serializer &s) { + if (s.getVersion() >= 2) + PlayerMover::synchronize(s); SYNC_POINTER(_destObject); s.syncAsSint16LE(_maxArea); s.syncAsSint16LE(_minArea); @@ -975,8 +975,8 @@ void PaletteModifierCached::setPalette(ScenePalette *palette, int step) { _percent = 100; } -void PaletteModifierCached::synchronise(Serialiser &s) { - PaletteModifier::synchronise(s); +void PaletteModifierCached::synchronize(Serializer &s) { + PaletteModifier::synchronize(s); s.syncAsByte(_step); s.syncAsSint32LE(_percent); @@ -990,8 +990,8 @@ PaletteRotation::PaletteRotation() : PaletteModifierCached() { _frameNumber = _globals->_events.getFrameNumber(); } -void PaletteRotation::synchronise(Serialiser &s) { - PaletteModifierCached::synchronise(s); +void PaletteRotation::synchronize(Serializer &s) { + PaletteModifierCached::synchronize(s); s.syncAsSint32LE(_delayCtr); s.syncAsUint32LE(_frameNumber); @@ -1119,8 +1119,8 @@ void PaletteRotation::setDelay(int amount) { /*--------------------------------------------------------------------------*/ -void PaletteFader::synchronise(Serialiser &s) { - PaletteModifierCached::synchronise(s); +void PaletteFader::synchronize(Serializer &s) { + PaletteModifierCached::synchronize(s); s.syncAsSint16LE(_step); s.syncAsSint16LE(_percent); @@ -1163,6 +1163,10 @@ ScenePalette::ScenePalette() { _field412 = 0; } +ScenePalette::~ScenePalette() { + clearListeners(); +} + ScenePalette::ScenePalette(int paletteNum) { loadPalette(paletteNum); } @@ -1247,7 +1251,7 @@ void ScenePalette::getPalette(int start, int count) { } void ScenePalette::signalListeners() { - SynchronisedList<PaletteModifier *>::iterator i = _listeners.begin(); + SynchronizedList<PaletteModifier *>::iterator i = _listeners.begin(); while (i != _listeners.end()) { PaletteModifier *obj = *i; ++i; @@ -1256,7 +1260,7 @@ void ScenePalette::signalListeners() { } void ScenePalette::clearListeners() { - SynchronisedList<PaletteModifier *>::iterator i = _listeners.begin(); + SynchronizedList<PaletteModifier *>::iterator i = _listeners.begin(); while (i != _listeners.end()) { PaletteModifier *obj = *i; ++i; @@ -1340,13 +1344,14 @@ void ScenePalette::changeBackground(const Rect &bounds, FadeMode fadeMode) { _globals->_screenSurface.copyFrom(_globals->_sceneManager._scene->_backSurface, bounds, Rect(0, 0, SCREEN_WIDTH, SCREEN_HEIGHT), NULL); - for (SynchronisedList<PaletteModifier *>::iterator i = tempPalette._listeners.begin(); i != tempPalette._listeners.end(); ++i) + for (SynchronizedList<PaletteModifier *>::iterator i = tempPalette._listeners.begin(); i != tempPalette._listeners.end(); ++i) delete *i; tempPalette._listeners.clear(); } -void ScenePalette::synchronise(Serialiser &s) { - SavedObject::synchronise(s); +void ScenePalette::synchronize(Serializer &s) { + if (s.getVersion() >= 2) + SavedObject::synchronize(s); s.syncBytes(_palette, 256 * 3); s.syncAsSint32LE(_colors.foreground); @@ -1363,10 +1368,10 @@ void ScenePalette::synchronise(Serialiser &s) { /*--------------------------------------------------------------------------*/ -void SceneItem::synchronise(Serialiser &s) { - EventHandler::synchronise(s); +void SceneItem::synchronize(Serializer &s) { + EventHandler::synchronize(s); - _bounds.synchronise(s); + _bounds.synchronize(s); s.syncString(_msg); s.syncAsSint32LE(_fieldE); s.syncAsSint32LE(_field10); @@ -1597,8 +1602,8 @@ void NamedHotspot::setup(int ys, int xs, int ye, int xe, const int resnum, const _globals->_sceneItems.addItems(this, NULL); } -void NamedHotspot::synchronise(Serialiser &s) { - SceneHotspot::synchronise(s); +void NamedHotspot::synchronize(Serializer &s) { + SceneHotspot::synchronize(s); s.syncAsSint16LE(_resnum); s.syncAsSint16LE(_lookLineNum); s.syncAsSint16LE(_useLineNum); @@ -1612,8 +1617,8 @@ void SceneObjectWrapper::setSceneObject(SceneObject *so) { so->_flags |= OBJFLAG_PANES; } -void SceneObjectWrapper::synchronise(Serialiser &s) { - EventHandler::synchronise(s); +void SceneObjectWrapper::synchronize(Serializer &s) { + EventHandler::synchronize(s); SYNC_POINTER(_sceneObject); } @@ -1891,7 +1896,7 @@ int SceneObject::checkRegion(const Common::Point &pt) { } newY -= _yDiff; - SynchronisedList<SceneObject *>::iterator i; + SynchronizedList<SceneObject *>::iterator i; for (i = _globals->_sceneObjects->begin(); (regionIndex == 0) && (i != _globals->_sceneObjects->end()); ++i) { if ((*i) && ((*i)->_flags & OBJFLAG_CHECK_REGION)) { int objYDiff = (*i)->_position.y - _yDiff; @@ -2010,8 +2015,8 @@ int SceneObject::getSpliceArea(const SceneObject *obj) { return (xd * xd + yd) / 2; } -void SceneObject::synchronise(Serialiser &s) { - SceneHotspot::synchronise(s); +void SceneObject::synchronize(Serializer &s) { + SceneHotspot::synchronize(s); s.syncAsUint32LE(_updateStartFrame); s.syncAsUint32LE(_walkStartFrame); @@ -2022,8 +2027,8 @@ void SceneObject::synchronise(Serialiser &s) { s.syncAsUint32LE(_flags); s.syncAsSint16LE(_xs); s.syncAsSint16LE(_xe); - _paneRects[0].synchronise(s); - _paneRects[1].synchronise(s); + _paneRects[0].synchronize(s); + _paneRects[1].synchronize(s); s.syncAsSint32LE(_visage); SYNC_POINTER(_objectWrapper); s.syncAsSint32LE(_strip); @@ -2316,7 +2321,7 @@ void SceneObjectList::draw() { uint32 flagMask = (paneNum == 0) ? OBJFLAG_PANE_0 : OBJFLAG_PANE_1; // Initial loop to set up object list and update object position, priority, and flags - for (SynchronisedList<SceneObject *>::iterator i = _globals->_sceneObjects->begin(); + for (SynchronizedList<SceneObject *>::iterator i = _globals->_sceneObjects->begin(); i != _globals->_sceneObjects->end(); ++i) { SceneObject *obj = *i; objList.push_back(obj); @@ -2470,7 +2475,7 @@ void SceneObjectList::activate() { _globals->_sceneObjects_queue.push_front(this); // Flag all the objects as modified - SynchronisedList<SceneObject *>::iterator i; + SynchronizedList<SceneObject *>::iterator i; for (i = begin(); i != end(); ++i) { (*i)->_flags |= OBJFLAG_PANES; } @@ -2491,7 +2496,7 @@ void SceneObjectList::deactivate() { _globals->_sceneObjects_queue.pop_front(); _globals->_sceneObjects = *_globals->_sceneObjects_queue.begin(); - SynchronisedList<SceneObject *>::iterator i; + SynchronizedList<SceneObject *>::iterator i; for (i = objectList->begin(); i != objectList->end(); ++i) { if (!((*i)->_flags & OBJFLAG_CLONED)) { SceneObject *sceneObj = (*i)->clone(); @@ -2501,9 +2506,10 @@ void SceneObjectList::deactivate() { } } -void SceneObjectList::synchronise(Serialiser &s) { - SavedObject::synchronise(s); - _objList.synchronise(s); +void SceneObjectList::synchronize(Serializer &s) { + if (s.getVersion() >= 2) + SavedObject::synchronize(s); + _objList.synchronize(s); } /*--------------------------------------------------------------------------*/ @@ -2530,6 +2536,8 @@ void SceneText::setup(const Common::String &msg) { gfxMan._font._colors2.foreground = _color3; gfxMan.getStringBounds(msg.c_str(), textRect, _width); + _bounds.setWidth(textRect.width()); + _bounds.setHeight(textRect.height()); // Set up a new blank surface to hold the text _textSurface.create(textRect.width(), textRect.height()); @@ -2545,8 +2553,8 @@ void SceneText::setup(const Common::String &msg) { gfxMan.deactivate(); } -void SceneText::synchronise(Serialiser &s) { - SceneObject::synchronise(s); +void SceneText::synchronize(Serializer &s) { + SceneObject::synchronize(s); s.syncAsSint16LE(_fontNumber); s.syncAsSint16LE(_width); @@ -2615,6 +2623,12 @@ int Visage::getFrameCount() const { /*--------------------------------------------------------------------------*/ +Player::Player(): SceneObject() { + _canWalk = false; + _uiEnabled = false; + _field8C = 0; +} + void Player::postInit(SceneObjectList *OwnerList) { SceneObject::postInit(); @@ -2664,8 +2678,8 @@ void Player::process(Event &event) { } } -void Player::synchronise(Serialiser &s) { - SceneObject::synchronise(s); +void Player::synchronize(Serializer &s) { + SceneObject::synchronize(s); s.syncAsByte(_canWalk); s.syncAsByte(_uiEnabled); @@ -2897,15 +2911,22 @@ void Region::uniteRect(const Rect &rect) { void SceneRegions::load(int sceneNum) { clear(); - - byte *regionData = _resourceManager->getResource(RES_CONTROL, sceneNum, 9999, true); + bool altRegions = _vm->getFeatures() & GF_ALT_REGIONS; + byte *regionData = _resourceManager->getResource(RES_CONTROL, sceneNum, altRegions ? 1 : 9999, true); if (regionData) { int regionCount = READ_LE_UINT16(regionData); for (int regionCtr = 0; regionCtr < regionCount; ++regionCtr) { - int rlbNum = READ_LE_UINT16(regionData + regionCtr * 6 + 2); + int regionId = READ_LE_UINT16(regionData + regionCtr * 6 + 2); - push_back(Region(sceneNum, rlbNum)); + if (altRegions) { + // Load data from within this resource + uint32 dataOffset = READ_LE_UINT32(regionData + regionCtr * 6 + 4); + push_back(Region(regionId, regionData + dataOffset)); + } else { + // Load region from a separate resource + push_back(Region(sceneNum, regionId)); + } } DEALLOCATE(regionData); @@ -3424,11 +3445,12 @@ void GameHandler::execute() { } } -void GameHandler::synchronise(Serialiser &s) { - EventHandler::synchronise(s); +void GameHandler::synchronize(Serializer &s) { + if (s.getVersion() >= 2) + EventHandler::synchronize(s); - _lockCtr.synchronise(s); - _waitCtr.synchronise(s); + _lockCtr.synchronize(s); + _waitCtr.synchronize(s); s.syncAsSint16LE(_nextWaitCtr); s.syncAsSint16LE(_field14); } @@ -3459,52 +3481,11 @@ void SceneHandler::postInit(SceneObjectList *OwnerList) { void SceneHandler::process(Event &event) { // Main keypress handler - if ((event.eventType == EVENT_KEYPRESS) && !event.handled) { - switch (event.kbd.keycode) { - case Common::KEYCODE_F1: - // F1 - Help - MessageDialog::show((_vm->getFeatures() & GF_DEMO) ? DEMO_HELP_MSG : HELP_MSG, OK_BTN_STRING); - break; - - case Common::KEYCODE_F2: { - // F2 - Sound Options - ConfigDialog *dlg = new ConfigDialog(); - dlg->runModal(); - delete dlg; - _globals->_events.setCursorFromFlag(); - break; - } - - case Common::KEYCODE_F3: - // F3 - Quit - _globals->_game->quitGame(); - event.handled = false; - break; - - case Common::KEYCODE_F4: - // F4 - Restart - _globals->_game->restartGame(); - _globals->_events.setCursorFromFlag(); - break; - - case Common::KEYCODE_F7: - // F7 - Restore - _globals->_game->restoreGame(); - _globals->_events.setCursorFromFlag(); - break; + if (!event.handled) { + _globals->_game->processEvent(event); - case Common::KEYCODE_F10: - // F10 - Pause - GfxDialog::setPalette(); - MessageDialog::show(GAME_PAUSED_MSG, OK_BTN_STRING); + if (event.eventType == EVENT_KEYPRESS) _globals->_events.setCursorFromFlag(); - break; - - default: - break; - } - - _globals->_events.setCursorFromFlag(); } // Check for displaying right-click dialog @@ -3543,7 +3524,7 @@ void SceneHandler::process(Event &event) { if (_globals->_player._uiEnabled && (event.eventType == EVENT_BUTTON_DOWN) && !_globals->_sceneItems.empty()) { // Scan the item list to find one the mouse is within - SynchronisedList<SceneItem *>::iterator i = _globals->_sceneItems.begin(); + SynchronizedList<SceneItem *>::iterator i = _globals->_sceneItems.begin(); while ((i != _globals->_sceneItems.end()) && !(*i)->contains(event.mousePos)) ++i; @@ -3621,26 +3602,8 @@ void SceneHandler::dispatchObject(EventHandler *obj) { obj->dispatch(); } -void SceneHandler::saveListener(Serialiser &ser) { +void SceneHandler::saveListener(Serializer &ser) { warning("TODO: SceneHandler::saveListener"); } -/*--------------------------------------------------------------------------*/ - -void Game::execute() { - // Main game loop - bool activeFlag = false; - do { - // Process all currently atcive game handlers - activeFlag = false; - for (SynchronisedList<GameHandler *>::iterator i = _handlers.begin(); i != _handlers.end(); ++i) { - GameHandler *gh = *i; - if (gh->_lockCtr.getCtr() == 0) { - gh->execute(); - activeFlag = true; - } - } - } while (activeFlag && !_vm->getEventManager()->shouldQuit()); -} - } // End of namespace tSage diff --git a/engines/tsage/core.h b/engines/tsage/core.h index 45a39b24bb..71130e5b0b 100644 --- a/engines/tsage/core.h +++ b/engines/tsage/core.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef TSAGE_CORE_H @@ -47,7 +44,7 @@ class SceneObject; class SceneObjectList; class ObjectMover; class Action; -class Serialiser; +class Serializer; class InvObject : public SavedObject { public: @@ -66,20 +63,20 @@ public: void setCursor(); virtual Common::String getClassName() { return "InvObject"; } - virtual void synchronise(Serialiser &s) { + virtual void synchronize(Serializer &s) { s.syncAsUint16LE(_sceneNumber); } }; class InvObjectList : public SavedObject { public: - SynchronisedList<InvObject *> _itemList; + SynchronizedList<InvObject *> _itemList; InvObject *_selectedItem; InvObjectList(); virtual Common::String getClassName() { return "InvObjectList"; } - virtual void synchronise(Serialiser &s); + virtual void synchronize(Serializer &s); }; /*--------------------------------------------------------------------------*/ @@ -105,7 +102,7 @@ public: int incCtr() { return ++_ctr; } int getCtr() const { return _ctr; } - virtual void synchronise(Serialiser &s) { s.syncAsSint16LE(_ctr); } + virtual void synchronize(Serializer &s) { s.syncAsSint16LE(_ctr); } }; class EventHandler : public SavedObject { @@ -115,7 +112,7 @@ public: EventHandler() : SavedObject() { _action = NULL; } virtual ~EventHandler() { destroy(); } - virtual void synchronise(Serialiser &s) { SYNC_POINTER(_action); } + virtual void synchronize(Serializer &s) { SYNC_POINTER(_action); } virtual Common::String getClassName() { return "EventHandler"; } virtual void postInit(SceneObjectList *OwnerList = NULL) {} virtual void remove() {} @@ -138,7 +135,7 @@ public: Action(); - virtual void synchronise(Serialiser &s); + virtual void synchronize(Serializer &s); virtual Common::String getClassName() { return "Action"; } virtual void remove(); virtual void process(Event &event); @@ -175,7 +172,7 @@ public: ObjectMover() { _action = NULL; _sceneObject = NULL; } virtual ~ObjectMover(); - virtual void synchronise(Serialiser &s); + virtual void synchronize(Serializer &s); virtual Common::String getClassName() { return "ObjectMover"; } virtual void remove(); virtual void dispatch(); @@ -194,7 +191,7 @@ public: ObjectMover2(); virtual ~ObjectMover2() {} - virtual void synchronise(Serialiser &s); + virtual void synchronize(Serializer &s); virtual Common::String getClassName() { return "ObjectMover2"; } virtual void dispatch(); virtual void startMove(SceneObject *sceneObj, va_list va); @@ -244,7 +241,7 @@ public: Common::Point _routeList[MAX_ROUTE_SIZE]; int _routeIndex; - virtual void synchronise(Serialiser &s); + virtual void synchronize(Serializer &s); virtual Common::String getClassName() { return "PlayerMover"; } virtual void startMove(SceneObject *sceneObj, va_list va); virtual void endMove(); @@ -257,7 +254,7 @@ public: int _minArea; PlayerMover2() : PlayerMover() { _destObject = NULL; } - virtual void synchronise(Serialiser &s); + virtual void synchronize(Serializer &s); virtual Common::String getClassName() { return "PlayerMover2"; } virtual void dispatch(); virtual void startMove(SceneObject *sceneObj, va_list va); @@ -275,7 +272,7 @@ public: public: PaletteModifier(); - virtual void synchronise(Serialiser &s) { + virtual void synchronize(Serializer &s) { SYNC_POINTER(_scenePalette); SYNC_POINTER(_action); } @@ -293,7 +290,7 @@ public: void setPalette(ScenePalette *palette, int step); virtual Common::String getClassName() { return "PaletteModifierCached"; } - virtual void synchronise(Serialiser &s); + virtual void synchronize(Serializer &s); }; class PaletteRotation: public PaletteModifierCached { @@ -309,7 +306,7 @@ public: PaletteRotation(); virtual Common::String getClassName() { return "PaletteRotation"; } - virtual void synchronise(Serialiser &s); + virtual void synchronize(Serializer &s); virtual void signal(); virtual void remove(); @@ -324,7 +321,7 @@ public: byte _palette[256 * 3]; public: virtual Common::String getClassName() { return "PaletteFader"; } - virtual void synchronise(Serialiser &s); + virtual void synchronize(Serializer &s); virtual void signal(); virtual void remove(); }; @@ -337,7 +334,7 @@ class ScenePalette : public SavedObject { public: byte _palette[256 * 3]; GfxColors _colors; - SynchronisedList<PaletteModifier *> _listeners; + SynchronizedList<PaletteModifier *> _listeners; int _field412; uint8 _redColor; @@ -349,6 +346,7 @@ public: public: ScenePalette(); ScenePalette(int paletteNum); + ~ScenePalette(); bool loadPalette(int paletteNum); void refresh(); @@ -363,7 +361,7 @@ public: static void changeBackground(const Rect &bounds, FadeMode fadeMode); - virtual void synchronise(Serialiser &s); + virtual void synchronize(Serializer &s); virtual Common::String getClassName() { return "ScenePalette"; } }; @@ -392,7 +390,7 @@ public: public: SceneItem() : EventHandler() { _msg = "Feature"; _action = NULL; _sceneRegionId = 0; } - virtual void synchronise(Serialiser &s); + virtual void synchronize(Serializer &s); virtual Common::String getClassName() { return "SceneItem"; } virtual void remove(); virtual void destroy() {} @@ -413,8 +411,8 @@ public: int _state; virtual Common::String getClassName() { return "SceneItemExt"; } - virtual void synchronise(Serialiser &s) { - SceneItem::synchronise(s); + virtual void synchronize(Serializer &s) { + SceneItem::synchronize(s); s.syncAsSint16LE(_state); } }; @@ -435,7 +433,7 @@ public: void setup(int ys, int xs, int ye, int xe, const int resnum, const int lookLineNum, const int useLineNum); virtual void doAction(int action); virtual Common::String getClassName() { return "NamedHotspot"; } - virtual void synchronise(Serialiser &s); + virtual void synchronize(Serializer &s); }; enum AnimateMode {ANIM_MODE_NONE = 0, ANIM_MODE_1 = 1, ANIM_MODE_2 = 2, ANIM_MODE_3 = 3, @@ -471,7 +469,7 @@ public: void setSceneObject(SceneObject *so); - virtual void synchronise(Serialiser &s); + virtual void synchronize(Serializer &s); virtual Common::String getClassName() { return "SceneObjectWrapper"; } virtual void remove(); virtual void dispatch(); @@ -545,7 +543,7 @@ public: int getSpliceArea(const SceneObject *obj); int getFrameCount(); - virtual void synchronise(Serialiser &s); + virtual void synchronize(Serializer &s); virtual Common::String getClassName() { return "SceneObject"; } virtual void postInit(SceneObjectList *OwnerList = NULL); virtual void remove(); @@ -565,8 +563,8 @@ class SceneObjectExt : public SceneObject { public: int _state; - virtual void synchronise(Serialiser &s) { - SceneObject::synchronise(s); + virtual void synchronize(Serializer &s) { + SceneObject::synchronize(s); s.syncAsSint16LE(_state); } virtual Common::String getClassName() { return "SceneObjectExt"; } @@ -587,7 +585,7 @@ public: void setup(const Common::String &msg); - virtual void synchronise(Serialiser &s); + virtual void synchronize(Serializer &s); virtual Common::String getClassName() { return "SceneText"; } virtual GfxSurface getFrame() { return _textSurface; } }; @@ -598,10 +596,10 @@ public: bool _uiEnabled; int _field8C; public: - Player() : SceneObject() {} + Player(); virtual Common::String getClassName() { return "Player"; } - virtual void synchronise(Serialiser &s); + virtual void synchronize(Serializer &s); virtual void postInit(SceneObjectList *OwnerList = NULL); virtual void process(Event &event); @@ -672,14 +670,14 @@ class SceneObjectList : public SavedObject { private: void checkIntersection(Common::Array<SceneObject *> &ObjList, uint ObjIndex, int PaneNum); - SynchronisedList<SceneObject *> _objList; + SynchronizedList<SceneObject *> _objList; bool _listAltered; public: SceneObjectList() { _listAltered = false; } void sortList(Common::Array<SceneObject *> &ObjList); virtual Common::String getClassName() { return "SceneObjectList"; } - virtual void synchronise(Serialiser &s); + virtual void synchronize(Serializer &s); void draw(); void activate(); @@ -689,14 +687,14 @@ public: void recurse(EventHandlerFn Fn) { // Loop through each object _listAltered = false; - for (SynchronisedList<SceneObject *>::iterator i = _objList.begin(); i != _objList.end() && !_listAltered; ) { + for (SynchronizedList<SceneObject *>::iterator i = _objList.begin(); i != _objList.end() && !_listAltered; ) { SceneObject *o = *i; ++i; Fn(o); } } - SynchronisedList<SceneObject *>::iterator begin() { return _objList.begin(); } - SynchronisedList<SceneObject *>::iterator end() { return _objList.end(); } + SynchronizedList<SceneObject *>::iterator begin() { return _objList.begin(); } + SynchronizedList<SceneObject *>::iterator end() { return _objList.end(); } int size() const { return _objList.size(); } bool contains(SceneObject *sceneObj) { return tSage::contains(_objList, sceneObj); } void push_back(SceneObject *sceneObj) { _objList.push_back(sceneObj); } @@ -789,7 +787,7 @@ public: /*--------------------------------------------------------------------------*/ -class SceneItemList : public SynchronisedList<SceneItem *> { +class SceneItemList : public SynchronizedList<SceneItem *> { public: void addItems(SceneItem *first, ...); }; @@ -886,7 +884,7 @@ public: virtual ~GameHandler(); void execute(); - virtual void synchronise(Serialiser &s); + virtual void synchronize(Serializer &s); virtual Common::String getClassName() { return "GameHandler"; } virtual void postInit(SceneObjectList *OwnerList = NULL) {} virtual void dispatch() {} @@ -908,31 +906,7 @@ public: virtual void dispatch(); static void dispatchObject(EventHandler *obj); - static void saveListener(Serialiser &ser); -}; - -/*--------------------------------------------------------------------------*/ - -class Game { -protected: - SynchronisedList<GameHandler *> _handlers; - - static bool notLockedFn(GameHandler *g); - virtual void handleSaveLoad(bool saveFlag, int &saveSlot, Common::String &saveName) {} -public: - virtual ~Game() {} - - void addHandler(GameHandler *entry) { _handlers.push_back(entry); } - void removeHandler(GameHandler *entry) { _handlers.remove(entry); } - - void execute(); - virtual void start() = 0; - virtual void restart() {} - virtual void restartGame() {} - virtual void saveGame() {} - virtual void restoreGame() {} - virtual void quitGame() {} - virtual void endGame(int resNum, int lineNum) {} + static void saveListener(Serializer &ser); }; } // End of namespace tSage diff --git a/engines/tsage/debugger.cpp b/engines/tsage/debugger.cpp index eecc844292..42ae366ced 100644 --- a/engines/tsage/debugger.cpp +++ b/engines/tsage/debugger.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "tsage/debugger.h" @@ -40,8 +37,7 @@ Debugger::Debugger() : GUI::Debugger() { DCmd_Register("clearflag", WRAP_METHOD(Debugger, Cmd_ClearFlag)); DCmd_Register("listobjects", WRAP_METHOD(Debugger, Cmd_ListObjects)); DCmd_Register("moveobject", WRAP_METHOD(Debugger, Cmd_MoveObject)); - - DCmd_Register("item", WRAP_METHOD(Debugger, Cmd_Item)); + DCmd_Register("hotspots", WRAP_METHOD(Debugger, Cmd_Hotspots)); } static int strToInt(const char *s) { @@ -388,11 +384,53 @@ bool Debugger::Cmd_MoveObject(int argc, const char **argv) { } /** - * Give a specified item to the player + * Show any active hotspot areas in the scene */ -bool Debugger::Cmd_Item(int argc, const char **argv) { - RING_INVENTORY._stasisBox._sceneNumber = 1; - return true; +bool Debugger::Cmd_Hotspots(int argc, const char **argv) { + int colIndex = 16; + const Rect &sceneBounds = _globals->_sceneManager._scene->_sceneBounds; + + // Lock the background surface for access + Graphics::Surface destSurface = _globals->_sceneManager._scene->_backSurface.lockSurface(); + + // Iterate through the scene items + SynchronizedList<SceneItem *>::iterator i; + for (i = _globals->_sceneItems.reverse_begin(); i != _globals->_sceneItems.end(); --i, ++colIndex) { + SceneItem *o = *i; + + // Draw the contents of the hotspot area + if (o->_sceneRegionId == 0) { + // Scene item doesn't use a region, so fill in the entire area + destSurface.fillRect(Rect(o->_bounds.left - sceneBounds.left, o->_bounds.top - sceneBounds.top, + o->_bounds.right - sceneBounds.left - 1, o->_bounds.bottom - sceneBounds.top - 1), colIndex); + } else { + // Scene uses a region, so get it and use it to fill out only the correct parts + SceneRegions::iterator ri = _globals->_sceneRegions.begin(); + while ((ri != _globals->_sceneRegions.end()) && ((*ri)._regionId != o->_sceneRegionId)) + ++ri; + + if (ri != _globals->_sceneRegions.end()) { + // Fill out the areas defined by the region + Region &r = *ri; + + for (int y = r._bounds.top; y < r._bounds.bottom; ++y) { + LineSliceSet set = r.getLineSlices(y); + + for (uint p = 0; p < set.items.size(); ++p) + destSurface.hLine(set.items[p].xs - sceneBounds.left, y - sceneBounds.top, + set.items[p].xe - sceneBounds.left - 1, colIndex); + } + } + } + } + + // Release the surface + _globals->_sceneManager._scene->_backSurface.unlockSurface(); + + // Mark the scene as requiring a full redraw + _globals->_paneRefreshFlag[0] = 2; + + return false; } diff --git a/engines/tsage/debugger.h b/engines/tsage/debugger.h index a34bb1ef0a..3c14cd7bed 100644 --- a/engines/tsage/debugger.h +++ b/engines/tsage/debugger.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef TSAGE_DEBUGGER_H @@ -46,7 +43,7 @@ protected: bool Cmd_ListObjects(int argc, const char **argv); bool Cmd_MoveObject(int argc, const char **argv); - bool Cmd_Item(int argc, const char **argv); + bool Cmd_Hotspots(int argc, const char **argv); }; } // End of namespace tSage diff --git a/engines/tsage/detection.cpp b/engines/tsage/detection.cpp index ba7b459304..20c2002257 100644 --- a/engines/tsage/detection.cpp +++ b/engines/tsage/detection.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/config-manager.h" @@ -91,7 +88,7 @@ public: } virtual const char *getName() const { - return "TsAGE Engine"; + return "TsAGE"; } virtual const char *getOriginalCopyright() const { diff --git a/engines/tsage/detection_tables.h b/engines/tsage/detection_tables.h index d165900d55..dc55f2a66d 100644 --- a/engines/tsage/detection_tables.h +++ b/engines/tsage/detection_tables.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ namespace tSage { @@ -112,7 +109,34 @@ static const tSageGameDescription gameDescriptions[] = { GType_BlueForce, GF_FLOPPY }, - + // Blue Force floppy + { + { + "blueforce", + "Floppy", + AD_ENTRY1s("blue.rlb", "17c3993415e8a2cf93040eef7e88ec93", 1156508), + Common::EN_ANY, + Common::kPlatformPC, + ADGF_NO_FLAGS, + Common::GUIO_NONE + }, + GType_BlueForce, + GF_FLOPPY + }, + // Blue Force CD and First Wave use the same files + { + { + "blueforce", + "CD", + AD_ENTRY1s("blue.rlb", "ac29f38184cb3b874ea18523059872ba", 63863322), + Common::EN_ANY, + Common::kPlatformPC, + ADGF_NO_FLAGS, + Common::GUIO_NONE + }, + GType_BlueForce, + GF_CD + }, { AD_TABLE_END_MARKER, 0, 0 } }; diff --git a/engines/tsage/dialogs.cpp b/engines/tsage/dialogs.cpp index b5f00bf73c..759deebbef 100644 --- a/engines/tsage/dialogs.cpp +++ b/engines/tsage/dialogs.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/translation.h" @@ -73,12 +70,11 @@ MessageDialog::MessageDialog(const Common::String &message, const Common::String int MessageDialog::show(const Common::String &message, const Common::String &btn1Message, const Common::String &btn2Message) { // Ensure that the cursor is the arrow - _globals->_events.pushCursor(CURSOR_ARROW); - _globals->_events.showCursor(); + _globals->_events.setCursor(CURSOR_ARROW); int result = show2(message, btn1Message, btn2Message); - _globals->_events.popCursor(); + _globals->_events.setCursorFromFlag(); return result; } @@ -379,7 +375,7 @@ bool GfxInvImage::process(Event &event) { void InventoryDialog::show() { // Determine how many items are in the player's inventory int itemCount = 0; - SynchronisedList<InvObject *>::iterator i; + SynchronizedList<InvObject *>::iterator i; for (i = RING_INVENTORY._itemList.begin(); i != RING_INVENTORY._itemList.end(); ++i) { if ((*i)->inInventory()) ++itemCount; @@ -400,7 +396,7 @@ InventoryDialog::InventoryDialog() { // Determine the maximum size of the image of any item in the player's inventory int imgWidth = 0, imgHeight = 0; - SynchronisedList<InvObject *>::iterator i; + SynchronizedList<InvObject *>::iterator i; for (i = RING_INVENTORY._itemList.begin(); i != RING_INVENTORY._itemList.end(); ++i) { InvObject *invObject = *i; if (invObject->inInventory()) { @@ -472,8 +468,10 @@ void InventoryDialog::execute() { while (!_vm->getEventManager()->shouldQuit()) { // Get events Event event; - while (!_globals->_events.getEvent(event) && !_vm->getEventManager()->shouldQuit()) - ; + while (!_globals->_events.getEvent(event) && !_vm->getEventManager()->shouldQuit()) { + g_system->delayMillis(10); + g_system->updateScreen(); + } if (_vm->getEventManager()->shouldQuit()) return; diff --git a/engines/tsage/dialogs.h b/engines/tsage/dialogs.h index c24fa2dd3b..a50307f775 100644 --- a/engines/tsage/dialogs.h +++ b/engines/tsage/dialogs.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef TSAGE_DIALOGS_H diff --git a/engines/tsage/events.cpp b/engines/tsage/events.cpp index bcfff9fc1d..e889c56c4d 100644 --- a/engines/tsage/events.cpp +++ b/engines/tsage/events.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/events.h" @@ -38,7 +35,7 @@ namespace tSage { EventsClass::EventsClass() { _currentCursor = CURSOR_NONE; - hideCursor(); + _lastCursor = CURSOR_NONE; _frameNumber = 0; _priorFrameTime = 0; _prevDelayFrame = 0; @@ -140,17 +137,11 @@ bool EventsClass::getEvent(Event &evt, int eventMask) { * @cursorType Specified cursor number */ void EventsClass::setCursor(CursorType cursorType) { - _globals->clearFlag(122); - - if ((_currentCursor == cursorType) && CursorMan.isVisible()) + if (cursorType == _lastCursor) return; - if (cursorType == CURSOR_NONE) { - if (CursorMan.isVisible()) - CursorMan.showMouse(false); - return; - } - + _lastCursor = cursorType; + _globals->clearFlag(122); CursorMan.showMouse(true); const byte *cursor; @@ -158,10 +149,15 @@ void EventsClass::setCursor(CursorType cursorType) { uint size; switch (cursorType) { - case CURSOR_CROSSHAIRS: - // Crosshairs cursor - cursor = _resourceManager->getSubResource(4, 1, 6, &size); + case CURSOR_NONE: + // No cursor _globals->setFlag(122); + + if (_vm->getFeatures() & GF_DEMO) { + CursorMan.showMouse(false); + return; + } + cursor = _resourceManager->getSubResource(4, 1, 6, &size); break; case CURSOR_LOOK: @@ -215,8 +211,8 @@ void EventsClass::pushCursor(CursorType cursorType) { uint size; switch (cursorType) { - case CURSOR_CROSSHAIRS: - // Crosshairs cursor + case CURSOR_NONE: + // No cursor cursor = _resourceManager->getSubResource(4, 1, 6, &size); break; @@ -273,19 +269,19 @@ void EventsClass::setCursor(Graphics::Surface &cursor, int transColor, const Com } void EventsClass::setCursorFromFlag() { - setCursor(_globals->getFlag(122) ? CURSOR_CROSSHAIRS : _currentCursor); + setCursor(isCursorVisible() ? _currentCursor : CURSOR_NONE); } void EventsClass::showCursor() { - CursorMan.showMouse(true); + setCursor(_currentCursor); } void EventsClass::hideCursor() { - CursorMan.showMouse(false); + setCursor(CURSOR_NONE); } bool EventsClass::isCursorVisible() const { - return CursorMan.isVisible(); + return !_globals->getFlag(122); } /** diff --git a/engines/tsage/events.h b/engines/tsage/events.h index 90516b2353..9a7bdbe82c 100644 --- a/engines/tsage/events.h +++ b/engines/tsage/events.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef TSAGE_EVENTS_H @@ -80,6 +77,7 @@ public: Common::Point _mousePos; CursorType _currentCursor; + CursorType _lastCursor; void setCursor(CursorType cursorType); void pushCursor(CursorType cursorType); @@ -100,10 +98,10 @@ public: uint32 getFrameNumber() const { return _frameNumber; } void delay(int numFrames); - virtual void listenerSynchronise(Serialiser &s) { + virtual void listenerSynchronize(Serializer &s) { s.syncAsUint32LE(_frameNumber); s.syncAsUint32LE(_prevDelayFrame); - // TODO: Synchronise unknown stuff + // TODO: Synchronize unknown stuff } }; diff --git a/engines/tsage/globals.cpp b/engines/tsage/globals.cpp index 10db2e9c5d..e38fb21237 100644 --- a/engines/tsage/globals.cpp +++ b/engines/tsage/globals.cpp @@ -18,13 +18,12 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "tsage/globals.h" #include "tsage/tsage.h" +#include "tsage/blueforce_logic.h" +#include "tsage/ringworld_demo.h" #include "tsage/ringworld_logic.h" namespace tSage { @@ -44,15 +43,17 @@ static SavedObject *classFactoryProc(const Common::String &className) { if (className == "ObjectMover3") return new ObjectMover3(); if (className == "PlayerMover") return new PlayerMover(); if (className == "SceneObjectWrapper") return new SceneObjectWrapper(); - + if (className == "PaletteRotation") return new PaletteRotation(); + if (className == "PaletteFader") return new PaletteFader(); return NULL; } /*--------------------------------------------------------------------------*/ Globals::Globals() : - _dialogCenter(160, 140), - _gfxManagerInstance(_screenSurface) { + _dialogCenter(160, 140), + _gfxManagerInstance(_screenSurface), + _randomSource("tsage") { reset(); _stripNum = 0; @@ -83,16 +84,26 @@ Globals::Globals() : _scrollFollower = NULL; _inventory = NULL; - if (!(_vm->getFeatures() & GF_DEMO)) { - _inventory = new RingworldInvObjectList(); - _game = new RingworldGame(); - } else { - _game = new RingworldDemoGame(); + switch (_vm->getGameID()) { + case GType_Ringworld: + if (!(_vm->getFeatures() & GF_DEMO)) { + _inventory = new RingworldInvObjectList(); + _game = new RingworldGame(); + } else { + _game = new RingworldDemoGame(); + } + break; + + case GType_BlueForce: + _game = new BlueForceGame(); + break; } } Globals::~Globals() { _globals = NULL; + delete _inventory; + delete _game; } void Globals::reset() { @@ -100,13 +111,14 @@ void Globals::reset() { _saver->addFactory(classFactoryProc); } -void Globals::synchronise(Serialiser &s) { - SavedObject::synchronise(s); +void Globals::synchronize(Serializer &s) { + if (s.getVersion() >= 2) + SavedObject::synchronize(s); assert(_gfxManagers.size() == 1); - _sceneItems.synchronise(s); + _sceneItems.synchronize(s); SYNC_POINTER(_sceneObjects); - _sceneObjects_queue.synchronise(s); + _sceneObjects_queue.synchronize(s); s.syncAsSint32LE(_gfxFontNumber); s.syncAsSint32LE(_gfxColors.background); s.syncAsSint32LE(_gfxColors.foreground); @@ -114,7 +126,7 @@ void Globals::synchronise(Serialiser &s) { s.syncAsSint32LE(_fontColors.foreground); s.syncAsSint16LE(_dialogCenter.x); s.syncAsSint16LE(_dialogCenter.y); - _sceneListeners.synchronise(s); + _sceneListeners.synchronize(s); for (int i = 0; i < 256; ++i) s.syncAsByte(_flags[i]); diff --git a/engines/tsage/globals.h b/engines/tsage/globals.h index 9e9ddd58d7..bec05a3c9a 100644 --- a/engines/tsage/globals.h +++ b/engines/tsage/globals.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef TSAGE_GLOBALS_H @@ -49,7 +46,7 @@ public: SceneItemList _sceneItems; SceneObjectList _sceneObjectsInstance; SceneObjectList *_sceneObjects; - SynchronisedList<SceneObjectList *> _sceneObjects_queue; + SynchronizedList<SceneObjectList *> _sceneObjects_queue; SceneText _sceneText; int _gfxFontNumber; GfxColors _gfxColors; @@ -57,7 +54,7 @@ public: SoundManager _soundManager; Common::Point _dialogCenter; WalkRegions _walkRegions; - SynchronisedList<EventHandler *> _sceneListeners; + SynchronizedList<EventHandler *> _sceneListeners; bool _flags[256]; Player _player; SoundHandler _soundHandler; @@ -90,7 +87,7 @@ public: GfxManager &gfxManager() { return **_gfxManagers.begin(); } virtual Common::String getClassName() { return "Globals"; } - virtual void synchronise(Serialiser &s); + virtual void synchronize(Serializer &s); }; extern Globals *_globals; diff --git a/engines/tsage/graphics.cpp b/engines/tsage/graphics.cpp index af38f211b2..a212c5dd77 100644 --- a/engines/tsage/graphics.cpp +++ b/engines/tsage/graphics.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "tsage/events.h" @@ -212,7 +209,7 @@ void Rect::expandPanes() { /** * Serialises the given rect */ -void Rect::synchronise(Serialiser &s) { +void Rect::synchronize(Serializer &s) { s.syncAsSint16LE(left); s.syncAsSint16LE(top); s.syncAsSint16LE(right); @@ -227,6 +224,7 @@ GfxSurface::GfxSurface() : _bounds(0, 0, SCREEN_WIDTH, SCREEN_HEIGHT) { _lockSurfaceCtr = 0; _customSurface = NULL; _screenSurfaceP = NULL; + _transColor = -1; } GfxSurface::GfxSurface(const GfxSurface &s) { @@ -257,8 +255,13 @@ void GfxSurface::setScreenSurface() { void GfxSurface::create(int width, int height) { assert((width >= 0) && (height >= 0)); _screenSurface = false; + if (_customSurface) { + _customSurface->free(); + delete _customSurface; + } _customSurface = new Graphics::Surface(); _customSurface->create(width, height, Graphics::PixelFormat::createFormatCLUT8()); + Common::set_to((byte *)_customSurface->pixels, (byte *)_customSurface->pixels + (width * height), 0); _bounds = Rect(0, 0, width, height); } @@ -417,11 +420,11 @@ static int *scaleLine(int size, int srcSize) { int *v = new int[size]; Common::set_to(v, &v[size], -1); - int distCtr = 0; + int distCtr = PRECISION_FACTOR / 2; int *destP = v; for (int distIndex = 0; distIndex < srcSize; ++distIndex) { distCtr += scale; - while (distCtr >= PRECISION_FACTOR) { + while (distCtr > PRECISION_FACTOR) { assert(destP < &v[size]); *destP++ = distIndex; distCtr -= PRECISION_FACTOR; @@ -667,12 +670,18 @@ void GfxElement::drawFrame() { * @event Event to process */ bool GfxElement::focusedEvent(Event &event) { + Common::Point mousePos = event.mousePos; bool highlightFlag = false; - while (!_vm->getEventManager()->shouldQuit()) { + // HACK: It should use the GfxManager object to figure out the relative + // position, but for now this seems like the easiest way. + int xOffset = mousePos.x - _globals->_events._mousePos.x; + int yOffset = mousePos.y - _globals->_events._mousePos.y; + + while (event.eventType != EVENT_BUTTON_UP && !_vm->getEventManager()->shouldQuit()) { g_system->delayMillis(10); - if (_bounds.contains(event.mousePos)) { + if (_bounds.contains(mousePos)) { if (!highlightFlag) { // First highlight call to show the highlight highlightFlag = true; @@ -684,8 +693,12 @@ bool GfxElement::focusedEvent(Event &event) { highlight(); } - if (_globals->_events.getEvent(event, EVENT_BUTTON_UP)) - break; + if (_globals->_events.getEvent(event, EVENT_MOUSE_MOVE | EVENT_BUTTON_UP)) { + if (event.eventType == EVENT_MOUSE_MOVE) { + mousePos.x = event.mousePos.x + xOffset; + mousePos.y = event.mousePos.y + yOffset; + } + } } if (highlightFlag) { @@ -964,9 +977,10 @@ GfxButton *GfxDialog::execute(GfxButton *defaultButton) { // Event loop GfxButton *selectedButton = NULL; - while (!_vm->getEventManager()->shouldQuit()) { + bool breakFlag = false; + while (!_vm->getEventManager()->shouldQuit() && !breakFlag) { Event event; - while (_globals->_events.getEvent(event)) { + while (_globals->_events.getEvent(event) && !breakFlag) { // Adjust mouse positions to be relative within the dialog event.mousePos.x -= _gfxManager._bounds.left; event.mousePos.y -= _gfxManager._bounds.top; @@ -975,19 +989,25 @@ GfxButton *GfxDialog::execute(GfxButton *defaultButton) { if ((*i)->process(event)) selectedButton = static_cast<GfxButton *>(*i); } - } - if (selectedButton) - break; - else if (!event.handled) { - if ((event.eventType == EVENT_KEYPRESS) && (event.kbd.keycode == Common::KEYCODE_ESCAPE)) { - selectedButton = NULL; - break; - } else if ((event.eventType == EVENT_KEYPRESS) && (event.kbd.keycode == Common::KEYCODE_RETURN)) { - selectedButton = defaultButton; + if (selectedButton) { + breakFlag = true; break; + } else if (!event.handled) { + if ((event.eventType == EVENT_KEYPRESS) && (event.kbd.keycode == Common::KEYCODE_ESCAPE)) { + selectedButton = NULL; + breakFlag = true; + break; + } else if ((event.eventType == EVENT_KEYPRESS) && (event.kbd.keycode == Common::KEYCODE_RETURN)) { + selectedButton = defaultButton; + breakFlag = true; + break; + } } } + + g_system->delayMillis(10); + g_system->updateScreen(); } _gfxManager.deactivate(); diff --git a/engines/tsage/graphics.h b/engines/tsage/graphics.h index c266d74bc5..c90833a95f 100644 --- a/engines/tsage/graphics.h +++ b/engines/tsage/graphics.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef RING_GRAPHICS_H @@ -55,7 +52,7 @@ public: void resize(const GfxSurface &surface, int xp, int yp, int percent); void expandPanes(); - virtual void synchronise(Serialiser &s); + virtual void synchronize(Serializer &s); }; class GfxColors { diff --git a/engines/tsage/module.mk b/engines/tsage/module.mk index 2f9194a9ba..aefc8b0992 100644 --- a/engines/tsage/module.mk +++ b/engines/tsage/module.mk @@ -1,6 +1,7 @@ MODULE := engines/tsage MODULE_OBJS := \ + blueforce_logic.o \ converse.o \ core.o \ debugger.o \ diff --git a/engines/tsage/resources.cpp b/engines/tsage/resources.cpp index 2b678a848a..676d319ba9 100644 --- a/engines/tsage/resources.cpp +++ b/engines/tsage/resources.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/scummsys.h" diff --git a/engines/tsage/resources.h b/engines/tsage/resources.h index 7b518cabd6..efbb86b24e 100644 --- a/engines/tsage/resources.h +++ b/engines/tsage/resources.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef RING_RESOURCES_H diff --git a/engines/tsage/ringworld_demo.cpp b/engines/tsage/ringworld_demo.cpp index 29438c0347..3ad414fa20 100644 --- a/engines/tsage/ringworld_demo.cpp +++ b/engines/tsage/ringworld_demo.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "tsage/ringworld_demo.h" @@ -30,6 +27,80 @@ namespace tSage { +void RingworldDemoGame::start() { + // Start the demo's single scene + _globals->_sceneManager.changeScene(1); + + _globals->_events.setCursor(CURSOR_NONE); +} + +Scene *RingworldDemoGame::createScene(int sceneNumber) { + // The demo only has a single scene, so ignore the scene number and always return it + return new RingworldDemoScene(); +} + +void RingworldDemoGame::quitGame() { + _globals->_events.setCursor(CURSOR_ARROW); + MessageDialog *dlg = new MessageDialog(DEMO_EXIT_MSG, EXIT_BTN_STRING, DEMO_BTN_STRING); + dlg->draw(); + + GfxButton *selectedButton = dlg->execute(&dlg->_btn2); + bool exitFlag = selectedButton != &dlg->_btn2; + + delete dlg; + _globals->_events.hideCursor(); + + if (exitFlag) + _vm->quitGame(); +} + +void RingworldDemoGame::pauseGame() { + _globals->_events.setCursor(CURSOR_ARROW); + MessageDialog *dlg = new MessageDialog(DEMO_PAUSED_MSG, EXIT_BTN_STRING, DEMO_RESUME_BTN_STRING); + dlg->draw(); + + GfxButton *selectedButton = dlg->execute(&dlg->_btn2); + bool exitFlag = selectedButton != &dlg->_btn2; + + delete dlg; + _globals->_events.hideCursor(); + + if (exitFlag) + _vm->quitGame(); +} + +void RingworldDemoGame::processEvent(Event &event) { + if (event.eventType == EVENT_KEYPRESS) { + switch (event.kbd.keycode) { + case Common::KEYCODE_F1: + // F1 - Help + MessageDialog::show(DEMO_HELP_MSG, OK_BTN_STRING); + break; + + case Common::KEYCODE_F2: { + // F2 - Sound Options + ConfigDialog *dlg = new ConfigDialog(); + dlg->runModal(); + delete dlg; + _globals->_events.setCursorFromFlag(); + break; + } + + case Common::KEYCODE_F3: + // F3 - Quit + quitGame(); + event.handled = false; + break; + + default: + break; + } + } else if (event.eventType == EVENT_BUTTON_DOWN) { + pauseGame(); + event.handled = true; + } +} + /*-------------------------------------------------------------------------- * Ringworld Demo scene * diff --git a/engines/tsage/ringworld_demo.h b/engines/tsage/ringworld_demo.h index 63ffe56555..7492c1e871 100644 --- a/engines/tsage/ringworld_demo.h +++ b/engines/tsage/ringworld_demo.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef TSAGE_RINGWORLD_DEMO_H @@ -34,6 +31,15 @@ namespace tSage { +class RingworldDemoGame: public Game { +private: + void pauseGame(); +public: + virtual void start(); + virtual Scene *createScene(int sceneNumber); + virtual void quitGame(); + virtual void processEvent(Event &event); +}; class RingworldDemoScene: public Scene { public: diff --git a/engines/tsage/ringworld_logic.cpp b/engines/tsage/ringworld_logic.cpp index 204f798f81..2141fcce5a 100644 --- a/engines/tsage/ringworld_logic.cpp +++ b/engines/tsage/ringworld_logic.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/config-manager.h" @@ -42,10 +39,7 @@ namespace tSage { -Scene *SceneFactory::createScene(int sceneNumber) { - if (_vm->getFeatures() & GF_DEMO) - return new RingworldDemoScene(); - +Scene *RingworldGame::createScene(int sceneNumber) { switch (sceneNumber) { /* Scene group 1 */ // Kziniti Palace (Introduction) @@ -307,7 +301,7 @@ void SceneArea::wait() { g_system->delayMillis(10); } - SynchronisedList<SceneItem *>::iterator ii; + SynchronizedList<SceneItem *>::iterator ii; for (ii = _globals->_sceneItems.begin(); ii != _globals->_sceneItems.end(); ++ii) { SceneItem *sceneItem = *ii; if (sceneItem->contains(event.mousePos)) { @@ -319,8 +313,9 @@ void SceneArea::wait() { _globals->_events.setCursor(CURSOR_ARROW); } -void SceneArea::synchronise(Serialiser &s) { - SavedObject::synchronise(s); +void SceneArea::synchronize(Serializer &s) { + if (s.getVersion() >= 2) + SavedObject::synchronize(s); s.syncAsSint16LE(_pt.x); s.syncAsSint16LE(_pt.y); @@ -328,7 +323,7 @@ void SceneArea::synchronise(Serialiser &s) { s.syncAsSint32LE(_rlbNum); s.syncAsSint32LE(_subNum); s.syncAsSint32LE(_actionId); - _bounds.synchronise(s); + _bounds.synchronize(s); } /*--------------------------------------------------------------------------*/ @@ -395,18 +390,18 @@ void SpeakerPOR::setText(const Common::String &msg) { _object1.postInit(&_objectList); _object1.setVisage(7223); _object1.setStrip2(2); - _object1.setPosition(Common::Point(191, 166), 0); - _object1.animate(ANIM_MODE_7, 0, 0); + _object1.setPosition(Common::Point(191, 166)); + _object1.animate(ANIM_MODE_7, 0, NULL); _object2.postInit(&_objectList); _object2.setVisage(7223); - _object2.setPosition(Common::Point(159, 86), 0); - _object2.setAction(&_speakerAction, 0); + _object2.setPosition(Common::Point(159, 86)); + _object2.setAction(&_speakerAction, NULL); _object3.postInit(&_objectList); _object3.setVisage(7223); _object3.setStrip(3); - _object3.setPosition(Common::Point(119, 107), 0); + _object3.setPosition(Common::Point(119, 107)); _object3.fixPriority(199); _object3.setAction(&_action2); @@ -430,8 +425,8 @@ void SpeakerOR::setText(const Common::String &msg) { _object1.fixPriority(255); _object1.changeZoom(100); _object1._frame = 1; - _object1.setPosition(Common::Point(202, 147), 0); - _object1.animate(ANIM_MODE_7, 0, 0); + _object1.setPosition(Common::Point(202, 147)); + _object1.animate(ANIM_MODE_7, 0, NULL); _object2.postInit(&_objectList); _object2.setVisage(9431); @@ -439,8 +434,8 @@ void SpeakerOR::setText(const Common::String &msg) { _object2.fixPriority(255); _object2.setZoom(100); _object2._frame = 1; - _object2.setPosition(Common::Point(199, 85), 0); - _object2.setAction(&_speakerAction, 0); + _object2.setPosition(Common::Point(199, 85)); + _object2.setAction(&_speakerAction, NULL); Speaker::setText(msg); } @@ -517,7 +512,7 @@ SpeakerEText::SpeakerEText() { /*--------------------------------------------------------------------------*/ -SpeakerGR::SpeakerGR() { +SpeakerGR::SpeakerGR() : AnimatedSpeaker() { _speakerName = "GR"; _newSceneNumber = 9220; _textWidth = 136; @@ -525,6 +520,19 @@ SpeakerGR::SpeakerGR() { _color1 = 14; } +void SpeakerGR::setText(const Common::String &msg) { + _object1.postInit(&_objectList); + _object1.setVisage(9221); + _object1.setStrip2(2); + _object1.fixPriority(255); + _object1.changeZoom(100); + _object1._frame = 1; + _object1.setPosition(Common::Point(101, 70)); + _object1.animate(ANIM_MODE_7, 0, NULL); + + Speaker::setText(msg); +} + /*--------------------------------------------------------------------------*/ SpeakerHText::SpeakerHText() { @@ -540,7 +548,7 @@ SpeakerSKText::SpeakerSKText() : ScreenSpeaker() { _speakerName = "SKTEXT"; _textWidth = 240; _textMode = ALIGN_CENTER; - _color1 = 5; + _color1 = 9; _hideObjects = false; } @@ -599,16 +607,16 @@ SpeakerSKL::SpeakerSKL() : AnimatedSpeaker() { _speakerName = "SKL"; _newSceneNumber = 7011; _textPos = Common::Point(10, 30); - _color1 = 10; + _color1 = 9; } void SpeakerSKL::setText(const Common::String &msg) { _object1.postInit(&_objectList); _object1.setVisage(7013); _object1.setStrip2(2); - _object1._frame = 1; _object1.fixPriority(255); _object1.changeZoom(100); + _object1._frame = 1; _object1.setPosition(Common::Point(203, 120)); _object1.animate(ANIM_MODE_7, 0, NULL); @@ -659,6 +667,7 @@ void SpeakerQL::setText(const Common::String &msg) { /*--------------------------------------------------------------------------*/ SpeakerSR::SpeakerSR() { + // TODO: check initialization of object3 _speakerName = "SR"; _newSceneNumber = 2811; _textPos = Common::Point(10, 30); @@ -735,7 +744,7 @@ SpeakerQR::SpeakerQR() { _speakerName = "QR"; _newSceneNumber = 2611; _textPos = Common::Point(10, 30); - _color1 = 13; + _color1 = 35; _textMode = ALIGN_CENTER; } @@ -778,8 +787,8 @@ void SpeakerQU::setText(const Common::String &msg) { _object1.fixPriority(255); _object1.changeZoom(100); _object1._frame = 1; - _object1.setPosition(Common::Point(116, 120), 0); - _object1.animate(ANIM_MODE_7, 0, 0); + _object1.setPosition(Common::Point(116, 120)); + _object1.animate(ANIM_MODE_7, 0, NULL); _object2.postInit(&_objectList); _object2.setVisage(7021); @@ -787,8 +796,8 @@ void SpeakerQU::setText(const Common::String &msg) { _object2.fixPriority(255); _object2.changeZoom(100); _object2._frame = 1; - _object2.setPosition(Common::Point(111, 84), 0); - _object2.setAction(&_speakerAction, 0); + _object2.setPosition(Common::Point(111, 84)); + _object2.setAction(&_speakerAction, NULL); Speaker::setText(msg); } @@ -825,7 +834,7 @@ void SpeakerCR::setText(const Common::String &msg) { SpeakerMR::SpeakerMR() { _speakerName = "MR"; _newSceneNumber = 2711; - _textPos = Common::Point(40, 10); + _textPos = Common::Point(10, 40); _color1 = 22; } @@ -843,6 +852,7 @@ void SpeakerMR::setText(const Common::String &msg) { _object2.setVisage(2713); _object2.setStrip2(1); _object2.fixPriority(255); + _object2.changeZoom(100); _object2._frame = 1; _object2.setPosition(Common::Point(215, 99)); _object2.setAction(&_speakerAction, NULL); @@ -874,6 +884,7 @@ void SpeakerSAL::setText(const Common::String &msg) { _object2.setVisage(2853); _object2.setStrip2(1); _object2.fixPriority(255); + _object2.changeZoom(100); _object2._frame = 1; _object2.setPosition(Common::Point(170, 92)); _object2.setAction(&_speakerAction, NULL); @@ -904,6 +915,7 @@ void SpeakerML::setText(const Common::String &msg) { _object2.setVisage(2712); _object2.setStrip2(1); _object2.fixPriority(255); + _object2.changeZoom(100); _object2._frame = 1; _object2.setPosition(Common::Point(105, 99)); _object2.setAction(&_speakerAction, NULL); @@ -934,6 +946,7 @@ void SpeakerCHFL::setText(const Common::String &msg) { _object2.setVisage(4113); _object2.setStrip2(1); _object2.fixPriority(255); + _object2.changeZoom(100); _object2._frame = 1; _object2.setPosition(Common::Point(202, 71)); _object2.setAction(&_speakerAction, NULL); @@ -964,6 +977,7 @@ void SpeakerCHFR::setText(const Common::String &msg) { _object2.setVisage(4112); _object2.setStrip2(1); _object2.fixPriority(255); + _object2.changeZoom(100); _object2._frame = 1; _object2.setPosition(Common::Point(106, 71)); _object2.setAction(&_speakerAction, NULL); @@ -994,6 +1008,7 @@ void SpeakerPL::setText(const Common::String &msg) { _object2.setVisage(4062); _object2.setStrip2(1); _object2.fixPriority(200); + _object2.changeZoom(100); _object2._frame = 1; _object2.setPosition(Common::Point(105, 62)); _object2.setAction(&_speakerAction, NULL); @@ -1002,6 +1017,7 @@ void SpeakerPL::setText(const Common::String &msg) { _object3.setVisage(4062); _object3.setStrip2(3); _object3.fixPriority(255); + _object3.changeZoom(100); _object3._frame = 1; _object3.setPosition(Common::Point(105, 59)); _object3.setAction(&_speakerAction2, NULL); @@ -1266,7 +1282,7 @@ void RingworldGame::restartGame() { } void RingworldGame::saveGame() { - if (_globals->getFlag(50)) + if (!_vm->canSaveGameStateCurrently()) MessageDialog::show(SAVING_NOT_ALLOWED_MSG, OK_BTN_STRING); else { // Show the save dialog @@ -1275,7 +1291,7 @@ void RingworldGame::saveGame() { } void RingworldGame::restoreGame() { - if (_globals->getFlag(50)) + if (!_vm->canLoadGameStateCurrently()) MessageDialog::show(RESTORING_NOT_ALLOWED_MSG, OK_BTN_STRING); else { // Show the load dialog @@ -1306,10 +1322,9 @@ void RingworldGame::handleSaveLoad(bool saveFlag, int &saveSlot, Common::String } void RingworldGame::start() { - // Set some default flags and cursor + // Set some default flags _globals->setFlag(12); _globals->setFlag(34); - _globals->_events.setCursor(CURSOR_WALK); // Set the screen to scroll in response to the player moving off-screen _globals->_scrollFollower = &_globals->_player; @@ -1394,11 +1409,11 @@ void RingworldGame::endGame(int resNum, int lineNum) { // Savegames exist, so prompt for Restore/Restart bool breakFlag; do { - if (MessageDialog::show(msg, RESTART_BTN_STRING, RESTORE_BTN_STRING) == 0) { + if (MessageDialog::show(msg, RESTART_BTN_STRING, RESTORE_BTN_STRING) == 0 || _vm->shouldQuit()) { breakFlag = true; } else { handleSaveLoad(false, _globals->_sceneHandler._loadGameSlot, _globals->_sceneHandler._saveName); - breakFlag = _globals->_sceneHandler._loadGameSlot > 0; + breakFlag = _globals->_sceneHandler._loadGameSlot >= 0; } } while (!breakFlag); } @@ -1406,16 +1421,52 @@ void RingworldGame::endGame(int resNum, int lineNum) { _globals->_events.setCursorFromFlag(); } -/*--------------------------------------------------------------------------*/ +void RingworldGame::processEvent(Event &event) { + if (event.eventType == EVENT_KEYPRESS) { + switch (event.kbd.keycode) { + case Common::KEYCODE_F1: + // F1 - Help + MessageDialog::show(HELP_MSG, OK_BTN_STRING); + break; -void RingworldDemoGame::start() { - // Start the demo's single scene - _globals->_sceneManager.changeScene(1); - - _globals->_events.setCursor(CURSOR_NONE); -} + case Common::KEYCODE_F2: { + // F2 - Sound Options + ConfigDialog *dlg = new ConfigDialog(); + dlg->runModal(); + delete dlg; + _globals->_events.setCursorFromFlag(); + break; + } + + case Common::KEYCODE_F3: + // F3 - Quit + quitGame(); + event.handled = false; + break; + + case Common::KEYCODE_F4: + // F4 - Restart + restartGame(); + _globals->_events.setCursorFromFlag(); + break; + + case Common::KEYCODE_F7: + // F7 - Restore + restoreGame(); + _globals->_events.setCursorFromFlag(); + break; + + case Common::KEYCODE_F10: + // F10 - Pause + GfxDialog::setPalette(); + MessageDialog::show(GAME_PAUSED_MSG, OK_BTN_STRING); + _globals->_events.setCursorFromFlag(); + break; -void RingworldDemoGame::restart() { + default: + break; + } + } } } // End of namespace tSage diff --git a/engines/tsage/ringworld_logic.h b/engines/tsage/ringworld_logic.h index eb395d59b8..19b0f10b42 100644 --- a/engines/tsage/ringworld_logic.h +++ b/engines/tsage/ringworld_logic.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef TSAGE_RINGWORLD_LOGIC_H @@ -97,7 +94,7 @@ public: void display(); void restore(); - virtual void synchronise(Serialiser &s); + virtual void synchronize(Serializer &s); virtual void draw(bool flag); virtual void wait(); }; @@ -192,6 +189,7 @@ public: SpeakerGR(); virtual Common::String getClassName() { return "SpeakerGR"; } + virtual void setText(const Common::String &msg); }; class SpeakerHText : public ScreenSpeaker { @@ -453,21 +451,11 @@ public: virtual void restoreGame(); virtual void quitGame(); virtual void endGame(int resNum, int lineNum); -}; -class RingworldDemoGame: public Game { -protected: - virtual void restart(); -public: - virtual void start(); - virtual void restartGame() {} - virtual void saveGame() {} - virtual void restoreGame() {} - virtual void quitGame() {} - virtual void endGame(int resNum, int lineNum) {} + virtual Scene *createScene(int sceneNumber); + virtual void processEvent(Event &event); }; - } // End of namespace tSage #endif diff --git a/engines/tsage/ringworld_scenes1.cpp b/engines/tsage/ringworld_scenes1.cpp index 9811cd52d3..b6daadbef7 100644 --- a/engines/tsage/ringworld_scenes1.cpp +++ b/engines/tsage/ringworld_scenes1.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "tsage/ringworld_scenes1.h" @@ -1762,6 +1759,8 @@ Scene50::Scene50() : _item3(8, OBJECT_STUNNER, 50, 14, OBJECT_SCANNER, 50, 13, CURSOR_LOOK, 50, 3, LIST_END), _item4(9, OBJECT_SCANNER, 40, 39, OBJECT_STUNNER, 40, 40, CURSOR_USE, 40, 41, CURSOR_LOOK, 50, 5, LIST_END), _item5(10, OBJECT_SCANNER, 50, 17, OBJECT_STUNNER, 50, 18, CURSOR_LOOK, 50, 6, CURSOR_USE, 30, 8, LIST_END) { + + _doorwayRect = Rect(80, 108, 160, 112); } void Scene50::postInit(SceneObjectList *OwnerList) { @@ -1824,7 +1823,6 @@ void Scene50::postInit(SceneObjectList *OwnerList) { _item0.setBounds(Rect(200, 0, 320, 200)); _globals->_sceneItems.addItems(&_item3, &_item4, &_item5, &_item0, NULL); - _doorwayRect = Rect(80, 108, 160, 112); } void Scene50::signal() { @@ -1843,6 +1841,8 @@ void Scene50::signal() { } void Scene50::dispatch() { + Scene::dispatch(); + if ((_sceneMode != 55) && _doorwayRect.contains(_globals->_player._position)) { // Player in house doorway, start player moving to within _globals->_player.disableControl(); @@ -3232,9 +3232,9 @@ void Scene6100::process(Event &event) { if (event.eventType == EVENT_KEYPRESS) { // Handle incremental turning speeds with arrow keys if ((event.kbd.keycode == Common::KEYCODE_LEFT) || (event.kbd.keycode == Common::KEYCODE_KP4)) { - _turnAmount = MAX(_turnAmount - 1, -8); + _turnAmount = MIN(_turnAmount + 1, 8); } else if ((event.kbd.keycode == Common::KEYCODE_RIGHT) || (event.kbd.keycode == Common::KEYCODE_KP6)) { - _turnAmount = MIN(_turnAmount + 1, -8); + _turnAmount = MAX(_turnAmount - 1, -8); } } diff --git a/engines/tsage/ringworld_scenes1.h b/engines/tsage/ringworld_scenes1.h index be6d8e6337..554b261f2c 100644 --- a/engines/tsage/ringworld_scenes1.h +++ b/engines/tsage/ringworld_scenes1.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef TSAGE_RINGWORLD_SCENES1_H @@ -443,7 +440,6 @@ class Scene95 : public Scene { public: Action1 _action1; - int _field326; SceneObject _object1, _object2, _object3; SoundHandler _soundHandler; diff --git a/engines/tsage/ringworld_scenes10.cpp b/engines/tsage/ringworld_scenes10.cpp index 661c64b93f..f8844ec486 100644 --- a/engines/tsage/ringworld_scenes10.cpp +++ b/engines/tsage/ringworld_scenes10.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "graphics/cursorman.h" @@ -122,8 +119,8 @@ void Scene9100::postInit(SceneObjectList *OwnerList) { _object1.setVisage(9100); _object1._strip = 1; _object1._numFrames = 6; - _object1.setPosition(Common::Point(279, 132), 0); - _object1.animate(ANIM_MODE_2, 0); + _object1.setPosition(Common::Point(279, 132)); + _object1.animate(ANIM_MODE_2, NULL); _object1.fixPriority(10); _globals->_player.postInit(); @@ -234,7 +231,7 @@ void Scene9150::dispatch() { if (_globals->_player._position.x > 630) { _globals->_player.disableControl(); _sceneMode = 9157; - setAction(&_sequenceManager1, this, _sceneMode, &_globals->_player, 0); + setAction(&_sequenceManager1, this, _sceneMode, &_globals->_player, NULL); } } else { _globals->_player.disableControl(); @@ -244,7 +241,7 @@ void Scene9150::dispatch() { } else { _sceneMode = 9156; } - setAction(&_sequenceManager1, this, _sceneMode, &_globals->_player, 0); + setAction(&_sequenceManager1, this, _sceneMode, &_globals->_player, NULL); } } } @@ -259,7 +256,7 @@ void Scene9150::postInit(SceneObjectList *OwnerList) { _object3.setVisage(9151); _object3._strip = 1; _object3._frame = 1; - _object3.setPosition(Common::Point(312, 95), 0); + _object3.setPosition(Common::Point(312, 95)); _object3.signal(); _sceneHotspot1.setup(0, 0, 200, 94, 9150, 46, -1); @@ -285,14 +282,14 @@ void Scene9150::postInit(SceneObjectList *OwnerList) { else // Hero wearing Purple suit _sceneMode = 9152; - setAction(&_sequenceManager1, this, _sceneMode, &_globals->_player, 0); + setAction(&_sequenceManager1, this, _sceneMode, &_globals->_player, NULL); } else { // Walking with the tiger _sceneMode = 9151; _object2.postInit(); _object2.hide(); _object1.postInit(); - setAction(&_sequenceManager1, this, _sceneMode, &_globals->_player, &_object1, &_object2, 0); + setAction(&_sequenceManager1, this, _sceneMode, &_globals->_player, &_object1, &_object2, NULL); } } @@ -307,16 +304,16 @@ void Scene9200::SceneHotspot1::doAction(int action) { _globals->_player.disableControl(); if (_globals->getFlag(93)) { scene->_sceneState = 9214; - scene->setAction(&scene->_sequenceManager, scene, 9214, &_globals->_player, &scene->_object2, 0); + scene->setAction(&scene->_sequenceManager, scene, 9214, &_globals->_player, &scene->_object2, NULL); } else { _globals->setFlag(93); scene->_sceneState = 9213; - scene->setAction(&scene->_sequenceManager, scene, 9213, &_globals->_player, &scene->_object2, 0); + scene->setAction(&scene->_sequenceManager, scene, 9213, &_globals->_player, &scene->_object2, NULL); } } else if (action <= 100) { _globals->_player.disableControl(); scene->_sceneState = 9214; - scene->setAction(&scene->_sequenceManager, scene, 9214, &_globals->_player, &scene->_object2, 0); + scene->setAction(&scene->_sequenceManager, scene, 9214, &_globals->_player, &scene->_object2, NULL); } else { NamedHotspot::doAction(action); } @@ -364,27 +361,27 @@ void Scene9200::dispatch() { if ( (_globals->_player._position.x <= 0) || ((_globals->_player._position.x < 100) && (_globals->_player._position.y > 199))) { _globals->_player.disableControl(); _sceneState = 9209; - setAction(&_sequenceManager, this, 9209, &_globals->_player, &_object2, &_object3, 0); + setAction(&_sequenceManager, this, 9209, &_globals->_player, &_object2, &_object3, NULL); } else { if (rect9200.contains(_globals->_player._position)) { if (_globals->getFlag(93)) { if (_globals->getFlag(86)) { _sceneState = 9215; - setAction(&_sequenceManager, this, 9215, &_globals->_player, &_object2, &_object3, 0); + setAction(&_sequenceManager, this, 9215, &_globals->_player, &_object2, &_object3, NULL); } else { _sceneState = 9208; - setAction(&_sequenceManager, this, 9208, &_globals->_player, &_object2, &_object3, 0); + setAction(&_sequenceManager, this, 9208, &_globals->_player, &_object2, &_object3, NULL); } } else { _globals->_player.disableControl(); _sceneState = 9204; - setAction(&_sequenceManager, this, 9204, &_globals->_player, &_object2, &_object3, 0); + setAction(&_sequenceManager, this, 9204, &_globals->_player, &_object2, &_object3, NULL); } } else { if (_globals->_player._position.y < 140) { _globals->_player.disableControl(); _sceneState = 9207; - setAction(&_sequenceManager, this, 9207, &_globals->_player, &_object2, &_object3, 0); + setAction(&_sequenceManager, this, 9207, &_globals->_player, &_object2, &_object3, NULL); } } } @@ -402,8 +399,8 @@ void Scene9200::postInit(SceneObjectList *OwnerList) { // Water animation _object1.setVisage(9200); _object1._strip = 3; - _object1.animate(ANIM_MODE_2, 0); - _object1.setPosition(Common::Point(132, 114), 0); + _object1.animate(ANIM_MODE_2, NULL); + _object1.setPosition(Common::Point(132, 114)); _object1.fixPriority(140); _soundHandler.startSound(297); _stripManager.addSpeaker(&_speakerQText); @@ -453,20 +450,20 @@ void Scene9200::postInit(SceneObjectList *OwnerList) { case 9700: if (_globals->getFlag(86)) { _sceneState = 9206; - setAction(&_sequenceManager, this, 9206, &_globals->_player, &_object2, &_object3, 0); + setAction(&_sequenceManager, this, 9206, &_globals->_player, &_object2, &_object3, NULL); } else { _sceneState = 9203; - setAction(&_sequenceManager, this, 9203, &_globals->_player, &_object2, &_object3, 0); + setAction(&_sequenceManager, this, 9203, &_globals->_player, &_object2, &_object3, NULL); } break; case 9360: default: if (_globals->getFlag(86)) { _sceneState = 9205; - setAction(&_sequenceManager, this, 9205, &_globals->_player, &_object2, &_object3, 0); + setAction(&_sequenceManager, this, 9205, &_globals->_player, &_object2, &_object3, NULL); } else { _sceneState = 9201; - setAction(&_sequenceManager, this, 9201, &_globals->_player, &_object2, &_object3, 0); + setAction(&_sequenceManager, this, 9201, &_globals->_player, &_object2, &_object3, NULL); } break; } @@ -499,7 +496,7 @@ void Scene9300::dispatch() { } else if (_globals->_player._position.y < 145) { _globals->_player.disableControl(); _sceneMode = 9303; - setAction(&_sequenceManager, this, 9303, &_globals->_player, &_object1, &_object2, 0); + setAction(&_sequenceManager, this, 9303, &_globals->_player, &_object1, &_object2, NULL); } } @@ -531,11 +528,11 @@ void Scene9300::postInit(SceneObjectList *OwnerList) { if (_globals->_sceneManager._previousScene == 9350) { _globals->_player.disableControl(); _sceneMode = 9302; - setAction(&_sequenceManager, this, 9302, &_globals->_player, &_object1, &_object2, 0); + setAction(&_sequenceManager, this, 9302, &_globals->_player, &_object1, &_object2, NULL); } else { _globals->_player.disableControl(); _sceneMode = 9301; - setAction(&_sequenceManager, this, 9301, &_globals->_player, &_object1, &_object2, 0); + setAction(&_sequenceManager, this, 9301, &_globals->_player, &_object1, &_object2, NULL); } } @@ -572,15 +569,15 @@ void Scene9350::dispatch() { if ((_globals->_player._position.x > 300) && (_globals->_player._position.y < 160)) { _globals->_player.disableControl(); _sceneState = 9356; - setAction(&_sequenceManager, this, 9356, &_globals->_player, &_object2, 0); + setAction(&_sequenceManager, this, 9356, &_globals->_player, &_object2, NULL); } else if ((_globals->_player._position.x > 110) && (_globals->_player._position.y >= 195)) { _globals->_player.disableControl(); _sceneState = 9357; - setAction(&_sequenceManager, this, 9357, &_globals->_player, &_object2, 0); + setAction(&_sequenceManager, this, 9357, &_globals->_player, &_object2, NULL); } else if ((_globals->_player._position.x < 10) || ((_globals->_player._position.x <= 110) && (_globals->_player._position.y >= 195))) { _globals->_player.disableControl(); _sceneState = 9355; - setAction(&_sequenceManager, this, 9355, &_globals->_player, &_object2, 0); + setAction(&_sequenceManager, this, 9355, &_globals->_player, &_object2, NULL); } } else { Scene::dispatch(); @@ -657,15 +654,15 @@ void Scene9360::dispatch() { if ((_globals->_player._position.x > 300) && (_globals->_player._position.y < 160)) { _globals->_player.disableControl(); _sceneState = 9366; - setAction(&_sequenceManager, this, 9366, &_globals->_player, 0); + setAction(&_sequenceManager, this, 9366, &_globals->_player, NULL); } else if ((_globals->_player._position.x > 110) && (_globals->_player._position.y >= 195)) { _globals->_player.disableControl(); _sceneState = 9367; - setAction(&_sequenceManager, this, 9367, &_globals->_player, 0); + setAction(&_sequenceManager, this, 9367, &_globals->_player, NULL); } else if ((_globals->_player._position.x < 10) || ((_globals->_player._position.x <= 110) && (_globals->_player._position.y >= 195))) { _globals->_player.disableControl(); _sceneState = 9365; - setAction(&_sequenceManager, this, 9365, &_globals->_player, 0); + setAction(&_sequenceManager, this, 9365, &_globals->_player, NULL); } } else { Scene::dispatch(); @@ -690,15 +687,15 @@ void Scene9360::postInit(SceneObjectList *OwnerList) { if (_globals->_sceneManager._previousScene == 9350) { _globals->_player.disableControl(); _sceneState = 9364; - setAction(&_sequenceManager, this, 9364, &_globals->_player, 0); + setAction(&_sequenceManager, this, 9364, &_globals->_player, NULL); } else if (_globals->_sceneManager._previousScene == 9450) { _globals->_player.disableControl(); _sceneState = 9363; - setAction(&_sequenceManager, this, 9363, &_globals->_player, 0); + setAction(&_sequenceManager, this, 9363, &_globals->_player, NULL); } else { _globals->_player.disableControl(); _sceneState = 9362; - setAction(&_sequenceManager, this, 9362, &_globals->_player, 0); + setAction(&_sequenceManager, this, 9362, &_globals->_player, NULL); } _object1.setup(9351, 1, 1, 131, 90, 0); } @@ -717,7 +714,7 @@ void Scene9400::SceneHotspot7::doAction(int action) { if ((action == CURSOR_USE) && (RING_INVENTORY._straw._sceneNumber != 1)) { scene->_sceneState = 1; RING_INVENTORY._straw._sceneNumber = 1; - scene->setAction(&scene->_sequenceManager, scene, 9408, &_globals->_player, 0); + scene->setAction(&scene->_sequenceManager, scene, 9408, &_globals->_player, NULL); } else { NamedHotspot::doAction(action); } @@ -743,7 +740,7 @@ void Scene9400::signal() { break; case 1: _object1._numFrames = 6; - _object1.animate(ANIM_MODE_2, 0); + _object1.animate(ANIM_MODE_2, NULL); _globals->_player.enableControl(); break; case 2: @@ -792,8 +789,8 @@ void Scene9400::postInit(SceneObjectList *OwnerList) { _screenNumber = 9400; setZoomPercents(0, 100, 200, 100); _globals->_player.postInit(); - _object1.postInit(0); - _object3.postInit(0); + _object1.postInit(); + _object3.postInit(); _speakerQText._textPos.x = 20; _hotspot7.setup(157, 66, 180, 110, 9400, 21, 23); @@ -819,7 +816,13 @@ void Scene9400::postInit(SceneObjectList *OwnerList) { _sceneState = 0; } - setAction(&_sequenceManager, this, 9400, &_globals->_player, &_object1, &_object3, 0); + setAction(&_sequenceManager, this, 9400, &_globals->_player, &_object1, &_object3, NULL); +} + +void Scene9400::synchronize(Serializer &s) { + Scene::synchronize(s); + if (s.getVersion() >= 3) + s.syncAsSint16LE(_field1032); } /*-------------------------------------------------------------------------- @@ -829,7 +832,7 @@ void Scene9400::postInit(SceneObjectList *OwnerList) { void Scene9450::Object2::signal() { Scene9450 *scene = (Scene9450 *)_globals->_sceneManager._scene; - this->setAction(&scene->_sequenceManager3, this, 9458, this, &scene->_object1, 0); + this->setAction(&scene->_sequenceManager3, this, 9458, this, &scene->_object1, NULL); } void Scene9450::Object3::dispatch() { @@ -845,7 +848,7 @@ void Scene9450::Hotspot1::doAction(int action) { scene->_object2._action->remove(); scene->_sceneMode = 9459; _globals->_player.disableControl(); - scene->setAction(&scene->_sequenceManager1, scene, 9459, &scene->_object2, &scene->_object1, &scene->_object3, &_globals->_player, 0); + scene->setAction(&scene->_sequenceManager1, scene, 9459, &scene->_object2, &scene->_object1, &scene->_object3, &_globals->_player, NULL); } else { NamedHotspot::doAction(action); } @@ -860,7 +863,7 @@ void Scene9450::Hotspot3::doAction(int action) { case OBJECT_TUNIC2: scene->_sceneMode = 9460; _globals->_player.disableControl(); - setAction(&scene->_sequenceManager1, scene, 9460, &_globals->_player, &scene->_object2, &scene->_object1, 0); + scene->setAction(&scene->_sequenceManager1, scene, 9460, &_globals->_player, &scene->_object2, &scene->_object1, NULL); break; case OBJECT_TUNIC: SceneItem::display(9450, 49, SET_Y, 20, SET_WIDTH, 200, SET_EXT_BGCOLOR, 7, LIST_END); @@ -878,13 +881,13 @@ void Scene9450::Hotspot3::doAction(int action) { scene->_object2._action->remove(); scene->_sceneMode = 9459; _globals->_player.disableControl(); - setAction(&scene->_sequenceManager1, scene, 9459, &scene->_object2, &scene->_object1, &scene->_object3, &_globals->_player, 0); + scene->setAction(&scene->_sequenceManager1, scene, 9459, &scene->_object2, &scene->_object1, &scene->_object3, &_globals->_player, NULL); } else if ((RING_INVENTORY._cloak._sceneNumber != 1) && (RING_INVENTORY._jacket._sceneNumber != 1) && (RING_INVENTORY._tunic2._sceneNumber != 1)) { SceneItem::display(9450, 38, SET_Y, 20, SET_WIDTH, 200, SET_EXT_BGCOLOR, 7, LIST_END); } else { scene->_sceneMode = 9460; _globals->_player.disableControl(); - setAction(&scene->_sequenceManager1, scene, 9460, &_globals->_player, &scene->_object2, &scene->_object1, 0); + scene->setAction(&scene->_sequenceManager1, scene, 9460, &_globals->_player, &scene->_object2, &scene->_object1, NULL); } break; default: @@ -898,11 +901,11 @@ void Scene9450::signal() { case 1002: case 1004: // Drink - setAction(&_sequenceManager1, this, 9456, &_object2, &_object1, &_object3, 0); + setAction(&_sequenceManager1, this, 9456, &_object2, &_object1, &_object3, NULL); break; case 1005: // Bring me more wine - setAction(&_sequenceManager1, this, 9457, &_object2, &_object1, &_object3, 0); + setAction(&_sequenceManager1, this, 9457, &_object2, &_object1, &_object3, NULL); break; case 9451: if (_globals->getFlag(87)) { @@ -911,12 +914,14 @@ void Scene9450::signal() { _sceneMode = 1001; if (_object2._action) _object2._action->remove(); + // Eat + setAction(&_sequenceManager1, this, 9455, &_object2, &_object1, &_object3, NULL); } - // No break on purpose + break; case 1001: case 1003: // Eat - setAction(&_sequenceManager1, this, 9455, &_object2, &_object1, &_object3, 0); + setAction(&_sequenceManager1, this, 9455, &_object2, &_object1, &_object3, NULL); break; case 9453: _globals->_sceneManager.changeScene(9360); @@ -944,11 +949,11 @@ void Scene9450::dispatch() { if ((_globals->_player._position.y < 98) && (_globals->_player._position.x > 241) && (_globals->_player._position.x < 282)) { _globals->_player.disableControl(); _sceneMode = 9452; - setAction(&_sequenceManager1, this, 9452, &_globals->_player, 0); + setAction(&_sequenceManager1, this, 9452, &_globals->_player, NULL); } else if ((_globals->_player._position.y < 99) && (_globals->_player._position.x > 68) && (_globals->_player._position.x < 103)) { _globals->_player.disableControl(); _sceneMode = 9453; - setAction(&_sequenceManager1, this, 9453, &_globals->_player, 0); + setAction(&_sequenceManager1, this, 9453, &_globals->_player, NULL); } } } @@ -965,13 +970,13 @@ void Scene9450::postInit(SceneObjectList *OwnerList) { _globals->_player.disableControl(); _sceneMode = 9451; - setAction(&_sequenceManager1, this, 9451, &_globals->_player, 0); + setAction(&_sequenceManager1, this, 9451, &_globals->_player, NULL); if (_globals->getFlag(87)) { if (RING_INVENTORY._tunic._sceneNumber == 1) { _object2.signal(); } else { - _object2.setPosition(Common::Point(184, 144), 0); + _object2.setPosition(Common::Point(184, 144)); _object2.setVisage(9451); _object2.fixPriority(250); _object2._strip = 5; @@ -980,7 +985,7 @@ void Scene9450::postInit(SceneObjectList *OwnerList) { } else { _object3.postInit(); _object3.hide(); - _object3.setAction(&_sequenceManager2, 0, 9455, &_object2, &_object1, 0); + _object3.setAction(&_sequenceManager2, NULL, 9455, &_object2, &_object1, NULL); } if (RING_INVENTORY._tunic._sceneNumber != 1) @@ -1017,7 +1022,7 @@ void Scene9500::Hotspot1::doAction(int action) { _globals->_player.disableControl(); _globals->_sceneItems.remove(this); scene->_hotspot2.setup(87, 294, 104, 314, 9400, 17, -1); - scene->setAction(&scene->_sequenceManager, scene, 9510, &_globals->_player, &scene->_object2, 0); + scene->setAction(&scene->_sequenceManager, scene, 9510, &_globals->_player, &scene->_object2, NULL); } else { NamedHotspot::doAction(action); } @@ -1030,7 +1035,7 @@ void Scene9500::Hotspot2::doAction(int action) { scene->_sceneMode = 9511; _globals->_player.disableControl(); _globals->_sceneItems.remove(this); - scene->setAction(&scene->_sequenceManager, scene, 9511, &_globals->_player, &scene->_object2, 0); + scene->setAction(&scene->_sequenceManager, scene, 9511, &_globals->_player, &scene->_object2, NULL); } else { NamedHotspot::doAction(action); } @@ -1043,7 +1048,7 @@ void Scene9500::Hotspot3::doAction(int action) { scene->_sceneMode = 9505; _globals->_player.disableControl(); _globals->_sceneItems.remove(this); - scene->setAction(&scene->_sequenceManager, scene, 9505, &_globals->_player, &scene->_candle, 0); + scene->setAction(&scene->_sequenceManager, scene, 9505, &_globals->_player, &scene->_candle, NULL); } else { NamedHotspot::doAction(action); } @@ -1058,17 +1063,17 @@ void Scene9500::Hotspot4::doAction(int action) { scene->_sceneMode = 9506; _globals->_sceneItems.remove(&scene->_hotspot5); _globals->_sceneItems.remove(this); - scene->setAction(&scene->_sequenceManager, scene, 9506, &_globals->_player, &scene->_object3, 0); + scene->setAction(&scene->_sequenceManager, scene, 9506, &_globals->_player, &scene->_object3, NULL); RING_INVENTORY._candle._sceneNumber = 9850; } else { scene->_sceneMode = 9507; - scene->setAction(&scene->_sequenceManager, scene, 9507, &_globals->_player, &scene->_object3, 0); + scene->setAction(&scene->_sequenceManager, scene, 9507, &_globals->_player, &scene->_object3, NULL); } } else if (action == OBJECT_STRAW) { scene->_sceneMode = 9512; _globals->_player.disableControl(); RING_INVENTORY._straw._sceneNumber = 9500; - scene->setAction(&scene->_sequenceManager, scene, 9512, &_globals->_player, &scene->_object3, 0); + scene->setAction(&scene->_sequenceManager, scene, 9512, &_globals->_player, &scene->_object3, NULL); } else { NamedHotspot::doAction(action); } @@ -1099,7 +1104,7 @@ void Scene9500::signal() { _globals->setFlag(51); _globals->_player.disableControl(); _sceneMode = 9514; - setAction(&_sequenceManager, this, 9514, &_globals->_player, 0, 0, 0, 0); + setAction(&_sequenceManager, this, 9514, &_globals->_player, NULL, NULL, NULL, NULL); } break; case 0: @@ -1117,11 +1122,11 @@ void Scene9500::dispatch() { if (_globals->_player._position.y >= 199) { _globals->_player.disableControl(); _sceneMode = 9503; - setAction(&_sequenceManager, this, 9503, &_globals->_player, 0, 0, 0, 0); + setAction(&_sequenceManager, this, 9503, &_globals->_player, NULL, NULL, NULL, NULL); } else if (_globals->_player._position.y < 127) { _globals->_player.disableControl(); _sceneMode = 9504; - setAction(&_sequenceManager, this, 9504, &_globals->_player, 0, 0, 0, 0); + setAction(&_sequenceManager, this, 9504, &_globals->_player, NULL, NULL, NULL, NULL); } } @@ -1138,15 +1143,15 @@ void Scene9500::postInit(SceneObjectList *OwnerList) { _globals->_player.postInit(); _globals->_soundHandler.startSound(305); - _candle.postInit(0); + _candle.postInit(); _candle.setVisage(9500); _candle.setStrip(1); _candle.animate(ANIM_MODE_2); - _candle.setPosition(Common::Point(30, 105), 0); + _candle.setPosition(Common::Point(30, 105)); if (RING_INVENTORY._candle._sceneNumber != 9500) _candle.setStrip(2); - _object3.postInit(0); + _object3.postInit(); _object3.hide(); _object3.fixPriority(150); _object3.setPosition(Common::Point(166, 133)); @@ -1159,12 +1164,12 @@ void Scene9500::postInit(SceneObjectList *OwnerList) { if (_globals->getFlag(85)) { _object3.setVisage(9500); _object3.setStrip(4); - _object3.animate(ANIM_MODE_8, 0, 0); + _object3.animate(ANIM_MODE_8, 0, NULL); _object3.setPosition(Common::Point(166, 133)); } } - _object2.postInit(0); + _object2.postInit(); _object2.hide(); if (_globals->getFlag(92)) { _object2.show(); @@ -1212,15 +1217,15 @@ void Scene9500::postInit(SceneObjectList *OwnerList) { if ((_globals->_sceneManager._previousScene == 9200) || (_globals->_sceneManager._previousScene != 9850)) { _sceneMode = 0; if (RING_INVENTORY._helmet._sceneNumber != 1) { - setAction(&_sequenceManager, this, 9501, &_globals->_player, &_candle, 0); + setAction(&_sequenceManager, this, 9501, &_globals->_player, &_candle, NULL); } else { RING_INVENTORY._helmet._sceneNumber = 9500; _hotspot2.setup(87, 294, 104, 314, 9400, 17, -1); - setAction(&_sequenceManager, this, 9513, &_globals->_player, &_object2, 0); + setAction(&_sequenceManager, this, 9513, &_globals->_player, &_object2, NULL); } } else { _sceneMode = 0; - setAction(&_sequenceManager, this, 9502, &_globals->_player, &_candle, 0); + setAction(&_sequenceManager, this, 9502, &_globals->_player, &_candle, NULL); } } @@ -1240,7 +1245,7 @@ void Scene9700::signal() { _gfxButton1.draw(); _gfxButton1._bounds.expandPanes(); _globals->_player.enableControl(); - _globals->_player._canWalk = 0; + _globals->_player._canWalk = false; _globals->_events.setCursor(CURSOR_USE); break; case 9704: @@ -1251,6 +1256,7 @@ void Scene9700::signal() { } void Scene9700::process(Event &event) { + Scene::process(event); if ((event.eventType == EVENT_BUTTON_DOWN) && !_action) { if (_gfxButton1.process(event)) { _globals->_sceneManager.changeScene(9200); @@ -1259,11 +1265,11 @@ void Scene9700::process(Event &event) { if (RING_INVENTORY._helmet._sceneNumber == 1) { _globals->_player.disableControl(); _sceneMode = 9704; - setAction(&_sequenceManager, this, 9704, &_globals->_player, &_object1, 0); + setAction(&_sequenceManager, this, 9704, &_globals->_player, &_object1, NULL); } else { _globals->_player.disableControl(); _sceneMode = 9703; - setAction(&_sequenceManager, this, 9703, &_globals->_player, &_object1, 0); + setAction(&_sequenceManager, this, 9703, &_globals->_player, &_object1, NULL); } } } @@ -1275,7 +1281,7 @@ void Scene9700::postInit(SceneObjectList *OwnerList) { _sceneHotspot1.setup(84, 218, 151, 278, 9700, 14, -1); _sceneHotspot2.setup(89, 11, 151, 121, 9700, 14, -1); - _sceneHotspot3.setup(69, 119, 138, 218, 9700, 15, 16); + _sceneHotspot3.setup(69, 119, 138, 216, 9700, 15, 16); _sceneHotspot4.setup(34, 13, 88, 116, 9700, 17, -1); _sceneHotspot5.setup(52, 119, 68, 204, 9700, 17, -1); _sceneHotspot6.setup(0, 22, 56, 275, 9700, 18, -1); @@ -1283,15 +1289,15 @@ void Scene9700::postInit(SceneObjectList *OwnerList) { _object1.postInit(); _object1.hide(); _globals->_player.postInit(); - if (_globals->getFlag(97)) { + if (!_globals->getFlag(97)) { _globals->_player.disableControl(); _sceneMode = 9701; - setAction(&_sequenceManager, this, 9701, &_globals->_player, &_object1, 0); + setAction(&_sequenceManager, this, 9701, &_globals->_player, &_object1, NULL); _globals->setFlag(97); } else { _globals->_player.disableControl(); _sceneMode = 9702; - setAction(&_sequenceManager, this, 9702, &_globals->_player, &_object1, 0); + setAction(&_sequenceManager, this, 9702, &_globals->_player, &_object1, NULL); } } @@ -1327,7 +1333,7 @@ void Scene9750::postInit(SceneObjectList *OwnerList) { _object2.hide(); _globals->_player.disableControl(); _sceneMode = 9751; - setAction(&_sequenceManager, this, 9751, &_globals->_player, &_object1, &_object2, 0); + setAction(&_sequenceManager, this, 9751, &_globals->_player, &_object1, &_object2, NULL); } @@ -1369,12 +1375,12 @@ void Scene9850::Hotspot12::doAction(int action) { RING_INVENTORY._tunic2._sceneNumber = 1; _globals->_player.disableControl(); scene->_sceneMode = 9858; - setAction(&scene->_sequenceManager, scene, 9858, &_globals->_player, &scene->_objTunic2, 0); + scene->setAction(&scene->_sequenceManager, scene, 9858, &_globals->_player, &scene->_objTunic2, NULL); } else { RING_INVENTORY._tunic2._sceneNumber = 9850; _globals->_player.disableControl(); scene->_sceneMode = 9861; - setAction(&scene->_sequenceManager, scene, 9861, &_globals->_player, &scene->_objTunic2, 0); + scene->setAction(&scene->_sequenceManager, scene, 9861, &_globals->_player, &scene->_objTunic2, NULL); } } else if ((action != CURSOR_LOOK) || (RING_INVENTORY._tunic2._sceneNumber != 1)) { NamedHotspot::doAction(action); @@ -1391,12 +1397,12 @@ void Scene9850::Hotspot14::doAction(int action) { RING_INVENTORY._jacket._sceneNumber = 1; _globals->_player.disableControl(); scene->_sceneMode = 9857; - setAction(&scene->_sequenceManager, scene, 9857, &_globals->_player, &scene->_objJacket, NULL); + scene->setAction(&scene->_sequenceManager, scene, 9857, &_globals->_player, &scene->_objJacket, NULL); } else { RING_INVENTORY._jacket._sceneNumber = 9850; _globals->_player.disableControl(); scene->_sceneMode = 9860; - setAction(&scene->_sequenceManager, scene, 9860, &_globals->_player, &scene->_objJacket, NULL); + scene->setAction(&scene->_sequenceManager, scene, 9860, &_globals->_player, &scene->_objJacket, NULL); } } else if ((action != CURSOR_LOOK) || (RING_INVENTORY._jacket._sceneNumber != 1)) { NamedHotspot::doAction(action); @@ -1413,12 +1419,12 @@ void Scene9850::Hotspot16::doAction(int action) { RING_INVENTORY._cloak._sceneNumber = 1; _globals->_player.disableControl(); scene->_sceneMode = 9862; - setAction(&scene->_sequenceManager, scene, 9862, &_globals->_player, &scene->_objCloak, 0); + scene->setAction(&scene->_sequenceManager, scene, 9862, &_globals->_player, &scene->_objCloak, NULL); } else { RING_INVENTORY._cloak._sceneNumber = 9850; _globals->_player.disableControl(); scene->_sceneMode = 9859; - setAction(&scene->_sequenceManager, scene, 9859, &_globals->_player, &scene->_objCloak, 0); + scene->setAction(&scene->_sequenceManager, scene, 9859, &_globals->_player, &scene->_objCloak, NULL); } } else if ((action != CURSOR_LOOK) || (RING_INVENTORY._cloak._sceneNumber != 1)) { NamedHotspot::doAction(action); @@ -1475,10 +1481,10 @@ void Scene9850::Hotspot20::doAction(int action) { if (RING_INVENTORY._sword._sceneNumber == 9850) scene->_objSword.show(); scene->_sceneMode = 11; - setAction(&scene->_sequenceManager, scene, 9853, &_globals->_player, &scene->_objDoor, &scene->_objLever, 0); + setAction(&scene->_sequenceManager, scene, 9853, &_globals->_player, &scene->_objDoor, &scene->_objLever, NULL); } else { scene->_sceneMode = 10; - setAction(&scene->_sequenceManager, scene, 9854, &_globals->_player, &scene->_objDoor, &scene->_objLever, 0); + setAction(&scene->_sequenceManager, scene, 9854, &_globals->_player, &scene->_objDoor, &scene->_objLever, NULL); } scene->_objSword._state ^= 1; } else { @@ -1525,10 +1531,10 @@ void Scene9850::process(Event &event) { _globals->_player.disableControl(); if (_objSword._state == 0) { _sceneMode = 0; - setAction(&_sequenceManager, this, 9853, &_objLever, &_objDoor, &_objScimitar, &_objSword, 0); + setAction(&_sequenceManager, this, 9853, &_objLever, &_objDoor, &_objScimitar, &_objSword, NULL); } else { _sceneMode = 10; - setAction(&_sequenceManager, this, 9854, &_objLever, &_objDoor, &_objScimitar, &_objSword, 0); + setAction(&_sequenceManager, this, 9854, &_objLever, &_objDoor, &_objScimitar, &_objSword, NULL); } _objSword._state ^= 1; } @@ -1540,7 +1546,7 @@ void Scene9850::dispatch() { } else if (_globals->_player._position.y >= 198) { _globals->_player.disableControl(); _sceneMode = 9500; - setAction(&_sequenceManager, this, 9852, &_globals->_player, 0); + setAction(&_sequenceManager, this, 9852, &_globals->_player, NULL); } } @@ -1632,7 +1638,7 @@ void Scene9850::postInit(SceneObjectList *OwnerList) { _globals->_player.postInit(); _globals->_player.disableControl(); _sceneMode = 0; - setAction(&_sequenceManager, this, 9851, &_globals->_player, 0); + setAction(&_sequenceManager, this, 9851, &_globals->_player, NULL); } /*-------------------------------------------------------------------------- @@ -1654,7 +1660,7 @@ void Scene9900::strAction1::signal() { _object9._strip = 6; _object9.fixPriority(250); _object9.setPosition(Common::Point(171, 59)); - _object9.animate(ANIM_MODE_5, 0); + _object9.animate(ANIM_MODE_5, NULL); _globals->_scenePalette.addRotation(67, 111, 1, 1, this); scene->_object2.hide(); break; @@ -1777,6 +1783,15 @@ void Scene9900::strAction2::dispatch() { Action::dispatch(); } +void Scene9900::strAction2::synchronize(Serializer &s) { + Action::synchronize(s); + if (s.getVersion() >= 3) { + s.syncAsSint16LE(_lineNum); + s.syncAsSint16LE(_txtArray1Index); + s.syncAsSint16LE(_var3); + } +} + void Scene9900::strAction3::signal() { const byte mask3[3] = {0xff, 0, 0}; const byte mask4[3] = {0, 0, 0}; @@ -1816,31 +1831,31 @@ void Scene9900::signal() { _object6.hide(); } - _object1.animate(ANIM_MODE_NONE, 0); - _object2.animate(ANIM_MODE_NONE, 0); - _object3.animate(ANIM_MODE_NONE, 0); - _object4.animate(ANIM_MODE_NONE, 0); - _object5.animate(ANIM_MODE_NONE, 0); - _object6.animate(ANIM_MODE_NONE, 0); + _object1.animate(ANIM_MODE_NONE, NULL); + _object2.animate(ANIM_MODE_NONE, NULL); + _object3.animate(ANIM_MODE_NONE, NULL); + _object4.animate(ANIM_MODE_NONE, NULL); + _object5.animate(ANIM_MODE_NONE, NULL); + _object6.animate(ANIM_MODE_NONE, NULL); - _object1.setObjectWrapper(0); - _object2.setObjectWrapper(0); - _object3.setObjectWrapper(0); - _object4.setObjectWrapper(0); - _object5.setObjectWrapper(0); - _object6.setObjectWrapper(0); + _object1.setObjectWrapper(NULL); + _object2.setObjectWrapper(NULL); + _object3.setObjectWrapper(NULL); + _object4.setObjectWrapper(NULL); + _object5.setObjectWrapper(NULL); + _object6.setObjectWrapper(NULL); - _object1.addMover(0); - _object2.addMover(0); - _object3.addMover(0); - _object4.addMover(0); - _object5.addMover(0); - _object6.addMover(0); + _object1.addMover(NULL); + _object2.addMover(NULL); + _object3.addMover(NULL); + _object4.addMover(NULL); + _object5.addMover(NULL); + _object6.addMover(NULL); switch (_sceneMode){ case 150: _globals->_soundHandler.startSound(380); - _object8.postInit(0); + _object8.postInit(); _object8.setVisage(2002); _object8.setStrip(1); _object8.setFrame(1); @@ -1955,17 +1970,17 @@ void Scene9900::dispatch() { } void Scene9900::postInit(SceneObjectList *OwnerList) { - _object1.postInit(0); + _object1.postInit(); _object1.hide(); - _object2.postInit(0); + _object2.postInit(); _object2.hide(); - _object3.postInit(0); + _object3.postInit(); _object3.hide(); - _object4.postInit(0); + _object4.postInit(); _object4.hide(); - _object5.postInit(0); + _object5.postInit(); _object5.hide(); - _object6.postInit(0); + _object6.postInit(); _object6.hide(); _object8._state = 0; @@ -2026,14 +2041,14 @@ void Scene9999::postInit(SceneObjectList *OwnerList) { _object1.postInit(); _object1.setVisage(1303); _object1.setStrip2(3); - _object1.setPosition(Common::Point(160, 152), 0); + _object1.setPosition(Common::Point(160, 152)); _globals->_player.postInit(); _globals->_player.setVisage(1303); _globals->_player.setStrip2(1); _globals->_player.fixPriority(250); - _globals->_player.animate(ANIM_MODE_2, 0); - _globals->_player.setPosition(Common::Point(194, 98), 0); + _globals->_player.animate(ANIM_MODE_2, NULL); + _globals->_player.setPosition(Common::Point(194, 98)); _globals->_player._numFrames = 20; _globals->_player.disableControl(); @@ -2041,14 +2056,14 @@ void Scene9999::postInit(SceneObjectList *OwnerList) { _object2.setVisage(1303); _object2.setStrip2(2); _object2.fixPriority(2); - _object2.setPosition(Common::Point(164, 149), 0); + _object2.setPosition(Common::Point(164, 149)); _object3.postInit(); _object3.setVisage(1303); _object3.setStrip2(2); _object3.fixPriority(2); _object3.setFrame(2); - _object3.setPosition(Common::Point(292, 149), 0); + _object3.setPosition(Common::Point(292, 149)); _object3.setAction(&_action3); if (_globals->_sceneManager._previousScene == 3500) diff --git a/engines/tsage/ringworld_scenes10.h b/engines/tsage/ringworld_scenes10.h index 2f5ce0f825..aa41555718 100644 --- a/engines/tsage/ringworld_scenes10.h +++ b/engines/tsage/ringworld_scenes10.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef TSAGE_RINGWORLD_SCENES10_H @@ -39,8 +36,8 @@ class SceneObject9150 : public SceneObject { public: int _timer, _signalFlag; - virtual void synchronise(Serialiser &s) { - SceneObject::synchronise(s); + virtual void synchronize(Serializer &s) { + SceneObject::synchronize(s); s.syncAsSint16LE(_timer); s.syncAsSint16LE(_signalFlag); } @@ -52,8 +49,8 @@ public : int _sceneState; Scene2(); - virtual void synchronise(Serialiser &s) { - Scene::synchronise(s); + virtual void synchronize(Serializer &s) { + Scene::synchronize(s); s.syncAsSint16LE(_sceneState); } }; @@ -241,6 +238,7 @@ public: virtual void postInit(SceneObjectList *OwnerList = NULL); virtual void signal(); virtual void dispatch(); + virtual void synchronize(Serializer &s); }; class Scene9450 : public Scene2 { @@ -471,6 +469,7 @@ class Scene9900 : public Scene { virtual void signal(); virtual void dispatch(); + virtual void synchronize(Serializer &s); }; class strAction3 : public Action { diff --git a/engines/tsage/ringworld_scenes2.cpp b/engines/tsage/ringworld_scenes2.cpp index 6a8db81adf..4378eac724 100644 --- a/engines/tsage/ringworld_scenes2.cpp +++ b/engines/tsage/ringworld_scenes2.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/config-manager.h" @@ -113,6 +110,8 @@ void Scene1000::Action3::signal() { setDelay(240); break; case 5: { + _globals->_player.enableControl(); + const char *SEEN_INTRO = "seen_intro"; if (!ConfMan.hasKey(SEEN_INTRO) || !ConfMan.getBool(SEEN_INTRO)) { // First time being played, so show the introduction @@ -478,13 +477,14 @@ void Scene1001::Action1::signal() { case 19: { _globals->_soundHandler.startSound(91); byte adjustData[4] = {0xff, 0xff, 0xff, 0}; - _globals->_scenePalette.fade(adjustData, true, 0); + _globals->_scenePalette.fade(adjustData, false, 0); scene->_object1._strip = 7; scene->_object1._frame = 1; scene->_object1.setPosition(Common::Point(314, 112)); scene->_object1.addMover(NULL); setDelay(2); + break; } case 20: _globals->_scenePalette.loadPalette(16); diff --git a/engines/tsage/ringworld_scenes2.h b/engines/tsage/ringworld_scenes2.h index 75843d3570..7731b45ae8 100644 --- a/engines/tsage/ringworld_scenes2.h +++ b/engines/tsage/ringworld_scenes2.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef TSAGE_RINGWORLD_SCENES2_H diff --git a/engines/tsage/ringworld_scenes3.cpp b/engines/tsage/ringworld_scenes3.cpp index 13dfc1a40b..9931d89ad4 100644 --- a/engines/tsage/ringworld_scenes3.cpp +++ b/engines/tsage/ringworld_scenes3.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/config-manager.h" @@ -1150,6 +1147,7 @@ void Scene2100::Action14::signal() { case 12: scene->_object3.setStrip(2); setDelay(30); + break; case 13: scene->_object3.fixPriority(1); scene->_soundHandler.startSound(162); @@ -1957,6 +1955,12 @@ void Scene2100::signal() { } } +void Scene2100::synchronize(Serializer &s) { + Scene::synchronize(s); + if (s.getVersion() >= 3) + s.syncAsSint16LE(_field1800); +} + /*-------------------------------------------------------------------------- * Scene 2120 - Encyclopedia * @@ -2163,12 +2167,19 @@ void Scene2120::Action1::dispatch() { /*--------------------------------------------------------------------------*/ +Scene2120::Scene2120(): Scene() { + _listRect = Rect(18, 48, 260, 177); + _dbMode = 0; + _prevDbMode = 0; + _visageVisable = false; + _subjectIndex = 0; +} + void Scene2120::postInit(SceneObjectList *OwnerList) { loadScene(2120); setZoomPercents(0, 100, 200, 100); _globals->_player.disableControl(); - _listRect = Rect(18, 48, 260, 177); _subjectButton.setBounds(Rect(266, 13, 320, 56)); _nextPageButton.setBounds(Rect(266, 56, 320, 98)); _previousPageButton.setBounds(Rect(266, 98, 320, 140)); @@ -2185,18 +2196,13 @@ void Scene2120::postInit(SceneObjectList *OwnerList) { _arrowHotspot._frame = 1; _arrowHotspot.setPosition(Common::Point(400, 200)); - _dbMode = 0; - _prevDbMode = 0; - _visageVisable = false; - _subjectIndex = 0; - setAction(&_action1); _globals->_sceneManager._scene->_sceneBounds.contain(_globals->_sceneManager._scene->_backgroundBounds); _globals->_sceneOffset.x = (_globals->_sceneManager._scene->_sceneBounds.left / 160) * 160; } -void Scene2120::synchronise(Serialiser &s) { - Scene::synchronise(s); +void Scene2120::synchronize(Serializer &s) { + Scene::synchronize(s); s.syncAsSint16LE(_dbMode); s.syncAsSint16LE(_prevDbMode); @@ -2471,6 +2477,8 @@ Scene2150::Scene2150() : _hotspot8(16, CURSOR_LOOK, 2150, 8, LIST_END), _hotspot9(0, CURSOR_LOOK, 2150, 9, CURSOR_USE, 2150, 13, LIST_END), _hotspot11(0, CURSOR_LOOK, 2150, 12, LIST_END) { + _rect1 = Rect(260, 70, 270, 77); + _rect2 = Rect(222, 142, 252, 150); } void Scene2150::postInit(SceneObjectList *OwnerList) { @@ -2521,9 +2529,6 @@ void Scene2150::postInit(SceneObjectList *OwnerList) { _hotspot10.setStrip(5); _hotspot10.setPosition(Common::Point(59, 56)); - _rect1 = Rect(260, 70, 270, 77); - _rect2 = Rect(222, 142, 252, 150); - _globals->_player.postInit(); _globals->_player.setVisage(_globals->getFlag(13) ? 2170 : 0); _globals->_player.animate(ANIM_MODE_1, NULL); @@ -2589,10 +2594,10 @@ void Scene2150::postInit(SceneObjectList *OwnerList) { _globals->_sceneOffset.x = (_globals->_sceneManager._scene->_sceneBounds.left / 160) * 160; } -void Scene2150::synchronise(Serialiser &s) { - Scene::synchronise(s); - _rect1.synchronise(s); - _rect2.synchronise(s); +void Scene2150::synchronize(Serializer &s) { + Scene::synchronize(s); + _rect1.synchronize(s); + _rect2.synchronize(s); } void Scene2150::signal() { @@ -2727,7 +2732,7 @@ void Scene2200::Action3::signal() { _actionIndex = 8; setDelay(5); } else { - for (SynchronisedList<SceneObject *>::iterator i = _globals->_sceneObjects->begin(); + for (SynchronizedList<SceneObject *>::iterator i = _globals->_sceneObjects->begin(); i != _globals->_sceneObjects->end(); ++i) { (*i)->hide(); } @@ -2764,7 +2769,7 @@ void Scene2200::Action3::signal() { setDelay(5); break; case 7: - for (SynchronisedList<SceneObject *>::iterator i = _globals->_sceneObjects->begin(); + for (SynchronizedList<SceneObject *>::iterator i = _globals->_sceneObjects->begin(); i != _globals->_sceneObjects->end(); ++i) (*i)->show(); @@ -3006,9 +3011,9 @@ void Scene2200::stripCallback(int v) { } } -void Scene2200::synchronise(Serialiser &s) { - Scene::synchronise(s); - _exitRect.synchronise(s); +void Scene2200::synchronize(Serializer &s) { + Scene::synchronize(s); + _exitRect.synchronize(s); } void Scene2200::signal() { @@ -3733,9 +3738,9 @@ void Scene2230::postInit(SceneObjectList *OwnerList) { _globals->_sceneOffset.x = (_globals->_sceneManager._scene->_sceneBounds.left / 160) * 160; } -void Scene2230::synchronise(Serialiser &s) { - Scene::synchronise(s); - _rect1.synchronise(s); +void Scene2230::synchronize(Serializer &s) { + Scene::synchronize(s); + _rect1.synchronize(s); s.syncAsSint16LE(_field30A); } @@ -4216,7 +4221,7 @@ void Scene2280::Hotspot18::doAction(int action) { /*--------------------------------------------------------------------------*/ Scene2280::Scene2280() : - _hotspot3(0, CURSOR_LOOK, 2280, 30, CURSOR_USE, 31, 0, LIST_END), + _hotspot3(0, CURSOR_LOOK, 2280, 30, CURSOR_USE, 2280, 31, LIST_END), _hotspot5(0, CURSOR_LOOK, 2280, 35, CURSOR_USE, 2280, 36, LIST_END), _hotspot6(0, CURSOR_LOOK, 2280, 19, CURSOR_USE, 2280, 20, LIST_END), _hotspot9(0, CURSOR_LOOK, 2280, 5, CURSOR_USE, 2280, 6, LIST_END), @@ -4355,9 +4360,9 @@ void Scene2280::dispatch() { } } -void Scene2280::synchronise(Serialiser &s) { - Scene::synchronise(s); - _exitRect.synchronise(s); +void Scene2280::synchronize(Serializer &s) { + Scene::synchronize(s); + _exitRect.synchronize(s); } /*-------------------------------------------------------------------------- @@ -4851,6 +4856,14 @@ Scene2310::Scene2310() { _pageList[18].set(18, 2, 3, 0, 1, 4); _pageList[19].set(19, 3, 0, 1, 4, 2); _pageList[20].set(20, 4, 0, 3, 1, 2); + + _rectList[0].set(135, 70, 151, 140); + _rectList[1].set(151, 70, 167, 140); + _rectList[2].set(167, 70, 183, 140); + _rectList[3].set(183, 70, 199, 140); + _rectList[4].set(199, 70, 215, 140); + + _wireIndex = 5; } void Scene2310::postInit(SceneObjectList *OwnerList) { @@ -4867,16 +4880,9 @@ void Scene2310::postInit(SceneObjectList *OwnerList) { _wireList[idx].setPosition(pointList[idx]); } - _rectList[0].set(135, 70, 151, 140); - _rectList[1].set(151, 70, 167, 140); - _rectList[2].set(167, 70, 183, 140); - _rectList[3].set(183, 70, 199, 140); - _rectList[4].set(199, 70, 215, 140); - _globals->_player.disableControl(); _globals->_events.setCursor(CURSOR_WALK); - _wireIndex = 5; if (_vm->getFeatures() & GF_CD) _pageIndex = _globals->_randomSource.getRandomNumber(14) + 2; else @@ -4917,8 +4923,8 @@ void Scene2310::signal() { } } -void Scene2310::synchronise(Serialiser &s) { - Scene::synchronise(s); +void Scene2310::synchronize(Serializer &s) { + Scene::synchronize(s); s.syncAsSint16LE(_wireIndex); s.syncAsSint16LE(_pageIndex); @@ -5998,8 +6004,8 @@ void Scene2320::postInit(SceneObjectList *OwnerList) { &_hotspot13, &_hotspot4, &_hotspot3, &_hotspot2, &_hotspot1, NULL); } -void Scene2320::synchronise(Serialiser &s) { - Scene::synchronise(s); +void Scene2320::synchronize(Serializer &s) { + Scene::synchronize(s); SYNC_POINTER(_hotspotPtr); } diff --git a/engines/tsage/ringworld_scenes3.h b/engines/tsage/ringworld_scenes3.h index 2cbe8de65b..3c3b90db56 100644 --- a/engines/tsage/ringworld_scenes3.h +++ b/engines/tsage/ringworld_scenes3.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef TSAGE_RINGWORLD_SCENES3_H @@ -288,6 +285,7 @@ public: virtual void postInit(SceneObjectList *OwnerList = NULL); virtual void stripCallback(int v); virtual void signal(); + virtual void synchronize(Serializer &s); }; class Scene2120 : public Scene { @@ -323,8 +321,9 @@ public: int _subjectIndex; int _lineOffset; + Scene2120(); virtual void postInit(SceneObjectList *OwnerList = NULL); - virtual void synchronise(Serialiser &s); + virtual void synchronize(Serializer &s); }; class Scene2150 : public Scene { @@ -381,7 +380,7 @@ public: Scene2150(); virtual void postInit(SceneObjectList *OwnerList = NULL); - virtual void synchronise(Serialiser &s); + virtual void synchronize(Serializer &s); virtual void signal(); virtual void dispatch(); }; @@ -446,7 +445,7 @@ public: Scene2200(); virtual void postInit(SceneObjectList *OwnerList = NULL); virtual void stripCallback(int v); - virtual void synchronise(Serialiser &s); + virtual void synchronize(Serializer &s); virtual void signal(); virtual void dispatch(); }; @@ -579,7 +578,7 @@ public: Scene2230(); virtual void postInit(SceneObjectList *OwnerList = NULL); - virtual void synchronise(Serialiser &s); + virtual void synchronize(Serializer &s); virtual void dispatch(); }; @@ -679,7 +678,7 @@ public: Scene2280(); virtual void postInit(SceneObjectList *OwnerList = NULL); - virtual void synchronise(Serialiser &s); + virtual void synchronize(Serializer &s); virtual void signal(); virtual void dispatch(); }; @@ -760,7 +759,7 @@ public: Scene2310(); virtual void postInit(SceneObjectList *OwnerList = NULL); - virtual void synchronise(Serialiser &s); + virtual void synchronize(Serializer &s); virtual void signal(); virtual void process(Event &event); virtual void dispatch(); @@ -873,7 +872,7 @@ public: Scene2320(); virtual void postInit(SceneObjectList *OwnerList = NULL); - virtual void synchronise(Serialiser &s); + virtual void synchronize(Serializer &s); virtual void signal(); }; diff --git a/engines/tsage/ringworld_scenes4.cpp b/engines/tsage/ringworld_scenes4.cpp index 89feb223a1..883da9b5b1 100644 --- a/engines/tsage/ringworld_scenes4.cpp +++ b/engines/tsage/ringworld_scenes4.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/config-manager.h" @@ -113,8 +110,8 @@ Scene3700::Viewer::Viewer() { _percentList[3] = 114; } -void Scene3700::Viewer::synchronise(Serialiser &s) { - SceneObject::synchronise(s); +void Scene3700::Viewer::synchronize(Serializer &s) { + SceneObject::synchronize(s); s.syncAsByte(_active); s.syncAsSint16LE(_countdownCtr); for (int idx = 0; idx < 4; ++idx) { diff --git a/engines/tsage/ringworld_scenes4.h b/engines/tsage/ringworld_scenes4.h index f5dac297fc..389c67b83a 100644 --- a/engines/tsage/ringworld_scenes4.h +++ b/engines/tsage/ringworld_scenes4.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef TSAGE_RINGWORLD_SCENES4_H @@ -67,7 +64,7 @@ class Scene3700 : public Scene { Viewer(); virtual Common::String getClassName() { return "Viewer"; } - virtual void synchronise(Serialiser &s); + virtual void synchronize(Serializer &s); virtual void dispatch(); virtual void reposition(); virtual void draw(); diff --git a/engines/tsage/ringworld_scenes5.cpp b/engines/tsage/ringworld_scenes5.cpp index 3dfd421b60..cda69b859f 100644 --- a/engines/tsage/ringworld_scenes5.cpp +++ b/engines/tsage/ringworld_scenes5.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/config-manager.h" @@ -47,7 +44,6 @@ void Scene4000::Action1::signal() { scene->_hotspot5.animate(ANIM_MODE_1, NULL); scene->_hotspot5.setPosition(Common::Point(116, 160)); -// ADD_PLAYER_MOVER_NULL(scene->_hotspot5, 208, 169); Common::Point pt(208, 169); NpcMover *mover = new NpcMover(); scene->_hotspot5.addMover(mover, &pt, this); @@ -102,7 +98,7 @@ void Scene4000::Action1::signal() { } case 4: ADD_MOVER(scene->_miranda, -30, 86); - ADD_MOVER(scene->_hotspot5, -40, 86); + ADD_MOVER_NULL(scene->_hotspot5, -40, 86); break; case 5: _globals->_soundHandler.startSound(155); @@ -989,7 +985,6 @@ void Scene4000::postInit(SceneObjectList *OwnerList) { _globals->_player.enableControl(); if (RING_INVENTORY._ladder._sceneNumber != 4000) { - _hotspot8.postInit(); _hotspot8.setVisage(4017); _hotspot8.animate(ANIM_MODE_1, NULL); _hotspot8.setPosition(Common::Point(199, 188)); @@ -1009,8 +1004,9 @@ void Scene4000::postInit(SceneObjectList *OwnerList) { _olo.setObjectWrapper(new SceneObjectWrapper()); _olo.setPosition(Common::Point(219, 150)); + _sceneMode = 4010; _globals->_player.disableControl(); - setAction(&_sequenceManager1, this, 4010, &_globals->_player, NULL); + setAction(&_sequenceManager1, this, 4010, &_globals->_player, &_olo, NULL); } if (_globals->_stripNum == 4000) { @@ -1137,6 +1133,10 @@ void Scene4000::postInit(SceneObjectList *OwnerList) { void Scene4000::signal() { switch (_sceneMode) { + case 4010: + _globals->setFlag(38); + _olo.remove(); + // Deliberate fall-through case 4001: _globals->_player.enableControl(); break; @@ -1169,10 +1169,6 @@ void Scene4000::signal() { case 4009: _globals->_sceneManager.changeScene(2200); break; - case 4010: - _globals->setFlag(38); - _olo.remove(); - break; case 4012: _globals->_player.checkAngle(&_theTech); _globals->_sceneManager.changeScene(4025); @@ -1415,8 +1411,8 @@ void Scene4025::Action3::signal() { /*--------------------------------------------------------------------------*/ -void Scene4025::Hole::synchronise(Serialiser &s) { - SceneObject::synchronise(s); +void Scene4025::Hole::synchronize(Serializer &s) { + SceneObject::synchronize(s); SYNC_POINTER(_pegPtr); s.syncAsSint16LE(_armStrip); s.syncAsSint16LE(_newPosition.x); @@ -1459,8 +1455,8 @@ void Scene4025::Hole::doAction(int action) { } } -void Scene4025::Peg::synchronise(Serialiser &s) { - SceneObject::synchronise(s); +void Scene4025::Peg::synchronize(Serializer &s) { + SceneObject::synchronize(s); s.syncAsSint16LE(_field88); SYNC_POINTER(_armStrip); } @@ -1600,8 +1596,8 @@ void Scene4025::postInit(SceneObjectList *OwnerList) { setAction(&_sequenceManager, this, 4026, NULL); } -void Scene4025::synchronise(Serialiser &s) { - Scene::synchronise(s); +void Scene4025::synchronize(Serializer &s) { + Scene::synchronize(s); SYNC_POINTER(_pegPtr); SYNC_POINTER(_pegPtr2); SYNC_POINTER(_holePtr); @@ -1755,7 +1751,7 @@ void Scene4045::OlloStand::doAction(int action) { case CURSOR_TALK: if (_strip == 5) { setStrip(6); - animate(ANIM_MODE_NONE, 0); + animate(ANIM_MODE_NONE, NULL); } if (_globals->_player._position.y < 135) { scene->_sceneMode = 4046; @@ -1831,10 +1827,10 @@ Scene4045::Scene4045() : _hotspot7(9, CURSOR_LOOK, 4045, 0, CURSOR_USE, 4045, 15, LIST_END), _hotspot8(10, CURSOR_LOOK, 4045, 2, LIST_END), _hotspot9(11, CURSOR_LOOK, 4045, 3, CURSOR_USE, 4045, 15, LIST_END), - _hotspot10(12, CURSOR_LOOK, 4045, 4, CURSOR_USE, 4045, 19, LIST_END), + _hotspot10(12, CURSOR_LOOK, 4045, 4, CURSOR_USE, 4100, 19, LIST_END), _hotspot11(13, CURSOR_LOOK, 4045, 6, CURSOR_USE, 4045, 15, LIST_END), - _hotspot12(14, CURSOR_LOOK, 4045, 7, CURSOR_USE, 4045, 29, LIST_END), - _hotspot13(15, CURSOR_LOOK, 4045, 8, CURSOR_USE, 4045, 19, LIST_END), + _hotspot12(14, CURSOR_LOOK, 4045, 7, CURSOR_USE, 4150, 29, LIST_END), + _hotspot13(15, CURSOR_LOOK, 4045, 8, CURSOR_USE, 4100, 19, LIST_END), _hotspot14(0, CURSOR_LOOK, 4045, 10, LIST_END) { _hotspot14.setBounds(Rect(0, 0, SCREEN_WIDTH, SCREEN_HEIGHT)); @@ -2002,7 +1998,7 @@ void Scene4045::dispatch() { } /*-------------------------------------------------------------------------- - * Scene 4000 - Village - Temple + * Scene 4050 - Village - Outside * *--------------------------------------------------------------------------*/ @@ -3309,6 +3305,7 @@ void Scene4250::Hotspot1::doAction(int action) { } void Scene4250::Hotspot2::doAction(int action) { + //Ship with stasis field Scene4250 *scene = (Scene4250 *)_globals->_sceneManager._scene; switch (action) { @@ -3640,6 +3637,7 @@ void Scene4250::signal() { break; case 4253: if (_globals->_stripNum == 4301) { + _sceneMode = 4261; ADD_MOVER_NULL(_hotspot1, 241, 169); setAction(&_sequenceManager, this, 4261, &_globals->_player, &_hotspot6, NULL); } else { @@ -3660,10 +3658,6 @@ void Scene4250::signal() { case 4270: _globals->_player.enableControl(); break; - case 4255: - case 4262: - case 4263: - break; case 4259: _globals->_soundHandler.startSound(360); _globals->_sceneManager.changeScene(9900); @@ -3672,6 +3666,11 @@ void Scene4250::signal() { RING_INVENTORY._keyDevice._sceneNumber = 1; _globals->_player.enableControl(); break; + case 4255: + case 4262: + case 4263: + default: + break; } } @@ -3861,6 +3860,7 @@ void Scene4300::Hotspot9::doAction(int action) { } void Scene4300::Hotspot10::doAction(int action) { + // Alien Scene4300 *scene = (Scene4300 *)_globals->_sceneManager._scene; switch (action) { @@ -4191,8 +4191,8 @@ void Scene4300::process(Event &event) { * *--------------------------------------------------------------------------*/ -void Scene4301::Action1::synchronise(Serialiser &s) { - Action::synchronise(s); +void Scene4301::Action1::synchronize(Serializer &s) { + Action::synchronize(s); s.syncAsSint16LE(_field34E); for (int idx = 0; idx < 6; ++idx) s.syncAsSint16LE(_indexList[idx]); @@ -4244,6 +4244,7 @@ void Scene4301::Action1::signal() { _actionIndex = 2; break; case 10: + // Puzzle: Wrong code _globals->_events.setCursor(CURSOR_NONE); scene->_soundHandler.startSound(337); if (scene->_hotspot3._flags & OBJFLAG_HIDE) @@ -4268,6 +4269,7 @@ void Scene4301::Action1::signal() { _globals->_events.setCursor(CURSOR_USE); break; case 20: + // Puzzle: Correct code _globals->_player.disableControl(); scene->_soundHandler.startSound(339); scene->_hotspot3._frame = 3; @@ -4290,6 +4292,7 @@ void Scene4301::Action1::signal() { } void Scene4301::Action1::process(Event &event) { + // Puzzle Scene4301 *scene = (Scene4301 *)_globals->_sceneManager._scene; Rect buttonsRect; @@ -4344,6 +4347,7 @@ void Scene4301::Action1::process(Event &event) { /*--------------------------------------------------------------------------*/ void Scene4301::Hotspot4::doAction(int action) { + // Hatch near door Scene4301 *scene = (Scene4301 *)_globals->_sceneManager._scene; if (action == CURSOR_USE) { diff --git a/engines/tsage/ringworld_scenes5.h b/engines/tsage/ringworld_scenes5.h index 626eab5dab..a2991c7283 100644 --- a/engines/tsage/ringworld_scenes5.h +++ b/engines/tsage/ringworld_scenes5.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef TSAGE_RINGWORLD_SCENES5_H @@ -97,8 +94,8 @@ class Scene4000 : public Scene { private: int _ctr; public: - virtual void synchronise(Serialiser &s) { - SceneObject::synchronise(s); + virtual void synchronize(Serializer &s) { + SceneObject::synchronize(s); s.syncAsUint16LE(_ctr); } virtual void doAction(int action); @@ -208,7 +205,7 @@ class Scene4025 : public Scene { int _armStrip; Common::Point _newPosition; - virtual void synchronise(Serialiser &s); + virtual void synchronize(Serializer &s); virtual void doAction(int action); }; class Peg : public SceneObject { @@ -217,7 +214,7 @@ class Scene4025 : public Scene { int _armStrip; Peg() : SceneObject() { _field88 = 0; _armStrip = 3; } - virtual void synchronise(Serialiser &s); + virtual void synchronize(Serializer &s); virtual void doAction(int action); }; @@ -248,7 +245,7 @@ public: Scene4025(); virtual void postInit(SceneObjectList *OwnerList = NULL); - virtual void synchronise(Serialiser &s); + virtual void synchronize(Serializer &s); virtual void remove(); virtual void signal(); virtual void process(Event &event); @@ -300,8 +297,8 @@ public: DisplayHotspot _hotspot7, _hotspot8, _hotspot9, _hotspot10; DisplayHotspot _hotspot11, _hotspot12, _hotspot13, _hotspot14; Action1 _action1; - Action _action2; - Action _action3; + Action2 _action2; + Action3 _action3; Scene4045(); virtual void postInit(SceneObjectList *OwnerList = NULL); @@ -656,7 +653,7 @@ class Scene4301 : public Scene { int _field34E; int _indexList[6]; - virtual void synchronise(Serialiser &s); + virtual void synchronize(Serializer &s); virtual void remove(); virtual void signal(); virtual void process(Event &event); @@ -684,8 +681,8 @@ public: virtual void postInit(SceneObjectList *OwnerList = NULL); virtual void dispatch(); - virtual void synchronise(Serialiser &s) { - Scene::synchronise(s); + virtual void synchronize(Serializer &s) { + Scene::synchronize(s); s.syncAsSint16LE(_field68E); } }; diff --git a/engines/tsage/ringworld_scenes6.cpp b/engines/tsage/ringworld_scenes6.cpp index 17f7654e70..958c0ef9e2 100644 --- a/engines/tsage/ringworld_scenes6.cpp +++ b/engines/tsage/ringworld_scenes6.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "tsage/ringworld_scenes6.h" @@ -135,6 +132,7 @@ void Scene5000::Action2::signal() { ADD_MOVER(_globals->_player, 213, 98); break; case 4: + _globals->_player.fixPriority(20); ADD_MOVER(_globals->_player, 215, 115); break; case 5: @@ -218,7 +216,7 @@ void Scene5000::Action3::signal() { break; case 4: scene->_hotspot7.fixPriority(19); - ADD_MOVER(scene->_hotspot7, 213, 98); + ADD_MOVER(scene->_hotspot7, 215, 115); break; case 5: scene->_hotspot7.changeZoom(46); @@ -1390,8 +1388,7 @@ void Scene5100::dispatch() { if (_globals->getFlag(61) && !_globals->getFlag(62) && ((_globals->_player._position.x - _hotspot2._position.x) < 160) && - (_globals->_sceneManager._previousScene != 5200) && - (_globals->_sceneManager._previousScene != 5150)) { + (_globals->_sceneManager._previousScene != 5200) && (_sceneMode != 5150)) { setAction(NULL); _sceneMode = 5150; _soundHandler.startSound(208); @@ -1589,9 +1586,6 @@ void Scene5200::Hotspot14::doAction(int action) { case CURSOR_USE: scene->setAction(&scene->_action2); break; - default: - SceneObject::doAction(action); - break; } } diff --git a/engines/tsage/ringworld_scenes6.h b/engines/tsage/ringworld_scenes6.h index 16b2800fc6..6ac73d4bff 100644 --- a/engines/tsage/ringworld_scenes6.h +++ b/engines/tsage/ringworld_scenes6.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef TSAGE_RINGWORLD_SCENES6_H @@ -321,8 +318,8 @@ public: Scene5300(); virtual void postInit(SceneObjectList *OwnerList = NULL); virtual void signal(); - virtual void synchronise(Serialiser &s) { - Scene::synchronise(s); + virtual void synchronize(Serializer &s) { + Scene::synchronize(s); s.syncAsSint16LE(_field1B0A); } }; diff --git a/engines/tsage/ringworld_scenes8.cpp b/engines/tsage/ringworld_scenes8.cpp index 3f1895a432..05306fb450 100644 --- a/engines/tsage/ringworld_scenes8.cpp +++ b/engines/tsage/ringworld_scenes8.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "graphics/cursorman.h" @@ -31,12 +28,20 @@ namespace tSage { -void NamedHotspotMult::synchronise(Serialiser &s) { - SceneHotspot::synchronise(s); +void NamedHotspotMult::synchronize(Serializer &s) { + SceneHotspot::synchronize(s); s.syncAsSint16LE(_useLineNum); s.syncAsSint16LE(_lookLineNum); } +void SceneObject7700::synchronize(Serializer &s) { + SceneObject::synchronize(s); + if (s.getVersion() >= 3) { + s.syncAsSint16LE(_lookLineNum); + s.syncAsSint16LE(_defltLineNum); + } +} + /*-------------------------------------------------------------------------- * Scene 7000 * @@ -59,7 +64,7 @@ void Scene7000::Action1::signal() { scene->_object1.postInit(); scene->_object1.setVisage(7003); scene->_object1.animate(ANIM_MODE_5, this); - scene->_object1.setPosition(Common::Point(151, 182), 0); + scene->_object1.setPosition(Common::Point(151, 182)); scene->_object1.fixPriority(205); _globals->_sceneItems.push_front(&scene->_object1); break; @@ -91,7 +96,7 @@ void Scene7000::Action2::signal() { setDelay(3); break; case 1: - _globals->_player.addMover(0, 0); + _globals->_player.addMover(NULL); _globals->_player.setVisage(7006); _globals->_player.setStrip(1); _globals->_player.setFrame(1); @@ -114,7 +119,7 @@ void Scene7000::Action3::dispatch() { Action::dispatch(); if (_actionIndex == 4) - scene->_object4.setPosition(scene->_object3._position, 0); + scene->_object4.setPosition(Common::Point(scene->_object3._position.x, scene->_object3._position.y + 15)); } /*--------------------------------------------------------------------------*/ @@ -130,7 +135,7 @@ void Scene7000::Action3::signal() { scene->_object4.setVisage(5001); scene->_object4.setStrip2(2); scene->_object4.animate(ANIM_MODE_8, 0, NULL); - scene->_object4.setPosition(Common::Point(10, 18), 0); + scene->_object4.setPosition(Common::Point(10, 18)); scene->_object4.fixPriority(10); scene->_object4.changeZoom(100); scene->_object4.hide(); @@ -144,7 +149,7 @@ void Scene7000::Action3::signal() { case 2: scene->_object3._moveDiff.y = 1; scene->_object3.fixPriority(10); - scene->_object4.setPosition(Common::Point(scene->_object3._position.x, scene->_object3._position.y + 15), 0); + scene->_object4.setPosition(Common::Point(scene->_object3._position.x, scene->_object3._position.y + 15)); scene->_object4.show(); setDelay(30); break; @@ -346,11 +351,11 @@ void Scene7000::Action7::signal() { /*--------------------------------------------------------------------------*/ -void Scene7000::SceneItem1::doAction(int action) { +void Scene7000::Hotspot1::doAction(int action) { if (action == CURSOR_LOOK) - SceneItem::display(7000, 2, SET_WIDTH, 200, SET_EXT_BGCOLOR, 7, LIST_END); - - SceneItem::doAction(action); + SceneItem::display2(7000, 2); + else + SceneHotspot::doAction(action); } /*--------------------------------------------------------------------------*/ @@ -412,9 +417,9 @@ void Scene7000::Object1::doAction(int action) { break; case CURSOR_LOOK: if (_globals->getFlag(81)) - SceneItem::display(7000, 1, SET_WIDTH, 200, SET_EXT_BGCOLOR, 7, LIST_END); + SceneItem::display2(7000, 1); else - SceneItem::display(7000, 0, SET_WIDTH, 200, SET_EXT_BGCOLOR, 7, LIST_END); + SceneItem::display2(7000, 0); break; case CURSOR_USE: if (_globals->getFlag(81)) { @@ -422,7 +427,7 @@ void Scene7000::Object1::doAction(int action) { _globals->_player.disableControl(); scene->setAction(&scene->_action5); } else { - SceneItem::display(7000, 5, SET_WIDTH, 200, SET_EXT_BGCOLOR, 7, LIST_END); + SceneItem::display2(7000, 5); } break; case CURSOR_TALK: @@ -432,13 +437,13 @@ void Scene7000::Object1::doAction(int action) { scene->setAction(&scene->_action5); } else if (_globals->getFlag(52)) { scene->_sceneMode = 7005; - scene->setAction(&scene->_sequenceManager, scene, 7013, 0, 0); + scene->setAction(&scene->_sequenceManager, scene, 7013, NULL); } else if (_globals->getFlag(13)) { _globals->_sceneManager._sceneNumber = 7002; - scene->setAction(&scene->_sequenceManager, scene, 7014, 0, 0); + scene->setAction(&scene->_sequenceManager, scene, 7014, NULL); } else { _globals->_sceneManager._sceneNumber = 7002; - scene->setAction(&scene->_sequenceManager, scene, 7002, 0, 0); + scene->setAction(&scene->_sequenceManager, scene, 7002, NULL); } break; default: @@ -493,35 +498,35 @@ void Scene7000::postInit(SceneObjectList *OwnerList) { _object5.setVisage(7001); _object5.setStrip2(1); _object5.animate(ANIM_MODE_2, NULL); - _object5.setPosition(Common::Point(49, 147), 0); + _object5.setPosition(Common::Point(49, 147)); _object5.fixPriority(1); _object6.postInit(); _object6.setVisage(7001); _object6.setStrip2(2); _object6.animate(ANIM_MODE_2, NULL); - _object6.setPosition(Common::Point(160, 139), 0); + _object6.setPosition(Common::Point(160, 139)); _object6.fixPriority(1); _object7.postInit(); _object7.setVisage(7001); _object7.setStrip2(3); _object7.animate(ANIM_MODE_2, NULL); - _object7.setPosition(Common::Point(272, 129), 0); + _object7.setPosition(Common::Point(272, 129)); _object7.fixPriority(1); _object8.postInit(); _object8.setVisage(7001); _object8.setStrip2(4); _object8.animate(ANIM_MODE_2, NULL); - _object8.setPosition(Common::Point(176, 175), 0); + _object8.setPosition(Common::Point(176, 175)); _object8.fixPriority(1); if (_globals->getFlag(72)) { _object3.postInit(); _object3.setVisage(5001); _object3.setStrip2(1); - _object3.setPosition(Common::Point(107, 92), 0); + _object3.setPosition(Common::Point(107, 92)); _object3.changeZoom(100); _object3.fixPriority(10); @@ -531,7 +536,7 @@ void Scene7000::postInit(SceneObjectList *OwnerList) { _object1.setStrip(4); else _object1.setStrip(2); - _object1.setPosition(Common::Point(87, 129), 0); + _object1.setPosition(Common::Point(87, 129)); _object1._numFrames = 4; _object1.changeZoom(45); _object1.animate(ANIM_MODE_8, 0, NULL); @@ -545,13 +550,13 @@ void Scene7000::postInit(SceneObjectList *OwnerList) { _globals->_player.animate(ANIM_MODE_1, NULL); SceneObjectWrapper *wrapper = new SceneObjectWrapper(); _globals->_player.setObjectWrapper(wrapper); - _globals->_player.setPosition(Common::Point(57, 94), 0); + _globals->_player.setPosition(Common::Point(57, 94)); _globals->_player.changeZoom(-1); _globals->_player.fixPriority(10); if (_globals->getFlag(81)) { setAction(&_action4); } else { - _object1.setPosition(Common::Point(151, 182), 0); + _object1.setPosition(Common::Point(151, 182)); _object1.changeZoom(100); setAction(&_action1); } @@ -563,7 +568,7 @@ void Scene7000::postInit(SceneObjectList *OwnerList) { _object3.setVisage(5001); _object3.setStrip2(1); _object3.animate(ANIM_MODE_1, NULL); - _object3.setPosition(Common::Point(307, 0), 0); + _object3.setPosition(Common::Point(307, 0)); _object3.changeZoom(-1); setAction(&_action3); } @@ -572,14 +577,14 @@ void Scene7000::postInit(SceneObjectList *OwnerList) { _globals->_player.setVisage(2170); _globals->_player.animate(ANIM_MODE_1, NULL); _globals->_player.setObjectWrapper(new SceneObjectWrapper()); - _globals->_player.setPosition(Common::Point(57, 94), 0); + _globals->_player.setPosition(Common::Point(57, 94)); _globals->_player.changeZoom(-1); _globals->_player.fixPriority(10); _globals->_player.disableControl(); _sceneMode = 7001; setAction(&_action6, this); if (!_globals->getFlag(81)) { - _object1.setPosition(Common::Point(151, 182), 0); + _object1.setPosition(Common::Point(151, 182)); _object1.changeZoom(100); } _object8.remove(); @@ -587,10 +592,10 @@ void Scene7000::postInit(SceneObjectList *OwnerList) { } else if (_globals->_sceneManager._previousScene == 2320) { _globals->_player.postInit(); _globals->_player.setVisage(0); - _globals->_player.animate(ANIM_MODE_1, 0); + _globals->_player.animate(ANIM_MODE_1, NULL); SceneObjectWrapper *wrapper = new SceneObjectWrapper(); _globals->_player.setObjectWrapper(wrapper); - _globals->_player.setPosition(Common::Point(57, 94), 0); + _globals->_player.setPosition(Common::Point(57, 94)); _globals->_player.changeZoom(-1); _globals->_player.fixPriority(10); _sceneMode = 7001; @@ -601,15 +606,15 @@ void Scene7000::postInit(SceneObjectList *OwnerList) { _object3.postInit(); _object3.setVisage(5001); _object3.setStrip2(1); - _object3.setPosition(Common::Point(307, 0), 0); + _object3.setPosition(Common::Point(307, 0)); _soundHandler.startSound(151); _soundHandler.proc5(1); _globals->_soundHandler.startSound(250); setAction(&_action3); } - _sceneItem1.setBounds(Rect(0, 0, SCREEN_WIDTH, SCREEN_HEIGHT)); - _globals->_sceneItems.push_back(&_sceneItem1); + _hotspot1.setBounds(Rect(0, 0, SCREEN_WIDTH, SCREEN_HEIGHT)); + _globals->_sceneItems.push_back(&_hotspot1); } /*--------------------------------------------------------------------------*/ @@ -741,13 +746,13 @@ void Scene7100::Action6::signal() { case 0: setDelay(1); scene->_object10.fixPriority(8); - scene->_object10.setPosition(Common::Point(155, 187), 0); + scene->_object10.setPosition(Common::Point(155, 187)); scene->_object11.fixPriority(8); - scene->_object11.setPosition(Common::Point(155, 190), 0); + scene->_object11.setPosition(Common::Point(155, 190)); scene->_object12.fixPriority(8); - scene->_object12.setPosition(Common::Point(151, 193), 0); + scene->_object12.setPosition(Common::Point(151, 193)); break; case 1: { Common::Point pt1(167, 187); @@ -756,11 +761,11 @@ void Scene7100::Action6::signal() { Common::Point pt2(165, 185); NpcMover *mover2 = new NpcMover(); - scene->_object11.addMover(mover2, &pt2, 0); + scene->_object11.addMover(mover2, &pt2, NULL); Common::Point pt3(163, 183); NpcMover *mover3 = new NpcMover(); - scene->_object12.addMover(mover3, &pt3, 0); + scene->_object12.addMover(mover3, &pt3, NULL); break; } case 2: { @@ -773,13 +778,13 @@ void Scene7100::Action6::signal() { scene->_object11.fixPriority(50); Common::Point pt2(89, 185); NpcMover *mover2 = new NpcMover(); - scene->_object11.addMover(mover2, &pt2, 0); + scene->_object11.addMover(mover2, &pt2, NULL); scene->_object12.setStrip2(6); scene->_object12.fixPriority(50); Common::Point pt3(87, 183); NpcMover *mover3 = new NpcMover(); - scene->_object12.addMover(mover3, &pt3, 0); + scene->_object12.addMover(mover3, &pt3, NULL); break; } case 3: @@ -807,7 +812,7 @@ void Scene7100::Action7::signal() { scene->_object13.setStrip2(2); Common::Point pt(524, 104); NpcMover *mover = new NpcMover(); - scene->_object13.addMover(mover, &pt, 0); + scene->_object13.addMover(mover, &pt, NULL); break; } case 3: @@ -835,11 +840,11 @@ void Scene7100::Action8::signal() { Common::Point pt2(480, 146); NpcMover *mover2 = new NpcMover(); - scene->_object18.addMover(mover2, &pt2, 0); + scene->_object18.addMover(mover2, &pt2, NULL); Common::Point pt3(470, 153); NpcMover *mover3 = new NpcMover(); - scene->_object19.addMover(mover3, &pt3, 0); + scene->_object19.addMover(mover3, &pt3, NULL); break; } case 2: { @@ -853,11 +858,11 @@ void Scene7100::Action8::signal() { Common::Point pt2(502, 179); NpcMover *mover2 = new NpcMover(); - scene->_object18.addMover(mover2, &pt2, 0); + scene->_object18.addMover(mover2, &pt2, NULL); Common::Point pt3(495, 184); NpcMover *mover3 = new NpcMover(); - scene->_object19.addMover(mover3, &pt3, 0); + scene->_object19.addMover(mover3, &pt3, NULL); break; } case 3: { @@ -871,11 +876,11 @@ void Scene7100::Action8::signal() { Common::Point pt2(379, 161); NpcMover *mover2 = new NpcMover(); - scene->_object18.addMover(mover2, &pt2, 0); + scene->_object18.addMover(mover2, &pt2, NULL); Common::Point pt3(373, 167); NpcMover *mover3 = new NpcMover(); - scene->_object19.addMover(mover3, &pt3, 0); + scene->_object19.addMover(mover3, &pt3, NULL); break; } case 4: { @@ -889,11 +894,11 @@ void Scene7100::Action8::signal() { Common::Point pt2(473, 187); NpcMover *mover2 = new NpcMover(); - scene->_object18.addMover(mover2, &pt2, 0); + scene->_object18.addMover(mover2, &pt2, NULL); Common::Point pt3(466, 192); NpcMover *mover3 = new NpcMover(); - scene->_object19.addMover(mover3, &pt3, 0); + scene->_object19.addMover(mover3, &pt3, NULL); break; } case 5: { @@ -903,11 +908,11 @@ void Scene7100::Action8::signal() { Common::Point pt2(552, 178); NpcMover *mover2 = new NpcMover(); - scene->_object18.addMover(mover2, &pt2, 0); + scene->_object18.addMover(mover2, &pt2, NULL); Common::Point pt3(541, 183); NpcMover *mover3 = new NpcMover(); - scene->_object19.addMover(mover3, &pt3, 0); + scene->_object19.addMover(mover3, &pt3, NULL); _actionIndex = 0; break; @@ -1015,68 +1020,68 @@ void Scene7100::postInit(SceneObjectList *OwnerList) { _object2.postInit(); _object2.setVisage(7161); - _object2.animate(ANIM_MODE_2, 0); - _object2.setPosition(Common::Point(10, 140), 0); + _object2.animate(ANIM_MODE_2, NULL); + _object2.setPosition(Common::Point(10, 140)); _object2._numFrames = 1; _object2.fixPriority(180); - _object2.setAction(&_action1, 0); + _object2.setAction(&_action1, NULL); _object3.postInit(); _object3.setVisage(7161); - _object3.animate(ANIM_MODE_2, 0); - _object3.setPosition(Common::Point(34, 115), 0); + _object3.animate(ANIM_MODE_2, NULL); + _object3.setPosition(Common::Point(34, 115)); _object3._numFrames = 1; _object3.fixPriority(180); - _object3.setAction(&_action2, 0); + _object3.setAction(&_action2, NULL); _object4.postInit(); _object4.setVisage(7164); - _object4.animate(ANIM_MODE_2, 0); - _object4.setPosition(Common::Point(-10, 159), 0); + _object4.animate(ANIM_MODE_2, NULL); + _object4.setPosition(Common::Point(-10, 159)); _object4._numFrames = 2; _object4.fixPriority(250); - _object4.setAction(&_action3, 0); + _object4.setAction(&_action3, NULL); _object5.postInit(); _object5.setVisage(7162); _object5.setStrip(3); - _object5.animate(ANIM_MODE_2, 0); - _object5.setPosition(Common::Point(20, 52), 0); - _object5.setAction(&_action4, 0); + _object5.animate(ANIM_MODE_2, NULL); + _object5.setPosition(Common::Point(20, 52)); + _object5.setAction(&_action4, NULL); _object9.postInit(); _object9.setVisage(7160); _object5.setStrip(2); - _object9.animate(ANIM_MODE_2, 0); - _object9.setPosition(Common::Point(110, 168), 0); + _object9.animate(ANIM_MODE_2, NULL); + _object9.setPosition(Common::Point(110, 168)); _object9._numFrames = 2; _object9.fixPriority(16); - _object9.setAction(&_action5, 0); + _object9.setAction(&_action5, NULL); _object13.postInit(); _object13.setVisage(7161); _object13.setStrip(8); - _object13.animate(ANIM_MODE_2, 0); - _object13.setPosition(Common::Point(524, 104), 0); + _object13.animate(ANIM_MODE_2, NULL); + _object13.setPosition(Common::Point(524, 104)); _object13._numFrames = 5; _object13.fixPriority(250); - _object13.setAction(&_action7, 0); + _object13.setAction(&_action7, NULL); _object17.postInit(); _object17.setVisage(7160); _object17.setStrip(3); - _object17.animate(ANIM_MODE_2, 0); - _object17.setPosition(Common::Point(552, 183), 0); + _object17.animate(ANIM_MODE_2, NULL); + _object17.setPosition(Common::Point(552, 183)); _object17._numFrames = 4; _object17._moveDiff.x = 12; _object17._moveDiff.y = 12; - _object17.setAction(&_action8, 0); + _object17.setAction(&_action8, NULL); _object18.postInit(); _object18.setVisage(7160); _object18.setStrip(3); - _object18.animate(ANIM_MODE_2, 0); - _object18.setPosition(Common::Point(552, 178), 0); + _object18.animate(ANIM_MODE_2, NULL); + _object18.setPosition(Common::Point(552, 178)); _object18._numFrames = 4; _object18._moveDiff.x = 12; _object18._moveDiff.y = 12; @@ -1084,8 +1089,8 @@ void Scene7100::postInit(SceneObjectList *OwnerList) { _object19.postInit(); _object19.setVisage(7160); _object19.setStrip(3); - _object19.animate(ANIM_MODE_2, 0); - _object19.setPosition(Common::Point(541, 183), 0); + _object19.animate(ANIM_MODE_2, NULL); + _object19.setPosition(Common::Point(541, 183)); _object19._numFrames = 4; _object19._moveDiff.x = 12; _object19._moveDiff.y = 12; @@ -1093,37 +1098,37 @@ void Scene7100::postInit(SceneObjectList *OwnerList) { _object24.postInit(); _object24.setVisage(7162); _object24.setStrip(1); - _object24.animate(ANIM_MODE_2, 0); - _object24.setPosition(Common::Point(-12, 182), 0); + _object24.animate(ANIM_MODE_2, NULL); + _object24.setPosition(Common::Point(-12, 182)); _object24._numFrames = 4; _object24.fixPriority(180); - _object24.setAction(&_action9, 0); + _object24.setAction(&_action9, NULL); _object25.postInit(); _object25.setVisage(7163); - _object25.animate(ANIM_MODE_2, 0); - _object25.setPosition(Common::Point(551, 145), 0); + _object25.animate(ANIM_MODE_2, NULL); + _object25.setPosition(Common::Point(551, 145)); _object25._numFrames = 5; _object25.fixPriority(160); - _object25.setAction(&_action10, 0); + _object25.setAction(&_action10, NULL); // Swimmer 1 _globals->_player.postInit(); _globals->_player.setVisage(7101); - _globals->_player.animate(ANIM_MODE_2, 0); + _globals->_player.animate(ANIM_MODE_2, NULL); _globals->_player._moveDiff.x = 4; _globals->_player._moveDiff.y = 2; - _globals->_player.setPosition(Common::Point(135, 135), 0); + _globals->_player.setPosition(Common::Point(135, 135)); _globals->_player.fixPriority(200); _globals->_player.disableControl(); // Swimmer 2 _object1.postInit(); _object1.setVisage(7110); - _object1.animate(ANIM_MODE_1, 0); + _object1.animate(ANIM_MODE_1, NULL); _object1._moveDiff.x = 4; _object1._moveDiff.y = 2; - _object1.setPosition(Common::Point(100, 100), 0); + _object1.setPosition(Common::Point(100, 100)); setAction(&_action11); _soundHandler1.startSound(270); @@ -1181,10 +1186,10 @@ void Scene7200::Action2::signal() { scene->_object2.addMover(mover1, &pt1, this); NpcMover *mover2 = new NpcMover(); Common::Point pt2(56, 85); - scene->_object3.addMover(mover2, &pt2, 0); + scene->_object3.addMover(mover2, &pt2, NULL); NpcMover *mover3 = new NpcMover(); Common::Point pt3(54, 80); - scene->_object4.addMover(mover3, &pt3, 0); + scene->_object4.addMover(mover3, &pt3, NULL); break; } case 2: { @@ -1199,10 +1204,10 @@ void Scene7200::Action2::signal() { scene->_object2.addMover(mover1, &pt1, this); NpcMover *mover2 = new NpcMover(); Common::Point pt2(12, 84); - scene->_object3.addMover(mover2, &pt2, 0); + scene->_object3.addMover(mover2, &pt2, NULL); NpcMover *mover3 = new NpcMover(); Common::Point pt3(10, 79); - scene->_object4.addMover(mover3, &pt3, 0); + scene->_object4.addMover(mover3, &pt3, NULL); break; } case 3: @@ -1220,77 +1225,77 @@ void Scene7200::postInit(SceneObjectList *OwnerList) { Scene::postInit(); _object2.postInit(); _object2.setVisage(7160); - _object2.animate(ANIM_MODE_2, 0); + _object2.animate(ANIM_MODE_2, NULL); _object2.setZoom(10); - _object2.setPosition(Common::Point(53, 88), 0); + _object2.setPosition(Common::Point(53, 88)); _object2.setAction(&_action2); _object3.postInit(); _object3.setVisage(7160); - _object3.animate(ANIM_MODE_2, 0); + _object3.animate(ANIM_MODE_2, NULL); _object3.setZoom(10); - _object3.setPosition(Common::Point(55, 83), 0); + _object3.setPosition(Common::Point(55, 83)); _object4.postInit(); _object4.setVisage(7160); - _object4.animate(ANIM_MODE_2, 0); + _object4.animate(ANIM_MODE_2, NULL); _object4.setZoom(10); - _object4.setPosition(Common::Point(57, 78), 0); + _object4.setPosition(Common::Point(57, 78)); _object5.postInit(); _object5.setVisage(7201); - _object5.setPosition(Common::Point(300, 172), 0); + _object5.setPosition(Common::Point(300, 172)); _object5.setPriority(172); - _object5.animate(ANIM_MODE_2, 0); + _object5.animate(ANIM_MODE_2, NULL); _object5._numFrames = 3; _object6.postInit(); _object6.setVisage(7201); _object6.setStrip2(3); - _object6.setPosition(Common::Point(144, 97), 0); + _object6.setPosition(Common::Point(144, 97)); _object6.setPriority(199); - _object6.animate(ANIM_MODE_2, 0); + _object6.animate(ANIM_MODE_2, NULL); _object6._numFrames = 3; _object7.postInit(); _object7.setVisage(7201); _object7.setStrip2(4); - _object7.setPosition(Common::Point(115, 123), 0); + _object7.setPosition(Common::Point(115, 123)); _object7.setPriority(199); - _object7.animate(ANIM_MODE_2, 0); + _object7.animate(ANIM_MODE_2, NULL); _object7._numFrames = 3; _object8.postInit(); _object8.setVisage(7201); _object8.setStrip2(6); - _object8.setPosition(Common::Point(140, 173), 0); + _object8.setPosition(Common::Point(140, 173)); _object8.setPriority(199); - _object8.animate(ANIM_MODE_2, 0); + _object8.animate(ANIM_MODE_2, NULL); _object8._numFrames = 3; _object9.postInit(); _object9.setVisage(7201); _object9.setStrip2(7); - _object9.setPosition(Common::Point(215, 196), 0); + _object9.setPosition(Common::Point(215, 196)); _object9.setPriority(199); - _object9.animate(ANIM_MODE_2, 0); + _object9.animate(ANIM_MODE_2, NULL); _object9._numFrames = 3; // Orange swimmer _globals->_player.postInit(); _globals->_player.setVisage(7110); - _globals->_player.animate(ANIM_MODE_1, 0); + _globals->_player.animate(ANIM_MODE_1, NULL); _globals->_player.setObjectWrapper(new SceneObjectWrapper()); _globals->_player.setZoom(50); - _globals->_player.setPosition(Common::Point(-18, 16), 0); + _globals->_player.setPosition(Common::Point(-18, 16)); _globals->_player.disableControl(); _swimmer.postInit(); _swimmer.setVisage(7101); - _swimmer.animate(ANIM_MODE_1, 0); + _swimmer.animate(ANIM_MODE_1, NULL); _swimmer.setObjectWrapper(new SceneObjectWrapper()); _swimmer.setZoom(50); - _swimmer.setPosition(Common::Point(-8, 16), 0); + _swimmer.setPosition(Common::Point(-8, 16)); setAction(&_action1); _soundHandler.startSound(271); @@ -1426,65 +1431,65 @@ void Scene7300::postInit(SceneObjectList *OwnerList) { _object4.setVisage(7311); _object4.setStrip(1); _object4.setFrame(1); - _object4.setPosition(Common::Point(218, 157), 0); + _object4.setPosition(Common::Point(218, 157)); _object3.postInit(); _object3.setVisage(7311); _object3.setStrip(2); _object3.setFrame(1); - _object3.setPosition(Common::Point(203, 96), 0); + _object3.setPosition(Common::Point(203, 96)); _object3._numFrames = 2; _object3._moveDiff = Common::Point(1, 1); - _object3.animate(ANIM_MODE_8, 0, 0); + _object3.animate(ANIM_MODE_8, 0, NULL); _object3._moveRate = 2; _object3.setAction(&_action2); _globals->_player.postInit(); _globals->_player.setVisage(7305); - _globals->_player.animate(ANIM_MODE_1, 0); - _globals->_player.setPosition(Common::Point(-100, 100), 0); + _globals->_player.animate(ANIM_MODE_1, NULL); + _globals->_player.setPosition(Common::Point(-100, 100)); _globals->_player.disableControl(); _object1.postInit(); _object1.setVisage(7312); - _object1.animate(ANIM_MODE_1, 0); + _object1.animate(ANIM_MODE_1, NULL); _object1._moveDiff = Common::Point(1, 1); - _object1.setPosition(Common::Point(76, 78), 0); + _object1.setPosition(Common::Point(76, 78)); _object1._moveRate = 1; _object1.setAction(&_action3); _object2.postInit(); _object2.setVisage(7312); _object2.setStrip(2); - _object2.animate(ANIM_MODE_2, 0); - _object2.setPosition(Common::Point(77, 47), 0); + _object2.animate(ANIM_MODE_2, NULL); + _object2.setPosition(Common::Point(77, 47)); _object2.fixPriority(190); _object5.postInit(); _object5.setVisage(7300); - _object5.setPosition(Common::Point(106, 45), 0); - _object5.animate(ANIM_MODE_2, 0); + _object5.setPosition(Common::Point(106, 45)); + _object5.animate(ANIM_MODE_2, NULL); _object5._numFrames = 5; _object6.postInit(); _object6.setVisage(7300); _object6.setStrip2(2); - _object6.setPosition(Common::Point(283, 193), 0); - _object6.animate(ANIM_MODE_2, 0); + _object6.setPosition(Common::Point(283, 193)); + _object6.animate(ANIM_MODE_2, NULL); _object6._numFrames = 3; _object7.postInit(); _object7.setVisage(7300); _object7.setStrip(4); - _object7.setPosition(Common::Point(295, 77), 0); - _object7.animate(ANIM_MODE_2, 0); + _object7.setPosition(Common::Point(295, 77)); + _object7.animate(ANIM_MODE_2, NULL); _object7._numFrames = 3; _object8.postInit(); _object8.setVisage(7300); _object8.setStrip(5); - _object8.setPosition(Common::Point(1, 147), 0); - _object8.animate(ANIM_MODE_2, 0); + _object8.setPosition(Common::Point(1, 147)); + _object8.animate(ANIM_MODE_2, NULL); _object8._numFrames = 2; setAction(&_action1); @@ -1602,7 +1607,7 @@ void Scene7600::postInit(SceneObjectList *OwnerList) { *--------------------------------------------------------------------------*/ void Scene7700::Action1::signal() { - SceneObject *fmtObj = (SceneObject *) _endHandler; + SceneObjectExt *fmtObj = (SceneObjectExt *) _endHandler; switch (_actionIndex++) { case 0: { PlayerMover *mover1 = new PlayerMover(); @@ -1612,7 +1617,7 @@ void Scene7700::Action1::signal() { } case 1: _globals->_player.checkAngle(fmtObj); - if (_globals->_player._field8C == 0) + if (fmtObj->_state == 0) fmtObj->animate(ANIM_MODE_5, this); else fmtObj->animate(ANIM_MODE_6, this); @@ -1631,7 +1636,7 @@ void Scene7700::Action2::signal() { setDelay(_globals->_randomSource.getRandomNumber(60) + 60); break; case 1: - scene->_prof.animate(ANIM_MODE_7, 0, 0); + scene->_prof.animate(ANIM_MODE_7, 0, NULL); setDelay(20); break; case 3: @@ -1658,7 +1663,7 @@ void Scene7700::Action3::signal() { case 2: scene->_soundHandler.startSound(260); scene->_object8.setVisage(7703); - scene->_object8.setPosition(Common::Point(177, 97), 0); + scene->_object8.setPosition(Common::Point(177, 97)); scene->_object8.setStrip2(3); scene->_object8.animate(ANIM_MODE_5, this); scene->_object8._numFrames = 3; @@ -1684,12 +1689,12 @@ void Scene7700::Action4::signal() { scene->_object13.postInit(); scene->_object13.setVisage(7700); scene->_object13.setStrip2(7); - scene->_object13.setPosition(Common::Point(151, 33), 0); + scene->_object13.setPosition(Common::Point(151, 33)); scene->_object13.animate(ANIM_MODE_5, this); break; case 3: CursorMan.showMouse(true); - SceneItem::display(7700, 11, SET_WIDTH, 200, SET_EXT_BGCOLOR, 7, LIST_END); + SceneItem::display2(7700, 11); _globals->_player.enableControl(); remove(); break; @@ -1704,7 +1709,7 @@ void Scene7700::Action5::signal() { break; case 1: { scene->_cloud.setFrame(_globals->_randomSource.getRandomNumber(1) + 1); - scene->_cloud.setPosition(Common::Point(133, 145 + _globals->_randomSource.getRandomNumber(54)), 0); + scene->_cloud.setPosition(Common::Point(133, 145 + _globals->_randomSource.getRandomNumber(54))); Common::Point pt(360, scene->_cloud._position.y); NpcMover *mover = new NpcMover(); @@ -1729,13 +1734,13 @@ void Scene7700::Action6::signal() { } case 2: scene->_easterEgg1.setStrip(2); - scene->_easterEgg1.setPosition(Common::Point(43, 65), 0); + scene->_easterEgg1.setPosition(Common::Point(43, 65)); scene->_easterEgg2.postInit(); scene->_easterEgg2.setVisage(7708); scene->_easterEgg2.setStrip(3); - scene->_easterEgg2.setPosition(Common::Point(116, 54), 0); - scene->_easterEgg2.animate(ANIM_MODE_2, 0); + scene->_easterEgg2.setPosition(Common::Point(116, 54)); + scene->_easterEgg2.animate(ANIM_MODE_2, NULL); setDelay(120); break; @@ -1749,14 +1754,14 @@ void Scene7700::Action6::signal() { void Scene7700::SceneHotspot1::doAction(int action) { if (action == CURSOR_LOOK) - SceneItem::display(7700, 4, SET_WIDTH, 200, SET_EXT_BGCOLOR, 7, LIST_END); + SceneItem::display2(7700, 4); else SceneHotspot::doAction(action); } void Scene7700::SceneHotspot2::doAction(int action) { if (action == CURSOR_LOOK) - SceneItem::display(7700, 6, SET_WIDTH, 200, SET_EXT_BGCOLOR, 7, LIST_END); + SceneItem::display2(7700, 6); else SceneHotspot::doAction(action); } @@ -1766,19 +1771,19 @@ void Scene7700::SceneHotspot3::doAction(int action) { switch (action) { case OBJECT_KEY: - SceneItem::display(7702, 3, SET_WIDTH, 200, SET_EXT_BGCOLOR, 7, LIST_END); + SceneItem::display2(7702, 3); RING_INVENTORY._key._sceneNumber = 7700; break; case CURSOR_LOOK: if (RING_INVENTORY._key._sceneNumber == 7700) - scene->setAction(&scene->_action4, 0); + scene->setAction(&scene->_action4, NULL); else - SceneItem::display(7700, 53, SET_WIDTH, 200, SET_EXT_BGCOLOR, 7, LIST_END); + SceneItem::display2(7700, 53); break; case CURSOR_USE: if (!_globals->getFlag(78)) { scene->_sceneMode = 7712; - scene->setAction(&scene->_sequenceManager, scene, 7715, 0); + scene->setAction(&scene->_sequenceManager, scene, 7715, NULL); } else if (RING_INVENTORY._key._sceneNumber == 7700) { _globals->_player.disableControl(); scene->_sceneMode = 7705; @@ -1796,14 +1801,14 @@ void Scene7700::SceneHotspot4::doAction(int action) { switch (action) { case CURSOR_LOOK: - SceneItem::display(7700, 12, SET_WIDTH, 200, SET_EXT_BGCOLOR, 7, LIST_END); + SceneItem::display2(7700, 12); break; case CURSOR_USE: if (!_globals->getFlag(78)) { scene->_sceneMode = 7712; - scene->setAction(&scene->_sequenceManager, scene, 7715, 0); + scene->setAction(&scene->_sequenceManager, scene, 7715, NULL); } else { - SceneItem::display(7700, 12, SET_WIDTH, 200, SET_EXT_BGCOLOR, 7, LIST_END); + SceneItem::display2(7700, 12); } break; default: @@ -1817,18 +1822,18 @@ void Scene7700::SceneHotspot5::doAction(int action) { switch (action) { case CURSOR_LOOK: - SceneItem::display(7700, 28, SET_WIDTH, 200, SET_EXT_BGCOLOR, 7, LIST_END); + SceneItem::display2(7700, 28); break; case CURSOR_USE: if (_globals->getFlag(78)) { if (RING_INVENTORY._paper._sceneNumber == 7700) { _globals->_player.disableControl(); scene->_sceneMode = 7708; - scene->setAction(&scene->_sequenceManager, scene, 7708, &_globals->_player, 0); + scene->setAction(&scene->_sequenceManager, scene, 7708, &_globals->_player, NULL); } } else { scene->_sceneMode = 7712; - scene->setAction(&scene->_sequenceManager, scene, 7715, 0); + scene->setAction(&scene->_sequenceManager, scene, 7715, NULL); } break; default: @@ -1840,10 +1845,10 @@ void Scene7700::SceneHotspot5::doAction(int action) { void Scene7700::SceneHotspot6::doAction(int action) { switch (action) { case CURSOR_LOOK: - SceneItem::display(7700, 43, SET_WIDTH, 200, SET_EXT_BGCOLOR, 7, LIST_END); + SceneItem::display2(7700, 43); break; case CURSOR_USE: - SceneItem::display(7700, 56, SET_WIDTH, 200, SET_EXT_BGCOLOR, 7, LIST_END); + SceneItem::display2(7700, 56); break; default: SceneHotspot::doAction(action); @@ -1853,7 +1858,7 @@ void Scene7700::SceneHotspot6::doAction(int action) { void Scene7700::SceneItem7::doAction(int action) { if (action == CURSOR_LOOK) - SceneItem::display(7700, 51, SET_WIDTH, 200, SET_EXT_BGCOLOR, 7, LIST_END); + SceneItem::display2(7700, 51); } void Scene7700::SceneHotspot8::doAction(int action) { @@ -1861,7 +1866,7 @@ void Scene7700::SceneHotspot8::doAction(int action) { switch (action) { case CURSOR_LOOK: - SceneItem::display(7700, 48, SET_WIDTH, 200, SET_EXT_BGCOLOR, 7, LIST_END); + SceneItem::display2(7700, 48); break; case CURSOR_USE: scene->_sceneMode = 7709; @@ -1887,7 +1892,7 @@ void Scene7700::SceneHotspot9::doAction(int action) { switch (action) { case CURSOR_LOOK: - SceneItem::display(7700, 48, SET_WIDTH, 200, SET_EXT_BGCOLOR, 7, LIST_END); + SceneItem::display2(7700, 48); break; case CURSOR_USE: scene->_sceneMode = 7709; @@ -1929,14 +1934,14 @@ void Scene7700::Object1::doAction(int action) { Scene7700 *scene = (Scene7700 *)_globals->_sceneManager._scene; if (action == CURSOR_LOOK) { - SceneItem::display(7700, _lookLineNum, SET_WIDTH, 200, SET_EXT_BGCOLOR, 7, LIST_END); + SceneItem::display2(7700, _lookLineNum); } else if (action == CURSOR_USE) { if (_globals->getFlag(78)) { _globals->_player.disableControl(); scene->setAction(&scene->_action1, this); } else { scene->_sceneMode = 7712; - scene->setAction(&scene->_sequenceManager, scene, 7715, 0); + scene->setAction(&scene->_sequenceManager, scene, 7715, NULL); } } else { SceneHotspot::doAction(action); @@ -1946,10 +1951,10 @@ void Scene7700::Object1::doAction(int action) { void Scene7700::SceneHotspot11::doAction(int action) { switch (action) { case CURSOR_LOOK: - SceneItem::display(7700, _lookLineNum, SET_WIDTH, 200, SET_EXT_BGCOLOR, 7, LIST_END); + SceneItem::display2(7700, _lookLineNum); break; case CURSOR_USE: - SceneItem::display(7701, _useLineNum, SET_WIDTH, 200, SET_EXT_BGCOLOR, 7, LIST_END); + SceneItem::display2(7701, _useLineNum); break; default: SceneHotspot::doAction(action); @@ -1960,7 +1965,7 @@ void Scene7700::SceneHotspot11::doAction(int action) { void Scene7700::Object1::signal() { if (_state == 0) { _state = 1; - SceneItem::display(7701, _defltLineNum, SET_WIDTH, 200, SET_EXT_BGCOLOR, 7, LIST_END); + SceneItem::display2(7701, _defltLineNum); } else { _state = 0; } @@ -1971,19 +1976,19 @@ void Scene7700::Object3::doAction(int action) { Scene7700 *scene = (Scene7700 *)_globals->_sceneManager._scene; if (action == CURSOR_LOOK) { - SceneItem::display(7700, 34, SET_WIDTH, 200, SET_EXT_BGCOLOR, 7, LIST_END); + SceneItem::display2(7700, 34); } else if (action == CURSOR_USE) { if (_globals->getFlag(78)) { if (scene->_object3._frame == 1) { _globals->_player.disableControl(); scene->_sceneMode = 7707; - scene->setAction(&scene->_sequenceManager, scene, 7707, &_globals->_player, this, 0); + scene->setAction(&scene->_sequenceManager, scene, 7707, &_globals->_player, this, NULL); } else { - SceneItem::display(7700, 60, SET_WIDTH, 200, SET_EXT_BGCOLOR, 7, LIST_END); + SceneItem::display2(7700, 60); } } else { scene->_sceneMode = 7712; - scene->setAction(&scene->_sequenceManager, scene, 7715, 0); + scene->setAction(&scene->_sequenceManager, scene, 7715, NULL); } } else { SceneHotspot::doAction(action); @@ -1996,30 +2001,30 @@ void Scene7700::Object7::doAction(int action) { switch (action) { case CURSOR_LOOK: if (_globals->getFlag(78)) - SceneItem::display(7700, 45, SET_WIDTH, 200, SET_EXT_BGCOLOR, 7, LIST_END); + SceneItem::display2(7700, 45); else - SceneItem::display(7700, 44, SET_WIDTH, 200, SET_EXT_BGCOLOR, 7, LIST_END); + SceneItem::display2(7700, 44); break; case CURSOR_USE: if (_globals->getFlag(78)) { - SceneItem::display(7701, 41, SET_WIDTH, 200, SET_EXT_BGCOLOR, 7, LIST_END); + SceneItem::display2(7701, 41); } else { scene->_sceneMode = 7712; - scene->setAction(&scene->_sequenceManager, scene, 7714, 0); + scene->setAction(&scene->_sequenceManager, scene, 7714, NULL); } break; case CURSOR_TALK: if (_globals->getFlag(78)) { - SceneItem::display(7702, 1, SET_WIDTH, 200, SET_EXT_BGCOLOR, 7, LIST_END); + SceneItem::display2(7702, 1); } else { _globals->_player.disableControl(); if (_state == 0) { _state = 1; scene->_sceneMode = 7703; - scene->setAction(&scene->_sequenceManager, scene, 7703, 0); + scene->setAction(&scene->_sequenceManager, scene, 7703, NULL); } else { scene->_sceneMode = 7712; - scene->setAction(&scene->_sequenceManager, scene, 7712, 0); + scene->setAction(&scene->_sequenceManager, scene, 7712, NULL); } } break; @@ -2027,10 +2032,10 @@ void Scene7700::Object7::doAction(int action) { if (!_globals->getFlag(78)) { _globals->_soundHandler.proc3(); _globals->setFlag(78); - setAction(0); + setAction(NULL); _globals->_player.disableControl(); scene->_sceneMode = 7704; - scene->setAction(&scene->_sequenceManager, scene, 7704, &_globals->_player, this, 0); + scene->setAction(&scene->_sequenceManager, scene, 7704, &_globals->_player, this, NULL); } break; default: @@ -2047,14 +2052,14 @@ void Scene7700::Object8::doAction(int action) { scene->_object9.postInit(); scene->_object9.setVisage(7701); scene->_object9.setStrip2(3); - scene->_object9.setPosition(Common::Point(91, 166), 0); + scene->_object9.setPosition(Common::Point(91, 166)); scene->_object9.fixPriority(200); scene->_object14.postInit(); scene->_object14.setVisage(7701); scene->_object14.setStrip(2); scene->_object14.fixPriority(250); - scene->_object14.setPosition(Common::Point(139, 151), 0); + scene->_object14.setPosition(Common::Point(139, 151)); scene->_gfxButton.setText(EXIT_MSG); scene->_gfxButton._bounds.center(140, 189); @@ -2066,7 +2071,7 @@ void Scene7700::Object8::doAction(int action) { } else if (_globals->getFlag(78)) { scene->_object15.postInit(); scene->_object15.setVisage(7701); - scene->_object15.setPosition(Common::Point(140, 165), 0); + scene->_object15.setPosition(Common::Point(140, 165)); scene->_object15.fixPriority(200); scene->_gfxButton.setText(EXIT_MSG); @@ -2077,7 +2082,7 @@ void Scene7700::Object8::doAction(int action) { scene->_object19.postInit(); scene->_object19.setVisage(7700); scene->_object19.setStrip(6); - scene->_object19.setPosition(Common::Point(140, 192), 0); + scene->_object19.setPosition(Common::Point(140, 192)); _globals->_sceneItems.push_front(&scene->_sceneItem10); _globals->_sceneItems.push_front(&scene->_sceneHotspot8); @@ -2097,13 +2102,13 @@ void Scene7700::Object9::doAction(int action) { switch (action) { case CURSOR_LOOK: - SceneItem::display(7700, 49, SET_WIDTH, 200, SET_EXT_BGCOLOR, 7, LIST_END); + SceneItem::display2(7700, 49); break; case CURSOR_USE: - SceneItem::display(7701, 42, SET_WIDTH, 200, SET_EXT_BGCOLOR, 7, LIST_END); + SceneItem::display2(7701, 42); break; case CURSOR_TALK: - SceneItem::display(7702, 4, SET_WIDTH, 200, SET_EXT_BGCOLOR, 7, LIST_END); + SceneItem::display2(7702, 4); break; case OBJECT_KEY: if (_frame == 1) { @@ -2116,7 +2121,7 @@ void Scene7700::Object9::doAction(int action) { scene->_object10.fixPriority(240); } scene->_soundHandler.startSound(262); - scene->_object14.animate(ANIM_MODE_5, 0); + scene->_object14.animate(ANIM_MODE_5, NULL); } _globals->_events.setCursor(CURSOR_WALK); break; @@ -2129,7 +2134,7 @@ void Scene7700::Object10::doAction(int action) { Scene7700 *scene = (Scene7700 *)_globals->_sceneManager._scene; if (action == CURSOR_LOOK) { - SceneItem::display(7700, 50, SET_WIDTH, 200, SET_EXT_BGCOLOR, 7, LIST_END); + SceneItem::display2(7700, 50); } else if (action == CURSOR_USE) { _globals->_player._canWalk = true; RING_INVENTORY._translator._sceneNumber = 1; @@ -2150,19 +2155,19 @@ void Scene7700::Object11::doAction(int action) { switch (action) { case OBJECT_SCANNER: if (_frame != 1) - SceneItem::display(7701, 44, SET_WIDTH, 200, SET_EXT_BGCOLOR, 7, LIST_END); + SceneItem::display2(7701, 44); else SceneItem::doAction(action); break; case CURSOR_LOOK: if (_frame != 1) - SceneItem::display(7700, 9, SET_WIDTH, 200, SET_EXT_BGCOLOR, 7, LIST_END); + SceneItem::display2(7700, 9); else - SceneItem::display(7700, 52, SET_WIDTH, 200, SET_EXT_BGCOLOR, 7, LIST_END); + SceneItem::display2(7700, 52); break; case CURSOR_USE: if (_frame != 1) { - SceneItem::display(7701, 8, SET_WIDTH, 200, SET_EXT_BGCOLOR, 7, LIST_END); + SceneItem::display2(7701, 8); } else { _globals->setFlag(49); _globals->_player.disableControl(); @@ -2186,7 +2191,7 @@ void Scene7700::Object12::doAction(int action) { Scene7700 *scene = (Scene7700 *)_globals->_sceneManager._scene; if (action == CURSOR_LOOK) { - SceneItem::display(7700, 15, SET_WIDTH, 200, SET_EXT_BGCOLOR, 7, LIST_END); + SceneItem::display2(7700, 15); } else if (action == CURSOR_USE) { if (_globals->getFlag(78)) { scene->_sceneMode = 7713; @@ -2209,7 +2214,7 @@ void Scene7700::signal() { _globals->_player.enableControl(); } else { _sceneMode = 7711; - setAction(&_sequenceManager, this, 7711, 0); + setAction(&_sequenceManager, this, 7711, NULL); } break; case 7702: @@ -2227,7 +2232,7 @@ void Scene7700::signal() { _globals->_soundHandler.startSound(256); _prof.setStrip2(4); _prof.setFrame2(1); - _prof.setPosition(Common::Point(159, 87), 0); + _prof.setPosition(Common::Point(159, 87)); _globals->_player.enableControl(); break; case 7705: @@ -2243,7 +2248,7 @@ void Scene7700::signal() { break; case 7710: _globals->_player.enableControl(); - SceneItem::display(7700, 62, SET_WIDTH, 200, SET_EXT_BGCOLOR, 7, LIST_END); + SceneItem::display2(7700, 62); break; case 7713: _emptyJar.remove(); @@ -2276,9 +2281,9 @@ void Scene7700::process(Event &event) { if (!_globals->_sceneObjects->contains(&_easterEgg1)) { _easterEgg1.postInit(); _easterEgg1.setVisage(7708); - _easterEgg1.setPosition(Common::Point(163, 50), 0); + _easterEgg1.setPosition(Common::Point(163, 50)); _easterEgg1.fixPriority(1); - _easterEgg1.animate(ANIM_MODE_2, 0); + _easterEgg1.animate(ANIM_MODE_2, NULL); _easterEgg1.setAction(&_action6); } } @@ -2293,7 +2298,7 @@ void Scene7700::dispatch() { if ((_action == 0) && (_globals->_sceneRegions.indexOf(_globals->_player._position) == 30)) { _globals->_player.disableControl(); _sceneMode = 7702; - setAction(&_sequenceManager, this, 7702, &_globals->_player, 0); + setAction(&_sequenceManager, this, 7702, &_globals->_player, NULL); } Scene::dispatch(); } @@ -2314,10 +2319,10 @@ void Scene7700::postInit(SceneObjectList *OwnerList) { _globals->_player.postInit(); _globals->_player.setVisage(4201); - _globals->_player.animate(ANIM_MODE_1, 0); + _globals->_player.animate(ANIM_MODE_1, NULL); SceneObjectWrapper *wrapper = new SceneObjectWrapper(); _globals->_player.setObjectWrapper(wrapper); - _globals->_player.setPosition(Common::Point(-19, 68), 0); + _globals->_player.setPosition(Common::Point(-19, 68)); _globals->_player.setStrip2(7); _globals->_player.fixPriority(95); _globals->_player.changeZoom(80); @@ -2331,9 +2336,9 @@ void Scene7700::postInit(SceneObjectList *OwnerList) { if (_globals->getFlag(78)) { _prof.setStrip2(4); _prof.fixPriority(80); - _prof.setPosition(Common::Point(159, 87), 0); + _prof.setPosition(Common::Point(159, 87)); } else { - _prof.setPosition(Common::Point(203, 87), 0); + _prof.setPosition(Common::Point(203, 87)); _prof.setStrip2(2); _prof._numFrames = 6; _prof.setAction(&_action2); @@ -2343,39 +2348,39 @@ void Scene7700::postInit(SceneObjectList *OwnerList) { _cloud.setVisage(7700); _cloud.setStrip2(5); _cloud.fixPriority(1); - _cloud.setPosition(Common::Point(133, 160), 0); + _cloud.setPosition(Common::Point(133, 160)); _cloud._moveDiff.x = 1; _cloud._moveRate = 7; _cloud.setAction(&_action5); _object1.postInit(); _object1.setVisage(7700); - _object1.setPosition(Common::Point(184, 61), 0); + _object1.setPosition(Common::Point(184, 61)); _object1._lookLineNum = 18; _object1._defltLineNum = 16; _object2.postInit(); _object2.setVisage(7700); - _object2.setPosition(Common::Point(184, 70), 0); + _object2.setPosition(Common::Point(184, 70)); _object2.fixPriority(60); _object2._lookLineNum = 19; _object2._defltLineNum = 17; _object3.postInit(); _object3.setVisage(7703); - _object3.setPosition(Common::Point(288, 36), 0); + _object3.setPosition(Common::Point(288, 36)); _object3.setStrip(2); _object4.postInit(); _object4.setVisage(7700); - _object4.setPosition(Common::Point(268, 59), 0); + _object4.setPosition(Common::Point(268, 59)); _object4.setStrip(2); _object4._lookLineNum = 37; _object4._defltLineNum = 35; _object5.postInit(); _object5.setVisage(7700); - _object5.setPosition(Common::Point(268, 67), 0); + _object5.setPosition(Common::Point(268, 67)); _object5.fixPriority(58); _object5.setStrip2(3); _object5._lookLineNum = 38; @@ -2383,7 +2388,7 @@ void Scene7700::postInit(SceneObjectList *OwnerList) { _object6.postInit(); _object6.setVisage(7700); - _object6.setPosition(Common::Point(268, 75), 0); + _object6.setPosition(Common::Point(268, 75)); _object6.fixPriority(57); _object6.setStrip2(4); _object6._lookLineNum = 40; @@ -2391,7 +2396,7 @@ void Scene7700::postInit(SceneObjectList *OwnerList) { _object8.postInit(); _object8.setVisage(7703); - _object8.setPosition(Common::Point(203, 91), 0); + _object8.setPosition(Common::Point(203, 91)); _object8.setStrip2(4); _object8.fixPriority(86); @@ -2400,7 +2405,7 @@ void Scene7700::postInit(SceneObjectList *OwnerList) { _cork.postInit(); _cork.setVisage(7703); - _cork.setPosition(Common::Point(32, 128), 0); + _cork.setPosition(Common::Point(32, 128)); if (_globals->getFlag(49)) _cork.setFrame(_cork.getFrameCount()); @@ -2409,7 +2414,7 @@ void Scene7700::postInit(SceneObjectList *OwnerList) { _emptyJar.postInit(); _emptyJar.setVisage(7700); _emptyJar.setStrip(8); - _emptyJar.setPosition(Common::Point(189, 48), 0); + _emptyJar.setPosition(Common::Point(189, 48)); _globals->_sceneItems.addItems(&_emptyJar, NULL); } _sceneHotspot1._sceneRegionId = 28; @@ -2510,7 +2515,7 @@ void Scene7700::postInit(SceneObjectList *OwnerList) { _globals->_sceneItems.addItems(&_object6, &_object5, &_object4, &_sceneHotspot6, &_sceneHotspot36, &_sceneItem7, NULL); _sceneMode = 7701; - setAction(&_sequenceManager, this, 7701, &_globals->_player, 0); + setAction(&_sequenceManager, this, 7701, &_globals->_player, NULL); _soundHandler.startSound(256); } @@ -2523,4 +2528,13 @@ Scene7700::Scene7700() { _prof._state = 0; } +void Scene7700::synchronize(Serializer &s) { + Scene::synchronize(s); + if (s.getVersion() >= 3) { + s.syncAsSint16LE(_field977); + s.syncAsSint16LE(_field979); + s.syncAsSint16LE(_field97B); + } +} + } // End of namespace tSage diff --git a/engines/tsage/ringworld_scenes8.h b/engines/tsage/ringworld_scenes8.h index e40f3d4133..8b183e895f 100644 --- a/engines/tsage/ringworld_scenes8.h +++ b/engines/tsage/ringworld_scenes8.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef TSAGE_RINGWORLD_SCENES8_H @@ -41,18 +38,14 @@ public: NamedHotspotMult() : SceneHotspot() {} virtual Common::String getClassName() { return "NamedHotspotMult"; } - virtual void synchronise(Serialiser &s); + virtual void synchronize(Serializer &s); }; class SceneObject7700 : public SceneObjectExt { public: int _lookLineNum, _defltLineNum; - virtual void synchronise(Serialiser &s) { - SceneObject::synchronise(s); - s.syncAsSint16LE(_lookLineNum); - s.syncAsSint16LE(_defltLineNum); - } + virtual void synchronize(Serializer &s); virtual Common::String getClassName() { return "SceneObject7700"; } }; @@ -95,7 +88,7 @@ class Scene7000 : public Scene { }; /* Items */ - class SceneItem1 : public SceneItem { + class Hotspot1 : public SceneHotspot { public: virtual void doAction(int action); }; @@ -125,7 +118,7 @@ public: Action5 _action5; Action6 _action6; Action7 _action7; - SceneItem1 _sceneItem1; + Hotspot1 _hotspot1; virtual void postInit(SceneObjectList *OwnerList = NULL); virtual void signal(); @@ -489,6 +482,7 @@ public: virtual void signal(); virtual void process(Event &event); virtual void dispatch(); + virtual void synchronize(Serializer &s); }; } // End of namespace tSage diff --git a/engines/tsage/saveload.cpp b/engines/tsage/saveload.cpp index 317bc4bbb7..6ae62568a3 100644 --- a/engines/tsage/saveload.cpp +++ b/engines/tsage/saveload.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/savefile.h" @@ -53,7 +50,7 @@ Saver::Saver() { Saver::~Saver() { // Internal validation that no saved object is still present int totalLost = 0; - for (SynchronisedList<SavedObject *>::iterator i = _saver->_objList.begin(); i != _saver->_objList.end(); ++i) { + for (SynchronizedList<SavedObject *>::iterator i = _saver->_objList.begin(); i != _saver->_objList.end(); ++i) { SavedObject *so = *i; if (so) ++totalLost; @@ -65,7 +62,7 @@ Saver::~Saver() { /*--------------------------------------------------------------------------*/ -void Serialiser::syncPointer(SavedObject **ptr, Common::Serializer::Version minVersion, +void Serializer::syncPointer(SavedObject **ptr, Common::Serializer::Version minVersion, Common::Serializer::Version maxVersion) { int idx; assert(ptr); @@ -89,7 +86,7 @@ void Serialiser::syncPointer(SavedObject **ptr, Common::Serializer::Version minV } } -void Serialiser::validate(const Common::String &s, Common::Serializer::Version minVersion, +void Serializer::validate(const Common::String &s, Common::Serializer::Version minVersion, Common::Serializer::Version maxVersion) { Common::String tempStr = s; syncString(tempStr, minVersion, maxVersion); @@ -98,7 +95,7 @@ void Serialiser::validate(const Common::String &s, Common::Serializer::Version m error("Savegame is corrupt"); } -void Serialiser::validate(int v, Common::Serializer::Version minVersion, +void Serializer::validate(int v, Common::Serializer::Version minVersion, Common::Serializer::Version maxVersion) { int tempVal = v; syncAsUint32LE(tempVal, minVersion, maxVersion); @@ -118,9 +115,10 @@ Common::Error Saver::save(int slot, const Common::String &saveName) { _macroSaveFlag = true; _saveSlot = slot; - // Set up the serialiser + // Set up the serializer Common::OutSaveFile *saveFile = g_system->getSavefileManager()->openForSaving(_vm->generateSaveName(slot)); - Serialiser serialiser(NULL, saveFile); + Serializer serializer(NULL, saveFile); + serializer.setSaveVersion(TSAGE_SAVEGAME_VERSION); // Write out the savegame header tSageSavegameHeader header; @@ -129,14 +127,14 @@ Common::Error Saver::save(int slot, const Common::String &saveName) { writeSavegameHeader(saveFile, header); // Save out objects that need to come at the start of the savegame - for (SynchronisedList<SaveListener *>::iterator i = _listeners.begin(); i != _listeners.end(); ++i) { - (*i)->listenerSynchronise(serialiser); + for (SynchronizedList<SaveListener *>::iterator i = _listeners.begin(); i != _listeners.end(); ++i) { + (*i)->listenerSynchronize(serializer); } // Save each registered SaveObject descendant object into the savegame file - for (SynchronisedList<SavedObject *>::iterator i = _objList.begin(); i != _objList.end(); ++i) { - serialiser.validate((*i)->getClassName()); - (*i)->synchronise(serialiser); + for (SynchronizedList<SavedObject *>::iterator i = _objList.begin(); i != _objList.end(); ++i) { + serializer.validate((*i)->getClassName()); + (*i)->synchronize(serializer); } // Save file complete @@ -162,24 +160,26 @@ Common::Error Saver::restore(int slot) { _saveSlot = slot; _unresolvedPtrs.clear(); - // Set up the serialiser + // Set up the serializer Common::InSaveFile *saveFile = g_system->getSavefileManager()->openForLoading(_vm->generateSaveName(slot)); - Serialiser serialiser(saveFile, NULL); + Serializer serializer(saveFile, NULL); // Read in the savegame header tSageSavegameHeader header; readSavegameHeader(saveFile, header); delete header.thumbnail; + serializer.setSaveVersion(header.version); + // Load in data for objects that need to come at the start of the savegame for (Common::List<SaveListener *>::iterator i = _listeners.begin(); i != _listeners.end(); ++i) { - (*i)->listenerSynchronise(serialiser); + (*i)->listenerSynchronize(serializer); } // Loop through each registered object to load in the data - for (SynchronisedList<SavedObject *>::iterator i = _objList.begin(); i != _objList.end(); ++i) { - serialiser.validate((*i)->getClassName()); - (*i)->synchronise(serialiser); + for (SynchronizedList<SavedObject *>::iterator i = _objList.begin(); i != _objList.end(); ++i) { + serializer.validate((*i)->getClassName()); + (*i)->synchronize(serializer); } // Loop through the remaining data of the file, instantiating new objects. @@ -187,17 +187,17 @@ Common::Error Saver::restore(int slot) { // of instantiating a saved object registers it with the saver, and will then be resolved to whatever // object originally had a pointer to it as part of the post-processing step Common::String className; - serialiser.syncString(className); + serializer.syncString(className); while (className != "END") { SavedObject *savedObject; if (!_factoryPtr || ((savedObject = _factoryPtr(className)) == NULL)) error("Unknown class name '%s' encountered trying to restore savegame", className.c_str()); // Populate the contents of the object - savedObject->synchronise(serialiser); + savedObject->synchronize(serializer); // Move to next object - serialiser.syncString(className); + serializer.syncString(className); } // Post-process any unresolved pointers to get the correct pointer @@ -208,6 +208,7 @@ Common::Error Saver::restore(int slot) { // Final post-restore notifications _macroRestoreFlag = false; _loadNotifiers.notify(false); + _globals->_events.setCursor(_globals->_player._uiEnabled ? CURSOR_WALK : CURSOR_NONE); return Common::kNoError; } @@ -225,7 +226,7 @@ bool Saver::readSavegameHeader(Common::InSaveFile *in, tSageSavegameHeader &head return false; header.version = in->readByte(); - if (header.version != TSAGE_SAVEGAME_VERSION) + if (header.version > TSAGE_SAVEGAME_VERSION) return false; // Read in the string @@ -376,7 +377,7 @@ void Saver::resolveLoadPointers() { // Outer loop through the main object list int objIndex = 1; - for (SynchronisedList<SavedObject *>::iterator iObj = _objList.begin(); iObj != _objList.end(); ++iObj, ++objIndex) { + for (SynchronizedList<SavedObject *>::iterator iObj = _objList.begin(); iObj != _objList.end(); ++iObj, ++objIndex) { Common::List<SavedObjectRef>::iterator iPtr; SavedObject *pObj = *iObj; diff --git a/engines/tsage/saveload.h b/engines/tsage/saveload.h index c45271b8fc..51b7696590 100644 --- a/engines/tsage/saveload.h +++ b/engines/tsage/saveload.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef TSAGE_SAVELOAD_H @@ -36,7 +33,7 @@ namespace tSage { typedef void (*SaveNotifierFn)(bool postFlag); -#define TSAGE_SAVEGAME_VERSION 1 +#define TSAGE_SAVEGAME_VERSION 3 class SavedObject; @@ -62,11 +59,17 @@ struct tSageSavegameHeader { if (s.isLoading()) FIELD = (TYPE)v_##FIELD; /** - * Derived serialiser class with extra synchronisation types + * Derived serializer class with extra synchronisation types */ -class Serialiser : public Common::Serializer { +class Serializer : public Common::Serializer { public: - Serialiser(Common::SeekableReadStream *in, Common::WriteStream *out) : Common::Serializer(in, out) {} + Serializer(Common::SeekableReadStream *in, Common::WriteStream *out) : Common::Serializer(in, out) {} + + // HACK: TSAGE saved games contain a single byte for the savegame version, + // thus the normal syncVersion() Serializer member won't work here. In order + // to maintain compatibility with older game saves, this method is provided + // in order to set the savegame version from a byte + void setSaveVersion(byte version) { _version = version; } void syncPointer(SavedObject **ptr, Common::Serializer::Version minVersion = 0, Common::Serializer::Version maxVersion = kLastVersion); @@ -81,13 +84,13 @@ public: class Serialisable { public: virtual ~Serialisable() {} - virtual void synchronise(Serialiser &s) = 0; + virtual void synchronize(Serializer &s) = 0; }; class SaveListener { public: virtual ~SaveListener() {} - virtual void listenerSynchronise(Serialiser &s) = 0; + virtual void listenerSynchronize(Serializer &s) = 0; }; /*--------------------------------------------------------------------------*/ @@ -98,7 +101,7 @@ public: virtual ~SavedObject(); virtual Common::String getClassName() { return "SavedObject"; } - virtual void synchronise(Serialiser &s) {} + virtual void synchronize(Serializer &s) {} static SavedObject *createInstance(const Common::String &className); }; @@ -109,10 +112,10 @@ public: * Derived list class with extra functionality */ template<typename T> -class SynchronisedList : public Common::List<T> { +class SynchronizedList : public Common::List<T> { public: - void synchronise(Serialiser &s) { - int entryCount; + void synchronize(Serializer &s) { + int entryCount = 0; if (s.isLoading()) { this->clear(); diff --git a/engines/tsage/scenes.cpp b/engines/tsage/scenes.cpp index a59c86c97d..3741bdafd7 100644 --- a/engines/tsage/scenes.cpp +++ b/engines/tsage/scenes.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "tsage/scenes.h" @@ -71,7 +68,7 @@ void SceneManager::sceneChange() { } // Clear the scene objects - SynchronisedList<SceneObject *>::iterator io = _globals->_sceneObjects->begin(); + SynchronizedList<SceneObject *>::iterator io = _globals->_sceneObjects->begin(); while (io != _globals->_sceneObjects->end()) { SceneObject *sceneObj = *io; ++io; @@ -87,7 +84,7 @@ void SceneManager::sceneChange() { } // Clear the hotspot list - SynchronisedList<SceneItem *>::iterator ii = _globals->_sceneItems.begin(); + SynchronizedList<SceneItem *>::iterator ii = _globals->_sceneItems.begin(); while (ii != _globals->_sceneItems.end()) { SceneItem *sceneItem = *ii; ++ii; @@ -130,7 +127,7 @@ void SceneManager::sceneChange() { } Scene *SceneManager::getNewScene() { - return SceneFactory::createScene(_nextSceneNumber); + return _globals->_game->createScene(_nextSceneNumber); } void SceneManager::fadeInIfNecessary() { @@ -164,7 +161,7 @@ void SceneManager::changeScene(int newSceneNumber) { } // Stop any objects that were animating - SynchronisedList<SceneObject *>::iterator i; + SynchronizedList<SceneObject *>::iterator i; for (i = _globals->_sceneObjects->begin(); i != _globals->_sceneObjects->end(); ++i) { SceneObject *sceneObj = *i; Common::Point pt(0, 0); @@ -227,10 +224,10 @@ void SceneManager::setBgOffset(const Common::Point &pt, int loadCount) { _sceneLoadCount = loadCount; } -void SceneManager::listenerSynchronise(Serialiser &s) { +void SceneManager::listenerSynchronize(Serializer &s) { s.validate("SceneManager"); - _altSceneObjects.synchronise(s); + _altSceneObjects.synchronize(s); s.syncAsSint32LE(_sceneNumber); s.syncAsUint16LE(_globals->_sceneManager._scene->_activeScreenNumber); @@ -239,7 +236,7 @@ void SceneManager::listenerSynchronise(Serialiser &s) { checkScene(); } - _globals->_sceneManager._scrollerRect.synchronise(s); + _globals->_sceneManager._scrollerRect.synchronize(s); SYNC_POINTER(_globals->_scrollFollower); s.syncAsSint16LE(_loadMode); } @@ -256,16 +253,17 @@ Scene::Scene() : _sceneBounds(0, 0, SCREEN_WIDTH, SCREEN_HEIGHT), Scene::~Scene() { } -void Scene::synchronise(Serialiser &s) { - StripCallback::synchronise(s); +void Scene::synchronize(Serializer &s) { + if (s.getVersion() >= 2) + StripCallback::synchronize(s); s.syncAsSint32LE(_field12); s.syncAsSint32LE(_screenNumber); s.syncAsSint32LE(_activeScreenNumber); s.syncAsSint32LE(_sceneMode); - _backgroundBounds.synchronise(s); - _sceneBounds.synchronise(s); - _oldSceneBounds.synchronise(s); + _backgroundBounds.synchronize(s); + _sceneBounds.synchronize(s); + _oldSceneBounds.synchronize(s); s.syncAsSint16LE(_fieldA); s.syncAsSint16LE(_fieldE); @@ -435,7 +433,7 @@ void Scene::drawAltObjects() { Common::Array<SceneObject *> objList; // Initial loop to set the priority for entries in the list - for (SynchronisedList<SceneObject *>::iterator i = _globals->_sceneManager._altSceneObjects.begin(); + for (SynchronizedList<SceneObject *>::iterator i = _globals->_sceneManager._altSceneObjects.begin(); i != _globals->_sceneManager._altSceneObjects.end(); ++i) { SceneObject *obj = *i; objList.push_back(obj); @@ -492,4 +490,22 @@ void Scene::setZoomPercents(int yStart, int minPercent, int yEnd, int maxPercent _zoomPercents[yEnd++] = minPercent; } +/*--------------------------------------------------------------------------*/ + +void Game::execute() { + // Main game loop + bool activeFlag = false; + do { + // Process all currently atcive game handlers + activeFlag = false; + for (SynchronizedList<GameHandler *>::iterator i = _handlers.begin(); i != _handlers.end(); ++i) { + GameHandler *gh = *i; + if (gh->_lockCtr.getCtr() == 0) { + gh->execute(); + activeFlag = true; + } + } + } while (activeFlag && !_vm->getEventManager()->shouldQuit()); +} + } // End of namespace tSage diff --git a/engines/tsage/scenes.h b/engines/tsage/scenes.h index 0ac906728f..b3c009c4fe 100644 --- a/engines/tsage/scenes.h +++ b/engines/tsage/scenes.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef TSAGE_SCENES_H @@ -59,7 +56,7 @@ public: virtual ~Scene(); virtual Common::String getClassName() { return "Scene"; } - virtual void synchronise(Serialiser &s); + virtual void synchronize(Serializer &s); virtual void stripCallback(int v) {} virtual void postInit(SceneObjectList *OwnerList = NULL); virtual void process(Event &event); @@ -93,7 +90,7 @@ public: SceneManager(); virtual ~SceneManager(); - virtual void listenerSynchronise(Serialiser &s); + virtual void listenerSynchronize(Serializer &s); void setNewScene(int sceneNumber); void checkScene(); void sceneChange(); @@ -111,6 +108,30 @@ public: static void loadNotifier(bool postFlag); }; +class Game { +protected: + SynchronizedList<GameHandler *> _handlers; + + static bool notLockedFn(GameHandler *g); + virtual void handleSaveLoad(bool saveFlag, int &saveSlot, Common::String &saveName) {} +public: + virtual ~Game() {} + + void addHandler(GameHandler *entry) { _handlers.push_back(entry); } + void removeHandler(GameHandler *entry) { _handlers.remove(entry); } + + void execute(); + virtual void start() = 0; + virtual void restart() {} + virtual void restartGame() {} + virtual void saveGame() {} + virtual void restoreGame() {} + virtual void quitGame() {} + virtual void endGame(int resNum, int lineNum) {} + virtual Scene *createScene(int sceneNumber) = 0; + virtual void processEvent(Event &event) {} +}; + } // End of namespace tSage #endif diff --git a/engines/tsage/sound.cpp b/engines/tsage/sound.cpp index 63e753104e..defec1cebd 100644 --- a/engines/tsage/sound.cpp +++ b/engines/tsage/sound.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "tsage/core.h" @@ -52,9 +49,9 @@ void SoundManager::loadNotifierProc(bool postFlag) { warning("TODO: SoundManager::loadNotifierProc"); } -void SoundManager::listenerSynchronise(Serialiser &s) { +void SoundManager::listenerSynchronize(Serializer &s) { s.validate("SoundManager"); - warning("TODO: SoundManager listenerSynchronise"); + warning("TODO: SoundManager listenerSynchronize"); } } // End of namespace tSage diff --git a/engines/tsage/sound.h b/engines/tsage/sound.h index a495344038..03ae77b703 100644 --- a/engines/tsage/sound.h +++ b/engines/tsage/sound.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef TSAGE_SOUND_H @@ -34,7 +31,7 @@ namespace tSage { class SoundManager : public SaveListener { public: void dispatch() {} - virtual void listenerSynchronise(Serialiser &s); + virtual void listenerSynchronize(Serializer &s); virtual void postInit(); void proc2() {} diff --git a/engines/tsage/staticres.cpp b/engines/tsage/staticres.cpp index bc85718035..9f36268ce3 100644 --- a/engines/tsage/staticres.cpp +++ b/engines/tsage/staticres.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "tsage/staticres.h" @@ -115,6 +112,10 @@ const char *SCENE6100_VERY_WELL = "Very well. I will retrieve the stasis box and Wait for it's return in the lander bay."; const char *DEMO_HELP_MSG = " Help...\rF2 - Sound Options\rF3 - Exit demo\r\rPress ENTER\rto continue"; -const char *DEMO_PAUSED_MSG = " demo is paused"; +const char *DEMO_PAUSED_MSG = "Ringworld\x14 demo is paused"; +const char *DEMO_EXIT_MSG = "Press ENTER to resume the Ringworld\x14 demo. Press ESC to exit"; +const char *EXIT_BTN_STRING = "Exit"; +const char *DEMO_BTN_STRING = "Demo"; +const char *DEMO_RESUME_BTN_STRING = "Resume"; } // End of namespace tSage diff --git a/engines/tsage/staticres.h b/engines/tsage/staticres.h index 0db349f8a7..fa93511779 100644 --- a/engines/tsage/staticres.h +++ b/engines/tsage/staticres.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef TSAGE_STATICRES_H @@ -82,6 +79,12 @@ extern const char *SCENE6100_VERY_WELL; // Demo messages extern const char *DEMO_HELP_MSG; extern const char *DEMO_PAUSED_MSG; +extern const char *DEMO_HELP_MSG; +extern const char *DEMO_PAUSED_MSG; +extern const char *DEMO_EXIT_MSG; +extern const char *EXIT_BTN_STRING; +extern const char *DEMO_BTN_STRING; +extern const char *DEMO_RESUME_BTN_STRING; } // End of namespace tSage diff --git a/engines/tsage/tsage.cpp b/engines/tsage/tsage.cpp index d6f07c999b..4f55ecfb83 100644 --- a/engines/tsage/tsage.cpp +++ b/engines/tsage/tsage.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/debug-channels.h" @@ -71,9 +68,15 @@ void TSageEngine::initialise() { if (_vm->getFeatures() & GF_DEMO) { // Add the single library file associated with the demo _resourceManager->addLib(getPrimaryFilename()); - } else { + } else if (_vm->getGameID() == GType_Ringworld) { _resourceManager->addLib("RING.RLB"); _resourceManager->addLib("TSAGE.RLB"); + } else if (_vm->getGameID() == GType_BlueForce) { + _resourceManager->addLib("BLUE.RLB"); + if (_vm->getFeatures() & GF_FLOPPY) { + _resourceManager->addLib("FILES.RLB"); + _resourceManager->addLib("TSAGE.RLB"); + } } _globals = new Globals(); @@ -101,14 +104,14 @@ Common::Error TSageEngine::run() { * Returns true if it is currently okay to restore a game */ bool TSageEngine::canLoadGameStateCurrently() { - return (_globals->getFlag(50) == 0) && _globals->_player._uiEnabled; + return (_globals->getFlag(50) == 0); } /** * Returns true if it is currently okay to save the game */ bool TSageEngine::canSaveGameStateCurrently() { - return (_globals->getFlag(50) == 0) && _globals->_player._uiEnabled; + return (_globals->getFlag(50) == 0); } /** diff --git a/engines/tsage/tsage.h b/engines/tsage/tsage.h index 06c66d8f42..2228212510 100644 --- a/engines/tsage/tsage.h +++ b/engines/tsage/tsage.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef TSAGE_H diff --git a/engines/tucker/console.cpp b/engines/tucker/console.cpp index 34be3dd9fd..e0f2debc30 100644 --- a/engines/tucker/console.cpp +++ b/engines/tucker/console.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "tucker/console.h" diff --git a/engines/tucker/console.h b/engines/tucker/console.h index fe91c1bb70..6be56d5594 100644 --- a/engines/tucker/console.h +++ b/engines/tucker/console.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef TUCKER_CONSOLE_H diff --git a/engines/tucker/detection.cpp b/engines/tucker/detection.cpp index 7404abc2e7..9b466d682d 100644 --- a/engines/tucker/detection.cpp +++ b/engines/tucker/detection.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/config-manager.h" @@ -146,7 +143,7 @@ public: } virtual const char *getName() const { - return "Tucker Engine"; + return "Tucker"; } virtual const char *getOriginalCopyright() const { diff --git a/engines/tucker/graphics.cpp b/engines/tucker/graphics.cpp index 163719197d..e6fb70ac16 100644 --- a/engines/tucker/graphics.cpp +++ b/engines/tucker/graphics.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "tucker/graphics.h" diff --git a/engines/tucker/graphics.h b/engines/tucker/graphics.h index c5b723e632..2b4a57d65d 100644 --- a/engines/tucker/graphics.h +++ b/engines/tucker/graphics.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef TUCKER_GRAPHICS_H diff --git a/engines/tucker/locations.cpp b/engines/tucker/locations.cpp index ee117d233d..70b17e4191 100644 --- a/engines/tucker/locations.cpp +++ b/engines/tucker/locations.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "tucker/tucker.h" diff --git a/engines/tucker/resource.cpp b/engines/tucker/resource.cpp index aeb4399dee..467500b121 100644 --- a/engines/tucker/resource.cpp +++ b/engines/tucker/resource.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/file.h" diff --git a/engines/tucker/saveload.cpp b/engines/tucker/saveload.cpp index 52c6bf19ce..754e8deae9 100644 --- a/engines/tucker/saveload.cpp +++ b/engines/tucker/saveload.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/savefile.h" diff --git a/engines/tucker/sequences.cpp b/engines/tucker/sequences.cpp index d747b346ee..23ae3380cd 100644 --- a/engines/tucker/sequences.cpp +++ b/engines/tucker/sequences.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/system.h" diff --git a/engines/tucker/staticres.cpp b/engines/tucker/staticres.cpp index aec0c999b4..ef778b6f54 100644 --- a/engines/tucker/staticres.cpp +++ b/engines/tucker/staticres.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "tucker/tucker.h" diff --git a/engines/tucker/tucker.cpp b/engines/tucker/tucker.cpp index ed3046867b..2bd7c47b62 100644 --- a/engines/tucker/tucker.cpp +++ b/engines/tucker/tucker.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/config-manager.h" @@ -44,7 +41,7 @@ namespace Tucker { TuckerEngine::TuckerEngine(OSystem *system, Common::Language language, uint32 flags) - : Engine(system), _gameLang(language), _gameFlags(flags) { + : Engine(system), _gameLang(language), _gameFlags(flags), _rnd("tucker") { _console = new TuckerConsole(this); } diff --git a/engines/tucker/tucker.h b/engines/tucker/tucker.h index 532892fd48..b011d65cbb 100644 --- a/engines/tucker/tucker.h +++ b/engines/tucker/tucker.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef TUCKER_ENGINE_H diff --git a/engines/util.h b/engines/util.h index 5bfc4f8ad9..53899cb341 100644 --- a/engines/util.h +++ b/engines/util.h @@ -17,9 +17,6 @@ * 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. - * - * $URL$ - * $Id$ */ #ifndef ENGINES_UTIL_H |