Changeset - r8786:f24a6d1fba34
src/ai/default/default.cpp
Show inline comments
 
@@ -11,7 +11,6 @@
 
#include "../../roadveh.h"
 
#include "../../station_map.h"
 
#include "../../tunnel_map.h"
 
#include "../../engine.h"
 
#include "../../command_func.h"
 
#include "../../town.h"
 
#include "../../industry.h"
src/ai/trolly/build.cpp
Show inline comments
 
@@ -6,7 +6,7 @@
 
#include "../../road_map.h"
 
#include "../../command_func.h"
 
#include "trolly.h"
 
#include "../../engine.h"
 
#include "../../engine_func.h"
 
#include "../../variables.h"
 
#include "../../bridge.h"
 
#include "../../vehicle_func.h"
src/ai/trolly/trolly.cpp
Show inline comments
 
@@ -27,7 +27,7 @@
 
#include "../../town.h"
 
#include "../../industry.h"
 
#include "../../station_base.h"
 
#include "../../engine.h"
 
#include "../../engine_func.h"
 
#include "../../gui.h"
 
#include "../../depot.h"
 
#include "../../vehicle_base.h"
src/aircraft.h
Show inline comments
 
@@ -8,7 +8,7 @@
 
#include "station_map.h"
 
#include "station_base.h"
 
#include "vehicle_base.h"
 
#include "engine.h"
 
#include "engine_func.h"
 

	
 
/** An aircraft can be one ot those types */
 
enum AircraftSubType {
src/aircraft_cmd.cpp
Show inline comments
 
@@ -11,7 +11,6 @@
 
#include "station_map.h"
 
#include "timetable.h"
 
#include "depot.h"
 
#include "engine.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 "engine.h"
 
#include "depot.h"
 
#include "vehicle_gui.h"
 
#include "newgrf_engine.h"
src/articulated_vehicles.cpp
Show inline comments
 
@@ -5,7 +5,6 @@
 
#include "stdafx.h"
 
#include "openttd.h"
 
#include "articulated_vehicles.h"
 
#include "engine.h"
 
#include "train.h"
 
#include "roadveh.h"
 
#include "newgrf_callbacks.h"
src/autoreplace_cmd.cpp
Show inline comments
 
@@ -6,7 +6,6 @@
 
#include "ship.h"
 
#include "news_func.h"
 
#include "player_func.h"
 
#include "engine.h"
 
#include "debug.h"
 
#include "vehicle_gui.h"
 
#include "depot.h"
src/autoreplace_gui.cpp
Show inline comments
 
@@ -19,6 +19,7 @@
 
#include "gfx_func.h"
 
#include "player_func.h"
 
#include "widgets/dropdown_func.h"
 
#include "engine_func.h"
 

	
 
#include "table/sprites.h"
 
#include "table/strings.h"
src/build_vehicle_gui.cpp
Show inline comments
 
@@ -13,7 +13,6 @@
 
#include "articulated_vehicles.h"
 
#include "textbuf_gui.h"
 
#include "command_func.h"
 
#include "engine.h"
 
#include "player_func.h"
 
#include "depot.h"
 
#include "airport.h"
src/console_cmds.cpp
Show inline comments
 
@@ -6,7 +6,7 @@
 
#include "openttd.h"
 
#include "console.h"
 
#include "debug.h"
 
#include "engine.h"
 
#include "engine_func.h"
 
#include "landscape.h"
 
#include "saveload.h"
 
#include "variables.h"
 
@@ -18,7 +18,6 @@
 
#include "settings_func.h"
 
#include "fios.h"
 
#include "fileio.h"
 
#include "station.h"
 
#include "screenshot.h"
 
#include "genworld.h"
 
#include "network/network.h"
src/dock_gui.cpp
Show inline comments
 
@@ -5,7 +5,7 @@
 
#include "stdafx.h"
 
#include "openttd.h"
 
#include "tile_map.h"
 
#include "station.h"
 
#include "station_type.h"
 
#include "gui.h"
 
#include "terraform_gui.h"
 
#include "window_gui.h"
src/economy.cpp
Show inline comments
 
@@ -14,7 +14,6 @@
 
#include "town.h"
 
#include "news_func.h"
 
#include "network/network.h"
 
#include "engine.h"
 
#include "network/network_data.h"
 
#include "variables.h"
 
#include "vehicle_gui.h"
src/elrail.cpp
Show inline comments
 
@@ -65,6 +65,7 @@
 
#include "vehicle_func.h"
 
#include "player_base.h"
 
#include "tunnelbridge.h"
 
#include "engine_func.h"
 

	
 
#include "table/sprites.h"
 
#include "table/elrail_data.h"
src/engine.cpp
Show inline comments
 
@@ -5,7 +5,6 @@
 
#include "stdafx.h"
 
#include "openttd.h"
 
#include "debug.h"
 
#include "engine.h"
 
#include "player_base.h"
 
#include "player_func.h"
 
#include "command_func.h"
src/engine.h
Show inline comments
 
deleted file
src/engine_func.h
Show inline comments
 
new file 100644
 
/* $Id$ */
 

	
 
/** @file engine.h */
 

	
 
#ifndef ENGINE_H
 
#define ENGINE_H
 

	
 
#include "engine_type.h"
 

	
 
void SetupEngines();
 
void StartupEngines();
 

	
 

	
 
void DrawTrainEngine(int x, int y, EngineID engine, SpriteID pal);
 
void DrawRoadVehEngine(int x, int y, EngineID engine, SpriteID pal);
 
void DrawShipEngine(int x, int y, EngineID engine, SpriteID pal);
 
void DrawAircraftEngine(int x, int y, EngineID engine, SpriteID pal);
 

	
 
void LoadCustomEngineNames();
 
void DeleteCustomEngineNames();
 

	
 
bool IsEngineBuildable(EngineID engine, VehicleType type, PlayerID player);
 
CargoID GetEngineCargoType(EngineID engine);
 

	
 
static inline EngineID GetFirstEngineOfType(VehicleType type)
 
{
 
	const EngineID start[] = {0, ROAD_ENGINES_INDEX, SHIP_ENGINES_INDEX, AIRCRAFT_ENGINES_INDEX};
 

	
 
	return start[type];
 
}
 

	
 
static inline EngineID GetLastEngineOfType(VehicleType type)
 
{
 
	const EngineID end[] = {
 
		NUM_TRAIN_ENGINES,
 
		ROAD_ENGINES_INDEX + NUM_ROAD_ENGINES,
 
		SHIP_ENGINES_INDEX + NUM_SHIP_ENGINES,
 
		AIRCRAFT_ENGINES_INDEX + NUM_AIRCRAFT_ENGINES};
 

	
 
	return end[type];
 
}
 

	
 
extern Engine _engines[TOTAL_NUM_ENGINES];
 
#define FOR_ALL_ENGINES(e) for (e = _engines; e != endof(_engines); e++)
 
#define FOR_ALL_ENGINEIDS_OF_TYPE(e, type) for (e = GetFirstEngineOfType(type); e != GetLastEngineOfType(type); e++)
 

	
 

	
 
static inline Engine* GetEngine(EngineID i)
 
{
 
	assert(i < lengthof(_engines));
 
	return &_engines[i];
 
}
 

	
 
static inline bool IsEngineIndex(uint index)
 
{
 
	return index < TOTAL_NUM_ENGINES;
 
}
 

	
 
/* Access Vehicle Data */
 
extern const EngineInfo _orig_engine_info[TOTAL_NUM_ENGINES];
 
extern const RailVehicleInfo _orig_rail_vehicle_info[NUM_TRAIN_ENGINES];
 
extern const ShipVehicleInfo _orig_ship_vehicle_info[NUM_SHIP_ENGINES];
 
extern const AircraftVehicleInfo _orig_aircraft_vehicle_info[NUM_AIRCRAFT_ENGINES];
 
extern const RoadVehicleInfo _orig_road_vehicle_info[NUM_ROAD_ENGINES];
 

	
 
extern EngineInfo _engine_info[TOTAL_NUM_ENGINES];
 
extern RailVehicleInfo _rail_vehicle_info[NUM_TRAIN_ENGINES];
 
extern ShipVehicleInfo _ship_vehicle_info[NUM_SHIP_ENGINES];
 
extern AircraftVehicleInfo _aircraft_vehicle_info[NUM_AIRCRAFT_ENGINES];
 
extern RoadVehicleInfo _road_vehicle_info[NUM_ROAD_ENGINES];
 

	
 
static inline const EngineInfo *EngInfo(EngineID e)
 
{
 
	assert(e < lengthof(_engine_info));
 
	return &_engine_info[e];
 
}
 

	
 
static inline const RailVehicleInfo* RailVehInfo(EngineID e)
 
{
 
	assert(e < lengthof(_rail_vehicle_info));
 
	return &_rail_vehicle_info[e];
 
}
 

	
 
static inline const ShipVehicleInfo* ShipVehInfo(EngineID e)
 
{
 
	assert(e >= SHIP_ENGINES_INDEX && e < SHIP_ENGINES_INDEX + lengthof(_ship_vehicle_info));
 
	return &_ship_vehicle_info[e - SHIP_ENGINES_INDEX];
 
}
 

	
 
static inline const AircraftVehicleInfo* AircraftVehInfo(EngineID e)
 
{
 
	assert(e >= AIRCRAFT_ENGINES_INDEX && e < AIRCRAFT_ENGINES_INDEX + lengthof(_aircraft_vehicle_info));
 
	return &_aircraft_vehicle_info[e - AIRCRAFT_ENGINES_INDEX];
 
}
 

	
 
static inline const RoadVehicleInfo* RoadVehInfo(EngineID e)
 
{
 
	assert(e >= ROAD_ENGINES_INDEX && e < ROAD_ENGINES_INDEX + lengthof(_road_vehicle_info));
 
	return &_road_vehicle_info[e - ROAD_ENGINES_INDEX];
 
}
 

	
 
/* Engine list manipulators - current implementation is only C wrapper of CBlobT<EngineID> class (helpers.cpp) */
 
void EngList_Create(EngineList *el);            ///< Creates engine list
 
void EngList_Destroy(EngineList *el);           ///< Deallocate and destroy engine list
 
uint EngList_Count(const EngineList *el);       ///< Returns number of items in the engine list
 
void EngList_Add(EngineList *el, EngineID eid); ///< Append one item at the end of engine list
 
EngineID* EngList_Items(EngineList *el);        ///< Returns engine list items as C array
 
void EngList_RemoveAll(EngineList *el);         ///< Removes all items from engine list
 
typedef int CDECL EngList_SortTypeFunction(const void*, const void*); ///< argument type for EngList_Sort()
 
void EngList_Sort(EngineList *el, EngList_SortTypeFunction compare); ///< qsort of the engine list
 
void EngList_SortPartial(EngineList *el, EngList_SortTypeFunction compare, uint begin, uint num_items); ///< qsort of specified portion of the engine list
 

	
 
#endif /* ENGINE_H */
src/engine_gui.cpp
Show inline comments
 
@@ -7,7 +7,7 @@
 
#include "gui.h"
 
#include "window_gui.h"
 
#include "gfx_func.h"
 
#include "engine.h"
 
#include "engine_func.h"
 
#include "command_func.h"
 
#include "economy_func.h"
 
#include "news_func.h"
src/genworld.cpp
Show inline comments
 
@@ -21,7 +21,7 @@
 
#include "map_func.h"
 
#include "date_func.h"
 
#include "core/random_func.hpp"
 
#include "engine.h"
 
#include "engine_func.h"
 
#include "settings_type.h"
 
#include "newgrf_storage.h"
 
#include "water.h"
src/group.h
Show inline comments
 
@@ -9,7 +9,7 @@
 
#include "oldpool.h"
 
#include "player_type.h"
 
#include "vehicle_type.h"
 
#include "engine.h"
 
#include "engine_type.h"
 

	
 
DECLARE_OLD_POOL(Group, Group, 5, 2047)
 

	
src/group_gui.cpp
Show inline comments
 
@@ -8,7 +8,6 @@
 
#include "window_gui.h"
 
#include "textbuf_gui.h"
 
#include "command_func.h"
 
#include "engine.h"
 
#include "vehicle_gui.h"
 
#include "depot.h"
 
#include "train.h"
src/helpers.cpp
Show inline comments
 
@@ -5,7 +5,7 @@
 
#include "stdafx.h"
 

	
 
#include "openttd.h"
 
#include "engine.h"
 
#include "engine_func.h"
 

	
 
#include <new>
 
#include "misc/blob.hpp"
src/misc.cpp
Show inline comments
 
@@ -8,7 +8,6 @@
 
#include "landscape.h"
 
#include "news_func.h"
 
#include "saveload.h"
 
#include "engine.h"
 
#include "vehicle_gui.h"
 
#include "variables.h"
 
#include "ai/ai.h"
src/newgrf.cpp
Show inline comments
 
@@ -9,7 +9,7 @@
 
#include "openttd.h"
 
#include "debug.h"
 
#include "fileio.h"
 
#include "engine.h"
 
#include "engine_func.h"
 
#include "spritecache.h"
 
#include "sprite.h"
 
#include "newgrf.h"
src/newgrf_engine.cpp
Show inline comments
 
@@ -6,7 +6,7 @@
 
#include "openttd.h"
 
#include "variables.h"
 
#include "debug.h"
 
#include "engine.h"
 
#include "engine_func.h"
 
#include "train.h"
 
#include "player_func.h"
 
#include "player_base.h"
src/newgrf_sound.cpp
Show inline comments
 
@@ -5,7 +5,7 @@
 
#include "stdafx.h"
 
#include "openttd.h"
 
#include "oldpool.h"
 
#include "engine.h"
 
#include "engine_func.h"
 
#include "newgrf_callbacks.h"
 
#include "newgrf_engine.h"
 
#include "newgrf_sound.h"
src/newgrf_station.h
Show inline comments
 
@@ -5,7 +5,7 @@
 
#ifndef NEWGRF_STATION_H
 
#define NEWGRF_STATION_H
 

	
 
#include "engine.h"
 
#include "engine_type.h"
 
#include "newgrf_callbacks.h"
 
#include "newgrf_cargo.h"
 
#include "tile_type.h"
src/oldloader.cpp
Show inline comments
 
@@ -9,7 +9,6 @@
 
#include "industry.h"
 
#include "player_func.h"
 
#include "player_base.h"
 
#include "engine.h"
 
#include "aircraft.h"
 
#include "roadveh.h"
 
#include "ship.h"
src/openttd.cpp
Show inline comments
 
@@ -28,7 +28,6 @@
 
#include "town.h"
 
#include "industry.h"
 
#include "news_func.h"
 
#include "engine.h"
 
#include "fileio.h"
 
#include "fios.h"
 
#include "airport.h"
src/player_base.h
Show inline comments
 
@@ -8,7 +8,7 @@
 
#include "road_type.h"
 
#include "rail_type.h"
 
#include "date_type.h"
 
#include "engine.h"
 
#include "engine_type.h"
 
#include "livery.h"
 
#include "autoreplace_type.h"
 
#include "economy_type.h"
src/players.cpp
Show inline comments
 
@@ -4,7 +4,7 @@
 
 */
 
#include "stdafx.h"
 
#include "openttd.h"
 
#include "engine.h"
 
#include "engine_func.h"
 
#include "player_func.h"
 
#include "player_gui.h"
 
#include "town.h"
 
@@ -14,7 +14,6 @@
 
#include "network/network.h"
 
#include "network/network_internal.h"
 
#include "variables.h"
 
#include "engine.h"
 
#include "ai/ai.h"
 
#include "player_face.h"
 
#include "group.h"
src/rail.cpp
Show inline comments
 
@@ -13,6 +13,7 @@
 
#include "date_func.h"
 
#include "player_func.h"
 
#include "player_base.h"
 
#include "engine_func.h"
 

	
 

	
 
/* XXX: Below 3 tables store duplicate data. Maybe remove some? */
src/rail_cmd.cpp
Show inline comments
 
@@ -17,7 +17,7 @@
 
#include "viewport_func.h"
 
#include "command_func.h"
 
#include "pathfind.h"
 
#include "engine.h"
 
#include "engine_func.h"
 
#include "town.h"
 
#include "sprite.h"
 
#include "depot.h"
src/road.cpp
Show inline comments
 
@@ -9,7 +9,7 @@
 
#include "genworld.h"
 
#include "player_func.h"
 
#include "player_base.h"
 
#include "engine.h"
 
#include "engine_func.h"
 
#include "settings_type.h"
 
#include "date_func.h"
 

	
src/roadveh.h
Show inline comments
 
@@ -6,7 +6,7 @@
 
#define ROADVEH_H
 

	
 
#include "vehicle_base.h"
 
#include "engine.h"
 
#include "engine_func.h"
 
#include "economy_func.h"
 

	
 
enum RoadVehicleSubType {
src/roadveh_cmd.cpp
Show inline comments
 
@@ -11,7 +11,6 @@
 
#include "roadveh.h"
 
#include "station_map.h"
 
#include "timetable.h"
 
#include "engine.h"
 
#include "command_func.h"
 
#include "station_base.h"
 
#include "news_func.h"
src/settings_gui.cpp
Show inline comments
 
@@ -9,7 +9,7 @@
 
#include "window_gui.h"
 
#include "textbuf_gui.h"
 
#include "command_func.h"
 
#include "engine.h"
 
#include "engine_func.h"
 
#include "screenshot.h"
 
#include "newgrf.h"
 
#include "network/network.h"
src/ship.h
Show inline comments
 
@@ -6,7 +6,7 @@
 
#define SHIP_H
 

	
 
#include "vehicle_base.h"
 
#include "engine.h"
 
#include "engine_func.h"
 
#include "economy_func.h"
 

	
 
void CcBuildShip(bool success, TileIndex tile, uint32 p1, uint32 p2);
src/ship_cmd.cpp
Show inline comments
 
@@ -13,7 +13,7 @@
 
#include "station_map.h"
 
#include "station_base.h"
 
#include "news_func.h"
 
#include "engine.h"
 
#include "engine_func.h"
 
#include "player_func.h"
 
#include "player_base.h"
 
#include "npf.h"
src/strings.cpp
Show inline comments
 
@@ -36,6 +36,7 @@
 
#include "fios.h"
 
#include "settings_type.h"
 
#include "video/video_driver.hpp"
 
#include "engine_func.h"
 

	
 
#include "table/strings.h"
 
#include "table/control_codes.h"
src/terraform_gui.cpp
Show inline comments
 
@@ -17,7 +17,7 @@
 
#include "variables.h"
 
#include "functions.h"
 
#include "sound_func.h"
 
#include "station.h"
 
#include "station_base.h"
 
#include "unmovable_map.h"
 
#include "textbuf_gui.h"
 
#include "genworld.h"
src/timetable_gui.cpp
Show inline comments
 
@@ -6,7 +6,6 @@
 
#include "openttd.h"
 
#include "variables.h"
 
#include "command_func.h"
 
#include "engine.h"
 
#include "gui.h"
 
#include "window_gui.h"
 
#include "textbuf_gui.h"
src/train_cmd.cpp
Show inline comments
 
@@ -18,7 +18,7 @@
 
#include "npf.h"
 
#include "station_base.h"
 
#include "news_func.h"
 
#include "engine.h"
 
#include "engine_func.h"
 
#include "player_func.h"
 
#include "player_base.h"
 
#include "depot.h"
src/train_gui.cpp
Show inline comments
 
@@ -17,6 +17,7 @@
 
#include "vehicle_func.h"
 
#include "settings_type.h"
 
#include "order_func.h"
 
#include "engine_func.h"
 

	
 
#include "table/sprites.h"
 
#include "table/strings.h"
src/tunnelbridge_cmd.cpp
Show inline comments
 
@@ -34,6 +34,7 @@
 
#include "signal_func.h"
 
#include "tunnelbridge.h"
 
#include "player_base.h"
 
#include "engine_func.h"
 

	
 
#include "table/sprites.h"
 
#include "table/strings.h"
src/vehicle.cpp
Show inline comments
 
@@ -17,7 +17,6 @@
 
#include "command_func.h"
 
#include "saveload.h"
 
#include "player_func.h"
 
#include "engine.h"
 
#include "debug.h"
 
#include "vehicle_gui.h"
 
#include "depot.h"
src/vehicle_gui.cpp
Show inline comments
 
@@ -6,7 +6,6 @@
 
#include "openttd.h"
 
#include "debug.h"
 
#include "player_func.h"
 
#include "engine.h"
 
#include "gui.h"
 
#include "window_gui.h"
 
#include "textbuf_gui.h"
0 comments (0 inline, 0 general)