Complete.Org: Mailing Lists: Archives: freeciv-dev: December 2001:
[Freeciv-Dev] Re: (PR#1098)
Home

[Freeciv-Dev] Re: (PR#1098)

[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: (PR#1098)
From: jdorje@xxxxxxxxxxxxxxxxxxxxx
Date: Thu, 6 Dec 2001 22:34:29 -0800 (PST)

Vasco Alexandre Da Silva Costa wrote:

Seems good. However tile_is_known() returns an enum. The name sounds like
a predicate name.
So wouldn't returning (map_get_tile(x,y)->known>=TILE_KNOWN_FOGGED) make
more sense?

tile_is_known is definitely used in inconsistent ways. It is used in roughly 40 places, of which about half use it as a boolean (which the name would make you think it is). But the others compare it...at a glance I see
  tile_is_known(...) >= TILE_KNOWN_FOGGED (equivalent to boolean)
  tile_is_known(...) == TILE_KNOWN_FOGGED
  tile_is_known(...) == TILE_KNOWN
  tile_is_known(...) != TILE_UNKNOWN (equivalent to boolean)

So, I don't think changing it to a boolean is reasonable - but it could be renamed tile_get_known or something to that effect, which would remove the appeareance of it being a boolean. Taking it one step further, you might want to make all of the uses consistent with each other, but this is probably overkill.

Server-side, the equivalent function is called map_get_known. But then, the server usually deals with "map positions" while the client deals with "tiles", so I think tile_get_known is a reasonable name, assuming you don't want to duplicate the server's name of map_get_known().


Oh, one other thing that could use improvement: the boxed comment about the tile_is_known function. This should IMO describe the server/client descrepancy of freeciv, and only mention civworld as a side note.

Attached is a variant patch where I've renamed tile_is_known to tile_get_known. I also changed the boxed comment a little (Mike: you may want to fix it).

jason
? old
? topology
? client/diff
? client/gui-gtk/diff
Index: client/climisc.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/client/climisc.c,v
retrieving revision 1.64
diff -u -r1.64 climisc.c
--- client/climisc.c    2001/10/30 12:11:43     1.64
+++ client/climisc.c    2001/12/07 06:27:36
@@ -205,13 +205,13 @@
   old = map_get_continent(x,y);
 
   /* some sanity checks: */
-  assert(tile_is_known(x,y) >= TILE_KNOWN_FOGGED);
+  assert(tile_get_known(x,y) >= TILE_KNOWN_FOGGED);
   assert(map_get_terrain(x,y) != T_OCEAN);
   assert(old>0 && old<=max_cont_used);
   
   map_set_continent(x,y,newnumber);
   adjc_iterate(x, y, i, j) {
-    if (tile_is_known(i, j) >= TILE_KNOWN_FOGGED
+    if (tile_get_known(i, j) >= TILE_KNOWN_FOGGED
        && map_get_terrain(i, j) != T_OCEAN
        && map_get_continent(i, j) == old) {
       climap_renumber_continent(i, j, newnumber);
@@ -237,7 +237,7 @@
 
   this_con = -1;
   adjc_iterate(x, y, i, j) {
-    if (tile_is_known(i, j) >= TILE_KNOWN_FOGGED
+    if (tile_get_known(i, j) >= TILE_KNOWN_FOGGED
        && map_get_terrain(i, j) != T_OCEAN) {
       con = map_get_continent(i, j);
       if (con > 0) {
@@ -465,6 +465,20 @@
   return index;
 }
 
+/************************************************************************
+ A tile's "known" field is used by the server to store whether _each_
+ player knows the tile.  Client-side, it's used as an enum known_type
+ to track whether the tile is known/fogged/unknown.
+
+ Judicious use of this function also makes things very convenient for
+ civworld, since it uses both client and server-style storage; since it
+ uses the stock tilespec.c file this function serves as a wrapper.
+*************************************************************************/
+enum known_type tile_get_known(int x, int y)
+{
+  return (enum known_type) map_get_tile(x, y)->known;
+}
+
 /**************************************************************************
 Find something sensible to display. This is used to overwrite the
 intro gfx.
@@ -497,7 +511,7 @@
     /* Just any known tile will do; search near the middle first. */
     iterate_outward(map.xsize / 2, map.ysize / 2,
                    MAX(map.xsize / 2, map.ysize / 2), x, y) {
-      if (tile_is_known(x, y)) {
+      if (tile_get_known(x, y)) {
        center_tile_mapcanvas(x, y);
        goto OUT;
       }
Index: client/climisc.h
===================================================================
RCS file: /home/freeciv/CVS/freeciv/client/climisc.h,v
retrieving revision 1.25
diff -u -r1.25 climisc.h
--- client/climisc.h    2001/10/30 12:11:43     1.25
+++ client/climisc.h    2001/12/07 06:27:36
@@ -13,8 +13,11 @@
 #ifndef FC__CLIMISC_H
 #define FC__CLIMISC_H
 
+#include "shared.h" /* MAX_LEN_NAME */
+
 struct city;
 struct Clause;
+struct player;
 typedef int cid;
 typedef int wid;
 
@@ -37,6 +40,7 @@
 int client_warming_sprite(void);
 int client_cooling_sprite(void);
 
+enum known_type tile_get_known(int x, int y);
 void center_on_something(void);
 
 int concat_tile_activity_text(char *buf, int buf_size, int x, int y);
Index: client/control.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/client/control.c,v
retrieving revision 1.63
diff -u -r1.63 control.c
--- client/control.c    2001/10/26 07:19:07     1.63
+++ client/control.c    2001/12/07 06:27:37
@@ -23,6 +23,7 @@
 
 #include "chatline_g.h"
 #include "citydlg_g.h"
+#include "climisc.h"
 #include "dialogs_g.h"
 #include "gui_main_g.h"
 #include "mapctrl_g.h"
@@ -1071,7 +1072,7 @@
     }
   } square_iterate_end;
   
-  if(!pinfo->carried && tile_is_known(punit->x,punit->y) == TILE_KNOWN)
+  if(!pinfo->carried && tile_get_known(punit->x,punit->y) == TILE_KNOWN)
     refresh_tile_mapcanvas(punit->x, punit->y, 1);
 
   if(get_unit_in_focus()==punit) update_menus();
Index: client/packhand.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/client/packhand.c,v
retrieving revision 1.196
diff -u -r1.196 packhand.c
--- client/packhand.c   2001/10/18 16:45:31     1.196
+++ client/packhand.c   2001/12/07 06:27:39
@@ -875,7 +875,7 @@
       struct city *pcity;
       pcity=map_get_city(punit->x, punit->y);
       
-      if(tile_is_known(packet->x, packet->y) == TILE_KNOWN) {
+      if(tile_get_known(packet->x, packet->y) == TILE_KNOWN) {
        do_move_unit(punit, packet);
        update_unit_focus();
       }
@@ -946,7 +946,7 @@
     dest_x = packet->x;
     dest_y = packet->y;
     /*fog of war*/
-    if (!(tile_is_known(punit->x,punit->y) == TILE_KNOWN)) {
+    if (!(tile_get_known(punit->x,punit->y) == TILE_KNOWN)) {
       client_remove_unit(packet->id);
       refresh_tile_mapcanvas(dest_x, dest_y, 1);
     }
@@ -1474,7 +1474,7 @@
     whole_map_iterate_end;
     climap_init_continents();
     whole_map_iterate(x, y) {
-      if ((tile_is_known(x, y) >= TILE_KNOWN_FOGGED) &&
+      if ((tile_get_known(x, y) >= TILE_KNOWN_FOGGED) &&
          (map_get_terrain(x, y) != T_OCEAN))
        climap_update_continents(x, y);
     }
@@ -1493,7 +1493,7 @@
        have changed it affects the adjacent tiles */
     if (tile_changed) {
       adjc_iterate(x, y, x1, y1) {
-       if (tile_is_known(x1, y1) >= TILE_KNOWN_FOGGED)
+       if (tile_get_known(x1, y1) >= TILE_KNOWN_FOGGED)
          refresh_tile_mapcanvas(x1, y1, 1);
       }
       adjc_iterate_end;
@@ -1504,7 +1504,7 @@
        removed here */
     if (old_known == TILE_UNKNOWN && packet->known >= TILE_KNOWN_FOGGED) {     
       cartesian_adjacent_iterate(x, y, x1, y1) {
-       if (tile_is_known(x1, y1) >= TILE_KNOWN_FOGGED)
+       if (tile_get_known(x1, y1) >= TILE_KNOWN_FOGGED)
          refresh_tile_mapcanvas(x1, y1, 1);
       }
       cartesian_adjacent_iterate_end;
Index: client/tilespec.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/client/tilespec.c,v
retrieving revision 1.57
diff -u -r1.57 tilespec.c
--- client/tilespec.c   2001/11/11 15:49:18     1.57
+++ client/tilespec.c   2001/12/07 06:27:40
@@ -43,6 +43,7 @@
 #include "support.h"
 #include "unit.h"
 
+#include "climisc.h" /* for tile_get_known() */
 #include "control.h" /* for fill_xxx */
 #include "graphics_g.h"
 #include "options.h" /* for fill_xxx */
@@ -904,7 +905,7 @@
   if(city_unhappy(pcity))
     *sprs++ = sprites.city.disorder;
 
-  if(tile_is_known(pcity->x, pcity->y) == TILE_KNOWN_FOGGED && draw_fog_of_war)
+  if(tile_get_known(pcity->x, pcity->y) == TILE_KNOWN_FOGGED && 
draw_fog_of_war)
     *sprs++ = sprites.tx.fog;
 
   /* Put the size sprites last, so that they are not obscured
@@ -1114,7 +1115,7 @@
 
   *solid_bg = 0;
 
-  if (!tile_is_known(x, y))
+  if (!tile_get_known(x, y))
     return -1;
 
   pcity = map_get_city(x, y);
@@ -1292,7 +1293,7 @@
     dither[dir] = get_dither(ttype, T_UNKNOWN);
   }
   adjc_dir_iterate(x, y, x1, y1, dir8) {
-    if (!DIR_IS_CARDINAL(dir8) || !tile_is_known(x1, y1)) {
+    if (!DIR_IS_CARDINAL(dir8) || !tile_get_known(x1, y1)) {
       continue;
     }
 
@@ -1342,7 +1343,7 @@
 
   ptile=map_get_tile(abs_x0, abs_y0);
 
-  if (tile_is_known(abs_x0,abs_y0) == TILE_UNKNOWN) {
+  if (tile_get_known(abs_x0,abs_y0) == TILE_UNKNOWN) {
     return 0;
   }
 
@@ -1559,7 +1560,7 @@
   if(tspecial & S_AIRBASE && draw_fortress_airbase) *sprs++ = 
sprites.tx.airbase;
   if(tspecial & S_POLLUTION && draw_pollution) *sprs++ = sprites.tx.pollution;
   if(tspecial & S_FALLOUT && draw_pollution) *sprs++ = sprites.tx.fallout;
-  if(tile_is_known(abs_x0,abs_y0) == TILE_KNOWN_FOGGED && draw_fog_of_war) 
+  if(tile_get_known(abs_x0,abs_y0) == TILE_KNOWN_FOGGED && draw_fog_of_war)
     *sprs++ = sprites.tx.fog;
 
   if(!citymode) {
@@ -1572,7 +1573,7 @@
     adjc_dir_iterate(abs_x0, abs_y0, x, y, dir8) {
       if (!DIR_IS_CARDINAL(dir8))
        continue;
-      known[dir8_to_dir4(dir8)] = (tile_is_known(x, y) != TILE_UNKNOWN);
+      known[dir8_to_dir4(dir8)] = (tile_get_known(x, y) != TILE_UNKNOWN);
     } adjc_dir_iterate_end;
 
     tileno =
@@ -1761,7 +1762,7 @@
   struct unit *punit;
   struct city *pcity;
 
-  if(!tile_is_known(x, y)) {
+  if(!tile_get_known(x, y)) {
     color=COLOR_STD_BLACK;
   } else if((pcity=map_get_city(x, y))) {
     if(pcity->owner==game.player_idx)
Index: client/gui-gtk/citydlg.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/client/gui-gtk/citydlg.c,v
retrieving revision 1.103
diff -u -r1.103 citydlg.c
--- client/gui-gtk/citydlg.c    2001/12/05 04:13:04     1.103
+++ client/gui-gtk/citydlg.c    2001/12/07 06:27:42
@@ -1772,7 +1772,7 @@
       int map_x, map_y;
       if (is_valid_city_coords(city_x, city_y)
          && city_map_to_map(&map_x, &map_y, pcity, city_x, city_y)) {
-       if (tile_is_known(map_x, map_y)) {
+       if (tile_get_known(map_x, map_y)) {
          int canvas_x, canvas_y;
          city_pos_to_canvas_pos(city_x, city_y, &canvas_x, &canvas_y);
          put_one_tile_full(pdialog->map_canvas_store, map_x, map_y,
@@ -1783,7 +1783,7 @@
 
   /* We have to put the output afterwards or it will be covered. */
   city_map_checked_iterate(pcity->x, pcity->y, x, y, map_x, map_y) {
-    if (tile_is_known(map_x, map_y)) {
+    if (tile_get_known(map_x, map_y)) {
       int canvas_x, canvas_y;
       city_pos_to_canvas_pos(x, y, &canvas_x, &canvas_y);
       if (pcity->city_map[x][y] == C_TILE_WORKER) {
@@ -1802,7 +1802,7 @@
      to fix this, but maybe it wouldn't be a good idea because the
      lines would get obscured. */
   city_map_checked_iterate(pcity->x, pcity->y, x, y, map_x, map_y) {
-    if (tile_is_known(map_x, map_y)) {
+    if (tile_get_known(map_x, map_y)) {
       int canvas_x, canvas_y;
       city_pos_to_canvas_pos(x, y, &canvas_x, &canvas_y);
       if (pcity->city_map[x][y] == C_TILE_UNAVAILABLE) {
@@ -1827,7 +1827,7 @@
 
       if (is_valid_city_coords(x, y)
          && city_map_to_map(&map_x, &map_y, pcity, x, y)
-         && tile_is_known(map_x, map_y)) {
+         && tile_get_known(map_x, map_y)) {
        pixmap_put_tile(pdialog->map_canvas_store, map_x, map_y,
                        x * NORMAL_TILE_WIDTH, y * NORMAL_TILE_HEIGHT, 1);
        if (pcity->city_map[x][y] == C_TILE_WORKER)
Index: client/gui-gtk/mapctrl.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/client/gui-gtk/mapctrl.c,v
retrieving revision 1.49
diff -u -r1.49 mapctrl.c
--- client/gui-gtk/mapctrl.c    2001/10/09 18:56:59     1.49
+++ client/gui-gtk/mapctrl.c    2001/12/07 06:27:42
@@ -108,7 +108,7 @@
   struct unit *punit;
   struct tile *ptile=map_get_tile(xtile, ytile);
 
-  if(ptile->known>=TILE_KNOWN_FOGGED) {
+  if(tile_get_known(xtile, ytile) >= TILE_KNOWN_FOGGED) {
     p=gtk_window_new(GTK_WINDOW_POPUP);
     b=gtk_vbox_new(FALSE, 0);
     gtk_container_add(GTK_CONTAINER(p), b);
Index: client/gui-gtk/mapview.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/client/gui-gtk/mapview.c,v
retrieving revision 1.108
diff -u -r1.108 mapview.c
--- client/gui-gtk/mapview.c    2001/11/27 20:11:29     1.108
+++ client/gui-gtk/mapview.c    2001/12/07 06:27:44
@@ -134,7 +134,7 @@
   int fill_bg;
   struct player *pplayer;
 
-  if (normalize_map_pos(&x, &y) && tile_is_known(x, y)) {
+  if (normalize_map_pos(&x, &y) && tile_get_known(x, y)) {
     int count = fill_tile_sprite_array(tile_sprs, x, y, citymode, &fill_bg, 
&pplayer);
     int i = 0;
 
@@ -2103,7 +2103,7 @@
   assert(is_real_tile(x, y));
   normalize_map_pos(&x, &y);
 
-  fog = tile_is_known(x, y) == TILE_KNOWN_FOGGED && draw_fog_of_war;
+  fog = tile_get_known(x, y) == TILE_KNOWN_FOGGED && draw_fog_of_war;
   pcity = map_get_city(x, y);
   punit = get_drawable_unit(x, y, citymode);
   pfocus = get_unit_in_focus();
Index: client/gui-mui/graphics.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/client/gui-mui/graphics.c,v
retrieving revision 1.16
diff -u -r1.16 graphics.c
--- client/gui-mui/graphics.c   2001/10/15 19:51:01     1.16
+++ client/gui-mui/graphics.c   2001/12/07 06:27:45
@@ -899,7 +899,7 @@
   int fill_bg;
   struct player *pplayer;
 
-  if (normalize_map_pos(&x, &y) && tile_is_known(x, y)) {
+  if (normalize_map_pos(&x, &y) && tile_get_known(x, y)) {
     int count = fill_tile_sprite_array(tile_sprs, x, y, citymode, &fill_bg, 
&pplayer);
     int i = 0;
 
@@ -1250,7 +1250,7 @@
 
   assert(is_real_tile(x, y));
   normalize_map_pos(&x, &y);
-  fog = tile_is_known(x, y) == TILE_KNOWN_FOGGED && draw_fog_of_war;
+  fog = tile_get_known(x, y) == TILE_KNOWN_FOGGED && draw_fog_of_war;
   pcity = map_get_city(x, y);
   punit = get_drawable_unit(x, y, citymode);
   pfocus = get_unit_in_focus();
Index: client/gui-mui/mapclass.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/client/gui-mui/mapclass.c,v
retrieving revision 1.69
diff -u -r1.69 mapclass.c
--- client/gui-mui/mapclass.c   2001/12/05 04:13:05     1.69
+++ client/gui-mui/mapclass.c   2001/12/07 06:27:46
@@ -2300,7 +2300,7 @@
          the city radius can be fogged. */
 
       city_map_checked_iterate(pcity->x, pcity->y, x, y, map_x, map_y) {
-       if (tile_is_known(map_x, map_y)) {
+       if (tile_get_known(map_x, map_y)) {
          int canvas_x, canvas_y;
          city_pos_to_canvas_pos(x, y, &canvas_x, &canvas_y);
          put_one_tile_full(_rp(o), map_x, map_y, canvas_x + _mleft(o), 
canvas_y + _mtop(o), 1);
@@ -2309,7 +2309,7 @@
 
       /* We have to put the output afterwards or it will be covered. */
       city_map_checked_iterate(pcity->x, pcity->y, x, y, map_x, map_y) {
-       if (tile_is_known(map_x, map_y)) {
+       if (tile_get_known(map_x, map_y)) {
          int canvas_x, canvas_y;
          city_pos_to_canvas_pos(x, y, &canvas_x, &canvas_y);
          if (pcity->city_map[x][y]==C_TILE_WORKER) {
@@ -2327,7 +2327,7 @@
          to fix this, but maybe it wouldn't be a good idea because the
          lines would get obscured. */
       city_map_checked_iterate(pcity->x, pcity->y, x, y, map_x, map_y) {
-       if (tile_is_known(map_x, map_y))
+       if (tile_get_known(map_x, map_y))
        {
          int canvas_x, canvas_y;
          city_pos_to_canvas_pos(x, y, &canvas_x, &canvas_y);
@@ -2367,7 +2367,7 @@
            LONG tilex, tiley;
 
            if (city_map_to_map(&tilex, &tiley, pcity, x, y)
-               && tile_is_known(tilex, tiley)) {
+               && tile_get_known(tilex, tiley)) {
              put_tile(_rp(o), tilex, tiley, x1, y1, 1);
 
              if (pcity->city_map[x][y] == C_TILE_WORKER) {
Index: client/gui-win32/citydlg.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/client/gui-win32/citydlg.c,v
retrieving revision 1.6
diff -u -r1.6 citydlg.c
--- client/gui-win32/citydlg.c  2001/12/05 04:13:06     1.6
+++ client/gui-win32/citydlg.c  2001/12/07 06:27:48
@@ -464,7 +464,7 @@
       int map_x, map_y;
       if (is_valid_city_coords(city_x, city_y)
           && city_map_to_map(&map_x, &map_y, pcity, city_x, city_y)) {
-        if (tile_is_known(map_x, map_y)) {
+        if (tile_get_known(map_x, map_y)) {
           int canvas_x, canvas_y;
           city_pos_to_canvas_pos(city_x, city_y, &canvas_x, &canvas_y);
           put_one_tile_full(hdc, map_x, map_y,
@@ -475,7 +475,7 @@
   
   /* We have to put the output afterwards or it will be covered. */
   city_map_checked_iterate(pcity->x, pcity->y, x, y, map_x, map_y) {
-    if (tile_is_known(map_x, map_y)) {
+    if (tile_get_known(map_x, map_y)) {
       int canvas_x, canvas_y;
       city_pos_to_canvas_pos(x, y, &canvas_x, &canvas_y);
       if (pcity->city_map[x][y]==C_TILE_WORKER) {
@@ -493,7 +493,7 @@
      to fix this, but maybe it wouldn't be a good idea because the
      lines would get obscured. */
   city_map_checked_iterate(pcity->x, pcity->y, x, y, map_x, map_y) {
-    if (tile_is_known(map_x, map_y)) {
+    if (tile_get_known(map_x, map_y)) {
       int canvas_x, canvas_y;
       city_pos_to_canvas_pos(x, y, &canvas_x, &canvas_y);
       if (pcity->city_map[x][y]==C_TILE_UNAVAILABLE) {
@@ -519,7 +519,7 @@
 
       if (is_valid_city_coords(x, y)
          && city_map_to_map(&map_x, &map_y, pcity, x, y)
-         && tile_is_known(map_x, map_y)) {
+         && tile_get_known(map_x, map_y)) {
        pixmap_put_tile(citydlgdc, map_x, map_y,
                        x*NORMAL_TILE_WIDTH,
                        y*NORMAL_TILE_HEIGHT,1);
Index: client/gui-win32/mapview.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/client/gui-win32/mapview.c,v
retrieving revision 1.13
diff -u -r1.13 mapview.c
--- client/gui-win32/mapview.c  2001/11/27 20:11:30     1.13
+++ client/gui-win32/mapview.c  2001/12/07 06:27:49
@@ -274,7 +274,7 @@
   int fill_bg;
   struct player *pplayer;
 
-  if (normalize_map_pos(&x, &y) && tile_is_known(x, y)) {
+  if (normalize_map_pos(&x, &y) && tile_get_known(x, y)) {
     int count = fill_tile_sprite_array(tile_sprs, x, y, citymode, &fill_bg, 
&pplayer);
 
 
@@ -1729,7 +1729,7 @@
   }
   is_real = normalize_map_pos(&x, &y);
   assert(is_real);
-  fog = tile_is_known(x, y) == TILE_KNOWN_FOGGED && draw_fog_of_war;
+  fog = tile_get_known(x, y) == TILE_KNOWN_FOGGED && draw_fog_of_war;
   pcity = map_get_city(x, y);
   punit = get_drawable_unit(x, y, citymode);
   pfocus = get_unit_in_focus();
Index: client/gui-xaw/citydlg.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/client/gui-xaw/citydlg.c,v
retrieving revision 1.58
diff -u -r1.58 citydlg.c
--- client/gui-xaw/citydlg.c    2001/10/26 08:07:16     1.58
+++ client/gui-xaw/citydlg.c    2001/12/07 06:27:50
@@ -1569,7 +1569,7 @@
 
       if (is_valid_city_coords(x, y)
          && city_map_to_map(&map_x, &map_y, pcity, x, y)
-         && tile_is_known(map_x, map_y)) {
+         && tile_get_known(map_x, map_y)) {
        pixmap_put_tile(XtWindow(pdialog->map_canvas), map_x, map_y,
                        x * NORMAL_TILE_WIDTH, y * NORMAL_TILE_HEIGHT, 1);
        if (pcity->city_map[x][y] == C_TILE_WORKER)
Index: client/gui-xaw/mapview.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/client/gui-xaw/mapview.c,v
retrieving revision 1.88
diff -u -r1.88 mapview.c
--- client/gui-xaw/mapview.c    2001/11/27 20:11:31     1.88
+++ client/gui-xaw/mapview.c    2001/12/07 06:27:56
@@ -986,7 +986,7 @@
   int fill_bg;
   struct player *pplayer;
 
-  if (normalize_map_pos(&x, &y) && tile_is_known(x, y)) {
+  if (normalize_map_pos(&x, &y) && tile_get_known(x, y)) {
     int count = fill_tile_sprite_array(tile_sprs, x, y, citymode, &fill_bg, 
&pplayer);
     int i = 0;
 
Index: common/map.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/common/map.c,v
retrieving revision 1.101
diff -u -r1.101 map.c
--- common/map.c        2001/12/02 13:30:36     1.101
+++ common/map.c        2001/12/07 06:27:57
@@ -1217,22 +1217,12 @@
   return MAP_TILE(x, y)->city;
 }
 
-
 /***************************************************************
 ...
 ***************************************************************/
 void map_set_city(int x, int y, struct city *pcity)
 {
   MAP_TILE(x, y)->city = pcity;
-}
-
-
-/***************************************************************
-Only for use on the client side
-***************************************************************/
-enum known_type tile_is_known(int x, int y)
-{
-  return (enum known_type) (MAP_TILE(x, y)->known);
 }
 
 /***************************************************************
Index: common/map.h
===================================================================
RCS file: /home/freeciv/CVS/freeciv/common/map.h,v
retrieving revision 1.105
diff -u -r1.105 map.h
--- common/map.h        2001/12/02 13:30:37     1.105
+++ common/map.h        2001/12/07 06:27:57
@@ -272,7 +272,6 @@
 void map_set_special(int x, int y, enum tile_special_type spe);
 void map_clear_special(int x, int y, enum tile_special_type spe);
 void tile_init(struct tile *ptile);
-enum known_type tile_is_known(int x, int y);
 int is_real_tile(int x, int y);
 int is_normal_map_pos(int x, int y);
 

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