Complete.Org: Mailing Lists: Archives: freeciv-dev: April 2004:
[Freeciv-Dev] (PR#8579) bg_color parameter for fill_tile_sprite_array_is
Home

[Freeciv-Dev] (PR#8579) bg_color parameter for fill_tile_sprite_array_is

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: undisclosed-recipients: ;
Subject: [Freeciv-Dev] (PR#8579) bg_color parameter for fill_tile_sprite_array_iso
From: "Jason Short" <jdorje@xxxxxxxxxxxxxxxxxxxxx>
Date: Sat, 24 Apr 2004 00:59:50 -0700
Reply-to: rt@xxxxxxxxxxx

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

fill_tile_sprite_array has a solid_bg and bg_color parameters.

However fill_tile_sprite_array_iso only has the solid_bg parameter.  The 
bg_color is always assumed to be COLOR_STD_BACKGROUND.

That patch changes that by adding the extra parameter.  This makes the 
two functions line up more closely.  This is a small step toward PR#8574.

jason

Index: client/tilespec.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/client/tilespec.c,v
retrieving revision 1.161
diff -u -r1.161 tilespec.c
--- client/tilespec.c   24 Apr 2004 07:46:52 -0000      1.161
+++ client/tilespec.c   24 Apr 2004 07:57:59 -0000
@@ -2147,7 +2147,8 @@
  5) huts
 ***********************************************************************/
 int fill_tile_sprite_array_iso(struct drawn_sprite *sprs,
-                              int x, int y, bool citymode, bool *solid_bg)
+                              int x, int y, bool citymode,
+                              bool *solid_bg, enum color_std *bg_color)
 {
   enum tile_terrain_type ttype, ttype_near[8];
   enum tile_special_type tspecial, tspecial_near[8];
@@ -2193,6 +2194,7 @@
     }
   } else {
     *solid_bg = TRUE;
+    *bg_color = COLOR_STD_BACKGROUND;
   }
   
   sprs += fill_road_rail_sprite_array(sprs,
Index: client/tilespec.h
===================================================================
RCS file: /home/freeciv/CVS/freeciv/client/tilespec.h,v
retrieving revision 1.62
diff -u -r1.62 tilespec.h
--- client/tilespec.h   22 Apr 2004 21:07:32 -0000      1.62
+++ client/tilespec.h   24 Apr 2004 07:57:59 -0000
@@ -67,7 +67,8 @@
 /* Gfx support */
 
 int fill_tile_sprite_array_iso(struct drawn_sprite *sprs,
-                              int x, int y, bool citymode, bool *solid_bg);
+                              int x, int y, bool citymode,
+                              bool *solid_bg, enum color_std *bg_color);
 int fill_tile_sprite_array(struct drawn_sprite *sprs, int abs_x0, int abs_y0,
                           bool citymode, bool *solid_bg,
                           enum color_std *bg_color);
Index: client/gui-gtk/mapview.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/client/gui-gtk/mapview.c,v
retrieving revision 1.216
diff -u -r1.216 mapview.c
--- client/gui-gtk/mapview.c    23 Apr 2004 22:58:05 -0000      1.216
+++ client/gui-gtk/mapview.c    24 Apr 2004 07:57:59 -0000
@@ -968,6 +968,7 @@
   struct drawn_sprite tile_sprs[80];
   int count, i;
   bool solid_bg, fog;
+  enum color_std bg_color;
   struct canvas canvas_store = {pm};
 
   if (!width || !(height || height_unit))
@@ -991,7 +992,7 @@
   if (solid_bg) {
     gdk_gc_set_clip_origin(fill_bg_gc, canvas_x, canvas_y);
     gdk_gc_set_clip_mask(fill_bg_gc, sprites.black_tile->mask);
-    gdk_gc_set_foreground(fill_bg_gc, colors_standard[COLOR_STD_BACKGROUND]);
+    gdk_gc_set_foreground(fill_bg_gc, colors_standard[bg_color]);
 
     gdk_draw_rectangle(pm, fill_bg_gc, TRUE,
                       canvas_x+offset_x, canvas_y+offset_y,
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.121
diff -u -r1.121 mapview.c
--- client/gui-gtk-2.0/mapview.c        23 Apr 2004 22:58:05 -0000      1.121
+++ client/gui-gtk-2.0/mapview.c        24 Apr 2004 07:57:59 -0000
@@ -1026,13 +1026,14 @@
   struct drawn_sprite tile_sprs[80];
   int count, i;
   bool solid_bg, fog;
+  enum color_std bg_color;
   struct canvas canvas_store = {.type = CANVAS_PIXMAP, .v.pixmap = pm};
 
   if (!width || !(height || height_unit))
     return;
 
   count = fill_tile_sprite_array_iso(tile_sprs,
-                                    x, y, citymode, &solid_bg);
+                                    x, y, citymode, &solid_bg, &bg_color);
 
   if (count == -1) { /* tile is unknown */
     pixmap_put_black_tile_iso(pm, canvas_x, canvas_y,
@@ -1049,7 +1050,7 @@
   if (solid_bg) {
     gdk_gc_set_clip_origin(fill_bg_gc, canvas_x, canvas_y);
     gdk_gc_set_clip_mask(fill_bg_gc, sprites.black_tile->mask);
-    gdk_gc_set_foreground(fill_bg_gc, colors_standard[COLOR_STD_BACKGROUND]);
+    gdk_gc_set_foreground(fill_bg_gc, colors_standard[bg_color]);
 
     gdk_draw_rectangle(pm, fill_bg_gc, TRUE,
                       canvas_x+offset_x, canvas_y+offset_y,
Index: client/gui-win32/mapview.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/client/gui-win32/mapview.c,v
retrieving revision 1.113
diff -u -r1.113 mapview.c
--- client/gui-win32/mapview.c  23 Apr 2004 22:58:06 -0000      1.113
+++ client/gui-win32/mapview.c  24 Apr 2004 07:58:00 -0000
@@ -918,11 +918,13 @@
   struct canvas canvas_store={hdc,NULL};
   int count, i;
   bool fog, solid_bg, is_real;
+  enum color_std bg_color;
 
   if (!width || !(height || height_unit))
     return;
 
-  count = fill_tile_sprite_array_iso(tile_sprs, x, y, citymode, &solid_bg);
+  count = fill_tile_sprite_array_iso(tile_sprs, x, y, citymode,
+                                    &solid_bg, &bg_color);
 
   if (count == -1) { /* tile is unknown */
     pixmap_put_black_tile_iso(hdc, canvas_x, canvas_y,
@@ -945,8 +947,8 @@
     points[2].y=canvas_y+NORMAL_TILE_HEIGHT;
     points[3].x=canvas_x+NORMAL_TILE_WIDTH;
     points[3].y=canvas_y+NORMAL_TILE_HEIGHT/2;
-    oldpen=SelectObject(hdc,pen_std[COLOR_STD_BACKGROUND]); 
-    oldbrush=SelectObject(hdc,brush_std[COLOR_STD_BACKGROUND]);
+    oldpen = SelectObject(hdc, pen_std[bg_color]); 
+    oldbrush = SelectObject(hdc, brush_std[bg_color]);
     Polygon(hdc,points,4);
     SelectObject(hdc,oldpen);
     SelectObject(hdc,oldbrush);

[Prev in Thread] Current Thread [Next in Thread]
  • [Freeciv-Dev] (PR#8579) bg_color parameter for fill_tile_sprite_array_iso, Jason Short <=