00001
00002
00003
00004
00005
00006
00007
00008
00009 #ifndef SPATH_H
00010 #define SPATH_H
00011
00012 #define HEX_BASED
00013 #undef APPROXIMATE_ASTAR
00014
00015
00016
00017
00018
00019
00020 typedef struct {
00021 int *coords;
00022 int coordcount;
00023 int iterations;
00024 int score;
00025 } SPATHRESULT;
00026
00027 void FreePath(SPATHRESULT * res);
00028 SPATHRESULT *CalculatePath(int x1, int y1, int x2, int y2, int errper);
00029
00030
00031 #ifdef _SPATH_C
00032
00033
00034 #ifdef HEX_BASED
00035 #define NBCOUNT 6
00036 #else
00037 #define NBCOUNT 8
00038 #endif
00039
00040 typedef struct NODETYPE {
00041 int x, y;
00042 int f, h, g;
00043 int NodeNum;
00044 struct NODETYPE *Parent;
00045 struct NODETYPE *Child[NBCOUNT];
00046 struct NODETYPE *next;
00047 } NODE;
00048
00049
00050 #define TileNum(x,y) ((x) + ((y) << 16))
00051
00052
00053
00054
00055
00056
00057 typedef struct STACKTYPE {
00058 NODE *Node;
00059 struct STACKTYPE *Next;
00060 } MYSTACK;
00061
00062 #endif
00063 #include "p.spath.h"
00064
00065 #endif