From f86500df92c52eb9ab5b65c6ebaf5ef05a1872ed Mon Sep 17 00:00:00 2001 From: Rubidium Date: Sun, 11 Jun 2023 21:16:16 +0200 Subject: [PATCH] Codechange: remove need for SetDParamX --- src/industry_cmd.cpp | 2 +- src/misc_gui.cpp | 2 +- src/strings_func.h | 11 ----------- src/tile_cmd.h | 2 +- src/town_cmd.cpp | 2 +- 5 files changed, 4 insertions(+), 15 deletions(-) diff --git a/src/industry_cmd.cpp b/src/industry_cmd.cpp index 26d25fa2aa..c5f69bb73f 100644 --- a/src/industry_cmd.cpp +++ b/src/industry_cmd.cpp @@ -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; } diff --git a/src/misc_gui.cpp b/src/misc_gui.cpp index a94a71fe5d..315964dada 100644 --- a/src/misc_gui.cpp +++ b/src/misc_gui.cpp @@ -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 */ diff --git a/src/strings_func.h b/src/strings_func.h index 7c34c4a252..cc63efdb98 100644 --- a/src/strings_func.h +++ b/src/strings_func.h @@ -190,17 +190,6 @@ static inline int64 PackVelocity(uint speed, VehicleType type) return speed | (static_cast(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. diff --git a/src/tile_cmd.h b/src/tile_cmd.h index f44e0aac32..32a04ab6ac 100644 --- a/src/tile_cmd.h +++ b/src/tile_cmd.h @@ -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. diff --git a/src/town_cmd.cpp b/src/town_cmd.cpp index e12597981e..ae032937ea 100644 --- a/src/town_cmd.cpp +++ b/src/town_cmd.cpp @@ -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; }