ASYLUM: Utilities class renamed to Shared. All common resources bound to shared singleton so they can be used by all engine components without needing a direct reference back to the engine variables (Screen, Sound, Video, Scene).

Better Pathfinding (you can actually walk around now)

git-svn-id: http://asylumengine.googlecode.com/svn/trunk@292 0bfb4aae-4ea4-11de-8d8d-752d95cf3e3c
This commit is contained in:
Alex Bevilacqua 2009-08-08 12:38:17 +00:00 committed by Eugene Sandulenko
parent 04c2840c49
commit 54682e1f44
No known key found for this signature in database
GPG key ID: 014D387312D34F08
15 changed files with 320 additions and 274 deletions

View file

@ -31,6 +31,7 @@
#include "asylum/asylum.h"
#include "asylum/respack.h"
#include "asylum/shared.h"
namespace Asylum {
@ -84,6 +85,10 @@ Common::Error AsylumEngine::init() {
_mainMenu = 0;
_scene = 0;
Shared.setScreen(_screen);
Shared.setSound(_sound);
Shared.setVideo(_video);
return Common::kNoError;
}
@ -102,19 +107,17 @@ Common::Error AsylumEngine::go() {
//_video->playVideo(1, kSubtitlesOn);
// Set up the game's main scene
_scene = new Scene(_screen, _sound, _video, 5);
_scene->setBlowUpPuzzle(new BlowUpPuzzleVCR(_scene)); // this will be done by a Script command
_scene = new Scene(5);
Shared.setScene(_scene);
// TODO Since the ScriptMan is a singleton, setScene assignments could
// probably be rolled into the Scene constructor :D
ScriptMan.setScene(_scene);
_scene->setBlowUpPuzzle(new BlowUpPuzzleVCR()); // this will be done by a Script command
// TODO This can probably also be rolled into the scene constructor.
// Investigate if this will fuck up the execution sequence though :P
ScriptMan.setScript(_scene->getDefaultActionList());
// Set up main menu
_mainMenu = new MainMenu(_screen, _sound, _scene);
_mainMenu = new MainMenu();
// XXX Testing
@ -228,11 +231,9 @@ void AsylumEngine::processDelayedEvents() {
if (_scene)
delete _scene;
_scene = new Scene(_screen, _sound, _video, sceneIdx);
ScriptMan.setScene(_scene);
_scene = new Scene(sceneIdx);
_scene->enterScene();
ScriptMan.setDelayedSceneIndex(-1);
ScriptMan.setScript(_scene->getDefaultActionList());
}