mirror of https://github.com/OpenTTD/OpenTTD
Codechange: Allow using more than 65536 NewGRF string IDs.
NewGRF string allocation allowed up to 524288 strings, however stringid was passed as uint16_t which limits to 2^16.pull/11262/head
parent
3e762af2d1
commit
e4613fc04c
|
@ -636,7 +636,7 @@ const char *GetGRFStringFromGRFText(const GRFTextWrapper &text)
|
||||||
/**
|
/**
|
||||||
* Get a C-string from a stringid set by a newgrf.
|
* Get a C-string from a stringid set by a newgrf.
|
||||||
*/
|
*/
|
||||||
const char *GetGRFStringPtr(uint16_t stringid)
|
const char *GetGRFStringPtr(uint32_t stringid)
|
||||||
{
|
{
|
||||||
assert(stringid < _grf_text.size());
|
assert(stringid < _grf_text.size());
|
||||||
assert(_grf_text[stringid].grfid != 0);
|
assert(_grf_text[stringid].grfid != 0);
|
||||||
|
|
|
@ -33,7 +33,7 @@ StringID AddGRFString(uint32_t grfid, uint16_t stringid, byte langid, bool new_s
|
||||||
StringID GetGRFStringID(uint32_t grfid, StringID stringid);
|
StringID GetGRFStringID(uint32_t grfid, StringID stringid);
|
||||||
const char *GetGRFStringFromGRFText(const GRFTextList &text_list);
|
const char *GetGRFStringFromGRFText(const GRFTextList &text_list);
|
||||||
const char *GetGRFStringFromGRFText(const GRFTextWrapper &text);
|
const char *GetGRFStringFromGRFText(const GRFTextWrapper &text);
|
||||||
const char *GetGRFStringPtr(uint16_t stringid);
|
const char *GetGRFStringPtr(uint32_t stringid);
|
||||||
void CleanUpStrings();
|
void CleanUpStrings();
|
||||||
void SetCurrentGrfLangID(byte language_id);
|
void SetCurrentGrfLangID(byte 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);
|
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);
|
||||||
|
|
Loading…
Reference in New Issue