Changeset - r15961:9492ed63ba2b
[Not reviewed]
master
0 6 0
rubidium - 14 years ago 2010-08-28 18:37:49
rubidium@openttd.org
(svn r20659) -Feature: make the (flat) area around an industry configurable (Eddi|zuHause)
6 files changed with 10 insertions and 4 deletions:
0 comments (0 inline, 0 general)
src/industry_cmd.cpp
Show inline comments
 
@@ -1443,27 +1443,28 @@ static bool CheckIfCanLevelIndustryPlatf
 
	do {
 
		if (it->gfx == 0xFF) continue;  //  FF been a marquer for a check on clear water, skip it
 
		if (it->ti.x > max_x) max_x = it->ti.x;
 
		if (it->ti.y > max_y) max_y = it->ti.y;
 
	} while ((++it)->ti.x != MKEND);
 

	
 
	/* Remember level height */
 
	uint h = TileHeight(tile);
 

	
 
	if (TileX(tile) <= 1 || TileY(tile) <= 1) return false;
 
	/* Check that all tiles in area and surrounding are clear
 
	 * this determines that there are no obstructing items */
 
	TileIndex cur_tile = tile + TileDiffXY(-1, -1);
 
	uint size_x = max_x + 4;
 
	uint size_y = max_y + 4;
 

	
 
	TileIndex cur_tile = tile + TileDiffXY(-_settings_game.construction.industry_platform, -_settings_game.construction.industry_platform);
 
	uint size_x = max_x + 2 + 2 * _settings_game.construction.industry_platform;
 
	uint size_y = max_y + 2 + 2 * _settings_game.construction.industry_platform;
 

	
 
	/* Check if we don't leave the map */
 
	if (TileX(cur_tile) + size_x >= MapMaxX() || TileY(cur_tile) + size_y >= MapMaxY()) return false;
 

	
 
	/* _current_company is OWNER_NONE for randomly generated industries and in editor, or the company who funded or prospected the industry.
 
	 * Perform terraforming as OWNER_TOWN to disable autoslope and town ratings. */
 
	Backup<CompanyByte> cur_company(_current_company, OWNER_TOWN, FILE_LINE);
 

	
 
	TILE_LOOP(tile_walk, size_x, size_y, cur_tile) {
 
		uint curh = TileHeight(tile_walk);
 
		if (curh != h) {
 
			/* This tile needs terraforming. Check if we can do that without
src/lang/english.txt
Show inline comments
 
@@ -1102,24 +1102,25 @@ STR_CONFIG_SETTING_FORBID_90_DEG                                :{LTBLUE}Forbid trains and ships from making 90° turns: {ORANGE}{STRING1} {LTBLUE} (not with OPF)
 
STR_CONFIG_SETTING_JOINSTATIONS                                 :{LTBLUE}Join train stations built next to each other: {ORANGE}{STRING1}
 
STR_CONFIG_SETTING_DISTANT_JOIN_STATIONS                        :{LTBLUE}Allow to join stations not directly adjacent: {ORANGE}{STRING1}
 
STR_CONFIG_SETTING_IMPROVEDLOAD                                 :{LTBLUE}Use improved loading algorithm: {ORANGE}{STRING1}
 
STR_CONFIG_SETTING_GRADUAL_LOADING                              :{LTBLUE}Load vehicles gradually: {ORANGE}{STRING1}
 
STR_CONFIG_SETTING_INFLATION                                    :{LTBLUE}Inflation: {ORANGE}{STRING1}
 
STR_CONFIG_SETTING_SELECTGOODS                                  :{LTBLUE}Deliver cargo to a station only when there is a demand: {ORANGE}{STRING1}
 
STR_CONFIG_SETTING_LONGBRIDGES                                  :{LTBLUE}Allow building very long bridges: {ORANGE}{STRING1}
 
STR_CONFIG_SETTING_GOTODEPOT                                    :{LTBLUE}Allow goto depot orders: {ORANGE}{STRING1}
 
STR_CONFIG_SETTING_RAW_INDUSTRY_CONSTRUCTION_METHOD             :{LTBLUE}Manual primary industry construction method: {ORANGE}{STRING1}
 
STR_CONFIG_SETTING_RAW_INDUSTRY_CONSTRUCTION_METHOD_NONE        :none
 
STR_CONFIG_SETTING_RAW_INDUSTRY_CONSTRUCTION_METHOD_NORMAL      :as other industries
 
STR_CONFIG_SETTING_RAW_INDUSTRY_CONSTRUCTION_METHOD_PROSPECTING :prospecting
 
STR_CONFIG_SETTING_INDUSTRY_PLATFORM                            :{LTBLUE}Flat area around industries: {ORANGE}{STRING1} tile{P 0:1 "" s}
 
STR_CONFIG_SETTING_MULTIPINDTOWN                                :{LTBLUE}Allow multiple similar industries per town: {ORANGE}{STRING1}
 
STR_CONFIG_SETTING_LONGDATE                                     :{LTBLUE}Always show long date in the status bar: {ORANGE}{STRING1}
 
STR_CONFIG_SETTING_SIGNALSIDE                                   :{LTBLUE}Show signals on the drive side: {ORANGE}{STRING1}
 
STR_CONFIG_SETTING_SHOWFINANCES                                 :{LTBLUE}Show finances window at the end of the year: {ORANGE}{STRING1}
 
STR_CONFIG_SETTING_NONSTOP_BY_DEFAULT                           :{LTBLUE}New orders are 'non-stop' by default: {ORANGE}{STRING1}
 
STR_CONFIG_SETTING_STOP_LOCATION                                :{LTBLUE}New train orders stop by default at the {ORANGE}{STRING1}{LTBLUE} of the platform
 
STR_CONFIG_SETTING_STOP_LOCATION_NEAR_END                       :near end
 
STR_CONFIG_SETTING_STOP_LOCATION_MIDDLE                         :middle
 
STR_CONFIG_SETTING_STOP_LOCATION_FAR_END                        :far end
 
STR_CONFIG_SETTING_ROAD_VEHICLE_QUEUEING                        :{LTBLUE}Road vehicle queueing (with quantum effects): {ORANGE}{STRING1}
 
STR_CONFIG_SETTING_AUTOSCROLL                                   :{LTBLUE}Pan window when mouse is at the edge: {ORANGE}{STRING1}
 
STR_CONFIG_SETTING_BRIBE                                        :{LTBLUE}Allow bribing of the local authority: {ORANGE}{STRING1}
src/saveload/saveload.cpp
Show inline comments
 
@@ -201,26 +201,27 @@
 
 *  136   18764
 
 *  137   18912
 
 *  138   18942   1.0.x
 
 *  139   19346
 
 *  140   19382
 
 *  141   19799
 
 *  142   20003
 
 *  143   20048
 
 *  144   20334
 
 *  145   20376
 
 *  146   20446
 
 *  147   20621
 
 *  148   20659
 
 */
 
extern const uint16 SAVEGAME_VERSION = 147; ///< current savegame version of OpenTTD
 
extern const uint16 SAVEGAME_VERSION = 148; ///< current savegame version of OpenTTD
 

	
 
SavegameType _savegame_type; ///< type of savegame we are loading
 

	
 
uint32 _ttdp_version;     ///< version of TTDP savegame (if applicable)
 
uint16 _sl_version;       ///< the major savegame version identifier
 
byte   _sl_minor_version; ///< the minor savegame version, DO NOT USE!
 
char _savegame_format[8]; ///< how to compress savegames
 
bool _do_autosave;        ///< are we doing an autosave at the moment?
 

	
 
typedef void WriterProc(size_t len);
 
typedef size_t ReaderProc();
 

	
src/settings_gui.cpp
Show inline comments
 
@@ -1362,24 +1362,25 @@ static SettingEntry _settings_economy_to
 
	SettingEntry("economy.allow_town_level_crossings"),
 
	SettingEntry("economy.found_town"),
 
	SettingEntry("economy.mod_road_rebuild"),
 
	SettingEntry("economy.town_growth_rate"),
 
	SettingEntry("economy.larger_towns"),
 
	SettingEntry("economy.initial_city_size"),
 
};
 
/** Towns sub-page */
 
static SettingsPage _settings_economy_towns_page = {_settings_economy_towns, lengthof(_settings_economy_towns)};
 

	
 
static SettingEntry _settings_economy_industries[] = {
 
	SettingEntry("construction.raw_industry_construction"),
 
	SettingEntry("construction.industry_platform"),
 
	SettingEntry("economy.multiple_industry_per_town"),
 
	SettingEntry("game_creation.oil_refinery_limit"),
 
};
 
/** Industries sub-page */
 
static SettingsPage _settings_economy_industries_page = {_settings_economy_industries, lengthof(_settings_economy_industries)};
 

	
 
static SettingEntry _settings_economy[] = {
 
	SettingEntry(&_settings_economy_towns_page, STR_CONFIG_SETTING_ECONOMY_TOWNS),
 
	SettingEntry(&_settings_economy_industries_page, STR_CONFIG_SETTING_ECONOMY_INDUSTRIES),
 
	SettingEntry("economy.inflation"),
 
	SettingEntry("economy.smooth_economy"),
 
	SettingEntry("economy.feeder_payment_share"),
src/settings_type.h
Show inline comments
 
@@ -182,24 +182,25 @@ struct GameCreationSettings {
 
};
 

	
 
/** Settings related to construction in-game */
 
struct ConstructionSettings {
 
	bool   build_on_slopes;                  ///< allow building on slopes
 
	bool   autoslope;                        ///< allow terraforming under things
 
	bool   longbridges;                      ///< allow 100 tile long bridges
 
	bool   signal_side;                      ///< show signals on right side
 
	bool   extra_dynamite;                   ///< extra dynamite
 
	bool   road_stop_on_town_road;           ///< allow building of drive-through road stops on town owned roads
 
	bool   road_stop_on_competitor_road;     ///< allow building of drive-through road stops on roads owned by competitors
 
	uint8  raw_industry_construction;        ///< type of (raw) industry construction (none, "normal", prospecting)
 
	uint8  industry_platform;                ///< the amount of flat land around an industry
 
	bool   freeform_edges;                   ///< allow terraforming the tiles at the map edges
 
	uint8  extra_tree_placement;             ///< (dis)allow building extra trees in-game
 
};
 

	
 
/** Settings related to the AI. */
 
struct AISettings {
 
	bool   ai_in_multiplayer;                ///< so we allow AIs in multiplayer
 
	bool   ai_disable_veh_train;             ///< disable types for AI
 
	bool   ai_disable_veh_roadveh;           ///< disable types for AI
 
	bool   ai_disable_veh_aircraft;          ///< disable types for AI
 
	bool   ai_disable_veh_ship;              ///< disable types for AI
 
	uint32 ai_max_opcode_till_suspend;       ///< max opcode calls till AI will suspend
src/table/settings.h
Show inline comments
 
@@ -423,24 +423,25 @@ const SettingDesc _settings[] = {
 
	     SDT_VAR(GameSettings, station.station_spread,               SLE_UINT8,                     0, 0,    12,     4,      64, 0, STR_CONFIG_SETTING_STATION_SPREAD,         InvalidateStationBuildWindow),
 
	    SDT_BOOL(GameSettings, order.serviceathelipad,                                              0, 0,  true,                    STR_CONFIG_SETTING_SERVICEATHELIPAD,       NULL),
 
	    SDT_BOOL(GameSettings, station.modified_catchment,                                          0, 0,  true,                    STR_CONFIG_SETTING_CATCHMENT,              StationCatchmentChanged),
 
	SDT_CONDBOOL(GameSettings, order.gradual_loading,                           40, SL_MAX_VERSION, 0,NN,  true,                    STR_CONFIG_SETTING_GRADUAL_LOADING,        NULL),
 
	SDT_CONDBOOL(GameSettings, construction.road_stop_on_town_road,             47, SL_MAX_VERSION, 0, 0,  true,                    STR_CONFIG_SETTING_STOP_ON_TOWN_ROAD,      NULL),
 
	SDT_CONDBOOL(GameSettings, construction.road_stop_on_competitor_road,      114, SL_MAX_VERSION, 0, 0,  true,                    STR_CONFIG_SETTING_STOP_ON_COMPETITOR_ROAD,NULL),
 
	SDT_CONDBOOL(GameSettings, station.adjacent_stations,                       62, SL_MAX_VERSION, 0, 0,  true,                    STR_CONFIG_SETTING_ADJACENT_STATIONS,      NULL),
 
	SDT_CONDBOOL(GameSettings, economy.station_noise_level,                     96, SL_MAX_VERSION, 0,NN, false,                    STR_CONFIG_SETTING_NOISE_LEVEL,            InvalidateTownViewWindow),
 
	SDT_CONDBOOL(GameSettings, station.distant_join_stations,                  106, SL_MAX_VERSION, 0, 0,  true,                    STR_CONFIG_SETTING_DISTANT_JOIN_STATIONS,  DeleteSelectStationWindow),
 

	
 
	    SDT_BOOL(GameSettings, economy.inflation,                                                   0, 0,  true,                    STR_CONFIG_SETTING_INFLATION,              NULL),
 
	     SDT_VAR(GameSettings, construction.raw_industry_construction, SLE_UINT8,                   0,MS,     0,     0,       2, 0, STR_CONFIG_SETTING_RAW_INDUSTRY_CONSTRUCTION_METHOD, InvalidateBuildIndustryWindow),
 
	 SDT_CONDVAR(GameSettings, construction.industry_platform,       SLE_UINT8,148, SL_MAX_VERSION, 0, 0,     1,     0,       4, 0, STR_CONFIG_SETTING_INDUSTRY_PLATFORM,      NULL),
 
	    SDT_BOOL(GameSettings, economy.multiple_industry_per_town,                                  0, 0, false,                    STR_CONFIG_SETTING_MULTIPINDTOWN,          NULL),
 
	SDT_CONDNULL(                                                            1,  0, 140),
 
	    SDT_BOOL(GameSettings, economy.bribe,                                                       0, 0,  true,                    STR_CONFIG_SETTING_BRIBE,                  NULL),
 
	SDT_CONDBOOL(GameSettings, economy.exclusive_rights,                        79, SL_MAX_VERSION, 0, 0,  true,                    STR_CONFIG_SETTING_ALLOW_EXCLUSIVE,        NULL),
 
	SDT_CONDBOOL(GameSettings, economy.give_money,                              79, SL_MAX_VERSION, 0, 0,  true,                    STR_CONFIG_SETTING_ALLOW_GIVE_MONEY,       NULL),
 
	     SDT_VAR(GameSettings, game_creation.snow_line_height,       SLE_UINT8,                     0, 0, DEF_SNOWLINE_HEIGHT, MIN_SNOWLINE_HEIGHT, DEF_SNOWLINE_HEIGHT, 0, STR_CONFIG_SETTING_SNOWLINE_HEIGHT, NULL),
 
	SDT_CONDNULL(                                                            4,  0, 143),
 
	     SDT_VAR(GameSettings, game_creation.starting_year,          SLE_INT32,                     0,NC,DEF_START_YEAR,MIN_YEAR,MAX_YEAR,1,STR_CONFIG_SETTING_STARTING_YEAR,  NULL),
 
	SDT_CONDNULL(                                                            4,  0, 104),
 
	    SDT_BOOL(GameSettings, economy.smooth_economy,                                              0, 0,  true,                    STR_CONFIG_SETTING_SMOOTH_ECONOMY,         NULL),
 
	    SDT_BOOL(GameSettings, economy.allow_shares,                                                0, 0, false,                    STR_CONFIG_SETTING_ALLOW_SHARES,           NULL),
 
	 SDT_CONDVAR(GameSettings, economy.feeder_payment_share,         SLE_UINT8,134, SL_MAX_VERSION, 0, 0,    75,     0,     100, 0, STR_CONFIG_SETTING_FEEDER_PAYMENT_SHARE,   NULL),
0 comments (0 inline, 0 general)