Complete.Org: Mailing Lists: Archives: freeciv-dev: December 2003:
[Freeciv-Dev] (PR#7157) Add #define is_city_hilited(pcity)
Home

[Freeciv-Dev] (PR#7157) Add #define is_city_hilited(pcity)

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: undisclosed-recipients: ;
Subject: [Freeciv-Dev] (PR#7157) Add #define is_city_hilited(pcity)
From: "Arnstein Lindgard" <a-l@xxxxxxx>
Date: Fri, 26 Dec 2003 08:31:57 -0800
Reply-to: rt@xxxxxxxxxxx

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

Add a #define as an access function
  is_city_hilited(pcity)
for the area selection rectangle.


Arnstein

diff -ruN -Xdiff_ignore freeciv/client/gui-gtk/cityrep.c 
access/client/gui-gtk/cityrep.c
--- freeciv/client/gui-gtk/cityrep.c    Mon Nov 17 19:27:28 2003
+++ access/client/gui-gtk/cityrep.c     Fri Dec 26 17:15:11 2003
@@ -45,6 +45,7 @@
 #include "gui_main.h"
 #include "gui_stuff.h"
 #include "mapview.h"
+#include "mapctrl.h"    /* is_city_hilited() */
 #include "optiondlg.h"
 #include "repodlgs.h"
 
@@ -1355,7 +1356,7 @@
   {
     struct city *pcity = gtk_clist_get_row_data(GTK_CLIST(city_list), i);
 
-    if (map_get_tile(pcity->x, pcity->y)->client.hilite == HILITE_CITY) {
+    if (is_city_hilited(pcity)) {
       gtk_clist_select_row(GTK_CLIST(city_list), i, 0);
     }
   }
diff -ruN -Xdiff_ignore freeciv/client/gui-gtk-2.0/cityrep.c 
access/client/gui-gtk-2.0/cityrep.c
--- freeciv/client/gui-gtk-2.0/cityrep.c        Fri Nov 28 21:37:01 2003
+++ access/client/gui-gtk-2.0/cityrep.c Fri Dec 26 17:19:10 2003
@@ -39,6 +39,7 @@
 #include "gui_main.h"
 #include "gui_stuff.h"
 #include "mapview.h"
+#include "mapctrl.h"    /* is_city_hilited() */
 #include "mapview_common.h"
 #include "optiondlg.h"
 #include "options.h"
@@ -1697,7 +1698,7 @@
     itree_get(&it, 0, &res, -1);
     pcity = res;
 
-    if (map_get_tile(pcity->x, pcity->y)->client.hilite == HILITE_CITY)  {
+    if (is_city_hilited(pcity))  {
       itree_select(city_selection, &it);
     }
   }
diff -ruN -Xdiff_ignore freeciv/client/mapctrl_common.c 
access/client/mapctrl_common.c
--- freeciv/client/mapctrl_common.c     Tue Dec 16 16:10:04 2003
+++ access/client/mapctrl_common.c      Fri Dec 26 17:06:49 2003
@@ -348,7 +348,7 @@
   else {
     connection_do_buffer(&aconnection);
     city_list_iterate(game.player_ptr->cities, pcity) {
-      if (map_get_tile(pcity->x, pcity->y)->client.hilite == HILITE_CITY) {
+      if (is_city_hilited(pcity)) {
         clipboard_send_production_packet(pcity);
       }
     } city_list_iterate_end;
diff -ruN -Xdiff_ignore freeciv/client/mapctrl_common.h 
access/client/mapctrl_common.h
--- freeciv/client/mapctrl_common.h     Tue Dec 16 16:10:04 2003
+++ access/client/mapctrl_common.h      Fri Dec 26 17:17:45 2003
@@ -59,4 +59,7 @@
 
 extern struct city *city_workers_display;
 
+#define is_city_hilited(pcity)                                              \
+  map_get_tile((pcity)->x, (pcity)->y)->client.hilite == HILITE_CITY        \
+
 #endif /* FC__MAPVIEW_COMMON_H */

[Prev in Thread] Current Thread [Next in Thread]
  • [Freeciv-Dev] (PR#7157) Add #define is_city_hilited(pcity), Arnstein Lindgard <=