Complete.Org: Mailing Lists: Archives: freeciv-dev: March 2002:
[Freeciv-Dev] Re: mapview doesn't update properly when we get a city upd
Home

[Freeciv-Dev] Re: mapview doesn't update properly when we get a city upd

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: jdorje@xxxxxxxxxxxxxxxxxxxxx
Cc: freeciv-dev@xxxxxxxxxxx, bugs@xxxxxxxxxxxxxxxxxxx
Subject: [Freeciv-Dev] Re: mapview doesn't update properly when we get a city update (PR#1303)
From: Raimar Falke <hawk@xxxxxxxxxxxxxxxxxxxxxxx>
Date: Sun, 17 Mar 2002 15:35:14 +0100
Reply-to: rf13@xxxxxxxxxxxxxxxxxxxxxx

On Fri, Mar 15, 2002 at 04:54:58PM +0100, Raimar Falke wrote:
> On Tue, Mar 05, 2002 at 09:54:19PM -0800, jdorje@xxxxxxxxxxxxxxxxxxxxx wrote:
> > +/**************************************************************************
> > +  This function, along with unqueue_mapview_update(), helps in updating
> > +  the mapview when a packet is received.  Previously, we just called
> > +  update_map_canvas when (for instance) a city update was received.
> > +  Not only would this often end up with a lot of duplicated work, but it
> > +  would also draw over the city descriptions, which would then just
> > +  "disappear" from the mapview.  The hack is to instead call
> > +  queue_mapview_update in place of this update, and later (after all
> > +  packets have been read) call unqueue_mapview_update.  The functions
> > +  don't track which areas of the screen need updating, rather when the
> > +  unqueue is done we just update the whole visible mapqueue, and redraw
> > +  the city descriptions.
> > +
> > +  Using these functions, updates are done correctly, and are probably
> > +  faster too.  But it's a bit of a hack to insert this code into the
> > +  packet-handling code.
> > +**************************************************************************/
> 
> >    if (draw_map_grid && get_client_state() == CLIENT_GAME_RUNNING_STATE) {
> 
> I ask myself: shouldn't this be
> 
>   if ((draw_map_grid || draw_city_names || draw_city_productions) && 
> get_client_state() == CLIENT_GAME_RUNNING_STATE)
> 
> Or do I miss something here?

Yes. The code takes care of draw_city_names and draw_city_productions
in another part of packhand.c. The attached patch unifies the two
patches from Jason. It successfully coalesce all the packets of a
"change all storm" into one real update.

        Raimar

-- 
 email: rf13@xxxxxxxxxxxxxxxxx
 Q:  Do you know what the death rate around here is?
 A:  One per person.

Attachment: mapview_update1.diff
Description: Text document


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