Complete.Org: Mailing Lists: Archives: freeciv-dev: February 2005:
[Freeciv-Dev] (PR#12369) encapsulate the view topology info
Home

[Freeciv-Dev] (PR#12369) encapsulate the view topology info

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
Subject: [Freeciv-Dev] (PR#12369) encapsulate the view topology info
From: "Jason Short" <jdorje@xxxxxxxxxxxxxxxxxxxxx>
Date: Sat, 26 Feb 2005 12:21:10 -0800
Reply-to: bugs@xxxxxxxxxxx

<URL: http://bugs.freeciv.org/Ticket/Display.html?id=12369 >

This patch encapsulates the view topology info within tilespec.c. 
is_isometric, hex_width, and hex_height are all turned into static 
variables in this file.  Accessor functions are added for the callers 
that need them.

-jason

? client/diff
Index: client/citydlg_common.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/client/citydlg_common.c,v
retrieving revision 1.62
diff -u -r1.62 citydlg_common.c
--- client/citydlg_common.c     24 Feb 2005 01:56:40 -0000      1.62
+++ client/citydlg_common.c     26 Feb 2005 20:19:52 -0000
@@ -32,7 +32,7 @@
 #include "control.h"
 #include "mapview_common.h"
 #include "options.h"           /* for concise_city_production */
-#include "tilespec.h"          /* for is_isometric */
+#include "tilespec.h"          /* for tileset_is_isometric() */
 
 static int citydlg_width, citydlg_height;
 
@@ -111,7 +111,7 @@
   canvas_x -= (width - NORMAL_TILE_WIDTH) / 2;
   canvas_y -= (height - NORMAL_TILE_HEIGHT) / 2;
 
-  if (is_isometric) {
+  if (tileset_is_isometric()) {
     const int W = NORMAL_TILE_WIDTH, H = NORMAL_TILE_HEIGHT;
 
     /* Shift the tile left so the top corner of the origin tile is at
Index: client/climap.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/client/climap.c,v
retrieving revision 1.5
diff -u -r1.5 climap.c
--- client/climap.c     29 Sep 2004 02:24:19 -0000      1.5
+++ client/climap.c     26 Feb 2005 20:19:52 -0000
@@ -18,7 +18,7 @@
 #include "map.h"
 #include "shared.h"
 
-#include "tilespec.h"           /* is_isometric */
+#include "tilespec.h"           /* tileset_is_isometric() */
 
 #include "climap.h"
 
@@ -50,7 +50,7 @@
 **************************************************************************/
 enum direction8 gui_to_map_dir(enum direction8 gui_dir)
 {
-  if (is_isometric) {
+  if (tileset_is_isometric()) {
     return dir_ccw(gui_dir);
   } else {
     return gui_dir;
@@ -64,7 +64,7 @@
 **************************************************************************/
 enum direction8 map_to_gui_dir(enum direction8 map_dir)
 {
-  if (is_isometric) {
+  if (tileset_is_isometric()) {
     return dir_cw(map_dir);
   } else {
     return map_dir;
Index: client/connectdlg_common.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/client/connectdlg_common.c,v
retrieving revision 1.29
diff -u -r1.29 connectdlg_common.c
--- client/connectdlg_common.c  5 Feb 2005 07:15:36 -0000       1.29
+++ client/connectdlg_common.c  26 Feb 2005 20:19:52 -0000
@@ -354,9 +354,9 @@
    * get an iso-map and for a classic tileset you get a classic map.  In
    * both cases the map wraps in the X direction by default.
    *
-   * This works with hex maps too now.  A hex map always has is_isometric
-   * set.  An iso-hex map has hex_height != 0, while a non-iso hex map
-   * has hex_width != 0.
+   * This works with hex maps too now.  A hex map always has 
tileset_is_isometric()
+   * set.  An iso-hex map has tileset_hex_height() != 0, while a non-iso hex 
map
+   * has tileset_hex_width() != 0.
    *
    * Setting the option here is a bit of a hack, but so long as the client
    * has sufficient permissions to do so (it doesn't have HACK access yet) it
@@ -364,8 +364,8 @@
    * set but then overwritten during the load. */
   my_snprintf(buf, sizeof(buf), "/set topology %d",
              (TF_WRAPX
-              | ((is_isometric && hex_height == 0) ? TF_ISO : 0)
-              | ((hex_width != 0 || hex_height != 0) ? TF_HEX : 0)));
+              | ((tileset_is_isometric() && tileset_hex_height() == 0) ? 
TF_ISO : 0)
+              | ((tileset_hex_width() != 0 || tileset_hex_height() != 0) ? 
TF_HEX : 0)));
   send_chat(buf);
 
   return TRUE;
Index: client/mapctrl_common.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/client/mapctrl_common.c,v
retrieving revision 1.49
diff -u -r1.49 mapctrl_common.c
--- client/mapctrl_common.c     23 Feb 2005 03:34:05 -0000      1.49
+++ client/mapctrl_common.c     26 Feb 2005 20:19:52 -0000
@@ -199,7 +199,7 @@
    */
   if (diff_x != 0 || diff_y != 0) {
 
-    if (is_isometric) {
+    if (tileset_is_isometric()) {
       rec_w += (diff_x - diff_y) * half_W;
       rec_h += (diff_x + diff_y) * half_H;
 
Index: client/mapview_common.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/client/mapview_common.c,v
retrieving revision 1.197
diff -u -r1.197 mapview_common.c
--- client/mapview_common.c     26 Feb 2005 18:27:19 -0000      1.197
+++ client/mapview_common.c     26 Feb 2005 20:19:53 -0000
@@ -181,7 +181,7 @@
 ****************************************************************************/
 void map_to_gui_vector(int *gui_dx, int *gui_dy, int map_dx, int map_dy)
 {
-  if (is_isometric) {
+  if (tileset_is_isometric()) {
     /*
      * Convert the map coordinates to isometric GUI
      * coordinates.  We'll make tile map(0,0) be the origin, and
@@ -225,7 +225,7 @@
 {
   const int W = NORMAL_TILE_WIDTH, H = NORMAL_TILE_HEIGHT;
 
-  if (is_isometric) {
+  if (tileset_is_isometric()) {
     /* The basic operation here is a simple pi/4 rotation; however, we
      * have to first scale because the tiles have different width and
      * height.  Mathematically, this looks like
@@ -259,7 +259,7 @@
     gui_x -= W / 2;
     *map_x = DIVIDE(gui_x * H + gui_y * W, W * H);
     *map_y = DIVIDE(gui_y * W - gui_x * H, W * H);
-  } else {                     /* is_isometric */
+  } else {                     /* tileset_is_isometric() */
     /* We use DIVIDE so that we will get the correct result even
      * for negative coordinates. */
     *map_x = DIVIDE(gui_x, W);
@@ -627,7 +627,7 @@
   *xsize = mapview.width;
   *ysize = mapview.height;
 
-  if (MAP_IS_ISOMETRIC == is_isometric) {
+  if (MAP_IS_ISOMETRIC == tileset_is_isometric()) {
     /* If the map and view line up, it's easy. */
     NATIVE_TO_MAP_POS(xmin, ymin, 0, 0);
     map_to_gui_pos(xmin, ymin, *xmin, *ymin);
@@ -707,7 +707,7 @@
   *xstep = NORMAL_TILE_WIDTH;
   *ystep = NORMAL_TILE_HEIGHT;
 
-  if (is_isometric) {
+  if (tileset_is_isometric()) {
     *xstep /= 2;
     *ystep /= 2;
   }
@@ -789,11 +789,11 @@
 {
   int canvas_x, canvas_y;
   int xmin, ymin, xmax, ymax, xsize, ysize, scroll_x, scroll_y;
-  const int border_x = (is_isometric ? NORMAL_TILE_WIDTH / 2
+  const int border_x = (tileset_is_isometric() ? NORMAL_TILE_WIDTH / 2
                        : 2 * NORMAL_TILE_WIDTH);
-  const int border_y = (is_isometric ? NORMAL_TILE_HEIGHT / 2
+  const int border_y = (tileset_is_isometric() ? NORMAL_TILE_HEIGHT / 2
                        : 2 * NORMAL_TILE_HEIGHT);
-  bool same = (is_isometric == MAP_IS_ISOMETRIC);
+  bool same = (tileset_is_isometric() == MAP_IS_ISOMETRIC);
 
   get_mapview_scroll_window(&xmin, &ymin, &xmax, &ymax, &xsize, &ysize);
   get_mapview_scroll_pos(&scroll_x, &scroll_y);
@@ -918,7 +918,7 @@
       break;
     case DRAWN_BG:
       /*** Background color. ***/
-      if (is_isometric) {
+      if (tileset_is_isometric()) {
        canvas_fill_sprite_area(pcanvas, sprites.black_tile, COLOR_STD_BLACK,
                            canvas_x, canvas_y);
        if (fog) {
@@ -1023,7 +1023,7 @@
 
   /* In iso-view the output sprite is a bit smaller than the tile, so we
    * have to use an offset. */
-  if (is_isometric) {
+  if (tileset_is_isometric()) {
     canvas_x += NORMAL_TILE_WIDTH / 3;
     canvas_y -= NORMAL_TILE_HEIGHT / 3;
   }
@@ -1141,7 +1141,7 @@
                                int *end_x, int *end_y)
 {
   const int W = NORMAL_TILE_WIDTH, H = NORMAL_TILE_HEIGHT;
-  const int HW = hex_width, HH = hex_height;
+  const int HW = tileset_hex_width(), HH = tileset_hex_height();
   const int overlap = (width > 1) ? 1 : 0;
 
   assert(inset >= 0);
@@ -1181,7 +1181,7 @@
    * adjustment and the overlap adjustment are both 1.
    */
 
-  if (is_isometric) {
+  if (tileset_is_isometric()) {
     switch (dir) {
     case DIR8_NORTH:
       /* Top right. */
@@ -1346,7 +1346,7 @@
     return;
   }
 
-  if (is_isometric) {
+  if (tileset_is_isometric()) {
     /* Isometric must be done differently or the borders will get overwritten
      * by other terrain graphics.  (This is because the tileset sprites'
      * edges don't line up exactly with the mathematical calculation of the
@@ -1508,7 +1508,7 @@
                                const struct tile *ptile,
                                int canvas_x, int canvas_y, bool citymode)
 {
-  const int inset = (is_isometric ? 0 : 1);
+  const int inset = (tileset_is_isometric() ? 0 : 1);
   enum direction8 dir;
 
   if (citymode) {
@@ -1528,7 +1528,7 @@
     if (get_tile_boundaries(dir, inset, 1,
                            &start_x, &start_y, &end_x, &end_y)) {
       if (map_deco[ptile->index].hilite == HILITE_CITY
-         || (is_isometric
+         || (tileset_is_isometric()
              && (adjc_tile = mapstep(ptile, dir))
              && map_deco[adjc_tile->index].hilite == HILITE_CITY)) {
        canvas_put_line(pcanvas, COLOR_STD_YELLOW, LINE_NORMAL,
@@ -1626,7 +1626,7 @@
 
   mapview_layer_iterate(layer) {
     gui_rect_iterate(gui_x0, gui_y0, width,
-                    height + (is_isometric ? (NORMAL_TILE_HEIGHT / 2) : 0),
+                    height + (tileset_is_isometric() ? (NORMAL_TILE_HEIGHT / 
2) : 0),
                     ptile, pedge, pcorner, gui_x, gui_y) {
       const int cx = gui_x - mapview.gui_x0, cy = gui_y - mapview.gui_y0;
 
@@ -2000,7 +2000,7 @@
     map_to_gui_vector(&canvas_dx, &canvas_dy, dx, dy);
 
     tile_to_canvas_pos(&start_x, &start_y, src_tile);
-    if (is_isometric) {
+    if (tileset_is_isometric()) {
       start_y -= NORMAL_TILE_HEIGHT / 2;
     }
 
@@ -2546,7 +2546,7 @@
   /* Note: these calculations operate on overview coordinates as if they
    * are natural.  Corners may be off by one tile, however. */
 
-  if (is_isometric && !MAP_IS_ISOMETRIC) {
+  if (tileset_is_isometric() && !MAP_IS_ISOMETRIC) {
     /* We start with the west corner. */
 
     /* North */
@@ -2560,7 +2560,7 @@
     /* South */
     x[3] = x[0] + OVERVIEW_TILE_WIDTH * mapview.tile_height;
     y[3] = y[0] + OVERVIEW_TILE_HEIGHT * mapview.tile_height;
-  } else if (!is_isometric && MAP_IS_ISOMETRIC) {
+  } else if (!tileset_is_isometric() && MAP_IS_ISOMETRIC) {
     /* We start with the west corner.  Note the X scale is smaller. */
 
     /* North */
@@ -2577,7 +2577,7 @@
   } else {
     /* We start with the northwest corner. */
     int screen_width = mapview.tile_width;
-    int screen_height = mapview.tile_height * (is_isometric ? 2 : 1);
+    int screen_height = mapview.tile_height * (tileset_is_isometric() ? 2 : 1);
 
     /* Northeast */
     x[1] = x[0] + OVERVIEW_TILE_WIDTH * screen_width - 1;
@@ -2685,7 +2685,7 @@
      * be visible twice so there's no problem. */
     return TRUE;
   }
-  if (XOR(topo_has_flag(TF_ISO) || topo_has_flag(TF_HEX), is_isometric)) {
+  if (XOR(topo_has_flag(TF_ISO) || topo_has_flag(TF_HEX), 
tileset_is_isometric())) {
     /* Non-matching.  In this case the mapview does not line up with the
      * map's axis of wrapping.  This will give very bad results for the
      * player!
@@ -2700,8 +2700,8 @@
            && h <= (NATURAL_WIDTH + NATURAL_HEIGHT) * H / 4);
   } else {
     /* Matching. */
-    const int isofactor = (is_isometric ? 2 : 1);
-    const int isodiff = (is_isometric ? 6 : 2);
+    const int isofactor = (tileset_is_isometric() ? 2 : 1);
+    const int isodiff = (tileset_is_isometric() ? 6 : 2);
 
     /* Now we can use the full width and height, with the exception of a small
      * area on each side. */
Index: client/mapview_common.h
===================================================================
RCS file: /home/freeciv/CVS/freeciv/client/mapview_common.h,v
retrieving revision 1.98
diff -u -r1.98 mapview_common.h
--- client/mapview_common.h     25 Feb 2005 17:31:49 -0000      1.98
+++ client/mapview_common.h     26 Feb 2005 20:19:53 -0000
@@ -100,7 +100,7 @@
     _height = -_height;                                                        
    \
   }                                                                        \
   if (_width > 0 && _height > 0) {                                         \
-    const int _ratio = (is_isometric ? 2 : 1);                             \
+    const int _ratio = (tileset_is_isometric() ? 2 : 1);                   \
     const int _W = NORMAL_TILE_WIDTH / (_ratio * 2);                       \
     const int _H = NORMAL_TILE_HEIGHT / (_ratio * 2);                      \
     const int GRI_x0 = DIVIDE(_gui_x0, _W) - 1;                                
    \
@@ -124,7 +124,7 @@
       GRI_y_itr = GRI_y0 + (GRI_itr / (GRI_x1 - GRI_x0));                  \
       GRI_sum = GRI_x_itr + GRI_y_itr;                                     \
       GRI_diff = GRI_y_itr - GRI_x_itr;                                        
    \
-      if (is_isometric) {                                                  \
+      if (tileset_is_isometric()) {                                        \
        if ((GRI_x_itr + GRI_y_itr) % 2 != 0) {                             \
          continue;                                                         \
        }                                                                   \
Index: client/tilespec.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/client/tilespec.c,v
retrieving revision 1.243
diff -u -r1.243 tilespec.c
--- client/tilespec.c   26 Feb 2005 18:40:21 -0000      1.243
+++ client/tilespec.c   26 Feb 2005 20:19:54 -0000
@@ -77,8 +77,8 @@
 
 int OVERVIEW_TILE_SIZE = 2;
 
-bool is_isometric;
-int hex_width, hex_height;
+static bool is_isometric;
+static int hex_width, hex_height;
 
 static int city_names_font_size, city_productions_font_size;
 
@@ -201,6 +201,33 @@
                                            bool required, const char *what,
                                            const char *name);
 
+
+/****************************************************************************
+  Return whether the current tileset is isometric.
+****************************************************************************/
+bool tileset_is_isometric(void)
+{
+  return is_isometric;
+}
+
+/****************************************************************************
+  Return the hex_width of the current tileset.  For hex tilesets this value
+  will be > 0 and is_isometric will be set.
+****************************************************************************/
+int tileset_hex_width(void)
+{
+  return hex_width;
+}
+
+/****************************************************************************
+  Return the hex_height of the current tileset.  For isohex tilesets this
+  value will be > 0 and is_isometric will be set.
+****************************************************************************/
+int tileset_hex_height(void)
+{
+  return hex_height;
+}
+
 /**************************************************************************
   Initialize.
 **************************************************************************/
Index: client/tilespec.h
===================================================================
RCS file: /home/freeciv/CVS/freeciv/client/tilespec.h,v
retrieving revision 1.108
diff -u -r1.108 tilespec.h
--- client/tilespec.h   26 Feb 2005 00:54:39 -0000      1.108
+++ client/tilespec.h   26 Feb 2005 20:19:54 -0000
@@ -396,11 +396,13 @@
 #define OVERVIEW_TILE_WIDTH ((MAP_IS_ISOMETRIC ? 2 : 1) * OVERVIEW_TILE_SIZE)
 #define OVERVIEW_TILE_HEIGHT OVERVIEW_TILE_SIZE
 
-extern bool is_isometric;
-extern int hex_width, hex_height;
-
 extern int num_tiles_explode_unit;
 
+/* Tileset accessor functions. */
+bool tileset_is_isometric(void);
+int tileset_hex_width(void);
+int tileset_hex_height(void);
+
 struct Sprite *load_sprite(const char *tag_name);
 void unload_sprite(const char *tag_name);
 bool sprite_exists(const char *tag_name);
Index: client/gui-gtk/citydlg.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/client/gui-gtk/citydlg.c,v
retrieving revision 1.195
diff -u -r1.195 citydlg.c
--- client/gui-gtk/citydlg.c    8 Feb 2005 22:14:17 -0000       1.195
+++ client/gui-gtk/citydlg.c    26 Feb 2005 20:19:54 -0000
@@ -321,7 +321,7 @@
   canvas_width = get_citydlg_canvas_width();
   canvas_height = get_citydlg_canvas_height();
 
-  if (is_isometric) {
+  if (tileset_is_isometric()) {
     MAX_UNIT_ROWS = (int) (100 / (UNIT_TILE_HEIGHT));
   } else {
     MAX_UNIT_ROWS = (int) (100 / (UNIT_TILE_HEIGHT + 6));
@@ -701,7 +701,7 @@
                    hbox);
 
   for (i = 0; i < MINI_NUM_UNITS; i++) {
-    int unit_height = (is_isometric) ?
+    int unit_height = (tileset_is_isometric()) ?
        UNIT_TILE_HEIGHT : UNIT_TILE_HEIGHT + UNIT_TILE_HEIGHT / 2;
 
     pdialog->overview.supported_unit_boxes[i] = gtk_event_box_new();
@@ -926,7 +926,7 @@
 
   gtk_notebook_append_page(GTK_NOTEBOOK(pdialog->notebook), page, label);
 
-  if (is_isometric)
+  if (tileset_is_isometric())
     MAX_UNIT_ROWS = (int) (100 / (UNIT_TILE_HEIGHT));
   else
     MAX_UNIT_ROWS = (int) (100 / (UNIT_TILE_HEIGHT + 6));
Index: client/gui-gtk/mapview.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/client/gui-gtk/mapview.c,v
retrieving revision 1.235
diff -u -r1.235 mapview.c
--- client/gui-gtk/mapview.c    17 Feb 2005 03:12:54 -0000      1.235
+++ client/gui-gtk/mapview.c    26 Feb 2005 20:19:54 -0000
@@ -805,7 +805,7 @@
   gdk_gc_set_ts_origin(fill_tile_gc, canvas_x, canvas_y);
   gdk_gc_set_foreground(fill_tile_gc, colors_standard[color]);
 
-  if (is_isometric) {
+  if (tileset_is_isometric()) {
     gdk_gc_set_clip_origin(fill_tile_gc, canvas_x, canvas_y);
     gdk_gc_set_clip_mask(fill_tile_gc, sprites.black_tile->mask);
   }
@@ -814,7 +814,7 @@
                     canvas_x, canvas_y,
                     NORMAL_TILE_WIDTH, NORMAL_TILE_HEIGHT);
 
-  if (is_isometric) {
+  if (tileset_is_isometric()) {
     gdk_gc_set_clip_mask(fill_tile_gc, NULL);
   }
 }
Index: client/gui-mui/graphics.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/client/gui-mui/graphics.c,v
retrieving revision 1.34
diff -u -r1.34 graphics.c
--- client/gui-mui/graphics.c   25 Aug 2004 18:24:19 -0000      1.34
+++ client/gui-mui/graphics.c   26 Feb 2005 20:19:55 -0000
@@ -349,7 +349,7 @@
     node = (struct SpriteNode *) node->node.mln_Succ;
   }
 
-  if (is_isometric)
+  if (tileset_is_isometric())
   {
     /* In isometric view we needs to build a fog mask, we could use 
BltPattern()
        to avoid this but the mask position can not be specified fine enough */
Index: client/gui-mui/mapclass.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/client/gui-mui/mapclass.c,v
retrieving revision 1.101
diff -u -r1.101 mapclass.c
--- client/gui-mui/mapclass.c   22 Nov 2004 07:54:46 -0000      1.101
+++ client/gui-mui/mapclass.c   26 Feb 2005 20:19:55 -0000
@@ -582,14 +582,14 @@
     anim_timer = renew_timer_start(anim_timer, TIMER_USER, TIMER_ACTIVE);
 
     if (w > 0 && h > 0) {
-      if (is_isometric) {
+      if (tileset_is_isometric()) {
       /* We first draw the explosion onto the unit and draw draw the
         complete thing onto the map canvas window. This avoids flickering. */
        MyBltBitMapRastPort(data->map_bitmap, canvas_x, canvas_y,
                            data->unit_layer->rp, 0, 0, w, h, 0xc0);
        put_sprite_overlay(data->unit_layer->rp, sprites.explode.unit[i], 
NORMAL_TILE_WIDTH/4,0);
        MyBltBitMapRastPort(data->unit_bitmap,0,0,_rp(o),_mleft(o) + canvas_x, 
_mtop(o) + canvas_y, w, h, 0xc0);
-      } else { /* is_isometric */
+      } else { /* tileset_is_isometric() */
        MyBltBitMapRastPort(data->map_bitmap, canvas_x, canvas_y,
                            data->unit_layer->rp, 0, 0, w, h, 0xc0);
        put_sprite_overlay(data->unit_layer->rp, sprites.explode.unit[i], 0, 0);
@@ -1039,7 +1039,7 @@
 
        APTR cliphandle = MUI_AddClipping(muiRenderInfo(o), _mleft(o), 
_mtop(o), _mwidth(o), _mheight(o));
 
-       if (is_isometric)
+       if (tileset_is_isometric())
        {
          /* Do I get points for style? */
 /*       char boom[] = "Really Loud BOOM!!!";
@@ -1159,7 +1159,7 @@
 
        assert(is_drawn_line(src_x, src_y, dir));
 
-       if (is_isometric) {
+       if (tileset_is_isometric()) {
          really_draw_segment(data->map_layer->rp, 0, 0, src_x, src_y, dir,
                              FALSE);
          really_draw_segment(_rp(o), _mleft(o), _mtop(o), src_x, src_y,
@@ -1223,13 +1223,13 @@
        write_to_screen = 1;
 
        /* see update_map_canvas_visible() in mapview.c */
-       if (is_isometric)
+       if (tileset_is_isometric())
        {
          y -= width;
          width = height = width + height;
        }
 
-       if ((msg->flags & MADF_DRAWUPDATE) && (data->update == 3) && 
!is_isometric)
+       if ((msg->flags & MADF_DRAWUPDATE) && (data->update == 3) && 
!tileset_is_isometric())
        {
          /* Map has been scrolled (non isometric only atm), drawing can be 
optimized */
          int dx = data->horiz_first - data->old_horiz_first;
@@ -1302,7 +1302,7 @@
        }
       }
 
-      if (is_isometric)
+      if (tileset_is_isometric())
       {
        int i;
        int x_itr, y_itr;
@@ -2097,7 +2097,7 @@
 {
   DoSuperMethodA(cl, o, (Msg) msg);
 
-  if (is_isometric)
+  if (tileset_is_isometric())
   {
     msg->MinMaxInfo->MinWidth += get_normal_tile_width() * 4;
     msg->MinMaxInfo->DefWidth += get_normal_tile_width() * 4;
@@ -2127,7 +2127,7 @@
   {
     struct city *pcity = data->pcity;
 
-    if (is_isometric)
+    if (tileset_is_isometric())
     {
       /* First make it all black. */
       SetAPen(rp,data->black_color);
Index: client/gui-mui/overviewclass.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/client/gui-mui/overviewclass.c,v
retrieving revision 1.20
diff -u -r1.20 overviewclass.c
--- client/gui-mui/overviewclass.c      9 Apr 2003 20:47:44 -0000       1.20
+++ client/gui-mui/overviewclass.c      26 Feb 2005 20:19:55 -0000
@@ -116,7 +116,7 @@
        if (x < 0) x = 0;
        else if (x >= data->ov_MapWidth * data->ov_ScaleX) x = 
data->ov_MapWidth * data->ov_ScaleX - 1;
 
-  if (is_isometric) {
+  if (tileset_is_isometric()) {
     x -= data->rect_width/2;
     y += data->rect_width/2;
     x -= data->rect_height/2;
@@ -226,7 +226,7 @@
 
   SetAPen(rp, data->pen_white);
 
-  if (is_isometric) {
+  if (tileset_is_isometric()) {
     int p1x = data->rect_left*2;
     int p1y = data->rect_top*2;
     int p2x = data->rect_left*2 + data->rect_height*2;
Index: client/gui-sdl/citydlg.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/client/gui-sdl/citydlg.c,v
retrieving revision 1.49
diff -u -r1.49 citydlg.c
--- client/gui-sdl/citydlg.c    13 Dec 2004 16:23:29 -0000      1.49
+++ client/gui-sdl/citydlg.c    26 Feb 2005 20:19:56 -0000
@@ -1615,7 +1615,7 @@
 **************************************************************************/
 static bool sdl_city_to_canvas_pos(int *canvas_x, int *canvas_y, int city_x, 
int city_y)
 {
-  if (is_isometric) {
+  if (tileset_is_isometric()) {
     /*
      * The top-left corner is in the center of tile (-2, 2).  However,
      * we're looking for the top-left corner of the tile, so we
@@ -1647,7 +1647,7 @@
 {
   int orig_canvas_x = canvas_x, orig_canvas_y = canvas_y;
 
-  if (is_isometric) {
+  if (tileset_is_isometric()) {
     const int W = SCALLED_TILE_WIDTH, H = SCALLED_TILE_HEIGHT;
 
     /* Shift the tile right so the top corner of tile (-2,2) is at
Index: client/gui-sdl/gui_main.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/client/gui-sdl/gui_main.c,v
retrieving revision 1.51
diff -u -r1.51 gui_main.c
--- client/gui-sdl/gui_main.c   14 Feb 2005 17:52:56 -0000      1.51
+++ client/gui-sdl/gui_main.c   26 Feb 2005 20:19:56 -0000
@@ -425,7 +425,7 @@
       }
     }
 
-    if(is_isometric && do_focus_animation && pAnim->num_tiles_focused_unit) {
+    if(tileset_is_isometric() && do_focus_animation && 
pAnim->num_tiles_focused_unit) {
       real_blink_active_unit();
     } else {
       blink_active_unit();
Index: client/gui-sdl/gui_tilespec.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/client/gui-sdl/gui_tilespec.c,v
retrieving revision 1.20
diff -u -r1.20 gui_tilespec.c
--- client/gui-sdl/gui_tilespec.c       20 Nov 2004 21:27:18 -0000      1.20
+++ client/gui-sdl/gui_tilespec.c       26 Feb 2005 20:19:56 -0000
@@ -502,7 +502,7 @@
     
   /* Map Dithering */
   
-    if (is_isometric)
+    if (tileset_is_isometric())
     {
       pBuf = sprites.dither_tile;
       pDitherMask = GET_SURF(pBuf);
@@ -819,7 +819,7 @@
   unload_sprite("upkeep.unhappy");
   unload_sprite("upkeep.unhappy2");
   unload_sprite("upkeep.shield");
-  if (is_isometric && sprite_exists("explode.iso_nuke"))
+  if (tileset_is_isometric() && sprite_exists("explode.iso_nuke"))
   {
     unload_sprite("explode.iso_nuke");
   }
Index: client/gui-sdl/mapview.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/client/gui-sdl/mapview.c,v
retrieving revision 1.78
diff -u -r1.78 mapview.c
--- client/gui-sdl/mapview.c    17 Feb 2005 03:12:54 -0000      1.78
+++ client/gui-sdl/mapview.c    26 Feb 2005 20:19:57 -0000
@@ -2400,7 +2400,7 @@
 SDL_Surface * create_city_map(struct city *pCity)
 {
   
-    if (is_isometric)
+    if (tileset_is_isometric())
     {
       return create_iso_city_map(pCity);
     }
@@ -2664,7 +2664,7 @@
   
   clear_dither_tiles();
   
-  if(is_isometric) {
+  if(tileset_is_isometric()) {
     
     /* =========================== */
     pTmpSurface = create_surf(UNIT_TILE_WIDTH,

[Prev in Thread] Current Thread [Next in Thread]
  • [Freeciv-Dev] (PR#12369) encapsulate the view topology info, Jason Short <=