Fixed yet another two long standing bugs in Screen::encodeShape.

svn-id: r31633
This commit is contained in:
Johannes Schickel 2008-04-20 23:13:38 +00:00
parent 87f10ebe40
commit 9616ec94c9

View File

@ -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;
}