# HG changeset patch # User rubidium # Date 2010-11-05 13:34:39 # Node ID 223fd7c7ddcd730cc0c82e2c562541b9404a324f # Parent 2171f2d3307ad6cb15dad30903e8d7803aafe525 (svn r21085) -Feature-ish: [NewGRF] Implement stringcode 9A 0C (station name) diff --git a/src/newgrf_text.cpp b/src/newgrf_text.cpp --- a/src/newgrf_text.cpp +++ b/src/newgrf_text.cpp @@ -306,6 +306,9 @@ char *TranslateTTDPatchCodes(uint32 grfi case 0x0B: d += Utf8Encode(d, SCC_NEWGRF_PRINT_HEX_QWORD); break; + case 0x0C: + d += Utf8Encode(d, SCC_NEWGRF_PRINT_WORD_STATION_NAME); + break; default: grfmsg(1, "missing handler for extended format code"); @@ -717,6 +720,7 @@ uint RemapNewGRFStringControlCode(uint s case SCC_NEWGRF_PRINT_HEX_WORD: case SCC_NEWGRF_PRINT_WORD_SPEED: case SCC_NEWGRF_PRINT_WORD_VOLUME: + case SCC_NEWGRF_PRINT_WORD_STATION_NAME: case SCC_NEWGRF_PRINT_UNSIGNED_WORD: *argv = _newgrf_textrefstack->PopUnsignedWord(); break; case SCC_NEWGRF_PRINT_DATE: @@ -767,6 +771,9 @@ uint RemapNewGRFStringControlCode(uint s case SCC_NEWGRF_PRINT_WORD_VOLUME: return SCC_VOLUME; + case SCC_NEWGRF_PRINT_WORD_STATION_NAME: + return SCC_STATION_NAME; + case SCC_NEWGRF_DISCARD_WORD: case SCC_NEWGRF_ROTATE_TOP_4_WORDS: case SCC_NEWGRF_PUSH_WORD: diff --git a/src/table/control_codes.h b/src/table/control_codes.h --- a/src/table/control_codes.h +++ b/src/table/control_codes.h @@ -121,6 +121,7 @@ enum StringControlCode { SCC_NEWGRF_PRINT_MONTH_YEAR, ///< Read 2 bytes from the stack as base 1920 date SCC_NEWGRF_PRINT_WORD_SPEED, ///< Read 2 bytes from the stack as signed speed SCC_NEWGRF_PRINT_WORD_VOLUME, ///< Read 2 bytes from the stack as signed volume + SCC_NEWGRF_PRINT_WORD_STATION_NAME, ///< Read 2 bytes from the stack as station name SCC_NEWGRF_PRINT_QWORD_CURRENCY, ///< Read 8 bytes from the stack as currency SCC_NEWGRF_PRINT_HEX_BYTE, ///< Read 1 byte from the stack and print it as hex SCC_NEWGRF_PRINT_HEX_WORD, ///< Read 2 bytes from the stack and print it as hex