Complete.Org: Mailing Lists: Archives: freeciv-dev: December 2002:
[Freeciv-Dev] Re: (PR#2583) fix for [un]queue_mapview_update
Home

[Freeciv-Dev] Re: (PR#2583) fix for [un]queue_mapview_update

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: undisclosed-recipients:;
Subject: [Freeciv-Dev] Re: (PR#2583) fix for [un]queue_mapview_update
From: "Jason Short via RT" <rt@xxxxxxxxxxxxxx>
Date: Mon, 16 Dec 2002 12:12:31 -0800
Reply-to: rt@xxxxxxxxxxxxxx

On Mon, 2002-12-16 at 10:02, Raimar Falke via RT wrote:
> On Sun, Dec 15, 2002 at 02:44:57PM -0800, Jason Short via RT wrote:
> > 
> > The current implementation of [un]queue_mapview_update is semi-broken. 
> > It is called when we need to do a update_city_descriptions, but when the
> > update is unqueued it instead calls update_map_canvas_visible.  This
> > forces a full redraw even if the GUI doesn't require it.
> > 
> > The attached patch allows either a city-description update or a
> > full-canvas update to be enqueued.  This is not a final solution, but is
> > an incremental improvement to the current code.  And it allows the GUI
> > to implement a 5x more efficient udpate_city_descriptions function if it
> > wants to.
> 
> I just see that UPDATE_MAP_CANVAS_VISIBLE isn't used. This was a
> surprise for the me. We only use the queue for city descriptions? Do
> you plan to extend this? If not can we specialize by renaming
> queue_mapview_update to queue_city_descr_update or similar?

Indeed.

It looks to me like queuing an update_map_canvas_visible is not needed
or desired.  This update is only done when recentering the screen or
changing view options - in which cases it generally needs to happen
immediately anyway.

Note also that we don't unqueue the update at the strictly proper time. 
Currently we only do it when leaving the packet handler.  We _should_ do
it before animations as well.  But since it is just city descriptions,
this is not a big deal.

We should also have update_map_canvas_visible change the updates_needed
to NO_UPDATE.

And finally, we should be able to enqueue an update of a particular
tile.  Perhaps here we could instead enqueue an
UPDATE_MAP_CANVAS_VISIBLE call so that we don't redraw individual
tiles.  But this would require fixing the unqueue issue above, and is
probably slower in any case.

jason




[Prev in Thread] Current Thread [Next in Thread]