* ---
*
* path.c: Empire/A* Interface code.
- * Define AS_STATS for A* statistics.
*
* Known contributors to this file:
* Phil Lapsley, 1991
* Steve McClure, 1997
*/
+/*
+ * Define AS_STATS for A* statistics on stderr.
+ *
+ * Define AS_NO_PATH_CACHE to disable the path cache. The path cache
+ * saves a lot of work, but uses lots of memory. It should be a
+ * significant net win, unless you run out of memory.
+ */
+
#include <config.h>
#include <stdio.h>
if (!mybestpath)
mybestpath = bp_init();
adp = mybestpath->adp;
+#ifdef AS_NO_PATH_CACHE
+ ap = NULL;
+#else
ap = as_find_cachepath(from->sct_x, from->sct_y, to->sct_x, to->sct_y);
+#endif
if (ap == NULL) {
adp->from.x = from->sct_x;
adp->from.y = from->sct_y;
void
bp_enable_cachepath(void)
{
+#ifndef AS_NO_PATH_CACHE
as_enable_cachepath();
+#endif
}
void
bp_disable_cachepath(void)
{
+#ifndef AS_NO_PATH_CACHE
as_disable_cachepath();
+#endif
}
void
bp_clear_cachepath(void)
{
+#ifndef AS_NO_PATH_CACHE
as_clear_cachepath();
+#endif
}
double