(svn r18364) -Codechange: move the pathfinders and their related files into a separate directory

This commit is contained in:
rubidium
2009-12-01 22:45:39 +00:00
parent 501d2ba0d8
commit 2f3053508d
37 changed files with 151 additions and 128 deletions

View File

@@ -25,9 +25,9 @@
* should call clear() yourself!
*/
#include "stdafx.h"
#include "../../stdafx.h"
#include "../../core/alloc_func.hpp"
#include "aystar.h"
#include "core/alloc_func.hpp"
int _aystar_stats_open_size;
int _aystar_stats_closed_size;

View File

@@ -19,8 +19,8 @@
#define AYSTAR_H
#include "queue.h"
#include "tile_type.h"
#include "track_type.h"
#include "../../tile_type.h"
#include "../../track_type.h"
//#define AYSTAR_DEBUG
enum {

View File

@@ -9,18 +9,18 @@
/** @file npf.cpp Implementation of the NPF pathfinder. */
#include "stdafx.h"
#include "../../stdafx.h"
#include "../../debug.h"
#include "../../landscape.h"
#include "../../depot_base.h"
#include "../../network/network.h"
#include "../../tunnelbridge_map.h"
#include "../../functions.h"
#include "../../tunnelbridge.h"
#include "../../pbs.h"
#include "../../train.h"
#include "../pathfinder_func.h"
#include "npf.h"
#include "debug.h"
#include "landscape.h"
#include "depot_base.h"
#include "network/network.h"
#include "tunnelbridge_map.h"
#include "functions.h"
#include "tunnelbridge.h"
#include "pbs.h"
#include "pathfind.h"
#include "train.h"
static AyStar _npf_aystar;

View File

@@ -13,14 +13,14 @@
#define NPF_H
#include "aystar.h"
#include "station_type.h"
#include "rail_type.h"
#include "company_type.h"
#include "vehicle_type.h"
#include "tile_type.h"
#include "track_type.h"
#include "core/bitmath_func.hpp"
#include "transport_type.h"
#include "../../station_type.h"
#include "../../rail_type.h"
#include "../../company_type.h"
#include "../../vehicle_type.h"
#include "../../tile_type.h"
#include "../../track_type.h"
#include "../../core/bitmath_func.hpp"
#include "../../transport_type.h"
/* mowing grass */
enum {

View File

@@ -9,9 +9,9 @@
/** @file queue.cpp Implementation of the Queue/Hash. */
#include "stdafx.h"
#include "../../stdafx.h"
#include "../../core/alloc_func.hpp"
#include "queue.h"
#include "core/alloc_func.hpp"
/*

View File

@@ -9,12 +9,12 @@
/** @file pathfind.cpp Implementation of the oldest supported pathfinder. */
#include "stdafx.h"
#include "pathfind.h"
#include "debug.h"
#include "tunnelbridge_map.h"
#include "core/alloc_type.hpp"
#include "tunnelbridge.h"
#include "../../stdafx.h"
#include "../../debug.h"
#include "../../tunnelbridge_map.h"
#include "../../core/alloc_type.hpp"
#include "../../tunnelbridge.h"
#include "opf_ship.h"
struct RememberData {
uint16 cur_length;

View File

@@ -0,0 +1,21 @@
/* $Id$ */
/*
* This file is part of OpenTTD.
* OpenTTD is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2.
* OpenTTD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
* See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with OpenTTD. If not, see <http://www.gnu.org/licenses/>.
*/
/** @file opf_ship.h Original pathfinder for ships; very simple. */
#ifndef OPF_SHIP_H
#define OPF_SHIP_H
#include "../../direction_type.h"
typedef bool TPFEnumProc(TileIndex tile, void *data, Trackdir trackdir, uint length);
void OPFShipFollowTrack(TileIndex tile, DiagDirection direction, TPFEnumProc *enum_proc, void *data);
#endif /* OPF_SHIP_H */

View File

@@ -7,18 +7,13 @@
* See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with OpenTTD. If not, see <http://www.gnu.org/licenses/>.
*/
/** @file pathfind.h The oldest pathfinder that's supported. */
/** @file pathfinder_func.h General functions related to pathfinders. */
#ifndef PATHFIND_H
#define PATHFIND_H
#ifndef PATHFINDER_FUNC_H
#define PATHFINDER_FUNC_H
#include "direction_type.h"
#include "station_base.h"
#include "waypoint_base.h"
typedef bool TPFEnumProc(TileIndex tile, void *data, Trackdir trackdir, uint length);
void OPFShipFollowTrack(TileIndex tile, DiagDirection direction, TPFEnumProc *enum_proc, void *data);
#include "../station_base.h"
#include "../waypoint_base.h"
/**
* Calculates the tile of given station that is closest to a given tile
@@ -51,4 +46,4 @@ static inline TileIndex CalcClosestStationTile(StationID station, TileIndex tile
return TileXY(x, y);
}
#endif /* PATHFIND_H */
#endif /* PATHFINDER_FUNC_H */

View File

@@ -13,9 +13,9 @@
#define FOLLOW_TRACK_HPP
#include "yapf.hpp"
#include "../depot_map.h"
#include "../roadveh.h"
#include "../train.h"
#include "../../depot_map.h"
#include "../../roadveh.h"
#include "../../train.h"
/** Track follower helper template class (can serve pathfinders and vehicle
* controllers). See 6 different typedefs below for 3 different transport

View File

@@ -12,9 +12,9 @@
#ifndef NODELIST_HPP
#define NODELIST_HPP
#include "../misc/array.hpp"
#include "../misc/hashtable.hpp"
#include "../misc/binaryheap.hpp"
#include "../../misc/array.hpp"
#include "../../misc/hashtable.hpp"
#include "../../misc/binaryheap.hpp"
/** Hash table based node list multi-container class.
* Implements open list, closed list and priority queue for A-star

View File

@@ -12,11 +12,11 @@
#ifndef YAPF_H
#define YAPF_H
#include "../debug.h"
#include "../depot_type.h"
#include "../direction_type.h"
#include "../station_type.h"
#include "../pbs.h"
#include "../../debug.h"
#include "../../depot_type.h"
#include "../../direction_type.h"
#include "../../station_type.h"
#include "../../pbs.h"
/** Finds the best path for given ship.
* @param v the ship that needs to find a path

View File

@@ -12,22 +12,22 @@
#ifndef YAPF_HPP
#define YAPF_HPP
#include "../openttd.h"
#include "../vehicle_base.h"
#include "../road_map.h"
#include "../tunnel_map.h"
#include "../bridge_map.h"
#include "../tunnelbridge_map.h"
#include "../bridge.h"
#include "../station_map.h"
#include "../tile_cmd.h"
#include "../landscape.h"
#include "../../openttd.h"
#include "../../vehicle_base.h"
#include "../../road_map.h"
#include "../../tunnel_map.h"
#include "../../bridge_map.h"
#include "../../tunnelbridge_map.h"
#include "../../bridge.h"
#include "../../station_map.h"
#include "../../tile_cmd.h"
#include "../../landscape.h"
#include "yapf.h"
#include "../pathfind.h"
#include "../waypoint_base.h"
#include "../debug.h"
#include "../settings_type.h"
#include "../tunnelbridge.h"
#include "../pathfinder_func.h"
#include "../../waypoint_base.h"
#include "../../debug.h"
#include "../../settings_type.h"
#include "../../tunnelbridge.h"
extern uint64 ottd_rdtsc();
@@ -109,14 +109,14 @@ typedef CPerfStartFake CPerfStart;
//#undef FORCEINLINE
//#define FORCEINLINE inline
#include "../misc/crc32.hpp"
#include "../misc/blob.hpp"
#include "../misc/str.hpp"
#include "../misc/fixedsizearray.hpp"
#include "../misc/array.hpp"
#include "../misc/hashtable.hpp"
#include "../misc/binaryheap.hpp"
#include "../misc/dbg_helpers.h"
#include "../../misc/crc32.hpp"
#include "../../misc/blob.hpp"
#include "../../misc/str.hpp"
#include "../../misc/fixedsizearray.hpp"
#include "../../misc/array.hpp"
#include "../../misc/hashtable.hpp"
#include "../../misc/binaryheap.hpp"
#include "../../misc/dbg_helpers.h"
#include "nodelist.hpp"
#include "follow_track.hpp"
#include "yapf_base.hpp"

View File

@@ -12,8 +12,8 @@
#ifndef YAPF_BASE_HPP
#define YAPF_BASE_HPP
#include "../debug.h"
#include "../settings_type.h"
#include "../../debug.h"
#include "../../settings_type.h"
extern int _total_pf_time_us;

View File

@@ -12,7 +12,7 @@
#ifndef YAPF_COSTCACHE_HPP
#define YAPF_COSTCACHE_HPP
#include "../date_func.h"
#include "../../date_func.h"
/** CYapfSegmentCostCacheNoneT - the formal only yapf cost cache provider that implements
* PfNodeCacheFetch() and PfNodeCacheFlush() callbacks. Used when nodes don't have CachedData

View File

@@ -12,7 +12,7 @@
#ifndef YAPF_COSTRAIL_HPP
#define YAPF_COSTRAIL_HPP
#include "../pbs.h"
#include "../../pbs.h"
template <class Types>
class CYapfCostRailT

View File

@@ -9,13 +9,13 @@
/** @file yapf_rail.cpp The rail pathfinding. */
#include "../stdafx.h"
#include "../../stdafx.h"
#include "yapf.hpp"
#include "yapf_node_rail.hpp"
#include "yapf_costrail.hpp"
#include "yapf_destrail.hpp"
#include "../functions.h"
#include "../../functions.h"
#define DEBUG_YAPF_CACHE 0

View File

@@ -9,9 +9,9 @@
/** @file yapf_road.cpp The road pathfinding. */
#include "../stdafx.h"
#include "../roadstop_base.h"
#include "../cargotype.h"
#include "../../stdafx.h"
#include "../../roadstop_base.h"
#include "../../cargotype.h"
#include "yapf.hpp"
#include "yapf_node_road.hpp"

View File

@@ -9,7 +9,7 @@
/** @file yapf_ship.cpp Implementation of YAPF for ships. */
#include "../stdafx.h"
#include "../../stdafx.h"
#include "yapf.hpp"

View File

@@ -7,11 +7,12 @@
* See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with OpenTTD. If not, see <http://www.gnu.org/licenses/>.
*/
/** @file pbs.cpp */
/** @file pbs.cpp PBS support routines */
#include "stdafx.h"
#include "functions.h"
#include "vehicle_func.h"
#include "yapf/follow_track.hpp"
#include "pathfinder/yapf/follow_track.hpp"
/**
* Get the reserved trackbits for any tile, regardless of type.

View File

@@ -17,7 +17,7 @@
#include "command_func.h"
#include "engine_base.h"
#include "depot_base.h"
#include "yapf/yapf.h"
#include "pathfinder/yapf/yapf.h"
#include "newgrf_engine.h"
#include "landscape_type.h"
#include "newgrf_commons.h"

View File

@@ -16,7 +16,7 @@
#include "landscape.h"
#include "viewport_func.h"
#include "command_func.h"
#include "yapf/yapf.h"
#include "pathfinder/yapf/yapf.h"
#include "depot_base.h"
#include "newgrf.h"
#include "variables.h"

View File

@@ -14,14 +14,14 @@
#include "roadveh.h"
#include "command_func.h"
#include "news_func.h"
#include "pathfind.h"
#include "npf.h"
#include "pathfinder/npf/npf.h"
#include "station_base.h"
#include "company_func.h"
#include "vehicle_gui.h"
#include "articulated_vehicles.h"
#include "newgrf_engine.h"
#include "newgrf_sound.h"
#include "yapf/yapf.h"
#include "pathfinder/yapf/yapf.h"
#include "strings_func.h"
#include "tunnelbridge_map.h"
#include "functions.h"

View File

@@ -25,7 +25,7 @@
#include "../clear_map.h"
#include "../vehicle_func.h"
#include "../newgrf_station.h"
#include "../yapf/yapf.hpp"
#include "../pathfinder/yapf/yapf.hpp"
#include "../elrail_func.h"
#include "../signs_func.h"
#include "../aircraft.h"

View File

@@ -31,8 +31,8 @@
#include "settings_internal.h"
#include "command_func.h"
#include "console_func.h"
#include "npf.h"
#include "yapf/yapf.h"
#include "pathfinder/npf/npf.h"
#include "pathfinder/yapf/yapf.h"
#include "genworld.h"
#include "train.h"
#include "news_func.h"

View File

@@ -16,11 +16,12 @@
#include "command_func.h"
#include "news_func.h"
#include "company_func.h"
#include "npf.h"
#include "pathfinder/npf/npf.h"
#include "depot_base.h"
#include "station_base.h"
#include "vehicle_gui.h"
#include "newgrf_engine.h"
#include "yapf/yapf.h"
#include "pathfinder/yapf/yapf.h"
#include "newgrf_sound.h"
#include "spritecache.h"
#include "strings_func.h"
@@ -33,7 +34,7 @@
#include "gfx_func.h"
#include "effectvehicle_func.h"
#include "ai/ai.hpp"
#include "pathfind.h"
#include "pathfinder/opf/opf_ship.h"
#include "landscape_type.h"
#include "table/strings.h"

View File

@@ -25,7 +25,7 @@
#include "newgrf_cargo.h"
#include "newgrf_station.h"
#include "newgrf_commons.h"
#include "yapf/yapf.h"
#include "pathfinder/yapf/yapf.h"
#include "road_internal.h" /* For drawing catenary/checking road removal */
#include "variables.h"
#include "autoslope.h"

View File

@@ -13,14 +13,14 @@
#include "gui.h"
#include "articulated_vehicles.h"
#include "command_func.h"
#include "npf.h"
#include "pathfinder/npf/npf.h"
#include "news_func.h"
#include "company_func.h"
#include "vehicle_gui.h"
#include "newgrf_engine.h"
#include "newgrf_sound.h"
#include "newgrf_text.h"
#include "yapf/follow_track.hpp"
#include "pathfinder/yapf/follow_track.hpp"
#include "group.h"
#include "table/sprites.h"
#include "strings_func.h"

View File

@@ -25,7 +25,7 @@
#include "ship.h"
#include "roadveh.h"
#include "water_map.h"
#include "yapf/yapf.h"
#include "pathfinder/yapf/yapf.h"
#include "newgrf_sound.h"
#include "autoslope.h"
#include "tunnelbridge_map.h"

View File

@@ -16,7 +16,7 @@
#include "bridge_map.h"
#include "town.h"
#include "waypoint_base.h"
#include "yapf/yapf.h"
#include "pathfinder/yapf/yapf.h"
#include "strings_func.h"
#include "functions.h"
#include "window_func.h"