diff options
author | johndoe123 | 2014-04-07 12:58:26 +0200 |
---|---|---|
committer | Eugene Sandulenko | 2018-07-20 06:43:33 +0000 |
commit | 3f15233f78a264e45ce74ecd2db9ed3119b1b654 (patch) | |
tree | 821bda821f8b1d0813e271d682c5c42b59103c59 /engines/illusions/screen.cpp | |
parent | 6ba5570de52344da602cf02fb83725b468e3d8c5 (diff) | |
download | scummvm-rg350-3f15233f78a264e45ce74ecd2db9ed3119b1b654.tar.gz scummvm-rg350-3f15233f78a264e45ce74ecd2db9ed3119b1b654.tar.bz2 scummvm-rg350-3f15233f78a264e45ce74ecd2db9ed3119b1b654.zip |
ILLUSIONS: Refactor code in preparation for the Duckman engine
Diffstat (limited to 'engines/illusions/screen.cpp')
-rw-r--r-- | engines/illusions/screen.cpp | 26 |
1 files changed, 15 insertions, 11 deletions
diff --git a/engines/illusions/screen.cpp b/engines/illusions/screen.cpp index de2efae4e9..9e03a40bd9 100644 --- a/engines/illusions/screen.cpp +++ b/engines/illusions/screen.cpp @@ -161,17 +161,7 @@ bool SpriteDrawQueue::draw(SpriteDrawQueueItem *item) { if (!calcItemRect(item, srcRect, dstRect)) return true; - if (item->_scale == 100) { - if (item->_flags & 1) - _screen->drawSurface10(dstRect.left, dstRect.top, item->_surface, srcRect, _screen->getColorKey2()); - else - _screen->drawSurface11(dstRect.left, dstRect.top, item->_surface, srcRect); - } else { - if (item->_flags & 1) - _screen->drawSurface20(dstRect, item->_surface, srcRect, _screen->getColorKey2()); - else - _screen->drawSurface21(dstRect, item->_surface, srcRect); - } + _screen->drawSurface(dstRect, item->_surface, srcRect, item->_scale, item->_flags); if (item->_drawFlags) *item->_drawFlags &= ~4; @@ -346,6 +336,20 @@ void Screen::updateSprites() { g_system->copyRectToScreen((byte*)_backSurface->getBasePtr(0, 0), _backSurface->pitch, 0, 0, _backSurface->w, _backSurface->h); } +void Screen::drawSurface(Common::Rect &dstRect, Graphics::Surface *surface, Common::Rect &srcRect, int16 scale, uint32 flags) { + if (scale == 100) { + if (flags & 1) + drawSurface10(dstRect.left, dstRect.top, surface, srcRect, _colorKey2); + else + drawSurface11(dstRect.left, dstRect.top, surface, srcRect); + } else { + if (flags & 1) + drawSurface20(dstRect, surface, srcRect, _colorKey2); + else + drawSurface21(dstRect, surface, srcRect); + } +} + void Screen::drawSurface10(int16 destX, int16 destY, Graphics::Surface *surface, Common::Rect &srcRect, uint16 colorKey) { // Unscaled // TODO |