ZVISION: Implement action:animunload

This commit is contained in:
Marisa-Chan 2014-11-08 12:21:38 +06:00
parent 0efa1bc560
commit 53002dd2d0
3 changed files with 22 additions and 1 deletions

View File

@ -440,6 +440,25 @@ bool ActionPreloadAnimation::execute() {
return true;
}
//////////////////////////////////////////////////////////////////////////////
// ActionUnloadAnimation
//////////////////////////////////////////////////////////////////////////////
ActionUnloadAnimation::ActionUnloadAnimation(ZVision *engine, int32 slotkey, const Common::String &line) :
ResultAction(engine, slotkey) {
sscanf(line.c_str(), "%u", &_key);
}
bool ActionUnloadAnimation::execute() {
AnimationNode *nod = (AnimationNode *)_engine->getScriptManager()->getSideFX(_key);
if (nod && nod->getType() == SideFX::SIDEFX_ANIM)
_engine->getScriptManager()->deleteSideFx(_key);
return true;
}
//////////////////////////////////////////////////////////////////////////////
// ActionPlayAnimation

View File

@ -347,6 +347,8 @@ class ActionUnloadAnimation : public ResultAction {
public:
ActionUnloadAnimation(ZVision *engine, int32 slotkey, const Common::String &line);
bool execute();
private:
uint32 _key;
};
class ActionRandom : public ResultAction {

View File

@ -220,7 +220,7 @@ void ScriptManager::parseResults(Common::SeekableReadStream &stream, Common::Lis
} else if (act.matchString("animpreload", true)) {
actionList.push_back(new ActionPreloadAnimation(_engine, slot, args));
} else if (act.matchString("animunload", true)) {
//actionList.push_back(new ActionUnloadAnimation(_engine, slot, args));
actionList.push_back(new ActionUnloadAnimation(_engine, slot, args));
} else if (act.matchString("attenuate", true)) {
actionList.push_back(new ActionAttenuate(_engine, slot, args));
} else if (act.matchString("assign", true)) {