Complete.Org: Mailing Lists: Archives: freeciv-dev: April 2004:
[Freeciv-Dev] (PR#8573) draw non-iso grid via DRAWN_GRID
Home

[Freeciv-Dev] (PR#8573) draw non-iso grid via DRAWN_GRID

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: undisclosed-recipients: ;
Subject: [Freeciv-Dev] (PR#8573) draw non-iso grid via DRAWN_GRID
From: "Jason Short" <jdorje@xxxxxxxxxxxxxxxxxxxxx>
Date: Thu, 22 Apr 2004 16:21:23 -0700
Reply-to: rt@xxxxxxxxxxx

<URL: http://rt.freeciv.org/Ticket/Display.html?id=8573 >

This patch handles the grid drawing in non-iso view the same way it's 
done in iso-view.

The advantage is that the iso-view and non-iso view tilespec codes 
should now line up properly.

jason

Index: client/mapview_common.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/client/mapview_common.c,v
retrieving revision 1.103
diff -u -r1.103 mapview_common.c
--- client/mapview_common.c     20 Apr 2004 19:56:16 -0000      1.103
+++ client/mapview_common.c     22 Apr 2004 23:16:52 -0000
@@ -1007,17 +1007,20 @@
     }
 
     for (i = 0; i < count; i++) {
-      if (tile_sprs[i].sprite) {
+      switch (tile_sprs[i].type) {
+      case DRAWN_SPRITE:
        canvas_put_sprite_full(pcanvas,
                               canvas_x + tile_sprs[i].offset_x,
                               canvas_y + tile_sprs[i].offset_y,
                               tile_sprs[i].sprite);
+       break;
+      case DRAWN_GRID:
+       /*** Grid (map grid, borders, coastline, etc.) ***/
+       tile_draw_grid(pcanvas, map_x, map_y, canvas_x, canvas_y,
+                      D_FULL, citymode);
+       break;
       }
     }
-
-    /*** Grid (map grid, borders, coastline, etc.) ***/
-    tile_draw_grid(pcanvas, map_x, map_y, canvas_x, canvas_y,
-                  D_FULL, citymode);
   } else {
     /* tile is unknown */
     canvas_put_rectangle(pcanvas, COLOR_STD_BLACK,
Index: client/tilespec.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/client/tilespec.c,v
retrieving revision 1.160
diff -u -r1.160 tilespec.c
--- client/tilespec.c   22 Apr 2004 21:07:32 -0000      1.160
+++ client/tilespec.c   22 Apr 2004 23:16:52 -0000
@@ -2418,6 +2418,10 @@
     }
   }
 
+  /* Add grid. */
+  sprs->type = DRAWN_GRID;
+  sprs++;
+
   return sprs - save_sprs;
 }
 

[Prev in Thread] Current Thread [Next in Thread]
  • [Freeciv-Dev] (PR#8573) draw non-iso grid via DRAWN_GRID, Jason Short <=