Complete.Org: Mailing Lists: Archives: freeciv-dev: March 2005:
[Freeciv-Dev] (PR#12553) add tileset parameter to tileset accessor funct
Home

[Freeciv-Dev] (PR#12553) add tileset parameter to tileset accessor funct

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
Subject: [Freeciv-Dev] (PR#12553) add tileset parameter to tileset accessor functions
From: "Jason Short" <jdorje@xxxxxxxxxxxxxxxxxxxxx>
Date: Sat, 19 Mar 2005 15:42:42 -0800
Reply-to: bugs@xxxxxxxxxxx

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

This patch adds a tileset parameter to some of the accessor functions in 
tilespec.h.  This is needed so that the sprites array can be moved 
inside the tileset struct.

The tilespec.[ch] parts I wrote myself; the rest is just 
search-and-replace.  Only gui-gtk-2.0 is tested.

-jason

? client/agents/agents.c.20475
Index: client/climisc.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/client/climisc.c,v
retrieving revision 1.157
diff -u -r1.157 climisc.c
--- client/climisc.c    18 Mar 2005 11:26:24 -0000      1.157
+++ client/climisc.c    19 Mar 2005 23:39:16 -0000
@@ -313,9 +313,9 @@
     /* This clipping can be necessary since we can end up with excess
      * research */
     index = CLIP(0, index, NUM_TILES_PROGRESS - 1);
-    return get_indicator_sprite(INDICATOR_BULB, index);
+    return get_indicator_sprite(tileset, INDICATOR_BULB, index);
   } else {
-    return get_indicator_sprite(INDICATOR_BULB, 0);
+    return get_indicator_sprite(tileset, INDICATOR_BULB, 0);
   }
 }
 
@@ -338,9 +338,9 @@
 
     /* The clipping is needed because the above math is a little fuzzy. */
     index = CLIP(0, index, NUM_TILES_PROGRESS - 1);
-    return get_indicator_sprite(INDICATOR_WARMING, index);
+    return get_indicator_sprite(tileset, INDICATOR_WARMING, index);
   } else {
-    return get_indicator_sprite(INDICATOR_WARMING, 0);
+    return get_indicator_sprite(tileset, INDICATOR_WARMING, 0);
   }
 }
 
@@ -363,9 +363,9 @@
 
     /* The clipping is needed because the above math is a little fuzzy. */
     index = CLIP(0, index, NUM_TILES_PROGRESS - 1);
-    return get_indicator_sprite(INDICATOR_COOLING, index);
+    return get_indicator_sprite(tileset, INDICATOR_COOLING, index);
   } else {
-    return get_indicator_sprite(INDICATOR_COOLING, 0);
+    return get_indicator_sprite(tileset, INDICATOR_COOLING, 0);
   }
 }
 
@@ -381,7 +381,7 @@
      * when we don't know any better. */
     struct citizen_type c = {.type = CITIZEN_UNHAPPY};
 
-    return get_citizen_sprite(c, 0, NULL);
+    return get_citizen_sprite(tileset, c, 0, NULL);
   }
 }
 
Index: client/mapview_common.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/client/mapview_common.c,v
retrieving revision 1.217
diff -u -r1.217 mapview_common.c
--- client/mapview_common.c     18 Mar 2005 00:38:55 -0000      1.217
+++ client/mapview_common.c     19 Mar 2005 23:39:17 -0000
@@ -1440,7 +1440,7 @@
                             struct unit *punit1, int hp1)
 {
   static struct timer *anim_timer = NULL; 
-  struct sprite_vector *anim = get_unit_explode_animation();
+  struct sprite_vector *anim = get_unit_explode_animation(tileset);
   const int num_tiles_explode_unit = sprite_vector_size(anim);
   struct unit *losing_unit = (hp0 == 0 ? punit0 : punit1);
   int canvas_x, canvas_y, i;
Index: client/tilespec.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/client/tilespec.c,v
retrieving revision 1.273
diff -u -r1.273 tilespec.c
--- client/tilespec.c   19 Mar 2005 23:00:28 -0000      1.273
+++ client/tilespec.c   19 Mar 2005 23:39:18 -0000
@@ -4078,7 +4078,8 @@
   value indicates there is no city; i.e., the sprite is just being
   used as a picture).
 **************************************************************************/
-struct Sprite *get_citizen_sprite(struct citizen_type type,
+struct Sprite *get_citizen_sprite(struct tileset *t,
+                                 struct citizen_type type,
                                  int citizen_index,
                                  const struct city *pcity)
 {
@@ -4096,7 +4097,7 @@
 /**************************************************************************
   Return a "sample" sprite for this city style.
 **************************************************************************/
-struct Sprite *get_sample_city_sprite(int city_style)
+struct Sprite *get_sample_city_sprite(struct tileset *t, int city_style)
 {
   int index = city_styles[city_style].tiles_num - 1;
 
@@ -4106,7 +4107,7 @@
 /**************************************************************************
   Return a sprite with the "right-arrow" theme graphic.
 **************************************************************************/
-struct Sprite *get_arrow_sprite(void)
+struct Sprite *get_arrow_sprite(struct tileset *t)
 {
   return sprites.right_arrow;
 }
@@ -4114,7 +4115,7 @@
 /**************************************************************************
   Return a tax sprite for the given output type (usually gold/lux/sci).
 **************************************************************************/
-struct Sprite *get_tax_sprite(Output_type_id otype)
+struct Sprite *get_tax_sprite(struct tileset *t, Output_type_id otype)
 {
   switch (otype) {
   case O_SCIENCE:
@@ -4136,7 +4137,7 @@
   Return a thumbs-up/thumbs-down sprite to show treaty approval or
   disapproval.
 **************************************************************************/
-struct Sprite *get_treaty_thumb_sprite(bool on_off)
+struct Sprite *get_treaty_thumb_sprite(struct tileset *t, bool on_off)
 {
   return sprites.treaty_thumb[on_off ? 1 : 0];
 }
@@ -4145,7 +4146,7 @@
   Return a sprite_vector containing the animation sprites for a unit
   explosion.
 **************************************************************************/
-struct sprite_vector *get_unit_explode_animation(void)
+struct sprite_vector *get_unit_explode_animation(struct tileset *t)
 {
   return &sprites.explode.unit;
 }
@@ -4165,7 +4166,7 @@
   active coordinates of the mouse relative to the sprite) are placed int
   (*hot_x, *hot_y).
 **************************************************************************/
-struct Sprite *get_cursor_sprite(enum cursor_type cursor,
+struct Sprite *get_cursor_sprite(struct tileset *t, enum cursor_type cursor,
                                 int *hot_x, int *hot_y)
 {
   *hot_x = sprites.cursor[cursor].hot_x;
@@ -4193,7 +4194,7 @@
   FIXME: This function shouldn't be needed if the attention graphics are
   drawn natively by the tileset code.
 ****************************************************************************/
-struct Sprite *get_attention_crosshair_sprite(void)
+struct Sprite *get_attention_crosshair_sprite(struct tileset *t)
 {
   return sprites.user.attention;
 }
@@ -4202,7 +4203,8 @@
   Returns a sprite for the given indicator with the given index.  The
   index should be in [0, NUM_TILES_PROGRESS).
 ****************************************************************************/
-struct Sprite *get_indicator_sprite(enum indicator_type indicator,
+struct Sprite *get_indicator_sprite(struct tileset *t,
+                                   enum indicator_type indicator,
                                    int index)
 {
   index = CLIP(0, index, NUM_TILES_PROGRESS - 1);
Index: client/tilespec.h
===================================================================
RCS file: /home/freeciv/CVS/freeciv/client/tilespec.h,v
retrieving revision 1.134
diff -u -r1.134 tilespec.h
--- client/tilespec.h   19 Mar 2005 23:00:29 -0000      1.134
+++ client/tilespec.h   19 Mar 2005 23:39:18 -0000
@@ -174,20 +174,22 @@
 
 struct Sprite *get_spaceship_sprite(struct tileset *t,
                                    enum spaceship_part part);
-struct Sprite *get_citizen_sprite(struct citizen_type type,
+struct Sprite *get_citizen_sprite(struct tileset *t,
+                                 struct citizen_type type,
                                  int citizen_index,
                                  const struct city *pcity);
-struct Sprite *get_sample_city_sprite(int city_style);
-struct Sprite *get_arrow_sprite(void);
-struct Sprite *get_tax_sprite(Output_type_id otype);
-struct Sprite *get_treaty_thumb_sprite(bool on_off);
-struct sprite_vector *get_unit_explode_animation(void);
+struct Sprite *get_sample_city_sprite(struct tileset *t, int city_style);
+struct Sprite *get_arrow_sprite(struct tileset *t);
+struct Sprite *get_tax_sprite(struct tileset *t, Output_type_id otype);
+struct Sprite *get_treaty_thumb_sprite(struct tileset *t, bool on_off);
+struct sprite_vector *get_unit_explode_animation(struct tileset *t);
 struct Sprite *get_nuke_explode_sprite(struct tileset *t);
-struct Sprite *get_cursor_sprite(enum cursor_type cursor,
+struct Sprite *get_cursor_sprite(struct tileset *t, enum cursor_type cursor,
                                 int *hot_x, int *hot_y);
 struct Sprite *get_icon_sprite(struct tileset *t, enum icon_type icon);
-struct Sprite *get_attention_crosshair_sprite(void);
-struct Sprite *get_indicator_sprite(enum indicator_type indicator,
+struct Sprite *get_attention_crosshair_sprite(struct tileset *t);
+struct Sprite *get_indicator_sprite(struct tileset *t,
+                                   enum indicator_type indicator,
                                    int index);
 struct Sprite *get_unit_unhappy_sprite(struct tileset *t,
                                       const struct unit *punit);
Index: client/gui-gtk/citydlg.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/client/gui-gtk/citydlg.c,v
retrieving revision 1.197
diff -u -r1.197 citydlg.c
--- client/gui-gtk/citydlg.c    11 Mar 2005 17:11:26 -0000      1.197
+++ client/gui-gtk/citydlg.c    19 Mar 2005 23:39:19 -0000
@@ -1664,7 +1664,7 @@
 
   for (i = 0; i < pcity->size; i++) {
     gtk_pixcomm_copyto(GTK_PIXCOMM(pdialog->citizen_pixmap),
-                      get_citizen_sprite(citizens[i], i, pcity),
+                      get_citizen_sprite(tileset, citizens[i], i, pcity),
                       i * width, 0, TRUE);
   }
 
Index: client/gui-gtk/gui_main.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/client/gui-gtk/gui_main.c,v
retrieving revision 1.165
diff -u -r1.165 gui_main.c
--- client/gui-gtk/gui_main.c   18 Mar 2005 11:26:24 -0000      1.165
+++ client/gui-gtk/gui_main.c   19 Mar 2005 23:39:19 -0000
@@ -645,7 +645,7 @@
 
   /* citizens for taxrates */
   for (i = 0; i < 10; i++) {
-    struct Sprite *s = i < 5 ? get_tax_sprite(O_SCIENCE) : 
get_tax_sprite(O_GOLD);
+    struct Sprite *s = i < 5 ? get_tax_sprite(tileset, O_SCIENCE) : 
get_tax_sprite(tileset, O_GOLD);
 
     ebox = gtk_event_box_new();
     gtk_widget_set_events(ebox, GDK_BUTTON_PRESS_MASK);
@@ -674,7 +674,7 @@
     /* HACK: the UNHAPPY citizen is used for the government
      * when we don't know any better. */
     struct citizen_type c = {.type = CITIZEN_UNHAPPY};
-    struct Sprite *sprite = get_citizen_sprite(c, 0, NULL);
+    struct Sprite *sprite = get_citizen_sprite(tileset, c, 0, NULL);
 
     government_label = gtk_pixmap_new(sprite->pixmap, NULL);
   }
Index: client/gui-gtk/happiness.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/client/gui-gtk/happiness.c,v
retrieving revision 1.20
diff -u -r1.20 happiness.c
--- client/gui-gtk/happiness.c  22 Jan 2005 19:45:40 -0000      1.20
+++ client/gui-gtk/happiness.c  19 Mar 2005 23:39:19 -0000
@@ -171,7 +171,7 @@
   for (i = 0; i < num_citizens; i++) {
     canvas_put_sprite_full(&canvas,
                           i * offset, 0,
-                          get_citizen_sprite(citizens[i], i, pcity));
+                          get_citizen_sprite(tileset, citizens[i], i, pcity));
   }
 
   return happiness_pixmap;
Index: client/gui-gtk/mapview.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/client/gui-gtk/mapview.c,v
retrieving revision 1.240
diff -u -r1.240 mapview.c
--- client/gui-gtk/mapview.c    5 Mar 2005 23:43:58 -0000       1.240
+++ client/gui-gtk/mapview.c    19 Mar 2005 23:39:19 -0000
@@ -132,18 +132,18 @@
 
   d=0;
   for (; d < game.player_ptr->economic.luxury /10; d++) {
-    struct Sprite *sprite = sprite = get_tax_sprite(O_LUXURY);
+    struct Sprite *sprite = sprite = get_tax_sprite(tileset, O_LUXURY);
     gtk_pixmap_set(GTK_PIXMAP(econ_label[d]), sprite->pixmap, sprite->mask);
   }
  
   for (; d < (game.player_ptr->economic.science
             + game.player_ptr->economic.luxury) / 10; d++) {
-    struct Sprite *sprite = get_tax_sprite(O_SCIENCE);
+    struct Sprite *sprite = get_tax_sprite(tileset, O_SCIENCE);
     gtk_pixmap_set(GTK_PIXMAP(econ_label[d]), sprite->pixmap, sprite->mask);
   }
  
   for (; d < 10; d++) {
-    struct Sprite *sprite = get_tax_sprite(O_GOLD);
+    struct Sprite *sprite = get_tax_sprite(tileset, O_GOLD);
     gtk_pixmap_set(GTK_PIXMAP(econ_label[d]), sprite->pixmap, sprite->mask);
   }
  
@@ -781,7 +781,7 @@
   if (tile_to_canvas_pos(&canvas_x, &canvas_y, ptile)) {
     pixmap_put_overlay_tile(map_canvas->window,
                            canvas_x, canvas_y,
-                           get_attention_crosshair_sprite());
+                           get_attention_crosshair_sprite(tileset));
   }
 }
 
Index: client/gui-gtk-2.0/citydlg.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/client/gui-gtk-2.0/citydlg.c,v
retrieving revision 1.119
diff -u -r1.119 citydlg.c
--- client/gui-gtk-2.0/citydlg.c        16 Mar 2005 19:30:38 -0000      1.119
+++ client/gui-gtk-2.0/citydlg.c        19 Mar 2005 23:39:19 -0000
@@ -1393,7 +1393,7 @@
 
   for (i = 0; i < pcity->size; i++) {
     gtk_pixcomm_copyto(GTK_PIXCOMM(pdialog->citizen_pixmap),
-                      get_citizen_sprite(citizens[i], i, pcity),
+                      get_citizen_sprite(tileset, citizens[i], i, pcity),
                       i * width, 0);
   }
 
Index: client/gui-gtk-2.0/dialogs.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/client/gui-gtk-2.0/dialogs.c,v
retrieving revision 1.92
diff -u -r1.92 dialogs.c
--- client/gui-gtk-2.0/dialogs.c        28 Feb 2005 04:16:45 -0000      1.92
+++ client/gui-gtk-2.0/dialogs.c        19 Mar 2005 23:39:20 -0000
@@ -1762,7 +1762,7 @@
 
     gtk_list_store_append(store, &it);
 
-    s = crop_blankspace(get_sample_city_sprite(i));
+    s = crop_blankspace(get_sample_city_sprite(tileset, i));
     img = sprite_get_pixbuf(s);
     g_object_ref(img);
     free_sprite(s);
Index: client/gui-gtk-2.0/graphics.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/client/gui-gtk-2.0/graphics.c,v
retrieving revision 1.39
diff -u -r1.39 graphics.c
--- client/gui-gtk-2.0/graphics.c       14 Mar 2005 20:26:24 -0000      1.39
+++ client/gui-gtk-2.0/graphics.c       19 Mar 2005 23:39:20 -0000
@@ -188,7 +188,7 @@
 
   for (cursor = 0; cursor < CURSOR_LAST; cursor++) {
     int hot_x, hot_y;
-    struct Sprite *sprite = get_cursor_sprite(cursor, &hot_x, &hot_y);
+    struct Sprite *sprite = get_cursor_sprite(tileset, cursor, &hot_x, &hot_y);
     GdkPixbuf *pixbuf = sprite_get_pixbuf(sprite);
 
     fc_cursors[cursor] = gdk_cursor_new_from_pixbuf(display, pixbuf,
Index: client/gui-gtk-2.0/gui_main.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/client/gui-gtk-2.0/gui_main.c,v
retrieving revision 1.114
diff -u -r1.114 gui_main.c
--- client/gui-gtk-2.0/gui_main.c       18 Mar 2005 11:26:24 -0000      1.114
+++ client/gui-gtk-2.0/gui_main.c       19 Mar 2005 23:39:20 -0000
@@ -623,7 +623,7 @@
   }
 
   more_arrow_pixmap
-    = gtk_image_new_from_pixbuf(sprite_get_pixbuf(get_arrow_sprite()));
+    = gtk_image_new_from_pixbuf(sprite_get_pixbuf(get_arrow_sprite(tileset)));
   gtk_widget_ref(more_arrow_pixmap);
   gtk_table_attach_defaults(GTK_TABLE(table), more_arrow_pixmap, 4, 5, 1, 2);
 
@@ -826,7 +826,7 @@
     g_signal_connect(ebox, "button_press_event",
                      G_CALLBACK(taxrates_callback), GINT_TO_POINTER(i));
 
-    sprite = i < 5 ? get_tax_sprite(O_SCIENCE) : get_tax_sprite(O_GOLD);
+    sprite = i < 5 ? get_tax_sprite(tileset, O_SCIENCE) : 
get_tax_sprite(tileset, O_GOLD);
     econ_label[i] = gtk_image_new_from_pixbuf(sprite_get_pixbuf(sprite));
     gtk_container_add(GTK_CONTAINER(ebox), econ_label[i]);
   }
Index: client/gui-gtk-2.0/happiness.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/client/gui-gtk-2.0/happiness.c,v
retrieving revision 1.18
diff -u -r1.18 happiness.c
--- client/gui-gtk-2.0/happiness.c      3 Feb 2005 21:02:26 -0000       1.18
+++ client/gui-gtk-2.0/happiness.c      19 Mar 2005 23:39:20 -0000
@@ -169,7 +169,7 @@
   gtk_pixcomm_clear(dst);
 
   for (i = 0; i < num_citizens; i++) {
-    gtk_pixcomm_copyto(dst, get_citizen_sprite(citizens[i], i, pcity),
+    gtk_pixcomm_copyto(dst, get_citizen_sprite(tileset, citizens[i], i, pcity),
                       i * offset, 0);
   }
 
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.166
diff -u -r1.166 mapview.c
--- client/gui-gtk-2.0/mapview.c        16 Mar 2005 19:30:38 -0000      1.166
+++ client/gui-gtk-2.0/mapview.c        19 Mar 2005 23:39:20 -0000
@@ -123,7 +123,7 @@
 
   d=0;
   for (; d < game.player_ptr->economic.luxury /10; d++) {
-    struct Sprite *sprite = get_tax_sprite(O_LUXURY);
+    struct Sprite *sprite = get_tax_sprite(tileset, O_LUXURY);
 
     gtk_image_set_from_pixbuf(GTK_IMAGE(econ_label[d]),
                              sprite_get_pixbuf(sprite));
@@ -131,14 +131,14 @@
  
   for (; d < (game.player_ptr->economic.science
             + game.player_ptr->economic.luxury) / 10; d++) {
-    struct Sprite *sprite = get_tax_sprite(O_SCIENCE);
+    struct Sprite *sprite = get_tax_sprite(tileset, O_SCIENCE);
 
     gtk_image_set_from_pixbuf(GTK_IMAGE(econ_label[d]),
                              sprite_get_pixbuf(sprite));
   }
  
   for (; d < 10; d++) {
-    struct Sprite *sprite = get_tax_sprite(O_GOLD);
+    struct Sprite *sprite = get_tax_sprite(tileset, O_GOLD);
 
     gtk_image_set_from_pixbuf(GTK_IMAGE(econ_label[d]),
                              sprite_get_pixbuf(sprite));
@@ -215,7 +215,7 @@
 **************************************************************************/
 GdkPixbuf *get_thumb_pixbuf(int onoff)
 {
-  return sprite_get_pixbuf(get_treaty_thumb_sprite(BOOL_VAL(onoff)));
+  return sprite_get_pixbuf(get_treaty_thumb_sprite(tileset, BOOL_VAL(onoff)));
 }
 
 /****************************************************************************
@@ -922,7 +922,7 @@
   if (tile_to_canvas_pos(&canvas_x, &canvas_y, ptile)) {
     pixmap_put_overlay_tile(map_canvas->window,
                            canvas_x, canvas_y,
-                           get_attention_crosshair_sprite());
+                           get_attention_crosshair_sprite(tileset));
   }
 }
 
Index: client/gui-mui/citydlg.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/client/gui-mui/citydlg.c,v
retrieving revision 1.91
diff -u -r1.91 citydlg.c
--- client/gui-mui/citydlg.c    8 Feb 2005 22:14:17 -0000       1.91
+++ client/gui-mui/citydlg.c    19 Mar 2005 23:39:21 -0000
@@ -1869,7 +1869,7 @@
   get_city_citizen_types(pcity, 4, citizens);
 
   for (i = 0; i < pcity->size; i++) {
-    Object *o = MakeSprite(get_citizen_sprite(citizens[i], i, pcity));
+    Object *o = MakeSprite(get_citizen_sprite(tileset, citizens[i], i, pcity));
 
     if (o) {
       DoMethod(pdialog->citizen2_group, OM_ADDMEMBER, o);
@@ -2283,7 +2283,7 @@
     for (j = 0; j < num_citizens; j++) {
       Object *obj;
 
-      obj = MakeSprite(get_citizen_sprite(citizens[j], j, pcity));
+      obj = MakeSprite(get_citizen_sprite(tileset, citizens[j], j, pcity));
       if (obj) {
        DoMethod(pdialog->happiness_citizen_group[i], OM_ADDMEMBER, obj);
       }
Index: client/gui-mui/gui_main.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/client/gui-mui/gui_main.c,v
retrieving revision 1.92
diff -u -r1.92 gui_main.c
--- client/gui-mui/gui_main.c   5 Mar 2005 23:51:06 -0000       1.92
+++ client/gui-mui/gui_main.c   19 Mar 2005 23:39:21 -0000
@@ -1398,7 +1398,7 @@
        /* HACK: the UNHAPPY citizen is used for the government
         * when we don't know any better. */
        struct citizen_type c = {.type = CITIZEN_UNHAPPY};
-       struct Sprite *sprite = get_citizen_sprite(c, 0, NULL);
+       struct Sprite *sprite = get_citizen_sprite(tileset, c, 0, NULL);
 
        main_government_sprite = MakeBorderSprite(sprite);
       }
Index: client/gui-mui/mapview.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/client/gui-mui/mapview.c,v
retrieving revision 1.70
diff -u -r1.70 mapview.c
--- client/gui-mui/mapview.c    28 Feb 2005 04:16:45 -0000      1.70
+++ client/gui-mui/mapview.c    19 Mar 2005 23:39:21 -0000
@@ -203,13 +203,13 @@
 
   d = 0;
   for (; d < (game.player_ptr->economic.luxury) / 10; d++)
-    set(main_econ_sprite[d], MUIA_Sprite_Sprite, get_tax_sprite(O_LUXURY));
+    set(main_econ_sprite[d], MUIA_Sprite_Sprite, get_tax_sprite(tileset, 
O_LUXURY));
 
   for (; d < (game.player_ptr->economic.science + 
game.player_ptr->economic.luxury) / 10; d++)
-    set(main_econ_sprite[d], MUIA_Sprite_Sprite, get_tax_sprite(O_SCIENCE));
+    set(main_econ_sprite[d], MUIA_Sprite_Sprite, get_tax_sprite(tileset, 
O_SCIENCE));
 
   for (; d < 10; d++)
-    set(main_econ_sprite[d], MUIA_Sprite_Sprite, get_tax_sprite(O_GOLD));
+    set(main_econ_sprite[d], MUIA_Sprite_Sprite, get_tax_sprite(tileset, 
O_GOLD));
 
   update_timeout_label();
 }
@@ -337,7 +337,7 @@
      * when we don't know any better. */
     struct citizen_type c = {.type = CITIZEN_UNHAPPY};
 
-    gov_sprite = get_citizen_sprite(c, 0, NULL);
+    gov_sprite = get_citizen_sprite(tileset, c, 0, NULL);
   }
   else
   {
Index: client/gui-win32/citydlg.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/client/gui-win32/citydlg.c,v
retrieving revision 1.96
diff -u -r1.96 citydlg.c
--- client/gui-win32/citydlg.c  14 Feb 2005 02:39:48 -0000      1.96
+++ client/gui-win32/citydlg.c  19 Mar 2005 23:39:21 -0000
@@ -512,7 +512,7 @@
   get_city_citizen_types(pcity, 4, citizens);
 
   for (i = 0; i < pcity->size && i < NUM_CITIZENS_SHOWN; i++) {
-      draw_sprite(get_citizen_sprite(citizens[i], i, pcity), hdcsrc,
+      draw_sprite(get_citizen_sprite(tileset, citizens[i], i, pcity), hdcsrc,
                  SMALL_TILE_WIDTH * i, 0);
   }
 
Index: client/gui-win32/diplodlg.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/client/gui-win32/diplodlg.c,v
retrieving revision 1.25
diff -u -r1.25 diplodlg.c
--- client/gui-win32/diplodlg.c 19 Mar 2005 23:03:31 -0000      1.25
+++ client/gui-win32/diplodlg.c 19 Mar 2005 23:39:22 -0000
@@ -114,8 +114,8 @@
     ListBox_AddString(pdialog->list,buf);
   } clause_list_iterate_end;
   
-  pdialog->thumb0 = get_treaty_thumb_sprite(BOOL_VAL(pdialog->treaty.accept0));
-  pdialog->thumb1 = get_treaty_thumb_sprite(BOOL_VAL(pdialog->treaty.accept1));
+  pdialog->thumb0 = get_treaty_thumb_sprite(tileset, 
BOOL_VAL(pdialog->treaty.accept0));
+  pdialog->thumb1 = get_treaty_thumb_sprite(tileset, 
BOOL_VAL(pdialog->treaty.accept1));
   hdc=GetDC(pdialog->mainwin);
   draw_sprite(pdialog->thumb0,hdc,pdialog->thumb0_pos.x,pdialog->thumb0_pos.y);
   draw_sprite(pdialog->thumb1,hdc,pdialog->thumb1_pos.x,pdialog->thumb1_pos.y);
@@ -560,8 +560,8 @@
 *****************************************************************/
 static void thumb_minsize(POINT *minsize, void *data)
 {
-  minsize->x = get_treaty_thumb_sprite(FALSE)->width;
-  minsize->y = get_treaty_thumb_sprite(FALSE)->height;
+  minsize->x = get_treaty_thumb_sprite(tileset, FALSE)->width;
+  minsize->y = get_treaty_thumb_sprite(tileset, FALSE)->height;
 }
 
 /****************************************************************
@@ -642,8 +642,8 @@
   fcwin_box_add_static(hbox2,buf,0,SS_LEFT,FALSE,FALSE,5);
   fcwin_box_add_generic(hbox2,thumb_minsize,thumb_setsize,NULL,
                        &pdialog->thumb1_pos,FALSE,FALSE,5);
-  pdialog->thumb0 = get_treaty_thumb_sprite(FALSE);
-  pdialog->thumb1 = get_treaty_thumb_sprite(FALSE);
+  pdialog->thumb0 = get_treaty_thumb_sprite(tileset, FALSE);
+  pdialog->thumb1 = get_treaty_thumb_sprite(tileset, FALSE);
   fcwin_box_add_box(vbox,hbox2,FALSE,FALSE,5);
 
   fcwin_box_add_box(hbox,vbox,TRUE,TRUE,5);
Index: client/gui-win32/graphics.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/client/gui-win32/graphics.c,v
retrieving revision 1.27
diff -u -r1.27 graphics.c
--- client/gui-win32/graphics.c 11 Mar 2005 17:11:27 -0000      1.27
+++ client/gui-win32/graphics.c 19 Mar 2005 23:39:22 -0000
@@ -89,7 +89,7 @@
     int hot_x, hot_y;
     int x, y;
     int minwidth, minheight;
-    struct Sprite *sprite = get_cursor_sprite(cursor, &hot_x, &hot_y);
+    struct Sprite *sprite = get_cursor_sprite(tileset, cursor, &hot_x, &hot_y);
     unsigned char *src;
 
     for (x = 0; x < width * height / 8; x++) {
Index: client/gui-win32/happiness.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/client/gui-win32/happiness.c,v
retrieving revision 1.10
diff -u -r1.10 happiness.c
--- client/gui-win32/happiness.c        23 Jan 2005 23:11:31 -0000      1.10
+++ client/gui-win32/happiness.c        19 Mar 2005 23:39:22 -0000
@@ -309,7 +309,7 @@
   get_city_citizen_types(pcity, index, citizens);
 
   for (i = 0; i < num_citizens; i++) {
-    draw_sprite(get_citizen_sprite(citizens[i], i, pcity),
+    draw_sprite(get_citizen_sprite(tileset, citizens[i], i, pcity),
                hdc, i * offset, 0);
   }
 
Index: client/gui-win32/mapview.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/client/gui-win32/mapview.c,v
retrieving revision 1.148
diff -u -r1.148 mapview.c
--- client/gui-win32/mapview.c  19 Mar 2005 23:03:31 -0000      1.148
+++ client/gui-win32/mapview.c  19 Mar 2005 23:39:22 -0000
@@ -319,13 +319,13 @@
   int d;
   d=0;
   for(;d<(game.player_ptr->economic.luxury)/10;d++)
-    draw_sprite(get_tax_sprite(O_LUXURY), hdc,
+    draw_sprite(get_tax_sprite(tileset, O_LUXURY), hdc,
                SMALL_TILE_WIDTH*d,taxinfoline_y);/* elvis tile */
   
for(;d<(game.player_ptr->economic.science+game.player_ptr->economic.luxury)/10;d++)
-    draw_sprite(get_tax_sprite(O_SCIENCE), hdc,
+    draw_sprite(get_tax_sprite(tileset, O_SCIENCE), hdc,
                SMALL_TILE_WIDTH*d,taxinfoline_y); /* scientist tile */    
   for(;d<10;d++)
-    draw_sprite(get_tax_sprite(O_GOLD), hdc,
+    draw_sprite(get_tax_sprite(tileset, O_GOLD), hdc,
                SMALL_TILE_WIDTH*d,taxinfoline_y); /* taxman tile */  
 }
 
@@ -602,7 +602,7 @@
   tile_to_canvas_pos(&canvas_x, &canvas_y, ptile);
   if (tile_visible_mapcanvas(ptile)) {
     hdc=GetDC(map_window);
-    draw_sprite(get_attention_crosshair_sprite(), hdc, canvas_x, canvas_y);
+    draw_sprite(get_attention_crosshair_sprite(tileset), hdc, canvas_x, 
canvas_y);
     ReleaseDC(map_window,hdc);
   }
 }
Index: client/gui-xaw/citydlg.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/client/gui-xaw/citydlg.c,v
retrieving revision 1.134
diff -u -r1.134 citydlg.c
--- client/gui-xaw/citydlg.c    19 Mar 2005 23:17:59 -0000      1.134
+++ client/gui-xaw/citydlg.c    19 Mar 2005 23:39:22 -0000
@@ -1546,7 +1546,7 @@
   if (i >= pdialog->num_citizens_shown && i < pcity->size) {
     i = pdialog->num_citizens_shown - 1;
     /* FIXME: what about the mask? */
-    xaw_set_bitmap(pdialog->citizen_labels[i], get_arrow_sprite()->pixmap);
+    xaw_set_bitmap(pdialog->citizen_labels[i], 
get_arrow_sprite(tileset)->pixmap);
     XtSetSensitive(pdialog->citizen_labels[i], FALSE);
     XtRemoveAllCallbacks(pdialog->citizen_labels[i], XtNcallback);
     return;
Index: client/gui-xaw/graphics.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/client/gui-xaw/graphics.c,v
retrieving revision 1.59
diff -u -r1.59 graphics.c
--- client/gui-xaw/graphics.c   16 Mar 2005 05:28:41 -0000      1.59
+++ client/gui-xaw/graphics.c   19 Mar 2005 23:39:22 -0000
@@ -233,7 +233,7 @@
   XQueryColor(display, cmap, &black);
 
   for (cursor = 0; cursor < CURSOR_LAST; cursor++) {
-    sprite = get_cursor_sprite(cursor, &hot_x, &hot_y);
+    sprite = get_cursor_sprite(tileset, cursor, &hot_x, &hot_y);
 
     /* FIXME: this is entirely wrong.  It should be rewritten using
      * XcursorImageLoadCursor.  See gdkcursor-x11.c in the GTK sources for
Index: client/gui-xaw/gui_main.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/client/gui-xaw/gui_main.c,v
retrieving revision 1.109
diff -u -r1.109 gui_main.c
--- client/gui-xaw/gui_main.c   19 Mar 2005 23:17:59 -0000      1.109
+++ client/gui-xaw/gui_main.c   19 Mar 2005 23:39:22 -0000
@@ -449,7 +449,7 @@
 
   /* Do this outside setup_widgets() so after tiles are loaded */
   for(i=0;i<10;i++)  {
-    struct Sprite *s = i < 5 ? get_tax_sprite(O_SCIENCE) : 
get_tax_sprite(O_GOLD);
+    struct Sprite *s = i < 5 ? get_tax_sprite(tileset, O_SCIENCE) : 
get_tax_sprite(tileset, O_GOLD);
 
     XtVaSetValues(econ_label[i], XtNbitmap,
                  s->pixmap, NULL);
@@ -893,7 +893,7 @@
 
   if (onoff && !showing) {
     /* FIXME: what about the mask? */
-    xaw_set_bitmap(more_arrow_label, get_arrow_sprite()->pixmap);
+    xaw_set_bitmap(more_arrow_label, get_arrow_sprite(tileset)->pixmap);
     showing = TRUE;
   }
   else if(!onoff && showing) {
Index: client/gui-xaw/mapview.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/client/gui-xaw/mapview.c,v
retrieving revision 1.197
diff -u -r1.197 mapview.c
--- client/gui-xaw/mapview.c    19 Mar 2005 23:17:59 -0000      1.197
+++ client/gui-xaw/mapview.c    19 Mar 2005 23:39:23 -0000
@@ -176,13 +176,13 @@
 
   d=0;
   for(;d<(game.player_ptr->economic.luxury)/10;d++)
-    xaw_set_bitmap(econ_label[d], get_tax_sprite(O_LUXURY)->pixmap);
+    xaw_set_bitmap(econ_label[d], get_tax_sprite(tileset, O_LUXURY)->pixmap);
  
   
for(;d<(game.player_ptr->economic.science+game.player_ptr->economic.luxury)/10;d++)
-    xaw_set_bitmap(econ_label[d], get_tax_sprite(O_SCIENCE)->pixmap);
+    xaw_set_bitmap(econ_label[d], get_tax_sprite(tileset, O_SCIENCE)->pixmap);
  
    for(;d<10;d++)
-     xaw_set_bitmap(econ_label[d], get_tax_sprite(O_GOLD)->pixmap);
+     xaw_set_bitmap(econ_label[d], get_tax_sprite(tileset, O_GOLD)->pixmap);
  
   update_timeout_label();
 }
@@ -242,7 +242,7 @@
 Pixmap get_thumb_pixmap(int onoff)
 {
   /* FIXME: what about the mask? */
-  return get_treaty_thumb_sprite(BOOL_VAL(onoff))->pixmap;
+  return get_treaty_thumb_sprite(tileset, BOOL_VAL(onoff))->pixmap;
 }
 
 /**************************************************************************
@@ -251,7 +251,7 @@
 Pixmap get_citizen_pixmap(struct citizen_type type, int cnum,
                          struct city *pcity)
 {
-  return get_citizen_sprite(type, cnum, pcity)->pixmap;
+  return get_citizen_sprite(tileset, type, cnum, pcity)->pixmap;
 }
 
 
@@ -736,7 +736,7 @@
 
   if (tile_to_canvas_pos(&canvas_x, &canvas_y, ptile)) {
     pixmap_put_overlay_tile(XtWindow(map_canvas), canvas_x, canvas_y,
-                           get_attention_crosshair_sprite());
+                           get_attention_crosshair_sprite(tileset));
   }
 }
 

[Prev in Thread] Current Thread [Next in Thread]
  • [Freeciv-Dev] (PR#12553) add tileset parameter to tileset accessor functions, Jason Short <=