[Freeciv-Dev] Re: new player dialog
[Top] [All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
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>
- [Freeciv-Dev] new player dialog, Karl-Ingo Friese, 2001/08/22
- [Freeciv-Dev] Re: new player dialog, Raimar Falke, 2001/08/23
- [Freeciv-Dev] Re: new player dialog, Karl-Ingo Friese, 2001/08/23
- [Freeciv-Dev] Re: new player dialog,
Raimar Falke <=
- [Freeciv-Dev] Re: new player dialog, Karl-Ingo Friese, 2001/08/23
- [Freeciv-Dev] Re: new player dialog, Raimar Falke, 2001/08/23
- [Freeciv-Dev] Re: new player dialog, Karl-Ingo Friese, 2001/08/23
- [Freeciv-Dev] Re: new player dialog, Raimar Falke, 2001/08/23
[Freeciv-Dev] can you send me a screenshot ?, Karl-Ingo Friese, 2001/08/23
[Freeciv-Dev] Re: new player dialog, Christian Knoke, 2001/08/23
|
|