From 34fe545dc7f619a40cffa207b8660ecb0c027c1f Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Wed, 27 Apr 2011 21:23:47 +1000 Subject: TSAGE: Created stub classes for ASound and Sound, and reworked engine to use proper named methods --- engines/tsage/core.cpp | 46 ++++++++-------------------------------------- 1 file changed, 8 insertions(+), 38 deletions(-) (limited to 'engines/tsage/core.cpp') diff --git a/engines/tsage/core.cpp b/engines/tsage/core.cpp index e56cadb68a..36e2961aca 100644 --- a/engines/tsage/core.cpp +++ b/engines/tsage/core.cpp @@ -32,6 +32,7 @@ #include "tsage/scenes.h" #include "tsage/staticres.h" #include "tsage/globals.h" +#include "tsage/sound.h" namespace tSage { @@ -2911,53 +2912,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::synchronise(Serialiser &s) { + EventHandler::synchronise(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, ...) { -- cgit v1.2.3