diff options
author | sylvaintv | 2011-03-14 23:28:15 +0100 |
---|---|---|
committer | sylvaintv | 2011-03-14 23:28:15 +0100 |
commit | 0a983e1df5c8db22fe7e480322c1f2bd10cdef26 (patch) | |
tree | feff0267a2b856f43376025b541fa07bf5723387 | |
parent | c1cdc49ac57880c069607600b53d1ee958b723a2 (diff) | |
download | scummvm-rg350-0a983e1df5c8db22fe7e480322c1f2bd10cdef26.tar.gz scummvm-rg350-0a983e1df5c8db22fe7e480322c1f2bd10cdef26.tar.bz2 scummvm-rg350-0a983e1df5c8db22fe7e480322c1f2bd10cdef26.zip |
TOON: Fix more dirty rect issues
Especially not refreshing pictures when viewing
inventory items and corrupted last line of the screen.
-rw-r--r-- | engines/toon/toon.cpp | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/engines/toon/toon.cpp b/engines/toon/toon.cpp index 4568f72de1..0c7989f317 100644 --- a/engines/toon/toon.cpp +++ b/engines/toon/toon.cpp @@ -3413,6 +3413,7 @@ void ToonEngine::viewInventoryItem(Common::String str, int32 lineId, int32 itemD Picture *pic = new Picture(this); pic->loadPicture(str, false); pic->setupPalette(); + dirtyAllScreen(); flushPalette(); if (lineId) { @@ -3436,7 +3437,13 @@ void ToonEngine::viewInventoryItem(Common::String str, int32 lineId, int32 itemD break; } - pic->draw(*_mainSurface, 0, 0, 0, 0); + if (!_dirtyAll) { + pic->drawWithRectList(*_mainSurface, 0, 0, 0, 0, _dirtyRects); + } else { + pic->draw(*_mainSurface, 0, 0, 0, 0); + _dirtyRects.push_back(Common::Rect(0, 0, TOON_SCREEN_WIDTH, TOON_SCREEN_HEIGHT)); + } + clearDirtyRects(); drawConversationLine(); if (!_audioManager->voiceStillPlaying()) { @@ -3455,6 +3462,7 @@ void ToonEngine::viewInventoryItem(Common::String str, int32 lineId, int32 itemD } fadeOut(5); + dirtyAllScreen(); restorePalette(); _firstFrame = true; _gameState->_currentScrollValue = oldScrollValue; @@ -4674,10 +4682,10 @@ void ToonEngine::dirtyAllScreen() } void ToonEngine::addDirtyRect( int32 left, int32 top, int32 right, int32 bottom ) { - left = MIN<int32>(MAX<int32>(left, 0), TOON_BACKBUFFER_WIDTH - 1); - right = MIN<int32>(MAX<int32>(right, 0), TOON_BACKBUFFER_WIDTH - 1); - top = MIN<int32>(MAX<int32>(top, 0), TOON_BACKBUFFER_HEIGHT - 1); - bottom = MIN<int32>(MAX<int32>(bottom, 0), TOON_BACKBUFFER_HEIGHT - 1); + left = MIN<int32>(MAX<int32>(left, 0), TOON_BACKBUFFER_WIDTH); + right = MIN<int32>(MAX<int32>(right, 0), TOON_BACKBUFFER_WIDTH); + top = MIN<int32>(MAX<int32>(top, 0), TOON_BACKBUFFER_HEIGHT); + bottom = MIN<int32>(MAX<int32>(bottom, 0), TOON_BACKBUFFER_HEIGHT); Common::Rect rect(left, top, right, bottom); |