Complete.Org: Mailing Lists: Archives: freeciv-dev: February 2005:
[Freeciv-Dev] (PR#12350) solid unit background color not working with is
Home

[Freeciv-Dev] (PR#12350) solid unit background color not working with is

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: matzjosh-freeciv@xxxxxxxxxxxxxx
Subject: [Freeciv-Dev] (PR#12350) solid unit background color not working with iso tilesets
From: "Jason Short" <jdorje@xxxxxxxxxxxxxxxxxxxxx>
Date: Sat, 26 Feb 2005 16:52:26 -0800
Reply-to: bugs@xxxxxxxxxxx

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

This patch fixes it for the dev branch.  A simpler fix is probably
needed for 2.0.

-jason

Index: client/mapview_common.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/client/mapview_common.c,v
retrieving revision 1.197
diff -u -r1.197 mapview_common.c
--- client/mapview_common.c     26 Feb 2005 18:27:19 -0000      1.197
+++ client/mapview_common.c     27 Feb 2005 00:52:06 -0000
@@ -919,8 +919,9 @@
     case DRAWN_BG:
       /*** Background color. ***/
       if (is_isometric) {
-       canvas_fill_sprite_area(pcanvas, sprites.black_tile, COLOR_STD_BLACK,
-                           canvas_x, canvas_y);
+       canvas_fill_sprite_area(pcanvas, sprites.black_tile,
+                               pdrawn[i].data.bg.color,
+                               canvas_x, canvas_y);
        if (fog) {
          canvas_fog_sprite_area(pcanvas, sprites.black_tile,
                                 canvas_x, canvas_y);
Index: client/tilespec.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/client/tilespec.c,v
retrieving revision 1.243
diff -u -r1.243 tilespec.c
--- client/tilespec.c   26 Feb 2005 18:40:21 -0000      1.243
+++ client/tilespec.c   27 Feb 2005 00:52:07 -0000
@@ -2074,19 +2074,12 @@
   struct drawn_sprite *save_sprs = sprs;
   int ihp;
 
-  if (is_isometric) {
-    if (backdrop) {
+  if (backdrop) {
+    if (!solid_color_behind_units) {
       ADD_SPRITE(get_unit_nation_flag_sprite(punit),
                 DRAW_FULL, TRUE, flag_offset_x, flag_offset_y);
-    }
-  } else {
-    if (backdrop) {
-      if (!solid_color_behind_units) {
-       ADD_SPRITE(get_unit_nation_flag_sprite(punit),
-                  DRAW_FULL, TRUE, flag_offset_x, flag_offset_y);
-      } else {
-       ADD_BG(player_color(unit_owner(punit)));
-      }
+    } else {
+      /* Taken care of in the LAYER_BACKGROUND. */
     }
   }
 
@@ -2930,6 +2923,10 @@
    * if we're drawing on the mapview. */
   bool do_draw_unit = (punit && (draw_units || !ptile
                                 || (draw_focus_unit && pfocus == punit)));
+  bool solid_bg = (solid_color_behind_units
+                  && (do_draw_unit
+                      || (pcity && draw_cities)
+                      || (ptile && !draw_terrain)));
 
   if (citymode) {
     int count = 0, i, cx, cy;
@@ -2986,7 +2983,7 @@
   case LAYER_TERRAIN2:
     /* Terrain and specials.  These are drawn in multiple layers so that
      * upper layers will cover layers underneath. */
-    if (ptile && tile_get_known(ptile) != TILE_UNKNOWN) {
+    if (ptile && !solid_bg && tile_get_known(ptile) != TILE_UNKNOWN) {
       assert(MAX_NUM_LAYERS == 2);
       sprs += fill_terrain_sprite_array(sprs,
                                        (layer == LAYER_TERRAIN1) ? 0 : 1,
@@ -2996,7 +2993,7 @@
 
   case LAYER_WATER:
     if (ptile && tile_get_known(ptile) != TILE_UNKNOWN) {
-      if (is_ocean(ttype) && draw_terrain) {
+      if (is_ocean(ttype) && draw_terrain && !solid_bg) {
        for (dir = 0; dir < 4; dir++) {
          if (contains_special(tspecial_near[DIR4_TO_DIR8[dir]], S_RIVER)) {
            ADD_SPRITE_SIMPLE(sprites.tx.river_outlet[dir]);
@@ -3007,7 +3004,7 @@
       sprs += fill_irrigation_sprite_array(sprs, tspecial, tspecial_near,
                                           pcity);
 
-      if (draw_terrain && contains_special(tspecial, S_RIVER)) {
+      if (draw_terrain && !solid_bg && contains_special(tspecial, S_RIVER)) {
        int i;
 
        /* Draw rivers on top of irrigation. */

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