aboutsummaryrefslogtreecommitdiff
path: root/engines/sci/sci.cpp
diff options
context:
space:
mode:
authorMax Horn2010-06-15 12:15:52 +0000
committerMax Horn2010-06-15 12:15:52 +0000
commit824dd44ddfc7ca70aafcb4182b3afc58fa480528 (patch)
tree95c101e1b987c3f442be807782b75d05334bb148 /engines/sci/sci.cpp
parent713e61acba05c49ec4bc896fa2e873c3265000a7 (diff)
downloadscummvm-rg350-824dd44ddfc7ca70aafcb4182b3afc58fa480528.tar.gz
scummvm-rg350-824dd44ddfc7ca70aafcb4182b3afc58fa480528.tar.bz2
scummvm-rg350-824dd44ddfc7ca70aafcb4182b3afc58fa480528.zip
SCI: Revise how ResourceManager is instantiated.
This should allow for better error handling. Also, it means that g_sci->getResMan() returns a valid value much sooner, allowing me to simplify some code. Also added a note about potentially replacing Common::FSList usage by Common::Archive (and FSNode by Archive/ArchiveMember ?). This might be a way to unify the addAppropriateSources variants again. svn-id: r49825
Diffstat (limited to 'engines/sci/sci.cpp')
-rw-r--r--engines/sci/sci.cpp21
1 files changed, 17 insertions, 4 deletions
diff --git a/engines/sci/sci.cpp b/engines/sci/sci.cpp
index e8847f380b..2680da9d39 100644
--- a/engines/sci/sci.cpp
+++ b/engines/sci/sci.cpp
@@ -66,11 +66,20 @@ class GfxDriver;
SciEngine::SciEngine(OSystem *syst, const ADGameDescription *desc)
: Engine(syst), _gameDescription(desc), _system(syst) {
- _console = NULL;
assert(g_sci == 0);
g_sci = this;
+
+ _gfxMacIconBar = 0;
+
+ _audio = 0;
_features = 0;
+ _resMan = 0;
+ _gamestate = 0;
+ _kernel = 0;
+ _vocabulary = 0;
+ _eventMan = 0;
+ _console = 0;
// Set up the engine specific debug levels
DebugMan.addDebugChannel(kDebugLevelError, "Error", "Script error debugging");
@@ -98,9 +107,6 @@ SciEngine::SciEngine(OSystem *syst, const ADGameDescription *desc)
DebugMan.addDebugChannel(kDebugLevelResMan, "ResMan", "Resource manager debugging");
DebugMan.addDebugChannel(kDebugLevelOnStartup, "OnStartup", "Enter debugger at start of game");
- _gamestate = 0;
- _gfxMacIconBar = 0;
-
const Common::FSNode gameDataDir(ConfMan.get("path"));
SearchMan.addSubDirectoryMatching(gameDataDir, "actors"); // KQ6 hi-res portraits
@@ -138,11 +144,18 @@ Common::Error SciEngine::run() {
ConfMan.registerDefault("enable_fb01", "false");
_resMan = new ResourceManager();
+ assert(_resMan);
+ _resMan->addAppropriateSources();
+ _resMan->init();
+ // TODO: Add error handling. Check return values of addAppropriateSources
+ // and init. We first have to *add* sensible return values, though ;).
+/*
if (!_resMan) {
warning("No resources found, aborting");
return Common::kNoGameDataFoundError;
}
+*/
// Add the after market GM patches for the specified game, if they exist
_resMan->addNewGMPatch(getGameID());