mirror of
https://github.com/libretro/scummvm.git
synced 2025-03-06 10:17:14 +00:00
ZVISION: Implement ActionSetPartialScreen
This commit is contained in:
parent
7c02b66b2e
commit
683e24cd75
@ -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;
|
||||
}
|
||||
|
@ -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);
|
||||
|
Loading…
x
Reference in New Issue
Block a user