Opened 14 years ago

Closed 14 years ago

Last modified 13 months ago

#8451 closed patch

GUI: SDL mouse dirty rects too big

Reported by: SF/ewelsh42 Owned by: sev-
Priority: normal Component: Ports
Keywords: Cc:
Game:

Description

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.

Attachments (1)

mouse.dif (1.1 KB ) - added by SF/ewelsh42 14 years ago.
diff to fix mouse dirty rects too big problem

Download all attachments as: .zip

Change History (5)

by SF/ewelsh42, 14 years ago

Attachment: mouse.dif added

diff to fix mouse dirty rects too big problem

comment:1 by sev-, 14 years ago

Owner: set to sev-

comment:2 by sev-, 14 years ago

Status: newclosed

comment:3 by sev-, 14 years ago

Thanks for reporting and for the patch. Though since it is a
patch and not just a bugreport, I'm closing it and moving to
patches section.

Accepted.

comment:4 by digitall, 13 months ago

Component: Ports
Note: See TracTickets for help on using tickets.