summaryrefslogtreecommitdiff
path: root/src/strings.cpp
diff options
context:
space:
mode:
authorsmatz <smatz@openttd.org>2010-12-19 20:15:32 +0000
committersmatz <smatz@openttd.org>2010-12-19 20:15:32 +0000
commit79681051c8e139b3358b92cbdd2d6741fe74b4fd (patch)
tree175c7c2c2bd9e426daf1842c5f59fd56ed6d3562 /src/strings.cpp
parent3b46cf50b9b14148c0ebea98699edd11ef1ed662 (diff)
downloadopenttd-79681051c8e139b3358b92cbdd2d6741fe74b4fd.tar.xz
(svn r21541) -Add: {DATE_SHORT} and {DATE_LONG} can now have cases
Diffstat (limited to 'src/strings.cpp')
-rw-r--r--src/strings.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/strings.cpp b/src/strings.cpp
index 775bd80ae..661afeec3 100644
--- a/src/strings.cpp
+++ b/src/strings.cpp
@@ -320,22 +320,22 @@ static char *FormatBytes(char *buff, int64 number, const char *last)
return buff;
}
-static char *FormatYmdString(char *buff, Date date, const char *last)
+static char *FormatYmdString(char *buff, Date date, uint modifier, const char *last)
{
YearMonthDay ymd;
ConvertDateToYMD(date, &ymd);
int64 args[3] = { ymd.day + STR_ORDINAL_NUMBER_1ST - 1, STR_MONTH_ABBREV_JAN + ymd.month, ymd.year };
- return FormatString(buff, GetStringPtr(STR_FORMAT_DATE_LONG), args, endof(args), 0, last);
+ return FormatString(buff, GetStringPtr(STR_FORMAT_DATE_LONG), args, endof(args), modifier >> 24, last);
}
-static char *FormatMonthAndYear(char *buff, Date date, const char *last)
+static char *FormatMonthAndYear(char *buff, Date date, uint modifier, const char *last)
{
YearMonthDay ymd;
ConvertDateToYMD(date, &ymd);
int64 args[2] = { STR_MONTH_JAN + ymd.month, ymd.year };
- return FormatString(buff, GetStringPtr(STR_FORMAT_DATE_SHORT), args, endof(args), 0, last);
+ return FormatString(buff, GetStringPtr(STR_FORMAT_DATE_SHORT), args, endof(args), modifier >> 24, last);
}
static char *FormatTinyOrISODate(char *buff, Date date, StringID str, const char *last)
@@ -680,11 +680,11 @@ static char *FormatString(char *buff, const char *str, int64 *argv, const int64
}
case SCC_DATE_LONG: // {DATE_LONG}
- buff = FormatYmdString(buff, GetInt32(&argv, argve, &argt, SCC_DATE_LONG), last);
+ buff = FormatYmdString(buff, GetInt32(&argv, argve, &argt, SCC_DATE_LONG), modifier, last);
break;
case SCC_DATE_SHORT: // {DATE_SHORT}
- buff = FormatMonthAndYear(buff, GetInt32(&argv, argve, &argt, SCC_DATE_SHORT), last);
+ buff = FormatMonthAndYear(buff, GetInt32(&argv, argve, &argt, SCC_DATE_SHORT), modifier, last);
break;
case SCC_VELOCITY: { // {VELOCITY}