Mercurial > fife-parpg
diff engine/core/pathfinder/routepather/routepathersearch.cpp @ 378:64738befdf3b
bringing in the changes from the build_system_rework branch in preparation for the 0.3.0 release. This commit will require the Jan2010 devkit. Clients will also need to be modified to the new way to import fife.
author | vtchill@33b003aa-7bff-0310-803a-e67f0ece8222 |
---|---|
date | Mon, 11 Jan 2010 23:34:52 +0000 |
parents | 0fd74235b34d |
children |
line wrap: on
line diff
--- a/engine/core/pathfinder/routepather/routepathersearch.cpp Wed Dec 09 17:01:52 2009 +0000 +++ b/engine/core/pathfinder/routepather/routepathersearch.cpp Mon Jan 11 23:34:52 2010 +0000 @@ -40,15 +40,21 @@ namespace FIFE { RoutePatherSearch::RoutePatherSearch(const int session_id, const Location& from, const Location& to, SearchSpace* searchSpace) - : m_destCoordInt(0), m_startCoordInt(0), m_next(0), m_to(to), m_from(from), m_sessionId(session_id), m_searchspace(searchSpace), m_status(search_status_incomplete){ - m_startCoordInt = m_searchspace->convertCoordToInt(from.getLayerCoordinates()); + : m_to(to), + m_from(from), + m_sessionId(session_id), + m_searchspace(searchSpace), + m_status(search_status_incomplete), + m_startCoordInt(searchSpace->convertCoordToInt(from.getLayerCoordinates())), + m_destCoordInt(searchSpace->convertCoordToInt(to.getLayerCoordinates())), + m_next(0), + m_heuristic(Heuristic::getHeuristic(searchSpace->getLayer()->getCellGrid()->getType())) + { + m_sortedfrontier.pushElement(PriorityQueue<int, float>::value_type(m_startCoordInt, 0.0f)); int max_index = m_searchspace->getMaxIndex(); - m_destCoordInt = m_searchspace->convertCoordToInt(to.getLayerCoordinates()); - m_sortedfrontier.pushElement(PriorityQueue<int, float>::value_type(m_startCoordInt, 0.0f)); m_spt.resize(max_index + 1, -1); m_sf.resize(max_index + 1, -1); - m_gCosts.resize(max_index + 1, 0.0f); - m_heuristic = Heuristic::getHeuristic(searchSpace->getLayer()->getCellGrid()->getType()); + m_gCosts.resize(max_index + 1, 0.0f);; }