diff options
author | Marisa-Chan | 2014-01-17 11:07:58 +0700 |
---|---|---|
committer | Marisa-Chan | 2014-01-17 11:07:58 +0700 |
commit | d973b1fb1bde603b3b2436a58afcf043b178c407 (patch) | |
tree | 8fca8292f0aca3c2426995847ab176816a91edb7 /engines | |
parent | 41415002b223e5ae0e53fb351ee41d8a99fbc920 (diff) | |
download | scummvm-rg350-d973b1fb1bde603b3b2436a58afcf043b178c407.tar.gz scummvm-rg350-d973b1fb1bde603b3b2436a58afcf043b178c407.tar.bz2 scummvm-rg350-d973b1fb1bde603b3b2436a58afcf043b178c407.zip |
ZVISION: Implement attenuate code.
Diffstat (limited to 'engines')
-rw-r--r-- | engines/zvision/actions.cpp | 6 | ||||
-rw-r--r-- | engines/zvision/actions.h | 2 | ||||
-rw-r--r-- | engines/zvision/scr_file_handling.cpp | 2 |
3 files changed, 7 insertions, 3 deletions
diff --git a/engines/zvision/actions.cpp b/engines/zvision/actions.cpp index 3eec70d1ba..92d6f6c389 100644 --- a/engines/zvision/actions.cpp +++ b/engines/zvision/actions.cpp @@ -88,7 +88,11 @@ ActionAttenuate::ActionAttenuate(ZVision *engine, int32 slotkey, const Common::S } bool ActionAttenuate::execute() { - // TODO: Implement + SideFX *fx = _engine->getScriptManager()->getSideFX(_key); + if (fx && fx->getType() == SideFX::SIDEFX_AUDIO) { + MusicNode *mus = (MusicNode *)fx; + mus->setVolume(255 - (abs(_attenuation) >> 7)); + } return true; } diff --git a/engines/zvision/actions.h b/engines/zvision/actions.h index 417c1ada1a..b204fbeb28 100644 --- a/engines/zvision/actions.h +++ b/engines/zvision/actions.h @@ -116,7 +116,7 @@ public: private: uint32 _key; - int _attenuation; + int32 _attenuation; }; class ActionChangeLocation : public ResultAction { diff --git a/engines/zvision/scr_file_handling.cpp b/engines/zvision/scr_file_handling.cpp index 83f25a8954..002871af0b 100644 --- a/engines/zvision/scr_file_handling.cpp +++ b/engines/zvision/scr_file_handling.cpp @@ -214,7 +214,7 @@ void ScriptManager::parseResults(Common::SeekableReadStream &stream, Common::Lis } else if (act.matchString("animunload", true)) { //actionList.push_back(new ActionUnloadAnimation(_engine, slot, args)); } else if (act.matchString("attenuate", true)) { - // TODO: Implement ActionAttenuate + actionList.push_back(new ActionAttenuate(_engine, slot, args)); } else if (act.matchString("assign", true)) { actionList.push_back(new ActionAssign(_engine, slot, args)); } else if (act.matchString("change_location", true)) { |