diff options
author | Florian Kagerer | 2008-04-09 23:38:11 +0000 |
---|---|---|
committer | Florian Kagerer | 2008-04-09 23:38:11 +0000 |
commit | 3d407b81f8221e229136f4e12cb6bb9b9ba2d6e2 (patch) | |
tree | 2029857d3df111d7881d6cf7ff1f2eeb09767b4e /engines | |
parent | b586235fb838ebdd41fe36c7d7deb4f7f3e7a6f9 (diff) | |
download | scummvm-rg350-3d407b81f8221e229136f4e12cb6bb9b9ba2d6e2.tar.gz scummvm-rg350-3d407b81f8221e229136f4e12cb6bb9b9ba2d6e2.tar.bz2 scummvm-rg350-3d407b81f8221e229136f4e12cb6bb9b9ba2d6e2.zip |
fix drawShape glitch (Brandon's feet got mutilated and one vertical line was not drawn when leaving the screen to the left or to the right )
svn-id: r31461
Diffstat (limited to 'engines')
-rw-r--r-- | engines/kyra/screen.cpp | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/engines/kyra/screen.cpp b/engines/kyra/screen.cpp index 61fed19cbc..9abc0cbd80 100644 --- a/engines/kyra/screen.cpp +++ b/engines/kyra/screen.cpp @@ -1406,7 +1406,7 @@ void Screen::drawShape(uint8 pageNum, const uint8 *shapeData, int x, int y, int _dsOffscreenRight = 0; _dsOffscreenScaleVal2 = _dsOffscreenLeft; _dsOffscreenLeft <<= 8; - _dsOffscreenScaleVal1 = _dsOffscreenLeft % _dsScaleW; + _dsOffscreenScaleVal1 = (_dsOffscreenLeft % _dsScaleW) * -1; _dsOffscreenLeft /= _dsScaleW; } @@ -1482,14 +1482,14 @@ int Screen::drawShapeMarginScaleUpwind(uint8 *&dst, const uint8 *&src, int &cnt) if (src == dst || !cnt) return _dsOffscreenScaleVal1; - while (cnt-- > 0) { + do { if (*src++) continue; found = true; cnt = cnt + 1 - (*src++); - } + } while (--cnt > 0); - if (!found) + if (!found || !cnt) return _dsOffscreenScaleVal1; _dsTmpWidth += cnt; @@ -1511,14 +1511,14 @@ int Screen::drawShapeMarginScaleDownwind(uint8 *&dst, const uint8 *&src, int &cn if (src == dst || !cnt) return _dsOffscreenScaleVal1; - while (cnt-- > 0) { + do { if (*src++) continue; found = true; cnt = cnt + 1 - (*src++); - } + } while (--cnt > 0); - if (!found) + if (!found || !cnt) return _dsOffscreenScaleVal1; _dsTmpWidth += cnt; @@ -1539,11 +1539,11 @@ int Screen::drawShapeSkipScaleUpwind(uint8 *&dst, const uint8 *&src, int &cnt) { if (cnt <= 0) return 0; - while (cnt-- > 0) { + do { if (*src++) continue; cnt = cnt + 1 - (*src++); - } + } while (--cnt > 0); return 0; } @@ -1552,15 +1552,15 @@ int Screen::drawShapeSkipScaleDownwind(uint8 *&dst, const uint8 *&src, int &cnt) cnt = _dsTmpWidth; bool found = false; - if (cnt <= 0) + if (cnt == 0) return 0; - while (cnt-- > 0) { + do { if (*src++) continue; found = true; cnt = cnt + 1 - (*src++); - } + } while (--cnt > 0); return found ? 0 : _dsOffscreenScaleVal1; } |