Merge tag '1.11.1' into 1.11

This commit is contained in:
Sergii Pylypenko
2021-04-25 22:58:47 +03:00
150 changed files with 1525 additions and 616 deletions
+1 -1
View File
@@ -497,7 +497,7 @@ void Win32FontCache::ClearFontCache()
* For anti-aliased rendering, GDI uses the strange value range of 0 to 64,
* inclusively. To map this to 0 to 255, we shift left by two and then
* subtract one. */
uint pitch = Align(aa ? gm.gmBlackBoxX : std::max(gm.gmBlackBoxX / 8u, 1u), 4);
uint pitch = Align(aa ? gm.gmBlackBoxX : std::max((gm.gmBlackBoxX + 7u) / 8u, 1u), 4);
/* Draw shadow for medium size. */
if (this->fs == FS_NORMAL && !aa) {
+6 -3
View File
@@ -247,7 +247,7 @@ bool FiosGetDiskFreeSpace(const char *path, uint64 *tot)
ULARGE_INTEGER bytes_free;
bool retval = GetDiskFreeSpaceEx(OTTD2FS(path), &bytes_free, nullptr, nullptr);
if (retval) *tot = bytes_free.QuadPart;
if (retval && tot != nullptr) *tot = bytes_free.QuadPart;
SetErrorMode(sem); // reset previous setting
return retval;
@@ -625,9 +625,12 @@ wchar_t *convert_to_fs(const char *name, wchar_t *system_buf, size_t buflen, boo
/** Determine the current user's locale. */
const char *GetCurrentLocale(const char *)
{
const LANGID userUiLang = GetUserDefaultUILanguage();
const LCID userUiLocale = MAKELCID(userUiLang, SORT_DEFAULT);
char lang[9], country[9];
if (GetLocaleInfoA(LOCALE_USER_DEFAULT, LOCALE_SISO639LANGNAME, lang, lengthof(lang)) == 0 ||
GetLocaleInfoA(LOCALE_USER_DEFAULT, LOCALE_SISO3166CTRYNAME, country, lengthof(country)) == 0) {
if (GetLocaleInfoA(userUiLocale, LOCALE_SISO639LANGNAME, lang, lengthof(lang)) == 0 ||
GetLocaleInfoA(userUiLocale, LOCALE_SISO3166CTRYNAME, country, lengthof(country)) == 0) {
/* Unable to retrieve the locale. */
return nullptr;
}