Complete.Org: Mailing Lists: Archives: freeciv-dev: March 2005:
[Freeciv-Dev] (PR#12428) encapsulate the sprites.user.attention value
Home

[Freeciv-Dev] (PR#12428) encapsulate the sprites.user.attention value

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
Subject: [Freeciv-Dev] (PR#12428) encapsulate the sprites.user.attention value
From: "Jason Short" <jdorje@xxxxxxxxxxxxxxxxxxxxx>
Date: Thu, 3 Mar 2005 15:35:05 -0800
Reply-to: bugs@xxxxxxxxxxx

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

This patch adds an accessor function for it.  In the long run this 
shouldn't be needed because these graphics should be drawn by 
fill_sprite_array.  But this won't happen soon I think.

-jason

Index: client/tilespec.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/client/tilespec.c,v
retrieving revision 1.255
diff -u -r1.255 tilespec.c
--- client/tilespec.c   3 Mar 2005 17:18:28 -0000       1.255
+++ client/tilespec.c   3 Mar 2005 23:23:27 -0000
@@ -3747,6 +3747,17 @@
   return sprites.cursor[cursor].icon;
 }
 
+/****************************************************************************
+  Returns a sprite with the "user-attention" crosshair graphic.
+
+  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)
+{
+  return sprites.user.attention;
+}
+
 /**************************************************************************
   Loads the sprite. If the sprite is already loaded a reference
   counter is increased. Can return NULL if the sprite couldn't be
Index: client/tilespec.h
===================================================================
RCS file: /home/freeciv/CVS/freeciv/client/tilespec.h,v
retrieving revision 1.118
diff -u -r1.118 tilespec.h
--- client/tilespec.h   3 Mar 2005 17:18:29 -0000       1.118
+++ client/tilespec.h   3 Mar 2005 23:23:27 -0000
@@ -375,6 +375,7 @@
 struct sprite_vector *get_unit_explode_animation(void);
 struct Sprite *get_cursor_sprite(enum cursor_type cursor,
                                 int *hot_x, int *hot_y);
+struct Sprite *get_attention_crosshair_sprite(void);
 
 /* These variables contain the size of the tiles used within the game.
  *
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.162
diff -u -r1.162 mapview.c
--- client/gui-gtk-2.0/mapview.c        3 Mar 2005 03:47:31 -0000       1.162
+++ client/gui-gtk-2.0/mapview.c        3 Mar 2005 23:23:27 -0000
@@ -976,7 +976,7 @@
   if (tile_to_canvas_pos(&canvas_x, &canvas_y, ptile)) {
     pixmap_put_overlay_tile(map_canvas->window,
                            canvas_x, canvas_y,
-                           sprites.user.attention);
+                           get_attention_crosshair_sprite());
   }
 }
 

[Prev in Thread] Current Thread [Next in Thread]
  • [Freeciv-Dev] (PR#12428) encapsulate the sprites.user.attention value, Jason Short <=