[Freeciv-Dev] Re: (PR#8262) Map redraw
[Top] [All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
<URL: http://rt.freeciv.org/Ticket/Display.html?id=8262 >
On Tue, Mar 23, 2004 at 09:13:07AM -0800, Jason Short wrote:
>
> <URL: http://rt.freeciv.org/Ticket/Display.html?id=8262 >
>
> Raimar Falke wrote:
>
> >>I think this is the correct way to handle it. map_resized shouldn't
> >>return a value, unless we can define exactly what that value means.
> >
> > "Return TRUE iff the size (in tiles) changes."
>
> I don't think this is right. The way things are now (with pixel
> resolution) the size in tiles has much less significance.
>
> If anything, it should be "return TRUE iff update_map_canvas_visible was
> called".
I looked at the users of map_canvas_resized and I have to say: we
first need to clean them up to see what result map_canvas_resized
should give if any.
The common code should look like:
if (!can_client_change_view()) {
// pregame
check intro gfx sprite and load it
if size of scaled intro sprite != current canvas size:
free it
scale it
draw it to the window
return;
}
else
{
// not pregame
if scaled intro sprite:
free it (no longer needed)
}
map_resized = map_canvas_resized(width, height);
if (map_exists() && !map_resized) {
gdk_draw_pixmap(map_canvas->window, civ_gc, map_canvas_store,
ev->area.x, ev->area.y, ev->area.x, ev->area.y,
ev->area.width, ev->area.height);
}
refresh_overview_canvas();
So I think the return value is used here to indicate that
map_canvas_resized has already redraw the whole canvas. So you are
right with the update_map_canvas_visible-was-called.
But why is this "map_exists()" there? Another check for pregame?
Raimar
--
email: rf13@xxxxxxxxxxxxxxxxx
1) Customers cause problems.
2) Marketing is trying to create more customers.
Therefore:
3) Marketing is evil.
|
|