Complete.Org: Mailing Lists: Archives: freeciv-dev: December 2002:
[Freeciv-Dev] (PR#2682) introducing roadstyle and fill_road_rail_sprite_
Home

[Freeciv-Dev] (PR#2682) introducing roadstyle and fill_road_rail_sprite_

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: undisclosed-recipients:;
Subject: [Freeciv-Dev] (PR#2682) introducing roadstyle and fill_road_rail_sprite_array
From: "Jason Short via RT" <rt@xxxxxxxxxxxxxx>
Date: Mon, 30 Dec 2002 15:49:12 -0800
Reply-to: rt@xxxxxxxxxxxxxx

This patch pulls the road-drawing code off into a separate function,
fill_road_rail_sprite_array.

-----

Currently there are two distinct road/rail drawing methods.

Road and rail drawing is nearly identical.  The only difference is that
a road isn't drawn if a rail is present, and roads are always drawn
underneath rails.  Below I am talking about roads only, but the entire
process is duplicated.  (In future it might be possible to generalize
this duplication to allow more than 2 types of transportation.)

Both use an "isolated" road sprite for tiles that have a road but no
adjacent roads.

In isometric view, there are just 8 basic road sprites: one for a
connection in each direction.  These are layered as needed.  This means
only 8 sprites are necessary, but up to 8 sprites must be drawn.  The
sprites generally don't layer very well, so the drawing quality is
poor.  I name this method "roadstyle 0".

In non-isometric view, there are 16 "cardinal" and 16 "diagonal" road
sprites.  The cardinal 16 provide a single sprite for each of the 2^4=16
possibilities for connections in the cardinal direction, and the same is
true for the diagonal 16.  Thus when drawing roads on a tile we draw a
single cardinal and a single diagonal sprite (although more code is
needed to determine which sprite to use).  We have 32 total sprites, and
draw up to 2 at a time.  Thus there is a 4x increase in number of
sprites and an up to 4x increase in drawing speed compared to style 0. 
It is possible to get the sprites to layer together well, but given the
vast number of possible layering combinations I don't think the drawing
quality will be much better than with style 0.  I name this method
"roadstyle 1".

Both methods currently use corner sprites, although this is really a
separate issue.  (It should be a separate option whether corner sprites
or large road sprites are used.  But the current design of the drawing
code precludes using large road sprites.)

So although the drawing system is tied to is_isometric, nothing about
either system is specific to iso or non-iso view.

-----

Therefore I also introduce a new tileset variable, roadstyle.  It
defaults to 0 for iso and 1 for non-iso tilesets, thus preserving
backward-compatability.  And the drawing system used will be dependent
on the setting of this variable rather than on is_isometric.

-----

As a side note, there is another possible roadstyle: where we have 256
different road sprites, each providing the sprite for the tile providing
for all 2^8=256 possibilities of connections in all directions.  Now we
have 16x more sprites than in style 1, and the drawing itself is up to
2x faster.  It also allows for much higher-quality drawing.  This is
roadstyle 2 - it will be very easy to provide code to support this once
the infrastructure is put into place.

Civ3 uses roadstyle 2, but it also uses large road sprites.

jason


Index: client/tilespec.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/client/tilespec.c,v
retrieving revision 1.101
diff -u -r1.101 tilespec.c
--- client/tilespec.c   2002/12/30 20:57:51     1.101
+++ client/tilespec.c   2002/12/30 23:47:53
@@ -79,6 +79,7 @@
 int num_tiles_explode_unit=0;
 
 static bool is_mountainous = FALSE;
+static int roadstyle;
 
 static int num_spec_files = 0;
 static char **spec_filenames;  /* full pathnames */
@@ -90,13 +91,17 @@
    information (including on reconnections etc).
 */
 
-#define TILESPEC_CAPSTR "+tilespec2 duplicates_ok"
+#define TILESPEC_CAPSTR "+tilespec2 duplicates_ok roadstyle"
 /*
    Tilespec capabilities acceptable to this program:
    +tilespec2     -  basic format, required
    duplicates_ok  -  we can handle existence of duplicate tags
                      (lattermost tag which appears is used; tilesets which
                     have duplicates should specify "+duplicates_ok")
+   roadstyle      -  Allow the use of tilespec.roadstyle to control which
+                     style of road drawing to use.  Tilesets which rely on
+                     this (those that have roadstyle != is_isometric ? 0 : 1)
+                     should specify "+roadstyle".
 */
 
 #define SPEC_CAPSTR "+spec2"
@@ -418,6 +423,8 @@
 
   is_mountainous = secfile_lookup_bool_default(file, FALSE,
                                               "tilespec.is_mountainous");
+  roadstyle = secfile_lookup_int_default(file, is_isometric ? 0 : 1,
+                                        "tilespec.roadstyle");
 
   c = secfile_lookup_str_default(file, "10x20", "tilespec.city_names_font");
   city_names_font = mystrdup(c);
@@ -682,10 +689,13 @@
   SET_SPRITE(spaceship.fuel,         "spaceship.fuel");
   SET_SPRITE(spaceship.propulsion,   "spaceship.propulsion");
 
+  /* Isolated road graphics are used by roadstyle 0 and 1. */
   SET_SPRITE(road.isolated, "r.road_isolated");
   SET_SPRITE(rail.isolated, "r.rail_isolated");
   
-  if (is_isometric) {
+  if (roadstyle == 0) {
+    /* Roadstyle 0 has just 8 additional sprites for both road and rail:
+     * one for the road/rail going off in each direction. */
     for (i = 0; i < 8; i++) {
       const char *s = dir_get_name(i);
       char dir_name[3];
@@ -701,6 +711,11 @@
       SET_SPRITE(rail.dir[i], buffer);
     }
   } else {
+    /* Roadstyle 1 has 32 addidional sprites for both road and rail:
+     * 16 each for cardinal and diagonal directions.  Each set
+     * of 16 provides a NSEW-indexed sprite to provide connectors for
+     * all rails in the cardinal/diagonal directions.  The 0 entry is
+     * unused (the "isolated" sprite is used instead). */
     for(i=1; i<NUM_DIRECTION_NSEW; i++) {
       my_snprintf(buffer, sizeof(buffer), "r.c_road_%s", nsew_str(i));
       SET_SPRITE(road.cardinal[i], buffer);
@@ -716,6 +731,7 @@
     }
   }
 
+  /* Corner road/rail graphics are used by roadstyle 0 and 1. */
   SET_SPRITE_OPT(rail.corner[DIR8_NORTHWEST], "r.c_rail_nw");
   SET_SPRITE_OPT(rail.corner[DIR8_NORTHEAST], "r.c_rail_ne");
   SET_SPRITE_OPT(rail.corner[DIR8_SOUTHWEST], "r.c_rail_sw");
@@ -1352,29 +1368,23 @@
 }
 
 /**************************************************************************
-  Add any corner road tiles to the sprite array.
+  Add any corner road sprites to the sprite array.
 **************************************************************************/
-static struct Sprite **fill_road_corner_sprites(struct Sprite **sprs,
-       enum tile_special_type tspecial,
-       enum tile_special_type *tspecial_near)
+static int fill_road_corner_sprites(struct Sprite **sprs,
+                                   bool road, bool *road_near,
+                                   bool rail, bool *rail_near)
 {
-  bool road, road_near[8], rail, rail_near[8];
-  enum direction8 dir;
+  struct Sprite **saved_sprs = sprs;
 
-  if (!draw_roads_rails || !(draw_diagonal_roads || is_isometric)) {
+  assert(draw_roads_rails);
+  if (!(draw_diagonal_roads || is_isometric)) {
     /* We're not supposed to draw roads/rails here. */
     /* HACK: draw_diagonal_roads is not checked in iso view. */
-    return sprs;
+    return 0;
   }
 
   /* Roads going diagonally adjacent to this tile need to be
    * partly drawn on this tile. */
-  road = contains_special(tspecial, S_ROAD);
-  rail = contains_special(tspecial, S_RAILROAD);
-  for (dir = 0; dir < 8; dir++) {
-    road_near[dir] = contains_special(tspecial_near[dir], S_ROAD);
-    rail_near[dir] = contains_special(tspecial_near[dir], S_RAILROAD);
-  }
 
   /* Draw the corner sprite if:
    *   - There is a diagonal road (not rail!) between two adjacent tiles.
@@ -1413,31 +1423,26 @@
     *sprs++ = sprites.road.corner[DIR8_SOUTHWEST];
   }
 
-  return sprs;
+  return sprs - saved_sprs;
 }
 
 /**************************************************************************
-  Add any corner rail tiles to the sprite array.
+  Add any corner rail sprites to the sprite array.
 **************************************************************************/
-static struct Sprite **fill_rail_corner_sprites(struct Sprite **sprs,
-       enum tile_special_type tspecial,
-       enum tile_special_type *tspecial_near)
+static int fill_rail_corner_sprites(struct Sprite **sprs,
+                                   bool rail, bool *rail_near)
 {
-  bool rail, rail_near[8];
-  enum direction8 dir;
+  struct Sprite **saved_sprs = sprs;
 
-  if (!draw_roads_rails || !(draw_diagonal_roads || is_isometric)) {
+  assert(draw_roads_rails);
+  if (!(draw_diagonal_roads || is_isometric)) {
     /* We're not supposed to draw roads/rails here. */
     /* HACK: draw_diagonal_roads is not checked in iso view. */
-    return sprs;
+    return 0;
   }
 
   /* Rails going diagonally adjacent to this tile need to be
    * partly drawn on this tile. */
-  rail = contains_special(tspecial, S_RAILROAD);
-  for (dir = 0; dir < 8; dir++) {
-    rail_near[dir] = contains_special(tspecial_near[dir], S_RAILROAD);
-  }
 
   if (sprites.rail.corner[DIR8_NORTHEAST]
       && rail_near[DIR8_NORTH] && rail_near[DIR8_EAST]
@@ -1459,8 +1464,199 @@
       && !(rail && rail_near[DIR8_SOUTHWEST])) {
     *sprs++ = sprites.rail.corner[DIR8_SOUTHWEST];
   }
+
+  return sprs - saved_sprs;
+}
+
+/**************************************************************************
+  Fill all road and rail sprites into the sprite array.
+**************************************************************************/
+static int fill_road_rail_sprite_array(struct Sprite **sprs,
+                                      enum tile_special_type tspecial,
+                                      enum tile_special_type *tspecial_near,
+                                      struct city *pcity)
+{
+  struct Sprite **saved_sprs = sprs;
+  bool road, road_near[8], rail, rail_near[8];
+  enum direction8 dir;
+
+  if (!draw_roads_rails) {
+    /* Don't draw anything. */
+    return 0;
+  }
+
+  /* Fill some data arrays. */
+  road = contains_special(tspecial, S_ROAD);
+  rail = contains_special(tspecial, S_RAILROAD);
+  for (dir = 0; dir < 8; dir++) {
+    road_near[dir] = contains_special(tspecial_near[dir], S_ROAD);
+    rail_near[dir] = contains_special(tspecial_near[dir], S_RAILROAD);
+  }
+
+  /* Draw road corners underneath rails. */
+  sprs += fill_road_corner_sprites(sprs, road, road_near, rail, rail_near);
+
+  if (roadstyle == 0) {
+    /* With roadstyle 0, we simply draw one road/rail for every connection.
+     * This means we only need a few sprites, but a lot of drawing is
+     * necessary and it generally doesn't look very good. */
+
+    /* TODO: check draw_diagonal_roads */
+
+    /* Draw roads underneath rails. */
+    if (road) {
+      bool found = FALSE;
+
+      for (dir = 0; dir < 8; dir++) {
+       if (road_near[dir]) {
+         found = TRUE;
+         /* Only draw a road if there's no rail there. */
+         if (!(rail && rail_near[dir])) {
+           *sprs++ = sprites.road.dir[dir];
+         }
+       }
+      }
+
+      if (!found && !pcity && !rail) {
+       *sprs++ = sprites.road.isolated;
+      }
+    }
+
+    /* Draw rails over roads. */
+    if (rail) {
+      bool found = FALSE;
+
+      for (dir = 0; dir < 8; dir++) {
+       if (rail_near[dir]) {
+         *sprs++ = sprites.rail.dir[dir];
+         found = TRUE;
+       }
+      }
+
+      if (!found && !pcity) {
+       *sprs++ = sprites.rail.isolated;
+      }
+    }
+  } else {
+    /* With roadstyle 1, we draw one sprite for cardinal road connections,
+     * one sprite for diagonal road connections, and the same for rail.
+     * This means we need about 4x more sprites than in style 0, but up to
+     * 4x less drawing is needed.  The drawing quality may also be
+     *  improved. */
+
+    /* 'card' => cardinal; 'semi' => diagonal.
+     * 'count => number of connections.
+     * 'tileno' => index of sprite to use. */
+    int rail_card_count, rail_semi_count, road_card_count, road_semi_count;
+    int rail_card_tileno = 0, rail_semi_tileno = 0;
+    int road_card_tileno = 0, road_semi_tileno = 0;
+
+    if (road || rail) {
+      bool n, s, e, w;
+
+      /* Find cardinal rail connections. */
+      n = rail_near[DIR8_NORTH];
+      s = rail_near[DIR8_SOUTH];
+      e = rail_near[DIR8_EAST];
+      w = rail_near[DIR8_WEST];
+      rail_card_count = !!n + !!s + !!e + !!w;
+      rail_card_tileno = INDEX_NSEW(n, s, e, w);
+
+      /* Find cardinal road connections. */
+      n = road_near[DIR8_NORTH];
+      s = road_near[DIR8_SOUTH];
+      e = road_near[DIR8_EAST];
+      w = road_near[DIR8_WEST];
+      road_card_count = !!n + !!s + !!e + !!w;
+      road_card_tileno = INDEX_NSEW(n, s, e, w);
+
+      /* Find diagonal rail connections. */
+      n = rail_near[DIR8_NORTHEAST];
+      s = rail_near[DIR8_SOUTHWEST];
+      e = rail_near[DIR8_SOUTHEAST];
+      w = rail_near[DIR8_NORTHWEST];
+      rail_semi_count = !!n + !!s + !!e + !!w;
+      rail_semi_tileno = INDEX_NSEW(n, s, e, w);
+
+      /* Find diagonal road connections. */
+      n = road_near[DIR8_NORTHEAST];
+      s = road_near[DIR8_SOUTHWEST];
+      e = road_near[DIR8_SOUTHEAST];
+      w = road_near[DIR8_NORTHWEST];
+      road_semi_count = !!n + !!s + !!e + !!w;
+      road_semi_tileno = INDEX_NSEW(n, s, e, w);
+
+      if (rail) {
+       /* Don't draw a road if a rail is present. */
+       road_card_tileno &= ~rail_card_tileno;
+       road_semi_tileno &= ~rail_semi_tileno;
+      } else if (road) {
+       /* Don't draw a rail if there isn't one present. */
+       rail_card_tileno = 0;
+       rail_semi_tileno = 0;
+      }
+
+      /* First draw roads under rails.  We draw the sprite with fewer
+       * connections first - it is not clear why. */
+      if (road_semi_count > road_card_count) {
+       if (road_card_tileno != 0) {
+         *sprs++ = sprites.road.cardinal[road_card_tileno];
+       }
+       if (road_semi_tileno != 0 && draw_diagonal_roads) {
+         *sprs++ = sprites.road.diagonal[road_semi_tileno];
+       }
+      } else {
+       if (road_semi_tileno != 0 && draw_diagonal_roads) {
+         *sprs++ = sprites.road.diagonal[road_semi_tileno];
+       }
+       if (road_card_tileno != 0) {
+         *sprs++ = sprites.road.cardinal[road_card_tileno];
+       }
+      }
+
+      /* Then draw rails over roads. We draw the sprite with fewer
+       * connections first - it is not clear why. */
+      if (rail_semi_count > rail_card_count) {
+       if (rail_card_tileno != 0) {
+         *sprs++ = sprites.rail.cardinal[rail_card_tileno];
+       }
+       if (rail_semi_tileno != 0 && draw_diagonal_roads) {
+         *sprs++ = sprites.rail.diagonal[rail_semi_tileno];
+       }
+      } else {
+       if (rail_semi_tileno != 0 && draw_diagonal_roads) {
+         *sprs++ = sprites.rail.diagonal[rail_semi_tileno];
+       }
+       if (rail_card_tileno != 0) {
+         *sprs++ = sprites.rail.cardinal[rail_card_tileno];
+       }
+      }
+    }
+
+    /* Draw isolated rail/road separately. */
+    if (rail) {
+      int adjacent = rail_card_tileno;
+      if (draw_diagonal_roads) {
+       adjacent |= rail_semi_tileno;
+      }
+      if (adjacent == 0) {
+       *sprs++ = sprites.rail.isolated;
+      }
+    } else if (road) {
+      int adjacent = rail_card_tileno | road_card_tileno;
+      if (draw_diagonal_roads) {
+       adjacent |= (rail_semi_tileno | road_semi_tileno);
+      }
+      if (adjacent == 0) {
+       *sprs++ = sprites.road.isolated;
+      }
+    }
+  }
 
-  return sprs;
+  /* Draw rail corners over roads. */
+  sprs += fill_rail_corner_sprites(sprs, rail, rail_near);
+
+  return sprs - saved_sprs;
 }
 
 /**********************************************************************
@@ -1620,49 +1816,8 @@
       coasts[i] = sprites.tx.coast_cape_iso[array_index][i];
     }
   } else {
-    if (draw_roads_rails) {
-      /* Draw road corners underneath rails. */
-      sprs = fill_road_corner_sprites(sprs, tspecial, tspecial_near);
-
-      /* Draw roads underneath rails. */
-      if (contains_special(tspecial, S_ROAD)) {
-       bool found = FALSE;
-
-       for (dir = 0; dir < 8; dir++) {
-         if (contains_special(tspecial_near[dir], S_ROAD)) {
-           found = TRUE;
-           /* Only draw a road if there's no rail there. */
-           if (!(contains_special(tspecial, S_RAILROAD)
-                 && contains_special(tspecial_near[dir], S_RAILROAD))) {
-             *sprs++ = sprites.road.dir[dir];
-           }
-         }
-       }
-
-       if (!found && !pcity && !contains_special(tspecial, S_RAILROAD)) {
-         *sprs++ = sprites.road.isolated;
-       }
-      }
-
-      /* Draw rails over roads. */
-      if (contains_special(tspecial, S_RAILROAD)) {
-       bool found = FALSE;
-
-       for (dir = 0; dir < 8; dir++) {
-         if (contains_special(tspecial_near[dir], S_RAILROAD)) {
-           *sprs++ = sprites.rail.dir[dir];
-           found = TRUE;
-         }
-       }
-
-       if (!found && !pcity) {
-         *sprs++ = sprites.rail.isolated;
-       }
-      }
-
-      /* Draw rail corners over roads. */
-      sprs = fill_rail_corner_sprites(sprs, tspecial, tspecial_near);
-    }
+    sprs += fill_road_rail_sprite_array(sprs,
+                                       tspecial, tspecial_near, pcity);
 
     if (contains_special(tspecial, S_HUT) && draw_specials)
       *sprs++ = sprites.tx.village;
@@ -1713,8 +1868,6 @@
 {
   enum tile_terrain_type ttype, ttype_near[8];
   enum tile_special_type tspecial, tspecial_near[8];
-  int rail_card_tileno=0, rail_semi_tileno=0, road_card_tileno=0, 
road_semi_tileno=0;
-  int rail_card_count=0, rail_semi_count=0, road_card_count=0, 
road_semi_count=0;
 
   int dir;
   int tileno;
@@ -1825,84 +1978,8 @@
     else *sprs++=sprites.tx.irrigation;
   }
 
-  /* Draw road corners under rails. */
-  sprs = fill_road_corner_sprites(sprs, tspecial, tspecial_near);
+  sprs += fill_road_rail_sprite_array(sprs, tspecial, tspecial_near, pcity);
 
-  if((contains_special(tspecial, S_ROAD) || contains_special(tspecial, 
S_RAILROAD)) && draw_roads_rails) {
-    bool n, s, e, w;
-
-    n = contains_special(tspecial_near[DIR8_NORTH], S_RAILROAD);
-    s = contains_special(tspecial_near[DIR8_SOUTH], S_RAILROAD);
-    e = contains_special(tspecial_near[DIR8_EAST], S_RAILROAD);
-    w = contains_special(tspecial_near[DIR8_WEST], S_RAILROAD);
-    rail_card_count = (n ? 1 : 0) + (s ? 1 : 0) + (e ? 1 : 0) + (w ? 1 : 0);
-    rail_card_tileno = INDEX_NSEW(n,s,e,w);
-    
-    n = contains_special(tspecial_near[DIR8_NORTH], S_ROAD);
-    s = contains_special(tspecial_near[DIR8_SOUTH], S_ROAD);
-    e = contains_special(tspecial_near[DIR8_EAST], S_ROAD);
-    w = contains_special(tspecial_near[DIR8_WEST], S_ROAD);
-    road_card_count = (n ? 1 : 0) + (s ? 1 : 0) + (e ? 1 : 0) + (w ? 1 : 0);
-    road_card_tileno = INDEX_NSEW(n,s,e,w);
-    
-    n = contains_special(tspecial_near[DIR8_NORTHEAST], S_RAILROAD);
-    s = contains_special(tspecial_near[DIR8_SOUTHWEST], S_RAILROAD);
-    e = contains_special(tspecial_near[DIR8_SOUTHEAST], S_RAILROAD);
-    w = contains_special(tspecial_near[DIR8_NORTHWEST], S_RAILROAD);
-    rail_semi_count = (n ? 1 : 0) + (s ? 1 : 0) + (e ? 1 : 0) + (w ? 1 : 0);
-    rail_semi_tileno = INDEX_NSEW(n,s,e,w);
-    
-    n = contains_special(tspecial_near[DIR8_NORTHEAST], S_ROAD);
-    s = contains_special(tspecial_near[DIR8_SOUTHWEST], S_ROAD);
-    e = contains_special(tspecial_near[DIR8_SOUTHEAST], S_ROAD);
-    w = contains_special(tspecial_near[DIR8_NORTHWEST], S_ROAD);
-    road_semi_count = (n ? 1 : 0) + (s ? 1 : 0) + (e ? 1 : 0) + (w ? 1 : 0);
-    road_semi_tileno = INDEX_NSEW(n,s,e,w);
-
-    if(contains_special(tspecial, S_RAILROAD)) {
-      road_card_tileno&=~rail_card_tileno;
-      road_semi_tileno&=~rail_semi_tileno;
-    } else if(contains_special(tspecial, S_ROAD)) {
-      rail_card_tileno&=~road_card_tileno;
-      rail_semi_tileno&=~road_semi_tileno;
-    }
-
-    if(road_semi_count > road_card_count) {
-      if(road_card_tileno!=0) {
-        *sprs++ = sprites.road.cardinal[road_card_tileno];
-      }
-      if(road_semi_tileno!=0 && draw_diagonal_roads) {
-        *sprs++ = sprites.road.diagonal[road_semi_tileno];
-      }
-    } else {
-      if(road_semi_tileno!=0 && draw_diagonal_roads) {
-        *sprs++ = sprites.road.diagonal[road_semi_tileno];
-      }
-      if(road_card_tileno!=0) {
-        *sprs++ = sprites.road.cardinal[road_card_tileno];
-      }
-    }
-
-    if(rail_semi_count > rail_card_count) {
-      if(rail_card_tileno!=0) {
-        *sprs++ = sprites.rail.cardinal[rail_card_tileno];
-      }
-      if(rail_semi_tileno!=0 && draw_diagonal_roads) {
-        *sprs++ = sprites.rail.diagonal[rail_semi_tileno];
-      }
-    } else {
-      if(rail_semi_tileno!=0 && draw_diagonal_roads) {
-        *sprs++ = sprites.rail.diagonal[rail_semi_tileno];
-      }
-      if(rail_card_tileno!=0) {
-        *sprs++ = sprites.rail.cardinal[rail_card_tileno];
-      }
-    }
-  }
-
-  /* Draw rail corners over roads. */
-  sprs = fill_rail_corner_sprites(sprs, tspecial, tspecial_near);
-
   if(draw_specials) {
     if (contains_special(tspecial, S_SPECIAL_1))
       *sprs++ = tile_types[ttype].special[0].sprite;
@@ -1915,23 +1992,6 @@
       *sprs++ = sprites.tx.mine;
     else /* desert */
       *sprs++ = sprites.tx.oil_mine;
-  }
-  
-  if (draw_roads_rails) {
-    if (contains_special(tspecial, S_RAILROAD)) {
-      int adjacent = rail_card_tileno;
-      if (draw_diagonal_roads)
-       adjacent |= rail_semi_tileno;
-      if (adjacent == 0)
-       *sprs++ = sprites.rail.isolated;
-    }
-    else if (contains_special(tspecial, S_ROAD)) {
-      int adjacent = (rail_card_tileno | road_card_tileno);
-      if (draw_diagonal_roads)
-       adjacent |= (rail_semi_tileno | road_semi_tileno);
-      if (adjacent == 0)
-       *sprs++ = sprites.road.isolated;
-    }
   }
 
   if(contains_special(tspecial, S_HUT) && draw_specials) *sprs++ = 
sprites.tx.village;
Index: client/tilespec.h
===================================================================
RCS file: /home/freeciv/CVS/freeciv/client/tilespec.h,v
retrieving revision 1.35
diff -u -r1.35 tilespec.h
--- client/tilespec.h   2002/12/18 06:43:44     1.35
+++ client/tilespec.h   2002/12/30 23:47:53
@@ -116,12 +116,13 @@
   } spaceship;
   struct {
     struct Sprite
-      *isolated,
-      /* for isometric*/
-      *dir[8],     /* first used! */
-      /* for non-isometric */
+      /* for roadstyle 0 */
+      *dir[8],     /* all entries used */
+      /* for roadstyle 1 */
       *cardinal[NUM_DIRECTION_NSEW],     /* first unused */
       *diagonal[NUM_DIRECTION_NSEW],     /* first unused */
+      /* for roadstyle 0 and 1 */
+      *isolated,
       *corner[NUM_DIRECTION_NSEW]; /* only diagonal directions used */
   } road, rail;
   struct {

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