diff options
author | Max Horn | 2009-06-04 21:44:39 +0000 |
---|---|---|
committer | Max Horn | 2009-06-04 21:44:39 +0000 |
commit | 10c54394bd2f97a6a59a4fc1aedfcad09c40f1dc (patch) | |
tree | 06064a5a492015e1f79f3a3b8d2129c39346aa1f /engines/sci/sci.cpp | |
parent | 870db34cd1e435891e02f54c1c0dc013f257135d (diff) | |
download | scummvm-rg350-10c54394bd2f97a6a59a4fc1aedfcad09c40f1dc.tar.gz scummvm-rg350-10c54394bd2f97a6a59a4fc1aedfcad09c40f1dc.tar.bz2 scummvm-rg350-10c54394bd2f97a6a59a4fc1aedfcad09c40f1dc.zip |
SCI: Renamed EngineState::flags and version to _flags and _version (following our conventions); also slightly changed the EngineState constructor to init _version & _flags, and used this to make them constant
svn-id: r41177
Diffstat (limited to 'engines/sci/sci.cpp')
-rw-r--r-- | engines/sci/sci.cpp | 36 |
1 files changed, 16 insertions, 20 deletions
diff --git a/engines/sci/sci.cpp b/engines/sci/sci.cpp index eb75beab8f..8083ddad73 100644 --- a/engines/sci/sci.cpp +++ b/engines/sci/sci.cpp @@ -124,11 +124,10 @@ Common::Error SciEngine::run() { // FIXME/TODO: Move some of the stuff below to init() - sci_version_t version; + const sci_version_t version = getVersion(); + const uint32 flags = getFlags(); int res_version = getResourceVersion(); - version = getVersion(); - _resmgr = new ResourceManager(res_version, 256 * 1024); if (!_resmgr) { @@ -144,37 +143,34 @@ Common::Error SciEngine::run() { map_MIDI_instruments(_resmgr); #endif - _gamestate = new EngineState(); - _gamestate->resmgr = _resmgr; - _gamestate->gfx_state = NULL; - _gamestate->flags = getFlags(); + _gamestate = new EngineState(_resmgr, version, flags); // Verify that we haven't got an invalid game detection entry if (version < SCI_VERSION_1_EARLY) { // SCI0/SCI01 - if (_gamestate->flags & GF_SCI1_EGA || - _gamestate->flags & GF_SCI1_LOFSABSOLUTE || - _gamestate->flags & GF_SCI1_NEWDOSOUND) { + if (flags & GF_SCI1_EGA || + flags & GF_SCI1_LOFSABSOLUTE || + flags & GF_SCI1_NEWDOSOUND) { error("This game entry is erroneous. It's marked as SCI0/SCI01, but it has SCI1 flags set"); } } else if (version >= SCI_VERSION_1_EARLY && version <= SCI_VERSION_1_LATE) { // SCI1 - if (_gamestate->flags & GF_SCI0_OLD || - _gamestate->flags & GF_SCI0_OLDGFXFUNCS || - _gamestate->flags & GF_SCI0_OLDGETTIME) { + if (flags & GF_SCI0_OLD || + flags & GF_SCI0_OLDGFXFUNCS || + flags & GF_SCI0_OLDGETTIME) { error("This game entry is erroneous. It's marked as SCI1, but it has SCI0 flags set"); } } else if (version == SCI_VERSION_1_1 || version == SCI_VERSION_32) { - if (_gamestate->flags & GF_SCI1_EGA || - _gamestate->flags & GF_SCI1_LOFSABSOLUTE || - _gamestate->flags & GF_SCI1_NEWDOSOUND) { + if (flags & GF_SCI1_EGA || + flags & GF_SCI1_LOFSABSOLUTE || + flags & GF_SCI1_NEWDOSOUND) { error("This game entry is erroneous. It's marked as SCI1.1/SCI32, but it has SCI1 flags set"); } - if (_gamestate->flags & GF_SCI0_OLD || - _gamestate->flags & GF_SCI0_OLDGFXFUNCS || - _gamestate->flags & GF_SCI0_OLDGETTIME) { + if (flags & GF_SCI0_OLD || + flags & GF_SCI0_OLDGFXFUNCS || + flags & GF_SCI0_OLDGETTIME) { error("This game entry is erroneous. It's marked as SCI1.1/SCI32, but it has SCI0 flags set"); } @@ -183,7 +179,7 @@ Common::Error SciEngine::run() { error ("Unknown SCI version in game entry"); } - if (script_init_engine(_gamestate, version)) + if (script_init_engine(_gamestate)) return Common::kUnknownError; |