diff options
author | Paul Gilbert | 2014-02-18 20:08:58 -0500 |
---|---|---|
committer | Paul Gilbert | 2014-02-18 20:08:58 -0500 |
commit | 0e46c809d10dcd8fd766d7adcb966785e7955f5b (patch) | |
tree | 817e0f1c0c6f4b5ab86f6703cc09fb839173f3f5 /engines/mads/mads.cpp | |
parent | ece3e9a2200052cc65f60e0295b674095d7a6a66 (diff) | |
download | scummvm-rg350-0e46c809d10dcd8fd766d7adcb966785e7955f5b.tar.gz scummvm-rg350-0e46c809d10dcd8fd766d7adcb966785e7955f5b.tar.bz2 scummvm-rg350-0e46c809d10dcd8fd766d7adcb966785e7955f5b.zip |
MADS: Initial implementation of MSurface class and dependant classes
Diffstat (limited to 'engines/mads/mads.cpp')
-rw-r--r-- | engines/mads/mads.cpp | 42 |
1 files changed, 32 insertions, 10 deletions
diff --git a/engines/mads/mads.cpp b/engines/mads/mads.cpp index 25730fa9e4..9998bc02e9 100644 --- a/engines/mads/mads.cpp +++ b/engines/mads/mads.cpp @@ -20,35 +20,57 @@ * */ -#include "mads/mads.h" -#include "mads/sound.h" #include "common/scummsys.h" #include "common/config-manager.h" #include "common/debug-channels.h" -#include "engines/util.h" #include "common/events.h" +#include "engines/util.h" +#include "mads/mads.h" +#include "mads/resources.h" +#include "mads/sound.h" +#include "mads/msurface.h" +#include "mads/msprite.h" namespace MADS { -MADSEngine *g_vm; - MADSEngine::MADSEngine(OSystem *syst, const MADSGameDescription *gameDesc) : - Engine(syst), _randomSource("MADS") { - DebugMan.addDebugChannel(kDebugPath, "Path", "Pathfinding debug level"); - DebugMan.addDebugChannel(kDebugScripts, "scripts", "Game scripts"); + _gameDescription(gameDesc), Engine(syst), _randomSource("MADS") { + + // Initialise fields + _easyMouse = true; + _invObjectStill = false; + _textWindowStill = false; + _palette = nullptr; + _resources = nullptr; + _screen = nullptr; + _sound = nullptr; } MADSEngine::~MADSEngine() { + delete _events; + delete _resources; + delete _screen; + delete _sound; } void MADSEngine::initialise() { - _soundManager.setVm(this, _mixer); + // Set up debug channels + DebugMan.addDebugChannel(kDebugPath, "Path", "Pathfinding debug level"); + DebugMan.addDebugChannel(kDebugScripts, "scripts", "Game scripts"); + + // Initial sub-system engine references + MSurface::setVm(this); + MSprite::setVm(this); + + _events = new EventsManager(this); + _resources = new ResourcesManager(this); + _screen = MSurface::init(); + _sound = new SoundManager(this, _mixer); } Common::Error MADSEngine::run() { initGraphics(320, 200, false); initialise(); - _soundManager.test(); Common::Event e; while (!shouldQuit()) { |