Complete.Org: Mailing Lists: Archives: freeciv-dev: January 2005:
[Freeciv-Dev] Re: (PR#11980) freeciv 2.0.0.beta6: disappearing units
Home

[Freeciv-Dev] Re: (PR#11980) freeciv 2.0.0.beta6: disappearing units

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: dssr@xxxxxxx
Subject: [Freeciv-Dev] Re: (PR#11980) freeciv 2.0.0.beta6: disappearing units
From: "Jason Short" <jdorje@xxxxxxxxxxxxxxxxxxxxx>
Date: Fri, 28 Jan 2005 13:58:53 -0800
Reply-to: bugs@xxxxxxxxxxx

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

Jason Short wrote:
> <URL: http://bugs.freeciv.org/Ticket/Display.html?id=11980 >
> 
> I assume you turned off "units" in the view menu.  This means that units
> won't be drawn.
> 
> The bug here is that it also means units won't be drawn in city dialogs
> or on the panel.  Which is rather crippling, and may not be trivial to
> fix.  This option is rather usless so maybe it should just be removed.

OK, I take it back.  Here are patches to fix this (for 2.0 and dev 
branches).

-jason

Index: client/tilespec.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/client/tilespec.c,v
retrieving revision 1.224
diff -u -r1.224 tilespec.c
--- client/tilespec.c   22 Jan 2005 19:45:39 -0000      1.224
+++ client/tilespec.c   28 Jan 2005 21:57:25 -0000
@@ -2670,6 +2670,11 @@
   struct unit *pfocus = get_unit_in_focus();
   struct drawn_sprite *save_sprs = sprs;
 
+  /* Unit drawing is disabled if the view options is turned off, but only
+   * if we're drawing on the mapview. */
+  bool do_draw_unit = (punit && (draw_units || !ptile
+                                || (draw_focus_unit && pfocus == punit)));
+
   if (ptile && tile_get_known(ptile) != TILE_UNKNOWN) {
     build_tile_data(ptile,
                    &ttype, &tspecial, ttype_near, tspecial_near);
@@ -2684,7 +2689,7 @@
 
     /* Set up background color. */
     if (solid_color_behind_units) {
-      if (punit && (draw_units || (draw_focus_unit && pfocus == punit))) {
+      if (do_draw_unit) {
        ADD_BG(player_color(unit_owner(punit)));
       } else if (pcity && draw_cities) {
        ADD_BG(player_color(city_owner(pcity)));
@@ -2834,7 +2839,7 @@
     break;
 
   case LAYER_UNIT:
-    if (punit && (draw_units || (punit == pfocus && draw_focus_unit))) {
+    if (do_draw_unit) {
       bool stacked = ptile && (unit_list_size(ptile->units) > 1);
       bool backdrop = !pcity;
 
? patch.diff
? win32.diff
Index: client/tilespec.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/client/tilespec.c,v
retrieving revision 1.204.2.12
diff -u -r1.204.2.12 tilespec.c
--- client/tilespec.c   25 Dec 2004 19:50:23 -0000      1.204.2.12
+++ client/tilespec.c   28 Jan 2005 21:57:32 -0000
@@ -2641,13 +2641,18 @@
   struct unit *pfocus = get_unit_in_focus();
   struct drawn_sprite *save_sprs = sprs;
 
+  /* Unit drawing is disabled if the view options is turned off, but only
+   * if we're drawing on the mapview. */
+  bool do_draw_unit = (punit && (draw_units || !ptile
+                                || (draw_focus_unit && pfocus == punit)));
+
   if (ptile && tile_get_known(ptile) == TILE_UNKNOWN) {
     return sprs - save_sprs;
   }
 
   /* Set up background color. */
   if (solid_color_behind_units) {
-    if (punit && (draw_units || (draw_focus_unit && pfocus == punit))) {
+    if (do_draw_unit) {
       ADD_BG(player_color(unit_owner(punit)));
     } else if (pcity && draw_cities) {
       ADD_BG(player_color(city_owner(pcity)));
@@ -2771,7 +2776,7 @@
               FALSE, 0, 0);
   }
 
-  if (punit && (draw_units || (punit == pfocus && draw_focus_unit))) {
+  if (do_draw_unit) {
     bool stacked = ptile && (unit_list_size(&ptile->units) > 1);
     bool backdrop = !pcity;
 

[Prev in Thread] Current Thread [Next in Thread]