summaryrefslogtreecommitdiff
path: root/src/map/path.cpp
diff options
context:
space:
mode:
authorBen Longbons <b.r.longbons@gmail.com>2012-12-20 21:14:24 -0800
committerBen Longbons <b.r.longbons@gmail.com>2012-12-24 10:02:20 -0800
commitace159199161f555d6e13d05ccc374166ff375b6 (patch)
treed4cafca9f2733f99cc81d9f63b9f1f9172152023 /src/map/path.cpp
parent2b092c150e1226decc48160316070fc44d5fbba0 (diff)
downloadtmwa-ace159199161f555d6e13d05ccc374166ff375b6.tar.gz
tmwa-ace159199161f555d6e13d05ccc374166ff375b6.tar.bz2
tmwa-ace159199161f555d6e13d05ccc374166ff375b6.tar.xz
tmwa-ace159199161f555d6e13d05ccc374166ff375b6.zip
Purge some unused functions
Diffstat (limited to 'src/map/path.cpp')
-rw-r--r--src/map/path.cpp60
1 files changed, 6 insertions, 54 deletions
diff --git a/src/map/path.cpp b/src/map/path.cpp
index fb5eedf..afdae03 100644
--- a/src/map/path.cpp
+++ b/src/map/path.cpp
@@ -112,7 +112,7 @@ int calc_cost(struct tmp_path *p, int x1, int y1)
{
int xd, yd;
- nullpo_retr(0, p);
+ nullpo_ret(p);
xd = x1 - p->x;
if (xd < 0)
@@ -133,8 +133,8 @@ int add_path(int *heap, struct tmp_path *tp, int x, int y, int dist,
{
int i;
- nullpo_retr(0, heap);
- nullpo_retr(0, tp);
+ nullpo_ret(heap);
+ nullpo_ret(tp);
i = calc_index(x, y);
@@ -180,7 +180,7 @@ int can_place(struct map_data *m, int x, int y, int flag)
{
int c;
- nullpo_retr(0, m);
+ nullpo_ret(m);
c = read_gatp(m, x, y);
@@ -199,7 +199,7 @@ static
int can_move(struct map_data *m, int x0, int y0, int x1, int y1,
int flag)
{
- nullpo_retr(0, m);
+ nullpo_ret(m);
if (x0 - x1 < -1 || x0 - x1 > 1 || y0 - y1 < -1 || y0 - y1 > 1)
return 0;
@@ -280,7 +280,7 @@ int path_search(struct walkpath_data *wpd, int m, int x0, int y0, int x1,
struct map_data *md;
int dx, dy;
- nullpo_retr(0, wpd);
+ nullpo_ret(wpd);
if (!map[m].gat)
return -1;
@@ -397,51 +397,3 @@ int path_search(struct walkpath_data *wpd, int m, int x0, int y0, int x1,
}
return -1;
}
-
-#ifdef PATH_STANDALONETEST
-char gat[64][64] = {
- {0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
- {0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
- {0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
- {0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
- {0, 0, 0, 0, 1, 0, 0, 0, 0, 0},
-};
-
-struct map_data map[1];
-
-/*==========================================
- * 経路探索ルーチン単体テスト用main関数
- *------------------------------------------
- */
-void main(int argc, char *argv[])
-{
- struct walkpath_data wpd;
-
- map[0].gat = gat;
- map[0].xs = 64;
- map[0].ys = 64;
-
- path_search(&wpd, 0, 3, 4, 5, 4);
- path_search(&wpd, 0, 5, 4, 3, 4);
- path_search(&wpd, 0, 6, 4, 3, 4);
- path_search(&wpd, 0, 7, 4, 3, 4);
- path_search(&wpd, 0, 4, 3, 4, 5);
- path_search(&wpd, 0, 4, 2, 4, 5);
- path_search(&wpd, 0, 4, 1, 4, 5);
- path_search(&wpd, 0, 4, 5, 4, 3);
- path_search(&wpd, 0, 4, 6, 4, 3);
- path_search(&wpd, 0, 4, 7, 4, 3);
- path_search(&wpd, 0, 7, 4, 3, 4);
- path_search(&wpd, 0, 8, 4, 3, 4);
- path_search(&wpd, 0, 9, 4, 3, 4);
- path_search(&wpd, 0, 10, 4, 3, 4);
- path_search(&wpd, 0, 11, 4, 3, 4);
- path_search(&wpd, 0, 12, 4, 3, 4);
- path_search(&wpd, 0, 13, 4, 3, 4);
- path_search(&wpd, 0, 14, 4, 3, 4);
- path_search(&wpd, 0, 15, 4, 3, 4);
- path_search(&wpd, 0, 16, 4, 3, 4);
- path_search(&wpd, 0, 17, 4, 3, 4);
- path_search(&wpd, 0, 18, 4, 3, 4);
-}
-#endif