From e84c52e6620eed63ad1202a83e0a2e5a1b98fda5 Mon Sep 17 00:00:00 2001 From: rubidium Date: Tue, 16 Nov 2010 12:35:16 +0000 Subject: (svn r21207) -Codechange: replace the magic 0x00DE constant with something less magic --- src/newgrf_text.cpp | 4 ++-- src/newgrf_text.h | 4 ++++ 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/newgrf_text.cpp b/src/newgrf_text.cpp index b851546a7..5e5acfc73 100644 --- a/src/newgrf_text.cpp +++ b/src/newgrf_text.cpp @@ -21,6 +21,7 @@ #include "newgrf.h" #include "strings_func.h" #include "newgrf_storage.h" +#include "newgrf_text.h" #include "string_func.h" #include "date_type.h" #include "debug.h" @@ -232,8 +233,7 @@ char *TranslateTTDPatchCodes(uint32 grfid, uint8 language_id, const char *str, i WChar c; size_t len = Utf8Decode(&c, str); - if (c == 0x00DE) { - /* The thorn ('þ') indicates a unicode string to TTDPatch */ + if (c == NFO_UTF8_IDENTIFIER) { unicode = true; str += len; } diff --git a/src/newgrf_text.h b/src/newgrf_text.h index 6f4ed1206..2865bf706 100644 --- a/src/newgrf_text.h +++ b/src/newgrf_text.h @@ -12,8 +12,12 @@ #ifndef NEWGRF_TEXT_H #define NEWGRF_TEXT_H +#include "string_type.h" #include "strings_type.h" +/** This character, the thorn ('þ'), indicates a unicode string to NFO. */ +static const WChar NFO_UTF8_IDENTIFIER = 0x00DE; + StringID AddGRFString(uint32 grfid, uint16 stringid, byte langid, bool new_scheme, const char *text_to_add, StringID def_string); StringID GetGRFStringID(uint32 grfid, uint16 stringid); const char *GetGRFStringFromGRFText(const struct GRFText *text); -- cgit v1.2.3-70-g09d2