(svn r12316) -Codechange: Support loading full range of 0xD0xx NewGRF strings which

includes 0xD000 to 0xD3FF (yes, 0xD0xx makes a lot of sense, really...) 
and handle 0xD400 to 0xD7FF strings which map to 0xD000 to 0xD3FF 
(obviously).
pull/155/head
peter1138 17 years ago
parent 26c5a14d58
commit b913a135c0

@ -244,13 +244,24 @@ StringID MapGRFStringID(uint32 grfid, StringID str)
STR_BAGS, STR_LITERS, STR_TONS, STR_NOTHING,
STR_TONS, STR_NOTHING, STR_LITERS, STR_NOTHING
};
/* 0xD0 and 0xDC stand for all the TextIDs in the range
* of 0xD000 (misc graphics texts) and 0xDC00 (misc persistent texts).
* These strings are unique to each grf file, and thus require to be used with the
* grfid in which they are declared */
if (GB(str, 8, 8) == 0xD0 || GB(str, 8, 8) == 0xDC) {
return GetGRFStringID(grfid, str);
switch (GB(str, 8, 8)) {
case 0xD0: case 0xD1: case 0xD2: case 0xD3:
case 0xDC:
return GetGRFStringID(grfid, str);
case 0xD4: case 0xD5: case 0xD6: case 0xD7:
/* Strings embedded via 0x81 have 0x400 added to them (no real
* explanation why...) */
return GetGRFStringID(grfid, str - 0x400);
default: break;
}
#define TEXID_TO_STRINGID(begin, end, stringid) if (str >= begin && str <= end) return str + (stringid - begin)
/* We have some changes in our cargo strings, resulting in some missing. */
TEXID_TO_STRINGID(0x000E, 0x002D, STR_000E);
@ -3242,6 +3253,9 @@ static void FeatureNewName(byte *buf, int len)
break;
case 0xD0:
case 0xD1:
case 0xD2:
case 0xD3:
case 0xDC:
AddGRFString(_cur_grffile->grfid, id, lang, new_scheme, name, STR_UNDEFINED);
break;

Loading…
Cancel
Save