aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--engines/zvision/actions.cpp6
-rw-r--r--engines/zvision/actions.h2
-rw-r--r--engines/zvision/scr_file_handling.cpp2
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)) {