From dfcef632eacc27b4e035e3796550dced425e836d Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Sun, 16 Mar 2014 00:00:18 -0400 Subject: MADS: Hooked up the in-progress scene 103 --- engines/mads/game.cpp | 1 + engines/mads/nebular/game_nebular.cpp | 5 +++-- engines/mads/nebular/nebular_scenes.cpp | 15 ++++++++++++--- engines/mads/nebular/nebular_scenes1.h | 2 +- engines/mads/palette.cpp | 3 ++- 5 files changed, 19 insertions(+), 7 deletions(-) (limited to 'engines/mads') diff --git a/engines/mads/game.cpp b/engines/mads/game.cpp index ad3ea5e85d..a4f3b24542 100644 --- a/engines/mads/game.cpp +++ b/engines/mads/game.cpp @@ -82,6 +82,7 @@ void Game::run() { _statusFlag = 0; break; default: + _scene._nextSceneId = 103; break; } diff --git a/engines/mads/nebular/game_nebular.cpp b/engines/mads/nebular/game_nebular.cpp index 8948689622..1476620f9d 100644 --- a/engines/mads/nebular/game_nebular.cpp +++ b/engines/mads/nebular/game_nebular.cpp @@ -40,20 +40,21 @@ GameNebular::GameNebular(MADSEngine *vm): Game(vm) { } int GameNebular::checkCopyProtection() { + /* // DEBUG: Flag copy protection failure _globals[5] = -1; if (!ConfMan.getBool("copy_protection")) return true; - /* DEBUG: Disabled for now + * DEBUG: Disabled for now CopyProtectionDialog *dlg = new CopyProtectionDialog(_vm, false); dlg->show(); delete dlg; */ // DEBUG: Return that copy protection failed - return 1; + return 0; } void GameNebular::initialiseGlobals() { diff --git a/engines/mads/nebular/nebular_scenes.cpp b/engines/mads/nebular/nebular_scenes.cpp index 6644d957ed..21592b07bf 100644 --- a/engines/mads/nebular/nebular_scenes.cpp +++ b/engines/mads/nebular/nebular_scenes.cpp @@ -28,6 +28,7 @@ #include "mads/scene.h" #include "mads/nebular/game_nebular.h" #include "mads/nebular/nebular_scenes.h" +#include "mads/nebular/nebular_scenes1.h" #include "mads/nebular/nebular_scenes8.h" namespace MADS { @@ -43,10 +44,18 @@ SceneLogic *SceneFactory::createScene(MADSEngine *vm) { scene.addActiveVocab(NOUN_SPLASH); scene.addActiveVocab(NOUN_ALCOHOL); - // TODO: Implement all the game scenes - assert(scene._nextSceneId == 804); + switch (scene._nextSceneId) { + // Scene group #1 + case 103: + return new Scene103(vm); - return new Scene804(vm); + // Scene group #8 + case 804: + return new Scene804(vm); + + default: + error("Invalid scene %d called", scene._nextSceneId); + } } /*------------------------------------------------------------------------*/ diff --git a/engines/mads/nebular/nebular_scenes1.h b/engines/mads/nebular/nebular_scenes1.h index 6077e1e797..0af34dfff5 100644 --- a/engines/mads/nebular/nebular_scenes1.h +++ b/engines/mads/nebular/nebular_scenes1.h @@ -32,7 +32,7 @@ namespace MADS { namespace Nebular { -class Scene1xx : protected NebularScene { +class Scene1xx : public NebularScene { protected: /** * Plays an appropriate sound when entering a scene diff --git a/engines/mads/palette.cpp b/engines/mads/palette.cpp index d7301bb369..ba63dd3145 100644 --- a/engines/mads/palette.cpp +++ b/engines/mads/palette.cpp @@ -237,7 +237,8 @@ int PaletteUsage::process(Common::Array &palette, uint flags) { int PaletteUsage::rgbMerge(RGB6 &palEntry) { - return palEntry.r * 38 + palEntry.g * 76 + palEntry.b * 14; + return ((palEntry.r + 1) / 4 - 1) * 38 + ((palEntry.g + 1) / 4 - 1) * 76 + + ((palEntry.b + 1) / 4 - 1) * 14; } void PaletteUsage::prioritizeFromList(int lst[3]) { -- cgit v1.2.3