src/station_map.h
changeset 8785 871586967963
parent 8471 ba4c15fe147b
child 8787 41d9d5adbe87
equal deleted inserted replaced
8784:c2e9d649a9ce 8785:871586967963
     6 #define STATION_MAP_H
     6 #define STATION_MAP_H
     7 
     7 
     8 #include "rail_map.h"
     8 #include "rail_map.h"
     9 #include "road_map.h"
     9 #include "road_map.h"
    10 #include "water_map.h"
    10 #include "water_map.h"
    11 #include "station.h"
    11 #include "station_func.h"
       
    12 #include "station_base.h"
    12 #include "rail.h"
    13 #include "rail.h"
       
    14 #include "newgrf_station.h"
    13 
    15 
    14 typedef byte StationGfx;
    16 typedef byte StationGfx;
    15 
    17 
    16 static inline StationID GetStationIndex(TileIndex t)
    18 static inline StationID GetStationIndex(TileIndex t)
    17 {
    19 {
    47 static inline StationType GetStationType(TileIndex t)
    49 static inline StationType GetStationType(TileIndex t)
    48 {
    50 {
    49 	return (StationType)GB(_m[t].m6, 3, 3);
    51 	return (StationType)GB(_m[t].m6, 3, 3);
    50 }
    52 }
    51 
    53 
    52 static inline RoadStop::Type GetRoadStopType(TileIndex t)
    54 static inline RoadStopType GetRoadStopType(TileIndex t)
    53 {
    55 {
    54 	assert(GetStationType(t) == STATION_TRUCK || GetStationType(t) == STATION_BUS);
    56 	assert(GetStationType(t) == STATION_TRUCK || GetStationType(t) == STATION_BUS);
    55 	return GetStationType(t) == STATION_TRUCK ? RoadStop::TRUCK : RoadStop::BUS;
    57 	return GetStationType(t) == STATION_TRUCK ? ROADSTOP_TRUCK : ROADSTOP_BUS;
    56 }
    58 }
    57 
    59 
    58 static inline StationGfx GetStationGfx(TileIndex t)
    60 static inline StationGfx GetStationGfx(TileIndex t)
    59 {
    61 {
    60 	assert(IsTileType(t, MP_STATION));
    62 	assert(IsTileType(t, MP_STATION));
   258 {
   260 {
   259 	MakeStation(t, o, sid, STATION_RAIL, section + a);
   261 	MakeStation(t, o, sid, STATION_RAIL, section + a);
   260 	SetRailType(t, rt);
   262 	SetRailType(t, rt);
   261 }
   263 }
   262 
   264 
   263 static inline void MakeRoadStop(TileIndex t, Owner o, StationID sid, RoadStop::Type rst, RoadTypes rt, DiagDirection d)
   265 static inline void MakeRoadStop(TileIndex t, Owner o, StationID sid, RoadStopType rst, RoadTypes rt, DiagDirection d)
   264 {
   266 {
   265 	MakeStation(t, o, sid, (rst == RoadStop::BUS ? STATION_BUS : STATION_TRUCK), d);
   267 	MakeStation(t, o, sid, (rst == ROADSTOP_BUS ? STATION_BUS : STATION_TRUCK), d);
   266 	SetRoadTypes(t, rt);
   268 	SetRoadTypes(t, rt);
   267 }
   269 }
   268 
   270 
   269 static inline void MakeDriveThroughRoadStop(TileIndex t, Owner o, StationID sid, RoadStop::Type rst, RoadTypes rt, Axis a, bool on_town_road)
   271 static inline void MakeDriveThroughRoadStop(TileIndex t, Owner o, StationID sid, RoadStopType rst, RoadTypes rt, Axis a, bool on_town_road)
   270 {
   272 {
   271 	MakeStation(t, o, sid, (rst == RoadStop::BUS ? STATION_BUS : STATION_TRUCK), GFX_TRUCK_BUS_DRIVETHROUGH_OFFSET + a);
   273 	MakeStation(t, o, sid, (rst == ROADSTOP_BUS ? STATION_BUS : STATION_TRUCK), GFX_TRUCK_BUS_DRIVETHROUGH_OFFSET + a);
   272 	SB(_m[t].m6, 2, 1, on_town_road);
   274 	SB(_m[t].m6, 2, 1, on_town_road);
   273 	SetRoadTypes(t, rt);
   275 	SetRoadTypes(t, rt);
   274 }
   276 }
   275 
   277 
   276 static inline void MakeAirport(TileIndex t, Owner o, StationID sid, byte section)
   278 static inline void MakeAirport(TileIndex t, Owner o, StationID sid, byte section)