Changeset - r18876:3403b9c464f9
[Not reviewed]
master
! ! !
rubidium - 13 years ago 2012-01-03 20:26:05
rubidium@openttd.org
(svn r23735) -Codechange: remove ~50 includes from headers that weren't needed
71 files changed with 28 insertions and 76 deletions:
0 comments (0 inline, 0 general)
src/ai/ai.hpp
Show inline comments
 
@@ -4,25 +4,24 @@
 
 * This file is part of OpenTTD.
 
 * OpenTTD is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2.
 
 * OpenTTD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
 
 * See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with OpenTTD. If not, see <http://www.gnu.org/licenses/>.
 
 */
 

	
 
/** @file ai.hpp Base functions for all AIs. */
 

	
 
#ifndef AI_HPP
 
#define AI_HPP
 

	
 
#include "../script/api/script_event_types.hpp"
 
#include "../date_type.h"
 
#include "../core/string_compare_type.hpp"
 
#include <map>
 

	
 
/** A list that maps AI names to their AIInfo object. */
 
typedef std::map<const char *, class ScriptInfo *, StringCompare> ScriptInfoList;
 

	
 
/**
 
 * Main AI class. Contains all functions needed to start, stop, save and load AIs.
 
 */
 
class AI {
 
public:
 
	/**
src/ai/ai_config.hpp
Show inline comments
 
@@ -4,24 +4,25 @@
 
 * This file is part of OpenTTD.
 
 * OpenTTD is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2.
 
 * OpenTTD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
 
 * See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with OpenTTD. If not, see <http://www.gnu.org/licenses/>.
 
 */
 

	
 
/** @file ai_config.hpp AIConfig stores the configuration settings of every AI. */
 

	
 
#ifndef AI_CONFIG_HPP
 
#define AI_CONFIG_HPP
 

	
 
#include "../script/script_config.hpp"
 
#include "../company_type.h"
 

	
 
class AIConfig : public ScriptConfig {
 
public:
 
	/**
 
	 * Get the config of a company.
 
	 */
 
	static AIConfig *GetConfig(CompanyID company, ScriptSettingSource source = SSS_DEFAULT);
 

	
 
	AIConfig() :
 
		ScriptConfig()
 
	{}
 

	
src/ai/ai_info.hpp
Show inline comments
 
@@ -4,25 +4,24 @@
 
 * This file is part of OpenTTD.
 
 * OpenTTD is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2.
 
 * OpenTTD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
 
 * See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with OpenTTD. If not, see <http://www.gnu.org/licenses/>.
 
 */
 

	
 
/** @file ai_info.hpp AIInfo keeps track of all information of an AI, like Author, Description, ... */
 

	
 
#ifndef AI_INFO_HPP
 
#define AI_INFO_HPP
 

	
 
#include "../script/script_info.hpp"
 
#include "../script/script_config.hpp"
 

	
 
/** All static information from an AI like name, version, etc. */
 
class AIInfo : public ScriptInfo {
 
public:
 
	AIInfo();
 
	~AIInfo();
 

	
 
	/**
 
	 * Register the functions of this class.
 
	 */
 
	static void RegisterAPI(Squirrel *engine);
 

	
src/ai/ai_instance.hpp
Show inline comments
 
@@ -3,25 +3,24 @@
 
/*
 
 * This file is part of OpenTTD.
 
 * OpenTTD is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2.
 
 * OpenTTD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
 
 * See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with OpenTTD. If not, see <http://www.gnu.org/licenses/>.
 
 */
 

	
 
/** @file ai_instance.hpp The AIInstance tracks an AI. */
 

	
 
#ifndef AI_INSTANCE_HPP
 
#define AI_INSTANCE_HPP
 

	
 
#include <squirrel.h>
 
#include "../script/script_instance.hpp"
 

	
 
/** Runtime information about an AI like a pointer to the squirrel vm and the current state. */
 
class AIInstance : public ScriptInstance {
 
public:
 
	AIInstance();
 

	
 
	/**
 
	 * Initialize the AI and prepare it for its first run.
 
	 * @param info The AI to create the instance of.
 
	 */
 
	void Initialize(class AIInfo *info);
src/autoreplace_func.h
Show inline comments
 
@@ -5,26 +5,24 @@
 
 * OpenTTD is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2.
 
 * OpenTTD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
 
 * See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with OpenTTD. If not, see <http://www.gnu.org/licenses/>.
 
 */
 

	
 
/** @file autoreplace_func.h Functions related to autoreplacing. */
 

	
 
#ifndef AUTOREPLACE_FUNC_H
 
#define AUTOREPLACE_FUNC_H
 

	
 
#include "command_type.h"
 
#include "company_base.h"
 
#include "engine_type.h"
 
#include "group_type.h"
 

	
 
void RemoveAllEngineReplacement(EngineRenewList *erl);
 
EngineID EngineReplacement(EngineRenewList erl, EngineID engine, GroupID group);
 
CommandCost AddEngineReplacement(EngineRenewList *erl, EngineID old_engine, EngineID new_engine, GroupID group, DoCommandFlag flags);
 
CommandCost RemoveEngineReplacement(EngineRenewList *erl, EngineID engine, GroupID group, DoCommandFlag flags);
 

	
 
/**
 
 * Remove all engine replacement settings for the given company.
 
 * @param c the company.
 
 */
 
static inline void RemoveAllEngineReplacementForCompany(Company *c)
 
{
src/autoslope.h
Show inline comments
 
@@ -5,25 +5,24 @@
 
 * OpenTTD is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2.
 
 * OpenTTD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
 
 * See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with OpenTTD. If not, see <http://www.gnu.org/licenses/>.
 
 */
 

	
 
/** @file autoslope.h Functions related to autoslope. */
 

	
 
#ifndef AUTOSLOPE_H
 
#define AUTOSLOPE_H
 

	
 
#include "company_func.h"
 
#include "depot_func.h"
 
#include "slope_func.h"
 
#include "tile_map.h"
 

	
 
/**
 
 * Autoslope check for tiles with an entrance on an edge.
 
 * E.g. depots and non-drive-through-road-stops.
 
 *
 
 * The test succeeds if the slope is not steep and at least one corner of the entrance edge is on the TileMaxZ() level.
 
 *
 
 * @note The test does not check if autoslope is enabled at all.
 
 *
 
 * @param tile The tile.
 
 * @param z_new New TileZ.
src/cmd_helper.h
Show inline comments
 
@@ -4,25 +4,24 @@
 
 * This file is part of OpenTTD.
 
 * OpenTTD is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2.
 
 * OpenTTD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
 
 * See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with OpenTTD. If not, see <http://www.gnu.org/licenses/>.
 
 */
 

	
 
/** @file cmd_helper.h Helper functions to extract data from command parameters. */
 

	
 
#ifndef CMD_HELPER_H
 
#define CMD_HELPER_H
 

	
 
#include "core/enum_type.hpp"
 
#include "core/bitmath_func.hpp"
 

	
 
/**
 
 * Extracts a given type from a value.
 
 * @tparam T The type of data we're looking for.
 
 * @tparam S The offset in the data.
 
 * @tparam N The amount of bits to read.
 
 * @tparam U The type of data passed to us.
 
 * @param v The data to extract the value from.
 
 */
 
template<typename T, uint S, uint N, typename U> static inline T Extract(U v)
 
{
 
	/* Check if there are enough bits in v */
src/company_base.h
Show inline comments
 
@@ -3,30 +3,27 @@
 
/*
 
 * This file is part of OpenTTD.
 
 * OpenTTD is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2.
 
 * OpenTTD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
 
 * See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with OpenTTD. If not, see <http://www.gnu.org/licenses/>.
 
 */
 

	
 
/** @file company_base.h Definition of stuff that is very close to a company, like the company struct itself. */
 

	
 
#ifndef COMPANY_BASE_H
 
#define COMPANY_BASE_H
 

	
 
#include "core/pool_type.hpp"
 
#include "road_type.h"
 
#include "rail_type.h"
 
#include "livery.h"
 
#include "autoreplace_type.h"
 
#include "economy_type.h"
 
#include "tile_type.h"
 
#include "settings_type.h"
 
#include "group.h"
 

	
 
struct CompanyEconomyEntry {
 
	Money income;
 
	Money expenses;
 
	int32 delivered_cargo;
 
	int32 performance_history; ///< company score (scale 0-1000)
 
	Money company_value;
 
};
 

	
src/company_func.h
Show inline comments
 
@@ -5,25 +5,24 @@
 
 * OpenTTD is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2.
 
 * OpenTTD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
 
 * See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with OpenTTD. If not, see <http://www.gnu.org/licenses/>.
 
 */
 

	
 
/** @file company_func.h Functions related to companies. */
 

	
 
#ifndef COMPANY_FUNC_H
 
#define COMPANY_FUNC_H
 

	
 
#include "command_type.h"
 
#include "company_type.h"
 
#include "tile_type.h"
 
#include "gfx_type.h"
 

	
 
bool MayCompanyTakeOver(CompanyID cbig, CompanyID small);
 
void ChangeOwnershipOfCompanyItems(Owner old_owner, Owner new_owner);
 
void GetNameOfOwner(Owner owner, TileIndex tile);
 
void SetLocalCompany(CompanyID new_company);
 
void ShowBuyCompanyDialog(CompanyID company);
 
void CompanyAdminUpdate(const Company *company);
 
void CompanyAdminBankrupt(CompanyID company_id);
 
void UpdateLandscapingLimits();
 

	
 
bool CheckCompanyHasMoney(CommandCost &cost);
src/depot_func.h
Show inline comments
 
@@ -3,28 +3,26 @@
 
/*
 
 * This file is part of OpenTTD.
 
 * OpenTTD is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2.
 
 * OpenTTD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
 
 * See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with OpenTTD. If not, see <http://www.gnu.org/licenses/>.
 
 */
 

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

	
 
#ifndef DEPOT_FUNC_H
 
#define DEPOT_FUNC_H
 

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

	
 
void ShowDepotWindow(TileIndex tile, VehicleType type);
 

	
 
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
 
 */
 
static inline bool CanBuildDepotByTileh(DiagDirection direction, Slope tileh)
src/effectvehicle_base.h
Show inline comments
 
@@ -4,24 +4,25 @@
 
 * This file is part of OpenTTD.
 
 * OpenTTD is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2.
 
 * OpenTTD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
 
 * See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with OpenTTD. If not, see <http://www.gnu.org/licenses/>.
 
 */
 

	
 
/** @file effectvehicle_base.h Base class for all effect vehicles. */
 

	
 
#ifndef EFFECTVEHICLE_BASE_H
 
#define EFFECTVEHICLE_BASE_H
 

	
 
#include "vehicle_base.h"
 
#include "transparency.h"
 

	
 
/**
 
 * A special vehicle is one of the following:
 
 *  - smoke
 
 *  - electric sparks for trains
 
 *  - explosions
 
 *  - bulldozer (road works)
 
 *  - bubbles (industry)
 
 */
 
struct EffectVehicle FINAL : public SpecializedVehicle<EffectVehicle, VEH_EFFECT> {
 
	uint16 animation_state;  ///< State primarily used to change the graphics/behaviour.
 
	byte animation_substate; ///< Sub state to time the change of the graphics/behaviour.
src/engine_base.h
Show inline comments
 
@@ -3,29 +3,27 @@
 
/*
 
 * This file is part of OpenTTD.
 
 * OpenTTD is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2.
 
 * OpenTTD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
 
 * See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with OpenTTD. If not, see <http://www.gnu.org/licenses/>.
 
 */
 

	
 
/** @file engine_base.h Base class for engines. */
 

	
 
#ifndef ENGINE_BASE_H
 
#define ENGINE_BASE_H
 

	
 
#include "company_type.h"
 
#include "engine_type.h"
 
#include "vehicle_type.h"
 
#include "core/pool_type.hpp"
 
#include "core/smallvec_type.hpp"
 
#include "newgrf_commons.h"
 

	
 
typedef Pool<Engine, EngineID, 64, 64000> EnginePool;
 
extern EnginePool _engine_pool;
 

	
 
struct Engine : EnginePool::PoolItem<&_engine_pool> {
 
	char *name;                 ///< Custom name of engine.
 
	Date intro_date;            ///< Date of introduction of the engine.
 
	Date age;
 
	uint16 reliability;         ///< Current reliability of the engine.
 
	uint16 reliability_spd_dec; ///< Speed of reliability decay between services (per day).
 
	uint16 reliability_start;   ///< Initial reliability of the engine.
src/engine_gui.h
Show inline comments
 
@@ -6,24 +6,25 @@
 
 * OpenTTD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
 
 * See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with OpenTTD. If not, see <http://www.gnu.org/licenses/>.
 
 */
 

	
 
/** @file engine_gui.h %Engine GUI functions, used by build_vehicle_gui and autoreplace_gui */
 

	
 
#ifndef ENGINE_GUI_H
 
#define ENGINE_GUI_H
 

	
 
#include "engine_type.h"
 
#include "sortlist_type.h"
 
#include "gfx_type.h"
 
#include "vehicle_type.h"
 

	
 
typedef GUIList<EngineID, CargoID> GUIEngineList;
 

	
 
typedef int CDECL EngList_SortTypeFunction(const EngineID*, const EngineID*); ///< argument type for #EngList_Sort.
 
void EngList_Sort(GUIEngineList *el, EngList_SortTypeFunction compare);
 
void EngList_SortPartial(GUIEngineList *el, EngList_SortTypeFunction compare, uint begin, uint num_items);
 

	
 
StringID GetEngineCategoryName(EngineID engine);
 
StringID GetEngineInfoString(EngineID engine);
 

	
 
void DrawVehicleEngine(int left, int right, int preferred_x, int y, EngineID engine, PaletteID pal, EngineImageType image_type);
 
void DrawTrainEngine(int left, int right, int preferred_x, int y, EngineID engine, PaletteID pal, EngineImageType image_type);
src/game/game_info.hpp
Show inline comments
 
@@ -4,25 +4,24 @@
 
 * This file is part of OpenTTD.
 
 * OpenTTD is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2.
 
 * OpenTTD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
 
 * See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with OpenTTD. If not, see <http://www.gnu.org/licenses/>.
 
 */
 

	
 
/** @file game_info.hpp GameInfo keeps track of all information of an Game, like Author, Description, ... */
 

	
 
#ifndef GAME_INFO_HPP
 
#define GAME_INFO_HPP
 

	
 
#include "../script/script_info.hpp"
 
#include "../script/script_config.hpp"
 

	
 
/** All static information from an Game like name, version, etc. */
 
class GameInfo : public ScriptInfo {
 
public:
 
	GameInfo();
 
	~GameInfo();
 

	
 
	/**
 
	 * Register the functions of this class.
 
	 */
 
	static void RegisterAPI(Squirrel *engine);
 

	
src/goal_base.h
Show inline comments
 
@@ -3,25 +3,24 @@
 
/*
 
 * This file is part of OpenTTD.
 
 * OpenTTD is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2.
 
 * OpenTTD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
 
 * See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with OpenTTD. If not, see <http://www.gnu.org/licenses/>.
 
 */
 

	
 
/** @file goal_base.h %Goal base class. */
 

	
 
#ifndef GOAL_BASE_H
 
#define GOAL_BASE_H
 

	
 
#include "cargo_type.h"
 
#include "company_type.h"
 
#include "goal_type.h"
 
#include "core/pool_type.hpp"
 

	
 
typedef Pool<Goal, GoalID, 1, 256> GoalPool;
 
extern GoalPool _goal_pool;
 

	
 
/** Struct about subsidies, offered and awarded */
 
struct Goal : GoalPool::PoolItem<&_goal_pool> {
 
	CompanyByte company; ///< Goal is for a specific company; INVALID_COMPANY if it is global
 
	GoalTypeByte type;   ///< Type of the goal
 
	GoalTypeID dst;      ///< Index of type
src/goal_type.h
Show inline comments
 
@@ -3,24 +3,26 @@
 
/*
 
 * This file is part of OpenTTD.
 
 * OpenTTD is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2.
 
 * OpenTTD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
 
 * See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with OpenTTD. If not, see <http://www.gnu.org/licenses/>.
 
 */
 

	
 
/** @file goal_type.h basic types related to goals */
 

	
 
#ifndef GOAL_TYPE_H
 
#define GOAL_TYPE_H
 

	
 
#include "core/enum_type.hpp"
 

	
 
enum {
 
	GOAL_QUESTION_BUTTON_COUNT = 18, ///< Amount of buttons available.
 
};
 

	
 
/** Types of goal destinations */
 
enum GoalType {
 
	GT_NONE,         ///< Destination is not linked
 
	GT_TILE,         ///< Destination is a tile
 
	GT_INDUSTRY,     ///< Destination is an industry
 
	GT_TOWN,         ///< Destination is a town
 
	GT_COMPANY,      ///< Destination is a company
 
};
src/ground_vehicle.hpp
Show inline comments
 
@@ -7,24 +7,25 @@
 
 * See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with OpenTTD. If not, see <http://www.gnu.org/licenses/>.
 
 */
 

	
 
/** @file ground_vehicle.hpp Base class and functions for all vehicles that move through ground. */
 

	
 
#ifndef GROUND_VEHICLE_HPP
 
#define GROUND_VEHICLE_HPP
 

	
 
#include "vehicle_base.h"
 
#include "vehicle_gui.h"
 
#include "landscape.h"
 
#include "window_func.h"
 
#include "widgets/vehicle_widget.h"
 

	
 
/** What is the status of our acceleration? */
 
enum AccelStatus {
 
	AS_ACCEL, ///< We want to go faster, if possible of course.
 
	AS_BRAKE, ///< We want to stop.
 
};
 

	
 
/**
 
 * Cached, frequently calculated values.
 
 * All of these values except cached_slope_resistance are set only for the first part of a vehicle.
 
 */
 
struct GroundVehicleCache {
src/gui.h
Show inline comments
 
@@ -7,25 +7,24 @@
 
 * See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with OpenTTD. If not, see <http://www.gnu.org/licenses/>.
 
 */
 

	
 
/** @file gui.h GUI functions that shouldn't be here. */
 

	
 
#ifndef GUI_H
 
#define GUI_H
 

	
 
#include "vehicle_type.h"
 
#include "gfx_type.h"
 
#include "economy_type.h"
 
#include "tile_type.h"
 
#include "strings_type.h"
 
#include "transport_type.h"
 

	
 
struct Window;
 

	
 
/* main_gui.cpp */
 
void HandleOnEditText(const char *str);
 
void InitializeGUI();
 

	
 
/* settings_gui.cpp */
 
void ShowGameOptions();
 
void ShowGameDifficulty();
 
void ShowGameSettings();
src/house.h
Show inline comments
 
@@ -3,27 +3,25 @@
 
/*
 
 * This file is part of OpenTTD.
 
 * OpenTTD is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2.
 
 * OpenTTD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
 
 * See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with OpenTTD. If not, see <http://www.gnu.org/licenses/>.
 
 */
 

	
 
/** @file house.h definition of HouseSpec and accessors */
 

	
 
#ifndef HOUSE_H
 
#define HOUSE_H
 

	
 
#include "strings_type.h"
 
#include "cargo_type.h"
 
#include "economy_type.h"
 
#include "date_type.h"
 
#include "house_type.h"
 
#include "newgrf_animation_type.h"
 
#include "newgrf_commons.h"
 

	
 
/**
 
 * Simple value that indicates the house has reached the final stage of
 
 * construction.
 
 */
 
static const byte TOWN_HOUSE_COMPLETED = 3;
 

	
 
static const uint HOUSE_NO_CLASS      = 0;
src/industry.h
Show inline comments
 
@@ -3,25 +3,24 @@
 
/*
 
 * This file is part of OpenTTD.
 
 * OpenTTD is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2.
 
 * OpenTTD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
 
 * See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with OpenTTD. If not, see <http://www.gnu.org/licenses/>.
 
 */
 

	
 
/** @file industry.h Base of all industries. */
 

	
 
#ifndef INDUSTRY_H
 
#define INDUSTRY_H
 

	
 
#include "core/pool_type.hpp"
 
#include "newgrf_storage.h"
 
#include "subsidy_type.h"
 
#include "industry_map.h"
 
#include "tilearea_type.h"
 

	
 

	
 
typedef Pool<Industry, IndustryID, 64, 64000> IndustryPool;
 
extern IndustryPool _industry_pool;
 

	
 
/**
 
 * Production level maximum, minimum and default values.
 
 * It is not a value been really used in order to change, but rather an indicator
src/industrytype.h
Show inline comments
 
@@ -3,30 +3,28 @@
 
/*
 
 * This file is part of OpenTTD.
 
 * OpenTTD is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2.
 
 * OpenTTD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
 
 * See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with OpenTTD. If not, see <http://www.gnu.org/licenses/>.
 
 */
 

	
 
/** @file industrytype.h %Industry type specs. */
 

	
 
#ifndef INDUSTRYTYPE_H
 
#define INDUSTRYTYPE_H
 

	
 
#include "economy_type.h"
 
#include "map_type.h"
 
#include "slope_type.h"
 
#include "industry_type.h"
 
#include "landscape_type.h"
 
#include "strings_type.h"
 
#include "cargo_type.h"
 
#include "newgrf_animation_type.h"
 
#include "newgrf_commons.h"
 

	
 
enum IndustryCleanupType {
 
	CLEAN_RANDOMSOUNDS,    ///< Free the dynamically allocated sounds table
 
	CLEAN_TILELAYOUT,      ///< Free the dynamically allocated tile layout structure
 
};
 

	
 
/** Available types of industry lifetimes. */
 
enum IndustryLifeType {
 
	INDUSTRYLIFE_BLACK_HOLE =      0, ///< Like power plants and banks
src/landscape.h
Show inline comments
 
@@ -5,25 +5,24 @@
 
 * OpenTTD is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2.
 
 * OpenTTD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
 
 * See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with OpenTTD. If not, see <http://www.gnu.org/licenses/>.
 
 */
 

	
 
/** @file landscape.h Functions related to OTTD's landscape. */
 

	
 
#ifndef LANDSCAPE_H
 
#define LANDSCAPE_H
 

	
 
#include "core/geometry_type.hpp"
 
#include "tile_cmd.h"
 
#include "zoom_type.h"
 

	
 
static const uint SNOW_LINE_MONTHS = 12; ///< Number of months in the snow line table.
 
static const uint SNOW_LINE_DAYS   = 32; ///< Number of days in each month in the snow line table.
 

	
 
/**
 
 * Structure describing the height of the snow line each day of the year
 
 * @ingroup SnowLineGroup
 
 */
 
struct SnowLine {
 
	byte table[SNOW_LINE_MONTHS][SNOW_LINE_DAYS]; ///< Height of the snow line each day of the year
 
	byte highest_value; ///< Highest snow line of the year
 
	byte lowest_value;  ///< Lowest snow line of the year
src/newgrf_airport.h
Show inline comments
 
@@ -5,28 +5,26 @@
 
 * OpenTTD is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2.
 
 * OpenTTD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
 
 * See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with OpenTTD. If not, see <http://www.gnu.org/licenses/>.
 
 */
 

	
 
/** @file newgrf_airport.h NewGRF handling of airports. */
 

	
 
#ifndef NEWGRF_AIRPORT_H
 
#define NEWGRF_AIRPORT_H
 

	
 
#include "airport.h"
 
#include "date_type.h"
 
#include "map_type.h"
 
#include "newgrf_class.h"
 
#include "newgrf_commons.h"
 
#include "gfx_type.h"
 
#include "tilearea_type.h"
 

	
 
/** Copy from station_map.h */
 
typedef byte StationGfx;
 

	
 
/** Tile-offset / AirportTileID pair. */
 
struct AirportTileTable {
 
	TileIndexDiffC ti; ///< Tile offset from  the top-most airport tile.
 
	StationGfx gfx;    ///< AirportTile to use for this tile.
 
};
 

	
 
/** Iterator to iterate over all tiles belonging to an airport spec. */
src/newgrf_animation_base.h
Show inline comments
 
@@ -8,24 +8,25 @@
 
 */
 

	
 
/** @file newgrf_animation_base.h Function implementations related to NewGRF animation. */
 

	
 
/* No inclusion guards as this file must only be included from .cpp files. */
 

	
 
#include "animated_tile_func.h"
 
#include "core/random_func.hpp"
 
#include "date_func.h"
 
#include "viewport_func.h"
 
#include "newgrf_animation_type.h"
 
#include "newgrf_callbacks.h"
 
#include "tile_map.h"
 

	
 
/**
 
 * Helper class for a unified approach to NewGRF animation.
 
 * @tparam Tbase       Instantiation of this class.
 
 * @tparam Tspec       NewGRF specification related to the animated tile.
 
 * @tparam Tobj        Object related to the animated tile.
 
 * @tparam Textra      Custom extra callback data.
 
 * @tparam GetCallback The callback function pointer.
 
 */
 
template <typename Tbase, typename Tspec, typename Tobj, typename Textra, uint16 (*GetCallback)(CallbackID callback, uint32 param1, uint32 param2, const Tspec *statspec, Tobj *st, TileIndex tile, Textra extra_data)>
 
struct AnimationBase {
 
	/**
src/newgrf_canal.h
Show inline comments
 
@@ -3,27 +3,26 @@
 
/*
 
 * This file is part of OpenTTD.
 
 * OpenTTD is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2.
 
 * OpenTTD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
 
 * See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with OpenTTD. If not, see <http://www.gnu.org/licenses/>.
 
 */
 

	
 
/** @file newgrf_canal.h Handling of NewGRF canals. */
 

	
 
#ifndef NEWGRF_CANAL_H
 
#define NEWGRF_CANAL_H
 

	
 
#include "gfx_type.h"
 
#include "newgrf.h"
 
#include "tile_type.h"
 
#include "newgrf_generic.h"
 

	
 
/** Flags controlling the display of canals. */
 
enum CanalFeatureFlag {
 
	CFF_HAS_FLAT_SPRITE = 0, ///< Additional flat ground sprite in the beginning.
 
};
 

	
 
/** Information about a water feature. */
 
struct WaterFeature {
 
	const SpriteGroup *group; ///< Sprite group to start resolving.
 
	const GRFFile *grffile;   ///< NewGRF where 'group' belongs to.
 
	uint8 callback_mask;      ///< Bitmask of canal callbacks that have to be called.
 
	uint8 flags;              ///< Flags controlling display.
src/newgrf_commons.h
Show inline comments
 
@@ -6,25 +6,24 @@
 
 * OpenTTD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
 
 * See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with OpenTTD. If not, see <http://www.gnu.org/licenses/>.
 
 */
 

	
 
/**
 
 * @file newgrf_commons.h This file simplyfies and embeds a common mechanism of
 
 * loading/saving and mapping of grf entities.
 
 */
 

	
 
#ifndef NEWGRF_COMMONS_H
 
#define NEWGRF_COMMONS_H
 

	
 
#include "tile_type.h"
 
#include "sprite.h"
 
#include "core/alloc_type.hpp"
 
#include "core/smallvec_type.hpp"
 
#include "command_type.h"
 
#include "direction_type.h"
 
#include "company_type.h"
 

	
 
/** Context for tile accesses */
 
enum TileContext {
 
	TCX_NORMAL,         ///< Nothing special.
 
	TCX_UPPER_HALFTILE, ///< Querying information about the upper part of a tile with halftile foundation.
 
	TCX_ON_BRIDGE,      ///< Querying information about stuff on the bridge (via some bridgehead).
src/newgrf_generic.h
Show inline comments
 
@@ -3,25 +3,24 @@
 
/*
 
 * This file is part of OpenTTD.
 
 * OpenTTD is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2.
 
 * OpenTTD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
 
 * See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with OpenTTD. If not, see <http://www.gnu.org/licenses/>.
 
 */
 

	
 
/** @file newgrf_generic.h Functions related to generic callbacks. */
 

	
 
#ifndef NEWGRF_GENERIC_H
 
#define NEWGRF_GENERIC_H
 

	
 
#include "cargo_type.h"
 
#include "industry_type.h"
 
#include "newgrf.h"
 
#include "tile_type.h"
 

	
 
struct SpriteGroup;
 

	
 
/** AI events for asking the NewGRF for information. */
 
enum AIConstructionEvent {
 
	AICE_TRAIN_CHECK_RAIL_ENGINE     = 0x00, ///< Check if we should build an engine
 
	AICE_TRAIN_CHECK_ELRAIL_ENGINE   = 0x01, ///< Check if we should build an engine
 
	AICE_TRAIN_CHECK_MONORAIL_ENGINE = 0x02, ///< Check if we should build an engine
 
	AICE_TRAIN_CHECK_MAGLEV_ENGINE   = 0x03, ///< Check if we should build an engine
src/newgrf_industries.h
Show inline comments
 
@@ -3,26 +3,24 @@
 
/*
 
 * This file is part of OpenTTD.
 
 * OpenTTD is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2.
 
 * OpenTTD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
 
 * See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with OpenTTD. If not, see <http://www.gnu.org/licenses/>.
 
 */
 

	
 
/** @file newgrf_industries.h Functions for NewGRF industries. */
 

	
 
#ifndef NEWGRF_INDUSTRIES_H
 
#define NEWGRF_INDUSTRIES_H
 

	
 
#include "command_type.h"
 
#include "company_type.h"
 
#include "newgrf_spritegroup.h"
 

	
 
/** When should the industry(tile) be triggered for random bits? */
 
enum IndustryTrigger {
 
	/** Triggered each tile loop */
 
	INDUSTRY_TRIGGER_TILELOOP_PROCESS = 1,
 
	/** Triggered (whole industry) each 256 ticks */
 
	INDUSTRY_TRIGGER_256_TICKS        = 2,
 
	/** Triggered on cargo delivery */
 
	INDUSTRY_TRIGGER_CARGO_DELIVERY   = 4,
 
};
 

	
src/newgrf_industrytiles.h
Show inline comments
 
@@ -3,25 +3,24 @@
 
/*
 
 * This file is part of OpenTTD.
 
 * OpenTTD is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2.
 
 * OpenTTD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
 
 * See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with OpenTTD. If not, see <http://www.gnu.org/licenses/>.
 
 */
 

	
 
/** @file newgrf_industrytiles.h NewGRF handling of industry tiles. */
 

	
 
#ifndef NEWGRF_INDUSTRYTILES_H
 
#define NEWGRF_INDUSTRYTILES_H
 

	
 
#include "tile_cmd.h"
 
#include "newgrf_animation_type.h"
 
#include "newgrf_industries.h"
 
#include "core/random_func.hpp"
 

	
 
bool DrawNewIndustryTile(TileInfo *ti, Industry *i, IndustryGfx gfx, const IndustryTileSpec *inds);
 
uint16 GetIndustryTileCallback(CallbackID callback, uint32 param1, uint32 param2, IndustryGfx gfx_id, Industry *industry, TileIndex tile);
 
CommandCost PerformIndustryTileSlopeCheck(TileIndex ind_base_tile, TileIndex ind_tile, const IndustryTileSpec *its, IndustryType type, IndustryGfx gfx, uint itspec_index, uint16 initial_random_bits, Owner founder, IndustryAvailabilityCallType creation_type);
 

	
 
void AnimateNewIndustryTile(TileIndex tile);
 
bool StartStopIndustryTileAnimation(TileIndex tile, IndustryAnimationTrigger iat, uint32 random = Random());
 
bool StartStopIndustryTileAnimation(const Industry *ind, IndustryAnimationTrigger iat);
 

	
src/newgrf_object.cpp
Show inline comments
 
@@ -13,24 +13,25 @@
 
#include "company_base.h"
 
#include "company_func.h"
 
#include "debug.h"
 
#include "newgrf.h"
 
#include "newgrf_class_func.h"
 
#include "newgrf_object.h"
 
#include "newgrf_sound.h"
 
#include "newgrf_spritegroup.h"
 
#include "newgrf_town.h"
 
#include "object_base.h"
 
#include "object_map.h"
 
#include "sprite.h"
 
#include "tile_cmd.h"
 
#include "town.h"
 
#include "viewport_func.h"
 
#include "water.h"
 
#include "newgrf_animation_base.h"
 

	
 
/** The override manager for our objects. */
 
ObjectOverrideManager _object_mngr(NEW_OBJECT_OFFSET, NUM_OBJECTS, INVALID_OBJECT_TYPE);
 

	
 
extern const ObjectSpec _original_objects[NEW_OBJECT_OFFSET];
 
/** All the object specifications. */
 
ObjectSpec _object_specs[NUM_OBJECTS];
 

	
src/newgrf_object.h
Show inline comments
 
@@ -5,25 +5,25 @@
 
 * OpenTTD is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2.
 
 * OpenTTD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
 
 * See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with OpenTTD. If not, see <http://www.gnu.org/licenses/>.
 
 */
 

	
 
/** @file newgrf_object.h Functions related to NewGRF objects. */
 

	
 
#ifndef NEWGRF_OBJECT_H
 
#define NEWGRF_OBJECT_H
 

	
 
#include "newgrf_callbacks.h"
 
#include "economy_func.h"
 
#include "tile_cmd.h"
 
#include "date_type.h"
 
#include "object_type.h"
 
#include "newgrf_animation_type.h"
 
#include "newgrf_class.h"
 
#include "newgrf_commons.h"
 

	
 
/** Various object behaviours. */
 
enum ObjectFlags {
 
	OBJECT_FLAG_NONE               =       0, ///< Just nothing.
 
	OBJECT_FLAG_ONLY_IN_SCENEDIT   = 1 <<  0, ///< Object can only be constructed in the scenario editor.
 
	OBJECT_FLAG_CANNOT_REMOVE      = 1 <<  1, ///< Object can not be removed.
 
	OBJECT_FLAG_AUTOREMOVE         = 1 <<  2, ///< Object get automatically removed (like "owned land").
 
	OBJECT_FLAG_BUILT_ON_WATER     = 1 <<  3, ///< Object can be built on water (not required).
src/newgrf_spritegroup.h
Show inline comments
 
@@ -4,27 +4,25 @@
 
 * This file is part of OpenTTD.
 
 * OpenTTD is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2.
 
 * OpenTTD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
 
 * See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with OpenTTD. If not, see <http://www.gnu.org/licenses/>.
 
 */
 

	
 
/** @file newgrf_spritegroup.h Action 2 handling. */
 

	
 
#ifndef NEWGRF_SPRITEGROUP_H
 
#define NEWGRF_SPRITEGROUP_H
 

	
 
#include "town_type.h"
 
#include "gfx_type.h"
 
#include "engine_type.h"
 
#include "core/pool_type.hpp"
 
#include "house_type.h"
 

	
 
#include "newgrf_callbacks.h"
 
#include "newgrf_generic.h"
 
#include "newgrf_storage.h"
 
#include "newgrf_commons.h"
 

	
 
/**
 
 * Gets the value of a so-called newgrf "register".
 
 * @param i index of the register
 
 * @pre i < 0x110
 
 * @return the value of the register
src/newgrf_station.h
Show inline comments
 
@@ -7,25 +7,24 @@
 
 * See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with OpenTTD. If not, see <http://www.gnu.org/licenses/>.
 
 */
 

	
 
/** @file newgrf_station.h Header file for NewGRF stations */
 

	
 
#ifndef NEWGRF_STATION_H
 
#define NEWGRF_STATION_H
 

	
 
#include "newgrf_animation_type.h"
 
#include "newgrf_callbacks.h"
 
#include "newgrf_class.h"
 
#include "newgrf_commons.h"
 
#include "sprite.h"
 
#include "cargo_type.h"
 
#include "station_type.h"
 
#include "rail_type.h"
 

	
 
enum StationClassID {
 
	STAT_CLASS_BEGIN = 0,    ///< the lowest valid value
 
	STAT_CLASS_DFLT = 0,     ///< Default station class.
 
	STAT_CLASS_WAYP,         ///< Waypoint class.
 
	STAT_CLASS_MAX = 32,     ///< Maximum number of classes.
 
};
 
typedef SimpleTinyEnumT<StationClassID, byte> StationClassIDByte;
 
template <> struct EnumPropsT<StationClassID> : MakeEnumPropsT<StationClassID, byte, STAT_CLASS_BEGIN, STAT_CLASS_MAX, STAT_CLASS_MAX, 8> {};
src/newgrf_storage.h
Show inline comments
 
@@ -3,25 +3,24 @@
 
/*
 
 * This file is part of OpenTTD.
 
 * OpenTTD is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2.
 
 * OpenTTD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
 
 * See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with OpenTTD. If not, see <http://www.gnu.org/licenses/>.
 
 */
 

	
 
/** @file newgrf_storage.h Functionality related to the temporary and persistent storage arrays for NewGRFs. */
 

	
 
#ifndef NEWGRF_STORAGE_H
 
#define NEWGRF_STORAGE_H
 

	
 
#include "core/alloc_func.hpp"
 
#include "core/pool_type.hpp"
 

	
 
/**
 
 * Base class for all NewGRF storage arrays. Nothing fancy, only here
 
 * so we have a generalised class to use.
 
 */
 
struct BaseStorageArray {
 
	virtual ~BaseStorageArray();
 

	
 
	/**
 
	 * Clear the changes made since the last #ClearChanges.
 
	 * This can be done in two ways:
src/newgrf_town.h
Show inline comments
 
@@ -8,16 +8,16 @@
 
 */
 

	
 
/** @file newgrf_town.h Functions to handle the town part of NewGRF towns. */
 

	
 
#ifndef NEWGRF_TOWN_H
 
#define NEWGRF_TOWN_H
 

	
 
#include "town_type.h"
 

	
 
/* Currently there is no direct town resolver; we only need to get town
 
 * variable results from inside stations, house tiles and industries,
 
 * and to check the town's persistent storage. */
 
uint32 TownGetVariable(byte variable, uint32 parameter, bool *available, Town *t, const GRFFile *caller_grffile);
 
void TownStorePSA(Town *t, const GRFFile *caller_grffile, uint pos, int32 value);
 
uint32 TownGetVariable(byte variable, uint32 parameter, bool *available, Town *t, const struct GRFFile *caller_grffile);
 
void TownStorePSA(Town *t, const struct GRFFile *caller_grffile, uint pos, int32 value);
 

	
 
#endif /* NEWGRF_TOWN_H */
src/object_base.h
Show inline comments
 
@@ -8,25 +8,24 @@
 
 */
 

	
 
/** @file object_base.h Base for all objects. */
 

	
 
#ifndef OBJECT_BASE_H
 
#define OBJECT_BASE_H
 

	
 
#include "core/pool_type.hpp"
 
#include "object_type.h"
 
#include "tilearea_type.h"
 
#include "town_type.h"
 
#include "date_type.h"
 
#include "core/smallvec_type.hpp"
 

	
 
typedef Pool<Object, ObjectID, 64, 64000> ObjectPool;
 
extern ObjectPool _object_pool;
 

	
 
/** An object, such as transmitter, on the map. */
 
struct Object : ObjectPool::PoolItem<&_object_pool> {
 
	Town *town;         ///< Town the object is built in
 
	TileArea location;  ///< Location of the object
 
	Date build_date;    ///< Date of construction
 
	byte colour;        ///< Colour of the object, for display purpose
 
	byte view;          ///< The view setting for this object
 

	
src/rail.h
Show inline comments
 
@@ -11,25 +11,24 @@
 

	
 
#ifndef RAIL_H
 
#define RAIL_H
 

	
 
#include "rail_type.h"
 
#include "track_type.h"
 
#include "gfx_type.h"
 
#include "core/bitmath_func.hpp"
 
#include "economy_func.h"
 
#include "slope_type.h"
 
#include "strings_type.h"
 
#include "date_type.h"
 
#include "core/math_func.hpp"
 

	
 
/** Railtype flags. */
 
enum RailTypeFlags {
 
	RTF_CATENARY          = 0,                           ///< Bit number for drawing a catenary.
 
	RTF_NO_LEVEL_CROSSING = 1,                           ///< Bit number for disallowing level crossings.
 

	
 
	RTFB_NONE              = 0,                          ///< All flags cleared.
 
	RTFB_CATENARY          = 1 << RTF_CATENARY,          ///< Value for drawing a catenary.
 
	RTFB_NO_LEVEL_CROSSING = 1 << RTF_NO_LEVEL_CROSSING, ///< Value for disallowing level crossings.
 
};
 
DECLARE_ENUM_AS_BIT_SET(RailTypeFlags)
 

	
src/road_func.h
Show inline comments
 
@@ -5,27 +5,24 @@
 
 * OpenTTD is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2.
 
 * OpenTTD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
 
 * See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with OpenTTD. If not, see <http://www.gnu.org/licenses/>.
 
 */
 

	
 
/** @file road_func.h Functions related to roads. */
 

	
 
#ifndef ROAD_FUNC_H
 
#define ROAD_FUNC_H
 

	
 
#include "core/bitmath_func.hpp"
 
#include "road_type.h"
 
#include "direction_type.h"
 
#include "company_type.h"
 
#include "tile_type.h"
 
#include "economy_func.h"
 

	
 
/**
 
 * Iterate through each set RoadType in a RoadTypes value.
 
 * For more informations see FOR_EACH_SET_BIT_EX.
 
 *
 
 * @param var Loop index variable that stores fallowing set road type. Must be of type RoadType.
 
 * @param road_types The value to iterate through (any expression).
 
 *
 
 * @see FOR_EACH_SET_BIT_EX
 
 */
 
#define FOR_EACH_SET_ROADTYPE(var, road_types) FOR_EACH_SET_BIT_EX(RoadType, var, RoadTypes, road_types)
src/script/api/script_basestation.cpp
Show inline comments
 
@@ -2,24 +2,25 @@
 

	
 
/*
 
 * This file is part of OpenTTD.
 
 * OpenTTD is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2.
 
 * OpenTTD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
 
 * See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with OpenTTD. If not, see <http://www.gnu.org/licenses/>.
 
 */
 

	
 
/** @file script_basestation.cpp Implementation of ScriptBaseStation. */
 

	
 
#include "../../stdafx.h"
 
#include "script_basestation.hpp"
 
#include "script_error.hpp"
 
#include "../../station_base.h"
 
#include "../../string_func.h"
 
#include "../../strings_func.h"
 
#include "table/strings.h"
 

	
 
/* static */ bool ScriptBaseStation::IsValidBaseStation(StationID station_id)
 
{
 
	const BaseStation *st = ::BaseStation::GetIfValid(station_id);
 
	return st != NULL && (st->owner == ScriptObject::GetCompany() || ScriptObject::GetCompany() == OWNER_DEITY || st->owner == OWNER_NONE);
 
}
 

	
 
/* static */ char *ScriptBaseStation::GetName(StationID station_id)
src/script/api/script_basestation.hpp
Show inline comments
 
@@ -3,25 +3,24 @@
 
/*
 
 * This file is part of OpenTTD.
 
 * OpenTTD is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2.
 
 * OpenTTD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
 
 * See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with OpenTTD. If not, see <http://www.gnu.org/licenses/>.
 
 */
 

	
 
/** @file script_basestation.hpp Base for stations/waypoint handling. */
 

	
 
#ifndef SCRIPT_BASESTATION_HPP
 
#define SCRIPT_BASESTATION_HPP
 

	
 
#include "script_error.hpp"
 
#include "script_text.hpp"
 

	
 
/**
 
 * Base class for stations and waypoints.
 
 * @api ai game
 
 */
 
class ScriptBaseStation : public ScriptObject {
 
public:
 
	/**
 
	 * Special station IDs for building adjacent/new stations when
 
	 * the adjacent/distant join features are enabled.
 
	 */
src/script/api/script_cargo.hpp
Show inline comments
 
@@ -5,25 +5,24 @@
 
 * OpenTTD is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2.
 
 * OpenTTD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
 
 * See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with OpenTTD. If not, see <http://www.gnu.org/licenses/>.
 
 */
 

	
 
/** @file script_cargo.hpp Everything to query cargoes. */
 

	
 
#ifndef SCRIPT_CARGO_HPP
 
#define SCRIPT_CARGO_HPP
 

	
 
#include "script_object.hpp"
 
#include "../../cargotype.h"
 
#include "../../cargo_type.h"
 

	
 
/**
 
 * Class that handles all cargo related functions.
 
 * @api ai game
 
 */
 
class ScriptCargo : public ScriptObject {
 
public:
 
	/**
 
	 * The classes of cargo.
 
	 */
 
	enum CargoClass {
 
		/* Note: these values represent part of the in-game CargoClass enum */
src/script/api/script_company.hpp
Show inline comments
 
@@ -3,25 +3,24 @@
 
/*
 
 * This file is part of OpenTTD.
 
 * OpenTTD is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2.
 
 * OpenTTD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
 
 * See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with OpenTTD. If not, see <http://www.gnu.org/licenses/>.
 
 */
 

	
 
/** @file script_company.hpp Everything to query a company's financials and statistics or build company related buildings. */
 

	
 
#ifndef SCRIPT_COMPANY_HPP
 
#define SCRIPT_COMPANY_HPP
 

	
 
#include "script_object.hpp"
 
#include "script_text.hpp"
 

	
 
/**
 
 * Class that handles all company related functions.
 
 * @api ai game
 
 */
 
class ScriptCompany : public ScriptObject {
 
public:
 
	/** The range of possible quarters to get company information of. */
 
	enum Quarter {
 
		CURRENT_QUARTER  = 0,                      ///< The current quarter.
 
		EARLIEST_QUARTER = ::MAX_HISTORY_QUARTERS, ///< The earliest quarter company information is available for.
src/script/api/script_controller.hpp
Show inline comments
 
@@ -3,25 +3,25 @@
 
/*
 
 * This file is part of OpenTTD.
 
 * OpenTTD is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2.
 
 * OpenTTD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
 
 * See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with OpenTTD. If not, see <http://www.gnu.org/licenses/>.
 
 */
 

	
 
/** @file script_controller.hpp The controller of the AI. */
 

	
 
#ifndef SCRIPT_CONTROLLER_HPP
 
#define SCRIPT_CONTROLLER_HPP
 

	
 
#include "../../company_type.h"
 
#include "script_types.hpp"
 
#include "../../core/string_compare_type.hpp"
 
#include <map>
 

	
 
/**
 
 * The Controller, the class each Script should extend. It creates the Script,
 
 *  makes sure the logic kicks in correctly, and that GetTick() has a valid
 
 *  value.
 
 * @api ai game
 
 */
 
class ScriptController {
 
	friend class AIScanner;
 
	friend class ScriptInstance;
src/script/api/script_event_types.hpp
Show inline comments
 
@@ -4,25 +4,24 @@
 
 * This file is part of OpenTTD.
 
 * OpenTTD is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2.
 
 * OpenTTD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
 
 * See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with OpenTTD. If not, see <http://www.gnu.org/licenses/>.
 
 */
 

	
 
/** @file script_event_types.hpp The detailed types of all events. */
 

	
 
#ifndef SCRIPT_EVENT_TYPES_HPP
 
#define SCRIPT_EVENT_TYPES_HPP
 

	
 
#include "script_event.hpp"
 
#include "script_company.hpp"
 
#include "script_goal.hpp"
 
#include "script_window.hpp"
 

	
 
/**
 
 * Event Vehicle Crash, indicating a vehicle of yours is crashed.
 
 *  It contains the crash site, the crashed vehicle and the reason for the crash.
 
 * @api ai game
 
 */
 
class ScriptEventVehicleCrashed : public ScriptEvent {
 
public:
 
	/**
 
	 * The reasons for vehicle crashes
src/script/api/script_gamesettings.cpp
Show inline comments
 
@@ -3,24 +3,25 @@
 
/*
 
 * This file is part of OpenTTD.
 
 * OpenTTD is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2.
 
 * OpenTTD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
 
 * See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with OpenTTD. If not, see <http://www.gnu.org/licenses/>.
 
 */
 

	
 
/** @file script_gamesettings.cpp Implementation of ScriptGameSettings. */
 

	
 
#include "../../stdafx.h"
 
#include "script_gamesettings.hpp"
 
#include "../../settings_internal.h"
 
#include "../../settings_type.h"
 
#include "../../command_type.h"
 

	
 
/* static */ bool ScriptGameSettings::IsValid(const char *setting)
 
{
 
	uint i;
 
	const SettingDesc *sd = GetSettingFromName(setting, &i);
 
	return sd != NULL && sd->desc.cmd != SDT_STRING;
 
}
 

	
 
/* static */ int32 ScriptGameSettings::GetValue(const char *setting)
 
{
 
	if (!IsValid(setting)) return -1;
src/script/api/script_goal.hpp
Show inline comments
 
@@ -3,25 +3,24 @@
 
/*
 
 * This file is part of OpenTTD.
 
 * OpenTTD is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2.
 
 * OpenTTD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
 
 * See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with OpenTTD. If not, see <http://www.gnu.org/licenses/>.
 
 */
 

	
 
/** @file script_goal.hpp Everything to manipulate the current running goal. */
 

	
 
#ifndef SCRIPT_GOAL_HPP
 
#define SCRIPT_GOAL_HPP
 

	
 
#include "script_object.hpp"
 
#include "script_company.hpp"
 
#include "../../goal_type.h"
 

	
 
/**
 
 * Class that handles some goal related functions.
 
 * @api game
 
 */
 
class ScriptGoal : public ScriptObject {
 
public:
 
	/**
 
	 * The goal IDs.
 
	 */
src/script/api/script_infrastructure.hpp
Show inline comments
 
@@ -3,25 +3,24 @@
 
/*
 
 * This file is part of OpenTTD.
 
 * OpenTTD is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2.
 
 * OpenTTD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
 
 * See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with OpenTTD. If not, see <http://www.gnu.org/licenses/>.
 
 */
 

	
 
/** @file script_infrastructure.hpp Everything to query a company's infrastructure. */
 

	
 
#ifndef SCRIPT_INFRASTRUCTURE_HPP
 
#define SCRIPT_INFRASTRUCTURE_HPP
 

	
 
#include "script_object.hpp"
 
#include "script_road.hpp"
 
#include "script_rail.hpp"
 

	
 
/**
 
 * Class that handles all company infrastructure related functions.
 
 * @api ai game
 
 */
 
class ScriptInfrastructure : public ScriptObject {
 
public:
 
	/** Infrastructure categories. */
 
	enum Infrastructure {
 
		INFRASTRUCTURE_RAIL,    ///< Rail infrastructure.
src/script/api/script_news.hpp
Show inline comments
 
@@ -4,25 +4,24 @@
 
 * This file is part of OpenTTD.
 
 * OpenTTD is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2.
 
 * OpenTTD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
 
 * See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with OpenTTD. If not, see <http://www.gnu.org/licenses/>.
 
 */
 

	
 
/** @file script_news.hpp Everything to handle news messages. */
 

	
 
#ifndef SCRIPT_NEWS_HPP
 
#define SCRIPT_NEWS_HPP
 

	
 
#include "script_company.hpp"
 
#include "script_text.hpp"
 
#include "../../news_type.h"
 

	
 
/**
 
 * Class that handles news messages.
 
 * @api game
 
 */
 
class ScriptNews : public ScriptObject {
 
public:
 
	/**
 
	 * Enumeration for corners of tiles.
 
	 */
 
	enum NewsType {
src/script/api/script_order.hpp
Show inline comments
 
@@ -3,25 +3,24 @@
 
/*
 
 * This file is part of OpenTTD.
 
 * OpenTTD is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2.
 
 * OpenTTD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
 
 * See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with OpenTTD. If not, see <http://www.gnu.org/licenses/>.
 
 */
 

	
 
/** @file script_order.hpp Everything to query and build orders. */
 

	
 
#ifndef SCRIPT_ORDER_HPP
 
#define SCRIPT_ORDER_HPP
 

	
 
#include "script_error.hpp"
 
#include "script_vehicle.hpp"
 
#include "../../order_type.h"
 

	
 
/**
 
 * Class that handles all order related functions.
 
 * @api ai
 
 */
 
class ScriptOrder : public ScriptObject {
 
public:
 
	/**
 
	 * All order related error messages.
 
	 */
src/script/api/script_town.hpp
Show inline comments
 
@@ -5,25 +5,24 @@
 
 * OpenTTD is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2.
 
 * OpenTTD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
 
 * See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with OpenTTD. If not, see <http://www.gnu.org/licenses/>.
 
 */
 

	
 
/** @file script_town.hpp Everything to query towns. */
 

	
 
#ifndef SCRIPT_TOWN_HPP
 
#define SCRIPT_TOWN_HPP
 

	
 
#include "script_cargo.hpp"
 
#include "script_company.hpp"
 
#include "script_text.hpp"
 
#include "../../town_type.h"
 

	
 
/**
 
 * Class that handles all town related functions.
 
 * @api ai game
 
 */
 
class ScriptTown : public ScriptObject {
 
public:
 
	/**
 
	 * Actions that one can perform on a town.
 
	 */
 
	enum TownAction {
src/script/api/script_viewport.hpp
Show inline comments
 
@@ -3,25 +3,24 @@
 
/*
 
 * This file is part of OpenTTD.
 
 * OpenTTD is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2.
 
 * OpenTTD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
 
 * See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with OpenTTD. If not, see <http://www.gnu.org/licenses/>.
 
 */
 

	
 
/** @file script_viewport.hpp Everything to manipulate the users viewport. */
 

	
 
#ifndef SCRIPT_VIEWPORT_HPP
 
#define SCRIPT_VIEWPORT_HPP
 

	
 
#include <string>
 
#include "script_object.hpp"
 

	
 
/**
 
 * Class that manipultes the users viewport.
 
 * @api game
 
 */
 
class ScriptViewport : public ScriptObject {
 
public:
 
	/**
 
	 * Scroll the viewport to the given tile, where the tile will be in the
 
	 *  center of the screen.
 
	 * @param tile The tile to put in the center of the screen.
src/script/api/script_waypoint.hpp
Show inline comments
 
@@ -4,24 +4,25 @@
 
 * This file is part of OpenTTD.
 
 * OpenTTD is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2.
 
 * OpenTTD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
 
 * See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with OpenTTD. If not, see <http://www.gnu.org/licenses/>.
 
 */
 

	
 
/** @file script_waypoint.hpp Everything to query and build waypoints. */
 

	
 
#ifndef SCRIPT_WAYPOINT_HPP
 
#define SCRIPT_WAYPOINT_HPP
 

	
 
#include "script_basestation.hpp"
 
#include "script_error.hpp"
 
#include "../../station_type.h"
 

	
 
/**
 
 * Class that handles all waypoint related functions.
 
 * @api ai game
 
 */
 
class ScriptWaypoint : public ScriptBaseStation {
 
public:
 
	/**
 
	 * All waypoint related error messages.
 
	 */
 
	enum ErrorMessages {
src/script/script_config.hpp
Show inline comments
 
@@ -7,25 +7,24 @@
 
 * See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with OpenTTD. If not, see <http://www.gnu.org/licenses/>.
 
 */
 

	
 
/** @file script_config.hpp ScriptConfig stores the configuration settings of every Script. */
 

	
 
#ifndef SCRIPT_CONFIG_HPP
 
#define SCRIPT_CONFIG_HPP
 

	
 
#include <map>
 
#include <list>
 
#include "../core/smallmap_type.hpp"
 
#include "../core/string_compare_type.hpp"
 
#include "../company_type.h"
 

	
 
/** Bitmask of flags for Script settings. */
 
enum ScriptConfigFlags {
 
	SCRIPTCONFIG_NONE      = 0x0, ///< No flags set.
 
	SCRIPTCONFIG_RANDOM    = 0x1, ///< When randomizing the Script, pick any value between min_value and max_value when on custom difficulty setting.
 
	SCRIPTCONFIG_BOOLEAN   = 0x2, ///< This value is a boolean (either 0 (false) or 1 (true) ).
 
	SCRIPTCONFIG_INGAME    = 0x4, ///< This setting can be changed while the Script is running.
 
	SCRIPTCONFIG_DEVELOPER = 0x8, ///< This setting will only be visible when the Script development tools are active.
 
};
 

	
 
typedef SmallMap<int, char *> LabelMapping; ///< Map-type used to map the setting numbers to labels.
 

	
src/script/script_instance.hpp
Show inline comments
 
@@ -7,24 +7,25 @@
 
 * See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with OpenTTD. If not, see <http://www.gnu.org/licenses/>.
 
 */
 

	
 
/** @file script_instance.hpp The ScriptInstance tracks a script. */
 

	
 
#ifndef SCRIPT_INSTANCE_HPP
 
#define SCRIPT_INSTANCE_HPP
 

	
 
#include <squirrel.h>
 
#include "script_suspend.hpp"
 

	
 
#include "../command_type.h"
 
#include "../company_type.h"
 

	
 
static const uint SQUIRREL_MAX_DEPTH = 25; ///< The maximum recursive depth for items stored in the savegame.
 

	
 
/** Runtime information about a script like a pointer to the squirrel vm and the current state. */
 
class ScriptInstance {
 
public:
 
	friend class ScriptObject;
 
	friend class ScriptController;
 

	
 
	/**
 
	 * Create a new script.
 
	 */
src/script/squirrel_helper.hpp
Show inline comments
 
@@ -4,25 +4,24 @@
 
 * This file is part of OpenTTD.
 
 * OpenTTD is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2.
 
 * OpenTTD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
 
 * See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with OpenTTD. If not, see <http://www.gnu.org/licenses/>.
 
 */
 

	
 
/** @file squirrel_helper.hpp declarations and parts of the implementation of the class for convert code */
 

	
 
#ifndef SQUIRREL_HELPER_HPP
 
#define SQUIRREL_HELPER_HPP
 

	
 
#include "squirrel.hpp"
 
#include "../core/math_func.hpp"
 
#include "../core/smallvec_type.hpp"
 
#include "../economy_type.h"
 
#include "../string_func.h"
 
#include "squirrel_helper_type.hpp"
 

	
 
template <class CL, ScriptType ST> const char *GetClassName();
 

	
 
/**
 
 * The Squirrel convert routines
 
 */
 
namespace SQConvert {
 
	/**
src/settings_internal.h
Show inline comments
 
@@ -4,26 +4,24 @@
 
 * This file is part of OpenTTD.
 
 * OpenTTD is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2.
 
 * OpenTTD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
 
 * See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with OpenTTD. If not, see <http://www.gnu.org/licenses/>.
 
 */
 

	
 
/** @file settings_internal.h Functions and types used internally for the settings configurations. */
 

	
 
#ifndef SETTINGS_INTERNAL_H
 
#define SETTINGS_INTERNAL_H
 

	
 
#include "saveload/saveload.h"
 
#include "settings_type.h"
 
#include "strings_type.h"
 

	
 
/**
 
 * Convention/Type of settings. This is then further specified if necessary
 
 * with the SLE_ (SLE_VAR/SLE_FILE) enums in saveload.h
 
 * @see VarTypes
 
 * @see SettingDescBase
 
 */
 
enum SettingDescTypeLong {
 
	/* 4 bytes allocated a maximum of 16 types for GenericType */
 
	SDT_BEGIN       = 0,
 
	SDT_NUMX        = 0, ///< any number-type
 
	SDT_BOOLX       = 1, ///< a boolean number
src/station_base.h
Show inline comments
 
@@ -8,25 +8,24 @@
 
 */
 

	
 
/** @file station_base.h Base classes/functions for stations. */
 

	
 
#ifndef STATION_BASE_H
 
#define STATION_BASE_H
 

	
 
#include "base_station_base.h"
 
#include "newgrf_airport.h"
 
#include "cargopacket.h"
 
#include "industry_type.h"
 
#include "newgrf_storage.h"
 
#include "town.h"
 

	
 
typedef Pool<BaseStation, StationID, 32, 64000> StationPool;
 
extern StationPool _station_pool;
 

	
 
static const byte INITIAL_STATION_RATING = 175;
 

	
 
/**
 
 * Stores station stats for a single cargo.
 
 */
 
struct GoodsEntry {
 
	/** Status of this cargo for the station. */
 
	enum GoodsEntryStatus {
src/station_cmd.cpp
Show inline comments
 
@@ -43,24 +43,25 @@
 
#include "newgrf_railtype.h"
 
#include "waypoint_base.h"
 
#include "waypoint_func.h"
 
#include "pbs.h"
 
#include "debug.h"
 
#include "core/random_func.hpp"
 
#include "company_base.h"
 
#include "table/airporttile_ids.h"
 
#include "newgrf_airporttiles.h"
 
#include "order_backup.h"
 
#include "newgrf_house.h"
 
#include "company_gui.h"
 
#include "widgets/station_widget.h"
 

	
 
#include "table/strings.h"
 

	
 
/**
 
 * Check whether the given tile is a hangar.
 
 * @param t the tile to of whether it is a hangar.
 
 * @pre IsTileType(t, MP_STATION)
 
 * @return true if and only if the tile is a hangar.
 
 */
 
bool IsHangar(TileIndex t)
 
{
 
	assert(IsTileType(t, MP_STATION));
src/station_func.h
Show inline comments
 
@@ -3,30 +3,27 @@
 
/*
 
 * This file is part of OpenTTD.
 
 * OpenTTD is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2.
 
 * OpenTTD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
 
 * See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with OpenTTD. If not, see <http://www.gnu.org/licenses/>.
 
 */
 

	
 
/** @file station_func.h Functions related to stations. */
 

	
 
#ifndef STATION_FUNC_H
 
#define STATION_FUNC_H
 

	
 
#include "station_type.h"
 
#include "sprite.h"
 
#include "rail_type.h"
 
#include "road_type.h"
 
#include "cargo_type.h"
 
#include "company_type.h"
 
#include "economy_func.h"
 

	
 
void ModifyStationRatingAround(TileIndex tile, Owner owner, int amount, uint radius);
 

	
 
void FindStationsAroundTiles(const TileArea &location, StationList *stations);
 

	
 
void ShowStationViewWindow(StationID station);
 
void UpdateAllStationVirtCoords();
 

	
 
CargoArray GetProductionAroundTiles(TileIndex tile, int w, int h, int rad);
 
CargoArray GetAcceptanceAroundTiles(TileIndex tile, int w, int h, int rad, uint32 *always_accepted = NULL);
 

	
src/station_gui.h
Show inline comments
 
@@ -7,25 +7,24 @@
 
 * See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with OpenTTD. If not, see <http://www.gnu.org/licenses/>.
 
 */
 

	
 
/** @file station_gui.h Contains enums and function declarations connected with stations GUI */
 

	
 
#ifndef STATION_GUI_H
 
#define STATION_GUI_H
 

	
 
#include "command_type.h"
 
#include "tilearea_type.h"
 
#include "window_type.h"
 

	
 
#include "widgets/station_widget.h"
 

	
 
/** Types of cargo to display for station coverage. */
 
enum StationCoverageType {
 
	SCT_PASSENGERS_ONLY,     ///< Draw only passenger class cargoes.
 
	SCT_NON_PASSENGERS_ONLY, ///< Draw all non-passenger class cargoes.
 
	SCT_ALL,                 ///< Draw all cargoes.
 
};
 

	
 
int DrawStationCoverageAreaText(int left, int right, int top, StationCoverageType sct, int rad, bool supplies);
 
void CheckRedrawStationCoverage(const Window *w);
 

	
 
void ShowSelectStationIfNeeded(CommandContainer cmd, TileArea ta);
src/strgen/strgen.h
Show inline comments
 
@@ -3,24 +3,26 @@
 
/*
 
 * This file is part of OpenTTD.
 
 * OpenTTD is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2.
 
 * OpenTTD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
 
 * See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with OpenTTD. If not, see <http://www.gnu.org/licenses/>.
 
 */
 

	
 
/** @file strgen.h Structures related to strgen. */
 

	
 
#ifndef STRGEN_H
 
#define STRGEN_H
 

	
 
#include "../language.h"
 

	
 
/** Container for the different cases of a string. */
 
struct Case {
 
	int caseidx;  ///< The index of the case.
 
	char *string; ///< The translation of the case.
 
	Case *next;   ///< The next, chained, case.
 

	
 
	Case(int caseidx, const char *string, Case *next);
 
	~Case();
 
};
 

	
 
/** Information about a single string. */
 
struct LangString {
src/tar_type.h
Show inline comments
 
@@ -6,24 +6,26 @@
 
 * OpenTTD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
 
 * See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with OpenTTD. If not, see <http://www.gnu.org/licenses/>.
 
 */
 

	
 
/** @file tar_type.h Structs, typedefs and macros used for TAR file handling. */
 

	
 
#ifndef TAR_TYPE_H
 
#define TAR_TYPE_H
 

	
 
#include <map>
 
#include <string>
 

	
 
#include "fileio_type.h"
 

	
 
/** The define of a TarList. */
 
struct TarListEntry {
 
	const char *filename;
 
	const char *dirname;
 

	
 
	/* MSVC goes copying around this struct after initialisation, so it tries
 
	 * to free filename, which isn't set at that moment... but because it
 
	 * initializes the variable with garbage, it's going to segfault. */
 
	TarListEntry() : filename(NULL), dirname(NULL) {}
 
	~TarListEntry() { free(this->filename); free(this->dirname); }
 
};
 

	
src/textbuf_gui.h
Show inline comments
 
@@ -6,25 +6,24 @@
 
 * OpenTTD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
 
 * See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with OpenTTD. If not, see <http://www.gnu.org/licenses/>.
 
 */
 

	
 
/** @file textbuf_gui.h Stuff related to the text buffer GUI. */
 

	
 
#ifndef TEXTBUF_GUI_H
 
#define TEXTBUF_GUI_H
 

	
 
#include "window_type.h"
 
#include "string_type.h"
 
#include "strings_type.h"
 
#include "core/enum_type.hpp"
 

	
 
/** Helper/buffer for input fields. */
 
struct Textbuf {
 
	char *buf;                ///< buffer in which text is saved
 
	uint16 max_bytes;         ///< the maximum size of the buffer in bytes (including terminating '\0')
 
	uint16 max_chars;         ///< the maximum size of the buffer in characters (including terminating '\0')
 
	uint16 bytes;             ///< the current size of the string in bytes (including terminating '\0')
 
	uint16 chars;             ///< the current size of the string in characters (including terminating '\0')
 
	uint16 pixels;            ///< the current size of the string in pixels
 
	bool caret;               ///< is the caret ("_") visible or not
 
	uint16 caretpos;          ///< the current position of the caret in the buffer, in bytes
 
	uint16 caretxoffs;        ///< the current position of the caret in pixels
src/tilematrix_type.hpp
Show inline comments
 
@@ -3,25 +3,25 @@
 
/*
 
 * This file is part of OpenTTD.
 
 * OpenTTD is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2.
 
 * OpenTTD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
 
 * See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with OpenTTD. If not, see <http://www.gnu.org/licenses/>.
 
 */
 

	
 
/** @file tilematrix_type.hpp Template for storing a value per area of the map. */
 

	
 
#ifndef TILEMATRIX_TYPE_HPP
 
#define TILEMATRIX_TYPE_HPP
 

	
 
#include "core/mem_func.hpp"
 
#include "core/alloc_func.hpp"
 
#include "tilearea_type.h"
 

	
 
/**
 
 * A simple matrix that stores one value per N*N square of the map.
 
 * Storage is only allocated for the part of the map that has values
 
 * assigned.
 
 *
 
 * @note No constructor is called for newly allocated values, you
 
 *       have to do this yourself if needed.
 
 * @tparam T The type of the stored items.
 
 * @tparam N Grid size.
 
 */
src/town.h
Show inline comments
 
@@ -3,27 +3,25 @@
 
/*
 
 * This file is part of OpenTTD.
 
 * OpenTTD is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2.
 
 * OpenTTD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
 
 * See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with OpenTTD. If not, see <http://www.gnu.org/licenses/>.
 
 */
 

	
 
/** @file town.h Base of the town class. */
 

	
 
#ifndef TOWN_H
 
#define TOWN_H
 

	
 
#include "core/pool_type.hpp"
 
#include "viewport_type.h"
 
#include "command_type.h"
 
#include "town_map.h"
 
#include "subsidy_type.h"
 
#include "newgrf_storage.h"
 
#include "cargotype.h"
 
#include "tilematrix_type.hpp"
 
#include <list>
 

	
 
template <typename T>
 
struct BuildingCounts {
 
	T id_count[HOUSE_MAX];
 
	T class_count[HOUSE_CLASS_MAX];
 
};
src/vehicle_func.h
Show inline comments
 
@@ -12,25 +12,24 @@
 
#ifndef VEHICLE_FUNC_H
 
#define VEHICLE_FUNC_H
 

	
 
#include "gfx_type.h"
 
#include "direction_type.h"
 
#include "command_type.h"
 
#include "vehicle_type.h"
 
#include "engine_type.h"
 
#include "transport_type.h"
 
#include "newgrf_config.h"
 
#include "track_type.h"
 
#include "livery.h"
 
#include "cargotype.h"
 

	
 
#define is_custom_sprite(x) (x >= 0xFD)
 
#define IS_CUSTOM_FIRSTHEAD_SPRITE(x) (x == 0xFD)
 
#define IS_CUSTOM_SECONDHEAD_SPRITE(x) (x == 0xFE)
 

	
 
static const int VEHICLE_PROFIT_MIN_AGE = DAYS_IN_YEAR * 2; ///< Only vehicles older than this have a meaningful profit.
 
static const Money VEHICLE_PROFIT_THRESHOLD = 10000;        ///< Threshold for a vehicle to be considered making good profit.
 

	
 
typedef Vehicle *VehicleFromPosProc(Vehicle *v, void *data);
 

	
 
void VehicleServiceInDepot(Vehicle *v);
 
uint CountVehiclesInChain(const Vehicle *v);
src/vehicle_gui.h
Show inline comments
 
@@ -9,25 +9,24 @@
 

	
 
/** @file vehicle_gui.h Functions related to the vehicle's GUIs. */
 

	
 
#ifndef VEHICLE_GUI_H
 
#define VEHICLE_GUI_H
 

	
 
#include "window_type.h"
 
#include "vehicle_type.h"
 
#include "order_type.h"
 
#include "station_type.h"
 
#include "engine_type.h"
 
#include "company_type.h"
 
#include "widgets/vehicle_widget.h"
 

	
 
void ShowVehicleRefitWindow(const Vehicle *v, VehicleOrderID order, Window *parent, bool auto_refit = false);
 

	
 
/** The tabs in the train details window */
 
enum TrainDetailsWindowTabs {
 
	TDW_TAB_CARGO = 0, ///< Tab with cargo carried by the vehicles
 
	TDW_TAB_INFO,      ///< Tab with name and value of the vehicles
 
	TDW_TAB_CAPACITY,  ///< Tab with cargo capacity of the vehicles
 
	TDW_TAB_TOTALS,    ///< Tab with sum of total cargo transported
 
};
 

	
 
int DrawVehiclePurchaseInfo(int left, int right, int y, EngineID engine_number);
src/water.h
Show inline comments
 
@@ -3,30 +3,26 @@
 
/*
 
 * This file is part of OpenTTD.
 
 * OpenTTD is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2.
 
 * OpenTTD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
 
 * See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with OpenTTD. If not, see <http://www.gnu.org/licenses/>.
 
 */
 

	
 
/** @file water.h Functions related to water (management) */
 

	
 
#ifndef WATER_H
 
#define WATER_H
 

	
 
#include "tile_type.h"
 
#include "company_type.h"
 
#include "slope_type.h"
 
#include "water_map.h"
 
#include "economy_func.h"
 
#include "core/math_func.hpp"
 

	
 
/**
 
 * Describes the behaviour of a tile during flooding.
 
 */
 
enum FloodingBehaviour {
 
	FLOOD_NONE,    ///< The tile does not flood neighboured tiles.
 
	FLOOD_ACTIVE,  ///< The tile floods neighboured tiles.
 
	FLOOD_PASSIVE, ///< The tile does not actively flood neighboured tiles, but it prevents them from drying up.
 
	FLOOD_DRYUP,   ///< The tile drys up if it is not constantly flooded from neighboured tiles.
 
};
 

	
 
FloodingBehaviour GetFloodingBehaviour(TileIndex tile);
src/water_cmd.cpp
Show inline comments
 
@@ -29,24 +29,25 @@
 
#include "tree_map.h"
 
#include "aircraft.h"
 
#include "effectvehicle_func.h"
 
#include "tunnelbridge_map.h"
 
#include "station_base.h"
 
#include "ai/ai.hpp"
 
#include "game/game.hpp"
 
#include "core/random_func.hpp"
 
#include "core/backup_type.hpp"
 
#include "date_func.h"
 
#include "company_base.h"
 
#include "company_gui.h"
 
#include "newgrf_generic.h"
 

	
 
#include "table/strings.h"
 

	
 
/**
 
 * Describes from which directions a specific slope can be flooded (if the tile is floodable at all).
 
 */
 
static const uint8 _flood_from_dirs[] = {
 
	(1 << DIR_NW) | (1 << DIR_SW) | (1 << DIR_SE) | (1 << DIR_NE), // SLOPE_FLAT
 
	(1 << DIR_NE) | (1 << DIR_SE),                                 // SLOPE_W
 
	(1 << DIR_NW) | (1 << DIR_NE),                                 // SLOPE_S
 
	(1 << DIR_NE),                                                 // SLOPE_SW
 
	(1 << DIR_NW) | (1 << DIR_SW),                                 // SLOPE_E
src/widgets/ai_widget.h
Show inline comments
 
@@ -3,24 +3,26 @@
 
/*
 
 * This file is part of OpenTTD.
 
 * OpenTTD is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2.
 
 * OpenTTD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
 
 * See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with OpenTTD. If not, see <http://www.gnu.org/licenses/>.
 
 */
 

	
 
/** @file ai_widget.h Types related to the ai widgets. */
 

	
 
#ifndef WIDGETS_AI_WIDGET_H
 
#define WIDGETS_AI_WIDGET_H
 

	
 
#include "../company_type.h"
 

	
 
/** Widgets of the #AIListWindow class. */
 
enum AIListWidgets {
 
	WID_AIL_CAPTION,   ///< Caption of the window.
 
	WID_AIL_LIST,      ///< The matrix with all available AIs.
 
	WID_AIL_SCROLLBAR, ///< Scrollbar next to the AI list.
 
	WID_AIL_INFO_BG,   ///< Panel to draw some AI information on.
 
	WID_AIL_ACCEPT,    ///< Accept button.
 
	WID_AIL_CANCEL,    ///< Cancel button.
 
};
 

	
 
/** Widgets of the #AISettingsWindow class. */
 
enum AISettingsWidgets {
src/widgets/graph_widget.h
Show inline comments
 
@@ -4,24 +4,25 @@
 
 * This file is part of OpenTTD.
 
 * OpenTTD is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2.
 
 * OpenTTD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
 
 * See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with OpenTTD. If not, see <http://www.gnu.org/licenses/>.
 
 */
 

	
 
/** @file graph_widget.h Types related to the graph widgets. */
 

	
 
#ifndef WIDGETS_GRAPH_WIDGET_H
 
#define WIDGETS_GRAPH_WIDGET_H
 

	
 
#include "../economy_type.h"
 
#include "../company_type.h"
 

	
 
/** Widgets of the #GraphLegendWindow class. */
 
enum GraphLegendWidgets {
 
	WID_GL_BACKGROUND,    ///< Background of the window.
 

	
 
	WID_GL_FIRST_COMPANY, ///< First company in the legend.
 
	WID_GL_LAST_COMPANY = WID_GL_FIRST_COMPANY + MAX_COMPANIES - 1, ///< Last company in the legend.
 
};
 

	
 
/** Widgets of the #OperatingProfitGraphWindow class, #IncomeGraphWindow class, #DeliveredCargoGraphWindow class, and #CompanyValueGraphWindow class. */
 
enum CompanyValueWidgets {
 
	WID_CV_KEY_BUTTON, ///< Key button.
0 comments (0 inline, 0 general)