Use StringBuilder for GetString/GetStringWithArgs, as per upstream

Update dependent code as required
This commit is contained in:
Jonathan G Rennison
2024-01-05 21:12:54 +00:00
parent 1b7a5372ec
commit f034714559
61 changed files with 1064 additions and 1228 deletions

View File

@@ -25,7 +25,7 @@ struct NamePart {
struct NamePartList {
byte bitstart; ///< Start of random seed bits to use.
byte bitcount; ///< Number of bits of random seed to use.
uint16 maxprob; ///< Total probability of all parts.
uint16_t maxprob; ///< Total probability of all parts.
std::vector<NamePart> parts; ///< List of parts to choose from.
};
@@ -39,19 +39,18 @@ struct TownNameStyle {
struct GRFTownName {
static const uint MAX_LISTS = 128; ///< Maximum number of town name lists that can be defined per GRF.
uint32 grfid; ///< GRF ID of NewGRF.
uint32_t grfid; ///< GRF ID of NewGRF.
std::vector<TownNameStyle> styles; ///< Style names defined by the Town Name NewGRF.
std::vector<NamePartList> partlists[MAX_LISTS]; ///< Lists of town name parts.
};
GRFTownName *AddGRFTownName(uint32 grfid);
GRFTownName *GetGRFTownName(uint32 grfid);
void DelGRFTownName(uint32 grfid);
GRFTownName *AddGRFTownName(uint32_t grfid);
GRFTownName *GetGRFTownName(uint32_t grfid);
void DelGRFTownName(uint32_t grfid);
void CleanUpGRFTownNames();
char *GRFTownNameGenerate(char *buf, uint32 grfid, uint16 gen, uint32 seed, const char *last);
uint32 GetGRFTownNameId(uint16 gen);
uint16 GetGRFTownNameType(uint16 gen);
StringID GetGRFTownNameName(uint16 gen);
uint32_t GetGRFTownNameId(uint16_t gen);
uint16_t GetGRFTownNameType(uint16_t gen);
StringID GetGRFTownNameName(uint16_t gen);
const std::vector<StringID> &GetGRFTownNameList();