diff options
Diffstat (limited to 'engines')
-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 |