Complete.Org: Mailing Lists: Archives: freeciv-dev: December 2001:
[Freeciv-Dev] Re: Changing interface for generate_warmap (PR#1108)
Home

[Freeciv-Dev] Re: Changing interface for generate_warmap (PR#1108)

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: Gregory Berkolaiko <gberkolaiko@xxxxxxxxxxx>
Cc: freeciv-dev@xxxxxxxxxxx, bugs@xxxxxxxxxxxxxxxxxxx
Subject: [Freeciv-Dev] Re: Changing interface for generate_warmap (PR#1108)
From: Raimar Falke <hawk@xxxxxxxxxxxxxxxxxxxxxxx>
Date: Thu, 13 Dec 2001 18:20:27 +0100
Reply-to: rf13@xxxxxxxxxxxxxxxxxxxxxx

On Thu, Dec 13, 2001 at 04:47:17PM +0000, Gregory Berkolaiko wrote:
>  --- Raimar Falke <hawk@xxxxxxxxxxxxxxxxxxxxxxx> wrote: 
> > On Sun, Dec 09, 2001 at 03:28:17AM -0800, Gregory Berkolaiko wrote:
> > 
> > [ the attachment is broken ]
> 
> doesn't unzip or doesn't apply?
> 
> in any case, try the attached patch, it's against today's CVS.

Same problem. From the mailbox:
\begin{quote}
Do You Yahoo!?
Everything you'll ever need on one web page
from News and Sport to Email and Music Charts
http://uk.my.yahoo.com
--0-1479486197-1008262037=:7158
Content-Type: text/plain; name="local_warmap131201.diff.gz"
Content-Description: local_warmap131201.diff.gz
Content-Disposition: inline; filename="local_warmap131201.diff.gz"

^_<8$<8C>^X<
--0-1479486197-1008262037=:7158--
\end{quote}

The other one however is ok.

> > > This is a patch which changes interface of generate_warmap to:
> > > 1. Remove direct calls to really_generate_warmap
> > 
> > > 2. Provide the possibility of having a local warmap
> > 
> > Very nice.
> > 
> > > 3. Make recycling of the old warmap more transparent (I hope)
> > 
> > I have to see the code for this.
> 
> Half of the patch is just changing the direct access to the warmap.
> The relevant parts are in gotohand.c
> 
> Preemptive request: could you have a look at the general interface before
> asking me to split the patch?  I know I should have done it in two parts,
> but it's such a raw patch, I don't want to do unnecessary work now :)

From the first email:

> Functions like find_the_shortest_paths use local warmap by default
> (which renders it unrecyclable).

I don't see this.

Nobody needs to know the internals of struct move_cost_map. You can
move this from gotohand.h to gotohand.c.

About the interface:

+void generate_warmap(struct move_cost_map *wm, int x, int y,
+                    struct unit *punit);
+int get_warmap_land(struct move_cost_map *wm, int x, int y);
+int get_warmap_sea(struct move_cost_map *wm, int x, int y);

What do you think about:

  struct move_cost_map *generate_warmap(int x, int y, struct unit
                                        *punit, int use_global_warmap);

This way the access calls doesn't need to be changed if you use a
local warmap.

        Raimar

-- 
 email: rf13@xxxxxxxxxxxxxxxxx
 Q:  Do you know what the death rate around here is?
 A:  One per person.


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