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/nebular/nebular_scenes.cpp | 18 ++++++++++-------- engines/mads/nebular/nebular_scenes.h | 6 +++++- engines/mads/nebular/nebular_scenes8.cpp | 24 ++++++++++++++++++++++++ engines/mads/nebular/nebular_scenes8.h | 19 +++++++++++++++++-- 4 files changed, 56 insertions(+), 11 deletions(-) (limited to 'engines/mads/nebular') diff --git a/engines/mads/nebular/nebular_scenes.cpp b/engines/mads/nebular/nebular_scenes.cpp index efd831a4b7..e1dec2c34c 100644 --- a/engines/mads/nebular/nebular_scenes.cpp +++ b/engines/mads/nebular/nebular_scenes.cpp @@ -31,17 +31,19 @@ namespace MADS { namespace Nebular { -SceneLogic *SceneFactory::createScene(Scene *scene) { - scene->addActiveVocab(NOUN_DROP); - scene->addActiveVocab(NOUN_DOLLOP); - scene->addActiveVocab(NOUN_DASH); - scene->addActiveVocab(NOUN_SPLASH); - scene->addActiveVocab(NOUN_ALCOHOL); +SceneLogic *SceneFactory::createScene(MADSEngine *vm) { + Scene &scene = vm->_game->_scene; + + scene.addActiveVocab(NOUN_DROP); + scene.addActiveVocab(NOUN_DOLLOP); + scene.addActiveVocab(NOUN_DASH); + scene.addActiveVocab(NOUN_SPLASH); + scene.addActiveVocab(NOUN_ALCOHOL); // TODO: Implement all the game scenes - assert(scene->_nextSceneId == 804); + assert(scene._nextSceneId == 804); - return new Scene804(scene); + return new Scene804(vm); } } // End of namespace Nebular diff --git a/engines/mads/nebular/nebular_scenes.h b/engines/mads/nebular/nebular_scenes.h index 28d24f090f..1997202fbd 100644 --- a/engines/mads/nebular/nebular_scenes.h +++ b/engines/mads/nebular/nebular_scenes.h @@ -31,6 +31,10 @@ namespace MADS { namespace Nebular { +enum { + SEX_MALE = 0, SEX_FEMALE = 2 +}; + enum Noun { NOUN_BLOWGUN = 0x29, NOUN_BURGER = 0x35, @@ -81,7 +85,7 @@ enum Noun { class SceneFactory { public: - static SceneLogic *createScene(Scene *scene); + static SceneLogic *createScene(MADSEngine *vm); }; } // End of namespace Nebular diff --git a/engines/mads/nebular/nebular_scenes8.cpp b/engines/mads/nebular/nebular_scenes8.cpp index 8feabc8037..ee06dd00d3 100644 --- a/engines/mads/nebular/nebular_scenes8.cpp +++ b/engines/mads/nebular/nebular_scenes8.cpp @@ -21,12 +21,36 @@ */ #include "common/scummsys.h" +#include "mads/mads.h" +#include "mads/scene.h" +#include "mads/nebular/nebular_scenes.h" #include "mads/nebular/nebular_scenes8.h" namespace MADS { namespace Nebular { +void Scene8xx::setup1() { + _vm->_sound->command(5); + if ((_vm->_game->_globalFlags[178] && !_vm->_game->_globalFlags[179]) || + _scene->_nextSceneId == 804 || _scene->_nextSceneId == 805 || + _scene->_nextSceneId == 808 || _scene->_nextSceneId == 810) { + _vm->_game->_player._spritesPrefix = ""; + } else { + _vm->_game->_player._spritesPrefix = _vm->_game->_globalFlags[0] + == SEX_FEMALE ? "ROX" : "RXM"; + } + + _vm->_palette->setEntry(16, 0x0A, 0x3F, 0x3F); + _vm->_palette->setEntry(17, 0x0A, 0x2D, 0x2D); +} + +void Scene8xx::setup2() { + _vm->_game->_aaName = Resources::formatAAName(5); +} + +/*------------------------------------------------------------------------*/ + void Scene804::setup() { } diff --git a/engines/mads/nebular/nebular_scenes8.h b/engines/mads/nebular/nebular_scenes8.h index 11bb8b0d81..3f5d2744fa 100644 --- a/engines/mads/nebular/nebular_scenes8.h +++ b/engines/mads/nebular/nebular_scenes8.h @@ -31,9 +31,24 @@ namespace MADS { namespace Nebular { -class Scene804: public SceneLogic { +class Scene8xx : public SceneLogic { +protected: + /** + * Initial setup code shared by several scenes + */ + void setup1(); + + /** + * Initial setup code shared by several scenes + */ + void setup2(); public: - Scene804(Scene *scene): SceneLogic(scene) {} + Scene8xx(MADSEngine *vm) : SceneLogic(vm) {} +}; + +class Scene804: public Scene8xx { +public: + Scene804(MADSEngine *vm) : Scene8xx(vm) {} virtual void setup(); -- cgit v1.2.3