Author: alink
Date: Mon May 11 03:29:44 2009
New Revision: 35563
URL: http://svn.gna.org/viewcvs/wesnoth?rev=35563&view=rev
Log:
Fix an old optimization of off-screen rectangular invalidations.
We already had a mechanism to avoid invalidating adjacent hexes during the
update of a big or not aligned off-screen sprite.
But a flaw with the handling of empty intersection with the screen prevented it
to fully work.
(and in some cases caused few incorrect invalidations at the edge of the
screen, which was very bad because it caused blitting)
Modified:
trunk/src/display.cpp
Modified: trunk/src/display.cpp
URL:
http://svn.gna.org/viewcvs/wesnoth/trunk/src/display.cpp?rev=35563&r1=35562&r2=35563&view=diff
==============================================================================
--- trunk/src/display.cpp (original)
+++ trunk/src/display.cpp Mon May 11 03:29:44 2009
@@ -381,6 +381,17 @@
{
rect_of_hexes res;
+ if (r.w<=0 || r.h<=0) {
+ // empty rect, return dummy values giving begin=end
+ res.left = 0;
+ res.right = -1; // end is right+1
+ res.top[0] = 0;
+ res.top[1] = 0;
+ res.bottom[0] = 0;
+ res.bottom[1] = 0;
+ return res;
+ }
+
SDL_Rect map_rect = map_area();
// translate rect coordinates from screen-based to map_area-based
int x = xpos_ - map_rect.x + r.x;
_______________________________________________
Wesnoth-commits mailing list
[email protected]
https://mail.gna.org/listinfo/wesnoth-commits