Changeset - r8962:cfbdc736c8db
[Not reviewed]
src/ai/default/default.cpp
Show inline comments
 
@@ -16,7 +16,6 @@
 
#include "../../industry.h"
 
#include "../../pathfind.h"
 
#include "../../airport.h"
 
#include "../../depot.h"
 
#include "../../variables.h"
 
#include "../../bridge.h"
 
#include "../../date_func.h"
src/ai/trolly/pathfinder.cpp
Show inline comments
 
@@ -6,7 +6,6 @@
 
#include "../../debug.h"
 
#include "../../command_func.h"
 
#include "trolly.h"
 
#include "../../depot.h"
 
#include "../../tunnel_map.h"
 
#include "../../bridge.h"
 
#include "../../tunnelbridge_map.h"
src/ai/trolly/trolly.cpp
Show inline comments
 
@@ -24,12 +24,13 @@
 
#include "../../station_map.h"
 
#include "../../command_func.h"
 
#include "trolly.h"
 
#include "../../depot_base.h"
 
#include "../../town.h"
 
#include "../../industry.h"
 
#include "../../station_base.h"
 
#include "../../engine_func.h"
 
#include "../../gui.h"
 
#include "../../depot.h"
 
#include "../../depot_base.h"
 
#include "../../vehicle_base.h"
 
#include "../../vehicle_func.h"
 
#include "../../date_func.h"
src/aircraft_cmd.cpp
Show inline comments
 
@@ -10,7 +10,7 @@
 
#include "landscape.h"
 
#include "station_map.h"
 
#include "timetable.h"
 
#include "depot.h"
 
#include "depot_func.h"
 
#include "news_func.h"
 
#include "aircraft.h"
 
#include "airport.h"
src/aircraft_gui.cpp
Show inline comments
 
@@ -7,7 +7,6 @@
 
#include "aircraft.h"
 
#include "debug.h"
 
#include "gui.h"
 
#include "depot.h"
 
#include "vehicle_gui.h"
 
#include "newgrf_engine.h"
 
#include "strings_func.h"
src/airport_gui.cpp
Show inline comments
 
@@ -10,7 +10,6 @@
 
#include "terraform_gui.h"
 
#include "command_func.h"
 
#include "airport.h"
 
#include "depot.h"
 
#include "sound_func.h"
 
#include "window_func.h"
 
#include "settings_type.h"
 
@@ -18,6 +17,7 @@
 
#include "gfx_func.h"
 
#include "player_func.h"
 
#include "order_func.h"
 
#include "station_type.h"
 

	
 
#include "table/sprites.h"
 
#include "table/strings.h"
src/autoreplace_cmd.cpp
Show inline comments
 
@@ -8,7 +8,6 @@
 
#include "player_func.h"
 
#include "debug.h"
 
#include "vehicle_gui.h"
 
#include "depot.h"
 
#include "train.h"
 
#include "aircraft.h"
 
#include "cargotype.h"
src/autoslope.h
Show inline comments
 
@@ -5,9 +5,9 @@
 
#ifndef AUTOSLOPE_H
 
#define AUTOSLOPE_H
 

	
 
#include "depot.h"
 
#include "settings_type.h"
 
#include "player_func.h"
 
#include "depot_func.h"
 

	
 
/**
 
 * Autoslope check for tiles with an entrance on an edge.
src/build_vehicle_gui.cpp
Show inline comments
 
@@ -14,7 +14,6 @@
 
#include "textbuf_gui.h"
 
#include "command_func.h"
 
#include "player_func.h"
 
#include "depot.h"
 
#include "airport.h"
 
#include "vehicle_gui.h"
 
#include "newgrf_engine.h"
src/depot.cpp
Show inline comments
 
@@ -4,7 +4,7 @@
 

	
 
#include "stdafx.h"
 
#include "openttd.h"
 
#include "depot.h"
 
#include "depot_base.h"
 
#include "landscape.h"
 
#include "saveload.h"
 
#include "order_func.h"
src/depot.h
Show inline comments
 
deleted file
src/depot_base.h
Show inline comments
 
new file 100644
 
/* $Id$ */
 

	
 
/** @file depot.h Base for all depots (except hangars) */
 

	
 
#ifndef DEPOT_BASE_H
 
#define DEPOT_BASE_H
 

	
 
#include "tile_type.h"
 
#include "depot_type.h"
 
#include "oldpool.h"
 
#include "town_type.h"
 

	
 
DECLARE_OLD_POOL(Depot, Depot, 3, 8000)
 

	
 
struct Depot : PoolItem<Depot, DepotID, &_Depot_pool> {
 
	TileIndex xy;
 
	TownID town_index;
 

	
 
	Depot(TileIndex xy = 0) : xy(xy) {}
 
	~Depot();
 

	
 
	inline bool IsValid() const { return this->xy != 0; }
 
};
 

	
 
static inline bool IsValidDepotID(DepotID index)
 
{
 
	return index < GetDepotPoolSize() && GetDepot(index)->IsValid();
 
}
 

	
 
Depot *GetDepotByTile(TileIndex tile);
 

	
 
#define FOR_ALL_DEPOTS_FROM(d, start) for (d = GetDepot(start); d != NULL; d = (d->index + 1U < GetDepotPoolSize()) ? GetDepot(d->index + 1U) : NULL) if (d->IsValid())
 
#define FOR_ALL_DEPOTS(d) FOR_ALL_DEPOTS_FROM(d, 0)
 

	
 
#endif /* DEPOT_BASE_H */
src/depot_func.h
Show inline comments
 
new file 100644
 
/* $Id$ */
 

	
 
/** @file depot_func.h Functions related to depots. */
 

	
 
#ifndef DEPOT_FUNC_H
 
#define DEPOT_FUNC_H
 

	
 
#include "depot_type.h"
 
#include "tile_type.h"
 
#include "vehicle_type.h"
 
#include "direction_type.h"
 
#include "slope_type.h"
 

	
 
void ShowDepotWindow(TileIndex tile, VehicleType type);
 
void InitializeDepots();
 

	
 
void DeleteDepotHighlightOfVehicle(const Vehicle *v);
 

	
 
/**
 
 * Find out if the slope of the tile is suitable to build a depot of given direction
 
 * @param direction The direction in which the depot's exit points
 
 * @param tileh The slope of the tile in question
 
 * @return true if the construction is possible
 

	
 
 * This is checked by the ugly 0x4C >> direction magic, which does the following:
 
 * 0x4C is 0100 1100 and tileh has only bits 0..3 set (steep tiles are ruled out)
 
 * So: for direction (only the significant bits are shown)<p>
 
 * 00 (exit towards NE) we need either bit 2 or 3 set in tileh: 0x4C >> 0 = 1100<p>
 
 * 01 (exit towards SE) we need either bit 1 or 2 set in tileh: 0x4C >> 1 = 0110<p>
 
 * 02 (exit towards SW) we need either bit 0 or 1 set in tileh: 0x4C >> 2 = 0011<p>
 
 * 03 (exit towards NW) we need either bit 0 or 4 set in tileh: 0x4C >> 3 = 1001<p>
 
 * So ((0x4C >> direction) & tileh) determines whether the depot can be built on the current tileh
 
 */
 
static inline bool CanBuildDepotByTileh(DiagDirection direction, Slope tileh)
 
{
 
	return ((0x4C >> direction) & tileh) != 0;
 
}
 

	
 
#endif /* DEPOT_FUNC_H */
src/depot_gui.cpp
Show inline comments
 
@@ -13,7 +13,7 @@
 
#include "viewport_func.h"
 
#include "gfx_func.h"
 
#include "command_func.h"
 
#include "depot.h"
 
#include "depot_base.h"
 
#include "vehicle_gui.h"
 
#include "station_map.h"
 
#include "newgrf_engine.h"
 
@@ -23,6 +23,7 @@
 
#include "vehicle_func.h"
 
#include "player_func.h"
 
#include "order_func.h"
 
#include "depot_base.h"
 

	
 
#include "table/strings.h"
 
#include "table/sprites.h"
src/depot_map.h
Show inline comments
 
new file 100644
 
/* $Id$ */
 

	
 
/** @file depot_map.h Map related accessors for depots. */
 

	
 
#ifndef DEPOT_MAP_H
 
#define DEPOT_MAP_H
 

	
 
#include "road_map.h"
 
#include "rail_map.h"
 
#include "water_map.h"
 
#include "station_map.h"
 

	
 
/**
 
 * Check if a tile is a depot and it is a depot of the given type.
 
 */
 
static inline bool IsDepotTypeTile(TileIndex tile, TransportType type)
 
{
 
	switch (type) {
 
		default: NOT_REACHED();
 
		case TRANSPORT_RAIL:
 
			return IsRailDepotTile(tile);
 

	
 
		case TRANSPORT_ROAD:
 
			return IsRoadDepotTile(tile);
 

	
 
		case TRANSPORT_WATER:
 
			return IsShipDepotTile(tile);
 
	}
 
}
 

	
 
/**
 
 * Is the given tile a tile with a depot on it?
 
 * @param tile the tile to check
 
 * @return true if and only if there is a depot on the tile.
 
 */
 
static inline bool IsDepotTile(TileIndex tile)
 
{
 
	return IsRailDepotTile(tile) || IsRoadDepotTile(tile) || IsShipDepotTile(tile) || IsHangarTile(tile);
 
}
 

	
 
#endif /* DEPOT_MAP_H */
src/group_gui.cpp
Show inline comments
 
@@ -9,7 +9,6 @@
 
#include "textbuf_gui.h"
 
#include "command_func.h"
 
#include "vehicle_gui.h"
 
#include "depot.h"
 
#include "train.h"
 
#include "group.h"
 
#include "debug.h"
src/npf.cpp
Show inline comments
 
@@ -14,7 +14,8 @@
 
#include "pathfind.h"
 
#include "station_base.h"
 
#include "station_map.h"
 
#include "depot.h"
 
#include "depot_base.h"
 
#include "depot_map.h"
 
#include "tunnel_map.h"
 
#include "network/network.h"
 
#include "water_map.h"
src/oldloader.cpp
Show inline comments
 
@@ -15,7 +15,7 @@
 
#include "train.h"
 
#include "signs_base.h"
 
#include "debug.h"
 
#include "depot.h"
 
#include "depot_base.h"
 
#include "newgrf_config.h"
 
#include "ai/ai.h"
 
#include "ai/default/default.h"
src/openttd.cpp
Show inline comments
 
@@ -46,7 +46,6 @@
 
#include "network/network.h"
 
#include "signs_base.h"
 
#include "signs_func.h"
 
#include "depot.h"
 
#include "waypoint.h"
 
#include "ai/ai.h"
 
#include "train.h"
src/order_cmd.cpp
Show inline comments
 
@@ -7,7 +7,7 @@
 
#include "order_base.h"
 
#include "order_func.h"
 
#include "airport.h"
 
#include "depot.h"
 
#include "order_base.h"
 
#include "waypoint.h"
 
#include "command_func.h"
 
#include "player_func.h"
 
@@ -26,6 +26,7 @@
 
#include "timetable.h"
 
#include "vehicle_func.h"
 
#include "oldpool_func.h"
 
#include "depot_base.h"
 

	
 
#include "table/strings.h"
 

	
src/order_gui.cpp
Show inline comments
 
@@ -13,7 +13,7 @@
 
#include "command_func.h"
 
#include "viewport_func.h"
 
#include "gfx_func.h"
 
#include "depot.h"
 
#include "depot_base.h"
 
#include "waypoint.h"
 
#include "train.h"
 
#include "water_map.h"
 
@@ -29,6 +29,7 @@
 
#include "widgets/dropdown_func.h"
 
#include "textbuf_gui.h"
 
#include "string_func.h"
 
#include "depot_base.h"
 

	
 
#include "table/sprites.h"
 
#include "table/strings.h"
src/pathfind.cpp
Show inline comments
 
@@ -6,7 +6,6 @@
 
#include "openttd.h"
 
#include "bridge_map.h"
 
#include "station_map.h"
 
#include "depot.h"
 
#include "tile_cmd.h"
 
#include "landscape.h"
 
#include "pathfind.h"
 
@@ -14,7 +13,6 @@
 
#include "debug.h"
 
#include "tunnel_map.h"
 
#include "settings_type.h"
 
#include "depot.h"
 
#include "tunnelbridge_map.h"
 
#include "core/random_func.hpp"
 
#include "core/alloc_type.hpp"
src/rail_cmd.cpp
Show inline comments
 
@@ -20,7 +20,8 @@
 
#include "engine_func.h"
 
#include "town.h"
 
#include "sprite.h"
 
#include "depot.h"
 
#include "depot_base.h"
 
#include "depot_func.h"
 
#include "waypoint.h"
 
#include "rail.h"
 
#include "newgrf.h"
 
@@ -40,6 +41,8 @@
 
#include "sound_func.h"
 
#include "signal_func.h"
 
#include "tunnelbridge.h"
 
#include "station_map.h"
 
#include "water_map.h"
 

	
 
#include "table/sprites.h"
 
#include "table/strings.h"
src/road_cmd.cpp
Show inline comments
 
@@ -18,7 +18,8 @@
 
#include "command_func.h"
 
#include "town.h"
 
#include "yapf/yapf.h"
 
#include "depot.h"
 
#include "depot_base.h"
 
#include "depot_func.h"
 
#include "newgrf.h"
 
#include "station_map.h"
 
#include "tunnel_map.h"
src/road_map.cpp
Show inline comments
 
@@ -9,7 +9,6 @@
 
#include "road_map.h"
 
#include "tunnel_map.h"
 
#include "station_map.h"
 
#include "depot.h"
 
#include "tunnelbridge_map.h"
 

	
 

	
src/roadveh_cmd.cpp
Show inline comments
 
@@ -17,7 +17,6 @@
 
#include "npf.h"
 
#include "player_func.h"
 
#include "player_base.h"
 
#include "depot.h"
 
#include "bridge.h"
 
#include "tunnel_map.h"
 
#include "bridge_map.h"
 
@@ -41,6 +40,8 @@
 
#include "gfx_func.h"
 
#include "settings_type.h"
 
#include "order_func.h"
 
#include "depot_base.h"
 
#include "depot_func.h"
 

	
 
#include "table/strings.h"
 

	
src/roadveh_gui.cpp
Show inline comments
 
@@ -11,7 +11,6 @@
 
#include "viewport_func.h"
 
#include "gfx_func.h"
 
#include "command_func.h"
 
#include "depot.h"
 
#include "vehicle_gui.h"
 
#include "newgrf_engine.h"
 
#include "strings_func.h"
src/ship_cmd.cpp
Show inline comments
 
@@ -17,7 +17,8 @@
 
#include "player_func.h"
 
#include "player_base.h"
 
#include "npf.h"
 
#include "depot.h"
 
#include "depot_base.h"
 
#include "depot_func.h"
 
#include "vehicle_gui.h"
 
#include "newgrf_engine.h"
 
#include "water_map.h"
src/ship_gui.cpp
Show inline comments
 
@@ -10,7 +10,6 @@
 
#include "window_gui.h"
 
#include "viewport_func.h"
 
#include "gfx_func.h"
 
#include "depot.h"
 
#include "vehicle_gui.h"
 
#include "newgrf_engine.h"
 
#include "strings_func.h"
src/station.cpp
Show inline comments
 
@@ -13,7 +13,6 @@
 
#include "player_func.h"
 
#include "airport.h"
 
#include "sprite.h"
 
#include "depot.h"
 
#include "train.h"
 
#include "water_map.h"
 
#include "industry_map.h"
src/station_cmd.cpp
Show inline comments
 
@@ -18,7 +18,6 @@
 
#include "saveload.h"
 
#include "airport.h"
 
#include "sprite.h"
 
#include "depot.h"
 
#include "train.h"
 
#include "roadveh.h"
 
#include "water_map.h"
src/timetable_gui.cpp
Show inline comments
 
@@ -10,7 +10,6 @@
 
#include "window_gui.h"
 
#include "textbuf_gui.h"
 
#include "cargotype.h"
 
#include "depot.h"
 
#include "strings_func.h"
 
#include "vehicle_base.h"
 
#include "string_func.h"
src/town_cmd.cpp
Show inline comments
 
@@ -41,6 +41,9 @@
 
#include "string_func.h"
 
#include "newgrf_cargo.h"
 
#include "oldpool_func.h"
 
#include "sprite.h"
 
#include "economy_func.h"
 
#include "station_func.h"
 

	
 
#include "table/strings.h"
 
#include "table/sprites.h"
src/train_cmd.cpp
Show inline comments
 
@@ -20,7 +20,8 @@
 
#include "engine_func.h"
 
#include "player_func.h"
 
#include "player_base.h"
 
#include "depot.h"
 
#include "depot_base.h"
 
#include "depot_func.h"
 
#include "waypoint.h"
 
#include "vehicle_gui.h"
 
#include "train.h"
src/train_gui.cpp
Show inline comments
 
@@ -10,7 +10,6 @@
 
#include "gfx_func.h"
 
#include "command_func.h"
 
#include "vehicle_gui.h"
 
#include "depot.h"
 
#include "train.h"
 
#include "newgrf_engine.h"
 
#include "strings_func.h"
src/tunnelbridge_cmd.cpp
Show inline comments
 
@@ -35,6 +35,8 @@
 
#include "tunnelbridge.h"
 
#include "player_base.h"
 
#include "engine_func.h"
 
#include "economy_func.h"
 
#include "rail.h"
 

	
 
#include "table/sprites.h"
 
#include "table/strings.h"
src/unmovable_cmd.cpp
Show inline comments
 
@@ -24,6 +24,8 @@
 
#include "window_func.h"
 
#include "vehicle_func.h"
 
#include "player_gui.h"
 
#include "station_type.h"
 
#include "economy_func.h"
 

	
 
#include "table/strings.h"
 
#include "table/sprites.h"
src/vehicle.cpp
Show inline comments
 
@@ -19,7 +19,6 @@
 
#include "player_func.h"
 
#include "debug.h"
 
#include "vehicle_gui.h"
 
#include "depot.h"
 
#include "rail_type.h"
 
#include "train.h"
 
#include "aircraft.h"
 
@@ -47,6 +46,7 @@
 
#include "string_func.h"
 
#include "settings_type.h"
 
#include "oldpool_func.h"
 
#include "depot_map.h"
 

	
 
#include "table/sprites.h"
 
#include "table/strings.h"
src/vehicle_gui.cpp
Show inline comments
 
@@ -21,7 +21,7 @@
 
#include "ship.h"
 
#include "aircraft.h"
 
#include "roadveh.h"
 
#include "depot.h"
 
#include "depot_base.h"
 
#include "cargotype.h"
 
#include "group.h"
 
#include "group_gui.h"
 
@@ -35,6 +35,7 @@
 
#include "settings_type.h"
 
#include "widgets/dropdown_func.h"
 
#include "order_func.h"
 
#include "depot_base.h"
 

	
 
#include "table/sprites.h"
 
#include "table/strings.h"
src/water_cmd.cpp
Show inline comments
 
@@ -14,7 +14,8 @@
 
#include "command_func.h"
 
#include "town.h"
 
#include "news_func.h"
 
#include "depot.h"
 
#include "depot_base.h"
 
#include "depot_func.h"
 
#include "vehicle_gui.h"
 
#include "train.h"
 
#include "roadveh.h"
src/waypoint.h
Show inline comments
 
@@ -10,6 +10,7 @@
 
#include "rail_map.h"
 
#include "command_type.h"
 
#include "station_type.h"
 
#include "town_type.h"
 

	
 
DECLARE_OLD_POOL(Waypoint, Waypoint, 3, 8000)
 

	
src/yapf/follow_track.hpp
Show inline comments
 
@@ -6,7 +6,7 @@
 
#define  FOLLOW_TRACK_HPP
 

	
 
#include "yapf.hpp"
 

	
 
#include "../depot_map.h"
 

	
 
/** Track follower helper template class (can serve pathfinders and vehicle
 
 *  controllers). See 6 different typedefs below for 3 different transport
src/yapf/yapf.hpp
Show inline comments
 
@@ -8,7 +8,6 @@
 
#include "track_dir.hpp"
 

	
 
#include "../vehicle_base.h"
 
#include "../depot.h"
 
#include "../road_map.h"
 
#include "../tunnel_map.h"
 
#include "../bridge_map.h"
src/yapf/yapf_road.cpp
Show inline comments
 
@@ -3,6 +3,7 @@
 
/** @file yapf_road.cpp */
 

	
 
#include "../stdafx.h"
 
#include "../depot_base.h"
 

	
 
#include "yapf.hpp"
 
#include "yapf_node_road.hpp"
0 comments (0 inline, 0 general)