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: <rf13@xxxxxxxxxxxxxxxxxxxxxx>
Cc: <freeciv-dev@xxxxxxxxxxx>
Subject: [Freeciv-Dev] Re: new player dialog
From: Karl-Ingo Friese <kif@xxxxxxxxxxxxxxxxxxxxxxxxxx>
Date: Thu, 23 Aug 2001 10:58:44 +0200 (CEST)

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.

> > +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.

> Another point: the dialog is more than 1024 pixel wide. And I can't
> decrease the width.

??

> Overall it looks good.
>
>       Raimar

ThX.
Ingo

-- 

Karl-Ingo Friese
kif@xxxxxxxxxxxxxxxxxxxxxxxxxx



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