Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SDL: Fix incorrect handling of dirty rect with negative shake offset in SDL1 #4780

Merged
merged 1 commit into from Mar 6, 2023

Conversation

criezy
Copy link
Member

@criezy criezy commented Mar 6, 2023

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.

…in SDL1

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.
@dwatteau
Copy link
Contributor

dwatteau commented Mar 6, 2023

Works for me with DOTT on OSX PPC running SDL1.2 (forcing surfacesdl instead of default opengl graphics mode) 👍

@criezy criezy merged commit 9f1528e into scummvm:master Mar 6, 2023
8 checks passed
@criezy criezy deleted the sdl1-shake branch March 6, 2023 22:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants