Complete.Org: Mailing Lists: Archives: freeciv-dev: January 2001:
[Freeciv-Dev] Re: Patch: cleanup -- client/gui-gtk/citydlg.c
Home

[Freeciv-Dev] Re: Patch: cleanup -- client/gui-gtk/citydlg.c

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: mike_jing@xxxxxxxxx, "Mike Jing" <miky40@xxxxxxxxxxx>, freeciv-dev@xxxxxxxxxxx
Subject: [Freeciv-Dev] Re: Patch: cleanup -- client/gui-gtk/citydlg.c
From: Thue <thue@xxxxxxx>
Date: Thu, 4 Jan 2001 22:20:43 +0100

On Thursday 04 January 2001 22:06, Mike Jing wrote:
> I am planning to add a happiness display to the city dialog, but first I
> decided to clean up the code a little bit before adding anything new.  I
> added missing function prototypes and made static all functions that are
> referenced only in this file.  I also raised NUM_CITIZENS_SHOWN to 35
> because 25 is certainly not big enough for the super city builders.
>
> Mike

Rather than raising the number of citizens show beside each other you should 
draw as many as you need overlapping (like in civ 2). That should be fairly 
simple to implement, just make one pixmap, and draw the number of heads you 
need with an offset from the left edge. In the gtk client something like:

int offset = MAX(one_citizen_sprite->width,
                        citizens_list_pixmap_width/num_citizens);
gdk_draw_pixmap(cityzens_list_pixmap, civ_gc, one_citizen_sprite->pixmap,
            0, 0,
            this_citizen_number * offset, 0,
            one_citizen_sprite->width, one_citizen_sprite->height );

Where this_citizen_number should run from 0.

-Thue



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