diff options
author | lukaslw | 2014-05-14 03:20:26 +0200 |
---|---|---|
committer | lukaslw | 2014-06-22 20:08:04 +0200 |
commit | 7239843ba743792d1f3dc8fab600715d0a1667bd (patch) | |
tree | 93632d8bcb93ab40b62d5fc211d941bface81518 | |
parent | 2c9559b620def087f1d7e9bff3b2a07686c946f6 (diff) | |
download | scummvm-rg350-7239843ba743792d1f3dc8fab600715d0a1667bd.tar.gz scummvm-rg350-7239843ba743792d1f3dc8fab600715d0a1667bd.tar.bz2 scummvm-rg350-7239843ba743792d1f3dc8fab600715d0a1667bd.zip |
PRINCE: showHeroShadow - small fix for doubled lines and wrong colors
-rw-r--r-- | engines/prince/hero.cpp | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/engines/prince/hero.cpp b/engines/prince/hero.cpp index de4a3524cd..1697998c43 100644 --- a/engines/prince/hero.cpp +++ b/engines/prince/hero.cpp @@ -315,6 +315,8 @@ void Hero::showHeroShadow(Graphics::Surface *heroFrame) { int blackHeroX = 0; int blackHeroY = frameYSize - 1; + int shadLastY = 0; + byte *shadowStart = (byte *)makeShadow->getBasePtr(blackHeroX, blackHeroY); // esi, first pixel from last row of black hero byte *background = (byte *)_graph->_frontScreen->getBasePtr(sprDestX, sprDestY); // eax, pixel of background where shadow sprite starts @@ -348,7 +350,8 @@ void Hero::showHeroShadow(Graphics::Surface *heroFrame) { break; } //line_y_ok - if (shadPosY >= 0 && shadPosY < 480 && shadPosX < 640) { + if (shadLastY != shadPosY && shadPosY >= 0 && shadPosY < 480 && shadPosX < 640) { + shadLastY = shadPosY; if (shadPosX < 0) { //when it happens? shadSkipX = -1 * shadPosX; background += shadSkipX; @@ -533,12 +536,10 @@ void Hero::showHeroShadow(Graphics::Surface *heroFrame) { shadBitAddr -= kMaxPicWidth / 8; shadPosY--; diffY--; - background = (byte *)_graph->_frontScreen->getBasePtr(sprDestX + diffX, sprDestY + diffY); } else if (*(shadowLineStart + 2) > *(shadowLineStart - 2)) { shadBitAddr += kMaxPicWidth / 8; shadPosY++; diffY++; - background = (byte *)_graph->_frontScreen->getBasePtr(sprDestX + diffX, sprDestY + diffY); } //no_change_y if (*shadowLineStart < *(shadowLineStart - 4)) { @@ -570,6 +571,7 @@ void Hero::showHeroShadow(Graphics::Surface *heroFrame) { break; } blackHeroX = 0; + background = (byte *)_graph->_frontScreen->getBasePtr(sprDestX + diffX, sprDestY + diffY); shadowStart = (byte *)makeShadow->getBasePtr(blackHeroX, blackHeroY); } //koniec_bajki |