Merge branch 'master' into jgrpp

Remove 'byte' typedef
This commit is contained in:
Jonathan G Rennison
2024-05-07 17:21:50 +01:00
376 changed files with 2220 additions and 2152 deletions

View File

@@ -22,7 +22,7 @@ static const char32_t NFO_UTF8_IDENTIFIER = 0x00DE;
/** A GRF text with associated language ID. */
struct GRFText {
byte langid; ///< The language associated with this GRFText.
uint8_t langid; ///< The language associated with this GRFText.
std::string text; ///< The actual (translated) text.
};
@@ -31,7 +31,7 @@ typedef std::vector<GRFText> GRFTextList;
/** Reference counted wrapper around a GRFText pointer. */
typedef std::shared_ptr<GRFTextList> GRFTextWrapper;
StringID AddGRFString(uint32_t grfid, uint16_t stringid, byte langid, bool new_scheme, bool allow_newlines, const char *text_to_add, StringID def_string);
StringID AddGRFString(uint32_t grfid, uint16_t stringid, uint8_t langid, bool new_scheme, bool allow_newlines, const char *text_to_add, StringID def_string);
StringID GetGRFStringID(uint32_t grfid, StringID stringid);
const char *GetGRFStringFromGRFText(const GRFTextList &text_list);
const char *GetGRFStringFromGRFText(const GRFTextWrapper &text);
@@ -39,15 +39,15 @@ const char *GetDefaultLangGRFStringFromGRFText(const GRFTextList &text_list);
const char *GetDefaultLangGRFStringFromGRFText(const GRFTextWrapper &text);
const char *GetGRFStringPtr(uint32_t stringid);
void CleanUpStrings();
void SetCurrentGrfLangID(byte language_id);
void SetCurrentGrfLangID(uint8_t language_id);
std::string TranslateTTDPatchCodes(uint32_t grfid, uint8_t language_id, bool allow_newlines, const std::string &str, StringControlCode byte80 = SCC_NEWGRF_PRINT_WORD_STRING_ID);
void AddGRFTextToList(GRFTextList &list, byte langid, uint32_t grfid, bool allow_newlines, const char *text_to_add);
void AddGRFTextToList(GRFTextWrapper &list, byte langid, uint32_t grfid, bool allow_newlines, const char *text_to_add);
void AddGRFTextToList(GRFTextList &list, uint8_t langid, uint32_t grfid, bool allow_newlines, const char *text_to_add);
void AddGRFTextToList(GRFTextWrapper &list, uint8_t langid, uint32_t grfid, bool allow_newlines, const char *text_to_add);
void AddGRFTextToList(GRFTextWrapper &list, const std::string &text_to_add);
bool CheckGrfLangID(byte lang_id, byte grf_version);
bool CheckGrfLangID(uint8_t lang_id, uint8_t grf_version);
void StartTextRefStackUsage(const struct GRFFile *grffile, byte numEntries, const uint32_t *values = nullptr);
void StartTextRefStackUsage(const struct GRFFile *grffile, uint8_t numEntries, const uint32_t *values = nullptr);
void StopTextRefStackUsage();
bool UsingNewGRFTextStack();
struct TextRefStack *CreateTextRefStackBackup();
@@ -60,8 +60,8 @@ uint RemapNewGRFStringControlCode(uint scc, std::string *buffer, const char **st
struct LanguageMap {
/** Mapping between NewGRF and OpenTTD IDs. */
struct Mapping {
byte newgrf_id; ///< NewGRF's internal ID for a case/gender.
byte openttd_id; ///< OpenTTD's internal ID for a case/gender.
uint8_t newgrf_id; ///< NewGRF's internal ID for a case/gender.
uint8_t openttd_id; ///< OpenTTD's internal ID for a case/gender.
};
/* We need a vector and can't use SmallMap due to the fact that for "setting" a