revert 2007-05-21T19:55:03Z!koraq@xs4all.nl which was a revert of 2007-04-12T18:07:28Z!alinkmaze@gmail.com.

2007-04-12T18:07:28Z!alinkmaze@gmail.com was not supposed to fix bug #9144, but it really fix bug
#8910 I also doesn't causes the jerky moves of the MoL halo (which was
caused by 2007-05-12T12:53:53Z!jeremy.rosen@enst-bretagne.fr)
This commit is contained in:
Ali El Gariani 2007-05-22 08:08:06 +00:00
parent a12c8050dc
commit 69d4a009f9

View file

@ -109,8 +109,14 @@ effect::effect(int xpos, int ypos, const animated<std::string>::anim_description
void effect::set_location(int x, int y)
{
const gamemap::location zero_loc(0,0);
x_ = x - disp->get_location_x(zero_loc);
y_ = y - disp->get_location_y(zero_loc);
int new_x = x - disp->get_location_x(zero_loc);
int new_y = y - disp->get_location_y(zero_loc);
if (new_x != x_ || new_y != y_) {
x_ = new_x;
y_ = new_y;
buffer_.assign(NULL);
overlayed_hexes_.clear();
}
}
bool effect::render()
@ -145,10 +151,6 @@ bool effect::render()
SDL_Rect rect = {xpos,ypos,surf_->w,surf_->h};
rect_ = rect;
SDL_Rect clip_rect = disp->map_area();
if(rects_overlap(rect,clip_rect) == false) {
buffer_.assign(NULL);
return false;
}
// if rendered the first time need to detemine the area affected, if a halo
// changes size it's not updated.
@ -162,6 +164,11 @@ bool effect::render()
}
}
if(rects_overlap(rect,clip_rect) == false) {
buffer_.assign(NULL);
return false;
}
surface const screen = disp->video().getSurface();
const clip_rect_setter clip_setter(screen,clip_rect);