aboutsummaryrefslogtreecommitdiff
path: root/engines/tsage/core.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'engines/tsage/core.cpp')
-rw-r--r--engines/tsage/core.cpp46
1 files changed, 8 insertions, 38 deletions
diff --git a/engines/tsage/core.cpp b/engines/tsage/core.cpp
index 7534abdec7..4cbe70f0e3 100644
--- a/engines/tsage/core.cpp
+++ b/engines/tsage/core.cpp
@@ -30,6 +30,7 @@
#include "tsage/scenes.h"
#include "tsage/staticres.h"
#include "tsage/globals.h"
+#include "tsage/sound.h"
namespace tSage {
@@ -2944,53 +2945,22 @@ int SceneRegions::indexOf(const Common::Point &pt) {
/*--------------------------------------------------------------------------*/
-SoundHandler::SoundHandler() {
+ASound::ASound() {
_action = NULL;
_field280 = -1;
- if (_globals)
- _globals->_sceneListeners.push_back(this);
-}
-
-SoundHandler::~SoundHandler() {
- if (_globals)
- _globals->_sceneListeners.remove(this);
}
-void SoundHandler::dispatch() {
- EventHandler::dispatch();
- int v = _sound.proc12();
-
- if (v != -1) {
- _field280 = v;
- _sound.proc2(-1);
-
- if (_action)
- _action->signal();
- }
+void ASound::synchronize(Serializer &s) {
+ EventHandler::synchronize(s);
- if (_field280 != -1) {
- // FIXME: Hardcoded to only flag a sound ended if an action has been set
- if (_action) {
-// if (!_sound.proc3()) {
- _field280 = -1;
- if (_action) {
- _action->signal();
- _action = NULL;
- }
- }
- }
+ SYNC_POINTER(_action);
+ s.syncAsSint16LE(_field280);
}
-void SoundHandler::startSound(int soundNum, Action *action, int volume) {
- _action = action;
- _field280 = 0;
- setVolume(volume);
- _sound.startSound(soundNum);
-
- warning("TODO: SoundHandler::startSound");
+void ASound::dispatch() {
+
}
-
/*--------------------------------------------------------------------------*/
void SceneItemList::addItems(SceneItem *first, ...) {