Complete.Org: Mailing Lists: Archives: freeciv-dev: January 2005:
[Freeciv-Dev] (PR#11815) remove is_isometric users
Home

[Freeciv-Dev] (PR#11815) remove is_isometric users

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
Subject: [Freeciv-Dev] (PR#11815) remove is_isometric users
From: "Jason Short" <jdorje@xxxxxxxxxxxxxxxxxxxxx>
Date: Wed, 5 Jan 2005 19:31:28 -0800
Reply-to: bugs@xxxxxxxxxxx

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

This happy patch removes the only two remaining users of is_isometric in 
gui-gtk-2.0.

This is useful mostly to enforce a rule: the GUI code shouldn't need to 
know is_isometric.

-jason

? gmon.out
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.108
diff -u -r1.108 citydlg.c
--- client/gui-gtk-2.0/citydlg.c        21 Dec 2004 04:18:53 -0000      1.108
+++ client/gui-gtk-2.0/citydlg.c        6 Jan 2005 03:28:21 -0000
@@ -616,8 +616,7 @@
   gtk_container_add(GTK_CONTAINER(pdialog->overview.supported_units_frame), 
sw);
 
   {
-    int unit_height = (is_isometric) ?
-      UNIT_TILE_HEIGHT : UNIT_TILE_HEIGHT + UNIT_TILE_HEIGHT / 2;
+    int unit_height = NORMAL_TILE_HEIGHT * 3 / 2;
 
     align = gtk_alignment_new(0.0, 0.0, 0.0, 0.0);
     gtk_widget_set_size_request(align, -1, unit_height);
@@ -1538,8 +1537,7 @@
       GtkWidget *cmd, *pix;
       struct unit_node node;
 
-      int unit_height = (is_isometric) ?
-       UNIT_TILE_HEIGHT : UNIT_TILE_HEIGHT + UNIT_TILE_HEIGHT / 2;
+      int unit_height = NORMAL_TILE_HEIGHT * 3 / 2;
 
       cmd = gtk_button_new();
       node.cmd = cmd;
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.152
diff -u -r1.152 mapview.c
--- client/gui-gtk-2.0/mapview.c        28 Dec 2004 23:01:51 -0000      1.152
+++ client/gui-gtk-2.0/mapview.c        6 Jan 2005 03:28:21 -0000
@@ -997,7 +997,7 @@
     gdk_gc_set_ts_origin(fill_tile_gc, canvas_x, canvas_y);
     gdk_gc_set_foreground(fill_tile_gc, colors_standard[color]);
 
-    if (is_isometric) {
+    if (sprites.black_tile && sprites.black_tile->mask) {
       gdk_gc_set_clip_origin(fill_tile_gc, canvas_x, canvas_y);
       gdk_gc_set_clip_mask(fill_tile_gc, sprites.black_tile->mask);
     }
@@ -1006,7 +1006,7 @@
                       canvas_x, canvas_y,
                       NORMAL_TILE_WIDTH, NORMAL_TILE_HEIGHT);
 
-    if (is_isometric) {
+    if (sprites.black_tile && sprites.black_tile->mask) {
       gdk_gc_set_clip_mask(fill_tile_gc, NULL);
     }
   }

[Prev in Thread] Current Thread [Next in Thread]
  • [Freeciv-Dev] (PR#11815) remove is_isometric users, Jason Short <=