aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBorja Lorente2016-06-08 11:17:56 +0200
committerBorja Lorente2016-08-14 18:10:48 +0200
commitd15e3a03c73da1d5a0bbc372970936eedfa1108d (patch)
tree76effac3b7d4c6e5740fe2b5dcc2ef89f0a04151
parentf095c4a958af62d5f696f61243aca7a2c48f6ba7 (diff)
downloadscummvm-rg350-d15e3a03c73da1d5a0bbc372970936eedfa1108d.tar.gz
scummvm-rg350-d15e3a03c73da1d5a0bbc372970936eedfa1108d.tar.bz2
scummvm-rg350-d15e3a03c73da1d5a0bbc372970936eedfa1108d.zip
MACVENTURE: Add game file manager
-rw-r--r--engines/macventure/detection.cpp10
-rw-r--r--engines/macventure/macventure.cpp6
-rw-r--r--engines/macventure/macventure.h16
3 files changed, 25 insertions, 7 deletions
diff --git a/engines/macventure/detection.cpp b/engines/macventure/detection.cpp
index ade07a0853..88fb85d650 100644
--- a/engines/macventure/detection.cpp
+++ b/engines/macventure/detection.cpp
@@ -27,7 +27,13 @@
#include "macventure/macventure.h"
-#include "macventure.h"
+namespace MacVenture {
+
+ const char *MacVentureEngine::getGameFileName() const {
+ return _gameDescription->filesDescriptions[0].fileName;
+ }
+
+}
namespace MacVenture {
@@ -68,6 +74,8 @@ bool MacVentureMetaEngine::createInstance(OSystem * syst, Engine ** engine, cons
}
+
+
} // End of namespace MacVenture
#if PLUGIN_ENABLED_DYNAMIC(MACVENTURE)
diff --git a/engines/macventure/macventure.cpp b/engines/macventure/macventure.cpp
index ef47d93f1a..3f576373e0 100644
--- a/engines/macventure/macventure.cpp
+++ b/engines/macventure/macventure.cpp
@@ -64,6 +64,10 @@ Common::Error MacVentureEngine::run() {
// Your main even loop should be (invoked from) here.
debug("MacVentureEngine::go: Hello, World!");
+ _resourceManager = new Common::MacResManager();
+ if (!_resourceManager->open(getGameFileName()))
+ error("Could not open %s as a resource fork", getGameFileName());
+
_shouldQuit = false;
while (!_shouldQuit) {
processEvents();
@@ -90,4 +94,6 @@ void MacVentureEngine::processEvents() {
}
}
}
+
+
} // End of namespace MacVenture
diff --git a/engines/macventure/macventure.h b/engines/macventure/macventure.h
index 5f655b9e59..9be560c46e 100644
--- a/engines/macventure/macventure.h
+++ b/engines/macventure/macventure.h
@@ -23,14 +23,11 @@
#ifndef MACVENTURE_H
#define MACVENTURE_H
+#include "engines/engine.h"
#include "common/debug.h"
#include "common/random.h"
+#include "common/macresman.h"
-#include "engines/engine.h"
-
-#include "graphics/managed_surface.h"
-#include "graphics/macgui/macwindowmanager.h"
-
#include "gui/debugger.h"
#include "macventure/gui.h"
@@ -64,15 +61,22 @@ public:
private:
void processEvents();
-private:
+private: // Attributes
+
const ADGameDescription *_gameDescription;
Common::RandomSource *_rnd;
+
+ Common::MacResManager *_resourceManager;
Console *_debugger;
Gui *_gui;
bool _shouldQuit;
+
+private: // Methods
+
+ const char* getGameFileName() const;
};