Codechange: C++ initialise LanguageHeaderPack

This commit is contained in:
Rubidium
2025-05-06 18:33:22 +02:00
committed by rubidium42
parent 8f1e94c546
commit d70aeb72a7
3 changed files with 21 additions and 25 deletions
+19 -19
View File
@@ -24,22 +24,22 @@ static const uint8_t MAX_NUM_CASES = 16; ///< Maximum number of supported case
struct LanguagePackHeader {
static const uint32_t IDENT = 0x474E414C; ///< Identifier for OpenTTD language files, big endian for "LANG"
uint32_t ident; ///< 32-bits identifier
uint32_t version; ///< 32-bits of auto generated version info which is basically a hash of strings.h
char name[32]; ///< the international name of this language
char own_name[32]; ///< the localized name of this language
char isocode[16]; ///< the ISO code for the language (not country code)
uint16_t offsets[TEXT_TAB_END]; ///< the offsets
uint32_t ident = 0; ///< 32-bits identifier
uint32_t version = 0; ///< 32-bits of auto generated version info which is basically a hash of strings.h
char name[32] = ""; ///< the international name of this language
char own_name[32] = ""; ///< the localized name of this language
char isocode[16] = ""; ///< the ISO code for the language (not country code)
uint16_t offsets[TEXT_TAB_END] = {}; ///< the offsets
/** Thousand separator used for anything not currencies */
char digit_group_separator[8];
char digit_group_separator[8] = ",";
/** Thousand separator used for currencies */
char digit_group_separator_currency[8];
char digit_group_separator_currency[8] = ",";
/** Decimal separator */
char digit_decimal_separator[8];
uint16_t missing; ///< number of missing strings.
uint8_t plural_form; ///< plural form index
uint8_t text_dir; ///< default direction of the text
char digit_decimal_separator[8] = ".";
uint16_t missing = 0; ///< number of missing strings.
uint8_t plural_form = 0; ///< plural form index
uint8_t text_dir = 0; ///< default direction of the text
/**
* Windows language ID:
* Windows cannot and will not convert isocodes to something it can use to
@@ -48,14 +48,14 @@ struct LanguagePackHeader {
* what language it is in "Windows". The ID is the 'locale identifier' on:
* http://msdn.microsoft.com/en-us/library/ms776294.aspx
*/
uint16_t winlangid; ///< windows language id
uint8_t newgrflangid; ///< newgrf language id
uint8_t num_genders; ///< the number of genders of this language
uint8_t num_cases; ///< the number of cases of this language
uint8_t pad[3]; ///< pad header to be a multiple of 4
uint16_t winlangid = 0; ///< windows language id
uint8_t newgrflangid = 0; ///< newgrf language id
uint8_t num_genders = 0; ///< the number of genders of this language
uint8_t num_cases = 0; ///< the number of cases of this language
uint8_t pad[3] = {}; ///< pad header to be a multiple of 4
char genders[MAX_NUM_GENDERS][CASE_GENDER_LEN]; ///< the genders used by this translation
char cases[MAX_NUM_CASES][CASE_GENDER_LEN]; ///< the cases used by this translation
char genders[MAX_NUM_GENDERS][CASE_GENDER_LEN] = {}; ///< the genders used by this translation
char cases[MAX_NUM_CASES][CASE_GENDER_LEN] = {}; ///< the cases used by this translation
bool IsValid() const;
bool IsReasonablyFinished() const;