aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarisa-Chan2013-10-29 19:41:38 +0000
committerMarisa-Chan2013-10-29 19:41:38 +0000
commit41088f5516ba9566dcd558a103216c3798bcf9d4 (patch)
treeb985a15c3be75eb0c6a10513d415482557264722
parent66c9d1d0fd8c9df57bcf986dd124c879eae2f35d (diff)
downloadscummvm-rg350-41088f5516ba9566dcd558a103216c3798bcf9d4.tar.gz
scummvm-rg350-41088f5516ba9566dcd558a103216c3798bcf9d4.tar.bz2
scummvm-rg350-41088f5516ba9566dcd558a103216c3798bcf9d4.zip
ZVISION: Make setPartialScreen use mask color correctly.
-rw-r--r--engines/zvision/actions.cpp15
1 files changed, 11 insertions, 4 deletions
diff --git a/engines/zvision/actions.cpp b/engines/zvision/actions.cpp
index 68c279754d..8340c02428 100644
--- a/engines/zvision/actions.cpp
+++ b/engines/zvision/actions.cpp
@@ -313,16 +313,23 @@ bool ActionRandom::execute() {
ActionSetPartialScreen::ActionSetPartialScreen(ZVision *engine, const Common::String &line) :
ResultAction(engine) {
char fileName[25];
- uint color;
+ int color;
- sscanf(line.c_str(), "%*[^(](%u %u %25s %*u %u)", &_x, &_y, fileName, &color);
+ sscanf(line.c_str(), "%*[^(](%u %u %25s %*u %d)", &_x, &_y, fileName, &color);
_fileName = Common::String(fileName);
- if (color > 0xFFFF) {
+ if (color >= 0) {
+ byte r, g, b;
+ Graphics::PixelFormat(2, 5, 5, 5, 0, 10, 5, 0, 0).colorToRGB(color, r, g, b);
+ _backgroundColor = _engine->_pixelFormat.RGBToColor(r, g, b);
+ } else {
+ _backgroundColor = color;
+ }
+
+ if (color > 65535) {
warning("Background color for ActionSetPartialScreen is bigger than a uint16");
}
- _backgroundColor = color;
}
bool ActionSetPartialScreen::execute() {