Skip to content

Commit

Permalink
SCUMM: Fix backwards-in-same-array case of v72he::copyArray.
Browse files Browse the repository at this point in the history
  • Loading branch information
fuzzie committed Aug 4, 2013
1 parent 7b517f7 commit 89e14f6
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions engines/scumm/he/script_v72he.cpp
Expand Up @@ -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);
Expand Down

0 comments on commit 89e14f6

Please sign in to comment.