diff options
Diffstat (limited to 'engines/mads/screen.cpp')
-rw-r--r-- | engines/mads/screen.cpp | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/engines/mads/screen.cpp b/engines/mads/screen.cpp index 7fea54a2f2..975ec7720b 100644 --- a/engines/mads/screen.cpp +++ b/engines/mads/screen.cpp @@ -91,13 +91,12 @@ void DirtyArea::setSpriteSlot(const SpriteSlot *spriteSlot) { _bounds.top = spriteSlot->_position.y - scene._posAdjust.y; SpriteAsset &spriteSet = *scene._sprites[spriteSlot->_spritesIndex]; - MSprite *frame = spriteSet.getFrame(((spriteSlot->_frameNumber & 0x7fff) - 1) & 0x7f); + MSprite *frame = spriteSet.getFrame(ABS(spriteSlot->_frameNumber) - 1); if (spriteSlot->_scale == -1) { width = frame->w; height = frame->h; - } - else { + } else { width = frame->w * spriteSlot->_scale / 100; height = frame->h * spriteSlot->_scale / 100; @@ -380,8 +379,10 @@ void ScreenSurface::init() { void ScreenSurface::copyRectToScreen(const Common::Point &destPos, const Common::Rect &bounds) { byte *buf = getBasePtr(destPos.x, destPos.y); - g_system->copyRectToScreen(buf, this->pitch, bounds.left, bounds.top, - bounds.width(), bounds.height()); + + if (bounds.width() != 0 && bounds.height() != 0) + g_system->copyRectToScreen(buf, this->pitch, bounds.left, bounds.top, + bounds.width(), bounds.height()); } void ScreenSurface::copyRectToScreen(const Common::Rect &bounds) { |