diff options
author | Johannes Schickel | 2008-04-20 23:13:38 +0000 |
---|---|---|
committer | Johannes Schickel | 2008-04-20 23:13:38 +0000 |
commit | 9616ec94c9f5318505f4e3ecdf105439d973cb43 (patch) | |
tree | aaa94b982bd8d2f136f61c52769d9ec0c47e4b5c /engines | |
parent | 87f10ebe40d2c18742751f827d011cbf135c6f21 (diff) | |
download | scummvm-rg350-9616ec94c9f5318505f4e3ecdf105439d973cb43.tar.gz scummvm-rg350-9616ec94c9f5318505f4e3ecdf105439d973cb43.tar.bz2 scummvm-rg350-9616ec94c9f5318505f4e3ecdf105439d973cb43.zip |
Fixed yet another two long standing bugs in Screen::encodeShape.
svn-id: r31633
Diffstat (limited to 'engines')
-rw-r--r-- | engines/kyra/screen.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/engines/kyra/screen.cpp b/engines/kyra/screen.cpp index 773cd98949..6dff6a0fa4 100644 --- a/engines/kyra/screen.cpp +++ b/engines/kyra/screen.cpp @@ -2242,6 +2242,8 @@ uint8 *Screen::encodeShape(int x, int y, int w, int h, int flags) { src = _animBlockPtr; memcpy(dst, src, shapeSize2); dst = newShape; + if (_vm->gameFlags().useAltShapeHeader) + dst += 2; flags = READ_LE_UINT16(dst); flags |= 2; WRITE_LE_UINT16(dst, flags); @@ -2326,7 +2328,8 @@ int16 Screen::encodeShapeAndCalculateSize(uint8 *from, uint8 *to, int size_to) { byte *fromBackUp = from; byte *toBackUp = to; --to; - for (int i = 0; i < (fromPtrEnd - from); ++i) { + const int checkSize = fromPtrEnd - from; + for (int i = 0; i < checkSize; ++i) { if (*from++ != *to++) break; } |