mirror of
https://github.com/libretro/scummvm.git
synced 2025-02-03 09:23:37 +00:00
DIRECTOR: Standardize channel colour access
This commit is contained in:
parent
ed36fd4a37
commit
e3cf71185d
@ -245,4 +245,34 @@ MacShape *Channel::getShape() {
|
||||
return shape;
|
||||
}
|
||||
|
||||
uint Channel::getBackColor() {
|
||||
if (!_sprite->_cast)
|
||||
return _sprite->_backColor;
|
||||
|
||||
switch (_sprite->_cast->_type) {
|
||||
case kCastText:
|
||||
case kCastButton:
|
||||
case kCastShape: {
|
||||
return _sprite->_cast->getBackColor();
|
||||
}
|
||||
default:
|
||||
return _sprite->_backColor;
|
||||
}
|
||||
}
|
||||
|
||||
uint Channel::getForeColor() {
|
||||
if (!_sprite->_cast)
|
||||
return _sprite->_foreColor;
|
||||
|
||||
switch (_sprite->_cast->_type) {
|
||||
case kCastText:
|
||||
case kCastButton:
|
||||
case kCastShape: {
|
||||
return _sprite->_cast->getForeColor();
|
||||
}
|
||||
default:
|
||||
return _sprite->_foreColor;
|
||||
}
|
||||
}
|
||||
|
||||
} // End of namespace Director
|
||||
|
@ -57,6 +57,8 @@ struct Channel {
|
||||
Common::Rect getBbox();
|
||||
Common::Point getPosition();
|
||||
MacShape *getShape();
|
||||
uint getForeColor();
|
||||
uint getBackColor();
|
||||
Graphics::ManagedSurface *getSurface();
|
||||
const Graphics::Surface *getMask(bool forceMatte = false);
|
||||
|
||||
|
@ -189,7 +189,7 @@ void Stage::inkBlitFrom(Channel *channel, Common::Rect destRect, Graphics::Manag
|
||||
destRect.clip(srcRect);
|
||||
|
||||
MacShape *ms = channel->getShape();
|
||||
DirectorPlotData pd(_wm, channel->getSurface(), blitTo, destRect, channel->_sprite->_ink, channel->_sprite->_backColor, channel->_sprite->_foreColor, g_director->getPaletteColorCount());
|
||||
DirectorPlotData pd(_wm, channel->getSurface(), blitTo, destRect, channel->_sprite->_ink, channel->getBackColor(), channel->getForeColor(), g_director->getPaletteColorCount());
|
||||
|
||||
if (ms) {
|
||||
inkBlitShape(&pd, srcRect, ms);
|
||||
|
Loading…
x
Reference in New Issue
Block a user