Skip to content

Commit

Permalink
ZVISION: Make setPartialScreen use mask color correctly.
Browse files Browse the repository at this point in the history
  • Loading branch information
Marisa-Chan committed Oct 29, 2013
1 parent 66c9d1d commit 41088f5
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions engines/zvision/actions.cpp
Expand Up @@ -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() {
Expand Down

0 comments on commit 41088f5

Please sign in to comment.