Codechange: remove need for SetDParamX

This commit is contained in:
Rubidium 2023-06-11 21:16:16 +02:00 committed by rubidium42
parent 6c6f365d2f
commit f86500df92
5 changed files with 4 additions and 15 deletions

View File

@ -476,7 +476,7 @@ static void GetTileDesc_Industry(TileIndex tile, TileDesc *td)
td->owner[0] = i->owner;
td->str = is->name;
if (!IsIndustryCompleted(tile)) {
SetDParamX(td->dparam, 0, td->str);
td->dparam = td->str;
td->str = STR_LAI_TOWN_INDUSTRY_DESCRIPTION_UNDER_CONSTRUCTION;
}

View File

@ -174,7 +174,7 @@ public:
this->landinfo_data.clear();
/* Tiletype */
SetDParam(0, td.dparam[0]);
SetDParam(0, td.dparam);
this->landinfo_data.push_back(GetString(td.str));
/* Up to four owners */

View File

@ -190,17 +190,6 @@ static inline int64 PackVelocity(uint speed, VehicleType type)
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.
* @param n Index of the string parameter.

View File

@ -51,6 +51,7 @@ struct TileInfo {
/** Tile description for the 'land area information' tool */
struct TileDesc {
StringID str; ///< Description of the tile
uint64_t dparam; ///< Parameter of the \a str string
Owner owner[4]; ///< Name of the owner(s)
StringID owner_type[4]; ///< Type of each owner
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_tile_name; ///< Name of the airport tile
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.
uint16 rail_speed; ///< Speed limit of rail (bridges and track)
StringID roadtype; ///< Type of road on the tile.

View File

@ -788,7 +788,7 @@ static void GetTileDesc_Town(TileIndex tile, TileDesc *td)
}
if (!house_completed) {
SetDParamX(td->dparam, 0, td->str);
td->dparam = td->str;
td->str = STR_LAI_TOWN_INDUSTRY_DESCRIPTION_UNDER_CONSTRUCTION;
}