[Scummvm-cvs-logs] scummvm master -> 89e14f6862bbd61af0f532442e298f2323f9b88d

fuzzie fuzzie at fuzzie.org
Sun Aug 4 15:56:35 CEST 2013


This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .

Summary:
89e14f6862 SCUMM: Fix backwards-in-same-array case of v72he::copyArray.


Commit: 89e14f6862bbd61af0f532442e298f2323f9b88d
    https://github.com/scummvm/scummvm/commit/89e14f6862bbd61af0f532442e298f2323f9b88d
Author: Alyssa Milburn (fuzzie at fuzzie.org)
Date: 2013-08-04T06:54:37-07:00

Commit Message:
SCUMM: Fix backwards-in-same-array case of v72he::copyArray.

Changed paths:
    engines/scumm/he/script_v72he.cpp



diff --git a/engines/scumm/he/script_v72he.cpp b/engines/scumm/he/script_v72he.cpp
index b9f454d..f36f5cc 100644
--- a/engines/scumm/he/script_v72he.cpp
+++ b/engines/scumm/he/script_v72he.cpp
@@ -1779,8 +1779,11 @@ void ScummEngine_v72he::copyArray(int array1, int a1_dim2start, int a1_dim2end,
 				copyArrayHelper(ah, a1_dim2start, a1_dim1start, a1_dim1end, &dst, &dstPitch, &rowSize);
 				copyArrayHelper(ah, a2_dim2start, a2_dim1start, a2_dim1end, &src, &srcPitch, &rowSize);
 			} else {
+				// start at the end, so we copy backwards (in case the indices overlap)
 				copyArrayHelper(ah, a1_dim2end, a1_dim1start, a1_dim1end, &dst, &dstPitch, &rowSize);
 				copyArrayHelper(ah, a2_dim2end, a2_dim1start, a2_dim1end, &src, &srcPitch, &rowSize);
+				dstPitch = -dstPitch;
+				srcPitch = -srcPitch;
 			}
 			for (; a1_dim2start <= a1_dim2end; ++a1_dim2start) {
 				memcpy(dst, src, rowSize);






More information about the Scummvm-git-logs mailing list