Complete.Org: Mailing Lists: Archives: freeciv-dev: December 2002:
[Freeciv-Dev] Re: (PR#2490) unification of get_citizen_sprite
Home

[Freeciv-Dev] Re: (PR#2490) unification of get_citizen_sprite

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: undisclosed-recipients:;
Subject: [Freeciv-Dev] Re: (PR#2490) unification of get_citizen_sprite
From: "Jason Short via RT" <rt@xxxxxxxxxxxxxx>
Date: Fri, 6 Dec 2002 00:50:53 -0800
Reply-to: rt@xxxxxxxxxxxxxx

On Thu, 2002-12-05 at 06:48, Raimar Falke via RT wrote:
> On Wed, Dec 04, 2002 at 11:41:04PM -0800, Jason Short via RT wrote:

> > This function should IMO go into graphics_common, not mapview_common. 
> > Are there any objections to this?
> 
> What about tilespec.c?

Here's a version that puts it into tilespec.c.  This makes little
difference to me - not that it doesn't matter, but that the code modules
are so blurred at this point that the distinction is small.

jason


Index: client//tilespec.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/client/tilespec.c,v
retrieving revision 1.91
diff -u -r1.91 tilespec.c
--- client//tilespec.c  2002/11/21 02:26:48     1.91
+++ client//tilespec.c  2002/12/06 07:53:22
@@ -2042,3 +2042,12 @@
   hash_free(sprite_hash);
   sprite_hash = NULL;
 }
+
+/**************************************************************************
+  Return a sprite for the given citizen.
+**************************************************************************/
+struct Sprite *get_citizen_sprite(int citizen)
+{
+  citizen = CLIP(0, citizen, NUM_TILES_CITIZEN - 1);
+  return sprites.citizen[citizen];
+}
Index: client//tilespec.h
===================================================================
RCS file: /home/freeciv/CVS/freeciv/client/tilespec.h,v
retrieving revision 1.32
diff -u -r1.32 tilespec.h
--- client//tilespec.h  2002/11/19 23:04:28     1.32
+++ client//tilespec.h  2002/12/06 07:53:22
@@ -192,6 +192,8 @@
 
 extern struct named_sprites sprites;
 
+struct Sprite *get_citizen_sprite(int citizen);
+
 extern char current_tile_set_name[512];
 
 /* full pathnames: */
Index: client//gui-gtk/mapview.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/client/gui-gtk/mapview.c,v
retrieving revision 1.140
diff -u -r1.140 mapview.c
--- client//gui-gtk/mapview.c   2002/11/30 20:04:19     1.140
+++ client//gui-gtk/mapview.c   2002/12/06 07:53:22
@@ -451,17 +451,6 @@
   return sprites.citizen[frame]->pixmap;
 }
 
-
-/**************************************************************************
-...
-**************************************************************************/
-SPRITE *get_citizen_sprite(int frame)
-{
-  frame = CLIP(0, frame, NUM_TILES_CITIZEN-1);
-  return sprites.citizen[frame];
-}
-
-
 /**************************************************************************
 ...
 **************************************************************************/
Index: client//gui-gtk/mapview.h
===================================================================
RCS file: /home/freeciv/CVS/freeciv/client/gui-gtk/mapview.h,v
retrieving revision 1.13
diff -u -r1.13 mapview.h
--- client//gui-gtk/mapview.h   2002/11/15 09:24:51     1.13
+++ client//gui-gtk/mapview.h   2002/12/06 07:53:22
@@ -27,7 +27,6 @@
 
 GdkPixmap *get_thumb_pixmap(int onoff);
 GdkPixmap *get_citizen_pixmap(int frame);
-SPRITE *get_citizen_sprite(int frame);
 
 gint overview_canvas_expose(GtkWidget *w, GdkEventExpose *ev);
 gint map_canvas_expose(GtkWidget *w, GdkEventExpose *ev);
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.28
diff -u -r1.28 mapview.c
--- client//gui-gtk-2.0/mapview.c       2002/11/30 20:06:49     1.28
+++ client//gui-gtk-2.0/mapview.c       2002/12/06 07:53:23
@@ -450,17 +450,6 @@
   return sprites.citizen[frame]->pixmap;
 }
 
-
-/**************************************************************************
-...
-**************************************************************************/
-SPRITE *get_citizen_sprite(int frame)
-{
-  frame = CLIP(0, frame, NUM_TILES_CITIZEN-1);
-  return sprites.citizen[frame];
-}
-
-
 /**************************************************************************
 ...
 **************************************************************************/
Index: client//gui-gtk-2.0/mapview.h
===================================================================
RCS file: /home/freeciv/CVS/freeciv/client/gui-gtk-2.0/mapview.h,v
retrieving revision 1.4
diff -u -r1.4 mapview.h
--- client//gui-gtk-2.0/mapview.h       2002/11/15 09:24:52     1.4
+++ client//gui-gtk-2.0/mapview.h       2002/12/06 07:53:23
@@ -27,7 +27,6 @@
 
 GdkPixmap *get_thumb_pixmap(int onoff);
 GdkPixmap *get_citizen_pixmap(int frame);
-SPRITE *get_citizen_sprite(int frame);
 
 gboolean overview_canvas_expose(GtkWidget *w, GdkEventExpose *ev, gpointer 
data);
 gboolean map_canvas_expose(GtkWidget *w, GdkEventExpose *ev, gpointer data);
Index: client//gui-mui/graphics.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/client/gui-mui/graphics.c,v
retrieving revision 1.27
diff -u -r1.27 graphics.c
--- client//gui-mui/graphics.c  2002/11/14 09:14:56     1.27
+++ client//gui-mui/graphics.c  2002/12/06 07:53:23
@@ -389,14 +389,6 @@
 }
 
 /****************************************************************
- Returns a cititen sprite
-*****************************************************************/
-struct Sprite *get_citizen_sprite(int frame)
-{
-  return sprites.citizen[CLIP(0, frame, NUM_TILES_CITIZEN - 1)];
-}
-
-/****************************************************************
  Returns a thumb sprite
 *****************************************************************/
 struct Sprite *get_thumb_sprite(int onoff)
Index: client//gui-mui/graphics.h
===================================================================
RCS file: /home/freeciv/CVS/freeciv/client/gui-mui/graphics.h,v
retrieving revision 1.8
diff -u -r1.8 graphics.h
--- client//gui-mui/graphics.h  2002/11/26 12:01:11     1.8
+++ client//gui-mui/graphics.h  2002/12/06 07:53:23
@@ -58,7 +58,6 @@
 extern void put_city_output_tile(struct RastPort *rp,
        int food, int shield, int trade, int offx, int offy, int x_tile, int 
y_tile);
 
-extern struct Sprite *get_citizen_sprite(int frame);
 extern struct Sprite *get_thumb_sprite(int onoff);
 
 extern int load_all_sprites(void);
Index: client//gui-win32/graphics.h
===================================================================
RCS file: /home/freeciv/CVS/freeciv/client/gui-win32/graphics.h,v
retrieving revision 1.4
diff -u -r1.4 graphics.h
--- client//gui-win32/graphics.h        2002/04/02 19:27:56     1.4
+++ client//gui-win32/graphics.h        2002/12/06 07:53:23
@@ -47,7 +47,6 @@
 void draw_fog_part(HDC hdc,int x, int y,int w, int h,
                   int xsrc, int ysrc);
 
-SPRITE *get_citizen_sprite(int frame);
 extern HBITMAP BITMAP2HBITMAP(BITMAP *bmp);
 extern SPRITE *intro_gfx_sprite;
 extern SPRITE *radar_gfx_sprite;
Index: client//gui-win32/mapview.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/client/gui-win32/mapview.c,v
retrieving revision 1.41
diff -u -r1.41 mapview.c
--- client//gui-win32/mapview.c 2002/11/29 10:01:58     1.41
+++ client//gui-win32/mapview.c 2002/12/06 07:53:23
@@ -425,15 +425,6 @@
 /**************************************************************************
 
 **************************************************************************/
-SPRITE *get_citizen_sprite(int frame)
-{
-  frame = CLIP(0, frame, NUM_TILES_CITIZEN-1);
-  return sprites.citizen[frame];
-}           
-
-/**************************************************************************
-
-**************************************************************************/
 static void draw_rates(HDC hdc)
 {
   int d;

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