Complete.Org: Mailing Lists: Archives: freeciv-dev: February 2005:
[Freeciv-Dev] (PR#12185) unit citymaps in non-iso view
Home

[Freeciv-Dev] (PR#12185) unit citymaps in non-iso view

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
Subject: [Freeciv-Dev] (PR#12185) unit citymaps in non-iso view
From: "Jason Short" <jdorje@xxxxxxxxxxxxxxxxxxxxx>
Date: Wed, 9 Feb 2005 08:57:18 -0800
Reply-to: bugs@xxxxxxxxxxx

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

In non-iso-view there are artifacts when moving settlers with their 
gridlines on.  This is because only the tiles containing the citymap are 
refreshed, whereas in non-iso-view (which I didn't test very well 
apparently) the gridlines are 1 pixel outside of this - on the next tile 
over.

Paulz reported this; see http://www.freeciv.org/~paulz/artifacts.png/

This patch fixes it.

-jason

Index: client/mapview_common.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/client/mapview_common.c,v
retrieving revision 1.180
diff -u -r1.180 mapview_common.c
--- client/mapview_common.c     9 Feb 2005 16:23:12 -0000       1.180
+++ client/mapview_common.c     9 Feb 2005 16:55:17 -0000
@@ -90,8 +90,14 @@
                            bool write_to_screen)
 {
   if (unit_type_flag(punit->type, F_CITIES)) {
-    int width = get_citydlg_canvas_width();
-    int height = get_citydlg_canvas_height();
+    /* For settlers we (often) have to update the whole citymap area because
+     * of the 't' overlays or the citymap outlines.  The above check could
+     * be more rigorous so that no update is done unless it's needed...
+     *
+     * HACK: The +2 below accounts for grid lines that may actually be on a
+     * tile outside of the city radius. */
+    int width = get_citydlg_canvas_width() + 2;
+    int height = get_citydlg_canvas_height() + 2;
     int canvas_x, canvas_y;
 
     tile_to_canvas_pos(&canvas_x, &canvas_y, ptile);
Index: client/packhand.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/client/packhand.c,v
retrieving revision 1.466
diff -u -r1.466 packhand.c
--- client/packhand.c   8 Feb 2005 18:43:51 -0000       1.466
+++ client/packhand.c   9 Feb 2005 16:55:17 -0000
@@ -590,11 +590,12 @@
      * rectangle covered by the city's map, and update that.  Then we
      * queue up a city description redraw for later.
      *
-     * HACK: The +2 below accounts for grid lines that may actually be on a
-     * tile outside of the city radius. */
+     * HACK: The addition below accounts for grid lines that may actually
+     * be on a tile outside of the city radius.  This is similar to what's
+     * done in refresh_tile_mapcanvas. */
     int canvas_x, canvas_y;
-    int width = get_citydlg_canvas_width() + 2;
-    int height = get_citydlg_canvas_height() + 2;
+    int width = get_citydlg_canvas_width() + NORMAL_TILE_WIDTH;
+    int height = get_citydlg_canvas_height() + NORMAL_TILE_HEIGHT;
 
     (void) tile_to_canvas_pos(&canvas_x, &canvas_y, pcity->tile);
 

[Prev in Thread] Current Thread [Next in Thread]
  • [Freeciv-Dev] (PR#12185) unit citymaps in non-iso view, Jason Short <=