Complete.Org: Mailing Lists: Archives: freeciv-dev: March 2004:
[Freeciv-Dev] Re: (PR#8262) Map redraw
Home

[Freeciv-Dev] Re: (PR#8262) Map redraw

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: chrisk@xxxxxxxxx
Subject: [Freeciv-Dev] Re: (PR#8262) Map redraw
From: "Jason Short" <jdorje@xxxxxxxxxxxxxxxxxxxxx>
Date: Mon, 22 Mar 2004 14:09:37 -0800
Reply-to: rt@xxxxxxxxxxx

<URL: http://rt.freeciv.org/Ticket/Display.html?id=8262 >

Christian Knoke wrote:

>>The main map part of the civclient window doesn't get redrawn, when I switch
>>forth and back to another window. A right click into the map, or a size
>>change of the window, restores it then.

The return value of map_resized is always TRUE.  I didn't know anyone 
actually used it, and it was undocumented.

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.

jason

Index: client/gui-gtk/mapview.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/client/gui-gtk/mapview.c,v
retrieving revision 1.208
diff -u -r1.208 mapview.c
--- client/gui-gtk/mapview.c    15 Mar 2004 05:35:28 -0000      1.208
+++ client/gui-gtk/mapview.c    22 Mar 2004 22:07:40 -0000
@@ -345,12 +345,11 @@
 gint map_canvas_expose(GtkWidget *w, GdkEventExpose *ev)
 {
   gint height, width;
-  gboolean map_resized;
   static int exposed_once = 0;
 
   gdk_window_get_size(w->window, &width, &height);
 
-  map_resized = map_canvas_resized(width, height);
+  (void) map_canvas_resized(width, height);
 
   if (!can_client_change_view()) {
     if (!intro_gfx_sprite) {
@@ -379,10 +378,8 @@
       scaled_intro_sprite = NULL;
     }
 
-    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);
+    if (map_exists()) {
+      dirty_rect(ev->area.x, ev->area.y, ev->area.width, ev->area.height);
     }
     refresh_overview_canvas();
   }

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