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

[Freeciv-Dev] Re: single_tile_pixmap

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: Jason Short <jdorje@xxxxxxxxxxxxxxxxxxxxx>
Cc: freeciv-dev <freeciv-dev@xxxxxxxxxxx>
Subject: [Freeciv-Dev] Re: single_tile_pixmap
From: Raimar Falke <rf13@xxxxxxxxxxxxxxxxx>
Date: Thu, 19 Dec 2002 11:12:47 +0100

On Wed, Dec 18, 2002 at 04:41:36PM -0500, Jason Short wrote:
> 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.

I agree. Originally I meant this proposal of you:

   To accelerate the graphics here we should NOT redraw the unit
   pixmap each time, but should do what the SDL client does by
   assembling this sprite at the beginning of the animation.  If this
   is done with common-code support:

      struct Spite *create_unit_sprite(struct unit *punit);

   then we can provide this support natively, and unify this animation
   with the other animation functions (so we just animate a single
   sprite).  This could come in very handy if we ever try for more
   complex animations.

The common code creates a sprite and hands this sprite into
draw_unit_animation_frame. So draw_unit_animation_frame doesn't need
single_tile_pixmap anymore. It just draws the sprite into the screen.

However there are other users of single_tile_pixmap. I think that
independent of was/will be done at draw_unit_animation_frame we should
convert them to use your proposal 1 (make it a sprite).

        Raimar

-- 
 email: rf13@xxxxxxxxxxxxxxxxx
  This customer comes into the computer store. "I'm looking for a mystery
  Adventure Game with lots of graphics. You know, something realy
  challenging". "Well," replied the clerk, "have you tried Windows 98 ?"



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