aboutsummaryrefslogtreecommitdiff
path: root/engines/tsage/globals.cpp
diff options
context:
space:
mode:
authorStrangerke2011-06-29 16:15:41 +0200
committerStrangerke2011-06-29 16:15:41 +0200
commitb0c9c9122fc678074aba30068e5b36d347208e65 (patch)
tree79a99db08ec985f2e5f1e216823b1104d5b753fb /engines/tsage/globals.cpp
parentf2f3124246a77036f843dee2d83ad28084234ebc (diff)
parentc32a3ea0d30336771bab460ecccb58c4614e6294 (diff)
downloadscummvm-rg350-b0c9c9122fc678074aba30068e5b36d347208e65.tar.gz
scummvm-rg350-b0c9c9122fc678074aba30068e5b36d347208e65.tar.bz2
scummvm-rg350-b0c9c9122fc678074aba30068e5b36d347208e65.zip
Merge branch 'master' of github.com:scummvm/scummvm into soltys_wip2
Diffstat (limited to 'engines/tsage/globals.cpp')
-rw-r--r--engines/tsage/globals.cpp19
1 files changed, 14 insertions, 5 deletions
diff --git a/engines/tsage/globals.cpp b/engines/tsage/globals.cpp
index 863f1458b1..34b26ec311 100644
--- a/engines/tsage/globals.cpp
+++ b/engines/tsage/globals.cpp
@@ -94,8 +94,8 @@ Globals::Globals() : _dialogCenter(160, 140), _gfxManagerInstance(_screenSurface
_sceneObjects_queue.push_front(_sceneObjects);
_prevSceneOffset = Common::Point(-1, -1);
- _sceneListeners.push_back(&_soundHandler);
- _sceneListeners.push_back(&_sequenceManager._soundHandler);
+ _sounds.push_back(&_soundHandler);
+ _sounds.push_back(&_sequenceManager._soundHandler);
_scrollFollower = NULL;
_inventory = NULL;
@@ -117,9 +117,9 @@ Globals::Globals() : _dialogCenter(160, 140), _gfxManagerInstance(_screenSurface
}
Globals::~Globals() {
- _globals = NULL;
delete _inventory;
delete _game;
+ _globals = NULL;
}
void Globals::reset() {
@@ -140,7 +140,7 @@ void Globals::synchronize(Serializer &s) {
s.syncAsSint32LE(_gfxColors.foreground);
s.syncAsSint32LE(_fontColors.background);
s.syncAsSint32LE(_fontColors.foreground);
-
+
if (s.getVersion() >= 4) {
s.syncAsByte(_unkColor1);
s.syncAsByte(_unkColor2);
@@ -148,7 +148,7 @@ void Globals::synchronize(Serializer &s) {
}
s.syncAsSint16LE(_dialogCenter.x); s.syncAsSint16LE(_dialogCenter.y);
- _sceneListeners.synchronize(s);
+ _sounds.synchronize(s);
for (int i = 0; i < 256; ++i)
s.syncAsByte(_flags[i]);
@@ -158,4 +158,13 @@ void Globals::synchronize(Serializer &s) {
s.syncAsSint32LE(_stripNum);
}
+void Globals::dispatchSound(ASound *obj) {
+ obj->dispatch();
+}
+
+void Globals::dispatchSounds() {
+ Common::for_each(_sounds.begin(), _sounds.end(), Globals::dispatchSound);
+}
+
+
} // end of namespace tSage