Complete.Org: Mailing Lists: Archives: freeciv-dev: April 2003:
[Freeciv-Dev] (PR#3998) add map_exists to climap
Home

[Freeciv-Dev] (PR#3998) add map_exists to climap

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: undisclosed-recipients:;
Subject: [Freeciv-Dev] (PR#3998) add map_exists to climap
From: "Jason Short" <jdorje@xxxxxxxxxxxxxxxxxxxxx>
Date: Sun, 13 Apr 2003 23:09:16 -0700
Reply-to: rt@xxxxxxxxxxxxxx

This is a small cleanup to add a map_exists() macro to climap.  This is 
used in a few places to test whether the map information has been 
received yet.

Question: should we instead be checking can_client_change_view here?

jason

Index: client/climap.h
===================================================================
RCS file: /home/freeciv/CVS/freeciv/client/climap.h,v
retrieving revision 1.2
diff -u -r1.2 climap.h
--- client/climap.h     2003/02/05 07:23:47     1.2
+++ client/climap.h     2003/04/14 06:03:46
@@ -17,6 +17,8 @@
 #include "map.h"                /* enum direction8 */
 #include "terrain.h"            /* enum known_type */
 
+#define map_exists() (map.xsize != 0)
+
 enum known_type tile_get_known(int x, int y);
 
 enum direction8 gui_to_map_dir(enum direction8 gui_dir);
Index: client/gui-gtk/mapview.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/client/gui-gtk/mapview.c,v
retrieving revision 1.166
diff -u -r1.166 mapview.c
--- client/gui-gtk/mapview.c    2003/04/09 20:47:43     1.166
+++ client/gui-gtk/mapview.c    2003/04/14 06:03:49
@@ -620,7 +620,7 @@
       scaled_intro_sprite = NULL;
     }
 
-    if(map.xsize) { /* do we have a map at all */
+    if (map_exists()) { /* do we have a map at all */
       if(map_resized) {
        update_map_canvas_visible();
 
Index: client/gui-gtk-2.0/mapview.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/client/gui-gtk-2.0/mapview.c,v
retrieving revision 1.53
diff -u -r1.53 mapview.c
--- client/gui-gtk-2.0/mapview.c        2003/04/09 20:47:44     1.53
+++ client/gui-gtk-2.0/mapview.c        2003/04/14 06:03:51
@@ -599,7 +599,7 @@
     update_map_canvas_scrollbars_size();
 
     if (can_client_change_view()) {
-      if (map.xsize) { /* do we have a map at all */
+      if (map_exists()) { /* do we have a map at all */
         update_map_canvas_visible();
         update_map_canvas_scrollbars();
         refresh_overview_viewrect();
@@ -655,7 +655,7 @@
       scaled_intro_sprite = NULL;
     }
 
-    if (map.xsize) { /* do we have a map at all */
+    if (map_exists()) { /* do we have a map at all */
       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);
Index: client/gui-win32/mapview.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/client/gui-win32/mapview.c,v
retrieving revision 1.66
diff -u -r1.66 mapview.c
--- client/gui-win32/mapview.c  2003/04/09 20:47:44     1.66
+++ client/gui-win32/mapview.c  2003/04/14 06:03:53
@@ -106,7 +106,7 @@
   map_view_width=(map_win_width+NORMAL_TILE_WIDTH-1)/NORMAL_TILE_WIDTH;
   map_view_height=(map_win_height+NORMAL_TILE_HEIGHT-1)/NORMAL_TILE_HEIGHT; 
   update_map_canvas_scrollbars_size();
-  if (can_client_change_view() && (map.xsize != 0)) {
+  if (can_client_change_view() && map_exists()) {
     update_map_canvas_visible();
     update_map_canvas_scrollbars();
     refresh_overview_viewrect_real(NULL);
Index: client/gui-xaw/mapview.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/client/gui-xaw/mapview.c,v
retrieving revision 1.132
diff -u -r1.132 mapview.c
--- client/gui-xaw/mapview.c    2003/04/09 20:47:44     1.132
+++ client/gui-xaw/mapview.c    2003/04/14 06:03:54
@@ -523,7 +523,7 @@
     scaled_intro_pixmap=0; scaled_intro_pixmap_height=0;
   }
 
-  if(map.xsize) { /* do we have a map at all */
+  if (map_exists()) { /* do we have a map at all */
     if(map_canvas_store_twidth !=tile_width ||
        map_canvas_store_theight!=tile_height) { /* resized? */
       map_canvas_resize();

[Prev in Thread] Current Thread [Next in Thread]
  • [Freeciv-Dev] (PR#3998) add map_exists to climap, Jason Short <=