summaryrefslogtreecommitdiff
path: root/station.h
diff options
context:
space:
mode:
authorcelestar <celestar@openttd.org>2005-01-29 19:41:44 +0000
committercelestar <celestar@openttd.org>2005-01-29 19:41:44 +0000
commit3c82a2b3c76da6933c8c0f75905f62795acb115a (patch)
treefcefcecfa2ec7dd8e9178d5206788bd62dcf3c53 /station.h
parentb8fb0141a3faef0e98dd13562848c816a4ebb8bf (diff)
downloadopenttd-3c82a2b3c76da6933c8c0f75905f62795acb115a.tar.xz
(svn r1721) -Feature: It is now possible to build multiple road stations (up to 8) on
a single station. Thanks to: Truelight for the saveload code, Darkvater and Hackykid for network testing and Tron for proof-reading 1500 lines of diff.
Diffstat (limited to 'station.h')
-rw-r--r--station.h47
1 files changed, 41 insertions, 6 deletions
diff --git a/station.h b/station.h
index 885701bad..ca14257b1 100644
--- a/station.h
+++ b/station.h
@@ -14,10 +14,32 @@ typedef struct GoodsEntry {
byte last_age;
} GoodsEntry;
+typedef enum RoadStopType {
+ RS_BUS,
+ RS_TRUCK
+} RoadStopType;
+
+enum { NUM_ROAD_STOPS = 250 };
+enum { ROAD_STOP_LIMIT = 8 };
+enum { NUM_SLOTS = 2 };
+enum { INVALID_SLOT = 0xFFFF };
+
+typedef struct RoadStop {
+ TileIndex xy;
+ bool used;
+ byte status;
+ uint32 index;
+ uint16 slot[NUM_SLOTS];
+ uint16 station; //XXX should be StationIndex
+ uint8 type;
+ struct RoadStop *next;
+ struct RoadStop *prev;
+} RoadStop;
+
struct Station {
TileIndex xy;
- TileIndex bus_tile;
- TileIndex lorry_tile;
+ RoadStop *bus_stops;
+ RoadStop *truck_stops;
TileIndex train_tile;
TileIndex airport_tile;
TileIndex dock_tile;
@@ -36,9 +58,6 @@ struct Station {
byte owner;
byte facilities;
byte airport_type;
- byte truck_stop_status;
- byte bus_stop_status;
- byte blocked_months_obsolete;
// trainstation width/height
byte trainst_w, trainst_h;
@@ -53,6 +72,14 @@ struct Station {
VehicleID last_vehicle;
GoodsEntry goods[NUM_CARGO];
+
+ /* Stuff that is no longer used, but needed for conversion */
+ TileIndex bus_tile_obsolete;
+ TileIndex lorry_tile_obsolete;
+
+ byte truck_stop_status_obsolete;
+ byte bus_stop_status_obsolete;
+ byte blocked_months_obsolete;
};
enum {
@@ -68,7 +95,7 @@ enum {
HVOT_TRAIN = 1<<1,
HVOT_BUS = 1 << 2,
HVOT_TRUCK = 1 << 3,
- HVOT_AIRCRAFT = 1<<4,
+ HVOT_AIRCRAFT = 1 << 4,
HVOT_SHIP = 1 << 5,
HVOT_BUOY = 1 << 6
};
@@ -93,7 +120,9 @@ TileIndex GetStationTileForVehicle(const Vehicle *v, const Station *st);
void ShowStationViewWindow(int station);
void UpdateAllStationVirtCoord(void);
+VARDEF RoadStop _roadstops[NUM_ROAD_STOPS * 2];
VARDEF Station _stations[250];
+VARDEF uint _roadstops_size;
VARDEF uint _stations_size;
VARDEF SortStruct *_station_sort;
@@ -189,4 +218,10 @@ struct StationSpec *GetCustomStation(enum StationClass sclass, byte stid);
uint32 GetCustomStationRelocation(struct StationSpec *spec, struct Station *stat, byte ctype);
int GetCustomStationsCount(enum StationClass sclass);
+RoadStop * GetRoadStopByTile(TileIndex tile, RoadStopType type);
+inline int GetRoadStopType(TileIndex tile);
+uint GetNumRoadStops(const Station *st, RoadStopType type);
+RoadStop * GetPrimaryRoadStop(const Station *st, RoadStopType type);
+RoadStop * GetFirstFreeRoadStop( void );
+
#endif /* STATION_H */