| 51 | } |
| 52 | |
| 53 | bool dtPathQueue::init(const int maxPathSize, const int maxSearchNodeCount, dtNavMesh* nav) |
| 54 | { |
| 55 | purge(); |
| 56 | |
| 57 | m_navquery = dtAllocNavMeshQuery(); |
| 58 | if (!m_navquery) |
| 59 | return false; |
| 60 | if (dtStatusFailed(m_navquery->init(nav, maxSearchNodeCount))) |
| 61 | return false; |
| 62 | |
| 63 | m_maxPathSize = maxPathSize; |
| 64 | for (int i = 0; i < MAX_QUEUE; ++i) |
| 65 | { |
| 66 | m_queue[i].ref = DT_PATHQ_INVALID; |
| 67 | m_queue[i].path = (dtPolyRef*)dtAlloc(sizeof(dtPolyRef)*m_maxPathSize, DT_ALLOC_PERM); |
| 68 | if (!m_queue[i].path) |
| 69 | return false; |
| 70 | } |
| 71 | |
| 72 | m_queueHead = 0; |
| 73 | |
| 74 | return true; |
| 75 | } |
| 76 | |
| 77 | void dtPathQueue::update(const int maxIters) |
| 78 | { |
nothing calls this directly
no test coverage detected