mirror of https://github.com/OpenTTD/OpenTTD
(svn r19551) [1.0] -Backport from trunk:
- Feature: Add rail speed limit to land area information window (r19434) - Fix: [NewGRF] Bytes and words get sign-extended for temporary/persistent storage (r19497) - Fix: Stop reducing the size of the vehicle list after selecting a vehicle with a long description (r19480) - Fix: Implement custom sound effect for helicopter take-off [FS#3668] (r19364) - Update: Plural type of Slovak (r19452)release/1.0
parent
6837650080
commit
3106bb110e
|
@ -16,8 +16,6 @@
|
|||
*
|
||||
* \b 1.0.0
|
||||
*
|
||||
* 1.0.0 is not yet released. The following changes are not set in stone yet.
|
||||
*
|
||||
* API additions:
|
||||
* \li AIBaseStation
|
||||
* \li AIEngine::IsBuildable
|
||||
|
|
|
@ -876,7 +876,11 @@ static bool AircraftController(Aircraft *v)
|
|||
/* Make sure the rotors don't rotate too fast */
|
||||
if (u->cur_speed > 32) {
|
||||
v->cur_speed = 0;
|
||||
if (--u->cur_speed == 32) SndPlayVehicleFx(SND_18_HELICOPTER, v);
|
||||
if (--u->cur_speed == 32) {
|
||||
if (!PlayVehicleSound(v, VSE_START)) {
|
||||
SndPlayVehicleFx(SND_18_HELICOPTER, v);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
u->cur_speed = 32;
|
||||
count = UpdateAircraftSpeed(v);
|
||||
|
|
|
@ -1122,8 +1122,9 @@ struct BuildVehicleWindow : Window {
|
|||
}
|
||||
}
|
||||
if (needed_height != this->details_height) { // Details window are not high enough, enlarge them.
|
||||
int resize = needed_height - this->details_height;
|
||||
this->details_height = needed_height;
|
||||
this->ReInit();
|
||||
this->ReInit(0, resize);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -26,7 +26,7 @@ extern IndustryPool _industry_pool;
|
|||
* Defines the internal data of a functionnal industry
|
||||
*/
|
||||
struct Industry : IndustryPool::PoolItem<&_industry_pool> {
|
||||
typedef PersistentStorageArray<uint32, 16> PersistentStorage;
|
||||
typedef PersistentStorageArray<int32, 16> PersistentStorage;
|
||||
|
||||
TileArea location; ///< Location of the industry
|
||||
const Town *town; ///< Nearest town
|
||||
|
|
|
@ -2124,6 +2124,7 @@ STR_LAND_AREA_INFORMATION_STATION_TYPE :{BLACK}Station
|
|||
STR_LAND_AREA_INFORMATION_NEWGRF_NAME :{BLACK}NewGRF: {LTBLUE}{RAW_STRING}
|
||||
STR_LAND_AREA_INFORMATION_CARGO_ACCEPTED :{BLACK}Cargo accepted: {LTBLUE}
|
||||
STR_LAND_AREA_INFORMATION_CARGO_EIGHTS :({COMMA}/8 {STRING})
|
||||
STR_LANG_AREA_INFORMATION_RAIL_SPEED_LIMIT :{BLACK}Rail speed limit: {LTBLUE}{VELOCITY}
|
||||
|
||||
# Description of land area of different tiles
|
||||
STR_LAI_CLEAR_DESCRIPTION_ROCKS :Rocks
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
##name Slovak
|
||||
##ownname Slovensky
|
||||
##isocode sk_SK
|
||||
##plural 6
|
||||
##plural 10
|
||||
##textdir ltr
|
||||
##digitsep .
|
||||
##digitsepcur .
|
||||
|
|
|
@ -157,6 +157,7 @@ public:
|
|||
|
||||
td.station_class = STR_NULL;
|
||||
td.station_name = STR_NULL;
|
||||
td.rail_speed = 0;
|
||||
|
||||
td.grf = NULL;
|
||||
|
||||
|
@ -243,6 +244,13 @@ public:
|
|||
line_nr++;
|
||||
}
|
||||
|
||||
/* Rail speed limit */
|
||||
if (td.rail_speed != 0) {
|
||||
SetDParam(0, td.rail_speed);
|
||||
GetString(this->landinfo_data[line_nr], STR_LANG_AREA_INFORMATION_RAIL_SPEED_LIMIT, lastof(this->landinfo_data[line_nr]));
|
||||
line_nr++;
|
||||
}
|
||||
|
||||
/* NewGRF name */
|
||||
if (td.grf != NULL) {
|
||||
SetDParamStr(0, td.grf);
|
||||
|
|
|
@ -42,7 +42,7 @@ TileLayoutSpriteGroup::~TileLayoutSpriteGroup()
|
|||
free(this->dts);
|
||||
}
|
||||
|
||||
TemporaryStorageArray<uint32, 0x110> _temp_store;
|
||||
TemporaryStorageArray<int32, 0x110> _temp_store;
|
||||
|
||||
|
||||
static inline uint32 GetVariable(const ResolverObject *object, byte variable, byte parameter, bool *available)
|
||||
|
@ -118,9 +118,9 @@ static U EvalAdjustT(const DeterministicSpriteGroupAdjust *adjust, ResolverObjec
|
|||
case DSGA_OP_AND: return last_value & value;
|
||||
case DSGA_OP_OR: return last_value | value;
|
||||
case DSGA_OP_XOR: return last_value ^ value;
|
||||
case DSGA_OP_STO: _temp_store.Store(value, last_value); return last_value;
|
||||
case DSGA_OP_STO: _temp_store.Store((U)value, (S)last_value); return last_value;
|
||||
case DSGA_OP_RST: return value;
|
||||
case DSGA_OP_STOP: if (object->psa != NULL) object->psa->Store(value, last_value); return last_value;
|
||||
case DSGA_OP_STOP: if (object->psa != NULL) object->psa->Store((U)value, (S)last_value); return last_value;
|
||||
case DSGA_OP_ROR: return RotateRight(last_value, value);
|
||||
case DSGA_OP_SCMP: return ((S)last_value == (S)value) ? 1 : ((S)last_value < (S)value ? 0 : 2);
|
||||
case DSGA_OP_UCMP: return ((U)last_value == (U)value) ? 1 : ((U)last_value < (U)value ? 0 : 2);
|
||||
|
|
|
@ -31,7 +31,7 @@
|
|||
*/
|
||||
static inline uint32 GetRegister(uint i)
|
||||
{
|
||||
extern TemporaryStorageArray<uint32, 0x110> _temp_store;
|
||||
extern TemporaryStorageArray<int32, 0x110> _temp_store;
|
||||
return _temp_store.Get(i);
|
||||
}
|
||||
|
||||
|
|
|
@ -37,7 +37,7 @@ struct BaseStorageArray
|
|||
* @param pos the position to write at
|
||||
* @param value the value to write
|
||||
*/
|
||||
virtual void Store(uint pos, uint32 value) = 0;
|
||||
virtual void Store(uint pos, int32 value) = 0;
|
||||
};
|
||||
|
||||
/**
|
||||
|
@ -70,7 +70,7 @@ struct PersistentStorageArray : BaseStorageArray {
|
|||
* @param pos the position to write at
|
||||
* @param value the value to write
|
||||
*/
|
||||
void Store(uint pos, uint32 value)
|
||||
void Store(uint pos, int32 value)
|
||||
{
|
||||
/* Out of the scope of the array */
|
||||
if (pos >= SIZE) return;
|
||||
|
@ -138,7 +138,7 @@ struct TemporaryStorageArray : BaseStorageArray {
|
|||
* @param pos the position to write at
|
||||
* @param value the value to write
|
||||
*/
|
||||
void Store(uint pos, uint32 value)
|
||||
void Store(uint pos, int32 value)
|
||||
{
|
||||
/* Out of the scope of the array */
|
||||
if (pos >= SIZE) return;
|
||||
|
|
|
@ -571,7 +571,7 @@ static TextRefStack *_newgrf_textrefstack = &_newgrf_normal_textrefstack;
|
|||
*/
|
||||
void PrepareTextRefStackUsage(byte numEntries)
|
||||
{
|
||||
extern TemporaryStorageArray<uint32, 0x110> _temp_store;
|
||||
extern TemporaryStorageArray<int32, 0x110> _temp_store;
|
||||
|
||||
_newgrf_textrefstack->ResetStack();
|
||||
|
||||
|
|
|
@ -2523,6 +2523,8 @@ static bool ClickTile_Track(TileIndex tile)
|
|||
|
||||
static void GetTileDesc_Track(TileIndex tile, TileDesc *td)
|
||||
{
|
||||
const RailtypeInfo *rti = GetRailTypeInfo(GetRailType(tile));
|
||||
td->rail_speed = rti->max_speed;
|
||||
td->owner[0] = GetTileOwner(tile);
|
||||
switch (GetRailTileType(tile)) {
|
||||
case RAIL_TILE_NORMAL:
|
||||
|
@ -2596,6 +2598,11 @@ static void GetTileDesc_Track(TileIndex tile, TileDesc *td)
|
|||
|
||||
case RAIL_TILE_DEPOT:
|
||||
td->str = STR_LAI_RAIL_DESCRIPTION_TRAIN_DEPOT;
|
||||
if (td->rail_speed > 0) {
|
||||
td->rail_speed = min(td->rail_speed, 61);
|
||||
} else {
|
||||
td->rail_speed = 61;
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
|
|
|
@ -1500,6 +1500,10 @@ static void GetTileDesc_Road(TileIndex tile, TileDesc *td)
|
|||
rail_owner = GetTileOwner(tile);
|
||||
if (HasBit(rts, ROADTYPE_ROAD)) road_owner = GetRoadOwner(tile, ROADTYPE_ROAD);
|
||||
if (HasBit(rts, ROADTYPE_TRAM)) tram_owner = GetRoadOwner(tile, ROADTYPE_TRAM);
|
||||
|
||||
const RailtypeInfo *rti = GetRailTypeInfo(GetRailType(tile));
|
||||
td->rail_speed = rti->max_speed;
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
|
|
|
@ -2575,6 +2575,9 @@ static void GetTileDesc_Station(TileIndex tile, TileDesc *td)
|
|||
td->grf = gc->name;
|
||||
}
|
||||
}
|
||||
|
||||
const RailtypeInfo *rti = GetRailTypeInfo(GetRailType(tile));
|
||||
td->rail_speed = rti->max_speed;
|
||||
}
|
||||
|
||||
StringID str;
|
||||
|
|
|
@ -410,7 +410,7 @@ static int DeterminePluralForm(int64 count)
|
|||
|
||||
/* Three forms, special cases for numbers ending in 1 and 2, 3, 4, except those ending in 1[1-4]
|
||||
* Used in:
|
||||
* Croatian, Russian, Slovak, Ukrainian */
|
||||
* Croatian, Russian, Ukrainian */
|
||||
case 6:
|
||||
return n % 10 == 1 && n % 100 != 11 ? 0 : n % 10 >= 2 && n % 10 <= 4 && (n % 100 < 10 || n % 100 >= 20) ? 1 : 2;
|
||||
|
||||
|
@ -434,7 +434,7 @@ static int DeterminePluralForm(int64 count)
|
|||
|
||||
/* Three forms, special cases for one and 2, 3, or 4
|
||||
* Used in:
|
||||
* Czech */
|
||||
* Czech, Slovak */
|
||||
case 10:
|
||||
return n == 1 ? 0 : n >= 2 && n <= 4 ? 1 : 2;
|
||||
|
||||
|
|
|
@ -59,6 +59,7 @@ struct TileDesc {
|
|||
StringID station_name; ///< Type of station within the class
|
||||
const char *grf; ///< newGRF used for the tile contents
|
||||
uint64 dparam[2]; ///< Parameters of the \a str string
|
||||
uint16 rail_speed; ///< Speed limit of rail
|
||||
};
|
||||
|
||||
/**
|
||||
|
|
|
@ -1312,6 +1312,18 @@ static void GetTileDesc_TunnelBridge(TileIndex tile, TileDesc *td)
|
|||
td->owner[i] = tram_owner;
|
||||
}
|
||||
}
|
||||
|
||||
if (tt == TRANSPORT_RAIL) {
|
||||
const RailtypeInfo *rti = GetRailTypeInfo(GetRailType(tile));
|
||||
td->rail_speed = rti->max_speed;
|
||||
|
||||
if (!IsTunnel(tile)) {
|
||||
uint16 spd = GetBridgeSpec(GetBridgeType(tile))->speed;
|
||||
if (td->rail_speed == 0 || spd < td->rail_speed) {
|
||||
td->rail_speed = spd;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue