Complete.Org: Mailing Lists: Archives: freeciv-dev: April 2000:
[Freeciv-Dev] patch: draw fog on cities (PR#344)
Home

[Freeciv-Dev] patch: draw fog on cities (PR#344)

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: freeciv-dev@xxxxxxxxxxx
Cc: bugs@xxxxxxxxxxxxxxxxxxx
Subject: [Freeciv-Dev] patch: draw fog on cities (PR#344)
From: David Pfitzner <dwp@xxxxxxxxxxxxxx>
Date: Sun, 23 Apr 2000 07:05:59 -0700 (PDT)

Currently, for fogged enemy cities the fog is drawn "underneath"
the city flag and icon, which can make it hard to tell visually
whether the city is fogged or not.  (Eg, for a city on the edge
of your unfogged region; especially for solid backgrounds -- it 
becomes reasonably easy using "shield"-style flags.)

This patch draws the fog over the top.  I also moved the drawing
of the city size graphics right to the top, because otherwise they
can be hard to read (and this also avoid obscuration by unhappiness
or pollution etc).

The main disadvantage of this patch is that because the city icons
pack a fair bit of detail into only a few fixes, they can look 
a bit ugly when fogged (for trident tiles).  :-(

An alternative would be to put the fog over the city_nation_flag, 
but under the city icon itself.  Though that then looks a bit 
inconsistent...

-- David

--- freeciv-cvs/client/tilespec.c       Sun Apr  9 14:03:15 2000
+++ freeciv-mod/client/tilespec.c       Sun Apr 23 23:41:42 2000
@@ -737,13 +737,14 @@
 static int fill_city_sprite_array(struct Sprite **sprs, struct city *pcity)
 {
   struct Sprite **save_sprs=sprs;
-
+  struct tile *ptile = map_get_tile(pcity->x, pcity->y);
+  
   if(!use_solid_color_behind_units) {
     /* will be the first sprite if flags_are_transparent == FALSE */
     *sprs++ = get_city_nation_flag_sprite(pcity);
   } else *sprs++ = NULL;
   
-  if(genlist_size(&((map_get_tile(pcity->x, pcity->y))->units.list)) > 0)
+  if(genlist_size(&(ptile->units.list)) > 0)
     *sprs++ = get_city_occupied_sprite(pcity);
 
   *sprs++ = get_city_sprite(pcity);
@@ -751,17 +752,23 @@
   if(city_got_citywalls(pcity))
     *sprs++ = get_city_wall_sprite(pcity);
 
-  if(pcity->size>=10)
-    *sprs++ = sprites.city.size_tens[pcity->size/10];
-
-  *sprs++ = sprites.city.size[pcity->size%10];
-
   if(map_get_special(pcity->x, pcity->y) & S_POLLUTION)
     *sprs++ = sprites.tx.pollution;
 
   if(city_unhappy(pcity))
     *sprs++ = sprites.city.disorder;
 
+  if(ptile->known==TILE_KNOWN_FOGGED)
+    *sprs++ = sprites.tx.fog;
+
+  /* Put the size sprites last, so that they are not obscured
+   * (and because they can be hard to read if fogged).
+   */
+  if(pcity->size>=10)
+    *sprs++ = sprites.city.size_tens[pcity->size/10];
+
+  *sprs++ = sprites.city.size[pcity->size%10];
+
   return sprs - save_sprs;
 }
 

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