(svn r14321) -Add: support for newgrfs printing bytes/words/dwords as hexadecimals.
This commit is contained in:
@@ -267,6 +267,10 @@ static char *FormatNoCommaNumber(char *buff, int64 number, const char *last)
|
||||
return buff;
|
||||
}
|
||||
|
||||
static char *FormatHexNumber(char *buff, int64 number, const char *last)
|
||||
{
|
||||
return buff + snprintf(buff, last - buff, "0x%x", (uint32)number);
|
||||
}
|
||||
|
||||
static char *FormatYmdString(char *buff, Date date, const char* last)
|
||||
{
|
||||
@@ -815,6 +819,10 @@ static char* FormatString(char* buff, const char* str, const int64* argv, uint c
|
||||
buff = FormatNoCommaNumber(buff, GetInt64(&argv), last);
|
||||
break;
|
||||
|
||||
case SCC_HEX: // {HEX}
|
||||
buff = FormatHexNumber(buff, GetInt64(&argv), last);
|
||||
break;
|
||||
|
||||
case SCC_CURRENCY: // {CURRENCY}
|
||||
buff = FormatGenericCurrency(buff, _currency, GetInt64(&argv), false, last);
|
||||
break;
|
||||
|
Reference in New Issue
Block a user