aboutsummaryrefslogtreecommitdiff
path: root/engines/m4/m4.cpp
diff options
context:
space:
mode:
authorPaul Gilbert2010-01-30 23:03:07 +0000
committerPaul Gilbert2010-01-30 23:03:07 +0000
commit3d1a43bc5486de8d65b72a5385719e370f159298 (patch)
treecbd6ba0ace5b280f13697caa02dd32f4ad220f09 /engines/m4/m4.cpp
parent676bebe2be5d7cd685feb29059997f2a4b4f4442 (diff)
downloadscummvm-rg350-3d1a43bc5486de8d65b72a5385719e370f159298.tar.gz
scummvm-rg350-3d1a43bc5486de8d65b72a5385719e370f159298.tar.bz2
scummvm-rg350-3d1a43bc5486de8d65b72a5385719e370f159298.zip
Worked on separating scene logic into separate classes for M4 and MADS
svn-id: r47728
Diffstat (limited to 'engines/m4/m4.cpp')
-rw-r--r--engines/m4/m4.cpp25
1 files changed, 15 insertions, 10 deletions
diff --git a/engines/m4/m4.cpp b/engines/m4/m4.cpp
index 090921da83..fef646325c 100644
--- a/engines/m4/m4.cpp
+++ b/engines/m4/m4.cpp
@@ -118,6 +118,7 @@ MadsM4Engine::MadsM4Engine(OSystem *syst, const M4GameDescription *gameDesc) :
Common::addDebugChannel(kDebugConversations, "conversations", "Conversations debugging");
_resourceManager = NULL;
+ _globals = NULL;
}
@@ -174,7 +175,6 @@ Common::Error MadsM4Engine::run() {
_actor = NULL;
}
_rails = new Rails(); // needs to be initialized before _scene
- _scene = new Scene(this);
_dialogs = new Dialogs();
_viewManager = new ViewManager(this);
_inventory = new Inventory(this);
@@ -298,10 +298,13 @@ void MadsM4Engine::dumpFile(const char* filename, bool uncompress) {
M4Engine::M4Engine(OSystem *syst, const M4GameDescription *gameDesc): MadsM4Engine(syst, gameDesc) {
// FIXME
_m4Vm = this;
+
+ _globals = new M4Globals(this);
}
M4Engine::~M4Engine() {
delete _resourceManager;
+ delete _globals;
}
Common::Error M4Engine::run() {
@@ -314,7 +317,7 @@ Common::Error M4Engine::run() {
// Set up needed common functionality
MadsM4Engine::run();
-
+ _scene = new M4Scene(this);
_script->open("m4.dat");
#ifdef SCRIPT_TEST
@@ -506,22 +509,24 @@ Common::Error MadsEngine::run() {
// Set up needed common functionality
MadsM4Engine::run();
+ _scene = new MadsScene(this);
_palette->setMadsSystemPalette();
_mouse->init("cursor.ss", NULL);
_mouse->setCursorNum(0);
// Load MADS data files
- _globals->loadMadsVocab(); // vocab.dat
- _globals->loadMadsQuotes(); // quotes.dat
- _globals->loadMadsMessagesInfo(); // messages.dat
- _globals->loadMadsObjects();
+ MadsGlobals *globals = (MadsGlobals *)_globals;
+ globals->loadMadsVocab(); // vocab.dat
+ globals->loadMadsQuotes(); // quotes.dat
+ globals->loadMadsMessagesInfo(); // messages.dat
+ globals->loadMadsObjects();
// Setup globals
- _madsVm->_globals->easyMouse = true;
- _madsVm->_globals->invObjectsStill = false;
- _madsVm->_globals->textWindowStill = false;
- _madsVm->_globals->storyMode = 0;
+ globals->easyMouse = true;
+ globals->invObjectsStill = false;
+ globals->textWindowStill = false;
+ globals->storyMode = 0;
// Test code to dump all messages to the console
//for (int i = 0; i < _globals->getMessagesSize(); i++)