Complete.Org: Mailing Lists: Archives: freeciv-dev: February 2003:
[Freeciv-Dev] (PR#3017) unification of put_one_tile
Home

[Freeciv-Dev] (PR#3017) unification of put_one_tile

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: undisclosed-recipients:;
Subject: [Freeciv-Dev] (PR#3017) unification of put_one_tile
From: "Jason Short" <jdorje@xxxxxxxxxxxxxxxxxxxxx>
Date: Fri, 21 Feb 2003 02:58:18 -0800
Reply-to: rt@xxxxxxxxxxxxxx

Here's an updated version of this patch.

Changes:

- Switched from canvas_t to struct canvas_store.
- Updated SDL code.
- Improved win32 code.

It is tested under GTK, GTK2, XAW, and Win32 GUIs.

jason

Index: client/mapview_common.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/client/mapview_common.c,v
retrieving revision 1.31
diff -u -r1.31 mapview_common.c
--- client/mapview_common.c     2003/02/20 23:14:32     1.31
+++ client/mapview_common.c     2003/02/21 10:52:49
@@ -24,6 +24,7 @@
 
 #include "mapview_g.h"
 
+#include "climap.h"
 #include "control.h"
 #include "goto.h"
 #include "mapview_common.h"
@@ -433,6 +434,102 @@
   }
 }
 
+
+/**************************************************************************
+  Draw the given map tile at the given canvas position in non-isometric
+  view.
+**************************************************************************/
+void put_one_tile(struct canvas_store *pcanvas_store, int map_x, int map_y,
+                 int canvas_x, int canvas_y, bool citymode)
+{
+  struct Sprite *tile_sprs[80];
+  int fill_bg; /* FIXME: should be bool */
+  struct player *pplayer;
+  bool is_real = normalize_map_pos(&map_x, &map_y);
+
+  if (is_real && tile_get_known(map_x, map_y)) {
+    int count = fill_tile_sprite_array(tile_sprs, map_x, map_y, citymode,
+                                      &fill_bg, &pplayer);
+    int i = 0;
+
+    if (fill_bg) {
+      enum color_std color = pplayer ? player_color(pplayer)
+             : COLOR_STD_BACKGROUND;
+      gui_put_rectangle(pcanvas_store, color, canvas_x, canvas_y,
+                        NORMAL_TILE_WIDTH, NORMAL_TILE_HEIGHT);
+    }
+
+    for (i = 0; i < count; i++) {
+      if (tile_sprs[i]) {
+       gui_put_sprite_full(pcanvas_store, canvas_x, canvas_y, tile_sprs[i]);
+      }
+    }
+
+    if (draw_map_grid && !citymode) {
+      /* left side... */
+      gui_put_line(pcanvas_store,
+                  get_grid_color(map_x, map_y, map_x - 1, map_y),
+                  canvas_x, canvas_y, 0, NORMAL_TILE_HEIGHT);
+
+      /* top side... */
+      gui_put_line(pcanvas_store,
+                  get_grid_color(map_x, map_y, map_x, map_y - 1),
+                  canvas_x, canvas_y, NORMAL_TILE_WIDTH, 0);
+    }
+
+    if (draw_coastline && !draw_terrain) {
+      enum tile_terrain_type t1 = map_get_terrain(map_x, map_y), t2;
+      int x1, y1;
+
+      /* left side */
+      if (MAPSTEP(x1, y1, map_x, map_y, DIR8_WEST)) {
+       t2 = map_get_terrain(x1, y1);
+       if (is_ocean(t1) ^ is_ocean(t2)) {
+         gui_put_line(pcanvas_store, COLOR_STD_OCEAN,
+                      canvas_x, canvas_y, 0, NORMAL_TILE_HEIGHT);
+       }
+      }
+
+      /* top side */
+      if (MAPSTEP(x1, y1, map_x, map_y, DIR8_NORTH)) {
+       t2 = map_get_terrain(x1, y1);
+       if (is_ocean(t1) ^ is_ocean(t2)) {
+         gui_put_line(pcanvas_store, COLOR_STD_OCEAN,
+                      canvas_x, canvas_y, NORMAL_TILE_WIDTH, 0);
+       }
+      }
+    }
+  } else {
+    /* tile is unknown */
+    gui_put_rectangle(pcanvas_store, COLOR_STD_BLACK,
+                     canvas_x, canvas_y,
+                     NORMAL_TILE_WIDTH, NORMAL_TILE_HEIGHT);
+  }
+
+  if (!citymode) {
+    /* put any goto lines on the tile. */
+    if (is_real) {
+      enum direction8 dir;
+
+      for (dir = 0; dir < 8; dir++) {
+       if (get_drawn(map_x, map_y, dir)) {
+         draw_segment(map_x, map_y, dir);
+       }
+      }
+    }
+
+    /* Some goto lines overlap onto the tile... */
+    if (NORMAL_TILE_WIDTH % 2 == 0 || NORMAL_TILE_HEIGHT % 2 == 0) {
+      int line_x = map_x - 1, line_y = map_y;
+
+      if (normalize_map_pos(&line_x, &line_y)
+         && get_drawn(line_x, line_y, DIR8_NORTHEAST)) {
+       draw_segment(line_x, line_y, DIR8_NORTHEAST);
+      }
+    }
+  }
+}
+
 /**************************************************************************
   Draw the unique tile for the given map position, in non-isometric view.
   The coordinates have not been normalized, and are not guaranteed to be
@@ -445,7 +542,8 @@
   if (get_canvas_xy(map_x, map_y, &canvas_x, &canvas_y)) {
     freelog(LOG_DEBUG, "putting (%d,%d) at (%d,%d)",
            map_x, map_y, canvas_x, canvas_y);
-    put_one_tile(map_x, map_y, canvas_x, canvas_y);
+    put_one_tile(mapview_canvas.store, map_x, map_y,
+                canvas_x, canvas_y, FALSE);
   }
 }
 
Index: client/mapview_common.h
===================================================================
RCS file: /home/freeciv/CVS/freeciv/client/mapview_common.h,v
retrieving revision 1.22
diff -u -r1.22 mapview_common.h
--- client/mapview_common.h     2003/02/20 23:14:32     1.22
+++ client/mapview_common.h     2003/02/21 10:52:50
@@ -152,6 +152,9 @@
 bool tile_visible_mapcanvas(int map_x, int map_y);
 bool tile_visible_and_not_on_border_mapcanvas(int map_x, int map_y);
 
+void put_one_tile(struct canvas_store *pcanvas_store, int map_x, int map_y,
+                 int canvas_x, int canvas_y, bool citymode);
+
 void update_map_canvas(int x, int y, int width, int height,
                       bool write_to_screen);
 void update_map_canvas_visible(void);
Index: client/gui-gtk/citydlg.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/client/gui-gtk/citydlg.c,v
retrieving revision 1.158
diff -u -r1.158 citydlg.c
--- client/gui-gtk/citydlg.c    2003/02/15 07:23:47     1.158
+++ client/gui-gtk/citydlg.c    2003/02/21 10:52:51
@@ -1822,6 +1822,8 @@
 {
   int x, y;
   struct city *pcity = pdialog->pcity;
+  struct canvas_store store = {pdialog->map_canvas_store};
+
   for (y = 0; y < CITY_MAP_SIZE; y++)
     for (x = 0; x < CITY_MAP_SIZE; x++) {
       int map_x, map_y;
@@ -1829,8 +1831,8 @@
       if (is_valid_city_coords(x, y)
          && city_map_to_map(&map_x, &map_y, pcity, x, 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);
+       put_one_tile(&store, map_x, map_y,
+                    x * NORMAL_TILE_WIDTH, y * NORMAL_TILE_WIDTH, TRUE);
        if (pcity->city_map[x][y] == C_TILE_WORKER)
          put_city_tile_output(pdialog->map_canvas_store,
                               x * NORMAL_TILE_WIDTH,
Index: client/gui-gtk/mapview.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/client/gui-gtk/mapview.c,v
retrieving revision 1.157
diff -u -r1.157 mapview.c
--- client/gui-gtk/mapview.c    2003/02/20 23:14:33     1.157
+++ client/gui-gtk/mapview.c    2003/02/21 10:52:52
@@ -110,114 +110,6 @@
 }
 
 /**************************************************************************
-...
-**************************************************************************/
-void pixmap_put_tile(GdkDrawable *pm, int x, int y,
-                    int canvas_x, int canvas_y, int citymode)
-{
-  struct Sprite *tile_sprs[80];
-  int fill_bg;
-  struct player *pplayer;
-
-  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;
-
-    if (fill_bg) {
-      if (pplayer) {
-       gdk_gc_set_foreground(fill_bg_gc,
-                             colors_standard[player_color(pplayer)]);
-      } else {
-       gdk_gc_set_foreground(fill_bg_gc,
-                             colors_standard[COLOR_STD_BACKGROUND]);   
-      }
-      gdk_draw_rectangle(pm, fill_bg_gc, TRUE,
-                        canvas_x, canvas_y,
-                        NORMAL_TILE_WIDTH, NORMAL_TILE_HEIGHT);
-    } else {
-      /* first tile without mask */
-      gdk_draw_pixmap(pm, civ_gc, tile_sprs[0]->pixmap,
-                      0, 0, canvas_x, canvas_y,
-                      tile_sprs[0]->width, tile_sprs[0]->height);
-      i++;
-    }
-
-    for (;i<count; i++) {
-      if (tile_sprs[i]) {
-        pixmap_put_overlay_tile(pm, canvas_x, canvas_y, tile_sprs[i]);
-      }
-    }
-
-    if (draw_map_grid && !citymode) {
-      /* left side... */
-      gdk_gc_set_foreground(civ_gc,
-                           colors_standard[get_grid_color
-                                           (x, y, x - 1, y)]);
-      gdk_draw_line(pm, civ_gc, canvas_x, canvas_y, canvas_x,
-                   canvas_y + NORMAL_TILE_HEIGHT);
-
-      /* top side... */
-      gdk_gc_set_foreground(civ_gc,
-                           colors_standard[get_grid_color
-                                           (x, y, x, y - 1)]);
-      gdk_draw_line(pm, civ_gc, canvas_x, canvas_y,
-                   canvas_x + NORMAL_TILE_WIDTH, canvas_y);
-    }
-
-    if (draw_coastline && !draw_terrain) {
-      enum tile_terrain_type t1 = map_get_terrain(x, y), t2;
-      int x1 = x-1, y1 = y;
-      gdk_gc_set_foreground(civ_gc, colors_standard[COLOR_STD_OCEAN]);
-      if (normalize_map_pos(&x1, &y1)) {
-       t2 = map_get_terrain(x1, y1);
-       /* left side */
-       if (is_ocean(t1) ^ is_ocean(t2)) {
-         gdk_draw_line(pm, civ_gc,
-                       canvas_x, canvas_y,
-                       canvas_x, canvas_y + NORMAL_TILE_HEIGHT);
-       }
-      }
-      /* top side */
-      x1 = x; y1 = y-1;
-      if (normalize_map_pos(&x1, &y1)) {
-       t2 = map_get_terrain(x1, y1);
-       if (is_ocean(t1) ^ is_ocean(t2)) {
-         gdk_draw_line(pm, civ_gc,
-                       canvas_x, canvas_y,
-                       canvas_x + NORMAL_TILE_WIDTH, canvas_y);
-       }
-      }
-    }
-  } else {
-    /* tile is unknown */
-    pixmap_put_black_tile(pm, canvas_x, canvas_y);
-  }
-
-  if (!citymode) {
-    /* put any goto lines on the tile. */
-    if (is_real_map_pos(x, y)) {
-      int dir;
-      for (dir = 0; dir < 8; dir++) {
-       if (get_drawn(x, y, dir)) {
-         put_line(map_canvas_store, x, y, dir);
-       }
-      }
-    }
-
-    /* Some goto lines overlap onto the tile... */
-    if (NORMAL_TILE_WIDTH%2 == 0 || NORMAL_TILE_HEIGHT%2 == 0) {
-      int line_x = x - 1;
-      int line_y = y;
-      if (normalize_map_pos(&line_x, &line_y)
-         && get_drawn(line_x, line_y, 2)) {
-       /* it is really only one pixel in the top right corner */
-       put_line(map_canvas_store, line_x, line_y, 2);
-      }
-    }
-  }
-}
-
-/**************************************************************************
  This function is called to decrease a unit's HP smoothly in battle
  when combat_animation is turned on.
 **************************************************************************/
@@ -269,8 +161,10 @@
                      NORMAL_TILE_WIDTH, NORMAL_TILE_HEIGHT);
     } else { /* is_isometric */
       /* FIXME: maybe do as described in the above comment. */
-      pixmap_put_tile(single_tile_pixmap, losing_unit->x, losing_unit->y,
-                     0, 0, 0);
+      struct canvas_store store = {single_tile_pixmap};
+
+      put_one_tile(&store, losing_unit->x, losing_unit->y,
+                  0, 0, FALSE);
       put_unit_pixmap(losing_unit, single_tile_pixmap, 0, 0);
       pixmap_put_overlay_tile(single_tile_pixmap, 0, 0,
                              sprites.explode.unit[i]);
@@ -871,16 +765,6 @@
 }
 
 /**************************************************************************
-  Draw the given map tile at the given canvas position in non-isometric
-  view.
-**************************************************************************/
-void put_one_tile(int map_x, int map_y, int canvas_x, int canvas_y)
-{
-  pixmap_put_tile(map_canvas_store, map_x, map_y, canvas_x, canvas_y,
-                 FALSE);
-}
-
-/**************************************************************************
   Draw some or all of a tile onto the mapview canvas.
 **************************************************************************/
 void gui_map_put_tile_iso(int map_x, int map_y,
@@ -1182,6 +1066,18 @@
 }
 
 /**************************************************************************
+  Draw a full sprite onto the mapview or citydialog canvas.
+**************************************************************************/
+void gui_put_sprite_full(struct canvas_store *pcanvas_store,
+                        int canvas_x, int canvas_y,
+                        struct Sprite *sprite)
+{
+  gui_put_sprite(pcanvas_store, canvas_x, canvas_y,
+                sprite,
+                0, 0, sprite->width, sprite->height);
+}
+
+/**************************************************************************
   Place a (possibly masked) sprite on a pixmap.
 **************************************************************************/
 void pixmap_put_sprite_full(GdkDrawable *pixmap,
@@ -1190,6 +1086,29 @@
 {
   pixmap_put_sprite(pixmap, pixmap_x, pixmap_y, ssprite,
                    0, 0, ssprite->width, ssprite->height);
+}
+
+/**************************************************************************
+  Draw a filled-in colored rectangle onto the mapview or citydialog canvas.
+**************************************************************************/
+void gui_put_rectangle(struct canvas_store *pcanvas_store,
+                      enum color_std color,
+                      int canvas_x, int canvas_y, int width, int height)
+{
+  gdk_gc_set_foreground(fill_bg_gc, colors_standard[color]);
+  gdk_draw_rectangle(pcanvas_store->pixmap, fill_bg_gc, TRUE,
+                    canvas_x, canvas_y, width, height);
+}
+
+/**************************************************************************
+  Draw a 1-pixel-width colored line onto the mapview or citydialog canvas.
+**************************************************************************/
+void gui_put_line(struct canvas_store *pcanvas_store, enum color_std color,
+                 int start_x, int start_y, int dx, int dy)
+{
+  gdk_gc_set_foreground(civ_gc, colors_standard[color]);
+  gdk_draw_line(pcanvas_store->pixmap, civ_gc,
+               start_x, start_y, start_x + dx, start_y + dy);
 }
 
 /**************************************************************************
Index: client/gui-gtk/mapview.h
===================================================================
RCS file: /home/freeciv/CVS/freeciv/client/gui-gtk/mapview.h,v
retrieving revision 1.16
diff -u -r1.16 mapview.h
--- client/gui-gtk/mapview.h    2003/01/28 00:28:05     1.16
+++ client/gui-gtk/mapview.h    2003/02/21 10:52:52
@@ -40,8 +40,6 @@
                       int canvas_x, int canvas_y, int citymode);
 void pixmap_frame_tile_red(GdkDrawable *pm,
                           int canvas_x, int canvas_y);
-void pixmap_put_tile(GdkDrawable *pm, int x, int y,
-                    int canvas_x, int canvas_y, int citymode);
 void pixmap_put_black_tile(GdkDrawable *pm,
                           int canvas_x, int canvas_y);
 
Index: client/gui-gtk-2.0/citydlg.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/client/gui-gtk-2.0/citydlg.c,v
retrieving revision 1.30
diff -u -r1.30 citydlg.c
--- client/gui-gtk-2.0/citydlg.c        2003/02/15 07:23:47     1.30
+++ client/gui-gtk-2.0/citydlg.c        2003/02/21 10:52:53
@@ -1804,6 +1804,8 @@
 {
   int x, y;
   struct city *pcity = pdialog->pcity;
+  struct canvas_store store = {pdialog->map_canvas_store};
+
   for (y = 0; y < CITY_MAP_SIZE; y++)
     for (x = 0; x < CITY_MAP_SIZE; x++) {
       int map_x, map_y;
@@ -1811,8 +1813,8 @@
       if (is_valid_city_coords(x, y)
          && city_map_to_map(&map_x, &map_y, pcity, x, 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);
+       put_one_tile(&store, map_x, map_y,
+                    x * NORMAL_TILE_WIDTH, y * NORMAL_TILE_HEIGHT, TRUE);
        if (pcity->city_map[x][y] == C_TILE_WORKER)
          put_city_tile_output(pdialog->map_canvas_store,
                               x * NORMAL_TILE_WIDTH,
Index: client/gui-gtk-2.0/mapview.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/client/gui-gtk-2.0/mapview.c,v
retrieving revision 1.45
diff -u -r1.45 mapview.c
--- client/gui-gtk-2.0/mapview.c        2003/02/20 23:14:33     1.45
+++ client/gui-gtk-2.0/mapview.c        2003/02/21 10:52:54
@@ -110,114 +110,6 @@
 }
 
 /**************************************************************************
-...
-**************************************************************************/
-void pixmap_put_tile(GdkDrawable *pm, int x, int y,
-                    int canvas_x, int canvas_y, int citymode)
-{
-  struct Sprite *tile_sprs[80];
-  int fill_bg;
-  struct player *pplayer;
-
-  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;
-
-    if (fill_bg) {
-      if (pplayer) {
-       gdk_gc_set_foreground(fill_bg_gc,
-                             colors_standard[player_color(pplayer)]);
-      } else {
-       gdk_gc_set_foreground(fill_bg_gc,
-                             colors_standard[COLOR_STD_BACKGROUND]);   
-      }
-      gdk_draw_rectangle(pm, fill_bg_gc, TRUE,
-                        canvas_x, canvas_y,
-                        NORMAL_TILE_WIDTH, NORMAL_TILE_HEIGHT);
-    } else {
-      /* first tile without mask */
-      gdk_draw_pixmap(pm, civ_gc, tile_sprs[0]->pixmap,
-                      0, 0, canvas_x, canvas_y,
-                      tile_sprs[0]->width, tile_sprs[0]->height);
-      i++;
-    }
-
-    for (;i<count; i++) {
-      if (tile_sprs[i]) {
-        pixmap_put_overlay_tile(pm, canvas_x, canvas_y, tile_sprs[i]);
-      }
-    }
-
-    if (draw_map_grid && !citymode) {
-      /* left side... */
-      gdk_gc_set_foreground(civ_gc,
-                           colors_standard[get_grid_color
-                                           (x, y, x - 1, y)]);
-      gdk_draw_line(pm, civ_gc, canvas_x, canvas_y, canvas_x,
-                   canvas_y + NORMAL_TILE_HEIGHT);
-
-      /* top side... */
-      gdk_gc_set_foreground(civ_gc,
-                           colors_standard[get_grid_color
-                                           (x, y, x, y - 1)]);
-      gdk_draw_line(pm, civ_gc, canvas_x, canvas_y,
-                   canvas_x + NORMAL_TILE_WIDTH, canvas_y);
-    }
-
-    if (draw_coastline && !draw_terrain) {
-      enum tile_terrain_type t1 = map_get_terrain(x, y), t2;
-      int x1 = x-1, y1 = y;
-      gdk_gc_set_foreground(civ_gc, colors_standard[COLOR_STD_OCEAN]);
-      if (normalize_map_pos(&x1, &y1)) {
-       t2 = map_get_terrain(x1, y1);
-       /* left side */
-       if (is_ocean(t1) ^ is_ocean(t2)) {
-         gdk_draw_line(pm, civ_gc,
-                       canvas_x, canvas_y,
-                       canvas_x, canvas_y + NORMAL_TILE_HEIGHT);
-       }
-      }
-      /* top side */
-      x1 = x; y1 = y-1;
-      if (normalize_map_pos(&x1, &y1)) {
-       t2 = map_get_terrain(x1, y1);
-       if (is_ocean(t1) ^ is_ocean(t2)) {
-         gdk_draw_line(pm, civ_gc,
-                       canvas_x, canvas_y,
-                       canvas_x + NORMAL_TILE_WIDTH, canvas_y);
-       }
-      }
-    }
-  } else {
-    /* tile is unknown */
-    pixmap_put_black_tile(pm, canvas_x, canvas_y);
-  }
-
-  if (!citymode) {
-    /* put any goto lines on the tile. */
-    if (is_real_map_pos(x, y)) {
-      int dir;
-      for (dir = 0; dir < 8; dir++) {
-       if (get_drawn(x, y, dir)) {
-         put_line(map_canvas_store, x, y, dir);
-       }
-      }
-    }
-
-    /* Some goto lines overlap onto the tile... */
-    if (NORMAL_TILE_WIDTH%2 == 0 || NORMAL_TILE_HEIGHT%2 == 0) {
-      int line_x = x - 1;
-      int line_y = y;
-      if (normalize_map_pos(&line_x, &line_y)
-         && get_drawn(line_x, line_y, 2)) {
-       /* it is really only one pixel in the top right corner */
-       put_line(map_canvas_store, line_x, line_y, 2);
-      }
-    }
-  }
-}
-
-/**************************************************************************
  This function is called to decrease a unit's HP smoothly in battle
  when combat_animation is turned on.
 **************************************************************************/
@@ -269,8 +161,10 @@
                      NORMAL_TILE_WIDTH, NORMAL_TILE_HEIGHT);
     } else { /* is_isometric */
       /* FIXME: maybe do as described in the above comment. */
-      pixmap_put_tile(single_tile_pixmap, losing_unit->x, losing_unit->y,
-                     0, 0, 0);
+      struct canvas_store store = {single_tile_pixmap};
+
+      put_one_tile(&store, losing_unit->x, losing_unit->y,
+                  0, 0, FALSE);
       put_unit_pixmap(losing_unit, single_tile_pixmap, 0, 0);
       pixmap_put_overlay_tile(single_tile_pixmap, 0, 0,
                              sprites.explode.unit[i]);
@@ -905,16 +799,6 @@
 }
 
 /**************************************************************************
-  Draw the given map tile at the given canvas position in non-isometric
-  view.
-**************************************************************************/
-void put_one_tile(int map_x, int map_y, int canvas_x, int canvas_y)
-{
-  pixmap_put_tile(map_canvas_store, map_x, map_y, canvas_x, canvas_y,
-                 FALSE);
-}
-
-/**************************************************************************
   Draw some or all of a tile onto the mapview canvas.
 **************************************************************************/
 void gui_map_put_tile_iso(int map_x, int map_y,
@@ -1257,6 +1141,18 @@
 {
   pixmap_put_sprite(pcanvas_store->pixmap, canvas_x, canvas_y,
                    sprite, offset_x, offset_y, width, height);
+} 
+
+/**************************************************************************
+  Draw a full sprite onto the mapview or citydialog canvas.
+**************************************************************************/
+void gui_put_sprite_full(struct canvas_store *pcanvas_store,
+                        int canvas_x, int canvas_y,
+                        struct Sprite *sprite)
+{
+  gui_put_sprite(pcanvas_store, canvas_x, canvas_y,
+                sprite,
+                0, 0, sprite->width, sprite->height);
 }
 
 /**************************************************************************
@@ -1268,6 +1164,29 @@
 {
   pixmap_put_sprite(pixmap, pixmap_x, pixmap_y, ssprite,
                    0, 0, ssprite->width, ssprite->height);
+}
+
+/**************************************************************************
+  Draw a filled-in colored rectangle onto the mapview or citydialog canvas.
+**************************************************************************/
+void gui_put_rectangle(struct canvas_store *pcanvas_store,
+                      enum color_std color,
+                      int canvas_x, int canvas_y, int width, int height)
+{
+  gdk_gc_set_foreground(fill_bg_gc, colors_standard[color]);
+  gdk_draw_rectangle(pcanvas_store->pixmap, fill_bg_gc, TRUE,
+                    canvas_x, canvas_y, width, height);
+}
+
+/**************************************************************************
+  Draw a 1-pixel-width colored line onto the mapview or citydialog canvas.
+**************************************************************************/
+void gui_put_line(struct canvas_store *pcanvas_store, enum color_std color,
+                 int start_x, int start_y, int dx, int dy)
+{
+  gdk_gc_set_foreground(civ_gc, colors_standard[color]);
+  gdk_draw_line(pcanvas_store->pixmap, civ_gc,
+               start_x, start_y, start_x + dx, start_y + dy);
 }
 
 /**************************************************************************
Index: client/gui-gtk-2.0/mapview.h
===================================================================
RCS file: /home/freeciv/CVS/freeciv/client/gui-gtk-2.0/mapview.h,v
retrieving revision 1.7
diff -u -r1.7 mapview.h
--- client/gui-gtk-2.0/mapview.h        2003/01/28 00:18:16     1.7
+++ client/gui-gtk-2.0/mapview.h        2003/02/21 10:52:54
@@ -42,8 +42,6 @@
                       int canvas_x, int canvas_y, int citymode);
 void pixmap_frame_tile_red(GdkDrawable *pm,
                           int canvas_x, int canvas_y);
-void pixmap_put_tile(GdkDrawable *pm, int x, int y,
-                    int canvas_x, int canvas_y, int citymode);
 void pixmap_put_black_tile(GdkDrawable *pm,
                           int canvas_x, int canvas_y);
 
Index: client/gui-sdl/mapview.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/client/gui-sdl/mapview.c,v
retrieving revision 1.23
diff -u -r1.23 mapview.c
--- client/gui-sdl/mapview.c    2003/02/21 03:40:06     1.23
+++ client/gui-sdl/mapview.c    2003/02/21 10:52:55
@@ -154,15 +154,6 @@
   *map_view_pixel_height = Main.screen->h;
 }
 
-
-/**************************************************************************
-  Draw the given map tile at the given canvas position in no-isometric
-  view use with unification of update_mapcanvas(...).
-**************************************************************************/
-void put_one_tile( int map_x , int map_y , int canvas_x , int canvas_y )
-{
-}
-
 /**************************************************************************
   Draw some or all of a tile onto the mapview canvas.
 **************************************************************************/
@@ -206,6 +197,35 @@
   SDL_Rect src = {offset_x,offset_y,width,height};
   SDL_Rect dst = {canvas_x, canvas_y, 0, 0};
   SDL_BlitSurface(GET_SURF(sprite), &src, pCanvas_store->map, &dst);
+}
+
+/**************************************************************************
+  Draw a full sprite onto the mapview or citydialog canvas.
+**************************************************************************/
+void gui_put_sprite_full(struct canvas_store *pcanvas_store,
+                        int canvas_x, int canvas_y,
+                        struct Sprite *sprite)
+{
+  blit_entire_src(GET_SURF(sprite), pcanvas_store->map, canvas_x, canvas_y);
+}
+
+/**************************************************************************
+  Draw a filled-in colored rectangle onto the mapview or citydialog canvas.
+**************************************************************************/
+void gui_put_rectangle(struct canvas_store *pcanvas_store,
+                      enum color_std color,
+                      int canvas_x, int canvas_y, int width, int height)
+{
+  /* PORTME */
+}
+
+/**************************************************************************
+  Draw a 1-pixel-width colored line onto the mapview or citydialog canvas.
+**************************************************************************/
+void gui_put_line(struct canvas_store *pcanvas_store, enum color_std color,
+                 int start_x, int start_y, int dx, int dy)
+{
+  /* PORTME */
 }
 
 /**************************************************************************
Index: client/gui-stub/mapview.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/client/gui-stub/mapview.c,v
retrieving revision 1.27
diff -u -r1.27 mapview.c
--- client/gui-stub/mapview.c   2003/02/20 23:14:33     1.27
+++ client/gui-stub/mapview.c   2003/02/21 10:52:56
@@ -184,15 +184,6 @@
 }
 
 /**************************************************************************
-  Draw the given map tile at the given canvas position in non-isometric
-  view.
-**************************************************************************/
-void put_one_tile(int map_x, int map_y, int canvas_x, int canvas_y)
-{
-  /* PORTME */
-}
-
-/**************************************************************************
   Draw some or all of a tile onto the mapview canvas.
 **************************************************************************/
 void gui_map_put_tile_iso(int map_x, int map_y,
@@ -211,6 +202,35 @@
                    int canvas_x, int canvas_y,
                    struct Sprite *sprite,
                    int offset_x, int offset_y, int width, int height)
+{
+  /* PORTME */
+}
+
+/**************************************************************************
+  Draw a full sprite onto the mapview or citydialog canvas.
+**************************************************************************/
+void gui_put_sprite_full(struct canvas_store *pcanvas_store,
+                        int canvas_x, int canvas_y,
+                        struct Sprite *sprite)
+{
+  /* PORTME */
+}
+
+/**************************************************************************
+  Draw a filled-in colored rectangle onto the mapview or citydialog canvas.
+**************************************************************************/
+void gui_put_rectangle(struct canvas_store *pcanvas_store,
+                      enum color_std color,
+                      int canvas_x, int canvas_y, int width, int height)
+{
+  /* PORTME */
+}
+
+/**************************************************************************
+  Draw a 1-pixel-width colored line onto the mapview or citydialog canvas.
+**************************************************************************/
+void gui_put_line(struct canvas_store *pcanvas_store, enum color_std color,
+                 int start_x, int start_y, int dx, int dy)
 {
   /* PORTME */
 }
Index: client/gui-win32/citydlg.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/client/gui-win32/citydlg.c,v
retrieving revision 1.50
diff -u -r1.50 citydlg.c
--- client/gui-win32/citydlg.c  2003/02/12 22:49:51     1.50
+++ client/gui-win32/citydlg.c  2003/02/21 10:52:56
@@ -550,6 +550,8 @@
 {
   int y,x;
   struct city *pcity;
+  struct canvas_store store = {citydlgdc, pdialog->map_bmp};
+
   pcity=pdialog->pcity;
   for(y=0; y<CITY_MAP_SIZE; y++)
     for(x=0; x<CITY_MAP_SIZE; x++) {
@@ -558,9 +560,8 @@
       if (is_valid_city_coords(x, y)
          && city_map_to_map(&map_x, &map_y, pcity, x, 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);
+       put_one_tile(&store, map_x, map_y,
+                    x * NORMAL_TILE_WIDTH, y * NORMAL_TILE_HEIGHT, TRUE);
         if(pcity->city_map[x][y]==C_TILE_WORKER)
           put_city_tile_output(citydlgdc, NORMAL_TILE_WIDTH*x,
                               y*NORMAL_TILE_HEIGHT,
Index: client/gui-win32/mapview.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/client/gui-win32/mapview.c,v
retrieving revision 1.57
diff -u -r1.57 mapview.c
--- client/gui-win32/mapview.c  2003/02/20 23:14:33     1.57
+++ client/gui-win32/mapview.c  2003/02/21 10:52:58
@@ -26,6 +26,7 @@
 #include "log.h"
 #include "government.h"         /* government_graphic() */
 #include "map.h"
+#include "mem.h"
 #include "player.h"
 #include "rand.h"
 #include "support.h"
@@ -268,125 +269,6 @@
 }
 
 /**************************************************************************
-
-**************************************************************************/
-void pixmap_put_tile(HDC hdc, int x, int y,
-                     int canvas_x, int canvas_y, int citymode)
-{
-  struct Sprite *tile_sprs[80];
-  int fill_bg;
-  struct player *pplayer;
-
-  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;
-    
-    if (fill_bg) {
-      HBRUSH old;
-    
-      if (pplayer) {
-       old=SelectObject(hdc,brush_std[player_color(pplayer)]);
-      } else {
-       old=SelectObject(hdc,brush_std[COLOR_STD_BACKGROUND]);
-      }
-      mydrawrect(hdc,canvas_x,canvas_y,NORMAL_TILE_WIDTH,NORMAL_TILE_HEIGHT);
-      SelectObject(hdc,old);
-    } else {
-      /* first tile without mask */
-      draw_sprite(tile_sprs[0],hdc,canvas_x,canvas_y);
-      i++;
-    }
-
-    for (;i<count; i++) {
-      if (tile_sprs[i]) {
-        draw_sprite(tile_sprs[i],hdc,canvas_x,canvas_y);
-      }
-    }
-    
-    if (draw_map_grid && !citymode) {
-      HPEN old;
-      int here_in_radius =
-        player_in_city_radius(game.player_ptr, x, y);
-      /* left side... */
-      if ((map_get_tile(x-1, y))->known &&
-          (here_in_radius ||
-           player_in_city_radius(game.player_ptr, x-1, y))) {
-       old=SelectObject(hdc,pen_std[COLOR_STD_WHITE]);
-      } else {
-       old=SelectObject(hdc,pen_std[COLOR_STD_BLACK]);
-      }
-      MoveToEx(hdc,canvas_x,canvas_y,NULL);
-      LineTo(hdc,canvas_x,canvas_y+NORMAL_TILE_HEIGHT);
-      old=SelectObject(hdc,old);
-      /* top side... */
-      if((map_get_tile(x, y-1))->known &&
-         (here_in_radius ||
-          player_in_city_radius(game.player_ptr, x, y-1))) {
-        old=SelectObject(hdc,pen_std[COLOR_STD_WHITE]);
-      } else {
-       old=SelectObject(hdc,pen_std[COLOR_STD_BLACK]);
-      }
-      MoveToEx(hdc,canvas_x,canvas_y,NULL);
-      LineTo(hdc,canvas_x+NORMAL_TILE_WIDTH,canvas_y);
-      old=SelectObject(hdc,old);
-    }
-    if (draw_coastline && !draw_terrain) {
-      HPEN old;
-      enum tile_terrain_type t1 = map_get_terrain(x, y), t2;
-      int x1 = x-1, y1 = y;
-      old=SelectObject(hdc,pen_std[COLOR_STD_OCEAN]);
-      if (normalize_map_pos(&x1, &y1)) {
-        t2 = map_get_terrain(x1, y1);
-        /* left side */
-        if (is_ocean(t1) ^ is_ocean(t2)) {
-         MoveToEx(hdc,canvas_x,canvas_y,NULL);
-         LineTo(hdc,canvas_x,canvas_y+NORMAL_TILE_HEIGHT);
-       }
-      }
-      /* top side */
-      x1 = x; y1 = y-1;
-      if (normalize_map_pos(&x1, &y1)) {
-        t2 = map_get_terrain(x1, y1);
-        if (is_ocean(t1) ^ is_ocean(t2)) {
-         MoveToEx(hdc,canvas_x,canvas_y,NULL);
-         LineTo(hdc,canvas_x+NORMAL_TILE_WIDTH,canvas_y);
-       }
-      }
-      SelectObject(hdc,old);
-    }
-  } else {
-    /* tile is unknown */
-    BitBlt(hdc,canvas_x,canvas_y,NORMAL_TILE_WIDTH,NORMAL_TILE_HEIGHT,
-          NULL,0,0,BLACKNESS);
-  }
-
-  if (!citymode) {
-    /* put any goto lines on the tile. */
-    if (is_real_map_pos(x, y)) {
-      int dir;
-      for (dir = 0; dir < 8; dir++) {
-        if (get_drawn(x, y, dir)) {
-          put_line(hdc, x, y, dir,0);
-        }
-      }
-    }
-
-    /* Some goto lines overlap onto the tile... */
-    if (NORMAL_TILE_WIDTH%2 == 0 || NORMAL_TILE_HEIGHT%2 == 0) {
-      int line_x = x - 1;
-      int line_y = y;
-      if (normalize_map_pos(&line_x, &line_y)
-          && get_drawn(line_x, line_y, 2)) {
-        /* it is really only one pixel in the top right corner */
-        put_line(hdc, line_x, line_y, 2,0);
-      }
-    }
-  }
-}
-
-/**************************************************************************
 hack to ensure that mapstorebitmap is usable. 
 On win95/win98 mapstorebitmap becomes somehow invalid. 
 **************************************************************************/
@@ -640,26 +522,6 @@
 }
 
 /**************************************************************************
-  Draw the given map tile at the given canvas position in non-isometric
-  view.
-**************************************************************************/
-void put_one_tile(int map_x, int map_y, int canvas_x, int canvas_y)
-{
-  HDC mapstoredc;
-  HBITMAP old;
-
-  /* FIXME: we don't want to have to recreate the hdc each time! */
-  mapstoredc = CreateCompatibleDC(NULL);
-  old = SelectObject(mapstoredc, mapstorebitmap);
-
-  pixmap_put_tile(mapstoredc, map_x, map_y,
-                 canvas_x, canvas_y, FALSE);
-
-  SelectObject(mapstoredc, old);
-  DeleteDC(mapstoredc);
-}
-
-/**************************************************************************
   Flush the given part of the canvas buffer (if there is one) to the
   screen.
 **************************************************************************/
@@ -900,8 +762,9 @@
             NORMAL_TILE_WIDTH,NORMAL_TILE_HEIGHT,
             hdc,0,0,SRCCOPY);
     } else {
-      pixmap_put_tile(hdc, losing_unit->x, losing_unit->y,
-                      0, 0, 0);
+      struct canvas_store store = {NULL, single_tile_pixmap};
+
+      put_one_tile(&store, losing_unit->x, losing_unit->y, 0, 0, FALSE);
       put_unit_pixmap(losing_unit, hdc, 0, 0);
       draw_sprite(sprites.explode.unit[i],hdc,NORMAL_TILE_WIDTH/4,0);
       BitBlt(hdcwin,canvas_x,canvas_y,
@@ -1371,7 +1234,7 @@
 
   /* FIXME: we don't want to have to recreate the hdc each time! */
   hdc = CreateCompatibleDC(pcanvas_store->hdc);
-  old = SelectObject(hdc, panvas_store->bitmap);
+  old = SelectObject(hdc, pcanvas_store->bitmap);
 
   pixmap_put_overlay_tile_draw(hdc, canvas_x, canvas_y,
                               sprite, offset_x, offset_y,
@@ -1381,6 +1244,48 @@
   DeleteDC(hdc);
 }
 
+/**************************************************************************
+  Draw a full sprite onto the mapview or citydialog canvas.
+**************************************************************************/
+void gui_put_sprite_full(struct canvas_store *pcanvas_store,
+                        int canvas_x, int canvas_y,
+                        struct Sprite *sprite)
+{
+  gui_put_sprite(pcanvas_store, canvas_x, canvas_y, sprite,
+                0, 0, sprite->width, sprite->height);
+}
+
+/**************************************************************************
+  Draw a filled-in colored rectangle onto the mapview or citydialog canvas.
+**************************************************************************/
+void gui_put_rectangle(struct canvas_store *pcanvas_store,
+                      enum color_std color,
+                      int canvas_x, int canvas_y, int width, int height)
+{
+  HDC hdc = CreateCompatibleDC(pcanvas_store->hdc);
+  HBRUSH old = SelectObject(hdc, brush_std[color]);
+
+  mydrawrect(hdc, canvas_x, canvas_y, width, height);
+
+  SelectObject(hdc, old);
+  DeleteDC(hdc);
+}
+
+/**************************************************************************
+  Draw a 1-pixel-width colored line onto the mapview or citydialog canvas.
+**************************************************************************/
+void gui_put_line(struct canvas_store *pcanvas_store, enum color_std color,
+                 int start_x, int start_y, int dx, int dy)
+{
+  HDC hdc = CreateCompatibleDC(pcanvas_store->hdc);
+  HPEN old = SelectObject(hdc, pen_std[color]);
+
+  MoveToEx(hdc, start_x, start_y, NULL);
+  LineTo(hdc, start_x + dx, start_y + dy);
+
+  SelectObject(hdc, old);
+  DeleteDC(hdc);
+}
 
 /**************************************************************************
 Only used for isometric view.
Index: client/gui-win32/mapview.h
===================================================================
RCS file: /home/freeciv/CVS/freeciv/client/gui-win32/mapview.h,v
retrieving revision 1.5
diff -u -r1.5 mapview.h
--- client/gui-win32/mapview.h  2003/01/23 21:39:32     1.5
+++ client/gui-win32/mapview.h  2003/02/21 10:52:58
@@ -15,8 +15,6 @@
 
 #include "mapview_g.h"
 
-void pixmap_put_tile(HDC hdc, int x, int y, int abs_x0, int abs_y0,
-                     int citymode);
 void put_city_tile_output(HDC hdc, int x, int y,
                           int food, int shield, int trade);    
 void put_unit_pixmap(struct unit *punit, HDC hdc,int x,int y);
Index: client/gui-xaw/citydlg.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/client/gui-xaw/citydlg.c,v
retrieving revision 1.92
diff -u -r1.92 citydlg.c
--- client/gui-xaw/citydlg.c    2003/02/12 22:49:52     1.92
+++ client/gui-xaw/citydlg.c    2003/02/21 10:52:59
@@ -1512,6 +1512,7 @@
 {
   int x, y;
   struct city *pcity=pdialog->pcity;
+  struct canvas_store store = {XtWindow(pdialog->map_canvas)};
   
   for(y=0; y<CITY_MAP_SIZE; y++) {
     for(x=0; x<CITY_MAP_SIZE; x++) {
@@ -1520,8 +1521,8 @@
       if (is_valid_city_coords(x, y)
          && city_map_to_map(&map_x, &map_y, pcity, x, 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);
+       put_one_tile(&store, map_x, map_y,
+                    x * NORMAL_TILE_WIDTH, y * NORMAL_TILE_HEIGHT, TRUE);
        if (pcity->city_map[x][y] == C_TILE_WORKER)
          put_city_tile_output(XtWindow(pdialog->map_canvas),
                               x * NORMAL_TILE_WIDTH,
Index: client/gui-xaw/mapview.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/client/gui-xaw/mapview.c,v
retrieving revision 1.124
diff -u -r1.124 mapview.c
--- client/gui-xaw/mapview.c    2003/02/20 23:14:33     1.124
+++ client/gui-xaw/mapview.c    2003/02/21 10:52:59
@@ -119,10 +119,11 @@
 
   get_canvas_xy(losing_unit->x, losing_unit->y, &canvas_x, &canvas_y);
   for (i = 0; i < num_tiles_explode_unit; i++) {
+    struct canvas_store store = {single_tile_pixmap};
+
     anim_timer = renew_timer_start(anim_timer, TIMER_USER, TIMER_ACTIVE);
 
-    pixmap_put_tile(single_tile_pixmap, 0, 0,
-                   losing_unit->x, losing_unit->y, 0);
+    put_one_tile(&store, 0, 0, losing_unit->x, losing_unit->y, FALSE);
     put_unit_pixmap(losing_unit, single_tile_pixmap, 0, 0);
     pixmap_put_overlay_tile(single_tile_pixmap, 0, 0, sprites.explode.unit[i]);
 
@@ -603,16 +604,6 @@
 }
 
 /**************************************************************************
-  Draw the given map tile at the given canvas position in non-isometric
-  view.
-**************************************************************************/
-void put_one_tile(int map_x, int map_y, int canvas_x, int canvas_y)
-{
-  pixmap_put_tile(map_canvas_store, map_x, map_y,
-                 canvas_x, canvas_y, FALSE);
-}
-
-/**************************************************************************
   Draw some or all of a tile onto the mapview canvas.
 **************************************************************************/
 void gui_map_put_tile_iso(int map_x, int map_y,
@@ -663,6 +654,40 @@
 }
 
 /**************************************************************************
+  Draw a full sprite onto the mapview or citydialog canvas.
+**************************************************************************/
+void gui_put_sprite_full(struct canvas_store *pcanvas_store,
+                        int canvas_x, int canvas_y,
+                        struct Sprite *sprite)
+{
+  gui_put_sprite(pcanvas_store, canvas_x, canvas_y,
+                sprite, 0, 0, sprite->width, sprite->height);
+}
+
+/**************************************************************************
+  Draw a filled-in colored rectangle onto the mapview or citydialog canvas.
+**************************************************************************/
+void gui_put_rectangle(struct canvas_store *pcanvas_store,
+                      enum color_std color,
+                      int canvas_x, int canvas_y, int width, int height)
+{
+  XSetForeground(display, fill_bg_gc, colors_standard[color]);
+  XFillRectangle(display, pcanvas_store->pixmap, fill_bg_gc,
+                canvas_x, canvas_y, width, height);
+}
+
+/**************************************************************************
+  Draw a 1-pixel-width colored line onto the mapview or citydialog canvas.
+**************************************************************************/
+void gui_put_line(struct canvas_store *pcanvas_store, enum color_std color,
+                 int start_x, int start_y, int dx, int dy)
+{
+  XSetForeground(display, civ_gc, colors_standard[color]);
+  XDrawLine(display, pcanvas_store->pixmap, civ_gc,
+           start_x, start_y, start_x + dx, start_y + dy);
+}
+
+/**************************************************************************
   Flush the given part of the canvas buffer (if there is one) to the
   screen.
 **************************************************************************/
@@ -899,114 +924,6 @@
                 NORMAL_TILE_WIDTH-5, NORMAL_TILE_HEIGHT-5);
 }
 
-
-/**************************************************************************
-...
-**************************************************************************/
-void pixmap_put_tile(Pixmap pm, int x, int y, int canvas_x, int canvas_y, 
-                    int citymode)
-{
-  struct Sprite *tile_sprs[80];
-  int fill_bg;
-  struct player *pplayer;
-
-  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;
-
-    if (fill_bg) {
-      if (pplayer) {
-        XSetForeground(display, fill_bg_gc,
-                      colors_standard[player_color(pplayer)]);
-      } else {
-        XSetForeground(display, fill_bg_gc,
-                      colors_standard[COLOR_STD_BACKGROUND]);
-      }
-      XFillRectangle(display, pm, fill_bg_gc, 
-                    canvas_x, canvas_y, NORMAL_TILE_WIDTH, NORMAL_TILE_HEIGHT);
-    } else {
-      /* first tile without mask */
-      XCopyArea(display, tile_sprs[0]->pixmap, pm, 
-               civ_gc, 0, 0,
-               tile_sprs[0]->width, tile_sprs[0]->height, canvas_x, canvas_y);
-      i++;
-    }
-
-    for (;i<count; i++) {
-      if (tile_sprs[i]) {
-        pixmap_put_overlay_tile(pm, canvas_x, canvas_y, tile_sprs[i]);
-      }
-    }
-
-    if (draw_map_grid && !citymode) {
-      /* left side... */
-      XSetForeground(display, civ_gc, colors_standard[get_grid_color
-                                                     (x, y, x - 1, y)]);
-      XDrawLine(display, pm, civ_gc,
-               canvas_x, canvas_y,
-               canvas_x, canvas_y + NORMAL_TILE_HEIGHT);
-
-      /* top side... */
-      XSetForeground(display, civ_gc, colors_standard[get_grid_color
-                                                     (x, y, x, y - 1)]);
-      XDrawLine(display, pm, civ_gc,
-               canvas_x, canvas_y,
-               canvas_x + NORMAL_TILE_WIDTH, canvas_y);
-    }
-    if (draw_coastline && !draw_terrain) {
-      enum tile_terrain_type t1 = map_get_terrain(x, y), t2;
-      int x1 = x-1, y1 = y;
-      XSetForeground(display, civ_gc, colors_standard[COLOR_STD_OCEAN]);
-      if (normalize_map_pos(&x1, &y1)) {
-       t2 = map_get_terrain(x1, y1);
-       /* left side */
-       if (is_ocean(t1) ^ is_ocean(t2)) {
-         XDrawLine(display, pm, civ_gc,
-                   canvas_x, canvas_y,
-                   canvas_x, canvas_y + NORMAL_TILE_HEIGHT);
-       }
-      }
-      /* top side */
-      x1 = x; y1 = y-1;
-      if (normalize_map_pos(&x1, &y1)) {
-       t2 = map_get_terrain(x1, y1);
-       if (is_ocean(t1) ^ is_ocean(t2)) {
-         XDrawLine(display, pm, civ_gc,
-                   canvas_x, canvas_y,
-                   canvas_x + NORMAL_TILE_WIDTH, canvas_y);
-       }
-      }
-    }
-  } else {
-    /* tile is unknown */
-    pixmap_put_black_tile(pm, canvas_x, canvas_y);
-  }
-
-  if (!citymode) {
-    /* put any goto lines on the tile. */
-    if (is_real_map_pos(x, y)) {
-      int dir;
-      for (dir = 0; dir < 8; dir++) {
-       if (get_drawn(x, y, dir)) {
-         put_line(map_canvas_store, x, y, dir);
-       }
-      }
-    }
-
-    /* Some goto lines overlap onto the tile... */
-    if (NORMAL_TILE_WIDTH%2 == 0 || NORMAL_TILE_HEIGHT%2 == 0) {
-      int line_x = x - 1;
-      int line_y = y;
-      if (normalize_map_pos(&line_x, &line_y)
-         && get_drawn(line_x, line_y, 2)) {
-       /* it is really only one pixel in the top right corner */
-       put_line(map_canvas_store, line_x, line_y, 2);
-      }
-    }
-  }
-}
-
-  
 /**************************************************************************
 ...
 **************************************************************************/
Index: client/gui-xaw/mapview.h
===================================================================
RCS file: /home/freeciv/CVS/freeciv/client/gui-xaw/mapview.h,v
retrieving revision 1.12
diff -u -r1.12 mapview.h
--- client/gui-xaw/mapview.h    2002/12/13 19:15:13     1.12
+++ client/gui-xaw/mapview.h    2003/02/21 10:52:59
@@ -42,8 +42,6 @@
                       void *client_data);
 void map_canvas_resize(void);
 
-void pixmap_put_tile(Pixmap pm, int x, int y, int canvas_x, int canvas_y, 
-                    int citymode);
 void pixmap_put_black_tile(Pixmap pm, int canvas_x, int canvas_y);
 void pixmap_frame_tile_red(Pixmap pm, int canvas_x, int canvas_y);
 
Index: client/include/mapview_g.h
===================================================================
RCS file: /home/freeciv/CVS/freeciv/client/include/mapview_g.h,v
retrieving revision 1.32
diff -u -r1.32 mapview_g.h
--- client/include/mapview_g.h  2003/02/20 23:14:33     1.32
+++ client/include/mapview_g.h  2003/02/21 10:52:59
@@ -38,7 +38,6 @@
 
 void show_city_desc(struct city *pcity, int canvas_x, int canvas_y);
 
-void put_one_tile(int map_x, int map_y, int canvas_x, int canvas_y);
 void gui_map_put_tile_iso(int map_x, int map_y,
                          int canvas_x, int canvas_y,
                          int offset_x, int offset_y, int offset_y_unit,
@@ -49,6 +48,14 @@
                    struct Sprite *sprite,
                    int offset_x, int offset_y,
                    int width, int height);
+void gui_put_sprite_full(struct canvas_store *pcanvas_store,
+                        int canvas_x, int canvas_y,
+                        struct Sprite *sprite);
+void gui_put_rectangle(struct canvas_store *pcanvas_store,
+                      enum color_std color,
+                      int canvas_x, int canvas_y, int width, int height);
+void gui_put_line(struct canvas_store *pcanvas_store, enum color_std color,
+                 int start_x, int start_y, int dx, int dy);
 void flush_mapcanvas(int canvas_x, int canvas_y,
                     int pixel_width, int pixel_height);
 

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