-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
SURFACESDL: Fix calculating the mouse dirty rectangle #4625
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
Conversation
|
Can you provide some more information? What has been fixed here? Can you provide a use case? Could you provide some screenshots that illustrate the problem? |
|
Some background information can be found in this issue: https://bugs.scummvm.org/ticket/14024 This isn't a problem with SDL2 since the list of dirty rectangles is ignored by the SDL_UpdateRects replacement, but I'm not sure why it was only visible with 32-bit displays. This PR attempts to fix the issue by moving the addition of both mouse dirty rects to before the game screen or overlay is blitted. |
bc4e90c to
9e7915f
Compare
|
Thank you! |
|
Unfortunately, it seems that this commit introduced (or uncovered) a regression either in SURFACESDL itself or the KYRA engine: https://bugs.scummvm.org/ticket/14147 |
|
|
||
| dst.x += _currentShakeXOffset; | ||
| dst.y += _currentShakeYOffset; | ||
| dst.x = _mouseNextRect.x + _currentShakeXOffset; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is added twice: one in undrawMouse and now here.
| // scaled and aspect-ratio corrected. | ||
|
|
||
| if (_mouseLastRect.w != 0 && _mouseLastRect.h != 0) | ||
| addDirtyRect(_mouseLastRect.x - hotX, _mouseLastRect.y - hotY, _mouseLastRect.w, _mouseLastRect.h, _overlayInGUI); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if hotX has changed between last frame and now, this calculation is invalid.
I believe it causes bug https://bugs.scummvm.org/ticket/14147
I wonder if everything should be calculated here and not in drawMouse
|
@ccawley2011 could you give an example of how to reproduce the issue with a 32-bit game? The bit making internUpdateScreen() call undrawMouse() every time is causing performance issues in Director (there's a lot of ad-hoc places which can call updateScreen, relying a bit on the assumption that it's near-zero cost when there's no dirty rects). |
It can be replicated in the launcher when compiling on Linux with SDL 1.2 and changing the call to |
No description provided.