MACVENTURE: Add game file manager

This commit is contained in:
Borja Lorente 2016-06-08 11:17:56 +02:00
parent f095c4a958
commit d15e3a03c7
3 changed files with 25 additions and 7 deletions

View File

@ -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)

View File

@ -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

View File

@ -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;
};