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 via RT" <rt@xxxxxxxxxxxxxx>
Date: Fri, 7 Feb 2003 04:10:10 -0800
Reply-to: rt.freeciv.org@xxxxxxxxxxxxxx

put_one_tile() is the core drawing routine for non-iso mode.  This 
function moves it into mapview_common.

This makes it a rather large patch, but this is difficult to avoid.  It 
doesn't seem like the function should be broken up (to move it in 
pieces), and it is fairly long (100+ lines).

Three new GUI functions are added: gui_put_sprite_full, 
gui_put_rectangle, and gui_put_line.  These should be pretty 
self-explanatory.

The implementation for gui-sdl is incomplete (gui-sdl does not use 
non-iso mode so there is no code to base it on).  There is a bug in the 
win32 client: gui_put_rectangle doesn't work (nor does the same code 
work in current CVS; try turning off terrain).  gui-gtk, gui-gtk-2.0, 
and gui-xaw clients have been tested and work.

The only ugly part of this patch is in the drawing of goto lines.  here 
instead of the local gui function put_line I just call draw_segment. 
This results in a bit of extra drawing, but is otherwise okay.  Note 
that the current goto-line-drawing system is already (slightly) broken: 
it doesn't work for animation (i.e., single_tile_pixmap).  Another patch 
will be able to fix this.

jason

Index: client/mapview_common.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/client/mapview_common.c,v
retrieving revision 1.28
diff -u -r1.28 mapview_common.c
--- client/mapview_common.c     2003/02/07 08:35:02     1.28
+++ client/mapview_common.c     2003/02/07 11:08:18
@@ -24,6 +24,7 @@
 
 #include "mapview_g.h"
 
+#include "climap.h"
 #include "control.h"
 #include "goto.h"
 #include "mapview_common.h"
@@ -422,6 +423,100 @@
   }
 }
 
+
+/**************************************************************************
+  Draw the given map tile at the given canvas position in non-isometric
+  view.
+**************************************************************************/
+void put_one_tile(canvas_t *pcanvas, 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, 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, canvas_x, canvas_y, tile_sprs[i]);
+      }
+    }
+
+    if (draw_map_grid && !citymode) {
+      /* left side... */
+      gui_put_line(pcanvas, 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, 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, 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, COLOR_STD_OCEAN,
+                      canvas_x, canvas_y, NORMAL_TILE_WIDTH, 0);
+       }
+      }
+    }
+  } else {
+    /* tile is unknown */
+    gui_put_rectangle(pcanvas, 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
@@ -434,7 +529,7 @@
   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(NULL, 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.21
diff -u -r1.21 mapview_common.h
--- client/mapview_common.h     2003/02/07 08:35:02     1.21
+++ client/mapview_common.h     2003/02/07 11:08:18
@@ -140,6 +140,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(canvas_t *pcanvas, 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.155
diff -u -r1.155 citydlg.c
--- client/gui-gtk/citydlg.c    2003/02/04 17:07:42     1.155
+++ client/gui-gtk/citydlg.c    2003/02/07 11:08:20
@@ -1841,8 +1841,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(pdialog->map_canvas_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.154
diff -u -r1.154 mapview.c
--- client/gui-gtk/mapview.c    2003/02/07 08:35:02     1.154
+++ client/gui-gtk/mapview.c    2003/02/07 11:08:21
@@ -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_tile(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,8 @@
                      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);
+      put_one_tile(single_tile_pixmap, 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 +763,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,
@@ -1183,6 +1065,17 @@
 }
 
 /**************************************************************************
+  Draw a full sprite onto the mapview or citydialog canvas.
+**************************************************************************/
+void gui_put_sprite_full(canvas_t *pcanvas, int canvas_x, int canvas_y,
+                        struct Sprite *sprite)
+{
+  gui_put_sprite(pcanvas, 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,
@@ -1191,6 +1084,31 @@
 {
   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(canvas_t *pcanvas, enum color_std color,
+                      int canvas_x, int canvas_y, int width, int height)
+{
+  GdkPixmap *pm = pcanvas ? pcanvas : map_canvas_store;
+
+  gdk_gc_set_foreground(fill_bg_gc, colors_standard[color]);
+  gdk_draw_rectangle(pm, 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(canvas_t *pcanvas, enum color_std color,
+                 int start_x, int start_y, int dx, int dy)
+{
+  GdkPixmap *pm = pcanvas ? pcanvas : map_canvas_store;
+
+  gdk_gc_set_foreground(civ_gc, colors_standard[color]);
+  gdk_draw_line(pm, 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/07 11:08:21
@@ -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.27
diff -u -r1.27 citydlg.c
--- client/gui-gtk-2.0/citydlg.c        2003/02/04 22:13:27     1.27
+++ client/gui-gtk-2.0/citydlg.c        2003/02/07 11:08:23
@@ -1823,8 +1823,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(pdialog->map_canvas_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.42
diff -u -r1.42 mapview.c
--- client/gui-gtk-2.0/mapview.c        2003/02/07 08:35:03     1.42
+++ client/gui-gtk-2.0/mapview.c        2003/02/07 11:08:24
@@ -109,114 +109,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_tile(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.
 **************************************************************************/
@@ -268,8 +160,8 @@
                      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);
+      put_one_tile(single_tile_pixmap, 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]);
@@ -900,16 +792,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,
@@ -1253,6 +1135,17 @@
 
   pixmap_put_sprite(pm, 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(canvas_t *pcanvas, int canvas_x, int canvas_y,
+                        struct Sprite *sprite)
+{
+  gui_put_sprite(pcanvas, canvas_x, canvas_y,
+                sprite,
+                0, 0, sprite->width, sprite->height);
 }
 
 /**************************************************************************
@@ -1264,6 +1157,31 @@
 {
   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(canvas_t *pcanvas, enum color_std color,
+                      int canvas_x, int canvas_y, int width, int height)
+{
+  GdkPixmap *pm = pcanvas ? pcanvas : map_canvas_store;
+
+  gdk_gc_set_foreground(fill_bg_gc, colors_standard[color]);
+  gdk_draw_rectangle(pm, 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(canvas_t *pcanvas, enum color_std color,
+                 int start_x, int start_y, int dx, int dy)
+{
+  GdkPixmap *pm = pcanvas ? pcanvas : map_canvas_store;
+
+  gdk_gc_set_foreground(civ_gc, colors_standard[color]);
+  gdk_draw_line(pm, 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/07 11:08:24
@@ -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.18
diff -u -r1.18 mapview.c
--- client/gui-sdl/mapview.c    2003/02/07 08:35:03     1.18
+++ client/gui-sdl/mapview.c    2003/02/07 11:08:25
@@ -162,15 +162,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.
 **************************************************************************/
@@ -212,6 +203,36 @@
   /* FIXME: handle partial-sprite draws. */
   assert(pcanvas == NULL);
   blit_entire_src((SDL_Surface *)sprite, surf, canvas_x, canvas_y);
+}
+
+/**************************************************************************
+  Draw a full sprite onto the mapview or citydialog canvas.
+**************************************************************************/
+void gui_put_sprite_full(canvas_t *pcanvas,
+                        int canvas_x, int canvas_y,
+                        struct Sprite *sprite)
+{
+  SDL_Surface *surf = pcanvas ? pcanvas : Main.screen;
+
+  blit_entire_src((SDL_Surface *)sprite, surf, canvas_x, canvas_y);
+}
+
+/**************************************************************************
+  Draw a filled-in colored rectangle onto the mapview or citydialog canvas.
+**************************************************************************/
+void gui_put_rectangle(canvas_t *pcanvas, 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(canvas_t *pcanvas, enum color_std color,
+                 int start_x, int start_y, int dx, int dy)
+{
+  /* PORTME */
 }
 
 void flush_mapcanvas( int canvas_x , int canvas_y ,
Index: client/gui-stub/mapview.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/client/gui-stub/mapview.c,v
retrieving revision 1.26
diff -u -r1.26 mapview.c
--- client/gui-stub/mapview.c   2003/02/07 08:35:03     1.26
+++ client/gui-stub/mapview.c   2003/02/07 11:08:25
@@ -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,
@@ -210,6 +201,34 @@
 void gui_put_sprite(canvas_t *pcanvas, 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(canvas_t *pcanvas,
+                        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(canvas_t *pcanvas, 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(canvas_t *pcanvas, 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.49
diff -u -r1.49 citydlg.c
--- client/gui-win32/citydlg.c  2003/02/04 22:13:27     1.49
+++ client/gui-win32/citydlg.c  2003/02/07 11:08:27
@@ -558,9 +558,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(citydlgdc, 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.54
diff -u -r1.54 mapview.c
--- client/gui-win32/mapview.c  2003/02/07 08:35:03     1.54
+++ client/gui-win32/mapview.c  2003/02/07 11:08:28
@@ -263,125 +263,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_tile(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. 
 **************************************************************************/
@@ -635,26 +516,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.
 **************************************************************************/
@@ -892,8 +753,7 @@
             NORMAL_TILE_WIDTH,NORMAL_TILE_HEIGHT,
             hdc,0,0,SRCCOPY);
     } else {
-      pixmap_put_tile(hdc, losing_unit->x, losing_unit->y,
-                      0, 0, 0);
+      put_one_tile(hdc, 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,
@@ -1357,12 +1217,10 @@
                    struct Sprite *sprite,
                    int offset_x, int offset_y, int width, int height)
 {
-  HDC hdc;
+  /* FIXME: we don't want to have to recreate the hdc each time! */
+  HDC hdc = pcanvas ? pcanvas : CreateCompatibleDC(NULL);
   HBITMAP old;
 
-  /* FIXME: we don't want to have to recreate the hdc each time! */
-  assert(pcanvas == NULL);
-  hdc = CreateCompatibleDC(NULL);
   old = SelectObject(hdc, mapstorebitmap);
 
   pixmap_put_overlay_tile_draw(hdc, canvas_x, canvas_y,
@@ -1370,9 +1228,56 @@
                               width, height, 0);
 
   SelectObject(hdc, old);
-  DeleteDC(hdc);
+  if (!pcanvas) {
+    DeleteDC(hdc);
+  }
 }
 
+/**************************************************************************
+  Draw a full sprite onto the mapview or citydialog canvas.
+**************************************************************************/
+void gui_put_sprite_full(canvas_t *pcanvas,
+                        int canvas_x, int canvas_y,
+                        struct Sprite *sprite)
+{
+  gui_put_sprite(pcanvas, 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(canvas_t *pcanvas, enum color_std color,
+                      int canvas_x, int canvas_y, int width, int height)
+{
+  HDC hdc = pcanvas ? pcanvas : CreateCompatibleDC(NULL);
+  HBRUSH old;
+
+  old = SelectObject(hdc, brush_std[color]);
+  mydrawrect(hdc, canvas_x, canvas_y, width, height);
+  SelectObject(hdc, old);
+  if (!pcanvas) {
+    DeleteDC(hdc);
+  }
+}
+
+/**************************************************************************
+  Draw a 1-pixel-width colored line onto the mapview or citydialog canvas.
+**************************************************************************/
+void gui_put_line(canvas_t *pcanvas, enum color_std color,
+                 int start_x, int start_y, int dx, int dy)
+{
+  HDC hdc = pcanvas ? pcanvas : CreateCompatibleDC(NULL);
+  HPEN old;
+
+  old = SelectObject(hdc, pen_std[color]);
+  MoveToEx(hdc, start_x, start_y, NULL);
+  LineTo(hdc, start_x + dx, start_y + dy);
+  SelectObject(hdc, old);
+  if (!pcanvas) {
+    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/07 11:08:28
@@ -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.91
diff -u -r1.91 citydlg.c
--- client/gui-xaw/citydlg.c    2003/02/04 22:13:27     1.91
+++ client/gui-xaw/citydlg.c    2003/02/07 11:08:29
@@ -1532,8 +1532,10 @@
       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);
+       Pixmap pm = XtWindow(pdialog->map_canvas);
+
+       put_one_tile(&pm, 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.121
diff -u -r1.121 mapview.c
--- client/gui-xaw/mapview.c    2003/02/07 08:35:03     1.121
+++ client/gui-xaw/mapview.c    2003/02/07 11:08:30
@@ -120,8 +120,8 @@
   for (i = 0; i < num_tiles_explode_unit; i++) {
     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(&single_tile_pixmap, 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]);
 
@@ -598,16 +598,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,
@@ -659,6 +649,42 @@
 }
 
 /**************************************************************************
+  Draw a full sprite onto the mapview or citydialog canvas.
+**************************************************************************/
+void gui_put_sprite_full(canvas_t *pcanvas,
+                        int canvas_x, int canvas_y,
+                        struct Sprite *sprite)
+{
+  gui_put_sprite(pcanvas, 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(canvas_t *pcanvas, enum color_std color,
+                      int canvas_x, int canvas_y, int width, int height)
+{
+  Pixmap pm = pcanvas ? *(Pixmap*)pcanvas : map_canvas_store;
+
+  XSetForeground(display, fill_bg_gc, colors_standard[color]);
+  XFillRectangle(display, pm, 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(canvas_t *pcanvas, enum color_std color,
+                 int start_x, int start_y, int dx, int dy)
+{
+  Pixmap pm = pcanvas ? *(Pixmap*)pcanvas : map_canvas_store;
+
+  XSetForeground(display, civ_gc, colors_standard[color]);
+  XDrawLine(display, pm, 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.
 **************************************************************************/
@@ -896,114 +922,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_tile(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/07 11:08:30
@@ -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.31
diff -u -r1.31 mapview_g.h
--- client/include/mapview_g.h  2003/02/07 08:35:03     1.31
+++ client/include/mapview_g.h  2003/02/07 11:08:30
@@ -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,13 @@
                    struct Sprite *sprite,
                    int offset_x, int offset_y,
                    int width, int height);
+void gui_put_sprite_full(canvas_t *pcanvas,
+                        int canvas_x, int canvas_y,
+                        struct Sprite *sprite);
+void gui_put_rectangle(canvas_t *pcanvas, enum color_std color,
+                      int canvas_x, int canvas_y, int width, int height);
+void gui_put_line(canvas_t *pcanvas, 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]