OpenTTD
|
Helper structure for mapping choice lists. More...
Public Member Functions | |
~UnmappedChoiceList () | |
Clean everything up. | |
UnmappedChoiceList (StringControlCode type, char *old_d, int offset) | |
Initialise the mapping. | |
char * | Flush (const LanguageMap *lm) |
Flush this choice list into the old d variable. | |
![]() | |
void * | operator new (size_t size) |
Memory allocator for a single class instance. | |
void * | operator new[] (size_t size) |
Memory allocator for an array of class instances. | |
void | operator delete (void *ptr) |
Memory release for a single class instance. | |
void | operator delete[] (void *ptr) |
Memory release for an array of class instances. |
Data Fields | |
StringControlCode | type |
The type of choice list. | |
char * | old_d |
The old/original location of the "d" local variable. | |
int | offset |
The offset for the plural/gender form. | |
SmallMap< byte, char * > | strings |
Mapping of NewGRF supplied ID to the different strings in the choice list. |
Helper structure for mapping choice lists.
Definition at line 196 of file newgrf_text.cpp.
|
inline |
Clean everything up.
Definition at line 198 of file newgrf_text.cpp.
References SmallVector< T, S >::Begin(), SmallVector< T, S >::End(), free(), and strings.
|
inline |
Initialise the mapping.
type | The type of mapping. |
old_d | The old begin of the string, i.e. from where to start writing again. |
offset | The offset to get the plural/gender from. |
Definition at line 211 of file newgrf_text.cpp.
|
inline |
Flush this choice list into the old d variable.
lm | The current language mapping. |
Definition at line 228 of file newgrf_text.cpp.
References _current_language, SmallMap< T, U, S >::Contains(), GB(), LanguageMap::GetReverseMapping(), grfmsg(), LanguagePackHeader::num_cases, LanguagePackHeader::num_genders, offset, old_d, LanguageMap::plural_form, stredup(), strings, type, and Utf8Encode().
Referenced by TranslateTTDPatchCodes().
SmallMap<byte, char *> UnmappedChoiceList::strings |
Mapping of NewGRF supplied ID to the different strings in the choice list.
Definition at line 221 of file newgrf_text.cpp.
Referenced by Flush(), TranslateTTDPatchCodes(), and ~UnmappedChoiceList().