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: freeciv-dev@xxxxxxxxxxx
Cc: bugs@xxxxxxxxxxxxxxxxxxx
Subject: [Freeciv-Dev] Re: mapview doesn't update properly when we get a city update (PR#1303)
From: jdorje@xxxxxxxxxxxxxxxxxxxxx
Date: Fri, 15 Mar 2002 08:10:19 -0800 (PST)

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?

An excellent question.

The draw_city_names and draw_city_productions checks are taken care of elsewhere (see the bug I filed yesterday about that). However, having them be taken care of here would probably make a *lot* more sense and would probably cause everything to "just work".

Or maybe I'm missing something.

jason




[Prev in Thread] Current Thread [Next in Thread]
  • [Freeciv-Dev] Re: mapview doesn't update properly when we get a city update (PR#1303), jdorje <=