diff options
-rw-r--r-- | engines/zvision/actions.cpp | 33 | ||||
-rw-r--r-- | engines/zvision/actions.h | 12 |
2 files changed, 43 insertions, 2 deletions
diff --git a/engines/zvision/actions.cpp b/engines/zvision/actions.cpp index affa8f5a9c..16499138c7 100644 --- a/engines/zvision/actions.cpp +++ b/engines/zvision/actions.cpp @@ -267,6 +267,36 @@ bool ActionRandom::execute(ZVision *engine) { ////////////////////////////////////////////////////////////////////////////// +// ActionSetPartialScreen +////////////////////////////////////////////////////////////////////////////// + +ActionSetPartialScreen::ActionSetPartialScreen(const Common::String &line) { + char fileName[25]; + uint color; + + sscanf(line.c_str(), "%*[^(](%u %u %25s %*u %u)", &_x, &_y, fileName, &color); + + _fileName = Common::String(fileName); + + if (color > 0xFFFF) { + warning("Background color for ActionSetPartialScreen is bigger than a uint16"); + } + _backgroundColor = color; +} + +bool ActionSetPartialScreen::execute(ZVision *engine) { + RenderManager *renderManager = engine->getRenderManager(); + + if (_backgroundColor > 0) { + renderManager->clearWorkingWindowToColor(_backgroundColor); + } + renderManager->renderImageToScreen(_fileName, _x, _y); + + return true; +} + + +////////////////////////////////////////////////////////////////////////////// // ActionSetScreen ////////////////////////////////////////////////////////////////////////////// @@ -278,8 +308,7 @@ ActionSetScreen::ActionSetScreen(const Common::String &line) { } bool ActionSetScreen::execute(ZVision *engine) { - RenderManager *renderManager = engine->getRenderManager(); - renderManager->setBackgroundImage(_fileName); + engine->getRenderManager()->setBackgroundImage(_fileName); return true; } diff --git a/engines/zvision/actions.h b/engines/zvision/actions.h index 1d87b8025c..5e7c2c63e3 100644 --- a/engines/zvision/actions.h +++ b/engines/zvision/actions.h @@ -277,6 +277,18 @@ private: uint _max; }; +class ActionSetPartialScreen : public ResultAction { +public: + ActionSetPartialScreen(const Common::String &line); + bool execute(ZVision *engine); + +private: + uint _x; + uint _y; + Common::String _fileName; + uint16 _backgroundColor; +}; + class ActionSetScreen : public ResultAction { public: ActionSetScreen(const Common::String &line); |