GUI: SDL mouse dirty rects too big
|Reported by:||SF/ewelsh42||Owned by:||sev-|
In the current CVS version of backends/sdl/graphics.cpp, the mouse dirty rects are too big. The effect is most easily observed in relation to bug #1185275 (mouse over distorts what's underneath left by one pixel in 3x overlay). Move the mouse from the left toward a vertical line on the right (say, the launcher menu scroll bar). Before the mouse rectangle gets near the vertical line, it distorts as if the mouse were already over it. This happens at 1.5x the "real" width of the mouse bitmap. The same goes for below the mouse. If one of the scaler functions is edited so as to highlight redrawn areas, the dirty rects can be observed as they redraw. With 3x scalers and visible overlay, both the width and height of the mouse dirty rects are 1.5x too large. With non-visible overlays, 2x scalers are 2x too large, and 3x scalers are 3x too large. The problem can be traced to drawMouse(), prior to the "_mouseBackup = dst" line which saves the current dst.w and dst.h for later use by undrawMouse and creating dirty rects. At this point, dst.w and dst.h are larger than they should be. A quick fix can be implemented which sets them to the correct values. I've attached a small patch to fix the problem. I'm not sure if it is the "correct" way to fix the problem, but if not, it does work, so I think it may be headed in the right direction.
Another way to observe the effects of the problem is to play a game with a large mouse bounding box on a slow CPU with a slow 3x filter. Since the mouse is redrawn/undrawn constantly now (as opposed to only when it needs to be, like it was before this last major GUI change) and the dirty rects problem results in a refresh area 9x as large as it should be, that puts a strain on the filter and the mouse moves quite sluggishly if it is too much CPU load for the machine to handle.
Ticket imported from: #1258912. Ticket imported from: patches/556.