mirror of https://github.com/OpenTTD/OpenTTD
Codechange: remove need for SetDParamX
parent
6c6f365d2f
commit
f86500df92
|
@ -476,7 +476,7 @@ static void GetTileDesc_Industry(TileIndex tile, TileDesc *td)
|
||||||
td->owner[0] = i->owner;
|
td->owner[0] = i->owner;
|
||||||
td->str = is->name;
|
td->str = is->name;
|
||||||
if (!IsIndustryCompleted(tile)) {
|
if (!IsIndustryCompleted(tile)) {
|
||||||
SetDParamX(td->dparam, 0, td->str);
|
td->dparam = td->str;
|
||||||
td->str = STR_LAI_TOWN_INDUSTRY_DESCRIPTION_UNDER_CONSTRUCTION;
|
td->str = STR_LAI_TOWN_INDUSTRY_DESCRIPTION_UNDER_CONSTRUCTION;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -174,7 +174,7 @@ public:
|
||||||
this->landinfo_data.clear();
|
this->landinfo_data.clear();
|
||||||
|
|
||||||
/* Tiletype */
|
/* Tiletype */
|
||||||
SetDParam(0, td.dparam[0]);
|
SetDParam(0, td.dparam);
|
||||||
this->landinfo_data.push_back(GetString(td.str));
|
this->landinfo_data.push_back(GetString(td.str));
|
||||||
|
|
||||||
/* Up to four owners */
|
/* Up to four owners */
|
||||||
|
|
|
@ -190,17 +190,6 @@ static inline int64 PackVelocity(uint speed, VehicleType type)
|
||||||
return speed | (static_cast<uint64>(type) << 56);
|
return speed | (static_cast<uint64>(type) << 56);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Set a string parameter \a v at index \a n in a given array \a s.
|
|
||||||
* @param s Array of string parameters.
|
|
||||||
* @param n Index of the string parameter.
|
|
||||||
* @param v Value of the string parameter.
|
|
||||||
*/
|
|
||||||
static inline void SetDParamX(uint64 *s, uint n, uint64 v)
|
|
||||||
{
|
|
||||||
s[n] = v;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Set a string parameter \a v at index \a n in the global string parameter array.
|
* Set a string parameter \a v at index \a n in the global string parameter array.
|
||||||
* @param n Index of the string parameter.
|
* @param n Index of the string parameter.
|
||||||
|
|
|
@ -51,6 +51,7 @@ struct TileInfo {
|
||||||
/** Tile description for the 'land area information' tool */
|
/** Tile description for the 'land area information' tool */
|
||||||
struct TileDesc {
|
struct TileDesc {
|
||||||
StringID str; ///< Description of the tile
|
StringID str; ///< Description of the tile
|
||||||
|
uint64_t dparam; ///< Parameter of the \a str string
|
||||||
Owner owner[4]; ///< Name of the owner(s)
|
Owner owner[4]; ///< Name of the owner(s)
|
||||||
StringID owner_type[4]; ///< Type of each owner
|
StringID owner_type[4]; ///< Type of each owner
|
||||||
TimerGameCalendar::Date build_date; ///< Date of construction of tile contents
|
TimerGameCalendar::Date build_date; ///< Date of construction of tile contents
|
||||||
|
@ -60,7 +61,6 @@ struct TileDesc {
|
||||||
StringID airport_name; ///< Name of the airport
|
StringID airport_name; ///< Name of the airport
|
||||||
StringID airport_tile_name; ///< Name of the airport tile
|
StringID airport_tile_name; ///< Name of the airport tile
|
||||||
const char *grf; ///< newGRF used for the tile contents
|
const char *grf; ///< newGRF used for the tile contents
|
||||||
uint64 dparam[2]; ///< Parameters of the \a str string
|
|
||||||
StringID railtype; ///< Type of rail on the tile.
|
StringID railtype; ///< Type of rail on the tile.
|
||||||
uint16 rail_speed; ///< Speed limit of rail (bridges and track)
|
uint16 rail_speed; ///< Speed limit of rail (bridges and track)
|
||||||
StringID roadtype; ///< Type of road on the tile.
|
StringID roadtype; ///< Type of road on the tile.
|
||||||
|
|
|
@ -788,7 +788,7 @@ static void GetTileDesc_Town(TileIndex tile, TileDesc *td)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!house_completed) {
|
if (!house_completed) {
|
||||||
SetDParamX(td->dparam, 0, td->str);
|
td->dparam = td->str;
|
||||||
td->str = STR_LAI_TOWN_INDUSTRY_DESCRIPTION_UNDER_CONSTRUCTION;
|
td->str = STR_LAI_TOWN_INDUSTRY_DESCRIPTION_UNDER_CONSTRUCTION;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue