From 1ea346e0640737a00a19c7dce281aa4f98b2c206 Mon Sep 17 00:00:00 2001 From: Alex Bevilacqua Date: Fri, 25 Sep 2009 13:19:46 +0000 Subject: [PATCH] ASYLUM: cleanup and comments git-svn-id: http://asylumengine.googlecode.com/svn/trunk@373 0bfb4aae-4ea4-11de-8d8d-752d95cf3e3c --- engines/asylum/actor.cpp | 1 + engines/asylum/asylum.cpp | 23 ++++++++++-------- engines/asylum/asylum.h | 25 ++++++++++++-------- engines/asylum/menu.h | 49 ++++++++++++++++++++------------------- 4 files changed, 54 insertions(+), 44 deletions(-) diff --git a/engines/asylum/actor.cpp b/engines/asylum/actor.cpp index b3b6cf8001c..f7785873228 100644 --- a/engines/asylum/actor.cpp +++ b/engines/asylum/actor.cpp @@ -55,6 +55,7 @@ void Actor::visible(bool value) { flags |= 0x01; else flags &= 0xFFFFFFFE; + // TODO object_sound_sub_414c30 } void Actor::setDirection(int dir) { diff --git a/engines/asylum/asylum.cpp b/engines/asylum/asylum.cpp index c6593993cc2..02fdbf83c2b 100644 --- a/engines/asylum/asylum.cpp +++ b/engines/asylum/asylum.cpp @@ -78,6 +78,7 @@ Common::Error AsylumEngine::run() { err = init(); if (err != Common::kNoError) return err; + return go(); } @@ -85,13 +86,13 @@ Common::Error AsylumEngine::run() { Common::Error AsylumEngine::init() { initGraphics(640, 480, true); - _screen = new Screen(this); - _sound = new Sound(_mixer); - _video = new Video(_mixer); - _console = new Console(this); - _text = new Text(_screen); - _mainMenu = 0; - _scene = 0; + _screen = new Screen(this); + _sound = new Sound(_mixer); + _video = new Video(_mixer); + _console = new Console(this); + _text = new Text(_screen); + _mainMenu = 0; + _scene = 0; _introPlaying = false; @@ -104,16 +105,18 @@ Common::Error AsylumEngine::go() { // TODO: init unknown game stuffs (address 0040F430) // TODO: if savegame exists on folder, than start NewGame() - // Set up the game's main scene + // FIXME The scene shouldn't be created here, as we don't technically know + // how the scene is starting. This was put in for testing, but will eventually + // have to be removed once saveload is implemented _scene = new Scene(5, this); - // XXX This is just here for testing purposes. It is also defined + // FIXME This is just here for testing purposes. It is also defined // in the processActionList() method when the necessary action is fired. // Once the blowup puzzle testing is removed from checkForEvent(), this // can be removed as well. _scene->setBlowUpPuzzle(new BlowUpPuzzleVCR(_scene)); - // XXX This can probably also be rolled into the scene constructor. + // FIXME This can probably also be rolled into the scene constructor. // Investigate if this will fuck up the execution sequence though :P _scene->actions()->setScriptByIndex(_scene->worldstats()->actionListIdx); diff --git a/engines/asylum/asylum.h b/engines/asylum/asylum.h index 70fd0db68a6..a1d5f7f3c58 100644 --- a/engines/asylum/asylum.h +++ b/engines/asylum/asylum.h @@ -39,11 +39,16 @@ namespace Asylum { +// XXX +// If defined, this will play the scene title loading +// progress before the scene is entered. This is +// just a convenience, as there's no need for the type +// of pre-loading that was performed in the original #define SHOW_SCENE_LOADING // XXX // I'm not sure if system endian-ness would have any -// effect byte order of the data files, but I guess +// effect on the byte order of the data files, but I guess // it won't hurt to keep this here until we can test // on a big-endian system #ifndef SCUMM_BIG_ENDIAN @@ -62,15 +67,15 @@ class Video; class Encounter; enum kDebugLevels { - kDebugLevelMain = 1 << 0, + kDebugLevelMain = 1 << 0, kDebugLevelResources = 1 << 1, - kDebugLevelSprites = 1 << 2, - kDebugLevelInput = 1 << 3, - kDebugLevelMenu = 1 << 4, - kDebugLevelScripts = 1 << 5, - kDebugLevelSound = 1 << 6, - kDebugLevelSavegame = 1 << 7, - kDebugLevelScene = 1 << 8 + kDebugLevelSprites = 1 << 2, + kDebugLevelInput = 1 << 3, + kDebugLevelMenu = 1 << 4, + kDebugLevelScripts = 1 << 5, + kDebugLevelSound = 1 << 6, + kDebugLevelSavegame = 1 << 7, + kDebugLevelScene = 1 << 8 }; class AsylumEngine: public Engine { @@ -121,7 +126,7 @@ private: void processDelayedEvents(); void playIntro(); - Common::Language _language; + Common::Language _language; Common::RandomSource _rnd; int _ambientVolume; diff --git a/engines/asylum/menu.h b/engines/asylum/menu.h index e457c27cf4d..89bd458e9d3 100644 --- a/engines/asylum/menu.h +++ b/engines/asylum/menu.h @@ -49,6 +49,7 @@ public: bool isActive() { return _active; } + void openMenu(); void closeMenu(); @@ -56,32 +57,32 @@ private: AsylumEngine *_vm; enum EyesAnimation { - kEyesFront = 0, - kEyesLeft = 1, - kEyesRight = 2, - kEyesTop = 3, - kEyesBottom = 4, - kEyesTopLeft = 5, - kEyesTopRight = 6, - kEyesBottomLeft = 7, + kEyesFront = 0, + kEyesLeft = 1, + kEyesRight = 2, + kEyesTop = 3, + kEyesBottom = 4, + kEyesTopLeft = 5, + kEyesTopRight = 6, + kEyesBottomLeft = 7, kEyesBottomRight = 8, - kEyesCrossed = 9 + kEyesCrossed = 9 }; enum MenuScreen { - kNewGame = 0, - kLoadGame = 1, - kSaveGame = 2, - kDeleteGame = 3, - kViewCinematics = 4, - kQuitGame = 5, - kTextOptions = 6, - kAudioOptions = 7, - kSettings = 8, - kKeyboardConfig = 9, - kShowCredits = 10, - kReturnToGame = 11, - kMainMenu = 12 + kNewGame = 0, + kLoadGame = 1, + kSaveGame = 2, + kDeleteGame = 3, + kViewCinematics = 4, + kQuitGame = 5, + kTextOptions = 6, + kAudioOptions = 7, + kSettings = 8, + kKeyboardConfig = 9, + kShowCredits = 10, + kReturnToGame = 11, + kMainMenu = 12 }; Common::Event *_ev; @@ -101,8 +102,8 @@ private: uint32 _confGammaLevel; uint32 _confGameQuality; - MenuScreen _activeMenuScreen; - ResourcePack *_resPack; + MenuScreen _activeMenuScreen; + ResourcePack *_resPack; GraphicResource *_bgResource; GraphicResource *_eyeResource; GraphicResource *_iconResource;