Complete.Org: Mailing Lists: Archives: freeciv-dev: January 2004:
[Freeciv-Dev] (PR#7301) Unified and cached overview
Home

[Freeciv-Dev] (PR#7301) Unified and cached overview

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: i-freeciv-lists@xxxxxxxxxxxxx
Subject: [Freeciv-Dev] (PR#7301) Unified and cached overview
From: "Jason Short" <jdorje@xxxxxxxxxxxxxxxxxxxxx>
Date: Sun, 25 Jan 2004 14:30:46 -0800
Reply-to: rt@xxxxxxxxxxx

<URL: http://rt.freeciv.org/Ticket/Display.html?id=7301 >

> [jdorje - Sun Jan 25 15:30:15 2004]:
> 
> 
> > You are correct. *looking* It wasn't the case in the old code base
> > which I used for gui-fs (March 2003). I have updated my code version
> > to CVS HEAD some weeks ago. And it still worked and was still slow. So
> > it is/was a problem with too much freedom. I as a client implementor I
> > got the freedom to implement the overview drawing and I did the wrong
> > thing. So with the unification comes a the strict framework what the
> > client has to implement and all the public high-level interface
> > functions are implemented in mapview_common. There is now no way to
> > implement it wrong.
> 
> Now we get to the crux of the problem, however:
> 
> +struct overview {
> +  /* controlled by mapview_common.c */
> +  int map_x0, map_y0;
> +  int width, height;           /* Size in pixels. */
> +  struct canvas_store *store;
> +
> +  /* controlled by mapview.c */
> +  struct canvas_store *window;
> +};
> 
> I don't think you can implement the window in the same way you can do
> the backing store.  Although the backing store is just a fixed-size
> piece of canvas, the window may obey entirely different semantics.

I think the best way to do it is to have two backing stores:

- Low level backing store is done in native coordinates (the way the
current backing store is).
- High level backing store is done in overview coordinates (the way the
current window is).

Then at the appropriate times, we draw to the native backing store, copy
it to the overview backing store, and copy the overview backing store to
the window.

This will make overview_canvas_expose() much more efficient.  Currently
any time an expose event is triggered for the overview window the entire
overview is redrawn.  Ugly.

jason



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