From 530cbb4bc3406757ee3daeb3fc1972f79fd9199b Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Tue, 18 Feb 2014 23:43:06 -0500 Subject: MADS: Adding in classes for fonts, game, user interfaec, and graphics --- engines/mads/game.h | 46 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100644 engines/mads/game.h (limited to 'engines/mads/game.h') diff --git a/engines/mads/game.h b/engines/mads/game.h new file mode 100644 index 0000000000..190dc883d2 --- /dev/null +++ b/engines/mads/game.h @@ -0,0 +1,46 @@ +/* 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 MADS_GAME_H +#define MADS_GAME_H + +#include "common/scummsys.h" + +namespace MADS { + +class MADSEngine; + +class Game { +private: + MADSEngine *_vm; + MSurface *_surface; + + Game(MADSEngine *vm); +public: + static Game *init(MADSEngine *vm); +public: + ~Game(); +}; + +} // End of namespace MADS + +#endif /* MADS_GAME_H */ -- cgit v1.2.3 From 58bb1383d0b11d357128ca2b0a7634f091c0fb5b Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Wed, 19 Feb 2014 23:17:57 -0500 Subject: MADS: Added skeleton files for the game and dialogs --- engines/mads/game.h | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) (limited to 'engines/mads/game.h') diff --git a/engines/mads/game.h b/engines/mads/game.h index 190dc883d2..2f0dcf7d48 100644 --- a/engines/mads/game.h +++ b/engines/mads/game.h @@ -30,15 +30,25 @@ namespace MADS { class MADSEngine; class Game { -private: +protected: MADSEngine *_vm; MSurface *_surface; Game(MADSEngine *vm); + + /** + * Perform any copy protection check + */ + virtual bool checkCopyProtection() = 0; public: static Game *init(MADSEngine *vm); public: - ~Game(); + virtual ~Game(); + + /** + * Run the game + */ + void run(); }; } // End of namespace MADS -- cgit v1.2.3 From 82514b4a28904ead97552f6605cd3bde6924660b Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Sat, 22 Feb 2014 11:13:35 -0500 Subject: MADS: Beginnings of cursor initialization --- engines/mads/game.h | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'engines/mads/game.h') diff --git a/engines/mads/game.h b/engines/mads/game.h index 2f0dcf7d48..bb15a8e35b 100644 --- a/engines/mads/game.h +++ b/engines/mads/game.h @@ -40,8 +40,17 @@ protected: * Perform any copy protection check */ virtual bool checkCopyProtection() = 0; + + /** + * Initialises the current section number of the game + */ + void initSection(int sectionNumber); + public: static Game *init(MADSEngine *vm); +public: + int _sectionNumber; + int _priorSectionNumber; public: virtual ~Game(); -- cgit v1.2.3 From 8c9420a8349b0cdb93dcace36c2bd5f93e03476f Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Sun, 23 Feb 2014 19:33:26 -0500 Subject: MADS: Added game initialisation code --- engines/mads/game.h | 112 +++++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 110 insertions(+), 2 deletions(-) (limited to 'engines/mads/game.h') diff --git a/engines/mads/game.h b/engines/mads/game.h index bb15a8e35b..9dd7ca0ace 100644 --- a/engines/mads/game.h +++ b/engines/mads/game.h @@ -24,28 +24,136 @@ #define MADS_GAME_H #include "common/scummsys.h" +#include "mads/scene.h" namespace MADS { class MADSEngine; +enum { + PLAYER_INVENTORY = 2 +}; + +enum Difficulty { + DIFFICULTY_HARD = 1, DIFFICULTY_MEDIUM = 2, DIFFICULTY_EASY = 3 +}; + +enum DialogId { + DIALOG_NONE = 0, DIALOG_GAME_MENU = 1, DIALOG_SAVE = 2, DIALOG_RESTORE = 3, + DIALOG_OPTIONS = 4, DIALOG_DIFFICULTY = 5, DIALOG_ERROR = 6 +}; + +class InventoryObject { +public: + int _descId; + int _roomNumber; + int _article; + int _vocabCount; + struct { + int _actionFlags1; + int _actionFlags2; + int _vocabId; + } _vocabList[3]; + char _mutilateString[10]; // ??? + const byte *_objFolder; // ??? + + /** + * Loads the data for a given object + */ + void load(Common::SeekableReadStream &f); +}; + +class Player { +public: + int _direction; + int _newDirection; +public: + Player(); +}; + +class SectionHandler { +protected: + MADSEngine *_vm; +public: + SectionHandler(MADSEngine *vm): _vm(vm) {} + + virtual void loadSection() = 0; + virtual void sectionPtr2() = 0; + virtual void sectionPtr3() = 0; +}; + class Game { +private: + /** + * Main game loop + */ + void gameLoop(); protected: MADSEngine *_vm; MSurface *_surface; + Difficulty _difficultyLevel; + Common::Array _globalFlags; + Common::Array _objects; + Common::Array _inventoryList; + Player _player; + Scene _scene; + int _saveSlot; + int _statusFlag; + DialogId _pendingDialog; + + SectionHandler *_sectionHandler; + /** + * Constructor + */ Game(MADSEngine *vm); /** - * Perform any copy protection check + * Loads the game's object list + */ + void loadObjects(); + + /** + * Set the associated data? pointer with an inventory object */ - virtual bool checkCopyProtection() = 0; + void setObjectData(int objIndex, int id, const byte *p); + + /** + * Sets the room number + */ + void setObjectRoom(int objectId, int roomNumber); /** * Initialises the current section number of the game */ void initSection(int sectionNumber); + void loadResourceSequence(const Common::String prefix, int v); + + //@{ + /** @name Virtual Method list */ + + /** + * Perform any copy protection check + */ + virtual int checkCopyProtection() = 0; + + /** + * Initialises global variables for a new game + */ + virtual void initialiseGlobals() = 0; + + /** + * Show a game dialog + */ + virtual void showDialog() = 0; + + /** + * Set up the section handler specific to each section + */ + virtual void setSectionHandler() = 0; + //@} + public: static Game *init(MADSEngine *vm); public: -- cgit v1.2.3 From 8ee283d921ec88bad61469e136a31aef0ff5b9ca Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Sun, 23 Feb 2014 21:34:20 -0500 Subject: MADS: Implemented sound player logic and outer game loop --- engines/mads/game.h | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'engines/mads/game.h') diff --git a/engines/mads/game.h b/engines/mads/game.h index 9dd7ca0ace..4a8daed6ca 100644 --- a/engines/mads/game.h +++ b/engines/mads/game.h @@ -77,9 +77,9 @@ protected: public: SectionHandler(MADSEngine *vm): _vm(vm) {} - virtual void loadSection() = 0; + virtual void preLoadSection() = 0; virtual void sectionPtr2() = 0; - virtual void sectionPtr3() = 0; + virtual void postLoadSection() = 0; }; class Game { @@ -88,6 +88,11 @@ private: * Main game loop */ void gameLoop(); + + /** + * Inner game loop for executing gameplay within a game section + */ + void sectionLoop(); protected: MADSEngine *_vm; MSurface *_surface; @@ -100,8 +105,9 @@ protected: int _saveSlot; int _statusFlag; DialogId _pendingDialog; - SectionHandler *_sectionHandler; + int _v1; + int _v2; /** * Constructor -- cgit v1.2.3 From 37b788b7ddb679f32653be326ae96ad9132feb1f Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Mon, 24 Feb 2014 00:20:53 -0500 Subject: MADS: Added skeleton framework for game scene classes --- engines/mads/game.h | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) (limited to 'engines/mads/game.h') diff --git a/engines/mads/game.h b/engines/mads/game.h index 4a8daed6ca..58b6ff968a 100644 --- a/engines/mads/game.h +++ b/engines/mads/game.h @@ -38,11 +38,6 @@ enum Difficulty { DIFFICULTY_HARD = 1, DIFFICULTY_MEDIUM = 2, DIFFICULTY_EASY = 3 }; -enum DialogId { - DIALOG_NONE = 0, DIALOG_GAME_MENU = 1, DIALOG_SAVE = 2, DIALOG_RESTORE = 3, - DIALOG_OPTIONS = 4, DIALOG_DIFFICULTY = 5, DIALOG_ERROR = 6 -}; - class InventoryObject { public: int _descId; @@ -67,6 +62,12 @@ class Player { public: int _direction; int _newDirection; + bool _spritesLoaded; + int _spriteListStart; + int _numSprites; + bool _stepEnabled; + bool _spritesChanged; + bool _visible; public: Player(); }; @@ -76,6 +77,7 @@ protected: MADSEngine *_vm; public: SectionHandler(MADSEngine *vm): _vm(vm) {} + virtual ~SectionHandler() {} virtual void preLoadSection() = 0; virtual void sectionPtr2() = 0; @@ -104,10 +106,14 @@ protected: Scene _scene; int _saveSlot; int _statusFlag; - DialogId _pendingDialog; SectionHandler *_sectionHandler; int _v1; int _v2; + int _v3; + int _v4; + int _v5; + int _v6; + byte *_quotes; /** * Constructor @@ -172,6 +178,8 @@ public: * Run the game */ void run(); + + Player &player() { return _player; } }; } // End of namespace MADS -- cgit v1.2.3 From 4c867aa62fea19f2bff7d3aa632b340aae110306 Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Mon, 24 Feb 2014 00:38:49 -0500 Subject: MADS: Shift some fields and methods to Dialogs and Game classes --- engines/mads/game.h | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) (limited to 'engines/mads/game.h') diff --git a/engines/mads/game.h b/engines/mads/game.h index 58b6ff968a..e2b8deede5 100644 --- a/engines/mads/game.h +++ b/engines/mads/game.h @@ -95,6 +95,16 @@ private: * Inner game loop for executing gameplay within a game section */ void sectionLoop(); + + /** + * Returns true if a given Scene Id exists in the listed of previously visited scenes. + */ + bool visitedScenesExists(int sceneId); + + /** + * Adds a scene Id to the list of previously visited scenes, if it doesn't already exist + */ + void addVisitedScene(int sceneId); protected: MADSEngine *_vm; MSurface *_surface; @@ -107,13 +117,14 @@ protected: int _saveSlot; int _statusFlag; SectionHandler *_sectionHandler; + Common::Array _visitedScenes; + byte *_quotes; int _v1; int _v2; int _v3; int _v4; int _v5; int _v6; - byte *_quotes; /** * Constructor @@ -155,11 +166,6 @@ protected: */ virtual void initialiseGlobals() = 0; - /** - * Show a game dialog - */ - virtual void showDialog() = 0; - /** * Set up the section handler specific to each section */ -- cgit v1.2.3 From cc16e42f2029955e066450d63bfb666b9ab47109 Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Mon, 24 Feb 2014 20:05:35 -0500 Subject: MADS: Beginnings of scene-specific data loading --- engines/mads/game.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'engines/mads/game.h') diff --git a/engines/mads/game.h b/engines/mads/game.h index e2b8deede5..4735615d7a 100644 --- a/engines/mads/game.h +++ b/engines/mads/game.h @@ -109,9 +109,6 @@ protected: MADSEngine *_vm; MSurface *_surface; Difficulty _difficultyLevel; - Common::Array _globalFlags; - Common::Array _objects; - Common::Array _inventoryList; Player _player; Scene _scene; int _saveSlot; @@ -177,6 +174,9 @@ public: public: int _sectionNumber; int _priorSectionNumber; + Common::Array _globalFlags; + Common::Array _objects; + Common::Array _inventoryList; public: virtual ~Game(); -- cgit v1.2.3 From c9057bd6a8ee2b039e2ba528b1e2e59814b8ef88 Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Tue, 25 Feb 2014 09:21:19 -0500 Subject: MADS: Moved scene data classes into their own code file --- engines/mads/game.h | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'engines/mads/game.h') diff --git a/engines/mads/game.h b/engines/mads/game.h index 4735615d7a..fbac20ce1f 100644 --- a/engines/mads/game.h +++ b/engines/mads/game.h @@ -70,6 +70,10 @@ public: bool _visible; public: Player(); + + void loadSprites(const Common::String &prefix) { + warning("TODO: Player::loadSprites"); + } }; class SectionHandler { @@ -122,6 +126,8 @@ protected: int _v4; int _v5; int _v6; + Common::String _aaName; + bool _playerSpritesFlag; /** * Constructor @@ -174,6 +180,7 @@ public: public: int _sectionNumber; int _priorSectionNumber; + int _currentSectionNumber; Common::Array _globalFlags; Common::Array _objects; Common::Array _inventoryList; -- cgit v1.2.3 From 9eaab29afedf9eceee50f882b64cb39a14e616a2 Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Tue, 25 Feb 2014 19:52:35 -0500 Subject: MADS: Starting to refactor some Scene array fields as separate classes --- engines/mads/game.h | 83 +++-------------------------------------------------- 1 file changed, 4 insertions(+), 79 deletions(-) (limited to 'engines/mads/game.h') diff --git a/engines/mads/game.h b/engines/mads/game.h index fbac20ce1f..4797908b1a 100644 --- a/engines/mads/game.h +++ b/engines/mads/game.h @@ -25,6 +25,7 @@ #include "common/scummsys.h" #include "mads/scene.h" +#include "mads/game_data.h" namespace MADS { @@ -38,56 +39,6 @@ enum Difficulty { DIFFICULTY_HARD = 1, DIFFICULTY_MEDIUM = 2, DIFFICULTY_EASY = 3 }; -class InventoryObject { -public: - int _descId; - int _roomNumber; - int _article; - int _vocabCount; - struct { - int _actionFlags1; - int _actionFlags2; - int _vocabId; - } _vocabList[3]; - char _mutilateString[10]; // ??? - const byte *_objFolder; // ??? - - /** - * Loads the data for a given object - */ - void load(Common::SeekableReadStream &f); -}; - -class Player { -public: - int _direction; - int _newDirection; - bool _spritesLoaded; - int _spriteListStart; - int _numSprites; - bool _stepEnabled; - bool _spritesChanged; - bool _visible; -public: - Player(); - - void loadSprites(const Common::String &prefix) { - warning("TODO: Player::loadSprites"); - } -}; - -class SectionHandler { -protected: - MADSEngine *_vm; -public: - SectionHandler(MADSEngine *vm): _vm(vm) {} - virtual ~SectionHandler() {} - - virtual void preLoadSection() = 0; - virtual void sectionPtr2() = 0; - virtual void postLoadSection() = 0; -}; - class Game { private: /** @@ -99,26 +50,15 @@ private: * Inner game loop for executing gameplay within a game section */ void sectionLoop(); - - /** - * Returns true if a given Scene Id exists in the listed of previously visited scenes. - */ - bool visitedScenesExists(int sceneId); - - /** - * Adds a scene Id to the list of previously visited scenes, if it doesn't already exist - */ - void addVisitedScene(int sceneId); protected: MADSEngine *_vm; MSurface *_surface; Difficulty _difficultyLevel; Player _player; - Scene _scene; int _saveSlot; int _statusFlag; SectionHandler *_sectionHandler; - Common::Array _visitedScenes; + VisitedScenes _visitedScenes; byte *_quotes; int _v1; int _v2; @@ -134,21 +74,6 @@ protected: */ Game(MADSEngine *vm); - /** - * Loads the game's object list - */ - void loadObjects(); - - /** - * Set the associated data? pointer with an inventory object - */ - void setObjectData(int objIndex, int id, const byte *p); - - /** - * Sets the room number - */ - void setObjectRoom(int objectId, int roomNumber); - /** * Initialises the current section number of the game */ @@ -182,8 +107,8 @@ public: int _priorSectionNumber; int _currentSectionNumber; Common::Array _globalFlags; - Common::Array _objects; - Common::Array _inventoryList; + InventoryObjects _objects; + Scene _scene; public: virtual ~Game(); -- cgit v1.2.3 From c49d7196fcabf18d9e97711f67b864808ca7848a Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Tue, 25 Feb 2014 23:10:51 -0500 Subject: MADS: In progress implementation of loadScene --- engines/mads/game.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'engines/mads/game.h') diff --git a/engines/mads/game.h b/engines/mads/game.h index 4797908b1a..b8add9ab00 100644 --- a/engines/mads/game.h +++ b/engines/mads/game.h @@ -61,7 +61,6 @@ protected: VisitedScenes _visitedScenes; byte *_quotes; int _v1; - int _v2; int _v3; int _v4; int _v5; @@ -109,6 +108,7 @@ public: Common::Array _globalFlags; InventoryObjects _objects; Scene _scene; + int _v2; public: virtual ~Game(); -- cgit v1.2.3 From b816b9990d98633794f42ba49aeb971d6f9d930b Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Sun, 2 Mar 2014 19:29:54 -0500 Subject: MADS: Added skeleton class for actions --- engines/mads/game.h | 1 + 1 file changed, 1 insertion(+) (limited to 'engines/mads/game.h') diff --git a/engines/mads/game.h b/engines/mads/game.h index b8add9ab00..562e0b99d0 100644 --- a/engines/mads/game.h +++ b/engines/mads/game.h @@ -67,6 +67,7 @@ protected: int _v6; Common::String _aaName; bool _playerSpritesFlag; + int _objectHiliteVocabIdx; /** * Constructor -- cgit v1.2.3 From 72163a233f980a385c432fbf66fd6bb21f6acdf2 Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Sun, 2 Mar 2014 20:06:21 -0500 Subject: MADS: Moved Player class into it's own file --- engines/mads/game.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'engines/mads/game.h') diff --git a/engines/mads/game.h b/engines/mads/game.h index 562e0b99d0..88c5bebf63 100644 --- a/engines/mads/game.h +++ b/engines/mads/game.h @@ -26,6 +26,7 @@ #include "common/scummsys.h" #include "mads/scene.h" #include "mads/game_data.h" +#include "mads/player.h" namespace MADS { @@ -62,7 +63,6 @@ protected: byte *_quotes; int _v1; int _v3; - int _v4; int _v5; int _v6; Common::String _aaName; @@ -110,6 +110,7 @@ public: InventoryObjects _objects; Scene _scene; int _v2; + int _v4; public: virtual ~Game(); -- cgit v1.2.3 From a0996b7384e5c3321af97347613120d2f90ab64e Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Sun, 2 Mar 2014 20:50:35 -0500 Subject: MADS: Implemented more of the multi-scene loop --- engines/mads/game.h | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'engines/mads/game.h') diff --git a/engines/mads/game.h b/engines/mads/game.h index 88c5bebf63..cd727af902 100644 --- a/engines/mads/game.h +++ b/engines/mads/game.h @@ -65,6 +65,7 @@ protected: int _v3; int _v5; int _v6; + bool _updateSceneFlag; Common::String _aaName; bool _playerSpritesFlag; int _objectHiliteVocabIdx; @@ -111,6 +112,10 @@ public: Scene _scene; int _v2; int _v4; + int _abortTimers; + int _abortTimers2; + AbortTimerMode _abortTimersMode2; + uint32 _currentTimer; public: virtual ~Game(); -- cgit v1.2.3 From 3a842a079c668e9dfc52a6056119d4932e8ef56d Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Sun, 2 Mar 2014 23:09:17 -0500 Subject: MADS: Bulk of implementation of ScreenObjects::check --- engines/mads/game.h | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'engines/mads/game.h') diff --git a/engines/mads/game.h b/engines/mads/game.h index cd727af902..2bfa53db18 100644 --- a/engines/mads/game.h +++ b/engines/mads/game.h @@ -55,7 +55,6 @@ protected: MADSEngine *_vm; MSurface *_surface; Difficulty _difficultyLevel; - Player _player; int _saveSlot; int _statusFlag; SectionHandler *_sectionHandler; @@ -104,6 +103,7 @@ protected: public: static Game *init(MADSEngine *vm); public: + Player _player; int _sectionNumber; int _priorSectionNumber; int _currentSectionNumber; @@ -123,8 +123,6 @@ public: * Run the game */ void run(); - - Player &player() { return _player; } }; } // End of namespace MADS -- cgit v1.2.3 From d8026b9ef72d7ca22721486244309ccd4a003cae Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Mon, 3 Mar 2014 00:42:41 -0500 Subject: MADS: Implementing Scene::doFrame --- engines/mads/game.h | 1 + 1 file changed, 1 insertion(+) (limited to 'engines/mads/game.h') diff --git a/engines/mads/game.h b/engines/mads/game.h index 2bfa53db18..148fc121cd 100644 --- a/engines/mads/game.h +++ b/engines/mads/game.h @@ -114,6 +114,7 @@ public: int _v4; int _abortTimers; int _abortTimers2; + AbortTimerMode _abortTimersMode; AbortTimerMode _abortTimersMode2; uint32 _currentTimer; public: -- cgit v1.2.3 From 9e356dd945863a4c4dfa89f2a94dd1a56c2d03a6 Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Mon, 3 Mar 2014 23:40:23 -0500 Subject: MADS: Implemented extra message and dirty area classes --- engines/mads/game.h | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'engines/mads/game.h') diff --git a/engines/mads/game.h b/engines/mads/game.h index 148fc121cd..47eed34393 100644 --- a/engines/mads/game.h +++ b/engines/mads/game.h @@ -124,6 +124,11 @@ public: * Run the game */ void run(); + + /** + * Get a quote + */ + Common::String getQuote(int quoteId); }; } // End of namespace MADS -- cgit v1.2.3 From f6888eef1069ac5df07c3f4dcc3a30755bc4ebb0 Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Tue, 4 Mar 2014 09:33:57 -0500 Subject: MADS: Implementation of timer functionality for Scene::doFrame --- engines/mads/game.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'engines/mads/game.h') diff --git a/engines/mads/game.h b/engines/mads/game.h index 47eed34393..5330cd3138 100644 --- a/engines/mads/game.h +++ b/engines/mads/game.h @@ -116,7 +116,7 @@ public: int _abortTimers2; AbortTimerMode _abortTimersMode; AbortTimerMode _abortTimersMode2; - uint32 _currentTimer; + uint32 _priorFrameTimer; public: virtual ~Game(); -- cgit v1.2.3 From 73a7140be775693533db183f353fc9c82c14fa53 Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Wed, 5 Mar 2014 21:36:02 -0500 Subject: MADS: Starting implementation of scene group 8 --- engines/mads/game.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'engines/mads/game.h') diff --git a/engines/mads/game.h b/engines/mads/game.h index 5330cd3138..aa3c38596c 100644 --- a/engines/mads/game.h +++ b/engines/mads/game.h @@ -65,7 +65,6 @@ protected: int _v5; int _v6; bool _updateSceneFlag; - Common::String _aaName; bool _playerSpritesFlag; int _objectHiliteVocabIdx; @@ -117,6 +116,7 @@ public: AbortTimerMode _abortTimersMode; AbortTimerMode _abortTimersMode2; uint32 _priorFrameTimer; + Common::String _aaName; public: virtual ~Game(); -- cgit v1.2.3 From c9186f51b9502a4cfb1881f2db4f92eeb6227144 Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Thu, 6 Mar 2014 20:30:05 -0500 Subject: MADS: Added in Rex Nebular globals class --- engines/mads/game.h | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'engines/mads/game.h') diff --git a/engines/mads/game.h b/engines/mads/game.h index aa3c38596c..0cd46b6f7e 100644 --- a/engines/mads/game.h +++ b/engines/mads/game.h @@ -97,6 +97,12 @@ protected: * Set up the section handler specific to each section */ virtual void setSectionHandler() = 0; + + /** + * Checks for whether to show a dialog + */ + virtual void checkShowDialog() = 0; + //@} public: @@ -106,7 +112,6 @@ public: int _sectionNumber; int _priorSectionNumber; int _currentSectionNumber; - Common::Array _globalFlags; InventoryObjects _objects; Scene _scene; int _v2; -- cgit v1.2.3 From a77ed90618664e50705b3e59dd2111faec2f5f39 Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Thu, 6 Mar 2014 22:31:41 -0500 Subject: MADS: Implementing support methods needed for scene 804 initialisation --- engines/mads/game.h | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) (limited to 'engines/mads/game.h') diff --git a/engines/mads/game.h b/engines/mads/game.h index 0cd46b6f7e..aa1810963d 100644 --- a/engines/mads/game.h +++ b/engines/mads/game.h @@ -24,6 +24,7 @@ #define MADS_GAME_H #include "common/scummsys.h" +#include "common/str-array.h" #include "mads/scene.h" #include "mads/game_data.h" #include "mads/player.h" @@ -51,6 +52,11 @@ private: * Inner game loop for executing gameplay within a game section */ void sectionLoop(); + + /** + * Load quotes data + */ + void loadQuotes(); protected: MADSEngine *_vm; MSurface *_surface; @@ -59,7 +65,7 @@ protected: int _statusFlag; SectionHandler *_sectionHandler; VisitedScenes _visitedScenes; - byte *_quotes; + Common::StringArray _quotes; int _v1; int _v3; int _v5; @@ -130,10 +136,14 @@ public: */ void run(); - /** - * Get a quote - */ - Common::String getQuote(int quoteId); + uint32 getQuotesSize() { return _quotes.size(); } + const Common::String &getQuote(uint32 index) { return _quotes[index - 1]; } + + // DEPRECATED: ScummVM re-implementation keeps all the quotes loaded, so the methods below are stubs + void clearQuotes() {} + void loadQuoteRange(int startNum, int endNum) {} + void loadQuoteSet(...) {} + void loadQuote(int quoteNum) {} }; } // End of namespace MADS -- cgit v1.2.3 From 3399516c5e4c2931adf76a25944cb3e46f9934ee Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Fri, 7 Mar 2014 23:07:36 -0500 Subject: MADS: Implemented remainder of scene 804 setup code and support methods --- engines/mads/game.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'engines/mads/game.h') diff --git a/engines/mads/game.h b/engines/mads/game.h index aa1810963d..143259dc2f 100644 --- a/engines/mads/game.h +++ b/engines/mads/game.h @@ -66,13 +66,11 @@ protected: SectionHandler *_sectionHandler; VisitedScenes _visitedScenes; Common::StringArray _quotes; - int _v1; int _v3; int _v5; int _v6; bool _updateSceneFlag; bool _playerSpritesFlag; - int _objectHiliteVocabIdx; /** * Constructor @@ -120,6 +118,7 @@ public: int _currentSectionNumber; InventoryObjects _objects; Scene _scene; + int _v1; int _v2; int _v4; int _abortTimers; @@ -128,6 +127,8 @@ public: AbortTimerMode _abortTimersMode2; uint32 _priorFrameTimer; Common::String _aaName; + uint32 _ticksExpiry; + int _objectHiliteVocabIdx; public: virtual ~Game(); -- cgit v1.2.3 From 2d99f761f0bb0a8db4468846f0643fbdc4da450a Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Tue, 11 Mar 2014 23:26:31 -0400 Subject: MADS: Implemented scene 804 step --- engines/mads/game.h | 1 + 1 file changed, 1 insertion(+) (limited to 'engines/mads/game.h') diff --git a/engines/mads/game.h b/engines/mads/game.h index 143259dc2f..01f23605d5 100644 --- a/engines/mads/game.h +++ b/engines/mads/game.h @@ -129,6 +129,7 @@ public: Common::String _aaName; uint32 _ticksExpiry; int _objectHiliteVocabIdx; + int _exitFlag; public: virtual ~Game(); -- cgit v1.2.3 From 10124f6806150aad409f6db9a6c7a60afcb44872 Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Sat, 15 Mar 2014 17:38:44 -0400 Subject: MADS: Implemented scene 103 setup and needed support methods --- engines/mads/game.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'engines/mads/game.h') diff --git a/engines/mads/game.h b/engines/mads/game.h index 01f23605d5..8e1559ed21 100644 --- a/engines/mads/game.h +++ b/engines/mads/game.h @@ -27,6 +27,7 @@ #include "common/str-array.h" #include "mads/scene.h" #include "mads/game_data.h" +#include "mads/inventory.h" #include "mads/player.h" namespace MADS { @@ -64,9 +65,7 @@ protected: int _saveSlot; int _statusFlag; SectionHandler *_sectionHandler; - VisitedScenes _visitedScenes; Common::StringArray _quotes; - int _v3; int _v5; int _v6; bool _updateSceneFlag; @@ -117,9 +116,11 @@ public: int _priorSectionNumber; int _currentSectionNumber; InventoryObjects _objects; + VisitedScenes _visitedScenes; Scene _scene; int _v1; int _v2; + int _v3; int _v4; int _abortTimers; int _abortTimers2; -- cgit v1.2.3 From acba8f9254a724ce9c57f5ddd81e6b9264c07274 Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Sun, 16 Mar 2014 23:40:21 -0400 Subject: MADS: Implementing user interface text display methods --- engines/mads/game.h | 1 - 1 file changed, 1 deletion(-) (limited to 'engines/mads/game.h') diff --git a/engines/mads/game.h b/engines/mads/game.h index 8e1559ed21..6ef1ca9ef5 100644 --- a/engines/mads/game.h +++ b/engines/mads/game.h @@ -129,7 +129,6 @@ public: uint32 _priorFrameTimer; Common::String _aaName; uint32 _ticksExpiry; - int _objectHiliteVocabIdx; int _exitFlag; public: virtual ~Game(); -- cgit v1.2.3 From db017b746dded2ea287c04c37fbb88ef82492781 Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Wed, 19 Mar 2014 19:44:51 -0400 Subject: MADS: Moved ScreenObjects into the Game class --- engines/mads/game.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'engines/mads/game.h') diff --git a/engines/mads/game.h b/engines/mads/game.h index 6ef1ca9ef5..444e2fa372 100644 --- a/engines/mads/game.h +++ b/engines/mads/game.h @@ -29,6 +29,7 @@ #include "mads/game_data.h" #include "mads/inventory.h" #include "mads/player.h" +#include "mads/screen.h" namespace MADS { @@ -112,6 +113,7 @@ public: static Game *init(MADSEngine *vm); public: Player _player; + ScreenObjects _screenObjects; int _sectionNumber; int _priorSectionNumber; int _currentSectionNumber; -- cgit v1.2.3 From 2b141aaba681a3c7b848010cd58768f55f4434a3 Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Fri, 21 Mar 2014 09:27:22 -0400 Subject: MADS: Fixes for screen objects loading and checking --- engines/mads/game.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'engines/mads/game.h') diff --git a/engines/mads/game.h b/engines/mads/game.h index 444e2fa372..32491ce0d0 100644 --- a/engines/mads/game.h +++ b/engines/mads/game.h @@ -65,7 +65,6 @@ protected: Difficulty _difficultyLevel; int _saveSlot; int _statusFlag; - SectionHandler *_sectionHandler; Common::StringArray _quotes; int _v5; int _v6; @@ -118,6 +117,7 @@ public: int _priorSectionNumber; int _currentSectionNumber; InventoryObjects _objects; + SectionHandler *_sectionHandler; VisitedScenes _visitedScenes; Scene _scene; int _v1; -- cgit v1.2.3 From 7f4dbf7d48b6db8d82d33b569c22f104fc153dd3 Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Sun, 23 Mar 2014 18:48:00 -0400 Subject: MADS: Implemented more action handling methods --- engines/mads/game.h | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'engines/mads/game.h') diff --git a/engines/mads/game.h b/engines/mads/game.h index 32491ce0d0..bf81c23d81 100644 --- a/engines/mads/game.h +++ b/engines/mads/game.h @@ -143,6 +143,11 @@ public: uint32 getQuotesSize() { return _quotes.size(); } const Common::String &getQuote(uint32 index) { return _quotes[index - 1]; } + /** + * Standard object handling across the game + */ + virtual void doObjectAction() = 0; + // DEPRECATED: ScummVM re-implementation keeps all the quotes loaded, so the methods below are stubs void clearQuotes() {} void loadQuoteRange(int startNum, int endNum) {} -- cgit v1.2.3 From 633da299f694a9998a0cdb002a08613750f36e61 Mon Sep 17 00:00:00 2001 From: Strangerke Date: Tue, 25 Mar 2014 22:01:25 +0100 Subject: MADS: Add scene 208 --- engines/mads/game.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'engines/mads/game.h') diff --git a/engines/mads/game.h b/engines/mads/game.h index bf81c23d81..c5a3dd3be0 100644 --- a/engines/mads/game.h +++ b/engines/mads/game.h @@ -62,7 +62,6 @@ private: protected: MADSEngine *_vm; MSurface *_surface; - Difficulty _difficultyLevel; int _saveSlot; int _statusFlag; Common::StringArray _quotes; @@ -110,9 +109,11 @@ protected: public: static Game *init(MADSEngine *vm); + public: Player _player; ScreenObjects _screenObjects; + Difficulty _difficultyLevel; int _sectionNumber; int _priorSectionNumber; int _currentSectionNumber; -- cgit v1.2.3 From 04cbbb5f0a5cc761c71ead882187c02a0000ec0b Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Tue, 25 Mar 2014 23:59:57 -0400 Subject: MADS: Added enums for copy protection result and globals --- engines/mads/game.h | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'engines/mads/game.h') diff --git a/engines/mads/game.h b/engines/mads/game.h index c5a3dd3be0..0abb70bb9f 100644 --- a/engines/mads/game.h +++ b/engines/mads/game.h @@ -43,6 +43,10 @@ enum Difficulty { DIFFICULTY_HARD = 1, DIFFICULTY_MEDIUM = 2, DIFFICULTY_EASY = 3 }; +enum ProtectionResult { + PROTECTION_SUCCEED = 0, PROTECTION_FAIL = 1, PROTECTION_ESCAPE = 2 +}; + class Game { private: /** @@ -88,7 +92,7 @@ protected: /** * Perform any copy protection check */ - virtual int checkCopyProtection() = 0; + virtual ProtectionResult checkCopyProtection() = 0; /** * Initialises global variables for a new game @@ -132,12 +136,12 @@ public: uint32 _priorFrameTimer; Common::String _aaName; uint32 _ticksExpiry; - int _exitFlag; + int _winStatus; public: virtual ~Game(); /** - * Run the game + * Main outer loop for the game */ void run(); -- cgit v1.2.3 From f9e2c1c71f29f6dc1ba8e860d597fe93bc79646a Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Wed, 26 Mar 2014 09:32:33 -0400 Subject: MADS: Cleaned up game initialisation code to use more constants --- engines/mads/game.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'engines/mads/game.h') diff --git a/engines/mads/game.h b/engines/mads/game.h index 0abb70bb9f..0d7178a567 100644 --- a/engines/mads/game.h +++ b/engines/mads/game.h @@ -40,7 +40,7 @@ enum { }; enum Difficulty { - DIFFICULTY_HARD = 1, DIFFICULTY_MEDIUM = 2, DIFFICULTY_EASY = 3 + DIFFICULTY_HARD = 1, DIFFICULTY_REALLY_HARD = 2, DIFFICULTY_IMPOSSIBLE = 3 }; enum ProtectionResult { @@ -117,7 +117,7 @@ public: public: Player _player; ScreenObjects _screenObjects; - Difficulty _difficultyLevel; + Difficulty _difficulty; int _sectionNumber; int _priorSectionNumber; int _currentSectionNumber; -- cgit v1.2.3 From 377cbbe77d5c7f16aba086e4fb1707de843ddc1a Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Thu, 27 Mar 2014 21:04:27 -0400 Subject: MADS: Cleanup of game and player fields used during initialization --- engines/mads/game.h | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) (limited to 'engines/mads/game.h') diff --git a/engines/mads/game.h b/engines/mads/game.h index 0d7178a567..11fd95491e 100644 --- a/engines/mads/game.h +++ b/engines/mads/game.h @@ -43,9 +43,15 @@ enum Difficulty { DIFFICULTY_HARD = 1, DIFFICULTY_REALLY_HARD = 2, DIFFICULTY_IMPOSSIBLE = 3 }; +enum KernelMode { + KERNEL_GAME_LOAD = 0, KERNEL_SECTION_PRELOAD = 1, KERNEL_SECTION_INIT = 2, + KERNEL_ROOM_PRELOAD = 3, KERNEL_ROOM_INIT = 4, KERNEL_ACTIVE_CODE = 5 +}; + enum ProtectionResult { PROTECTION_SUCCEED = 0, PROTECTION_FAIL = 1, PROTECTION_ESCAPE = 2 }; +; class Game { private: @@ -69,8 +75,8 @@ protected: int _saveSlot; int _statusFlag; Common::StringArray _quotes; - int _v5; - int _v6; + bool _quoteEmergency; + bool _vocabEmergency; bool _updateSceneFlag; bool _playerSpritesFlag; @@ -125,10 +131,8 @@ public: SectionHandler *_sectionHandler; VisitedScenes _visitedScenes; Scene _scene; - int _v1; + KernelMode _kernelMode; int _v2; - int _v3; - int _v4; int _abortTimers; int _abortTimers2; AbortTimerMode _abortTimersMode; -- cgit v1.2.3 From 6c85572d76245f616ae3bf2ac1ccc713d8271fa9 Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Thu, 27 Mar 2014 22:38:28 -0400 Subject: MADS: Initial cleanup of action/player handling --- engines/mads/game.h | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'engines/mads/game.h') diff --git a/engines/mads/game.h b/engines/mads/game.h index 11fd95491e..f3e2a67e23 100644 --- a/engines/mads/game.h +++ b/engines/mads/game.h @@ -78,7 +78,6 @@ protected: bool _quoteEmergency; bool _vocabEmergency; bool _updateSceneFlag; - bool _playerSpritesFlag; /** * Constructor @@ -133,8 +132,8 @@ public: Scene _scene; KernelMode _kernelMode; int _v2; - int _abortTimers; - int _abortTimers2; + int _trigger; + ScreenTransition _fx; AbortTimerMode _abortTimersMode; AbortTimerMode _abortTimersMode2; uint32 _priorFrameTimer; -- cgit v1.2.3 From 71b1343adf6e886cfd2e1a0040a12b5025672d14 Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Sat, 29 Mar 2014 11:18:07 -0400 Subject: MADS: Implemented NebularGame::step --- engines/mads/game.h | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'engines/mads/game.h') diff --git a/engines/mads/game.h b/engines/mads/game.h index f3e2a67e23..9da2694456 100644 --- a/engines/mads/game.h +++ b/engines/mads/game.h @@ -134,8 +134,8 @@ public: int _v2; int _trigger; ScreenTransition _fx; - AbortTimerMode _abortTimersMode; - AbortTimerMode _abortTimersMode2; + TriggerMode _triggerMode; + TriggerMode _triggerSetupMode; uint32 _priorFrameTimer; Common::String _aaName; uint32 _ticksExpiry; @@ -156,6 +156,11 @@ public: */ virtual void doObjectAction() = 0; + /** + * Global game step + */ + virtual void step() = 0; + // DEPRECATED: ScummVM re-implementation keeps all the quotes loaded, so the methods below are stubs void clearQuotes() {} void loadQuoteRange(int startNum, int endNum) {} -- cgit v1.2.3 From 89af9dde8c412b4d11cd0107fe20f9bbbfd2e3bc Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Sat, 29 Mar 2014 22:28:22 -0400 Subject: MADS: Implemented message loading/decoding --- engines/mads/game.h | 1 + 1 file changed, 1 insertion(+) (limited to 'engines/mads/game.h') diff --git a/engines/mads/game.h b/engines/mads/game.h index 9da2694456..4521ad68c1 100644 --- a/engines/mads/game.h +++ b/engines/mads/game.h @@ -150,6 +150,7 @@ public: uint32 getQuotesSize() { return _quotes.size(); } const Common::String &getQuote(uint32 index) { return _quotes[index - 1]; } + Common::StringArray getMessage(uint32 id); /** * Standard object handling across the game -- cgit v1.2.3 From 0c1001fbf4c37379ec685b036e63d6d59055997a Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Tue, 1 Apr 2014 22:50:03 -0400 Subject: MADS: Minor variable renaming and remove incorrect variable set in scene loop --- engines/mads/game.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'engines/mads/game.h') diff --git a/engines/mads/game.h b/engines/mads/game.h index 4521ad68c1..54aef443a6 100644 --- a/engines/mads/game.h +++ b/engines/mads/game.h @@ -77,7 +77,7 @@ protected: Common::StringArray _quotes; bool _quoteEmergency; bool _vocabEmergency; - bool _updateSceneFlag; + bool _anyEmergency; /** * Constructor -- cgit v1.2.3 From 041773705be6dd1fb09d71e482f4974247cee61f Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Wed, 2 Apr 2014 20:28:57 -0400 Subject: MADS: Fix/clean up ending of ScreenObjects::check --- engines/mads/game.h | 1 - 1 file changed, 1 deletion(-) (limited to 'engines/mads/game.h') diff --git a/engines/mads/game.h b/engines/mads/game.h index 54aef443a6..f41e7d248c 100644 --- a/engines/mads/game.h +++ b/engines/mads/game.h @@ -138,7 +138,6 @@ public: TriggerMode _triggerSetupMode; uint32 _priorFrameTimer; Common::String _aaName; - uint32 _ticksExpiry; int _winStatus; public: virtual ~Game(); -- cgit v1.2.3 From 7e13f488abeb6a7530d591bae880fdb185c8fef1 Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Mon, 7 Apr 2014 22:37:22 -0400 Subject: MADS: Implement loading logic for UI background animations --- engines/mads/game.h | 1 - 1 file changed, 1 deletion(-) (limited to 'engines/mads/game.h') diff --git a/engines/mads/game.h b/engines/mads/game.h index f41e7d248c..e4880091cc 100644 --- a/engines/mads/game.h +++ b/engines/mads/game.h @@ -131,7 +131,6 @@ public: VisitedScenes _visitedScenes; Scene _scene; KernelMode _kernelMode; - int _v2; int _trigger; ScreenTransition _fx; TriggerMode _triggerMode; -- cgit v1.2.3 From 0f476c31ef6edccc218286997a221bcf2e94a990 Mon Sep 17 00:00:00 2001 From: Strangerke Date: Tue, 8 Apr 2014 10:26:43 +0200 Subject: MADS: Implement scene 210, some cleanup of some other 2xx scenes, add some stubs --- engines/mads/game.h | 1 + 1 file changed, 1 insertion(+) (limited to 'engines/mads/game.h') diff --git a/engines/mads/game.h b/engines/mads/game.h index e4880091cc..3216da360e 100644 --- a/engines/mads/game.h +++ b/engines/mads/game.h @@ -148,6 +148,7 @@ public: uint32 getQuotesSize() { return _quotes.size(); } const Common::String &getQuote(uint32 index) { return _quotes[index - 1]; } + void splitQuote(Common::String quote, Common::String part1, Common::String part2) {warning("TODO: splitQuote()");} Common::StringArray getMessage(uint32 id); /** -- cgit v1.2.3 From 531ebab4da814aac23a9b084772a6156bfb3b9b8 Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Tue, 8 Apr 2014 22:04:43 -0400 Subject: MADS: Added preliminary keyboard handling and keypress process stub --- engines/mads/game.h | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'engines/mads/game.h') diff --git a/engines/mads/game.h b/engines/mads/game.h index 3216da360e..296bbcd7ea 100644 --- a/engines/mads/game.h +++ b/engines/mads/game.h @@ -78,6 +78,7 @@ protected: bool _quoteEmergency; bool _vocabEmergency; bool _anyEmergency; + int _widepipeCtr; /** * Constructor @@ -166,6 +167,11 @@ public: void loadQuoteRange(int startNum, int endNum) {} void loadQuoteSet(...) {} void loadQuote(int quoteNum) {} + + /** + * Handle a keyboard event + */ + void handleKeypress(const Common::Event &event); }; } // End of namespace MADS -- cgit v1.2.3 From 21a0e38f34324423e0f571ccb37a800737cd78d2 Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Tue, 8 Apr 2014 22:21:45 -0400 Subject: MADS: Resolve some old TODOs --- engines/mads/game.h | 2 -- 1 file changed, 2 deletions(-) (limited to 'engines/mads/game.h') diff --git a/engines/mads/game.h b/engines/mads/game.h index 296bbcd7ea..56593660b5 100644 --- a/engines/mads/game.h +++ b/engines/mads/game.h @@ -90,8 +90,6 @@ protected: */ void initSection(int sectionNumber); - void loadResourceSequence(const Common::String prefix, int v); - //@{ /** @name Virtual Method list */ -- cgit v1.2.3 From a30e78137e326c49d7de09f4fb2293bedfdd4a30 Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Thu, 10 Apr 2014 22:34:26 -0400 Subject: MADS: Added method stub for unhandled action method --- engines/mads/game.h | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'engines/mads/game.h') diff --git a/engines/mads/game.h b/engines/mads/game.h index 56593660b5..c7cb66081d 100644 --- a/engines/mads/game.h +++ b/engines/mads/game.h @@ -155,6 +155,11 @@ public: */ virtual void doObjectAction() = 0; + /** + * Fallback handler for any action that isn't explicitly handled + */ + virtual void unhandledAction() = 0; + /** * Global game step */ -- cgit v1.2.3 From 8b2a7525cc6af408f05e2bac9b1b16ed0b36dcda Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Sat, 12 Apr 2014 12:09:29 -0400 Subject: MADS: Fix a bunch of GCC warnings --- engines/mads/game.h | 1 - 1 file changed, 1 deletion(-) (limited to 'engines/mads/game.h') diff --git a/engines/mads/game.h b/engines/mads/game.h index c7cb66081d..2c87d70d9d 100644 --- a/engines/mads/game.h +++ b/engines/mads/game.h @@ -51,7 +51,6 @@ enum KernelMode { enum ProtectionResult { PROTECTION_SUCCEED = 0, PROTECTION_FAIL = 1, PROTECTION_ESCAPE = 2 }; -; class Game { private: -- cgit v1.2.3 From f0ce06f0e9e0ebcf21368fdf01856a026dd4d2fb Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Sun, 20 Apr 2014 21:32:29 -0400 Subject: MADS: Implemented display of conversation topics --- engines/mads/game.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'engines/mads/game.h') diff --git a/engines/mads/game.h b/engines/mads/game.h index 2c87d70d9d..44aa0dbee5 100644 --- a/engines/mads/game.h +++ b/engines/mads/game.h @@ -77,7 +77,6 @@ protected: bool _quoteEmergency; bool _vocabEmergency; bool _anyEmergency; - int _widepipeCtr; /** * Constructor @@ -136,6 +135,7 @@ public: uint32 _priorFrameTimer; Common::String _aaName; int _winStatus; + int _widepipeCtr; public: virtual ~Game(); -- cgit v1.2.3 From 692af23f6f0a698e9089fcef0592fcb20e56efa6 Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Mon, 21 Apr 2014 20:50:05 -0400 Subject: MADS: Create a Globals base class that the games will derive from --- engines/mads/game.h | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'engines/mads/game.h') diff --git a/engines/mads/game.h b/engines/mads/game.h index 44aa0dbee5..5bb7b31973 100644 --- a/engines/mads/game.h +++ b/engines/mads/game.h @@ -27,6 +27,7 @@ #include "common/str-array.h" #include "mads/scene.h" #include "mads/game_data.h" +#include "mads/globals.h" #include "mads/inventory.h" #include "mads/player.h" #include "mads/screen.h" @@ -149,6 +150,11 @@ public: void splitQuote(Common::String quote, Common::String part1, Common::String part2) {warning("TODO: splitQuote()");} Common::StringArray getMessage(uint32 id); + /** + * Returns the globals for the game + */ + virtual Globals &globals() = 0; + /** * Standard object handling across the game */ -- cgit v1.2.3 From 0e9e6cda40ee0bf739e6c7a6320a81307df7c8b9 Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Tue, 22 Apr 2014 23:00:41 -0400 Subject: MADS: Beginnings of savegame synchronisation --- engines/mads/game.h | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'engines/mads/game.h') diff --git a/engines/mads/game.h b/engines/mads/game.h index 5bb7b31973..ad40fbdcc0 100644 --- a/engines/mads/game.h +++ b/engines/mads/game.h @@ -25,6 +25,7 @@ #include "common/scummsys.h" #include "common/str-array.h" +#include "common/serializer.h" #include "mads/scene.h" #include "mads/game_data.h" #include "mads/globals.h" @@ -72,12 +73,12 @@ private: protected: MADSEngine *_vm; MSurface *_surface; - int _saveSlot; int _statusFlag; Common::StringArray _quotes; bool _quoteEmergency; bool _vocabEmergency; bool _anyEmergency; + Common::Serializer *_serializer; /** * Constructor @@ -170,6 +171,13 @@ public: */ virtual void step() = 0; + /** + * Synchronise the game data + * @param s Serializer + * @param phase1 If true, it's synchronising the basic scene information + */ + virtual void synchronize(Common::Serializer &s, bool phase1); + // DEPRECATED: ScummVM re-implementation keeps all the quotes loaded, so the methods below are stubs void clearQuotes() {} void loadQuoteRange(int startNum, int endNum) {} -- cgit v1.2.3 From bae0a6590a4ba843ef51f4cc67875c578863f5b2 Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Sat, 26 Apr 2014 09:08:46 -0400 Subject: MADS: Implemented savegame header read/writes --- engines/mads/game.h | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) (limited to 'engines/mads/game.h') diff --git a/engines/mads/game.h b/engines/mads/game.h index ad40fbdcc0..8334d94256 100644 --- a/engines/mads/game.h +++ b/engines/mads/game.h @@ -24,6 +24,7 @@ #define MADS_GAME_H #include "common/scummsys.h" +#include "common/savefile.h" #include "common/str-array.h" #include "common/serializer.h" #include "mads/scene.h" @@ -54,6 +55,17 @@ enum ProtectionResult { PROTECTION_SUCCEED = 0, PROTECTION_FAIL = 1, PROTECTION_ESCAPE = 2 }; +#define MADS_SAVEGAME_VERSION 1 + +struct MADSSavegameHeader { + uint8 _version; + Common::String _saveName; + Graphics::Surface *_thumbnail; + int _year, _month, _day; + int _hour, _minute; + int _totalFrames; +}; + class Game { private: /** @@ -78,6 +90,8 @@ protected: bool _quoteEmergency; bool _vocabEmergency; bool _anyEmergency; + int _loadGameSlot; + Common::String _saveName; Common::Serializer *_serializer; /** @@ -188,6 +202,28 @@ public: * Handle a keyboard event */ void handleKeypress(const Common::Event &event); + + /** + * Starts a savegame loading. + * @remarks Due to the way the engine is implemented, loading is done in two + * parts, the second part after the specific scene has been loaded + */ + void loadGame(int slotNumber); + + /** + * Save the current game + */ + void saveGame(int slotNumber, const Common::String &saveName); + + /** + * Write out a savegame header + */ + void writeSavegameHeader(Common::OutSaveFile *out, MADSSavegameHeader &header); + + /** + * Read in a savegame header + */ + static bool readSavegameHeader(Common::InSaveFile *in, MADSSavegameHeader &header); }; } // End of namespace MADS -- cgit v1.2.3 From bb5edf5426c3d8717d3a3f843a3dbf6193bbe9e9 Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Sat, 26 Apr 2014 11:01:21 -0400 Subject: MADS: Implemented more save/load logic --- engines/mads/game.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'engines/mads/game.h') diff --git a/engines/mads/game.h b/engines/mads/game.h index 8334d94256..982f880dca 100644 --- a/engines/mads/game.h +++ b/engines/mads/game.h @@ -92,7 +92,7 @@ protected: bool _anyEmergency; int _loadGameSlot; Common::String _saveName; - Common::Serializer *_serializer; + Common::InSaveFile *_saveFile; /** * Constructor -- cgit v1.2.3 From 6c9075eb2539aa4264ce4298772437caec55b256 Mon Sep 17 00:00:00 2001 From: Filippos Karapetis Date: Sun, 27 Apr 2014 22:56:15 +0300 Subject: MADS: Implement the audio player This is used for all digital samples, plus voices in talkie versions. Currently, it's only hooked to the "play_audio" debugger command --- engines/mads/game.h | 1 + 1 file changed, 1 insertion(+) (limited to 'engines/mads/game.h') diff --git a/engines/mads/game.h b/engines/mads/game.h index 982f880dca..246a7857a6 100644 --- a/engines/mads/game.h +++ b/engines/mads/game.h @@ -27,6 +27,7 @@ #include "common/savefile.h" #include "common/str-array.h" #include "common/serializer.h" +#include "mads/audio.h" #include "mads/scene.h" #include "mads/game_data.h" #include "mads/globals.h" -- cgit v1.2.3 From b5949010a61e3d12f22ea762ed8d09cc1a79b850 Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Thu, 1 May 2014 22:36:36 -0400 Subject: MADS: Implemented more savegame synchronization --- engines/mads/game.h | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) (limited to 'engines/mads/game.h') diff --git a/engines/mads/game.h b/engines/mads/game.h index 246a7857a6..5ae670df76 100644 --- a/engines/mads/game.h +++ b/engines/mads/game.h @@ -43,10 +43,6 @@ enum { PLAYER_INVENTORY = 2 }; -enum Difficulty { - DIFFICULTY_HARD = 1, DIFFICULTY_REALLY_HARD = 2, DIFFICULTY_IMPOSSIBLE = 3 -}; - enum KernelMode { KERNEL_GAME_LOAD = 0, KERNEL_SECTION_PRELOAD = 1, KERNEL_SECTION_INIT = 2, KERNEL_ROOM_PRELOAD = 3, KERNEL_ROOM_INIT = 4, KERNEL_ACTIVE_CODE = 5 @@ -92,6 +88,7 @@ protected: bool _vocabEmergency; bool _anyEmergency; int _loadGameSlot; + int _lastSave; Common::String _saveName; Common::InSaveFile *_saveFile; @@ -136,7 +133,6 @@ public: public: Player _player; ScreenObjects _screenObjects; - Difficulty _difficulty; int _sectionNumber; int _priorSectionNumber; int _currentSectionNumber; -- cgit v1.2.3 From 84159c59efe95c682d4d727f48e93b08a93860da Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Sat, 3 May 2014 11:09:28 -0400 Subject: MADS: Savegames are now working --- engines/mads/game.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'engines/mads/game.h') diff --git a/engines/mads/game.h b/engines/mads/game.h index 5ae670df76..358a266e09 100644 --- a/engines/mads/game.h +++ b/engines/mads/game.h @@ -87,7 +87,6 @@ protected: bool _quoteEmergency; bool _vocabEmergency; bool _anyEmergency; - int _loadGameSlot; int _lastSave; Common::String _saveName; Common::InSaveFile *_saveFile; @@ -149,6 +148,7 @@ public: Common::String _aaName; int _winStatus; int _widepipeCtr; + int _loadGameSlot; public: virtual ~Game(); -- cgit v1.2.3 From e7bef9019a71105a19c9f4eff567b8df47387a8b Mon Sep 17 00:00:00 2001 From: Strangerke Date: Sun, 18 May 2014 12:29:48 +0200 Subject: MADS: Implement scene 803, add an ongoingGame global flag to exit the multiple game loops --- engines/mads/game.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'engines/mads/game.h') diff --git a/engines/mads/game.h b/engines/mads/game.h index 358a266e09..0e9640594c 100644 --- a/engines/mads/game.h +++ b/engines/mads/game.h @@ -149,6 +149,8 @@ public: int _winStatus; int _widepipeCtr; int _loadGameSlot; + bool _ongoingGame; + public: virtual ~Game(); -- cgit v1.2.3 From e1a06ae543f0926118d2b82aa5344752e11ead1d Mon Sep 17 00:00:00 2001 From: Strangerke Date: Sun, 18 May 2014 12:34:15 +0200 Subject: MADS: Replace _ongoingGame by the use of quitGame() --- engines/mads/game.h | 1 - 1 file changed, 1 deletion(-) (limited to 'engines/mads/game.h') diff --git a/engines/mads/game.h b/engines/mads/game.h index 0e9640594c..d171638b66 100644 --- a/engines/mads/game.h +++ b/engines/mads/game.h @@ -149,7 +149,6 @@ public: int _winStatus; int _widepipeCtr; int _loadGameSlot; - bool _ongoingGame; public: virtual ~Game(); -- cgit v1.2.3 From 6d1fc8256f19e0b320b9b160b198f17af1cd14ff Mon Sep 17 00:00:00 2001 From: Strangerke Date: Mon, 19 May 2014 20:56:03 +0200 Subject: MADS: Some more British -> American English modifications --- engines/mads/game.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'engines/mads/game.h') diff --git a/engines/mads/game.h b/engines/mads/game.h index d171638b66..a55de617fd 100644 --- a/engines/mads/game.h +++ b/engines/mads/game.h @@ -112,7 +112,7 @@ protected: /** * Initialises global variables for a new game */ - virtual void initialiseGlobals() = 0; + virtual void initializeGlobals() = 0; /** * Set up the section handler specific to each section -- cgit v1.2.3 From 9099b36caa88d7675a03fb0bd283acf4e1122474 Mon Sep 17 00:00:00 2001 From: Johannes Schickel Date: Tue, 27 May 2014 00:58:25 +0200 Subject: MADS: initialise -> initialize. --- engines/mads/game.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'engines/mads/game.h') diff --git a/engines/mads/game.h b/engines/mads/game.h index a55de617fd..6ec053e068 100644 --- a/engines/mads/game.h +++ b/engines/mads/game.h @@ -97,7 +97,7 @@ protected: Game(MADSEngine *vm); /** - * Initialises the current section number of the game + * Initializes the current section number of the game */ void initSection(int sectionNumber); @@ -110,7 +110,7 @@ protected: virtual ProtectionResult checkCopyProtection() = 0; /** - * Initialises global variables for a new game + * Initializes global variables for a new game */ virtual void initializeGlobals() = 0; -- cgit v1.2.3 From 6a7cc38c89305cecdcb6414fe438615beb931eca Mon Sep 17 00:00:00 2001 From: Johannes Schickel Date: Tue, 27 May 2014 00:58:25 +0200 Subject: MADS: synchronise -> synchronize --- engines/mads/game.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'engines/mads/game.h') diff --git a/engines/mads/game.h b/engines/mads/game.h index 6ec053e068..3a84a720f7 100644 --- a/engines/mads/game.h +++ b/engines/mads/game.h @@ -184,9 +184,9 @@ public: virtual void step() = 0; /** - * Synchronise the game data + * Synchronize the game data * @param s Serializer - * @param phase1 If true, it's synchronising the basic scene information + * @param phase1 If true, it's synchronizing the basic scene information */ virtual void synchronize(Common::Serializer &s, bool phase1); -- cgit v1.2.3 From c06e330ba87410b36672936c76154f9352b95d6c Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Mon, 26 May 2014 21:25:18 -0400 Subject: MADS: Fix displaying multi-line messages in conversation with village girl --- engines/mads/game.h | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'engines/mads/game.h') diff --git a/engines/mads/game.h b/engines/mads/game.h index 3a84a720f7..1b06f847d0 100644 --- a/engines/mads/game.h +++ b/engines/mads/game.h @@ -158,9 +158,21 @@ public: */ void run(); + /** + * Return the number of quotes + */ uint32 getQuotesSize() { return _quotes.size(); } + + /** + * Get a specific quote string + */ const Common::String &getQuote(uint32 index) { return _quotes[index - 1]; } - void splitQuote(Common::String quote, Common::String part1, Common::String part2) {warning("TODO: splitQuote()");} + + /** + * Split a quote into two lines for display on-screen + */ + void splitQuote(const Common::String &source, Common::String &line1, Common::String &line2); + Common::StringArray getMessage(uint32 id); /** -- cgit v1.2.3 From 72e7d55d629ecb38ad0dc1cabcd6911c7c3d9ebd Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Sun, 1 Jun 2014 22:03:02 -0400 Subject: MADS: Fixes for recharging durafail batteries --- engines/mads/game.h | 4 ---- 1 file changed, 4 deletions(-) (limited to 'engines/mads/game.h') diff --git a/engines/mads/game.h b/engines/mads/game.h index 1b06f847d0..8b16590503 100644 --- a/engines/mads/game.h +++ b/engines/mads/game.h @@ -39,10 +39,6 @@ namespace MADS { class MADSEngine; -enum { - PLAYER_INVENTORY = 2 -}; - enum KernelMode { KERNEL_GAME_LOAD = 0, KERNEL_SECTION_PRELOAD = 1, KERNEL_SECTION_INIT = 2, KERNEL_ROOM_PRELOAD = 3, KERNEL_ROOM_INIT = 4, KERNEL_ACTIVE_CODE = 5 -- cgit v1.2.3 From 17cc86d1721d275d56845754b9a32710b0e0d2f0 Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Fri, 6 Jun 2014 20:04:46 -0400 Subject: MADS: Refactoring and cleanup of the game startup code --- engines/mads/game.h | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) (limited to 'engines/mads/game.h') diff --git a/engines/mads/game.h b/engines/mads/game.h index 8b16590503..08cd7e7843 100644 --- a/engines/mads/game.h +++ b/engines/mads/game.h @@ -44,10 +44,6 @@ enum KernelMode { KERNEL_ROOM_PRELOAD = 3, KERNEL_ROOM_INIT = 4, KERNEL_ACTIVE_CODE = 5 }; -enum ProtectionResult { - PROTECTION_SUCCEED = 0, PROTECTION_FAIL = 1, PROTECTION_ESCAPE = 2 -}; - #define MADS_SAVEGAME_VERSION 1 struct MADSSavegameHeader { @@ -101,9 +97,9 @@ protected: /** @name Virtual Method list */ /** - * Perform any copy protection check + * Perform any game-specifcic startup */ - virtual ProtectionResult checkCopyProtection() = 0; + virtual void startGame() = 0; /** * Initializes global variables for a new game -- cgit v1.2.3