diff options
author | Eugene Sandulenko | 2019-12-27 13:33:26 +0100 |
---|---|---|
committer | Eugene Sandulenko | 2019-12-27 13:39:56 +0100 |
commit | 936fe120863a51240407625f63c238a9bce3f132 (patch) | |
tree | 020e144bfc75bad3b5c2271e5cf7273e65dbd1bc /engines/director | |
parent | a9f8af5400bd66b033711f2d1f751d2e9d2b44bc (diff) | |
download | scummvm-rg350-936fe120863a51240407625f63c238a9bce3f132.tar.gz scummvm-rg350-936fe120863a51240407625f63c238a9bce3f132.tar.bz2 scummvm-rg350-936fe120863a51240407625f63c238a9bce3f132.zip |
DIRECTOR: Shuffle code around
Diffstat (limited to 'engines/director')
-rw-r--r-- | engines/director/frame.cpp | 67 |
1 files changed, 33 insertions, 34 deletions
diff --git a/engines/director/frame.cpp b/engines/director/frame.cpp index fd94c8dab7..aa892aa36a 100644 --- a/engines/director/frame.cpp +++ b/engines/director/frame.cpp @@ -759,40 +759,6 @@ void Frame::renderButton(Graphics::ManagedSurface &surface, uint16 spriteId) { } } -void Frame::inkBasedBlit(Graphics::ManagedSurface &targetSurface, const Graphics::Surface &spriteSurface, uint16 spriteId, Common::Rect drawRect) { - // drawRect could be bigger than the spriteSurface. Clip it - Common::Rect t(spriteSurface.w, spriteSurface.h); - t.moveTo(drawRect.left, drawRect.top); - drawRect.clip(t); - - switch (_sprites[spriteId]->_ink) { - case kInkTypeCopy: - targetSurface.blitFrom(spriteSurface, Common::Point(drawRect.left, drawRect.top)); - break; - case kInkTypeTransparent: - // FIXME: is it always white (last entry in pallette)? - targetSurface.transBlitFrom(spriteSurface, Common::Point(drawRect.left, drawRect.top), _vm->getPaletteColorCount() - 1); - break; - case kInkTypeBackgndTrans: - drawBackgndTransSprite(targetSurface, spriteSurface, drawRect); - break; - case kInkTypeMatte: - drawMatteSprite(targetSurface, spriteSurface, drawRect); - break; - case kInkTypeGhost: - drawGhostSprite(targetSurface, spriteSurface, drawRect); - break; - case kInkTypeReverse: - drawReverseSprite(targetSurface, spriteSurface, drawRect); - break; - default: - warning("Frame::inkBasedBlit(): Unhandled ink type %d", _sprites[spriteId]->_ink); - targetSurface.blitFrom(spriteSurface, Common::Point(drawRect.left, drawRect.top)); - break; - } -} - - void Frame::renderText(Graphics::ManagedSurface &surface, uint16 spriteId, Common::Rect *textSize) { TextCast *textCast = _sprites[spriteId]->_buttonCast != nullptr ? (TextCast*)_sprites[spriteId]->_buttonCast : _sprites[spriteId]->_textCast; @@ -916,6 +882,39 @@ void Frame::renderText(Graphics::ManagedSurface &surface, uint16 spriteId, Commo inkBasedBlit(surface, textWithFeatures, spriteId, Common::Rect(x, y, x + width, y + height)); } +void Frame::inkBasedBlit(Graphics::ManagedSurface &targetSurface, const Graphics::Surface &spriteSurface, uint16 spriteId, Common::Rect drawRect) { + // drawRect could be bigger than the spriteSurface. Clip it + Common::Rect t(spriteSurface.w, spriteSurface.h); + t.moveTo(drawRect.left, drawRect.top); + drawRect.clip(t); + + switch (_sprites[spriteId]->_ink) { + case kInkTypeCopy: + targetSurface.blitFrom(spriteSurface, Common::Point(drawRect.left, drawRect.top)); + break; + case kInkTypeTransparent: + // FIXME: is it always white (last entry in pallette)? + targetSurface.transBlitFrom(spriteSurface, Common::Point(drawRect.left, drawRect.top), _vm->getPaletteColorCount() - 1); + break; + case kInkTypeBackgndTrans: + drawBackgndTransSprite(targetSurface, spriteSurface, drawRect); + break; + case kInkTypeMatte: + drawMatteSprite(targetSurface, spriteSurface, drawRect); + break; + case kInkTypeGhost: + drawGhostSprite(targetSurface, spriteSurface, drawRect); + break; + case kInkTypeReverse: + drawReverseSprite(targetSurface, spriteSurface, drawRect); + break; + default: + warning("Frame::inkBasedBlit(): Unhandled ink type %d", _sprites[spriteId]->_ink); + targetSurface.blitFrom(spriteSurface, Common::Point(drawRect.left, drawRect.top)); + break; + } +} + void Frame::drawBackgndTransSprite(Graphics::ManagedSurface &target, const Graphics::Surface &sprite, Common::Rect &drawRect) { uint8 skipColor = _vm->getPaletteColorCount() - 1; // FIXME is it always white (last entry in pallette) ? |