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

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

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: freeciv-dev@xxxxxxxxxxx
Cc: bugs@xxxxxxxxxxxxxxxxxxx
Subject: [Freeciv-Dev] Changing interface for generate_warmap (PR#1108)
From: Gregory Berkolaiko <gberkolaiko@xxxxxxxxxxx>
Date: Sun, 9 Dec 2001 03:28:17 -0800 (PST)

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
3. Make recycling of the old warmap more transparent (I hope)

There is no rush with inclusion into CVS, but I would be grateful if you
comment on the implementation and on what else should be done.

Brief description:

To generate warmap now one has to pass the pointer to it.  If the pointer
is NULL, the static warmap local to gotohand.c is used.
Access and creator/destructor functions for warmaps are also provided.

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

The old recycling rules are left in place.

Tested: the savegames are identical.

It is now possible to have warmap-per-city in the AI.  Even if all 
warmaps are refreshed every turn (unnecessary, but happens now), it will
still save some time (but not memory).

G.

________________________________________________________________
Nokia 5510 looks weird sounds great. 
Go to http://uk.promotions.yahoo.com/nokia/ discover and win it! 
The competition ends 16 th of December 2001.
?D8<

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