Complete.Org: Mailing Lists: Archives: freeciv-dev: July 1999:
Re: [Freeciv-Dev] patch: makes city dialog units scrollable (PR#79)
Home

Re: [Freeciv-Dev] patch: makes city dialog units scrollable (PR#79)

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: vasc@xxxxxxxxxxxxxxxxxxxxx
Cc: freeciv-dev@xxxxxxxxxxx, bugs@xxxxxxxxxxxxxxxxxxx
Subject: Re: [Freeciv-Dev] patch: makes city dialog units scrollable (PR#79)
From: "P.E.Jean" <pejean.lists@xxxxxxxxx>
Date: Fri, 30 Jul 1999 11:04:14 -0400

vasc@xxxxxxxxxxxxxxxxxxxxx wrote:
> 
> On Thu, 29 Jul 1999, P.E.Jean wrote:
> 
> > pejean.lists@xxxxxxxxx wrote:
> > > Currently, in the city dialog, only 12 supported units
> > > and 12 present units can be shown.
> > >
> > > This patch allows the player to see more of them and
> > > adds a scroll bar under the supported units list and/or
> > > the present units list when there isn't enough place to
> > > show them all.
> 
> Sorry to pester you again, but the patch you added creates 2*50 unit
> pixmap widgets and adds a scrollable widget to them.  What if the city has
> more than 50 units inside?  (Not likely but...)  Besides it wastes a lot
> of mem because pixmaps are very memory hungry.  I suggest you add instead
> something like this:

The current way of doing it declares 2*12 pointers for the pixmap
widgets. It
then creates 2*12 event boxes and pixmaps to later hold the units
pixmaps.

What my patch does is declare 2*50 pointers for the pixmap widgets, but
it
doesn't allocate any event box or pixmap until they are neded and
destroys
them when they aren't neded any more.

I don't think that it uses more memory, except when there is more then
20
units in the city. But then is it better to use some more memory and
being
able to see all units (up to 50 supported and 50 present) or keep it
like it
is now?

> You keep the old number of pixmaps and your scrollbar and lose the viewport
> widget. Whenever you want to know which unit pixmaps to draw, check the
> position of the scrollbar widget to see which is the first unit to draw,
> and draw the rest of the units from that onwards.
> 
> If you really feel like it add a capture event for resize events and
> change the maximum number of unit pixmap widget accordingly.
> 
> I know this is a lot more trouble than the patch you added, but it saves
> mem and for seasoned players the click & point fury of hitting moving unit
> pixmaps can be frustrating.

That may be a better approach but like you said it would be lot more
trouble.

  Pierre.

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