Complete.Org: Mailing Lists: Archives: freeciv-dev: December 2002:
[Freeciv-Dev] single_tile_pixmap
Home

[Freeciv-Dev] single_tile_pixmap

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: freeciv-dev <freeciv-dev@xxxxxxxxxxx>
Subject: [Freeciv-Dev] single_tile_pixmap
From: Jason Short <jdorje@xxxxxxxxxxxxxxxxxxxxx>
Date: 18 Dec 2002 16:41:36 -0500

On Wed, 2002-12-18 at 14:07, Raimar Falke via RT wrote:
> On Wed, Dec 18, 2002 at 11:03:17AM -0800, Jason Short via RT wrote:
> > On Wed, 2002-12-18 at 05:01, Raimar Falke via RT wrote:
> > > On Tue, Dec 17, 2002 at 04:28:34PM -0800, Jason Short via RT wrote:
> > > > On Tue, 2002-12-17 at 14:19, Raimar Falke via RT wrote:
> > > > > On Tue, Dec 10, 2002 at 02:12:47AM -0800, Jason Short via RT wrote:
> > 
> > > > > The patch ok except one thing: what is the propose of
> > > > > single_tile_pixmap_width? Why was it added? Why do you use it?
> > > > 
> > > > single_tile_pixmap_width/single_tile_pixmap_height are currently used as
> > > > the width and height of the single_tile_pixmap pixmap (which is a
> > > > secondary backing store used only for animations).  But these are always
> > > > UNIT_TILE_WIDTH/UNIT_TILE_HEIGHT, so there's not much reason for their
> > > > existence.
> > > 
> > > So I replace their usage in the patch with
> > > UNIT_TILE_WIDTH/UNIT_TILE_HEIGHT.
> > 
> > This is confusing!  They should either be used consistently or removed.
> 
> Removed. Done with the patch (common code builds sprite of the unit)
> you outline in the previous mail

But they are used elsewhere.  If you're going to hard-code the values
here, to be consistent it needs to be done everywhere.

I'm a bit torn on this.  I see two possiblities (in gui_main.h):

- extern GdkPixmap *      single_tile_pixmap;
- extern int              single_tile_pixmap_width;
- extern int              single_tile_pixmap_height;
+ extern struct Sprite    single_tile_sprite;

...and use the sprite width/height information when drawing.

Or

  extern GdkPixmap *      single_tile_pixmap;
- extern int              single_tile_pixmap_width;
- extern int              single_tile_pixmap_height;

and hard-code the values of the width and height.

I would lean toward the latter solution (which is what you seem to be
pushing for...).

But I emphasize, the code should NOT be left in its current inconsistent
state.

jason



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