Changeset - r14748:2a6d539b6173
[Not reviewed]
master
0 7 0
terkhen - 14 years ago 2010-03-06 12:58:33
terkhen@openttd.org
(svn r19346) -Feature: Configurable slope steepness for road vehicles from 0% to 10%, default is 7%.
7 files changed with 22 insertions and 3 deletions:
0 comments (0 inline, 0 general)
src/lang/english.txt
Show inline comments
 
@@ -1087,6 +1087,7 @@ STR_CONFIG_SETTING_ROAD_VEHICLE_ACCELERA
 
STR_CONFIG_SETTING_ROAD_VEHICLE_ACCELERATION_MODEL_ORIGINAL     :Original
 
STR_CONFIG_SETTING_ROAD_VEHICLE_ACCELERATION_MODEL_REALISTIC    :Realistic
 
STR_CONFIG_SETTING_TRAIN_SLOPE_STEEPNESS                        :{LTBLUE}Slope steepness for trains {ORANGE}{STRING1}%
 
STR_CONFIG_SETTING_ROAD_VEHICLE_SLOPE_STEEPNESS                 :{LTBLUE}Slope steepness for road vehicles {ORANGE}{STRING1}%
 
STR_CONFIG_SETTING_FORBID_90_DEG                                :{LTBLUE}Forbid trains and ships to make 90 deg 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}
src/roadveh.h
Show inline comments
 
@@ -255,8 +255,7 @@ protected: // These functions should not
 
	 */
 
	FORCEINLINE uint32 GetSlopeSteepness() const
 
	{
 
		/* Road vehicles use by default a steeper slope than trains. */
 
		return 20 * 7; // 1% slope * slope steepness
 
		return 20 * _settings_game.vehicle.roadveh_slope_steepness; // 1% slope * slope steepness
 
	}
 

	
 
	/**
src/saveload/saveload.cpp
Show inline comments
 
@@ -46,7 +46,7 @@
 

	
 
#include "saveload_internal.h"
 

	
 
extern const uint16 SAVEGAME_VERSION = 138;
 
extern const uint16 SAVEGAME_VERSION = 139;
 

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

	
src/settings.cpp
Show inline comments
 
@@ -794,6 +794,21 @@ static bool RoadVehAccelerationModelChan
 
	return true;
 
}
 

	
 
/**
 
 * This function updates the road vehicle acceleration cache after a steepness change.
 
 * @param p1 Callback parameter.
 
 * @return Always true.
 
 */
 
static bool RoadVehSlopeSteepnessChanged(int32 p1)
 
{
 
	RoadVehicle *rv;
 
	FOR_ALL_ROADVEHICLES(rv) {
 
		if (rv->IsRoadVehFront()) rv->CargoChanged();
 
	}
 

	
 
	return true;
 
}
 

	
 
static bool DragSignalsDensityChanged(int32)
 
{
 
	InvalidateWindowData(WC_BUILD_SIGNAL, 0);
src/settings_gui.cpp
Show inline comments
 
@@ -1466,6 +1466,7 @@ static SettingEntry _settings_vehicles[]
 
	SettingEntry("order.timetabling"),
 
	SettingEntry("vehicle.dynamic_engines"),
 
	SettingEntry("vehicle.roadveh_acceleration_model"),
 
	SettingEntry("vehicle.roadveh_slope_steepness"),
 
};
 
/** Vehicles sub-page */
 
static SettingsPage _settings_vehicles_page = {_settings_vehicles, lengthof(_settings_vehicles)};
src/settings_type.h
Show inline comments
 
@@ -312,6 +312,7 @@ struct VehicleSettings {
 
	uint8  train_acceleration_model;         ///< realistic acceleration for trains
 
	uint8  roadveh_acceleration_model;       ///< realistic acceleration for road vehicles
 
	uint8  train_slope_steepness;            ///< Steepness of hills for trains when using realistic acceleration
 
	uint8  roadveh_slope_steepness;          ///< Steepness of hills for road vehicles when using realistic acceleration
 
	bool   wagon_speed_limits;               ///< enable wagon speed limits
 
	bool   disable_elrails;                  ///< when true, the elrails are disabled
 
	UnitID max_trains;                       ///< max trains in game per company
src/table/settings.h
Show inline comments
 
@@ -25,6 +25,7 @@ static bool CheckInterval(int32 p1);
 
static bool TrainAccelerationModelChanged(int32 p1);
 
static bool RoadVehAccelerationModelChanged(int32 p1);
 
static bool TrainSlopeSteepnessChanged(int32 p1);
 
static bool RoadVehSlopeSteepnessChanged(int32 p1);
 
static bool DragSignalsDensityChanged(int32);
 
static bool TownFoundingChanged(int32 p1);
 
static bool DifficultyReset(int32 level);
 
@@ -374,6 +375,7 @@ const SettingDesc _settings[] = {
 
	     SDT_VAR(GameSettings, vehicle.train_acceleration_model,     SLE_UINT8,                     0,MS,     0,     0,       1, 1, STR_CONFIG_SETTING_TRAIN_ACCELERATION_MODEL, TrainAccelerationModelChanged),
 
	 SDT_CONDVAR(GameSettings, vehicle.roadveh_acceleration_model,   SLE_UINT8,139, SL_MAX_VERSION, 0,MS,     0,     0,       1, 1, STR_CONFIG_SETTING_ROAD_VEHICLE_ACCELERATION_MODEL, RoadVehAccelerationModelChanged),
 
	 SDT_CONDVAR(GameSettings, vehicle.train_slope_steepness,        SLE_UINT8,133, SL_MAX_VERSION, 0, 0,     3,     0,      10, 1, STR_CONFIG_SETTING_TRAIN_SLOPE_STEEPNESS,  TrainSlopeSteepnessChanged),
 
	 SDT_CONDVAR(GameSettings, vehicle.roadveh_slope_steepness,      SLE_UINT8,139, SL_MAX_VERSION, 0, 0,     7,     0,      10, 1, STR_CONFIG_SETTING_ROAD_VEHICLE_SLOPE_STEEPNESS,  RoadVehSlopeSteepnessChanged),
 
	    SDT_BOOL(GameSettings, pf.forbid_90_deg,                                                    0, 0, false,                    STR_CONFIG_SETTING_FORBID_90_DEG,          NULL),
 
	    SDT_BOOL(GameSettings, vehicle.mammoth_trains,                                              0,NN,  true,                    STR_CONFIG_SETTING_MAMMOTHTRAINS,          NULL),
 
	    SDT_BOOL(GameSettings, order.gotodepot,                                                     0, 0,  true,                    STR_CONFIG_SETTING_GOTODEPOT,              NULL),
0 comments (0 inline, 0 general)