[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]
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
|
|