diff options
Diffstat (limited to 'engines/zvision')
-rw-r--r-- | engines/zvision/configure.engine | 2 | ||||
-rw-r--r-- | engines/zvision/core/clock.h | 10 | ||||
-rw-r--r-- | engines/zvision/core/console.cpp | 2 | ||||
-rw-r--r-- | engines/zvision/detection.cpp | 271 | ||||
-rw-r--r-- | engines/zvision/detection.h | 43 | ||||
-rw-r--r-- | engines/zvision/detection_tables.h | 277 | ||||
-rw-r--r-- | engines/zvision/file/save_manager.cpp | 2 | ||||
-rw-r--r-- | engines/zvision/graphics/render_manager.cpp | 2 | ||||
-rw-r--r-- | engines/zvision/scripting/actions.cpp | 137 | ||||
-rw-r--r-- | engines/zvision/scripting/menu.cpp | 74 | ||||
-rw-r--r-- | engines/zvision/scripting/menu.h | 16 | ||||
-rw-r--r-- | engines/zvision/sound/zork_raw.cpp | 7 | ||||
-rw-r--r-- | engines/zvision/text/string_manager.h | 1 | ||||
-rw-r--r-- | engines/zvision/text/text.h | 3 | ||||
-rw-r--r-- | engines/zvision/zvision.cpp | 13 | ||||
-rw-r--r-- | engines/zvision/zvision.h | 30 |
16 files changed, 447 insertions, 443 deletions
diff --git a/engines/zvision/configure.engine b/engines/zvision/configure.engine index 38a5959995..226870c3fd 100644 --- a/engines/zvision/configure.engine +++ b/engines/zvision/configure.engine @@ -1,3 +1,3 @@ # This file is included from the main "configure" script # add_engine [name] [desc] [build-by-default] [subengines] [base games] [deps] -add_engine zvision "ZVision" yes "" "" "freetype2 16bit" +add_engine zvision "Z-Vision" yes "" "" "freetype2 16bit" diff --git a/engines/zvision/core/clock.h b/engines/zvision/core/clock.h index cbf52be560..ae8c968111 100644 --- a/engines/zvision/core/clock.h +++ b/engines/zvision/core/clock.h @@ -67,14 +67,14 @@ public: } /** - * Pause the clock. Any future delta times will take this pause into account. - * Has no effect if the clock is already paused. - */ + * Un-pause the clock. + * Has no effect if the clock is already un-paused. + */ void start(); /** - * Un-pause the clock. - * Has no effect if the clock is already un-paused. + * Pause the clock. Any future delta times will take this pause into account. + * Has no effect if the clock is already paused. */ void stop(); }; diff --git a/engines/zvision/core/console.cpp b/engines/zvision/core/console.cpp index f5cacb582c..336541d82a 100644 --- a/engines/zvision/core/console.cpp +++ b/engines/zvision/core/console.cpp @@ -275,7 +275,7 @@ bool Console::cmdDumpFiles(int argc, const char **argv) { bool Console::cmdDumpImage(int argc, const char **argv) { if (argc != 2) { - debugPrintf("Use %s <TGA/TGZ name> to dump a ZVision TGA/TGZ image into a regular BMP image\n", argv[0]); + debugPrintf("Use %s <TGA/TGZ name> to dump a Z-Vision TGA/TGZ image into a regular BMP image\n", argv[0]); return true; } diff --git a/engines/zvision/detection.cpp b/engines/zvision/detection.cpp index c817cbf3e9..f44e653c2a 100644 --- a/engines/zvision/detection.cpp +++ b/engines/zvision/detection.cpp @@ -24,8 +24,9 @@ #include "base/plugins.h" +#include "engines/advancedDetector.h" + #include "zvision/zvision.h" -#include "zvision/detection.h" #include "zvision/file/save_manager.h" #include "zvision/scripting/script_manager.h" @@ -36,277 +37,39 @@ namespace ZVision { -uint32 ZVision::getFeatures() const { - return _gameDescription->desc.flags; -} +struct ZVisionGameDescription { + ADGameDescription desc; + ZVisionGameId gameId; +}; +ZVisionGameId ZVision::getGameId() const { + return _gameDescription->gameId; +} Common::Language ZVision::getLanguage() const { return _gameDescription->desc.language; } +uint32 ZVision::getFeatures() const { + return _gameDescription->desc.flags; +} } // End of namespace ZVision -static const PlainGameDescriptor zVisionGames[] = { - {"zvision", "ZVision Game"}, - {"znemesis", "Zork Nemesis: The Forbidden Lands"}, - {"zgi", "Zork: Grand Inquisitor"}, - {0, 0} -}; - -namespace ZVision { - -#define GAMEOPTION_ORIGINAL_SAVELOAD GUIO_GAMEOPTIONS1 -#define GAMEOPTION_DOUBLE_FPS GUIO_GAMEOPTIONS2 -#define GAMEOPTION_ENABLE_VENUS GUIO_GAMEOPTIONS3 -#define GAMEOPTION_DISABLE_ANIM_WHILE_TURNING GUIO_GAMEOPTIONS4 -#define GAMEOPTION_USE_HIRES_MPEG_MOVIES GUIO_GAMEOPTIONS5 - -static const ZVisionGameDescription gameDescriptions[] = { - - { - // Zork Nemesis English version - { - "znemesis", - 0, - AD_ENTRY1s("CSCR.ZFS", "88226e51a205d2e50c67a5237f3bd5f2", 2397741), - Common::EN_ANY, - Common::kPlatformDOS, - ADGF_NO_FLAGS, - GUIO4(GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_DOUBLE_FPS, GAMEOPTION_ENABLE_VENUS, GAMEOPTION_DISABLE_ANIM_WHILE_TURNING) - }, - GID_NEMESIS - }, - - { - // Zork Nemesis French version - { - "znemesis", - 0, - {{"CSCR.ZFS", 0, "f04113357b4748c13efcb58b4629887c", 2577873}, - {"NEMESIS.STR", 0, "333bcb17bbb7f57cae742fbbe44f56f3", 9219}, - AD_LISTEND - }, - Common::FR_FRA, - Common::kPlatformDOS, - ADGF_NO_FLAGS, - GUIO4(GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_DOUBLE_FPS, GAMEOPTION_ENABLE_VENUS, GAMEOPTION_DISABLE_ANIM_WHILE_TURNING) - }, - GID_NEMESIS - }, - - { - // Zork Nemesis German version - { - "znemesis", - 0, - {{"CSCR.ZFS", 0, "f04113357b4748c13efcb58b4629887c", 2577873}, - {"NEMESIS.STR", 0, "3d1a12b907751653866cffc6d4dfb331", 9505}, - AD_LISTEND - }, - Common::DE_DEU, - Common::kPlatformDOS, - ADGF_NO_FLAGS, - GUIO4(GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_DOUBLE_FPS, GAMEOPTION_ENABLE_VENUS, GAMEOPTION_DISABLE_ANIM_WHILE_TURNING) - }, - GID_NEMESIS - }, - - { - // Zork Nemesis Italian version - { - "znemesis", - 0, - {{"CSCR.ZFS", 0, "f04113357b4748c13efcb58b4629887c", 2577873}, - {"NEMESIS.STR", 0, "7c568feca8d9f9ae855c47183612c305", 9061}, - AD_LISTEND - }, - Common::IT_ITA, - Common::kPlatformDOS, - ADGF_NO_FLAGS, - GUIO4(GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_DOUBLE_FPS, GAMEOPTION_ENABLE_VENUS, GAMEOPTION_DISABLE_ANIM_WHILE_TURNING) - }, - GID_NEMESIS - }, - - { - // Zork Nemesis English demo version - { - "znemesis", - "Demo", - AD_ENTRY1s("SCRIPTS.ZFS", "64f1e881394e9462305104f99513c833", 380539), - Common::EN_ANY, - Common::kPlatformWindows, - ADGF_DEMO, - GUIO4(GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_DOUBLE_FPS, GAMEOPTION_ENABLE_VENUS, GAMEOPTION_DISABLE_ANIM_WHILE_TURNING) - }, - GID_NEMESIS - }, - - { - // Zork Grand Inquisitor English CD version - { - "zgi", - "CD", - AD_ENTRY1s("SCRIPTS.ZFS", "81efd40ecc3d22531e211368b779f17f", 8336944), - Common::EN_ANY, - Common::kPlatformWindows, - ADGF_NO_FLAGS, - GUIO3(GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_DOUBLE_FPS, GAMEOPTION_DISABLE_ANIM_WHILE_TURNING) - }, - GID_GRANDINQUISITOR - }, - - { - // Zork Grand Inquisitor French CD version, reported by ulrichh on IRC - { - "zgi", - "CD", - AD_ENTRY1s("SCRIPTS.ZFS", "4d1ec4ade7ecc9ee9ec591d43ca3d213", 8338133), - Common::FR_FRA, - Common::kPlatformWindows, - ADGF_NO_FLAGS, - GUIO3(GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_DOUBLE_FPS, GAMEOPTION_DISABLE_ANIM_WHILE_TURNING) - }, - GID_GRANDINQUISITOR - }, - - { - // Zork Grand Inquisitor German CD version, reported by breit in bug #6760 - { - "zgi", - "CD", - AD_ENTRY1s("SCRIPTS.ZFS", "b7ac7e331b9b7f884590b0b325b560c8", 8338133), - Common::DE_DEU, - Common::kPlatformWindows, - ADGF_NO_FLAGS, - GUIO3(GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_DOUBLE_FPS, GAMEOPTION_DISABLE_ANIM_WHILE_TURNING) - }, - GID_GRANDINQUISITOR - }, - - { - // Zork Grand Inquisitor Spanish CD version, reported by dianiu in bug #6764 - { - "zgi", - "CD", - AD_ENTRY1s("SCRIPTS.ZFS", "5cdc4b99c1134053af135aae71326fd1", 8338141), - Common::ES_ESP, - Common::kPlatformWindows, - ADGF_NO_FLAGS, - GUIO3(GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_DOUBLE_FPS, GAMEOPTION_DISABLE_ANIM_WHILE_TURNING) - }, - GID_GRANDINQUISITOR - }, - - { - // Zork Grand Inquisitor English DVD version - { - "zgi", - "DVD", - AD_ENTRY1s("SCRIPTS.ZFS", "03157a3399513bfaaf8dc6d5ab798b36", 8433326), - Common::EN_ANY, - Common::kPlatformWindows, - ADGF_NO_FLAGS, - GUIO4(GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_DOUBLE_FPS, GAMEOPTION_DISABLE_ANIM_WHILE_TURNING, GAMEOPTION_USE_HIRES_MPEG_MOVIES) - }, - GID_GRANDINQUISITOR - }, - - { - // Zork Grand Inquisitor English demo version - { - "zgi", - "Demo", - AD_ENTRY1s("SCRIPTS.ZFS", "71a2494fd2fb999347deb13401e9b998", 304239), - Common::EN_ANY, - Common::kPlatformWindows, - ADGF_DEMO, - GUIO3(GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_DOUBLE_FPS, GAMEOPTION_DISABLE_ANIM_WHILE_TURNING) - }, - GID_GRANDINQUISITOR - }, - - { - AD_TABLE_END_MARKER, - GID_NONE - } -}; - -} // End of namespace ZVision - -static const char *directoryGlobs[] = { - "znemscr", - 0 -}; - -static const ADExtraGuiOptionsMap optionsList[] = { - { - GAMEOPTION_ORIGINAL_SAVELOAD, - { - _s("Use original save/load screens"), - _s("Use the original save/load screens, instead of the ScummVM ones"), - "originalsaveload", - false - } - }, - - { - GAMEOPTION_DOUBLE_FPS, - { - _s("Double FPS"), - _s("Increase game FPS from 30 to 60"), - "doublefps", - false - } - }, - - { - GAMEOPTION_ENABLE_VENUS, - { - _s("Enable Venus"), - _s("Enable the Venus help system"), - "venusenabled", - true - } - }, - - { - GAMEOPTION_DISABLE_ANIM_WHILE_TURNING, - { - _s("Disable animation while turning"), - _s("Disable animation while turning in panoramic mode"), - "noanimwhileturning", - false - } - }, - - { - GAMEOPTION_USE_HIRES_MPEG_MOVIES, - { - _s("Use the hires MPEG movies"), - _s("Use the hires MPEG movies of the DVD version, instead of the lowres AVI ones"), - "mpegmovies", - true - } - }, - - AD_EXTRA_GUI_OPTIONS_TERMINATOR -}; +#include "zvision/detection_tables.h" class ZVisionMetaEngine : public AdvancedMetaEngine { public: - ZVisionMetaEngine() : AdvancedMetaEngine(ZVision::gameDescriptions, sizeof(ZVision::ZVisionGameDescription), zVisionGames, optionsList) { + ZVisionMetaEngine() : AdvancedMetaEngine(ZVision::gameDescriptions, sizeof(ZVision::ZVisionGameDescription), ZVision::zVisionGames, ZVision::optionsList) { _maxScanDepth = 2; - _directoryGlobs = directoryGlobs; + _directoryGlobs = ZVision::directoryGlobs; _singleid = "zvision"; } virtual const char *getName() const { - return "ZVision"; + return "Z-Vision"; } virtual const char *getOriginalCopyright() const { - return "ZVision Activision (C) 1996"; + return "Z-Vision (C) 1996 Activision"; } virtual bool hasFeature(MetaEngineFeature f) const; diff --git a/engines/zvision/detection.h b/engines/zvision/detection.h deleted file mode 100644 index f80cac79ec..0000000000 --- a/engines/zvision/detection.h +++ /dev/null @@ -1,43 +0,0 @@ -/* 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 ZVISION_DETECTION_H -#define ZVISION_DETECTION_H - -#include "engines/advancedDetector.h" - -namespace ZVision { - -enum ZVisionGameId { - GID_NONE = 0, - GID_NEMESIS = 1, - GID_GRANDINQUISITOR = 2 -}; - -struct ZVisionGameDescription { - ADGameDescription desc; - ZVisionGameId gameId; -}; - -} - -#endif diff --git a/engines/zvision/detection_tables.h b/engines/zvision/detection_tables.h new file mode 100644 index 0000000000..06bc58ee7f --- /dev/null +++ b/engines/zvision/detection_tables.h @@ -0,0 +1,277 @@ +/* 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 ZVISION_DETECTION_TABLES_H +#define ZVISION_DETECTION_TABLES_H + +namespace ZVision { + +static const PlainGameDescriptor zVisionGames[] = { + { "zvision", "Z-Vision Game" }, + { "znemesis", "Zork Nemesis: The Forbidden Lands" }, + { "zgi", "Zork: Grand Inquisitor" }, + { 0, 0 } +}; + +static const char *directoryGlobs[] = { + "znemscr", + 0 +}; + +#define GAMEOPTION_ORIGINAL_SAVELOAD GUIO_GAMEOPTIONS1 +#define GAMEOPTION_DOUBLE_FPS GUIO_GAMEOPTIONS2 +#define GAMEOPTION_ENABLE_VENUS GUIO_GAMEOPTIONS3 +#define GAMEOPTION_DISABLE_ANIM_WHILE_TURNING GUIO_GAMEOPTIONS4 +#define GAMEOPTION_USE_HIRES_MPEG_MOVIES GUIO_GAMEOPTIONS5 + +static const ADExtraGuiOptionsMap optionsList[] = { + + { + GAMEOPTION_ORIGINAL_SAVELOAD, + { + _s("Use original save/load screens"), + _s("Use the original save/load screens instead of the ScummVM interface"), + "originalsaveload", + false + } + }, + + { + GAMEOPTION_DOUBLE_FPS, + { + _s("Double FPS"), + _s("Increase framerate from 30 to 60 FPS"), + "doublefps", + false + } + }, + + { + GAMEOPTION_ENABLE_VENUS, + { + _s("Enable Venus"), + _s("Enable the Venus help system"), + "venusenabled", + true + } + }, + + { + GAMEOPTION_DISABLE_ANIM_WHILE_TURNING, + { + _s("Disable animation while turning"), + _s("Disable animation while turning in panorama mode"), + "noanimwhileturning", + false + } + }, + + { + GAMEOPTION_USE_HIRES_MPEG_MOVIES, + { + _s("Use high resolution MPEG video"), + _s("Use MPEG video from the DVD version, instead of lower resolution AVI"), + "mpegmovies", + true + } + }, + + AD_EXTRA_GUI_OPTIONS_TERMINATOR +}; + +static const ZVisionGameDescription gameDescriptions[] = { + + { + // Zork Nemesis English version + { + "znemesis", + 0, + AD_ENTRY1s("CSCR.ZFS", "88226e51a205d2e50c67a5237f3bd5f2", 2397741), + Common::EN_ANY, + Common::kPlatformDOS, + ADGF_NO_FLAGS, + GUIO4(GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_DOUBLE_FPS, GAMEOPTION_ENABLE_VENUS, GAMEOPTION_DISABLE_ANIM_WHILE_TURNING) + }, + GID_NEMESIS + }, + + { + // Zork Nemesis French version + { + "znemesis", + 0, + { + { "CSCR.ZFS", 0, "f04113357b4748c13efcb58b4629887c", 2577873 }, + { "NEMESIS.STR", 0, "333bcb17bbb7f57cae742fbbe44f56f3", 9219 }, + AD_LISTEND + }, + Common::FR_FRA, + Common::kPlatformDOS, + ADGF_NO_FLAGS, + GUIO4(GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_DOUBLE_FPS, GAMEOPTION_ENABLE_VENUS, GAMEOPTION_DISABLE_ANIM_WHILE_TURNING) + }, + GID_NEMESIS + }, + + { + // Zork Nemesis German version + { + "znemesis", + 0, + { + { "CSCR.ZFS", 0, "f04113357b4748c13efcb58b4629887c", 2577873 }, + { "NEMESIS.STR", 0, "3d1a12b907751653866cffc6d4dfb331", 9505 }, + AD_LISTEND + }, + Common::DE_DEU, + Common::kPlatformDOS, + ADGF_NO_FLAGS, + GUIO4(GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_DOUBLE_FPS, GAMEOPTION_ENABLE_VENUS, GAMEOPTION_DISABLE_ANIM_WHILE_TURNING) + }, + GID_NEMESIS + }, + + { + // Zork Nemesis Italian version + { + "znemesis", + 0, + { + { "CSCR.ZFS", 0, "f04113357b4748c13efcb58b4629887c", 2577873 }, + { "NEMESIS.STR", 0, "7c568feca8d9f9ae855c47183612c305", 9061 }, + AD_LISTEND + }, + Common::IT_ITA, + Common::kPlatformDOS, + ADGF_NO_FLAGS, + GUIO4(GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_DOUBLE_FPS, GAMEOPTION_ENABLE_VENUS, GAMEOPTION_DISABLE_ANIM_WHILE_TURNING) + }, + GID_NEMESIS + }, + + { + // Zork Nemesis English demo version + { + "znemesis", + "Demo", + AD_ENTRY1s("SCRIPTS.ZFS", "64f1e881394e9462305104f99513c833", 380539), + Common::EN_ANY, + Common::kPlatformWindows, + ADGF_DEMO, + GUIO4(GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_DOUBLE_FPS, GAMEOPTION_ENABLE_VENUS, GAMEOPTION_DISABLE_ANIM_WHILE_TURNING) + }, + GID_NEMESIS + }, + + { + // Zork Grand Inquisitor English CD version + { + "zgi", + "CD", + AD_ENTRY1s("SCRIPTS.ZFS", "81efd40ecc3d22531e211368b779f17f", 8336944), + Common::EN_ANY, + Common::kPlatformWindows, + ADGF_NO_FLAGS, + GUIO3(GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_DOUBLE_FPS, GAMEOPTION_DISABLE_ANIM_WHILE_TURNING) + }, + GID_GRANDINQUISITOR + }, + + { + // Zork Grand Inquisitor French CD version, reported by ulrichh on IRC + { + "zgi", + "CD", + AD_ENTRY1s("SCRIPTS.ZFS", "4d1ec4ade7ecc9ee9ec591d43ca3d213", 8338133), + Common::FR_FRA, + Common::kPlatformWindows, + ADGF_NO_FLAGS, + GUIO3(GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_DOUBLE_FPS, GAMEOPTION_DISABLE_ANIM_WHILE_TURNING) + }, + GID_GRANDINQUISITOR + }, + + { + // Zork Grand Inquisitor German CD version, reported by breit in bug #6760 + { + "zgi", + "CD", + AD_ENTRY1s("SCRIPTS.ZFS", "b7ac7e331b9b7f884590b0b325b560c8", 8338133), + Common::DE_DEU, + Common::kPlatformWindows, + ADGF_NO_FLAGS, + GUIO3(GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_DOUBLE_FPS, GAMEOPTION_DISABLE_ANIM_WHILE_TURNING) + }, + GID_GRANDINQUISITOR + }, + + { + // Zork Grand Inquisitor Spanish CD version, reported by dianiu in bug #6764 + { + "zgi", + "CD", + AD_ENTRY1s("SCRIPTS.ZFS", "5cdc4b99c1134053af135aae71326fd1", 8338141), + Common::ES_ESP, + Common::kPlatformWindows, + ADGF_NO_FLAGS, + GUIO3(GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_DOUBLE_FPS, GAMEOPTION_DISABLE_ANIM_WHILE_TURNING) + }, + GID_GRANDINQUISITOR + }, + + { + // Zork Grand Inquisitor English DVD version + { + "zgi", + "DVD", + AD_ENTRY1s("SCRIPTS.ZFS", "03157a3399513bfaaf8dc6d5ab798b36", 8433326), + Common::EN_ANY, + Common::kPlatformWindows, + ADGF_NO_FLAGS, + GUIO4(GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_DOUBLE_FPS, GAMEOPTION_DISABLE_ANIM_WHILE_TURNING, GAMEOPTION_USE_HIRES_MPEG_MOVIES) + }, + GID_GRANDINQUISITOR + }, + + { + // Zork Grand Inquisitor English demo version + { + "zgi", + "Demo", + AD_ENTRY1s("SCRIPTS.ZFS", "71a2494fd2fb999347deb13401e9b998", 304239), + Common::EN_ANY, + Common::kPlatformWindows, + ADGF_DEMO, + GUIO3(GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_DOUBLE_FPS, GAMEOPTION_DISABLE_ANIM_WHILE_TURNING) + }, + GID_GRANDINQUISITOR + }, + + { + AD_TABLE_END_MARKER, + GID_NONE + } +}; + +} // End of namespace ZVision + +#endif diff --git a/engines/zvision/file/save_manager.cpp b/engines/zvision/file/save_manager.cpp index 63b54269de..d169679e28 100644 --- a/engines/zvision/file/save_manager.cpp +++ b/engines/zvision/file/save_manager.cpp @@ -205,7 +205,7 @@ bool SaveManager::readSaveGameHeader(Common::InSaveFile *in, SaveGameHeader &hea return true; } if (tag != SAVEGAME_ID) { - warning("File is not a ZVision save file. Aborting load"); + warning("File is not a Z-Vision save file. Aborting load"); return false; } diff --git a/engines/zvision/graphics/render_manager.cpp b/engines/zvision/graphics/render_manager.cpp index ce0a02a1ad..f978ef7844 100644 --- a/engines/zvision/graphics/render_manager.cpp +++ b/engines/zvision/graphics/render_manager.cpp @@ -196,7 +196,7 @@ void RenderManager::readImageToSurface(const Common::String &fileName, Graphics: uint32 imageHeight; Image::TGADecoder tga; uint16 *buffer; - // All ZVision images are in RGB 555 + // All Z-Vision images are in RGB 555 destination.format = _engine->_resourcePixelFormat; bool isTGZ; diff --git a/engines/zvision/scripting/actions.cpp b/engines/zvision/scripting/actions.cpp index 9a8b734e0c..e1380b0eb2 100644 --- a/engines/zvision/scripting/actions.cpp +++ b/engines/zvision/scripting/actions.cpp @@ -47,15 +47,18 @@ namespace ZVision { -ResultAction::ResultAction(ZVision *engine, int32 slotkey) : _engine(engine), _slotKey(slotkey), _scriptManager(engine->getScriptManager()) { +ResultAction::ResultAction(ZVision *engine, int32 slotKey) : + _engine(engine), + _slotKey(slotKey), + _scriptManager(engine->getScriptManager()) { } ////////////////////////////////////////////////////////////////////////////// // ActionAdd ////////////////////////////////////////////////////////////////////////////// -ActionAdd::ActionAdd(ZVision *engine, int32 slotkey, const Common::String &line) : - ResultAction(engine, slotkey) { +ActionAdd::ActionAdd(ZVision *engine, int32 slotKey, const Common::String &line) : + ResultAction(engine, slotKey) { _key = 0; _value = 0; @@ -71,8 +74,8 @@ bool ActionAdd::execute() { // ActionAssign ////////////////////////////////////////////////////////////////////////////// -ActionAssign::ActionAssign(ZVision *engine, int32 slotkey, const Common::String &line) : - ResultAction(engine, slotkey) { +ActionAssign::ActionAssign(ZVision *engine, int32 slotKey, const Common::String &line) : + ResultAction(engine, slotKey) { _key = 0; char buf[64]; @@ -94,8 +97,8 @@ bool ActionAssign::execute() { // ActionAttenuate ////////////////////////////////////////////////////////////////////////////// -ActionAttenuate::ActionAttenuate(ZVision *engine, int32 slotkey, const Common::String &line) : - ResultAction(engine, slotkey) { +ActionAttenuate::ActionAttenuate(ZVision *engine, int32 slotKey, const Common::String &line) : + ResultAction(engine, slotKey) { _key = 0; _attenuation = 0; @@ -115,8 +118,8 @@ bool ActionAttenuate::execute() { // ActionChangeLocation ////////////////////////////////////////////////////////////////////////////// -ActionChangeLocation::ActionChangeLocation(ZVision *engine, int32 slotkey, const Common::String &line) : - ResultAction(engine, slotkey) { +ActionChangeLocation::ActionChangeLocation(ZVision *engine, int32 slotKey, const Common::String &line) : + ResultAction(engine, slotKey) { _world = 'g'; _room = 'a'; _node = 'r'; @@ -137,8 +140,8 @@ bool ActionChangeLocation::execute() { // ActionCrossfade ////////////////////////////////////////////////////////////////////////////// -ActionCrossfade::ActionCrossfade(ZVision *engine, int32 slotkey, const Common::String &line) : - ResultAction(engine, slotkey) { +ActionCrossfade::ActionCrossfade(ZVision *engine, int32 slotKey, const Common::String &line) : + ResultAction(engine, slotKey) { _keyOne = 0; _keyTwo = 0; _oneStartVolume = 0; @@ -181,8 +184,8 @@ bool ActionCrossfade::execute() { // ActionCursor ////////////////////////////////////////////////////////////////////////////// -ActionCursor::ActionCursor(ZVision *engine, int32 slotkey, const Common::String &line) : - ResultAction(engine, slotkey) { +ActionCursor::ActionCursor(ZVision *engine, int32 slotKey, const Common::String &line) : + ResultAction(engine, slotKey) { Common::String up = line; up.toUppercase(); _action = 0; @@ -213,8 +216,8 @@ bool ActionCursor::execute() { // ActionDelayRender ////////////////////////////////////////////////////////////////////////////// -ActionDelayRender::ActionDelayRender(ZVision *engine, int32 slotkey, const Common::String &line) : - ResultAction(engine, slotkey) { +ActionDelayRender::ActionDelayRender(ZVision *engine, int32 slotKey, const Common::String &line) : + ResultAction(engine, slotKey) { _framesToDelay = 0; sscanf(line.c_str(), "%u", &_framesToDelay); // Limit to 10 frames maximum. This fixes the script bug in ZGI scene px10 @@ -231,8 +234,8 @@ bool ActionDelayRender::execute() { // ActionDisableControl ////////////////////////////////////////////////////////////////////////////// -ActionDisableControl::ActionDisableControl(ZVision *engine, int32 slotkey, const Common::String &line) : - ResultAction(engine, slotkey) { +ActionDisableControl::ActionDisableControl(ZVision *engine, int32 slotKey, const Common::String &line) : + ResultAction(engine, slotKey) { _key = 0; sscanf(line.c_str(), "%u", &_key); @@ -247,8 +250,8 @@ bool ActionDisableControl::execute() { // ActionDisplayMessage ////////////////////////////////////////////////////////////////////////////// -ActionDisplayMessage::ActionDisplayMessage(ZVision *engine, int32 slotkey, const Common::String &line) : - ResultAction(engine, slotkey) { +ActionDisplayMessage::ActionDisplayMessage(ZVision *engine, int32 slotKey, const Common::String &line) : + ResultAction(engine, slotKey) { _control = 0; _msgid = 0; @@ -282,8 +285,8 @@ bool ActionDissolve::execute() { // ActionDistort - only used by Zork: Nemesis for the "treatment" puzzle in the Sanitarium (aj30) ////////////////////////////////////////////////////////////////////////////// -ActionDistort::ActionDistort(ZVision *engine, int32 slotkey, const Common::String &line) : - ResultAction(engine, slotkey) { +ActionDistort::ActionDistort(ZVision *engine, int32 slotKey, const Common::String &line) : + ResultAction(engine, slotKey) { _distSlot = 0; _speed = 0; _startAngle = 60.0; @@ -311,8 +314,8 @@ bool ActionDistort::execute() { // ActionEnableControl ////////////////////////////////////////////////////////////////////////////// -ActionEnableControl::ActionEnableControl(ZVision *engine, int32 slotkey, const Common::String &line) : - ResultAction(engine, slotkey) { +ActionEnableControl::ActionEnableControl(ZVision *engine, int32 slotKey, const Common::String &line) : + ResultAction(engine, slotKey) { _key = 0; sscanf(line.c_str(), "%u", &_key); @@ -327,8 +330,8 @@ bool ActionEnableControl::execute() { // ActionFlushMouseEvents ////////////////////////////////////////////////////////////////////////////// -ActionFlushMouseEvents::ActionFlushMouseEvents(ZVision *engine, int32 slotkey) : - ResultAction(engine, slotkey) { +ActionFlushMouseEvents::ActionFlushMouseEvents(ZVision *engine, int32 slotKey) : + ResultAction(engine, slotKey) { } bool ActionFlushMouseEvents::execute() { @@ -341,8 +344,8 @@ bool ActionFlushMouseEvents::execute() { // ActionInventory ////////////////////////////////////////////////////////////////////////////// -ActionInventory::ActionInventory(ZVision *engine, int32 slotkey, const Common::String &line) : - ResultAction(engine, slotkey) { +ActionInventory::ActionInventory(ZVision *engine, int32 slotKey, const Common::String &line) : + ResultAction(engine, slotKey) { _type = -1; _key = 0; @@ -393,8 +396,8 @@ bool ActionInventory::execute() { // ActionKill - only used by ZGI ////////////////////////////////////////////////////////////////////////////// -ActionKill::ActionKill(ZVision *engine, int32 slotkey, const Common::String &line) : - ResultAction(engine, slotkey) { +ActionKill::ActionKill(ZVision *engine, int32 slotKey, const Common::String &line) : + ResultAction(engine, slotKey) { _key = 0; _type = 0; char keytype[25]; @@ -432,8 +435,8 @@ bool ActionKill::execute() { // ActionMenuBarEnable ////////////////////////////////////////////////////////////////////////////// -ActionMenuBarEnable::ActionMenuBarEnable(ZVision *engine, int32 slotkey, const Common::String &line) : - ResultAction(engine, slotkey) { +ActionMenuBarEnable::ActionMenuBarEnable(ZVision *engine, int32 slotKey, const Common::String &line) : + ResultAction(engine, slotKey) { _menus = 0xFFFF; sscanf(line.c_str(), "%hu", &_menus); @@ -448,8 +451,8 @@ bool ActionMenuBarEnable::execute() { // ActionMusic ////////////////////////////////////////////////////////////////////////////// -ActionMusic::ActionMusic(ZVision *engine, int32 slotkey, const Common::String &line, bool global) : - ResultAction(engine, slotkey), +ActionMusic::ActionMusic(ZVision *engine, int32 slotKey, const Common::String &line, bool global) : + ResultAction(engine, slotKey), _note(0), _prog(0), _universe(global) { @@ -527,8 +530,8 @@ bool ActionMusic::execute() { // ActionPanTrack ////////////////////////////////////////////////////////////////////////////// -ActionPanTrack::ActionPanTrack(ZVision *engine, int32 slotkey, const Common::String &line) : - ResultAction(engine, slotkey), +ActionPanTrack::ActionPanTrack(ZVision *engine, int32 slotKey, const Common::String &line) : + ResultAction(engine, slotKey), _pos(0), _musicSlot(0) { @@ -552,8 +555,8 @@ bool ActionPanTrack::execute() { // ActionPreferences ////////////////////////////////////////////////////////////////////////////// -ActionPreferences::ActionPreferences(ZVision *engine, int32 slotkey, const Common::String &line) : - ResultAction(engine, slotkey) { +ActionPreferences::ActionPreferences(ZVision *engine, int32 slotKey, const Common::String &line) : + ResultAction(engine, slotKey) { if (line.compareToIgnoreCase("save") == 0) _save = true; else @@ -573,8 +576,8 @@ bool ActionPreferences::execute() { // ActionPreloadAnimation ////////////////////////////////////////////////////////////////////////////// -ActionPreloadAnimation::ActionPreloadAnimation(ZVision *engine, int32 slotkey, const Common::String &line) : - ResultAction(engine, slotkey) { +ActionPreloadAnimation::ActionPreloadAnimation(ZVision *engine, int32 slotKey, const Common::String &line) : + ResultAction(engine, slotKey) { _mask = 0; _framerate = 0; @@ -612,8 +615,8 @@ bool ActionPreloadAnimation::execute() { // ActionUnloadAnimation ////////////////////////////////////////////////////////////////////////////// -ActionUnloadAnimation::ActionUnloadAnimation(ZVision *engine, int32 slotkey, const Common::String &line) : - ResultAction(engine, slotkey) { +ActionUnloadAnimation::ActionUnloadAnimation(ZVision *engine, int32 slotKey, const Common::String &line) : + ResultAction(engine, slotKey) { _key = 0; sscanf(line.c_str(), "%u", &_key); @@ -632,8 +635,8 @@ bool ActionUnloadAnimation::execute() { // ActionPlayAnimation ////////////////////////////////////////////////////////////////////////////// -ActionPlayAnimation::ActionPlayAnimation(ZVision *engine, int32 slotkey, const Common::String &line) : - ResultAction(engine, slotkey) { +ActionPlayAnimation::ActionPlayAnimation(ZVision *engine, int32 slotKey, const Common::String &line) : + ResultAction(engine, slotKey) { _x = 0; _y = 0; _x2 = 0; @@ -690,8 +693,8 @@ bool ActionPlayAnimation::execute() { // ActionPlayPreloadAnimation ////////////////////////////////////////////////////////////////////////////// -ActionPlayPreloadAnimation::ActionPlayPreloadAnimation(ZVision *engine, int32 slotkey, const Common::String &line) : - ResultAction(engine, slotkey) { +ActionPlayPreloadAnimation::ActionPlayPreloadAnimation(ZVision *engine, int32 slotKey, const Common::String &line) : + ResultAction(engine, slotKey) { _controlKey = 0; _x1 = 0; _y1 = 0; @@ -729,8 +732,8 @@ bool ActionQuit::execute() { // ActionRegion - only used by Zork: Nemesis ////////////////////////////////////////////////////////////////////////////// -ActionRegion::ActionRegion(ZVision *engine, int32 slotkey, const Common::String &line) : - ResultAction(engine, slotkey) { +ActionRegion::ActionRegion(ZVision *engine, int32 slotKey, const Common::String &line) : + ResultAction(engine, slotKey) { _delay = 0; _type = 0; _unk1 = 0; @@ -808,8 +811,8 @@ bool ActionRegion::execute() { // ActionRandom ////////////////////////////////////////////////////////////////////////////// -ActionRandom::ActionRandom(ZVision *engine, int32 slotkey, const Common::String &line) : - ResultAction(engine, slotkey) { +ActionRandom::ActionRandom(ZVision *engine, int32 slotKey, const Common::String &line) : + ResultAction(engine, slotKey) { char maxBuffer[64]; memset(maxBuffer, 0, 64); sscanf(line.c_str(), "%s", maxBuffer); @@ -830,8 +833,8 @@ bool ActionRandom::execute() { // ActionRestoreGame ////////////////////////////////////////////////////////////////////////////// -ActionRestoreGame::ActionRestoreGame(ZVision *engine, int32 slotkey, const Common::String &line) : - ResultAction(engine, slotkey) { +ActionRestoreGame::ActionRestoreGame(ZVision *engine, int32 slotKey, const Common::String &line) : + ResultAction(engine, slotKey) { char buf[128]; sscanf(line.c_str(), "%s", buf); _fileName = Common::String(buf); @@ -846,8 +849,8 @@ bool ActionRestoreGame::execute() { // ActionRotateTo ////////////////////////////////////////////////////////////////////////////// -ActionRotateTo::ActionRotateTo(ZVision *engine, int32 slotkey, const Common::String &line) : - ResultAction(engine, slotkey) { +ActionRotateTo::ActionRotateTo(ZVision *engine, int32 slotKey, const Common::String &line) : + ResultAction(engine, slotKey) { _time = 0; _toPos = 0; @@ -864,8 +867,8 @@ bool ActionRotateTo::execute() { // ActionSetPartialScreen ////////////////////////////////////////////////////////////////////////////// -ActionSetPartialScreen::ActionSetPartialScreen(ZVision *engine, int32 slotkey, const Common::String &line) : - ResultAction(engine, slotkey) { +ActionSetPartialScreen::ActionSetPartialScreen(ZVision *engine, int32 slotKey, const Common::String &line) : + ResultAction(engine, slotKey) { _x = 0; _y = 0; @@ -904,8 +907,8 @@ bool ActionSetPartialScreen::execute() { // ActionSetScreen ////////////////////////////////////////////////////////////////////////////// -ActionSetScreen::ActionSetScreen(ZVision *engine, int32 slotkey, const Common::String &line) : - ResultAction(engine, slotkey) { +ActionSetScreen::ActionSetScreen(ZVision *engine, int32 slotKey, const Common::String &line) : + ResultAction(engine, slotKey) { char fileName[25]; sscanf(line.c_str(), "%24s", fileName); @@ -922,8 +925,8 @@ bool ActionSetScreen::execute() { // ActionStop ////////////////////////////////////////////////////////////////////////////// -ActionStop::ActionStop(ZVision *engine, int32 slotkey, const Common::String &line) : - ResultAction(engine, slotkey) { +ActionStop::ActionStop(ZVision *engine, int32 slotKey, const Common::String &line) : + ResultAction(engine, slotKey) { _key = 0; sscanf(line.c_str(), "%u", &_key); } @@ -937,8 +940,8 @@ bool ActionStop::execute() { // ActionStreamVideo ////////////////////////////////////////////////////////////////////////////// -ActionStreamVideo::ActionStreamVideo(ZVision *engine, int32 slotkey, const Common::String &line) : - ResultAction(engine, slotkey) { +ActionStreamVideo::ActionStreamVideo(ZVision *engine, int32 slotKey, const Common::String &line) : + ResultAction(engine, slotKey) { _x1 = 0; _x2 = 0; _y1 = 0; @@ -1019,8 +1022,8 @@ bool ActionStreamVideo::execute() { // ActionSyncSound ////////////////////////////////////////////////////////////////////////////// -ActionSyncSound::ActionSyncSound(ZVision *engine, int32 slotkey, const Common::String &line) : - ResultAction(engine, slotkey) { +ActionSyncSound::ActionSyncSound(ZVision *engine, int32 slotKey, const Common::String &line) : + ResultAction(engine, slotKey) { _syncto = 0; char fileName[25]; @@ -1047,8 +1050,8 @@ bool ActionSyncSound::execute() { // ActionTimer ////////////////////////////////////////////////////////////////////////////// -ActionTimer::ActionTimer(ZVision *engine, int32 slotkey, const Common::String &line) : - ResultAction(engine, slotkey) { +ActionTimer::ActionTimer(ZVision *engine, int32 slotKey, const Common::String &line) : + ResultAction(engine, slotKey) { char timeBuffer[64]; memset(timeBuffer, 0, 64); sscanf(line.c_str(), "%s", timeBuffer); @@ -1071,8 +1074,8 @@ bool ActionTimer::execute() { // ActionTtyText ////////////////////////////////////////////////////////////////////////////// -ActionTtyText::ActionTtyText(ZVision *engine, int32 slotkey, const Common::String &line) : - ResultAction(engine, slotkey) { +ActionTtyText::ActionTtyText(ZVision *engine, int32 slotKey, const Common::String &line) : + ResultAction(engine, slotKey) { _delay = 0; char filename[64]; diff --git a/engines/zvision/scripting/menu.cpp b/engines/zvision/scripting/menu.cpp index e7775cbe3f..064bd1b57d 100644 --- a/engines/zvision/scripting/menu.cpp +++ b/engines/zvision/scripting/menu.cpp @@ -46,7 +46,7 @@ MenuHandler::MenuHandler(ZVision *engine) { MenuZGI::MenuZGI(ZVision *engine) : MenuHandler(engine) { menuMouseFocus = -1; - inmenu = false; + inMenu = false; scrolled[0] = false; scrolled[1] = false; scrolled[2] = false; @@ -60,15 +60,15 @@ MenuZGI::MenuZGI(ZVision *engine) : char buf[24]; for (int i = 1; i < 4; i++) { sprintf(buf, "gmzau%2.2x1.tga", i); - _engine->getRenderManager()->readImageToSurface(buf, menuback[i - 1][0], false); + _engine->getRenderManager()->readImageToSurface(buf, menuBack[i - 1][0], false); sprintf(buf, "gmzau%2.2x1.tga", i + 0x10); - _engine->getRenderManager()->readImageToSurface(buf, menuback[i - 1][1], false); + _engine->getRenderManager()->readImageToSurface(buf, menuBack[i - 1][1], false); } for (int i = 0; i < 4; i++) { sprintf(buf, "gmzmu%2.2x1.tga", i); - _engine->getRenderManager()->readImageToSurface(buf, menubar[i][0], false); + _engine->getRenderManager()->readImageToSurface(buf, menuBar[i][0], false); sprintf(buf, "gmznu%2.2x1.tga", i); - _engine->getRenderManager()->readImageToSurface(buf, menubar[i][1], false); + _engine->getRenderManager()->readImageToSurface(buf, menuBar[i][1], false); } for (int i = 0; i < 50; i++) { @@ -86,12 +86,12 @@ MenuZGI::MenuZGI(ZVision *engine) : MenuZGI::~MenuZGI() { for (int i = 0; i < 3; i++) { - menuback[i][0].free(); - menuback[i][1].free(); + menuBack[i][0].free(); + menuBack[i][1].free(); } for (int i = 0; i < 4; i++) { - menubar[i][0].free(); - menubar[i][1].free(); + menuBar[i][0].free(); + menuBar[i][1].free(); } for (int i = 0; i < 50; i++) { if (items[i][0]) { @@ -208,9 +208,9 @@ void MenuZGI::onMouseUp(const Common::Point &Pos) { void MenuZGI::onMouseMove(const Common::Point &Pos) { if (Pos.y < 40) { - if (!inmenu) + if (!inMenu) redraw = true; - inmenu = true; + inMenu = true; switch (menuMouseFocus) { case kMenuItem: if (menuBarFlag & kMenubarItems) { @@ -311,7 +311,7 @@ void MenuZGI::onMouseMove(const Common::Point &Pos) { if (Common::Rect(64, 0, 64 + 512, 8).contains(Pos)) { // Main menuMouseFocus = kMenuMain; scrolled[kMenuMain] = false; - scrollPos[kMenuMain] = menuback[kMenuMain][1].h - menuback[kMenuMain][0].h; + scrollPos[kMenuMain] = menuBack[kMenuMain][1].h - menuBack[kMenuMain][0].h; _engine->getScriptManager()->setStateValue(StateKey_MenuState, 2); } @@ -337,9 +337,9 @@ void MenuZGI::onMouseMove(const Common::Point &Pos) { break; } } else { - if (inmenu) + if (inMenu) clean = true; - inmenu = false; + inMenu = false; if (_engine->getScriptManager()->getStateValue(StateKey_MenuState) != 0) _engine->getScriptManager()->setStateValue(StateKey_MenuState, 0); menuMouseFocus = -1; @@ -369,7 +369,7 @@ void MenuZGI::process(uint32 deltatime) { } } if (redraw) { - _engine->getRenderManager()->blitSurfaceToMenu(menuback[kMenuItem][0], scrollPos[kMenuItem], 0); + _engine->getRenderManager()->blitSurfaceToMenu(menuBack[kMenuItem][0], scrollPos[kMenuItem], 0); int itemCount = _engine->getScriptManager()->getStateValue(StateKey_Inv_TotalSlots); if (itemCount == 0) @@ -438,7 +438,7 @@ void MenuZGI::process(uint32 deltatime) { } } if (redraw) { - _engine->getRenderManager()->blitSurfaceToMenu(menuback[kMenuMagic][0], 640 - scrollPos[kMenuMagic], 0); + _engine->getRenderManager()->blitSurfaceToMenu(menuBack[kMenuMagic][0], 640 - scrollPos[kMenuMagic], 0); for (int i = 0; i < 12; i++) { bool inrect = false; @@ -503,45 +503,45 @@ void MenuZGI::process(uint32 deltatime) { } } if (redraw) { - _engine->getRenderManager()->blitSurfaceToMenu(menuback[kMenuMain][0], 30, scrollPos[kMenuMain]); + _engine->getRenderManager()->blitSurfaceToMenu(menuBack[kMenuMain][0], 30, scrollPos[kMenuMain]); if (menuBarFlag & kMenubarExit) { if (mouseOnItem == kMainMenuExit) - _engine->getRenderManager()->blitSurfaceToMenu(menubar[kMainMenuExit][1], 320 + 135, scrollPos[kMenuMain]); + _engine->getRenderManager()->blitSurfaceToMenu(menuBar[kMainMenuExit][1], 320 + 135, scrollPos[kMenuMain]); else - _engine->getRenderManager()->blitSurfaceToMenu(menubar[kMainMenuExit][0], 320 + 135, scrollPos[kMenuMain]); + _engine->getRenderManager()->blitSurfaceToMenu(menuBar[kMainMenuExit][0], 320 + 135, scrollPos[kMenuMain]); } if (menuBarFlag & kMenubarSettings) { if (mouseOnItem == kMainMenuPrefs) - _engine->getRenderManager()->blitSurfaceToMenu(menubar[kMainMenuPrefs][1], 320, scrollPos[kMenuMain]); + _engine->getRenderManager()->blitSurfaceToMenu(menuBar[kMainMenuPrefs][1], 320, scrollPos[kMenuMain]); else - _engine->getRenderManager()->blitSurfaceToMenu(menubar[kMainMenuPrefs][0], 320, scrollPos[kMenuMain]); + _engine->getRenderManager()->blitSurfaceToMenu(menuBar[kMainMenuPrefs][0], 320, scrollPos[kMenuMain]); } if (menuBarFlag & kMenubarRestore) { if (mouseOnItem == kMainMenuLoad) - _engine->getRenderManager()->blitSurfaceToMenu(menubar[kMainMenuLoad][1], 320 - 135, scrollPos[kMenuMain]); + _engine->getRenderManager()->blitSurfaceToMenu(menuBar[kMainMenuLoad][1], 320 - 135, scrollPos[kMenuMain]); else - _engine->getRenderManager()->blitSurfaceToMenu(menubar[kMainMenuLoad][0], 320 - 135, scrollPos[kMenuMain]); + _engine->getRenderManager()->blitSurfaceToMenu(menuBar[kMainMenuLoad][0], 320 - 135, scrollPos[kMenuMain]); } if (menuBarFlag & kMenubarSave) { if (mouseOnItem == kMainMenuSave) - _engine->getRenderManager()->blitSurfaceToMenu(menubar[kMainMenuSave][1], 320 - 135 * 2, scrollPos[kMenuMain]); + _engine->getRenderManager()->blitSurfaceToMenu(menuBar[kMainMenuSave][1], 320 - 135 * 2, scrollPos[kMenuMain]); else - _engine->getRenderManager()->blitSurfaceToMenu(menubar[kMainMenuSave][0], 320 - 135 * 2, scrollPos[kMenuMain]); + _engine->getRenderManager()->blitSurfaceToMenu(menuBar[kMainMenuSave][0], 320 - 135 * 2, scrollPos[kMenuMain]); } redraw = false; } break; default: if (redraw) { - if (inmenu) { - _engine->getRenderManager()->blitSurfaceToMenu(menuback[kMenuMain][1], 30, 0); + if (inMenu) { + _engine->getRenderManager()->blitSurfaceToMenu(menuBack[kMenuMain][1], 30, 0); if (menuBarFlag & kMenubarItems) - _engine->getRenderManager()->blitSurfaceToMenu(menuback[kMenuItem][1], 0, 0); + _engine->getRenderManager()->blitSurfaceToMenu(menuBack[kMenuItem][1], 0, 0); if (menuBarFlag & kMenubarMagic) - _engine->getRenderManager()->blitSurfaceToMenu(menuback[kMenuMagic][1], 640 - 28, 0); + _engine->getRenderManager()->blitSurfaceToMenu(menuBack[kMenuMagic][1], 640 - 28, 0); } redraw = false; } @@ -551,7 +551,7 @@ void MenuZGI::process(uint32 deltatime) { MenuNemesis::MenuNemesis(ZVision *engine) : MenuHandler(engine) { - inmenu = false; + inMenu = false; scrolled = false; scrollPos = 0; mouseOnItem = -1; @@ -565,7 +565,7 @@ MenuNemesis::MenuNemesis(ZVision *engine) : _engine->getRenderManager()->readImageToSurface(buf, but[i][j], false); } - _engine->getRenderManager()->readImageToSurface("bar.tga", menubar, false); + _engine->getRenderManager()->readImageToSurface("bar.tga", menuBar, false); frm = 0; } @@ -575,7 +575,7 @@ MenuNemesis::~MenuNemesis() { for (int j = 0; j < 6; j++) but[i][j].free(); - menubar.free(); + menuBar.free(); } static const int16 buts[4][2] = { {120 , 64}, {144, 184}, {128, 328}, {120, 456} }; @@ -631,7 +631,7 @@ void MenuNemesis::onMouseUp(const Common::Point &Pos) { void MenuNemesis::onMouseMove(const Common::Point &Pos) { if (Pos.y < 40) { - inmenu = true; + inMenu = true; if (_engine->getScriptManager()->getStateValue(StateKey_MenuState) != 2) _engine->getScriptManager()->setStateValue(StateKey_MenuState, 2); @@ -681,7 +681,7 @@ void MenuNemesis::onMouseMove(const Common::Point &Pos) { delay = 200; } } else { - inmenu = false; + inMenu = false; if (_engine->getScriptManager()->getStateValue(StateKey_MenuState) != 0) _engine->getScriptManager()->setStateValue(StateKey_MenuState, 0); mouseOnItem = -1; @@ -689,7 +689,7 @@ void MenuNemesis::onMouseMove(const Common::Point &Pos) { } void MenuNemesis::process(uint32 deltatime) { - if (inmenu) { + if (inMenu) { if (!scrolled) { float scrl = 32.0 * 2.0 * (deltatime / 1000.0); @@ -715,7 +715,7 @@ void MenuNemesis::process(uint32 deltatime) { } if (redraw) { - _engine->getRenderManager()->blitSurfaceToMenu(menubar, 64, scrollPos); + _engine->getRenderManager()->blitSurfaceToMenu(menuBar, 64, scrollPos); if (menuBarFlag & kMenubarExit) if (mouseOnItem == kMainMenuExit) @@ -752,7 +752,7 @@ void MenuNemesis::process(uint32 deltatime) { scrollPos = -32; if (redraw) { - _engine->getRenderManager()->blitSurfaceToMenu(menubar, 64, scrollPos); + _engine->getRenderManager()->blitSurfaceToMenu(menuBar, 64, scrollPos); redraw = false; } } diff --git a/engines/zvision/scripting/menu.h b/engines/zvision/scripting/menu.h index a88587966f..f6b21b9c97 100644 --- a/engines/zvision/scripting/menu.h +++ b/engines/zvision/scripting/menu.h @@ -68,8 +68,8 @@ public: void onMouseUp(const Common::Point &Pos); void process(uint32 deltaTimeInMillis); private: - Graphics::Surface menuback[3][2]; - Graphics::Surface menubar[4][2]; + Graphics::Surface menuBack[3][2]; + Graphics::Surface menuBar[4][2]; Graphics::Surface *items[50][2]; uint itemId[50]; @@ -77,11 +77,11 @@ private: uint magicId[12]; int menuMouseFocus; - bool inmenu; + bool inMenu; int mouseOnItem; - bool scrolled[3]; + bool scrolled[3]; int16 scrollPos[3]; bool clean; @@ -98,13 +98,13 @@ public: void process(uint32 deltaTimeInMillis); private: Graphics::Surface but[4][6]; - Graphics::Surface menubar; + Graphics::Surface menuBar; - bool inmenu; + bool inMenu; int mouseOnItem; - bool scrolled; + bool scrolled; int16 scrollPos; bool redraw; @@ -114,6 +114,6 @@ private: }; -} +} // End of namespace ZVision #endif diff --git a/engines/zvision/sound/zork_raw.cpp b/engines/zvision/sound/zork_raw.cpp index 7bdd4875fc..124235e0e0 100644 --- a/engines/zvision/sound/zork_raw.cpp +++ b/engines/zvision/sound/zork_raw.cpp @@ -33,7 +33,6 @@ #include "zvision/sound/zork_raw.h" #include "zvision/zvision.h" -#include "zvision/detection.h" namespace ZVision { @@ -136,7 +135,8 @@ int RawChunkStream::readBuffer(int16 *buffer, Common::SeekableReadStream *stream return bytesRead; } -const SoundParams RawZorkStream::_zNemSoundParamLookupTable[32] = {{'0', 0x1F40, false, false, false}, +const SoundParams RawZorkStream::_zNemSoundParamLookupTable[32] = { + {'0', 0x1F40, false, false, false}, {'1', 0x1F40, true, false, false}, {'2', 0x1F40, false, false, true}, {'3', 0x1F40, true, false, true}, @@ -170,7 +170,8 @@ const SoundParams RawZorkStream::_zNemSoundParamLookupTable[32] = {{'0', 0x1F40, {'x', 0xAC44, true, true, true} }; -const SoundParams RawZorkStream::_zgiSoundParamLookupTable[24] = {{'4', 0x2B11, false, false, false}, +const SoundParams RawZorkStream::_zgiSoundParamLookupTable[24] = { + {'4', 0x2B11, false, false, false}, {'5', 0x2B11, true, false, false}, {'6', 0x2B11, false, false, true}, {'7', 0x2B11, true, false, true}, diff --git a/engines/zvision/text/string_manager.h b/engines/zvision/text/string_manager.h index f4564ee1ec..2c31cf7afe 100644 --- a/engines/zvision/text/string_manager.h +++ b/engines/zvision/text/string_manager.h @@ -23,7 +23,6 @@ #ifndef ZVISION_STRING_MANAGER_H #define ZVISION_STRING_MANAGER_H -#include "zvision/detection.h" #include "zvision/text/truetype_font.h" namespace Graphics { diff --git a/engines/zvision/text/text.h b/engines/zvision/text/text.h index d35b90499d..5dd872a440 100644 --- a/engines/zvision/text/text.h +++ b/engines/zvision/text/text.h @@ -24,7 +24,6 @@ #ifndef ZVISION_TEXT_H #define ZVISION_TEXT_H -#include "zvision/detection.h" #include "zvision/text/truetype_font.h" #include "zvision/zvision.h" @@ -59,7 +58,7 @@ public: public: Common::String _fontname; - TextJustification _justification; // 0 - center, 1-left, 2-right + TextJustification _justification; int16 _size; uint8 _red; // 0-255 uint8 _green; // 0-255 diff --git a/engines/zvision/zvision.cpp b/engines/zvision/zvision.cpp index da80ff9d02..779fdc4464 100644 --- a/engines/zvision/zvision.cpp +++ b/engines/zvision/zvision.cpp @@ -29,7 +29,6 @@ #include "zvision/graphics/cursors/cursor_manager.h" #include "zvision/file/save_manager.h" #include "zvision/text/string_manager.h" -#include "zvision/detection.h" #include "zvision/scripting/menu.h" #include "zvision/file/search_manager.h" #include "zvision/text/text.h" @@ -184,10 +183,10 @@ void ZVision::initialize() { _searchManager->addDir("FONTS"); _searchManager->addDir("addon"); - if (_gameDescription->gameId == GID_GRANDINQUISITOR) { + if (getGameId() == GID_GRANDINQUISITOR) { if (!_searchManager->loadZix("INQUIS.ZIX")) error("Unable to load file INQUIS.ZIX"); - } else if (_gameDescription->gameId == GID_NEMESIS) { + } else if (getGameId() == GID_NEMESIS) { if (!_searchManager->loadZix("NEMESIS.ZIX")) { // The game might not be installed, try MEDIUM.ZIX instead if (!_searchManager->loadZix("ZNEMSCR/MEDIUM.ZIX")) @@ -209,7 +208,7 @@ void ZVision::initialize() { _textRenderer = new TextRenderer(this); _midiManager = new MidiManager(); - if (_gameDescription->gameId == GID_GRANDINQUISITOR) + if (getGameId() == GID_GRANDINQUISITOR) _menu = new MenuZGI(this); else _menu = new MenuNemesis(this); @@ -217,7 +216,7 @@ void ZVision::initialize() { // Initialize the managers _cursorManager->initialize(); _scriptManager->initialize(); - _stringManager->initialize(_gameDescription->gameId); + _stringManager->initialize(getGameId()); registerDefaultSettings(); @@ -396,8 +395,8 @@ void ZVision::fpsTimer() { } void ZVision::initScreen() { - uint16 workingWindowWidth = (_gameDescription->gameId == GID_NEMESIS) ? ZNM_WORKING_WINDOW_WIDTH : ZGI_WORKING_WINDOW_WIDTH; - uint16 workingWindowHeight = (_gameDescription->gameId == GID_NEMESIS) ? ZNM_WORKING_WINDOW_HEIGHT : ZGI_WORKING_WINDOW_HEIGHT; + uint16 workingWindowWidth = (getGameId() == GID_NEMESIS) ? ZNM_WORKING_WINDOW_WIDTH : ZGI_WORKING_WINDOW_WIDTH; + uint16 workingWindowHeight = (getGameId() == GID_NEMESIS) ? ZNM_WORKING_WINDOW_HEIGHT : ZGI_WORKING_WINDOW_HEIGHT; _workingWindow = Common::Rect( (WINDOW_WIDTH - workingWindowWidth) / 2, (WINDOW_HEIGHT - workingWindowHeight) / 2, diff --git a/engines/zvision/zvision.h b/engines/zvision/zvision.h index 854cd77bb8..7a331ce37a 100644 --- a/engines/zvision/zvision.h +++ b/engines/zvision/zvision.h @@ -24,7 +24,6 @@ #ifndef ZVISION_ZVISION_H #define ZVISION_ZVISION_H -#include "zvision/detection.h" #include "zvision/core/clock.h" #include "zvision/file/search_manager.h" @@ -51,7 +50,6 @@ class VideoDecoder; * - Zork: Grand Inquisitor * */ - namespace ZVision { struct ZVisionGameDescription; @@ -74,12 +72,12 @@ enum { HIRES_WINDOW_WIDTH = 800, HIRES_WINDOW_HEIGHT = 600, - // Zork nemesis working window sizes - ZNM_WORKING_WINDOW_WIDTH = 512, + // Zork Nemesis working window sizes + ZNM_WORKING_WINDOW_WIDTH = 512, ZNM_WORKING_WINDOW_HEIGHT = 320, // ZGI working window sizes - ZGI_WORKING_WINDOW_WIDTH = 640, + ZGI_WORKING_WINDOW_WIDTH = 640, ZGI_WORKING_WINDOW_HEIGHT = 344, ROTATION_SCREEN_EDGE_OFFSET = 60, @@ -88,6 +86,12 @@ enum { KEYBUF_SIZE = 20 }; +enum ZVisionGameId { + GID_NONE = 0, + GID_NEMESIS = 1, + GID_GRANDINQUISITOR = 2 +}; + class ZVision : public Engine { public: ZVision(OSystem *syst, const ZVisionGameDescription *gameDesc); @@ -116,12 +120,12 @@ private: ScriptManager *_scriptManager; RenderManager *_renderManager; CursorManager *_cursorManager; - SaveManager *_saveManager; StringManager *_stringManager; - MenuHandler *_menu; SearchManager *_searchManager; TextRenderer *_textRenderer; MidiManager *_midiManager; + SaveManager *_saveManager; + MenuHandler *_menu; // Clock Clock _clock; @@ -141,12 +145,15 @@ private: bool _videoIsPlaying; uint8 _cheatBuffer[KEYBUF_SIZE]; + public: - uint32 getFeatures() const; - Common::Language getLanguage() const; Common::Error run(); void pauseEngineIntern(bool pause); + ZVisionGameId ZVision::getGameId() const; + Common::Language ZVision::getLanguage() const; + uint32 ZVision::getFeatures() const; + ScriptManager *getScriptManager() const { return _scriptManager; } @@ -174,12 +181,10 @@ public: MenuHandler *getMenuHandler() const { return _menu; } + Common::RandomSource *getRandomSource() const { return _rnd; } - ZVisionGameId getGameId() const { - return _gameDescription->gameId; - } int16 getKeyboardVelocity() const { return _keyboardVelocity; } @@ -236,6 +241,7 @@ public: bool canSaveGameStateCurrently(); Common::Error loadGameState(int slot); Common::Error saveGameState(int slot, const Common::String &desc); + private: void initialize(); void initFonts(); |