mirror of https://github.com/OpenTTD/OpenTTD.git
(svn r12489) -Codechange: split station.h into station_base.h and station_func.h.
This commit is contained in:
parent
4a1035ab95
commit
2edd403656
|
@ -15,7 +15,6 @@
|
||||||
#include "../../command_func.h"
|
#include "../../command_func.h"
|
||||||
#include "../../town.h"
|
#include "../../town.h"
|
||||||
#include "../../industry.h"
|
#include "../../industry.h"
|
||||||
#include "../../station.h"
|
|
||||||
#include "../../pathfind.h"
|
#include "../../pathfind.h"
|
||||||
#include "../../airport.h"
|
#include "../../airport.h"
|
||||||
#include "../../depot.h"
|
#include "../../depot.h"
|
||||||
|
@ -2690,10 +2689,10 @@ static CommandCost AiDoBuildDefaultRoadBlock(TileIndex tile, const AiDefaultBloc
|
||||||
} else if (p->mode == 1) {
|
} else if (p->mode == 1) {
|
||||||
if (_want_road_truck_station) {
|
if (_want_road_truck_station) {
|
||||||
// Truck station
|
// Truck station
|
||||||
ret = DoCommand(c, p->attr, ROADTYPES_ROAD << 2 | RoadStop::TRUCK, flag | DC_AUTO | DC_NO_WATER | DC_AI_BUILDING, CMD_BUILD_ROAD_STOP);
|
ret = DoCommand(c, p->attr, ROADTYPES_ROAD << 2 | ROADSTOP_TRUCK, flag | DC_AUTO | DC_NO_WATER | DC_AI_BUILDING, CMD_BUILD_ROAD_STOP);
|
||||||
} else {
|
} else {
|
||||||
// Bus station
|
// Bus station
|
||||||
ret = DoCommand(c, p->attr, ROADTYPES_ROAD << 2 | RoadStop::BUS, flag | DC_AUTO | DC_NO_WATER | DC_AI_BUILDING, CMD_BUILD_ROAD_STOP);
|
ret = DoCommand(c, p->attr, ROADTYPES_ROAD << 2 | ROADSTOP_BUS, flag | DC_AUTO | DC_NO_WATER | DC_AI_BUILDING, CMD_BUILD_ROAD_STOP);
|
||||||
}
|
}
|
||||||
clear_town_stuff:;
|
clear_town_stuff:;
|
||||||
|
|
||||||
|
|
|
@ -7,7 +7,6 @@
|
||||||
#include "../../command_func.h"
|
#include "../../command_func.h"
|
||||||
#include "trolly.h"
|
#include "trolly.h"
|
||||||
#include "../../engine.h"
|
#include "../../engine.h"
|
||||||
#include "../../station.h"
|
|
||||||
#include "../../variables.h"
|
#include "../../variables.h"
|
||||||
#include "../../bridge.h"
|
#include "../../bridge.h"
|
||||||
#include "../../vehicle_func.h"
|
#include "../../vehicle_func.h"
|
||||||
|
@ -44,9 +43,9 @@ CommandCost AiNew_Build_Station(Player *p, byte type, TileIndex tile, byte lengt
|
||||||
return AI_DoCommand(tile, direction + (numtracks << 8) + (length << 16), 0, flag | DC_AUTO | DC_NO_WATER, CMD_BUILD_RAILROAD_STATION);
|
return AI_DoCommand(tile, direction + (numtracks << 8) + (length << 16), 0, flag | DC_AUTO | DC_NO_WATER, CMD_BUILD_RAILROAD_STATION);
|
||||||
|
|
||||||
if (type == AI_BUS)
|
if (type == AI_BUS)
|
||||||
return AI_DoCommand(tile, direction, ROADTYPES_ROAD << 2 | RoadStop::BUS, flag | DC_AUTO | DC_NO_WATER, CMD_BUILD_ROAD_STOP);
|
return AI_DoCommand(tile, direction, ROADTYPES_ROAD << 2 | ROADSTOP_BUS, flag | DC_AUTO | DC_NO_WATER, CMD_BUILD_ROAD_STOP);
|
||||||
|
|
||||||
return AI_DoCommand(tile, direction, ROADTYPES_ROAD << 2 | RoadStop::TRUCK, flag | DC_AUTO | DC_NO_WATER, CMD_BUILD_ROAD_STOP);
|
return AI_DoCommand(tile, direction, ROADTYPES_ROAD << 2 | ROADSTOP_TRUCK, flag | DC_AUTO | DC_NO_WATER, CMD_BUILD_ROAD_STOP);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -26,7 +26,7 @@
|
||||||
#include "trolly.h"
|
#include "trolly.h"
|
||||||
#include "../../town.h"
|
#include "../../town.h"
|
||||||
#include "../../industry.h"
|
#include "../../industry.h"
|
||||||
#include "../../station.h"
|
#include "../../station_base.h"
|
||||||
#include "../../engine.h"
|
#include "../../engine.h"
|
||||||
#include "../../gui.h"
|
#include "../../gui.h"
|
||||||
#include "../../depot.h"
|
#include "../../depot.h"
|
||||||
|
|
|
@ -6,6 +6,7 @@
|
||||||
#define AIRCRAFT_H
|
#define AIRCRAFT_H
|
||||||
|
|
||||||
#include "station_map.h"
|
#include "station_map.h"
|
||||||
|
#include "station_base.h"
|
||||||
#include "vehicle_base.h"
|
#include "vehicle_base.h"
|
||||||
#include "engine.h"
|
#include "engine.h"
|
||||||
|
|
||||||
|
|
|
@ -12,7 +12,6 @@
|
||||||
#include "timetable.h"
|
#include "timetable.h"
|
||||||
#include "depot.h"
|
#include "depot.h"
|
||||||
#include "engine.h"
|
#include "engine.h"
|
||||||
#include "station.h"
|
|
||||||
#include "news_func.h"
|
#include "news_func.h"
|
||||||
#include "aircraft.h"
|
#include "aircraft.h"
|
||||||
#include "airport.h"
|
#include "airport.h"
|
||||||
|
|
|
@ -9,7 +9,6 @@
|
||||||
#include "station_gui.h"
|
#include "station_gui.h"
|
||||||
#include "terraform_gui.h"
|
#include "terraform_gui.h"
|
||||||
#include "command_func.h"
|
#include "command_func.h"
|
||||||
#include "station.h"
|
|
||||||
#include "airport.h"
|
#include "airport.h"
|
||||||
#include "depot.h"
|
#include "depot.h"
|
||||||
#include "sound_func.h"
|
#include "sound_func.h"
|
||||||
|
|
|
@ -12,7 +12,6 @@
|
||||||
#include "gui.h"
|
#include "gui.h"
|
||||||
#include "articulated_vehicles.h"
|
#include "articulated_vehicles.h"
|
||||||
#include "textbuf_gui.h"
|
#include "textbuf_gui.h"
|
||||||
#include "station.h"
|
|
||||||
#include "command_func.h"
|
#include "command_func.h"
|
||||||
#include "engine.h"
|
#include "engine.h"
|
||||||
#include "player_func.h"
|
#include "player_func.h"
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
|
|
||||||
#include "stdafx.h"
|
#include "stdafx.h"
|
||||||
#include "openttd.h"
|
#include "openttd.h"
|
||||||
#include "station.h"
|
#include "station_base.h"
|
||||||
#include "cargopacket.h"
|
#include "cargopacket.h"
|
||||||
#include "saveload.h"
|
#include "saveload.h"
|
||||||
|
|
||||||
|
|
|
@ -5,6 +5,7 @@
|
||||||
#ifndef CARGOPACKET_H
|
#ifndef CARGOPACKET_H
|
||||||
#define CARGOPACKET_H
|
#define CARGOPACKET_H
|
||||||
|
|
||||||
|
#include "oldpool.h"
|
||||||
#include "economy_type.h"
|
#include "economy_type.h"
|
||||||
#include "tile_type.h"
|
#include "tile_type.h"
|
||||||
#include "station_type.h"
|
#include "station_type.h"
|
||||||
|
|
|
@ -25,7 +25,7 @@
|
||||||
#include "command_func.h"
|
#include "command_func.h"
|
||||||
#include "tile_cmd.h"
|
#include "tile_cmd.h"
|
||||||
#include "news_func.h"
|
#include "news_func.h"
|
||||||
#include "station.h"
|
#include "station_base.h"
|
||||||
#include "waypoint.h"
|
#include "waypoint.h"
|
||||||
#include "town.h"
|
#include "town.h"
|
||||||
#include "industry.h"
|
#include "industry.h"
|
||||||
|
|
|
@ -8,7 +8,6 @@
|
||||||
#include "landscape.h"
|
#include "landscape.h"
|
||||||
#include "player_base.h"
|
#include "player_base.h"
|
||||||
#include "player_func.h"
|
#include "player_func.h"
|
||||||
#include "station.h"
|
|
||||||
#include "command_func.h"
|
#include "command_func.h"
|
||||||
#include "saveload.h"
|
#include "saveload.h"
|
||||||
#include "industry.h"
|
#include "industry.h"
|
||||||
|
|
|
@ -36,6 +36,7 @@
|
||||||
#include "date_func.h"
|
#include "date_func.h"
|
||||||
#include "vehicle_func.h"
|
#include "vehicle_func.h"
|
||||||
#include "sound_func.h"
|
#include "sound_func.h"
|
||||||
|
#include "station_base.h"
|
||||||
|
|
||||||
#include "table/strings.h"
|
#include "table/strings.h"
|
||||||
#include "table/sprites.h"
|
#include "table/sprites.h"
|
||||||
|
|
|
@ -17,7 +17,7 @@
|
||||||
#include "textbuf_gui.h"
|
#include "textbuf_gui.h"
|
||||||
#include "viewport_func.h"
|
#include "viewport_func.h"
|
||||||
#include "gfx_func.h"
|
#include "gfx_func.h"
|
||||||
#include "station.h"
|
#include "station_func.h"
|
||||||
#include "command_func.h"
|
#include "command_func.h"
|
||||||
#include "player_func.h"
|
#include "player_func.h"
|
||||||
#include "player_base.h"
|
#include "player_base.h"
|
||||||
|
|
|
@ -16,7 +16,7 @@
|
||||||
#include "../console.h"
|
#include "../console.h"
|
||||||
#include "../command_func.h"
|
#include "../command_func.h"
|
||||||
#include "../saveload.h"
|
#include "../saveload.h"
|
||||||
#include "../station.h"
|
#include "../station_base.h"
|
||||||
#include "../variables.h"
|
#include "../variables.h"
|
||||||
#include "../genworld.h"
|
#include "../genworld.h"
|
||||||
#include "../core/alloc_func.hpp"
|
#include "../core/alloc_func.hpp"
|
||||||
|
|
|
@ -11,7 +11,6 @@
|
||||||
#include "fileio.h"
|
#include "fileio.h"
|
||||||
#include "engine.h"
|
#include "engine.h"
|
||||||
#include "spritecache.h"
|
#include "spritecache.h"
|
||||||
#include "station.h"
|
|
||||||
#include "sprite.h"
|
#include "sprite.h"
|
||||||
#include "newgrf.h"
|
#include "newgrf.h"
|
||||||
#include "variables.h"
|
#include "variables.h"
|
||||||
|
|
|
@ -5,11 +5,11 @@
|
||||||
#ifndef NEWGRF_H
|
#ifndef NEWGRF_H
|
||||||
#define NEWGRF_H
|
#define NEWGRF_H
|
||||||
|
|
||||||
#include "station.h"
|
|
||||||
#include "town_type.h"
|
#include "town_type.h"
|
||||||
#include "newgrf_config.h"
|
#include "newgrf_config.h"
|
||||||
#include "cargotype.h"
|
#include "cargotype.h"
|
||||||
#include "industry_type.h"
|
#include "industry_type.h"
|
||||||
|
#include "newgrf_station.h"
|
||||||
|
|
||||||
enum GrfLoadingStage {
|
enum GrfLoadingStage {
|
||||||
GLS_FILESCAN,
|
GLS_FILESCAN,
|
||||||
|
|
|
@ -10,7 +10,7 @@
|
||||||
#include "train.h"
|
#include "train.h"
|
||||||
#include "player_func.h"
|
#include "player_func.h"
|
||||||
#include "player_base.h"
|
#include "player_base.h"
|
||||||
#include "station.h"
|
#include "station_base.h"
|
||||||
#include "airport.h"
|
#include "airport.h"
|
||||||
#include "newgrf.h"
|
#include "newgrf.h"
|
||||||
#include "newgrf_callbacks.h"
|
#include "newgrf_callbacks.h"
|
||||||
|
|
|
@ -9,7 +9,7 @@
|
||||||
#include "landscape.h"
|
#include "landscape.h"
|
||||||
#include "debug.h"
|
#include "debug.h"
|
||||||
#include "sprite.h"
|
#include "sprite.h"
|
||||||
#include "station.h"
|
#include "station_base.h"
|
||||||
#include "station_map.h"
|
#include "station_map.h"
|
||||||
#include "newgrf.h"
|
#include "newgrf.h"
|
||||||
#include "newgrf_callbacks.h"
|
#include "newgrf_callbacks.h"
|
||||||
|
|
|
@ -9,7 +9,10 @@
|
||||||
#include "newgrf_callbacks.h"
|
#include "newgrf_callbacks.h"
|
||||||
#include "newgrf_cargo.h"
|
#include "newgrf_cargo.h"
|
||||||
#include "tile_type.h"
|
#include "tile_type.h"
|
||||||
|
#include "station_type.h"
|
||||||
#include "strings_type.h"
|
#include "strings_type.h"
|
||||||
|
#include "sprite.h"
|
||||||
|
#include "direction_type.h"
|
||||||
|
|
||||||
enum StationClassID {
|
enum StationClassID {
|
||||||
STAT_CLASS_BEGIN = 0, ///< the lowest valid value
|
STAT_CLASS_BEGIN = 0, ///< the lowest valid value
|
||||||
|
|
|
@ -12,7 +12,7 @@
|
||||||
#include "landscape.h"
|
#include "landscape.h"
|
||||||
#include "aystar.h"
|
#include "aystar.h"
|
||||||
#include "pathfind.h"
|
#include "pathfind.h"
|
||||||
#include "station.h"
|
#include "station_base.h"
|
||||||
#include "station_map.h"
|
#include "station_map.h"
|
||||||
#include "depot.h"
|
#include "depot.h"
|
||||||
#include "tunnel_map.h"
|
#include "tunnel_map.h"
|
||||||
|
|
|
@ -6,7 +6,9 @@
|
||||||
#define NPF_H
|
#define NPF_H
|
||||||
|
|
||||||
#include "aystar.h"
|
#include "aystar.h"
|
||||||
#include "station.h"
|
#include "station_type.h"
|
||||||
|
#include "rail_type.h"
|
||||||
|
#include "player_type.h"
|
||||||
#include "vehicle_type.h"
|
#include "vehicle_type.h"
|
||||||
#include "tile_type.h"
|
#include "tile_type.h"
|
||||||
#include "track_type.h"
|
#include "track_type.h"
|
||||||
|
|
|
@ -7,7 +7,6 @@
|
||||||
#include "station_map.h"
|
#include "station_map.h"
|
||||||
#include "town.h"
|
#include "town.h"
|
||||||
#include "industry.h"
|
#include "industry.h"
|
||||||
#include "station.h"
|
|
||||||
#include "player_func.h"
|
#include "player_func.h"
|
||||||
#include "player_base.h"
|
#include "player_base.h"
|
||||||
#include "engine.h"
|
#include "engine.h"
|
||||||
|
|
|
@ -15,7 +15,6 @@
|
||||||
#include "gfxinit.h"
|
#include "gfxinit.h"
|
||||||
#include "gui.h"
|
#include "gui.h"
|
||||||
#include "landscape.h"
|
#include "landscape.h"
|
||||||
#include "station.h"
|
|
||||||
#include "station_map.h"
|
#include "station_map.h"
|
||||||
#include "town_map.h"
|
#include "town_map.h"
|
||||||
#include "tunnel_map.h"
|
#include "tunnel_map.h"
|
||||||
|
|
|
@ -10,7 +10,6 @@
|
||||||
#include "depot.h"
|
#include "depot.h"
|
||||||
#include "waypoint.h"
|
#include "waypoint.h"
|
||||||
#include "command_func.h"
|
#include "command_func.h"
|
||||||
#include "station.h"
|
|
||||||
#include "player_func.h"
|
#include "player_func.h"
|
||||||
#include "news_func.h"
|
#include "news_func.h"
|
||||||
#include "saveload.h"
|
#include "saveload.h"
|
||||||
|
|
|
@ -8,7 +8,7 @@
|
||||||
#include "station_map.h"
|
#include "station_map.h"
|
||||||
#include "gui.h"
|
#include "gui.h"
|
||||||
#include "window_gui.h"
|
#include "window_gui.h"
|
||||||
#include "station.h"
|
#include "station_base.h"
|
||||||
#include "town.h"
|
#include "town.h"
|
||||||
#include "command_func.h"
|
#include "command_func.h"
|
||||||
#include "viewport_func.h"
|
#include "viewport_func.h"
|
||||||
|
|
|
@ -8,7 +8,6 @@
|
||||||
#include "player_func.h"
|
#include "player_func.h"
|
||||||
#include "player_gui.h"
|
#include "player_gui.h"
|
||||||
#include "town.h"
|
#include "town.h"
|
||||||
#include "station.h"
|
|
||||||
#include "news_func.h"
|
#include "news_func.h"
|
||||||
#include "saveload.h"
|
#include "saveload.h"
|
||||||
#include "command_func.h"
|
#include "command_func.h"
|
||||||
|
@ -34,6 +33,7 @@
|
||||||
#include "ai/trolly/trolly.h"
|
#include "ai/trolly/trolly.h"
|
||||||
#include "road_func.h"
|
#include "road_func.h"
|
||||||
#include "rail.h"
|
#include "rail.h"
|
||||||
|
#include "sprite.h"
|
||||||
|
|
||||||
#include "table/strings.h"
|
#include "table/strings.h"
|
||||||
#include "table/sprites.h"
|
#include "table/sprites.h"
|
||||||
|
|
|
@ -19,7 +19,6 @@
|
||||||
#include "pathfind.h"
|
#include "pathfind.h"
|
||||||
#include "engine.h"
|
#include "engine.h"
|
||||||
#include "town.h"
|
#include "town.h"
|
||||||
#include "station.h"
|
|
||||||
#include "sprite.h"
|
#include "sprite.h"
|
||||||
#include "depot.h"
|
#include "depot.h"
|
||||||
#include "waypoint.h"
|
#include "waypoint.h"
|
||||||
|
|
|
@ -13,7 +13,7 @@
|
||||||
#include "viewport_func.h"
|
#include "viewport_func.h"
|
||||||
#include "gfx_func.h"
|
#include "gfx_func.h"
|
||||||
#include "command_func.h"
|
#include "command_func.h"
|
||||||
#include "station.h"
|
#include "town_type.h"
|
||||||
#include "waypoint.h"
|
#include "waypoint.h"
|
||||||
#include "debug.h"
|
#include "debug.h"
|
||||||
#include "variables.h"
|
#include "variables.h"
|
||||||
|
|
|
@ -16,7 +16,6 @@
|
||||||
#include "road_cmd.h"
|
#include "road_cmd.h"
|
||||||
#include "road_map.h"
|
#include "road_map.h"
|
||||||
#include "station_map.h"
|
#include "station_map.h"
|
||||||
#include "station.h"
|
|
||||||
#include "functions.h"
|
#include "functions.h"
|
||||||
#include "window_func.h"
|
#include "window_func.h"
|
||||||
#include "vehicle_func.h"
|
#include "vehicle_func.h"
|
||||||
|
@ -27,7 +26,7 @@
|
||||||
#include "table/sprites.h"
|
#include "table/sprites.h"
|
||||||
#include "table/strings.h"
|
#include "table/strings.h"
|
||||||
|
|
||||||
static void ShowRVStationPicker(RoadStop::Type rs);
|
static void ShowRVStationPicker(RoadStopType rs);
|
||||||
static void ShowRoadDepotPicker();
|
static void ShowRoadDepotPicker();
|
||||||
|
|
||||||
static bool _remove_button_clicked;
|
static bool _remove_button_clicked;
|
||||||
|
@ -215,18 +214,18 @@ static void PlaceRoadStop(TileIndex tile, uint32 p2, uint32 cmd)
|
||||||
static void PlaceRoad_BusStation(TileIndex tile)
|
static void PlaceRoad_BusStation(TileIndex tile)
|
||||||
{
|
{
|
||||||
if (_remove_button_clicked) {
|
if (_remove_button_clicked) {
|
||||||
DoCommandP(tile, 0, RoadStop::BUS, CcPlaySound1D, CMD_REMOVE_ROAD_STOP | CMD_MSG(_road_type_infos[_cur_roadtype].err_remove_station[RoadStop::BUS]));
|
DoCommandP(tile, 0, ROADSTOP_BUS, CcPlaySound1D, CMD_REMOVE_ROAD_STOP | CMD_MSG(_road_type_infos[_cur_roadtype].err_remove_station[ROADSTOP_BUS]));
|
||||||
} else {
|
} else {
|
||||||
PlaceRoadStop(tile, (_ctrl_pressed << 5) | RoadTypeToRoadTypes(_cur_roadtype) << 2 | RoadStop::BUS, CMD_BUILD_ROAD_STOP | CMD_NO_WATER | CMD_MSG(_road_type_infos[_cur_roadtype].err_build_station[RoadStop::BUS]));
|
PlaceRoadStop(tile, (_ctrl_pressed << 5) | RoadTypeToRoadTypes(_cur_roadtype) << 2 | ROADSTOP_BUS, CMD_BUILD_ROAD_STOP | CMD_NO_WATER | CMD_MSG(_road_type_infos[_cur_roadtype].err_build_station[ROADSTOP_BUS]));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void PlaceRoad_TruckStation(TileIndex tile)
|
static void PlaceRoad_TruckStation(TileIndex tile)
|
||||||
{
|
{
|
||||||
if (_remove_button_clicked) {
|
if (_remove_button_clicked) {
|
||||||
DoCommandP(tile, 0, RoadStop::TRUCK, CcPlaySound1D, CMD_REMOVE_ROAD_STOP | CMD_MSG(_road_type_infos[_cur_roadtype].err_remove_station[RoadStop::TRUCK]));
|
DoCommandP(tile, 0, ROADSTOP_TRUCK, CcPlaySound1D, CMD_REMOVE_ROAD_STOP | CMD_MSG(_road_type_infos[_cur_roadtype].err_remove_station[ROADSTOP_TRUCK]));
|
||||||
} else {
|
} else {
|
||||||
PlaceRoadStop(tile, (_ctrl_pressed << 5) | RoadTypeToRoadTypes(_cur_roadtype) << 2 | RoadStop::TRUCK, CMD_BUILD_ROAD_STOP | CMD_NO_WATER | CMD_MSG(_road_type_infos[_cur_roadtype].err_build_station[RoadStop::TRUCK]));
|
PlaceRoadStop(tile, (_ctrl_pressed << 5) | RoadTypeToRoadTypes(_cur_roadtype) << 2 | ROADSTOP_TRUCK, CMD_BUILD_ROAD_STOP | CMD_NO_WATER | CMD_MSG(_road_type_infos[_cur_roadtype].err_build_station[ROADSTOP_TRUCK]));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -334,13 +333,13 @@ static void BuildRoadClick_Depot(Window *w)
|
||||||
static void BuildRoadClick_BusStation(Window *w)
|
static void BuildRoadClick_BusStation(Window *w)
|
||||||
{
|
{
|
||||||
if (_game_mode == GM_EDITOR || !CanBuildVehicleInfrastructure(VEH_ROAD)) return;
|
if (_game_mode == GM_EDITOR || !CanBuildVehicleInfrastructure(VEH_ROAD)) return;
|
||||||
if (HandlePlacePushButton(w, RTW_BUS_STATION, SPR_CURSOR_BUS_STATION, VHM_RECT, PlaceRoad_BusStation)) ShowRVStationPicker(RoadStop::BUS);
|
if (HandlePlacePushButton(w, RTW_BUS_STATION, SPR_CURSOR_BUS_STATION, VHM_RECT, PlaceRoad_BusStation)) ShowRVStationPicker(ROADSTOP_BUS);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void BuildRoadClick_TruckStation(Window *w)
|
static void BuildRoadClick_TruckStation(Window *w)
|
||||||
{
|
{
|
||||||
if (_game_mode == GM_EDITOR || !CanBuildVehicleInfrastructure(VEH_ROAD)) return;
|
if (_game_mode == GM_EDITOR || !CanBuildVehicleInfrastructure(VEH_ROAD)) return;
|
||||||
if (HandlePlacePushButton(w, RTW_TRUCK_STATION, SPR_CURSOR_TRUCK_STATION, VHM_RECT, PlaceRoad_TruckStation)) ShowRVStationPicker(RoadStop::TRUCK);
|
if (HandlePlacePushButton(w, RTW_TRUCK_STATION, SPR_CURSOR_TRUCK_STATION, VHM_RECT, PlaceRoad_TruckStation)) ShowRVStationPicker(ROADSTOP_TRUCK);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -942,12 +941,12 @@ static const WindowDesc _rv_station_picker_desc = {
|
||||||
RoadStationPickerWndProc
|
RoadStationPickerWndProc
|
||||||
};
|
};
|
||||||
|
|
||||||
static void ShowRVStationPicker(RoadStop::Type rs)
|
static void ShowRVStationPicker(RoadStopType rs)
|
||||||
{
|
{
|
||||||
Window *w = AllocateWindowDesc(&_rv_station_picker_desc);
|
Window *w = AllocateWindowDesc(&_rv_station_picker_desc);
|
||||||
if (w == NULL) return;
|
if (w == NULL) return;
|
||||||
|
|
||||||
w->window_class = (rs == RoadStop::BUS) ? WC_BUS_STATION : WC_TRUCK_STATION;
|
w->window_class = (rs == ROADSTOP_BUS) ? WC_BUS_STATION : WC_TRUCK_STATION;
|
||||||
w->widget[BRSW_CAPTION].data = _road_type_infos[_cur_roadtype].picker_title[rs];
|
w->widget[BRSW_CAPTION].data = _road_type_infos[_cur_roadtype].picker_title[rs];
|
||||||
for (uint i = BRSW_STATION_NE; i < BRSW_LT_OFF; i++) w->widget[i].tooltips = _road_type_infos[_cur_roadtype].picker_tooltip[rs];
|
for (uint i = BRSW_STATION_NE; i < BRSW_LT_OFF; i++) w->widget[i].tooltips = _road_type_infos[_cur_roadtype].picker_tooltip[rs];
|
||||||
}
|
}
|
||||||
|
|
|
@ -7,7 +7,6 @@
|
||||||
#include "bridge_map.h"
|
#include "bridge_map.h"
|
||||||
#include "tile_cmd.h"
|
#include "tile_cmd.h"
|
||||||
#include "road_map.h"
|
#include "road_map.h"
|
||||||
#include "station.h"
|
|
||||||
#include "tunnel_map.h"
|
#include "tunnel_map.h"
|
||||||
#include "station_map.h"
|
#include "station_map.h"
|
||||||
#include "depot.h"
|
#include "depot.h"
|
||||||
|
|
|
@ -13,7 +13,7 @@
|
||||||
#include "timetable.h"
|
#include "timetable.h"
|
||||||
#include "engine.h"
|
#include "engine.h"
|
||||||
#include "command_func.h"
|
#include "command_func.h"
|
||||||
#include "station.h"
|
#include "station_base.h"
|
||||||
#include "news_func.h"
|
#include "news_func.h"
|
||||||
#include "pathfind.h"
|
#include "pathfind.h"
|
||||||
#include "npf.h"
|
#include "npf.h"
|
||||||
|
@ -1171,7 +1171,7 @@ static Trackdir RoadFindPathToDest(Vehicle* v, TileIndex tile, DiagDirection ent
|
||||||
trackdirs = TRACKDIR_BIT_NONE;
|
trackdirs = TRACKDIR_BIT_NONE;
|
||||||
} else {
|
} else {
|
||||||
/* Our station */
|
/* Our station */
|
||||||
RoadStop::Type rstype = IsCargoInClass(v->cargo_type, CC_PASSENGERS) ? RoadStop::BUS : RoadStop::TRUCK;
|
RoadStopType rstype = IsCargoInClass(v->cargo_type, CC_PASSENGERS) ? ROADSTOP_BUS : ROADSTOP_TRUCK;
|
||||||
|
|
||||||
if (GetRoadStopType(tile) != rstype) {
|
if (GetRoadStopType(tile) != rstype) {
|
||||||
/* Wrong station type */
|
/* Wrong station type */
|
||||||
|
@ -1807,7 +1807,7 @@ again:
|
||||||
_road_veh_data_1[v->u.road.state - RVSB_IN_ROAD_STOP + (_opt.road_side << RVS_DRIVE_SIDE)] == v->u.road.frame) ||
|
_road_veh_data_1[v->u.road.state - RVSB_IN_ROAD_STOP + (_opt.road_side << RVS_DRIVE_SIDE)] == v->u.road.frame) ||
|
||||||
(IsInsideMM(v->u.road.state, RVSB_IN_DT_ROAD_STOP, RVSB_IN_DT_ROAD_STOP_END) &&
|
(IsInsideMM(v->u.road.state, RVSB_IN_DT_ROAD_STOP, RVSB_IN_DT_ROAD_STOP_END) &&
|
||||||
v->current_order.dest == GetStationIndex(v->tile) &&
|
v->current_order.dest == GetStationIndex(v->tile) &&
|
||||||
GetRoadStopType(v->tile) == (IsCargoInClass(v->cargo_type, CC_PASSENGERS) ? RoadStop::BUS : RoadStop::TRUCK) &&
|
GetRoadStopType(v->tile) == (IsCargoInClass(v->cargo_type, CC_PASSENGERS) ? ROADSTOP_BUS : ROADSTOP_TRUCK) &&
|
||||||
v->u.road.frame == RVC_DRIVE_THROUGH_STOP_FRAME))) {
|
v->u.road.frame == RVC_DRIVE_THROUGH_STOP_FRAME))) {
|
||||||
|
|
||||||
RoadStop *rs = GetRoadStopByTile(v->tile, GetRoadStopType(v->tile));
|
RoadStop *rs = GetRoadStopByTile(v->tile, GetRoadStopType(v->tile));
|
||||||
|
@ -1822,7 +1822,7 @@ again:
|
||||||
|
|
||||||
if (IsDriveThroughStopTile(v->tile)) {
|
if (IsDriveThroughStopTile(v->tile)) {
|
||||||
TileIndex next_tile = TILE_ADD(v->tile, TileOffsByDir(v->direction));
|
TileIndex next_tile = TILE_ADD(v->tile, TileOffsByDir(v->direction));
|
||||||
RoadStop::Type type = IsCargoInClass(v->cargo_type, CC_PASSENGERS) ? RoadStop::BUS : RoadStop::TRUCK;
|
RoadStopType type = IsCargoInClass(v->cargo_type, CC_PASSENGERS) ? ROADSTOP_BUS : ROADSTOP_TRUCK;
|
||||||
|
|
||||||
/* Check if next inline bay is free */
|
/* Check if next inline bay is free */
|
||||||
if (IsDriveThroughStopTile(next_tile) && (GetRoadStopType(next_tile) == type)) {
|
if (IsDriveThroughStopTile(next_tile) && (GetRoadStopType(next_tile) == type)) {
|
||||||
|
|
|
@ -16,7 +16,7 @@
|
||||||
#include "stdafx.h"
|
#include "stdafx.h"
|
||||||
#include "openttd.h"
|
#include "openttd.h"
|
||||||
#include "debug.h"
|
#include "debug.h"
|
||||||
#include "station.h"
|
#include "station_base.h"
|
||||||
#include "thread.h"
|
#include "thread.h"
|
||||||
#include "town.h"
|
#include "town.h"
|
||||||
#include "saveload.h"
|
#include "saveload.h"
|
||||||
|
|
|
@ -27,6 +27,7 @@
|
||||||
#include "waypoint.h"
|
#include "waypoint.h"
|
||||||
#include "widgets/dropdown_type.h"
|
#include "widgets/dropdown_type.h"
|
||||||
#include "widgets/dropdown_func.h"
|
#include "widgets/dropdown_func.h"
|
||||||
|
#include "station_func.h"
|
||||||
|
|
||||||
#include "table/sprites.h"
|
#include "table/sprites.h"
|
||||||
#include "table/strings.h"
|
#include "table/strings.h"
|
||||||
|
|
|
@ -11,7 +11,7 @@
|
||||||
#include "command_func.h"
|
#include "command_func.h"
|
||||||
#include "pathfind.h"
|
#include "pathfind.h"
|
||||||
#include "station_map.h"
|
#include "station_map.h"
|
||||||
#include "station.h"
|
#include "station_base.h"
|
||||||
#include "news_func.h"
|
#include "news_func.h"
|
||||||
#include "engine.h"
|
#include "engine.h"
|
||||||
#include "player_func.h"
|
#include "player_func.h"
|
||||||
|
|
|
@ -7,7 +7,7 @@
|
||||||
#include "bridge_map.h"
|
#include "bridge_map.h"
|
||||||
#include "debug.h"
|
#include "debug.h"
|
||||||
#include "station_map.h"
|
#include "station_map.h"
|
||||||
#include "station.h"
|
#include "station_base.h"
|
||||||
#include "town.h"
|
#include "town.h"
|
||||||
#include "saveload.h"
|
#include "saveload.h"
|
||||||
#include "player_func.h"
|
#include "player_func.h"
|
||||||
|
@ -100,7 +100,7 @@ Station::~Station()
|
||||||
*/
|
*/
|
||||||
RoadStop *Station::GetPrimaryRoadStop(const Vehicle *v) const
|
RoadStop *Station::GetPrimaryRoadStop(const Vehicle *v) const
|
||||||
{
|
{
|
||||||
RoadStop *rs = this->GetPrimaryRoadStop(IsCargoInClass(v->cargo_type, CC_PASSENGERS) ? RoadStop::BUS : RoadStop::TRUCK);
|
RoadStop *rs = this->GetPrimaryRoadStop(IsCargoInClass(v->cargo_type, CC_PASSENGERS) ? ROADSTOP_BUS : ROADSTOP_TRUCK);
|
||||||
|
|
||||||
for (; rs != NULL; rs = rs->next) {
|
for (; rs != NULL; rs = rs->next) {
|
||||||
/* The vehicle cannot go to this roadstop (different roadtype) */
|
/* The vehicle cannot go to this roadstop (different roadtype) */
|
||||||
|
|
|
@ -1,22 +1,18 @@
|
||||||
/* $Id$ */
|
/* $Id$ */
|
||||||
|
|
||||||
/** @file station.h */
|
/** @file station_base.h Base classes/functions for stations. */
|
||||||
|
|
||||||
#ifndef STATION_H
|
#ifndef STATION_BASE_H
|
||||||
#define STATION_H
|
#define STATION_BASE_H
|
||||||
|
|
||||||
#include "station_type.h"
|
#include "station_type.h"
|
||||||
#include "airport.h"
|
#include "airport.h"
|
||||||
#include "oldpool.h"
|
#include "oldpool.h"
|
||||||
#include "sprite.h"
|
|
||||||
#include "road_type.h"
|
|
||||||
#include "newgrf_station.h"
|
|
||||||
#include "cargopacket.h"
|
#include "cargopacket.h"
|
||||||
#include "cargo_type.h"
|
#include "cargo_type.h"
|
||||||
#include "town_type.h"
|
#include "town_type.h"
|
||||||
#include "core/geometry_type.hpp"
|
#include "newgrf_station.h"
|
||||||
#include <list>
|
#include <list>
|
||||||
#include <set>
|
|
||||||
|
|
||||||
DECLARE_OLD_POOL(Station, Station, 6, 1000)
|
DECLARE_OLD_POOL(Station, Station, 6, 1000)
|
||||||
DECLARE_OLD_POOL(RoadStop, RoadStop, 5, 2000)
|
DECLARE_OLD_POOL(RoadStop, RoadStop, 5, 2000)
|
||||||
|
@ -47,12 +43,6 @@ struct GoodsEntry {
|
||||||
|
|
||||||
/** A Stop for a Road Vehicle */
|
/** A Stop for a Road Vehicle */
|
||||||
struct RoadStop : PoolItem<RoadStop, RoadStopID, &_RoadStop_pool> {
|
struct RoadStop : PoolItem<RoadStop, RoadStopID, &_RoadStop_pool> {
|
||||||
/** Types of RoadStops */
|
|
||||||
enum Type {
|
|
||||||
BUS, ///< A standard stop for buses
|
|
||||||
TRUCK ///< A standard stop for trucks
|
|
||||||
};
|
|
||||||
|
|
||||||
static const int cDebugCtorLevel = 5; ///< Debug level on which Contructor / Destructor messages are printed
|
static const int cDebugCtorLevel = 5; ///< Debug level on which Contructor / Destructor messages are printed
|
||||||
static const uint LIMIT = 16; ///< The maximum amount of roadstops that are allowed at a single station
|
static const uint LIMIT = 16; ///< The maximum amount of roadstops that are allowed at a single station
|
||||||
static const uint MAX_BAY_COUNT = 2; ///< The maximum number of loading bays
|
static const uint MAX_BAY_COUNT = 2; ///< The maximum number of loading bays
|
||||||
|
@ -114,9 +104,9 @@ struct StationRect : public Rect {
|
||||||
|
|
||||||
struct Station : PoolItem<Station, StationID, &_Station_pool> {
|
struct Station : PoolItem<Station, StationID, &_Station_pool> {
|
||||||
public:
|
public:
|
||||||
RoadStop *GetPrimaryRoadStop(RoadStop::Type type) const
|
RoadStop *GetPrimaryRoadStop(RoadStopType type) const
|
||||||
{
|
{
|
||||||
return type == RoadStop::BUS ? bus_stops : truck_stops;
|
return type == ROADSTOP_BUS ? bus_stops : truck_stops;
|
||||||
}
|
}
|
||||||
|
|
||||||
RoadStop *GetPrimaryRoadStop(const Vehicle *v) const;
|
RoadStop *GetPrimaryRoadStop(const Vehicle *v) const;
|
||||||
|
@ -200,16 +190,6 @@ public:
|
||||||
inline bool IsValid() const { return this->xy != 0; }
|
inline bool IsValid() const { return this->xy != 0; }
|
||||||
};
|
};
|
||||||
|
|
||||||
void ModifyStationRatingAround(TileIndex tile, PlayerID owner, int amount, uint radius);
|
|
||||||
|
|
||||||
/** A set of stations (\c const \c Station* ) */
|
|
||||||
typedef std::set<Station*> StationSet;
|
|
||||||
|
|
||||||
StationSet FindStationsAroundIndustryTile(TileIndex tile, int w, int h);
|
|
||||||
|
|
||||||
void ShowStationViewWindow(StationID station);
|
|
||||||
void UpdateAllStationVirtCoord();
|
|
||||||
|
|
||||||
static inline StationID GetMaxStationIndex()
|
static inline StationID GetMaxStationIndex()
|
||||||
{
|
{
|
||||||
/* TODO - This isn't the real content of the function, but
|
/* TODO - This isn't the real content of the function, but
|
||||||
|
@ -241,22 +221,4 @@ static inline bool IsValidStationID(StationID index)
|
||||||
|
|
||||||
/* End of stuff for ROADSTOPS */
|
/* End of stuff for ROADSTOPS */
|
||||||
|
|
||||||
|
#endif /* STATION_BASE_H */
|
||||||
void AfterLoadStations();
|
|
||||||
void GetProductionAroundTiles(AcceptedCargo produced, TileIndex tile, int w, int h, int rad);
|
|
||||||
void GetAcceptanceAroundTiles(AcceptedCargo accepts, TileIndex tile, int w, int h, int rad);
|
|
||||||
|
|
||||||
|
|
||||||
const DrawTileSprites *GetStationTileLayout(StationType st, byte gfx);
|
|
||||||
void StationPickerDrawSprite(int x, int y, StationType st, RailType railtype, RoadType roadtype, int image);
|
|
||||||
|
|
||||||
RoadStop * GetRoadStopByTile(TileIndex tile, RoadStop::Type type);
|
|
||||||
uint GetNumRoadStops(const Station* st, RoadStop::Type type);
|
|
||||||
RoadStop * AllocateRoadStop();
|
|
||||||
void ClearSlot(Vehicle *v);
|
|
||||||
|
|
||||||
bool HasStationInUse(StationID station, PlayerID player);
|
|
||||||
|
|
||||||
void DeleteOilRig(TileIndex t);
|
|
||||||
|
|
||||||
#endif /* STATION_H */
|
|
|
@ -11,7 +11,6 @@
|
||||||
#include "tile_cmd.h"
|
#include "tile_cmd.h"
|
||||||
#include "landscape.h"
|
#include "landscape.h"
|
||||||
#include "station_map.h"
|
#include "station_map.h"
|
||||||
#include "station.h"
|
|
||||||
#include "viewport_func.h"
|
#include "viewport_func.h"
|
||||||
#include "command_func.h"
|
#include "command_func.h"
|
||||||
#include "town.h"
|
#include "town.h"
|
||||||
|
@ -71,7 +70,7 @@ bool IsHangar(TileIndex t)
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
RoadStop* GetRoadStopByTile(TileIndex tile, RoadStop::Type type)
|
RoadStop* GetRoadStopByTile(TileIndex tile, RoadStopType type)
|
||||||
{
|
{
|
||||||
const Station* st = GetStationByTile(tile);
|
const Station* st = GetStationByTile(tile);
|
||||||
|
|
||||||
|
@ -82,7 +81,7 @@ RoadStop* GetRoadStopByTile(TileIndex tile, RoadStop::Type type)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static uint GetNumRoadStopsInStation(const Station* st, RoadStop::Type type)
|
static uint GetNumRoadStopsInStation(const Station* st, RoadStopType type)
|
||||||
{
|
{
|
||||||
uint num = 0;
|
uint num = 0;
|
||||||
|
|
||||||
|
@ -1298,7 +1297,7 @@ static CommandCost RemoveRailroadStation(Station *st, TileIndex tile, uint32 fla
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param truck_station Determines whether a stop is RoadStop::BUS or RoadStop::TRUCK
|
* @param truck_station Determines whether a stop is ROADSTOP_BUS or ROADSTOP_TRUCK
|
||||||
* @param st The Station to do the whole procedure for
|
* @param st The Station to do the whole procedure for
|
||||||
* @return a pointer to where to link a new RoadStop*
|
* @return a pointer to where to link a new RoadStop*
|
||||||
*/
|
*/
|
||||||
|
@ -1397,7 +1396,7 @@ CommandCost CmdBuildRoadStop(TileIndex tile, uint32 flags, uint32 p1, uint32 p2)
|
||||||
AutoPtrT<RoadStop> rs_auto_delete(road_stop);
|
AutoPtrT<RoadStop> rs_auto_delete(road_stop);
|
||||||
|
|
||||||
if (st != NULL &&
|
if (st != NULL &&
|
||||||
GetNumRoadStopsInStation(st, RoadStop::BUS) + GetNumRoadStopsInStation(st, RoadStop::TRUCK) >= RoadStop::LIMIT) {
|
GetNumRoadStopsInStation(st, ROADSTOP_BUS) + GetNumRoadStopsInStation(st, ROADSTOP_TRUCK) >= RoadStop::LIMIT) {
|
||||||
return_cmd_error(type ? STR_TOO_MANY_TRUCK_STOPS : STR_TOO_MANY_BUS_STOPS);
|
return_cmd_error(type ? STR_TOO_MANY_TRUCK_STOPS : STR_TOO_MANY_BUS_STOPS);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1442,7 +1441,7 @@ CommandCost CmdBuildRoadStop(TileIndex tile, uint32 flags, uint32 p1, uint32 p2)
|
||||||
|
|
||||||
st->rect.BeforeAddTile(tile, StationRect::ADD_TRY);
|
st->rect.BeforeAddTile(tile, StationRect::ADD_TRY);
|
||||||
|
|
||||||
RoadStop::Type rs_type = type ? RoadStop::TRUCK : RoadStop::BUS;
|
RoadStopType rs_type = type ? ROADSTOP_TRUCK : ROADSTOP_BUS;
|
||||||
if (is_drive_through) {
|
if (is_drive_through) {
|
||||||
MakeDriveThroughRoadStop(tile, st->owner, st->index, rs_type, rts, (Axis)p1, town_owned_road);
|
MakeDriveThroughRoadStop(tile, st->owner, st->index, rs_type, rts, (Axis)p1, town_owned_road);
|
||||||
} else {
|
} else {
|
||||||
|
@ -1488,10 +1487,10 @@ static CommandCost RemoveRoadStop(Station *st, uint32 flags, TileIndex tile)
|
||||||
RoadStop *cur_stop;
|
RoadStop *cur_stop;
|
||||||
if (is_truck) { // truck stop
|
if (is_truck) { // truck stop
|
||||||
primary_stop = &st->truck_stops;
|
primary_stop = &st->truck_stops;
|
||||||
cur_stop = GetRoadStopByTile(tile, RoadStop::TRUCK);
|
cur_stop = GetRoadStopByTile(tile, ROADSTOP_TRUCK);
|
||||||
} else {
|
} else {
|
||||||
primary_stop = &st->bus_stops;
|
primary_stop = &st->bus_stops;
|
||||||
cur_stop = GetRoadStopByTile(tile, RoadStop::BUS);
|
cur_stop = GetRoadStopByTile(tile, ROADSTOP_BUS);
|
||||||
}
|
}
|
||||||
|
|
||||||
assert(cur_stop != NULL);
|
assert(cur_stop != NULL);
|
||||||
|
@ -2440,7 +2439,7 @@ static VehicleEnterTileStatus VehicleEnter_Station(Vehicle *v, TileIndex tile, i
|
||||||
if (!rs->IsFreeBay(side)) return VETSB_CANNOT_ENTER;
|
if (!rs->IsFreeBay(side)) return VETSB_CANNOT_ENTER;
|
||||||
|
|
||||||
/* Check if the vehicle is stopping at this road stop */
|
/* Check if the vehicle is stopping at this road stop */
|
||||||
if (GetRoadStopType(tile) == (IsCargoInClass(v->cargo_type, CC_PASSENGERS) ? RoadStop::BUS : RoadStop::TRUCK) &&
|
if (GetRoadStopType(tile) == (IsCargoInClass(v->cargo_type, CC_PASSENGERS) ? ROADSTOP_BUS : ROADSTOP_TRUCK) &&
|
||||||
v->current_order.dest == GetStationIndex(tile)) {
|
v->current_order.dest == GetStationIndex(tile)) {
|
||||||
SetBit(v->u.road.state, RVS_IS_STOPPING);
|
SetBit(v->u.road.state, RVS_IS_STOPPING);
|
||||||
rs->AllocateDriveThroughBay(side);
|
rs->AllocateDriveThroughBay(side);
|
||||||
|
@ -2913,7 +2912,7 @@ static void ChangeTileOwner_Station(TileIndex tile, PlayerID old_player, PlayerI
|
||||||
} else {
|
} else {
|
||||||
if (IsDriveThroughStopTile(tile)) {
|
if (IsDriveThroughStopTile(tile)) {
|
||||||
/* Remove the drive-through road stop */
|
/* Remove the drive-through road stop */
|
||||||
DoCommand(tile, 0, (GetStationType(tile) == STATION_TRUCK) ? RoadStop::TRUCK : RoadStop::BUS, DC_EXEC | DC_BANKRUPT, CMD_REMOVE_ROAD_STOP);
|
DoCommand(tile, 0, (GetStationType(tile) == STATION_TRUCK) ? ROADSTOP_TRUCK : ROADSTOP_BUS, DC_EXEC | DC_BANKRUPT, CMD_REMOVE_ROAD_STOP);
|
||||||
assert(IsTileType(tile, MP_ROAD));
|
assert(IsTileType(tile, MP_ROAD));
|
||||||
/* Change owner of tile and all roadtypes */
|
/* Change owner of tile and all roadtypes */
|
||||||
ChangeTileOwner(tile, old_player, new_player);
|
ChangeTileOwner(tile, old_player, new_player);
|
||||||
|
|
|
@ -0,0 +1,43 @@
|
||||||
|
/* $Id$ */
|
||||||
|
|
||||||
|
/** @file station_func.h Functions related to stations. */
|
||||||
|
|
||||||
|
#ifndef STATION_FUNC_H
|
||||||
|
#define STATION_FUNC_H
|
||||||
|
|
||||||
|
#include "station_type.h"
|
||||||
|
#include "sprite.h"
|
||||||
|
#include "road_type.h"
|
||||||
|
#include "tile_type.h"
|
||||||
|
#include "cargo_type.h"
|
||||||
|
#include "vehicle_type.h"
|
||||||
|
#include <set>
|
||||||
|
|
||||||
|
void ModifyStationRatingAround(TileIndex tile, PlayerID owner, int amount, uint radius);
|
||||||
|
|
||||||
|
/** A set of stations (\c const \c Station* ) */
|
||||||
|
typedef std::set<Station*> StationSet;
|
||||||
|
|
||||||
|
StationSet FindStationsAroundIndustryTile(TileIndex tile, int w, int h);
|
||||||
|
|
||||||
|
void ShowStationViewWindow(StationID station);
|
||||||
|
void UpdateAllStationVirtCoord();
|
||||||
|
|
||||||
|
void AfterLoadStations();
|
||||||
|
void GetProductionAroundTiles(AcceptedCargo produced, TileIndex tile, int w, int h, int rad);
|
||||||
|
void GetAcceptanceAroundTiles(AcceptedCargo accepts, TileIndex tile, int w, int h, int rad);
|
||||||
|
|
||||||
|
const DrawTileSprites *GetStationTileLayout(StationType st, byte gfx);
|
||||||
|
void StationPickerDrawSprite(int x, int y, StationType st, RailType railtype, RoadType roadtype, int image);
|
||||||
|
|
||||||
|
bool HasStationInUse(StationID station, PlayerID player);
|
||||||
|
|
||||||
|
RoadStop * GetRoadStopByTile(TileIndex tile, RoadStopType type);
|
||||||
|
uint GetNumRoadStops(const Station* st, RoadStopType type);
|
||||||
|
RoadStop * AllocateRoadStop();
|
||||||
|
|
||||||
|
void ClearSlot(Vehicle *v);
|
||||||
|
|
||||||
|
void DeleteOilRig(TileIndex t);
|
||||||
|
|
||||||
|
#endif /* STATION_FUNC_H */
|
|
@ -8,7 +8,7 @@
|
||||||
#include "gui.h"
|
#include "gui.h"
|
||||||
#include "window_gui.h"
|
#include "window_gui.h"
|
||||||
#include "textbuf_gui.h"
|
#include "textbuf_gui.h"
|
||||||
#include "station.h"
|
#include "station_base.h"
|
||||||
#include "player_func.h"
|
#include "player_func.h"
|
||||||
#include "economy_func.h"
|
#include "economy_func.h"
|
||||||
#include "town.h"
|
#include "town.h"
|
||||||
|
@ -17,7 +17,7 @@
|
||||||
#include "vehicle_gui.h"
|
#include "vehicle_gui.h"
|
||||||
#include "cargotype.h"
|
#include "cargotype.h"
|
||||||
#include "station_gui.h"
|
#include "station_gui.h"
|
||||||
#include "station.h"
|
#include "station_func.h"
|
||||||
#include "strings_func.h"
|
#include "strings_func.h"
|
||||||
#include "core/alloc_func.hpp"
|
#include "core/alloc_func.hpp"
|
||||||
#include "window_func.h"
|
#include "window_func.h"
|
||||||
|
|
|
@ -8,8 +8,10 @@
|
||||||
#include "rail_map.h"
|
#include "rail_map.h"
|
||||||
#include "road_map.h"
|
#include "road_map.h"
|
||||||
#include "water_map.h"
|
#include "water_map.h"
|
||||||
#include "station.h"
|
#include "station_func.h"
|
||||||
|
#include "station_base.h"
|
||||||
#include "rail.h"
|
#include "rail.h"
|
||||||
|
#include "newgrf_station.h"
|
||||||
|
|
||||||
typedef byte StationGfx;
|
typedef byte StationGfx;
|
||||||
|
|
||||||
|
@ -49,10 +51,10 @@ static inline StationType GetStationType(TileIndex t)
|
||||||
return (StationType)GB(_m[t].m6, 3, 3);
|
return (StationType)GB(_m[t].m6, 3, 3);
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline RoadStop::Type GetRoadStopType(TileIndex t)
|
static inline RoadStopType GetRoadStopType(TileIndex t)
|
||||||
{
|
{
|
||||||
assert(GetStationType(t) == STATION_TRUCK || GetStationType(t) == STATION_BUS);
|
assert(GetStationType(t) == STATION_TRUCK || GetStationType(t) == STATION_BUS);
|
||||||
return GetStationType(t) == STATION_TRUCK ? RoadStop::TRUCK : RoadStop::BUS;
|
return GetStationType(t) == STATION_TRUCK ? ROADSTOP_TRUCK : ROADSTOP_BUS;
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline StationGfx GetStationGfx(TileIndex t)
|
static inline StationGfx GetStationGfx(TileIndex t)
|
||||||
|
@ -260,15 +262,15 @@ static inline void MakeRailStation(TileIndex t, Owner o, StationID sid, Axis a,
|
||||||
SetRailType(t, rt);
|
SetRailType(t, rt);
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline void MakeRoadStop(TileIndex t, Owner o, StationID sid, RoadStop::Type rst, RoadTypes rt, DiagDirection d)
|
static inline void MakeRoadStop(TileIndex t, Owner o, StationID sid, RoadStopType rst, RoadTypes rt, DiagDirection d)
|
||||||
{
|
{
|
||||||
MakeStation(t, o, sid, (rst == RoadStop::BUS ? STATION_BUS : STATION_TRUCK), d);
|
MakeStation(t, o, sid, (rst == ROADSTOP_BUS ? STATION_BUS : STATION_TRUCK), d);
|
||||||
SetRoadTypes(t, rt);
|
SetRoadTypes(t, rt);
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline void MakeDriveThroughRoadStop(TileIndex t, Owner o, StationID sid, RoadStop::Type rst, RoadTypes rt, Axis a, bool on_town_road)
|
static inline void MakeDriveThroughRoadStop(TileIndex t, Owner o, StationID sid, RoadStopType rst, RoadTypes rt, Axis a, bool on_town_road)
|
||||||
{
|
{
|
||||||
MakeStation(t, o, sid, (rst == RoadStop::BUS ? STATION_BUS : STATION_TRUCK), GFX_TRUCK_BUS_DRIVETHROUGH_OFFSET + a);
|
MakeStation(t, o, sid, (rst == ROADSTOP_BUS ? STATION_BUS : STATION_TRUCK), GFX_TRUCK_BUS_DRIVETHROUGH_OFFSET + a);
|
||||||
SB(_m[t].m6, 2, 1, on_town_road);
|
SB(_m[t].m6, 2, 1, on_town_road);
|
||||||
SetRoadTypes(t, rt);
|
SetRoadTypes(t, rt);
|
||||||
}
|
}
|
||||||
|
|
|
@ -23,6 +23,12 @@ enum StationType {
|
||||||
STATION_BUOY
|
STATION_BUOY
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/** Types of RoadStops */
|
||||||
|
enum RoadStopType {
|
||||||
|
ROADSTOP_BUS, ///< A standard stop for buses
|
||||||
|
ROADSTOP_TRUCK ///< A standard stop for trucks
|
||||||
|
};
|
||||||
|
|
||||||
enum {
|
enum {
|
||||||
FACIL_TRAIN = 0x01,
|
FACIL_TRAIN = 0x01,
|
||||||
FACIL_TRUCK_STOP = 0x02,
|
FACIL_TRUCK_STOP = 0x02,
|
||||||
|
|
|
@ -6,7 +6,7 @@
|
||||||
#include "openttd.h"
|
#include "openttd.h"
|
||||||
#include "currency.h"
|
#include "currency.h"
|
||||||
#include "namegen_func.h"
|
#include "namegen_func.h"
|
||||||
#include "station.h"
|
#include "station_base.h"
|
||||||
#include "town.h"
|
#include "town.h"
|
||||||
#include "screenshot.h"
|
#include "screenshot.h"
|
||||||
#include "waypoint.h"
|
#include "waypoint.h"
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
|
|
||||||
#include "stdafx.h"
|
#include "stdafx.h"
|
||||||
#include "openttd.h"
|
#include "openttd.h"
|
||||||
#include "station.h"
|
#include "station_base.h"
|
||||||
#include "industry.h"
|
#include "industry.h"
|
||||||
#include "town.h"
|
#include "town.h"
|
||||||
#include "economy_func.h"
|
#include "economy_func.h"
|
||||||
|
|
|
@ -15,7 +15,7 @@
|
||||||
#include "town.h"
|
#include "town.h"
|
||||||
#include "command_func.h"
|
#include "command_func.h"
|
||||||
#include "industry.h"
|
#include "industry.h"
|
||||||
#include "station.h"
|
#include "station_base.h"
|
||||||
#include "player_base.h"
|
#include "player_base.h"
|
||||||
#include "news_func.h"
|
#include "news_func.h"
|
||||||
#include "saveload.h"
|
#include "saveload.h"
|
||||||
|
|
|
@ -16,7 +16,7 @@
|
||||||
#include "command_func.h"
|
#include "command_func.h"
|
||||||
#include "pathfind.h"
|
#include "pathfind.h"
|
||||||
#include "npf.h"
|
#include "npf.h"
|
||||||
#include "station.h"
|
#include "station_base.h"
|
||||||
#include "news_func.h"
|
#include "news_func.h"
|
||||||
#include "engine.h"
|
#include "engine.h"
|
||||||
#include "player_func.h"
|
#include "player_func.h"
|
||||||
|
|
|
@ -11,7 +11,6 @@
|
||||||
#include "player_func.h"
|
#include "player_func.h"
|
||||||
#include "player_base.h"
|
#include "player_base.h"
|
||||||
#include "gui.h"
|
#include "gui.h"
|
||||||
#include "station.h"
|
|
||||||
#include "town.h"
|
#include "town.h"
|
||||||
#include "sprite.h"
|
#include "sprite.h"
|
||||||
#include "bridge_map.h"
|
#include "bridge_map.h"
|
||||||
|
|
|
@ -21,7 +21,6 @@
|
||||||
#include "debug.h"
|
#include "debug.h"
|
||||||
#include "vehicle_gui.h"
|
#include "vehicle_gui.h"
|
||||||
#include "depot.h"
|
#include "depot.h"
|
||||||
#include "station.h"
|
|
||||||
#include "rail_type.h"
|
#include "rail_type.h"
|
||||||
#include "train.h"
|
#include "train.h"
|
||||||
#include "aircraft.h"
|
#include "aircraft.h"
|
||||||
|
|
|
@ -6,7 +6,6 @@
|
||||||
#include "openttd.h"
|
#include "openttd.h"
|
||||||
#include "debug.h"
|
#include "debug.h"
|
||||||
#include "player_func.h"
|
#include "player_func.h"
|
||||||
#include "station.h"
|
|
||||||
#include "engine.h"
|
#include "engine.h"
|
||||||
#include "gui.h"
|
#include "gui.h"
|
||||||
#include "window_gui.h"
|
#include "window_gui.h"
|
||||||
|
|
|
@ -10,7 +10,7 @@
|
||||||
#include "spritecache.h"
|
#include "spritecache.h"
|
||||||
#include "landscape.h"
|
#include "landscape.h"
|
||||||
#include "viewport_func.h"
|
#include "viewport_func.h"
|
||||||
#include "station.h"
|
#include "station_base.h"
|
||||||
#include "town.h"
|
#include "town.h"
|
||||||
#include "signs.h"
|
#include "signs.h"
|
||||||
#include "waypoint.h"
|
#include "waypoint.h"
|
||||||
|
@ -25,6 +25,7 @@
|
||||||
#include "vehicle_func.h"
|
#include "vehicle_func.h"
|
||||||
#include "player_func.h"
|
#include "player_func.h"
|
||||||
#include "settings_type.h"
|
#include "settings_type.h"
|
||||||
|
#include "station_func.h"
|
||||||
|
|
||||||
#include "table/sprites.h"
|
#include "table/sprites.h"
|
||||||
#include "table/strings.h"
|
#include "table/strings.h"
|
||||||
|
|
|
@ -35,6 +35,8 @@
|
||||||
#include "settings_type.h"
|
#include "settings_type.h"
|
||||||
#include "clear_map.h"
|
#include "clear_map.h"
|
||||||
#include "tree_map.h"
|
#include "tree_map.h"
|
||||||
|
#include "station_base.h"
|
||||||
|
#include "airport.h"
|
||||||
|
|
||||||
#include "table/sprites.h"
|
#include "table/sprites.h"
|
||||||
#include "table/strings.h"
|
#include "table/strings.h"
|
||||||
|
|
|
@ -12,7 +12,7 @@
|
||||||
#include "rail.h"
|
#include "rail.h"
|
||||||
#include "bridge_map.h"
|
#include "bridge_map.h"
|
||||||
#include "saveload.h"
|
#include "saveload.h"
|
||||||
#include "station.h"
|
#include "station_base.h"
|
||||||
#include "town.h"
|
#include "town.h"
|
||||||
#include "waypoint.h"
|
#include "waypoint.h"
|
||||||
#include "variables.h"
|
#include "variables.h"
|
||||||
|
|
|
@ -7,6 +7,7 @@
|
||||||
|
|
||||||
#include "../debug.h"
|
#include "../debug.h"
|
||||||
#include "../depot_type.h"
|
#include "../depot_type.h"
|
||||||
|
#include "../direction_type.h"
|
||||||
|
|
||||||
/** Finds the best path for given ship.
|
/** Finds the best path for given ship.
|
||||||
* @param v the ship that needs to find a path
|
* @param v the ship that needs to find a path
|
||||||
|
|
|
@ -14,7 +14,7 @@
|
||||||
#include "../bridge_map.h"
|
#include "../bridge_map.h"
|
||||||
#include "../tunnelbridge_map.h"
|
#include "../tunnelbridge_map.h"
|
||||||
#include "../bridge.h"
|
#include "../bridge.h"
|
||||||
#include "../station.h"
|
#include "../station_base.h"
|
||||||
#include "../station_map.h"
|
#include "../station_map.h"
|
||||||
#include "../tile_cmd.h"
|
#include "../tile_cmd.h"
|
||||||
#include "../landscape.h"
|
#include "../landscape.h"
|
||||||
|
|
Loading…
Reference in New Issue