src/newgrf_text.cpp
changeset 6574 e1d1a12faaf7
parent 6573 7624f942237f
child 6674 64f4781b4653
equal deleted inserted replaced
6573:7624f942237f 6574:e1d1a12faaf7
    28 /**
    28 /**
    29  * Explains the newgrf shift bit positionning.
    29  * Explains the newgrf shift bit positionning.
    30  * the grf base will not be used in order to find the string, but rather for
    30  * the grf base will not be used in order to find the string, but rather for
    31  * jumping from standard langID scheme to the new one.
    31  * jumping from standard langID scheme to the new one.
    32  */
    32  */
    33 typedef enum grf_base_languages {
    33 enum grf_base_languages {
    34 	GRFLB_AMERICAN    = 0x01,
    34 	GRFLB_AMERICAN    = 0x01,
    35 	GRFLB_ENGLISH     = 0x02,
    35 	GRFLB_ENGLISH     = 0x02,
    36 	GRFLB_GERMAN      = 0x04,
    36 	GRFLB_GERMAN      = 0x04,
    37 	GRFLB_FRENCH      = 0x08,
    37 	GRFLB_FRENCH      = 0x08,
    38 	GRFLB_SPANISH     = 0x10,
    38 	GRFLB_SPANISH     = 0x10,
    39 	GRFLB_GENERIC     = 0x80,
    39 	GRFLB_GENERIC     = 0x80,
    40 } grf_base_language;
    40 };
    41 
    41 
    42 typedef enum grf_extended_languages {
    42 enum grf_extended_languages {
    43 	GRFLX_AMERICAN    = 0x00,
    43 	GRFLX_AMERICAN    = 0x00,
    44 	GRFLX_ENGLISH     = 0x01,
    44 	GRFLX_ENGLISH     = 0x01,
    45 	GRFLX_GERMAN      = 0x02,
    45 	GRFLX_GERMAN      = 0x02,
    46 	GRFLX_FRENCH      = 0x03,
    46 	GRFLX_FRENCH      = 0x03,
    47 	GRFLX_SPANISH     = 0x04,
    47 	GRFLX_SPANISH     = 0x04,
    71 	GRFLX_PORTUGUESE  = 0x36,
    71 	GRFLX_PORTUGUESE  = 0x36,
    72 	GRFLX_BRAZILIAN   = 0x37,
    72 	GRFLX_BRAZILIAN   = 0x37,
    73 	GRFLX_CROATIAN    = 0x38,
    73 	GRFLX_CROATIAN    = 0x38,
    74 	GRFLX_TURKISH     = 0x3E,
    74 	GRFLX_TURKISH     = 0x3E,
    75 	GRFLX_UNSPECIFIED = 0x7F,
    75 	GRFLX_UNSPECIFIED = 0x7F,
    76 } grf_language;
    76 };
    77 
    77 
    78 
    78 
    79 typedef struct iso_grf {
    79 struct iso_grf {
    80 	char code[6];
    80 	char code[6];
    81 	byte grfLangID;
    81 	byte grfLangID;
    82 } iso_grf;
    82 };
    83 
    83 
    84 /**
    84 /**
    85  * ISO code VS NewGrf langID conversion array.
    85  * ISO code VS NewGrf langID conversion array.
    86  * This array is used in two ways:
    86  * This array is used in two ways:
    87  * 1-its ISO part is matching OpenTTD dynamic language id
    87  * 1-its ISO part is matching OpenTTD dynamic language id
   168 /**
   168 /**
   169  * Holder of the above structure.
   169  * Holder of the above structure.
   170  * Putting both grfid and stringid together allows us to avoid duplicates,
   170  * Putting both grfid and stringid together allows us to avoid duplicates,
   171  * since it is NOT SUPPOSED to happen.
   171  * since it is NOT SUPPOSED to happen.
   172  */
   172  */
   173 typedef struct GRFTextEntry {
   173 struct GRFTextEntry {
   174 	uint32 grfid;
   174 	uint32 grfid;
   175 	uint16 stringid;
   175 	uint16 stringid;
   176 	StringID def_string;
   176 	StringID def_string;
   177 	GRFText *textholder;
   177 	GRFText *textholder;
   178 } GRFTextEntry;
   178 };
   179 
   179 
   180 
   180 
   181 static uint _num_grf_texts = 0;
   181 static uint _num_grf_texts = 0;
   182 static GRFTextEntry _grf_text[(1 << TABSIZE) * 3];
   182 static GRFTextEntry _grf_text[(1 << TABSIZE) * 3];
   183 static byte _currentLangID = GRFLX_ENGLISH;  //by default, english is used.
   183 static byte _currentLangID = GRFLX_ENGLISH;  //by default, english is used.