Complete.Org: Mailing Lists: Archives: freeciv-dev: January 2003:
[Freeciv-Dev] (PR#2883)
Home

[Freeciv-Dev] (PR#2883)

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
Cc: freeciv-dev@xxxxxxxxxxx
Subject: [Freeciv-Dev] (PR#2883)
From: "Jason Short via RT" <rt@xxxxxxxxxxxxxx>
Date: Wed, 22 Jan 2003 12:40:08 -0800
Reply-to: rt@xxxxxxxxxxxxxx

The attached patch provides, for gui-gtk, a more efficient form of
update_city_descriptions().  Instead of redrawing everything, it uses
the already-existing backing store to draw city names on top of.  This
provides around a 4x speedup of this function, which is a substantial
gain.  (PR#2583 is needed as well; otherwise update_map_canvas_visible
is called instead of update_city_descriptions anyway.)

Nearly identical changes will work for other clients.

jason

Index: client/gui-gtk/mapview.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/client/gui-gtk/mapview.c,v
retrieving revision 1.149
diff -u -r1.149 mapview.c
--- client/gui-gtk/mapview.c    2003/01/17 20:20:56     1.149
+++ client/gui-gtk/mapview.c    2003/01/22 20:36:02
@@ -950,7 +950,11 @@
 **************************************************************************/
 void update_city_descriptions(void)
 {
-  update_map_canvas_visible();
+  int canvas_width, canvas_height;
+
+  gdk_window_get_size(map_canvas->window, &canvas_width, &canvas_height);
+  flush_mapcanvas(0, 0, canvas_width, canvas_height);
+  show_city_descriptions();
 }
 
 /**************************************************************************

[Prev in Thread] Current Thread [Next in Thread]
  • [Freeciv-Dev] (PR#2883), Jason Short via RT <=