/ scummvm Public
SDL: Fix incorrect handling of dirty rect with negative shake offset in SDL1 #4780
Add this suggestion to a batch that can be applied as a single commit. This suggestion is invalid because no changes were made to the code. Suggestions cannot be applied while the pull request is closed. Suggestions cannot be applied while viewing a subset of changes. Only one suggestion per line can be applied in a batch. Add this suggestion to a batch that can be applied as a single commit. Applying suggestions on deleted lines is not supported. You must change the existing code in this line in order to create a valid suggestion. Outdated suggestions cannot be applied. This suggestion has been applied or marked resolved. Suggestions cannot be applied from pending reviews. Suggestions cannot be applied on multi-line comments. Suggestions cannot be applied while the pull request is queued to merge.
PR #4754 fixed a crash in SDL1 when using negative shake offset. But reviewing the PR I think it did not correctly handle the dirty rect in the case of a negative offset. However the PR was merged before this could be confirmed and fixed.
Instead of shifting the destination to the left, if was moving the source to the right, which had the effect of shifting the dirty rect. So part of the surface that should have been copied to the screen was not, and instead it was copying part of the surface that did not need to be copied.
I am not completely confident with the change, and did not test it as no longer have a SDL 1.2 at hand to try it. So having another pair of eyes on this would be welcome.