Complete.Org: Mailing Lists: Archives: freeciv-dev: June 2004:
[Freeciv-Dev] (PR#7481) meta-ticket for hex maps
Home

[Freeciv-Dev] (PR#7481) meta-ticket for hex maps

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: undisclosed-recipients: ;
Subject: [Freeciv-Dev] (PR#7481) meta-ticket for hex maps
From: "Jason Short" <jdorje@xxxxxxxxxxxxxxxxxxxxx>
Date: Thu, 10 Jun 2004 17:39:26 -0700
Reply-to: rt@xxxxxxxxxxx

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

Here's an update of the demo hex patch.  Since the citymap changes it is
now much smaller.

- Run it with the isophex tileset for best results.  Of course the
isophex tileset is out of date and won't work with current CVS.  Isophex
should go with topology 12-15.

- It's only tested with topology 13.  It probably works with 8-15.

jason

Index: client/citydlg_common.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/client/citydlg_common.c,v
retrieving revision 1.35
diff -u -r1.35 citydlg_common.c
--- client/citydlg_common.c     2 Jun 2004 22:54:14 -0000       1.35
+++ client/citydlg_common.c     11 Jun 2004 00:23:12 -0000
@@ -37,7 +37,7 @@
 int get_citydlg_canvas_width(void)
 {
   if (is_isometric) {
-    return (CITY_MAP_SIZE - 1) * NORMAL_TILE_WIDTH;
+    return (CITY_MAP_SIZE - 2) * NORMAL_TILE_WIDTH;
   } else {
     return CITY_MAP_SIZE * NORMAL_TILE_WIDTH;
   }
@@ -49,7 +49,7 @@
 int get_citydlg_canvas_height(void)
 {
   if (is_isometric) {
-    return (CITY_MAP_SIZE - 1) * NORMAL_TILE_HEIGHT;
+    return (CITY_MAP_SIZE) * NORMAL_TILE_HEIGHT;
   } else {
     return CITY_MAP_SIZE * NORMAL_TILE_HEIGHT;
   }
@@ -61,6 +61,10 @@
 **************************************************************************/
 bool city_to_canvas_pos(int *canvas_x, int *canvas_y, int city_x, int city_y)
 {
+  const int x0 = CITY_MAP_RADIUS, y0 = CITY_MAP_RADIUS;
+  const int width = get_citydlg_canvas_width();
+  const int height = get_citydlg_canvas_height();
+
   if (is_isometric) {
     /*
      * The top-left corner is in the center of tile (-2, 2).  However,
@@ -68,16 +72,19 @@
      * subtract off half a tile in each direction.  For a more
      * rigorous example, see map_pos_to_canvas_pos().
      */
-    int iso_x = (city_x - city_y) + (2 * CITY_MAP_RADIUS);
-    int iso_y = (city_x + city_y) - (0);
+    int iso_x = (city_x - city_y) - (x0 - y0);
+    int iso_y = (city_x + city_y) - (x0 + y0);
 
-    *canvas_x = (iso_x - 1) * NORMAL_TILE_WIDTH / 2;
-    *canvas_y = (iso_y - 1) * NORMAL_TILE_HEIGHT / 2;
+    *canvas_x = iso_x * NORMAL_TILE_WIDTH / 2;
+    *canvas_y = iso_y * NORMAL_TILE_HEIGHT / 2;
   } else {
-    *canvas_x = city_x * NORMAL_TILE_WIDTH;
-    *canvas_y = city_y * NORMAL_TILE_HEIGHT;
+    *canvas_x = (city_x - x0) * NORMAL_TILE_WIDTH;
+    *canvas_y = (city_y - y0) * NORMAL_TILE_HEIGHT;
   }
 
+  *canvas_x += (width - NORMAL_TILE_WIDTH) / 2;
+  *canvas_y += (height - NORMAL_TILE_HEIGHT) / 2;
+
   if (!is_valid_city_coords(city_x, city_y)) {
     assert(FALSE);
     return FALSE;
Index: client/mapview_common.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/client/mapview_common.c,v
retrieving revision 1.123
diff -u -r1.123 mapview_common.c
--- client/mapview_common.c     10 Jun 2004 01:04:52 -0000      1.123
+++ client/mapview_common.c     11 Jun 2004 00:26:11 -0000
@@ -1711,6 +1711,7 @@
   }
   canvas_src_x += NORMAL_TILE_WIDTH/2;
   canvas_src_y += NORMAL_TILE_HEIGHT/2;
+  assert(is_valid_dir(dir));
   DIRSTEP(canvas_dest_x, canvas_dest_y, dir);
   canvas_dest_x = canvas_src_x + (NORMAL_TILE_WIDTH * canvas_dest_x) / 2;
   canvas_dest_y = canvas_src_y + (NORMAL_TILE_WIDTH * canvas_dest_y) / 2;
Index: common/city.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/common/city.c,v
retrieving revision 1.217
diff -u -r1.217 city.c
--- common/city.c       10 Jun 2004 01:04:54 -0000      1.217
+++ common/city.c       11 Jun 2004 00:26:12 -0000
@@ -63,6 +63,7 @@
 **************************************************************************/
 bool is_valid_city_coords(const int city_x, const int city_y)
 {
+  int dist;
   /* The city's valid positions are in a circle of radius CITY_MAP_RADIUS
    * around the city center.  Depending on the value of CITY_MAP_RADIUS
    * this circle will be:
@@ -79,9 +80,17 @@
    *
    * FIXME: this won't work for hexagonal tiles.
    */
-  if (CITY_MAP_RADIUS * CITY_MAP_RADIUS + 1
-      >= ((city_x - CITY_MAP_RADIUS) * (city_x - CITY_MAP_RADIUS) +
-         (city_y - CITY_MAP_RADIUS) * (city_y - CITY_MAP_RADIUS))) {
+
+  if (topo_has_flag(TF_HEX)) {
+    dist = vector_to_map_distance(city_x - CITY_MAP_RADIUS,
+                                 city_y - CITY_MAP_RADIUS);
+    dist = dist * dist;
+  } else {
+    dist = ((city_x - CITY_MAP_RADIUS) * (city_x - CITY_MAP_RADIUS) +
+           (city_y - CITY_MAP_RADIUS) * (city_y - CITY_MAP_RADIUS));
+  }
+
+  if (CITY_MAP_RADIUS * CITY_MAP_RADIUS + 1 >= dist) {
     return TRUE;
   } else {
     return FALSE;
@@ -261,8 +270,9 @@
 **************************************************************************/
 enum city_tile_type get_worker_city(struct city *pcity, int city_x, int city_y)
 {
-  if (!is_valid_city_coords(city_x, city_y)) 
+  if (!is_valid_city_coords(city_x, city_y)) {
     return C_TILE_UNAVAILABLE;
+  }
   return pcity->city_map[city_x][city_y];
 }
 
Index: common/city.h
===================================================================
RCS file: /home/freeciv/CVS/freeciv/common/city.h,v
retrieving revision 1.147
diff -u -r1.147 city.h
--- common/city.h       10 Jun 2004 01:04:54 -0000      1.147
+++ common/city.h       11 Jun 2004 00:26:13 -0000
@@ -66,7 +66,7 @@
 #define CITY_MAP_SIZE (CITY_MAP_RADIUS * 2 + 1) 
 
 /* Number of tiles a city can use */
-#define CITY_TILES (CITY_MAP_SIZE * CITY_MAP_SIZE - 4)
+#define CITY_TILES 19
 
 #define INCITE_IMPOSSIBLE_COST (1000 * 1000 * 1000)
 
Index: common/map.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/common/map.c,v
retrieving revision 1.169
diff -u -r1.169 map.c
--- common/map.c        6 Jun 2004 20:45:27 -0000       1.169
+++ common/map.c        11 Jun 2004 00:26:13 -0000
@@ -42,10 +42,6 @@
 const int DIR_DX[8] = { -1, 0, 1, -1, 1, -1, 0, 1 };
 const int DIR_DY[8] = { -1, -1, -1, 0, 0, 1, 1, 1 };
 
-/* like DIR_DX[] and DIR_DY[], only cartesian */
-const int CAR_DIR_DX[4] = {1, 0, -1, 0};
-const int CAR_DIR_DY[4] = {0, 1, 0, -1};
-
 /* Names of specials.
  * (These must correspond to enum tile_special_type in terrain.h.)
  */
@@ -325,11 +321,15 @@
 ***************************************************************/
 int real_map_distance(int x0, int y0, int x1, int y1)
 {
-  int dx, dy;
+  if (topo_has_flag(TF_HEX)) {
+    return map_distance(x0, y0, x1, y1);
+  } else {
+    int dx, dy;
 
-  map_distance_vector(&dx, &dy, x0, y0, x1, y1);
+    map_distance_vector(&dx, &dy, x0, y0, x1, y1);
 
-  return MAX(abs(dx), abs(dy));
+    return MAX(abs(dx), abs(dy));
+  }
 }
 
 /***************************************************************
@@ -337,13 +337,53 @@
 ***************************************************************/
 int sq_map_distance(int x0, int y0, int x1, int y1)
 {
-  /* We assume map_distance_vector gives us the vector with the
-     minimum squared distance. Right now this is true. */
-  int dx, dy;
+  if (topo_has_flag(TF_HEX)) {
+    int dist = map_distance(x0, y0, x1, y1);
 
-  map_distance_vector(&dx, &dy, x0, y0, x1, y1);
+    /* In a hex map the pythagorean distance is not significantly different
+     * from the map distance.  If you think about what the value's used
+     * for it becomes apparent the two should be the same. */
+    return dist * dist;
+  } else {
+    /* We assume map_distance_vector gives us the vector with the
+     * minimum squared distance. Right now this is true. */
+    int dx, dy;
+
+    map_distance_vector(&dx, &dy, x0, y0, x1, y1);
+
+    return dx * dx + dy * dy;
+  }
+}
 
-  return (dx*dx + dy*dy);
+int vector_to_map_distance(int dx, int dy)
+{
+  if (topo_has_flag(TF_HEX)) {
+    if (topo_has_flag(TF_ISO)) {
+      /* Iso-hex: you can't move NE or SW. */
+      if ((dx < 0 && dy > 0)
+         || (dx > 0 && dy < 0)) {
+       /* Diagonal moves in this direction aren't allowed, so it will take
+        * the full number of moves. */
+       return abs(dx) + abs(dy);
+      } else {
+       /* Diagonal moves in this direction *are* allowed. */
+       return MAX(abs(dx), abs(dy));
+      }
+    } else {
+      /* Hex: you can't move SE or NW. */
+      if ((dx > 0 && dy > 0)
+         || (dx < 0 && dy < 0)) {
+       /* Diagonal moves in this direction aren't allowed, so it will take
+        * the full number of moves. */
+       return abs(dx) + abs(dy);
+      } else {
+       /* Diagonal moves in this direction *are* allowed. */
+       return MAX(abs(dx), abs(dy));
+      }
+    }
+  } else {
+    return abs(dx) + abs(dy);
+  }
 }
 
 /***************************************************************
@@ -357,7 +397,7 @@
 
   map_distance_vector(&dx, &dy, x0, y0, x1, y1);
 
-  return abs(dx) + abs(dy);
+  return vector_to_map_distance(dx, dy);
 }
 
 /***************************************************************
@@ -567,8 +607,9 @@
     ptile = map_get_tile(x1, y1);
     if (is_ocean(ptile->terrain)
        || tile_has_special(ptile, S_RIVER)
-       || tile_has_special(ptile, S_IRRIGATION))
+       || tile_has_special(ptile, S_IRRIGATION)) {
       return TRUE;
+    }
   } cartesian_adjacent_iterate_end;
 
   return FALSE;
@@ -1476,10 +1517,10 @@
     return DIR8_SOUTHWEST;
   case DIR8_NORTHWEST:
     return DIR8_WEST;
-  default:
-    assert(0);
-    return -1;
   }
+
+  assert(0);
+  return -1;
 }
 
 /**************************************************************************
@@ -1488,18 +1529,20 @@
 bool is_valid_dir(enum direction8 dir)
 {
   switch (dir) {
-  case DIR8_NORTH:
+  case DIR8_SOUTHEAST:
+  case DIR8_NORTHWEST:
+    return !(topo_has_flag(TF_HEX) && !topo_has_flag(TF_ISO));
   case DIR8_NORTHEAST:
+  case DIR8_SOUTHWEST:
+    return !(topo_has_flag(TF_HEX) && topo_has_flag(TF_ISO));
+  case DIR8_NORTH:
   case DIR8_EAST:
-  case DIR8_SOUTHEAST:
   case DIR8_SOUTH:
-  case DIR8_SOUTHWEST:
   case DIR8_WEST:
-  case DIR8_NORTHWEST:
     return TRUE;
-  default:
-    return FALSE;
   }
+
+  return FALSE;
 }
 
 /**************************************************************************
Index: common/map.h
===================================================================
RCS file: /home/freeciv/CVS/freeciv/common/map.h,v
retrieving revision 1.187
diff -u -r1.187 map.h
--- common/map.h        6 Jun 2004 20:45:27 -0000       1.187
+++ common/map.h        11 Jun 2004 00:26:35 -0000
@@ -150,7 +150,8 @@
   /* Bit-values. */
   TF_WRAPX = 1,
   TF_WRAPY = 2,
-  TF_ISO = 4
+  TF_ISO = 4,
+  TF_HEX = 8
 };
 
 #define CURRENT_TOPOLOGY (map.topology_id)
@@ -166,6 +167,7 @@
 const char *map_get_tile_fpt_text(int x, int y);
 struct tile *map_get_tile(int x, int y);
 
+int vector_to_map_distance(int dx, int dy);
 int map_distance(int x0, int y0, int x1, int y1);
 int real_map_distance(int x0, int y0, int x1, int y1);
 int sq_map_distance(int x0, int y0, int x1, int y1);
@@ -199,13 +201,13 @@
 
 /* Obscure math.  See explanation in doc/HACKING. */
 #define native_to_map_pos(pmap_x, pmap_y, nat_x, nat_y)                     \
-  (topo_has_flag(TF_ISO)                                                    \
+  ((topo_has_flag(TF_ISO) || topo_has_flag(TF_HEX))                         \
    ? (*(pmap_x) = ((nat_y) + ((nat_y) & 1)) / 2 + (nat_x),                  \
       *(pmap_y) = (nat_y) - *(pmap_x) + map.xsize)                          \
    : (*(pmap_x) = (nat_x), *(pmap_y) = (nat_y)))
 
 #define map_to_native_pos(pnat_x, pnat_y, map_x, map_y)                     \
-  (topo_has_flag(TF_ISO)                                                    \
+  ((topo_has_flag(TF_ISO) || topo_has_flag(TF_HEX))                        \
    ? (*(pnat_y) = (map_x) + (map_y) - map.xsize,                            \
       *(pnat_x) = (2 * (map_x) - *(pnat_y) - (*(pnat_y) & 1)) / 2)          \
    : (*(pnat_x) = (map_x), *(pnat_y) = (map_y)))
@@ -283,9 +285,10 @@
  * we bend this rule here.
  */
 #define MAPSTEP(dest_x, dest_y, src_x, src_y, dir)     \
-(    (dest_x) = (src_x) + DIR_DX[(dir)],               \
-     (dest_y) = (src_y) + DIR_DY[(dir)],               \
-     normalize_map_pos(&(dest_x), &(dest_y)))
+  (is_valid_dir(dir)                                    \
+   && ((dest_x) = (src_x) + DIR_DX[(dir)],             \
+       (dest_y) = (src_y) + DIR_DY[(dir)],             \
+       normalize_map_pos(&(dest_x), &(dest_y))))
 
 struct player *map_get_owner(int x, int y);
 void map_set_owner(int x, int y, struct player *pplayer);
@@ -312,7 +315,6 @@
 bool contains_special(enum tile_special_type all,
                      enum tile_special_type to_test_for);
 
-
 bool is_singular_map_pos(int map_x, int map_y, int dist);
 bool normalize_map_pos(int *x, int *y);
 void nearest_real_pos(int *x, int *y);
@@ -526,6 +528,9 @@
   int MACRO_center_y = (center_y);                                            \
   CHECK_MAP_POS(MACRO_center_x, MACRO_center_y);                              \
   for (dir_itr = 0; dir_itr < 8; dir_itr++) {                                 \
+    if (!is_valid_dir(dir_itr)) {                                            \
+      continue;                                                                
      \
+    }                                                                        \
     DIRSTEP(x_itr, y_itr, dir_itr);                                           \
     x_itr += MACRO_center_x;                                                  \
     y_itr += MACRO_center_y;                                                  \
@@ -597,9 +602,23 @@
 
 /* is the direction "cardinal"?  Cardinal directions
  * (also called cartesian) are the four main ones */
-#define DIR_IS_CARDINAL(dir)                           \
-  ((dir) == DIR8_NORTH || (dir) == DIR8_EAST ||        \
-   (dir) == DIR8_WEST || (dir) == DIR8_SOUTH)
+static inline bool DIR_IS_CARDINAL(enum direction8 dir)
+{
+  switch (dir) {
+  case DIR8_NORTH:
+  case DIR8_SOUTH:
+  case DIR8_EAST:
+  case DIR8_WEST:
+    return TRUE;
+  case DIR8_NORTHEAST:
+  case DIR8_NORTHWEST:
+  case DIR8_SOUTHEAST:
+  case DIR8_SOUTHWEST:
+    /* In hex all directions are "cardinal". */
+    return topo_has_flag(TF_HEX);
+  }
+  return FALSE;
+}
 
 enum direction8 dir_cw(enum direction8 dir);
 enum direction8 dir_ccw(enum direction8 dir);
@@ -609,26 +628,14 @@
 extern const int DIR_DX[8];
 extern const int DIR_DY[8];
 
-/* like DIR_DX[] and DIR_DY[], only cartesian */
-extern const int CAR_DIR_DX[4];
-extern const int CAR_DIR_DY[4];
-
 #define cartesian_adjacent_iterate(x, y, IAC_x, IAC_y)                        \
 {                                                                             \
-  int IAC_i;                                                                  \
-  int IAC_x, IAC_y;                                                           \
-  bool _is_border = IS_BORDER_MAP_POS(x, y, 1);                               \
-  CHECK_MAP_POS(x, y);                                                        \
-  for (IAC_i = 0; IAC_i < 4; IAC_i++) {                                       \
-    IAC_x = x + CAR_DIR_DX[IAC_i];                                            \
-    IAC_y = y + CAR_DIR_DY[IAC_i];                                            \
-                                                                              \
-    if (_is_border && !normalize_map_pos(&IAC_x, &IAC_y)) {                   \
-      continue;                                                               \
-    }
+  adjc_dir_iterate(x, y, IAC_x, IAC_y, _dir) {                               \
+    if (DIR_IS_CARDINAL(_dir)) {
 
 #define cartesian_adjacent_iterate_end                                        \
-  }                                                                           \
+    }                                                                         \
+  } adjc_dir_iterate_end;                                                    \
 }
 
 /* Used for network transmission; do not change. */
@@ -649,7 +656,7 @@
 #define MAP_ORIGINAL_TOPO        TF_WRAPX
 #define MAP_DEFAULT_TOPO         TF_WRAPX
 #define MAP_MIN_TOPO             0
-#define MAP_MAX_TOPO             7
+#define MAP_MAX_TOPO             15
 
 #define MAP_DEFAULT_SEED         0
 #define MAP_MIN_SEED             0
@@ -726,6 +733,11 @@
 ****************************************************************************/
 static inline bool IS_BORDER_MAP_POS(int map_x, int map_y, int dist)
 {
+  if (topo_has_flag(TF_HEX)) {
+    /* TODO */
+    return TRUE;
+  }
+
   do_in_native_pos(nat_x, nat_y, map_x, map_y) {
     /* HACK: An iso-map compresses the value in the X direction but not in
      * the Y direction.  Hence (x+1,y) is 1 tile away while (x,y+2) is also
Index: server/mapgen.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/server/mapgen.c,v
retrieving revision 1.136
diff -u -r1.136 mapgen.c
--- server/mapgen.c     6 Jun 2004 20:45:27 -0000       1.136
+++ server/mapgen.c     11 Jun 2004 00:26:57 -0000
@@ -832,9 +832,10 @@
     for (func_num = 0; func_num < NUM_TEST_FUNCTIONS; func_num++) {
       int best_val = -1;
       /* first get the tile values for the function */
-      for (dir = 0; dir < 4; dir++) {
-       int x1 = x + CAR_DIR_DX[dir];
-       int y1 = y + CAR_DIR_DY[dir];
+      adjc_dir_iterate(x, y, x1, y1, dir) {
+       if (!DIR_IS_CARDINAL(dir)) {
+         continue;
+       }
        if (normalize_map_pos(&x1, &y1)
            && rd_direction_is_valid[dir]) {
          rd_comparison_val[dir] = (test_funcs[func_num].func) (x1, y1);
@@ -844,22 +845,23 @@
            best_val = MIN(rd_comparison_val[dir], best_val);
          }
        }
-      }
+      } adjc_dir_iterate_end;
       assert(best_val != -1);
 
       /* should we abort? */
       if (best_val > 0 && test_funcs[func_num].fatal) return FALSE;
 
       /* mark the less attractive directions as invalid */
-      for (dir = 0; dir < 4; dir++) {
-       int x1 = x + CAR_DIR_DX[dir];
-       int y1 = y + CAR_DIR_DY[dir];
+      adjc_dir_iterate(x, y, x1, y1, dir) {
+       if (!DIR_IS_CARDINAL(dir)) {
+         continue;
+       }
        if (normalize_map_pos(&x1, &y1)
            && rd_direction_is_valid[dir]) {
          if (rd_comparison_val[dir] != best_val)
            rd_direction_is_valid[dir] = FALSE;
        }
-      }
+      } adjc_dir_iterate_end;
     }
 
     /* Directions evaluated with all functions. Now choose the best
@@ -873,16 +875,17 @@
     case 0:
       return FALSE; /* river aborted */
     case 1:
-      for (dir = 0; dir < 4; dir++) {
-       int x1 = x + CAR_DIR_DX[dir];
-       int y1 = y + CAR_DIR_DY[dir];
+      adjc_dir_iterate(x, y, x1, y1, dir) {
+       if (!DIR_IS_CARDINAL(dir)) {
+         continue;
+       }
        if (normalize_map_pos(&x1, &y1)
            && rd_direction_is_valid[dir]) {
          river_blockmark(x, y);
          x = x1;
          y = y1;
        }
-      }
+      } adjc_dir_iterate_end;
       break;
     default:
       /* More than one possible direction; Let the random number
@@ -893,9 +896,10 @@
       freelog(LOG_DEBUG, "mapgen.c: direction: %d", direction);
 
       /* Find the direction that the random number generator selected. */
-      for (dir = 0; dir < 4; dir++) {
-       int x1 = x + CAR_DIR_DX[dir];
-       int y1 = y + CAR_DIR_DY[dir];
+      adjc_dir_iterate(x, y, x1, y1, dir) {
+       if (!DIR_IS_CARDINAL(dir)) {
+         continue;
+       }
        if (normalize_map_pos(&x1, &y1)
            && rd_direction_is_valid[dir]) {
          if (direction > 0) direction--;
@@ -906,7 +910,7 @@
            break;
          }
        }
-      }
+      } adjc_dir_iterate_end;
       break;
     } /* end switch (rd_number_of_directions()) */
 
Index: server/settlers.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/server/settlers.c,v
retrieving revision 1.182
diff -u -r1.182 settlers.c
--- server/settlers.c   23 May 2004 02:05:37 -0000      1.182
+++ server/settlers.c   11 Jun 2004 00:26:57 -0000
@@ -551,7 +551,9 @@
   if (is_wet(pplayer, x, y))
     return TRUE;
 
+  freelog(LOG_NORMAL, "Searching wetness at %d,%d", x, y);
   cartesian_adjacent_iterate(x, y, x1, y1) {
+    freelog(LOG_NORMAL, "  %d,%d: %d.", x1, y1, is_wet(pplayer, x1, y1));
     if (is_wet(pplayer, x1, y1))
       return TRUE;
   } cartesian_adjacent_iterate_end;
Index: server/srv_main.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/server/srv_main.c,v
retrieving revision 1.169
diff -u -r1.169 srv_main.c
--- server/srv_main.c   9 Jun 2004 21:27:46 -0000       1.169
+++ server/srv_main.c   11 Jun 2004 00:26:58 -0000
@@ -1644,7 +1644,7 @@
   test_random1(200000);
 #endif
     
-  if (topo_has_flag(TF_ISO) && topo_has_flag(TF_WRAPY)
+  if ((topo_has_flag(TF_ISO) || topo_has_flag(TF_HEX)) && 
topo_has_flag(TF_WRAPY)
       && (map.ysize % 2 == 1)) {
     /* To wrap north-south an iso-map must have even Y dimension.  Since the
      * X dimension is compressed this isn't an issue for east-west
Index: server/stdinhand.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/server/stdinhand.c,v
retrieving revision 1.322
diff -u -r1.322 stdinhand.c
--- server/stdinhand.c  6 Jun 2004 20:45:27 -0000       1.322
+++ server/stdinhand.c  11 Jun 2004 00:26:59 -0000
@@ -275,7 +275,15 @@
             "  4 Flat Earth (isometric)\n"
             "  5 Earth (isometric)\n"
             "  6 Uranus (isometric)\n"
-            "  7 Donut World (isometric)"
+            "  7 Donut World (isometric)\n"
+            "  8 Flat Earth (hexagonal)\n"
+            "  9 Earth (hexagonal)\n"
+            " 10 Uranus (hexagonal)\n"
+            " 11 Donut World (hexagonal)\n"
+            " 12 Flat Earth (iso-hex)\n"
+            " 13 Earth (iso-hex)\n"
+            " 14 Uranus (iso-hex)\n"
+            " 15 Donut World (iso-hex)"
           ), NULL, 
          MAP_MIN_TOPO, MAP_MAX_TOPO, MAP_DEFAULT_TOPO)
 

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