diff options
| author | richiesams | 2013-08-03 15:00:58 -0500 | 
|---|---|---|
| committer | richiesams | 2013-08-04 13:33:10 -0500 | 
| commit | 32b3363acddcc25fb2380fbb66df829832d5200d (patch) | |
| tree | a07636be3c8b5d9b8a26f3542bbbbdc113020cdc | |
| parent | 8bbc260b8642d08c049acb81546e82bc88100ee2 (diff) | |
| download | scummvm-rg350-32b3363acddcc25fb2380fbb66df829832d5200d.tar.gz scummvm-rg350-32b3363acddcc25fb2380fbb66df829832d5200d.tar.bz2 scummvm-rg350-32b3363acddcc25fb2380fbb66df829832d5200d.zip  | |
ZVISION: Add ActionSetScreen
| -rw-r--r-- | engines/zvision/actions.cpp | 24 | ||||
| -rw-r--r-- | engines/zvision/actions.h | 9 | ||||
| -rw-r--r-- | engines/zvision/scr_file_handling.cpp | 3 | 
3 files changed, 31 insertions, 5 deletions
diff --git a/engines/zvision/actions.cpp b/engines/zvision/actions.cpp index a1ea96707b..9a8dee0e32 100644 --- a/engines/zvision/actions.cpp +++ b/engines/zvision/actions.cpp @@ -25,6 +25,7 @@  #include "zvision/actions.h"  #include "zvision/zvision.h"  #include "zvision/script_manager.h" +#include "zvision/render_manager.h"  #include "zvision/action_node.h"  namespace ZVision { @@ -157,17 +158,34 @@ bool ActionRandom::execute(ZVision *engine) {  ////////////////////////////////////////////////////////////////////////////// -// ActionTimer +// ActionSetScreen  ////////////////////////////////////////////////////////////////////////////// -ActionTimer::ActionTimer(const Common::String &line) { +ActionSetScreen::ActionSetScreen(const Common::String &line) { +	char fileName[25]; +	sscanf(line.c_str(), "%*[^(](%25[^)])", fileName); + +	_fileName = Common::String(fileName);  } +bool ActionSetScreen::execute(ZVision *engine) { +	RenderManager *renderManager = engine->getRenderManager(); +	renderManager->setBackgroundImage(_fileName); + +	return true; +} + + +////////////////////////////////////////////////////////////////////////////// +// ActionTimer +////////////////////////////////////////////////////////////////////////////// + +ActionTimer::ActionTimer(const Common::String &line) {  	sscanf(line.c_str(), "%*[^:]:%*[^:]:%u(%u)", &_key, &_time);  }  bool ActionTimer::execute(ZVision *engine) { -	engine->getScriptManager()->addActionNode(new NodeTimer(_key, _time)); +	engine->getScriptManager()->addActionNode(Common::SharedPtr<ActionNode>(new NodeTimer(_key, _time)));  	return true;  } diff --git a/engines/zvision/actions.h b/engines/zvision/actions.h index 7ee51ad279..3922f92b44 100644 --- a/engines/zvision/actions.h +++ b/engines/zvision/actions.h @@ -186,6 +186,15 @@ private:  	uint _max;  }; +class ActionSetScreen : public ResultAction { +public: +	ActionSetScreen(const Common::String &line); +	bool execute(ZVision *engine); + +private: +	Common::String _fileName; +}; +  class ActionTimer : public ResultAction {  public:  	ActionTimer(const Common::String &line); diff --git a/engines/zvision/scr_file_handling.cpp b/engines/zvision/scr_file_handling.cpp index 8c8c6c488a..1dc8ee5d4e 100644 --- a/engines/zvision/scr_file_handling.cpp +++ b/engines/zvision/scr_file_handling.cpp @@ -233,8 +233,7 @@ void ScriptManager::parseResults(Common::SeekableReadStream &stream, Common::Lis  		} else if (line.matchString("*:set_screen*", true)) { -			 - +			actionList.push_back(Common::SharedPtr<ResultAction>(new ActionSetScreen(line)));  		} else if (line.matchString("*:set_venus*", true)) {  | 
