ZVISION: Implement ActionSetPartialScreen

This commit is contained in:
richiesams 2013-08-19 23:43:02 -05:00
parent 7c02b66b2e
commit 683e24cd75
2 changed files with 43 additions and 2 deletions

View File

@ -266,6 +266,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;
}

View File

@ -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);