aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorEugene Sandulenko2019-12-25 00:58:16 +0100
committerEugene Sandulenko2019-12-25 01:00:02 +0100
commite5f3febb1a581b537ca0ee69b534ecd16ad18e0d (patch)
tree2be1a868ca0c2a6d09fd52d70d4a1c75ade30f67 /engines
parentc898b7eaaec4415a5c2793f269c40f54f10df807 (diff)
downloadscummvm-rg350-e5f3febb1a581b537ca0ee69b534ecd16ad18e0d.tar.gz
scummvm-rg350-e5f3febb1a581b537ca0ee69b534ecd16ad18e0d.tar.bz2
scummvm-rg350-e5f3febb1a581b537ca0ee69b534ecd16ad18e0d.zip
DIRECTOR: Read color information for shapes
Diffstat (limited to 'engines')
-rw-r--r--engines/director/cast.cpp2
-rw-r--r--engines/director/frame.cpp13
2 files changed, 8 insertions, 7 deletions
diff --git a/engines/director/cast.cpp b/engines/director/cast.cpp
index f47fa37ad0..238b2a53a0 100644
--- a/engines/director/cast.cpp
+++ b/engines/director/cast.cpp
@@ -257,7 +257,7 @@ ShapeCast::ShapeCast(Common::ReadStreamEndian &stream, uint16 version) {
_shapeType = static_cast<ShapeType>(stream.readByte());
_initialRect = Score::readRect(stream);
_pattern = stream.readUint16BE();
- _fgCol = stream.readByte();
+ _fgCol = (stream.readByte() + 128) & 0xff; // -128 -> 0, 127 -> 256
_bgCol = stream.readByte();
_fillType = stream.readByte();
_lineThickness = stream.readByte();
diff --git a/engines/director/frame.cpp b/engines/director/frame.cpp
index 1a3d66e71d..79f3b0b8c1 100644
--- a/engines/director/frame.cpp
+++ b/engines/director/frame.cpp
@@ -197,7 +197,8 @@ void Frame::readChannels(Common::ReadStreamEndian *stream) {
sprite._scriptId = stream->readByte();
sprite._spriteType = stream->readByte();
sprite._enabled = sprite._spriteType != 0;
- sprite._x2 = stream->readUint16();
+ sprite._foreColor = stream->readByte();
+ sprite._backColor = stream->readByte();
sprite._flags = stream->readUint16();
sprite._ink = static_cast<InkType>(sprite._flags & 0x3f);
@@ -651,9 +652,9 @@ void Frame::addDrawRect(uint16 spriteId, Common::Rect &rect) {
void Frame::renderShape(Graphics::ManagedSurface &surface, uint16 spriteId) {
Sprite *sp = _sprites[spriteId];
- if (sp->_shapeCast == NULL) {
- warning("Frame::renderShape(): missing shapecast in sprite id: %d", spriteId);
- return;
+ if (sp->_shapeCast != NULL) {
+ sp->_foreColor = sp->_shapeCast->_fgCol;
+ sp->_backColor = sp->_shapeCast->_bgCol;
}
Common::Rect shapeRect = Common::Rect(sp->_startPoint.x,
@@ -670,9 +671,9 @@ void Frame::renderShape(Graphics::ManagedSurface &surface, uint16 spriteId) {
sp->_ink = kInkTypeReverse;
} else {
// No minus one on the pattern here! MacPlotData will do that for us!
- Graphics::MacPlotData pd(&tmpSurface, &_vm->getPatterns(), sp->_castId, 1, sp->_shapeCast->_bgCol);
+ Graphics::MacPlotData pd(&tmpSurface, &_vm->getPatterns(), sp->_castId, 1, sp->_backColor);
Common::Rect fillRect(shapeRect.width(), shapeRect.height());
- Graphics::drawFilledRect(fillRect, sp->_shapeCast->_fgCol, Graphics::macDrawPixel, &pd);
+ Graphics::drawFilledRect(fillRect, sp->_foreColor, Graphics::macDrawPixel, &pd);
}
if (sp->_lineSize > 0) {