forked from mirror/OpenTTD
(svn r1751) - Feature: New PathFinder (NPF).
- Supports trains, road vehicles and ships. - Uses A* pathfinding (same codebase as the new ai). - Currently unlimited search depth, so might perform badly on large maps/networks (especially ships). - Will always find a route if there is one. - Allows custom penalties for obstacles to be set in openttd.cfg (npf_ values). - With NPF enabled, ships can have orders that are very far apart. Be careful, this will break (ships get lost) when the old pathfinder is used again. - Feature: Disabling 90 degree turns for trains and ships. - Requires NPF to be enabled. - Ships and trains can no longer make weird 90 degree turns on tile borders. - Codechange: Removed table/directions.h. - table/directions.h contained ugly static tables but was included more than once. The tables, along with a few new ones are in npf.[ch] now. Better suggestions for a location? - Fix: Binary heap in queue.c did not allocate enough space, resulting in a segfault. - Codechange: Rewritten FindFirstBit2x64, added KillFirstBit2x64. - Codechange: Introduced constant INVALID_TILE, to replace the usage of 0 as an invalid tile. Also replaces TILE_WRAPPED. - Codechange: Moved TileAddWrap() to map.[ch] - Add TileIndexDiffCByDir(), TileIndexDiffCByDir(). - Codechange: Moved IsTrainStationTile() to station.h - Add: IsRoadStationTile() and GetRoadStationDir().
This commit is contained in:
16
station.h
16
station.h
@@ -2,6 +2,7 @@
|
||||
#define STATION_H
|
||||
|
||||
#include "sprite.h"
|
||||
#include "tile.h"
|
||||
#include "vehicle.h"
|
||||
|
||||
typedef struct GoodsEntry {
|
||||
@@ -224,4 +225,19 @@ uint GetNumRoadStops(const Station *st, RoadStopType type);
|
||||
RoadStop * GetPrimaryRoadStop(const Station *st, RoadStopType type);
|
||||
RoadStop * GetFirstFreeRoadStop( void );
|
||||
|
||||
static inline bool IsTrainStationTile(uint tile) {
|
||||
return IsTileType(tile, MP_STATION) && IS_BYTE_INSIDE(_map5[tile], 0, 8);
|
||||
}
|
||||
|
||||
static inline bool IsRoadStationTile(uint tile) {
|
||||
return IsTileType(tile, MP_STATION) && IS_BYTE_INSIDE(_map5[tile], 0x43, 0x4B);
|
||||
}
|
||||
|
||||
/* Get's the direction the station exit points towards. Ie, returns 0 for a
|
||||
* station with the exit NE. */
|
||||
static inline byte GetRoadStationDir(uint tile) {
|
||||
assert(IsRoadStationTile(tile));
|
||||
return (_map5[tile] - 0x43) & 3;
|
||||
}
|
||||
|
||||
#endif /* STATION_H */
|
||||
|
Reference in New Issue
Block a user