diff options
author | Eugene Sandulenko | 2010-01-09 01:42:28 +0200 |
---|---|---|
committer | Eugene Sandulenko | 2015-12-27 15:39:52 +0100 |
commit | 199bea21674003ddaffca28125e05d1351bc3712 (patch) | |
tree | 90d6b2cc23a9ec32d3de5cb5a0ce61472bdee890 /engines/wage | |
parent | 2caf2102220a0cdae65a42c794835d859a674596 (diff) | |
download | scummvm-rg350-199bea21674003ddaffca28125e05d1351bc3712.tar.gz scummvm-rg350-199bea21674003ddaffca28125e05d1351bc3712.tar.bz2 scummvm-rg350-199bea21674003ddaffca28125e05d1351bc3712.zip |
WAGE: Started scene loader implemenation
Signed-off-by: Eugene Sandulenko <sev@scummvm.org>
Diffstat (limited to 'engines/wage')
-rw-r--r-- | engines/wage/sound.cpp | 5 | ||||
-rw-r--r-- | engines/wage/sound.h | 7 | ||||
-rw-r--r-- | engines/wage/world.cpp | 14 | ||||
-rw-r--r-- | engines/wage/world.h | 48 |
4 files changed, 56 insertions, 18 deletions
diff --git a/engines/wage/sound.cpp b/engines/wage/sound.cpp index e9d67770a0..272aafcb32 100644 --- a/engines/wage/sound.cpp +++ b/engines/wage/sound.cpp @@ -28,10 +28,5 @@ namespace Wage { -Sound::Sound() { -} - -Sound::~Sound() { -} } // End of namespace Wage diff --git a/engines/wage/sound.h b/engines/wage/sound.h index 30c36f7c03..a0be0c7d0e 100644 --- a/engines/wage/sound.h +++ b/engines/wage/sound.h @@ -30,8 +30,11 @@ namespace Wage { class Sound { public: - Sound(); - ~Sound(); + Sound(byte *data) : _data(data) {} + ~Sound() { free(_data); } + + String _name; + byte *_data; }; } // End of namespace Wage diff --git a/engines/wage/world.cpp b/engines/wage/world.cpp index 6b56e782c7..d897d9e9af 100644 --- a/engines/wage/world.cpp +++ b/engines/wage/world.cpp @@ -35,8 +35,8 @@ namespace Wage { World::World() { _storageScene._name = STORAGESCENE; - _orderedScenes.push_back(_storageScene); - _scenes[STORAGESCENE] = _storageScene; + _orderedScenes.push_back(&_storageScene); + _scenes[STORAGESCENE] = &_storageScene; } bool World::loadWorld(MacResManager *resMan) { @@ -48,9 +48,11 @@ bool World::loadWorld(MacResManager *resMan) { if ((resArray = resMan->getResIDArray("GCOD")).size() == 0) return false; + // Load global script res = resMan->getResource("GCOD", resArray[0], &resSize); _globalScript = new Script(res); + // Load main configuration if ((resArray = resMan->getResIDArray("VERS")).size() == 0) return false; @@ -75,7 +77,13 @@ bool World::loadWorld(MacResManager *resMan) { _soundLibrary1 = readPascalString(readS); _soundLibrary2 = readPascalString(readS); - debug(0, "%s\n%s", _soundLibrary1.c_str(), _soundLibrary2.c_str()); + // Load scenes + resArray = resMan->getResIDArray("ASCN"); + + for (iter = resArray.begin(); iter != resArray.end(); ++iter) { + + } + return true; } diff --git a/engines/wage/world.h b/engines/wage/world.h index 18c32884ba..3a8d7edc15 100644 --- a/engines/wage/world.h +++ b/engines/wage/world.h @@ -50,18 +50,50 @@ public: bool _weaponMenuDisabled; Script *_globalScript; - Common::HashMap<String, Scene> _scenes; - Common::HashMap<String, Obj> _objs; - Common::HashMap<String, Chr> _chrs; - Common::HashMap<String, Sound> _sounds; - Common::List<Scene> _orderedScenes; - Common::List<Obj> _orderedObjs; - Common::List<Chr> _orderedChrs; - Common::List<Sound> _orderedSounds; + Common::HashMap<String, Scene *> _scenes; + Common::HashMap<String, Obj *> _objs; + Common::HashMap<String, Chr *> _chrs; + Common::HashMap<String, Sound *> _sounds; + Common::List<Scene *> _orderedScenes; + Common::List<Obj *> _orderedObjs; + Common::List<Chr *> _orderedChrs; + Common::List<Sound *> _orderedSounds; Common::List<byte *> _patterns; Scene _storageScene; Chr _player; //List<MoveListener> moveListeners; + + void addScene(Scene *room) { + if (room->_name.size() != 0) { + String s = room->_name; + s.toLowercase(); + _scenes[s] = room; + } + _orderedScenes.push_back(room); + } + + void addObj(Obj *obj) { + String s = obj->_name; + s.toLowercase(); + _objs[s] = obj; + obj->_index = _orderedObjs.size(); + _orderedObjs.push_back(obj); + } + + void addChr(Chr *chr) { + String s = chr->_name; + s.toLowercase(); + _chrs[s] = chr; + chr->_index = _orderedChrs.size(); + _orderedChrs.push_back(chr); + } + + void addSound(Sound *sound) { + String s = sound->_name; + s.toLowercase(); + _sounds[s] = sound; + _orderedSounds.push_back(sound); + } }; } // End of namespace Wage |