aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorrichiesams2013-08-19 23:43:02 -0500
committerrichiesams2013-08-20 11:41:35 -0500
commit683e24cd75e629061a7f5d0733b29daf10bba2ec (patch)
tree216fb8b2883ea573a6d4a1d45ed4a41c4e7d4af9 /engines
parent7c02b66b2e556816c70b75e69e53ba1fb3d1b895 (diff)
downloadscummvm-rg350-683e24cd75e629061a7f5d0733b29daf10bba2ec.tar.gz
scummvm-rg350-683e24cd75e629061a7f5d0733b29daf10bba2ec.tar.bz2
scummvm-rg350-683e24cd75e629061a7f5d0733b29daf10bba2ec.zip
ZVISION: Implement ActionSetPartialScreen
Diffstat (limited to 'engines')
-rw-r--r--engines/zvision/actions.cpp33
-rw-r--r--engines/zvision/actions.h12
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);