Complete.Org: Mailing Lists: Archives: freeciv-dev: August 2001:
[Freeciv-Dev] Re: new player dialog
Home

[Freeciv-Dev] Re: new player dialog

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: Karl-Ingo Friese <kif@xxxxxxxxxxxxxxxxxxxxxxxxxx>
Cc: freeciv-dev@xxxxxxxxxxx
Subject: [Freeciv-Dev] Re: new player dialog
From: Raimar Falke <hawk@xxxxxxxxxxxxxxxxxxxxxxx>
Date: Thu, 23 Aug 2001 12:20:14 +0200
Reply-to: rf13@xxxxxxxxxxxxxxxxxxxxxx

On Thu, Aug 23, 2001 at 10:58:44AM +0200, Karl-Ingo Friese wrote:
> On Thu, 23 Aug 2001, Raimar Falke wrote:
> 
> > On Wed, Aug 22, 2001 at 09:19:30PM +0200, Karl-Ingo Friese wrote:
> >
> > > -#define NUM_COLOUMS 9
> > > +#define NUM_COLUMS 11
> >
> > ??
> 
> Two new columns: one for the flag, one for the ai status, allowing
> it to sort by ai and name independently.

NUM_COLOUMS is not used anymore. Can you please delete it?

> > > +void build_flag(int playerindex) {
> >
> > Lets try to understand this:
> >  - you remove the black border
> >  - scale it
> >  - add the border?
> > Correct?
> 
> Almost ;) Unfortunately the flags are stored in a bigger pixmap then
> the flag dimension itself. So what I am doing is using the knowledge
> about Vascos scaling function to perform a combined crop+scale. To
> visualize this:
> 
>     XXXXXXXX.....             XXXXXXXX         XXXX
>     XXXXXXXX.....             XXXXXXXX         XXXX
>     XXXXXXXX.....        -->  XXXXXXXX    -->
>     XXXXXXXx.....             XXXXXXXX
>     .............
> 
>         (1)                      (2)            (3)
> 
> (1) is the orignal flag pixmap. It contains unused pixels which are
> masked out when its drawn on the main map. The task is to a) crop
> this unused pixeles (2) and b) scale the croped image (3).
> 
> > > +  while (gdk_image_get_pixel(mask_image, flag_w-1, 0)==0 && flag_w>4) 
> > > flag_w--;
> > > +  if (flag_w<5) flag_w=flag_sprite->width;
> > What is the reason for these constructs?
> Parsing the mask of the flag immage to find out the dimensions of the
> "real" flag. Remember: Flags can have different dimensions! If however
> a flag image is empty or the mask set wrong, I dont crop at all. Looks
> ugly, but better then crashing.

What about an assertion? Can't we just check if all flags are valid?

        Raimar
        
-- 
 email: rf13@xxxxxxxxxxxxxxxxx
  "With a PC, I always felt limited by the software available.
   On Unix, I am limited by my knowledge."
    -- Peter J. Schoenster <pschon@xxxxxxxxxxxxxxxxx>


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