Complete.Org: Mailing Lists: Archives: freeciv-dev: October 2001:
[Freeciv-Dev] Re: zoom
Home

[Freeciv-Dev] Re: zoom

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: freeciv-dev <freeciv-dev@xxxxxxxxxxx>
Subject: [Freeciv-Dev] Re: zoom
From: Jason Dorje Short <vze2zq63@xxxxxxxxxxx>
Date: Mon, 29 Oct 2001 14:13:12 -0500
Reply-to: jdorje@xxxxxxxxxxxx

Karl-Ingo Friese wrote:
> 
> On Mon, 29 Oct 2001, Raimar Falke wrote:
> 
> > On Mon, Oct 29, 2001 at 12:31:37PM +0100, Karl-Ingo Friese wrote:
> > > Hello there,
> > >
> > > as some of you might already know, I added a zoom feature
> > > to teamciv. Now I think about adapting that patch to CVS.
> > > However, before I do, I'd like to discuss a few things:
> > >
> > > a) zooming takes both: memory and CPU time. CPU time at
> > >    initializing, memory afterward. It might be better
> > >    to add this as an optionial feature for slower machines.
> > >    Any suggestions how this should be done ?
> >
> > Make it a command line switch? How fast/slow it is really?
> 
> The initiaizing takes about 10-20 seconds on an Athlon 800,
> depending on how many zoom levels you want (currently hard-
> coded).
> 
> After that, the zoom itself is smooth.
> 
> Download teamciv and try for yourself ;)

I must say, that is pretty sweet.

A couple ideas:

- You should be able to zoom in as well as zoom out from the original
size.

- When zooming, it would be nice for the zoom to occur around the center
of the screen rather than keeping the same map_view_x0, map_view_y0. 
That is, at the start of do_scale you should have:

  center_x = map_view_x0 + map_canvas_store_twidth/2;
  center_y = map_view_y0 + map_canvas_store_theight/2;
  /* then the rest of do_scale */
  map_view_x0 = center_x - map_canvas_store_twidth/2;
  map_view_y0 = center_x - map_canvas_store_theight/2;
  /* then refresh the mapcanvas */

Unfortunately, this doesn't appear to work particularly well - since the
overview is always aligned to the nearest tile, zooming around a tile
other than map_view_x0, map_view_y0 gives very ugly results.  Oh well.

- Scaling the pixmaps when you first try to zoom is questionable.  At
first I thought I was pressing the wrong button.  Other options would be
(1) scaling during startup (2) spawning a separate thread on startup to
do the scaling (GTK can use threads, I'm told).  OTOH, if you never use
zoom then this would just waste your time.  (It takes over 10 seconds to
scale on my machine, a intel P3/450.)  Alternately, some sort of popup
dialog window ("Scaling Pixmaps...") would be nice here.

jason


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