ZVISION: Remove some unused actions. Cleanup

This commit is contained in:
Filippos Karapetis 2014-12-26 12:04:21 +02:00
parent e4b2913e4a
commit 2350eca546
3 changed files with 13 additions and 72 deletions

View file

@ -242,23 +242,6 @@ bool ActionDisableControl::execute() {
return true;
}
//////////////////////////////////////////////////////////////////////////////
// ActionDisableVenus
//////////////////////////////////////////////////////////////////////////////
ActionDisableVenus::ActionDisableVenus(ZVision *engine, int32 slotkey, const Common::String &line) :
ResultAction(engine, slotkey) {
_key = 0;
sscanf(line.c_str(), "%d", &_key);
}
bool ActionDisableVenus::execute() {
_engine->getScriptManager()->setStateValue(_key, 0);
return true;
}
//////////////////////////////////////////////////////////////////////////////
// ActionDisplayMessage
//////////////////////////////////////////////////////////////////////////////
@ -295,7 +278,7 @@ bool ActionDissolve::execute() {
}
//////////////////////////////////////////////////////////////////////////////
// ActionDistort
// ActionDistort - only used by Zork: Nemesis for the "treatment" puzzle in the Sanitarium (aj30)
//////////////////////////////////////////////////////////////////////////////
ActionDistort::ActionDistort(ZVision *engine, int32 slotkey, const Common::String &line) :
@ -406,7 +389,7 @@ bool ActionInventory::execute() {
}
//////////////////////////////////////////////////////////////////////////////
// ActionKill
// ActionKill - only used by ZGI
//////////////////////////////////////////////////////////////////////////////
ActionKill::ActionKill(ZVision *engine, int32 slotkey, const Common::String &line) :
@ -735,13 +718,13 @@ bool ActionRegion::execute() {
if (_engine->getScriptManager()->getSideFX(_slotKey))
return true;
Effect *effct = NULL;
Effect *effect = NULL;
switch (_type) {
case 0: {
uint16 centerX, centerY, frames;
double amplitude, waveln, speed;
sscanf(_custom.c_str(), "%hu,%hu,%hu,%lf,%lf,%lf,", &centerX, &centerY, &frames, &amplitude, &waveln, &speed);
effct = new WaveFx(_engine, _slotKey, _rect, _unk1, frames, centerX, centerY, amplitude, waveln, speed);
effect = new WaveFx(_engine, _slotKey, _rect, _unk1, frames, centerX, centerY, amplitude, waveln, speed);
}
break;
case 1: {
@ -753,7 +736,7 @@ bool ActionRegion::execute() {
int8 minD;
int8 maxD;
EffectMap *_map = _engine->getRenderManager()->makeEffectMap(Common::Point(aX, aY), aD, _rect, &minD, &maxD);
effct = new LightFx(_engine, _slotKey, _rect, _unk1, _map, atoi(_custom.c_str()), minD, maxD);
effect = new LightFx(_engine, _slotKey, _rect, _unk1, _map, atoi(_custom.c_str()), minD, maxD);
}
break;
case 9: {
@ -769,16 +752,16 @@ bool ActionRegion::execute() {
_rect.setHeight(tempMask.h);
EffectMap *_map = _engine->getRenderManager()->makeEffectMap(tempMask, 0);
effct = new FogFx(_engine, _slotKey, _rect, _unk1, _map, Common::String(buf));
effect = new FogFx(_engine, _slotKey, _rect, _unk1, _map, Common::String(buf));
}
break;
default:
break;
}
if (effct) {
_engine->getScriptManager()->addSideFX(new RegionNode(_engine, _slotKey, effct, _delay));
_engine->getRenderManager()->addEffect(effct);
if (effect) {
_engine->getScriptManager()->addSideFX(new RegionNode(_engine, _slotKey, effect, _delay));
_engine->getRenderManager()->addEffect(effect);
}
return true;
@ -899,24 +882,6 @@ bool ActionSetScreen::execute() {
return true;
}
//////////////////////////////////////////////////////////////////////////////
// ActionSetVenus
//////////////////////////////////////////////////////////////////////////////
ActionSetVenus::ActionSetVenus(ZVision *engine, int32 slotkey, const Common::String &line) :
ResultAction(engine, slotkey) {
_key = 0;
sscanf(line.c_str(), "%d", &_key);
}
bool ActionSetVenus::execute() {
if (_engine->getScriptManager()->getStateValue(_key))
_engine->getScriptManager()->setStateValue(StateKey_Venus, _key);
return true;
}
//////////////////////////////////////////////////////////////////////////////
// ActionStop
//////////////////////////////////////////////////////////////////////////////

View file

@ -124,14 +124,6 @@ private:
uint8 _action;
};
class ActionDebug : public ResultAction {
public:
ActionDebug(ZVision *engine, int32 slotkey, const Common::String &line);
bool execute();
private:
};
class ActionDelayRender : public ResultAction {
public:
ActionDelayRender(ZVision *engine, int32 slotkey, const Common::String &line);
@ -150,15 +142,6 @@ private:
uint32 _key;
};
class ActionDisableVenus : public ResultAction {
public:
ActionDisableVenus(ZVision *engine, int32 slotkey, const Common::String &line);
bool execute();
private:
int32 _key;
};
class ActionDisplayMessage : public ResultAction {
public:
ActionDisplayMessage(ZVision *engine, int32 slotkey, const Common::String &line);
@ -397,15 +380,6 @@ private:
Common::String _fileName;
};
class ActionSetVenus : public ResultAction {
public:
ActionSetVenus(ZVision *engine, int32 slotkey, const Common::String &line);
bool execute();
private:
int32 _key;
};
class ActionStop : public ResultAction {
public:
ActionStop(ZVision *engine, int32 slotkey, const Common::String &line);

View file

@ -235,12 +235,13 @@ void ScriptManager::parseResults(Common::SeekableReadStream &stream, Common::Lis
} else if (act.matchString("disable_control", true)) {
actionList.push_back(new ActionDisableControl(_engine, slot, args));
} else if (act.matchString("disable_venus", true)) {
actionList.push_back(new ActionDisableVenus(_engine, slot, args));
// Not used. Purposely left empty
} else if (act.matchString("display_message", true)) {
actionList.push_back(new ActionDisplayMessage(_engine, slot, args));
} else if (act.matchString("dissolve", true)) {
actionList.push_back(new ActionDissolve(_engine));
} else if (act.matchString("distort", true)) {
// Only used by Zork: Nemesis for the "treatment" puzzle in the Sanitarium (aj30)
actionList.push_back(new ActionDistort(_engine, slot, args));
} else if (act.matchString("enable_control", true)) {
actionList.push_back(new ActionEnableControl(_engine, slot, args));
@ -249,6 +250,7 @@ void ScriptManager::parseResults(Common::SeekableReadStream &stream, Common::Lis
} else if (act.matchString("inventory", true)) {
actionList.push_back(new ActionInventory(_engine, slot, args));
} else if (act.matchString("kill", true)) {
// Only used by ZGI
actionList.push_back(new ActionKill(_engine, slot, args));
} else if (act.matchString("menu_bar_enable", true)) {
actionList.push_back(new ActionMenuBarEnable(_engine, slot, args));
@ -278,7 +280,7 @@ void ScriptManager::parseResults(Common::SeekableReadStream &stream, Common::Lis
} else if (act.matchString("set_screen", true)) {
actionList.push_back(new ActionSetScreen(_engine, slot, args));
} else if (act.matchString("set_venus", true)) {
actionList.push_back(new ActionSetVenus(_engine, slot, args));
// Not used. Purposely left empty
} else if (act.matchString("stop", true)) {
actionList.push_back(new ActionStop(_engine, slot, args));
} else if (act.matchString("streamvideo", true)) {