diff --git a/changelog.txt b/changelog.txt index 2e00def700..cd9bbe7ebe 100644 --- a/changelog.txt +++ b/changelog.txt @@ -1,3 +1,11 @@ +1.9.3 (2019-09-16) +------------------------------------------------------------------------ +- Change: Use natural sort when sorting the file list (#7727) +- Fix #7479: Don't close construction windows when changing client name (#7728) +- Fix #7731: Files sorting by modification time on Windows XP (#7731) +- Fix #7644: [OSX] Better solution for colourspace/performance issues (#7741) + + 1.9.3-RC1 (2019-09-07) ------------------------------------------------------------------------ - Add: Can now click industries to make orders to their neutral station (e.g. oil rig) (#7709) diff --git a/known-bugs.txt b/known-bugs.txt index 598fbcda38..342e75305d 100644 --- a/known-bugs.txt +++ b/known-bugs.txt @@ -1,6 +1,6 @@ OpenTTD's known bugs -Last updated: 2019-09-07 -Release version: 1.9.3-RC1 +Last updated: 2019-09-16 +Release version: 1.9.3 ------------------------------------------------------------------------ diff --git a/os/debian/changelog b/os/debian/changelog index f2ff4169a0..67b0e802c1 100644 --- a/os/debian/changelog +++ b/os/debian/changelog @@ -1,3 +1,9 @@ +openttd (1.9.3-0) unstable; urgency=low + + * New upstream release 1.9.3 + + -- OpenTTD Mon, 16 Sep 2019 21:00:00 +0200 + openttd (1.9.3~RC1-0) unstable; urgency=low * New upstream release 1.9.3-RC1 diff --git a/os/rpm/openttd.spec b/os/rpm/openttd.spec index 98dfacf572..1c0f55f46c 100644 --- a/os/rpm/openttd.spec +++ b/os/rpm/openttd.spec @@ -17,9 +17,9 @@ # Name: openttd -Version: 1.9.3-RC1 +Version: 1.9.3 Release: 0 -%define srcver 1.9.3-RC1 +%define srcver 1.9.3 Summary: An open source reimplementation of Chris Sawyer's Transport Tycoon Deluxe License: GPL-2.0 Group: Amusements/Games/Strategy/Other diff --git a/os/windows/installer/install.nsi b/os/windows/installer/install.nsi index 8bb35e3c06..54c739ad94 100644 --- a/os/windows/installer/install.nsi +++ b/os/windows/installer/install.nsi @@ -3,7 +3,7 @@ !define APPV_MINOR 9 !define APPV_MAINT 3 !define APPV_BUILD 0 -!define APPV_EXTRA "-RC1" +!define APPV_EXTRA "" !define APPNAME "OpenTTD" ; Define application name !define APPVERSION "${APPV_MAJOR}.${APPV_MINOR}.${APPV_MAINT}${APPV_EXTRA}" ; Define application version diff --git a/src/blitter/32bpp_anim_sse4.hpp b/src/blitter/32bpp_anim_sse4.hpp index 5ff1fb01be..ee678bc164 100644 --- a/src/blitter/32bpp_anim_sse4.hpp +++ b/src/blitter/32bpp_anim_sse4.hpp @@ -46,7 +46,7 @@ public: /** Factory for the SSE4 32 bpp blitter (with palette animation). */ class FBlitter_32bppSSE4_Anim: public BlitterFactory { public: - FBlitter_32bppSSE4_Anim() : BlitterFactory("32bpp-sse4-anim", "SSE4 Blitter (palette animation)", HasCPUIDFlag(1, 2, 19)) {} + FBlitter_32bppSSE4_Anim() : BlitterFactory("32bpp-sse4-anim", "32bpp SSE4 Blitter (palette animation)", HasCPUIDFlag(1, 2, 19)) {} /* virtual */ Blitter *CreateInstance() { return new Blitter_32bppSSE4_Anim(); } }; diff --git a/src/company_cmd.cpp b/src/company_cmd.cpp index 6194ebee80..62a818ea62 100644 --- a/src/company_cmd.cpp +++ b/src/company_cmd.cpp @@ -104,9 +104,12 @@ void SetLocalCompany(CompanyID new_company) /* company could also be COMPANY_SPECTATOR or OWNER_NONE */ assert(Company::IsValidID(new_company) || new_company == COMPANY_SPECTATOR || new_company == OWNER_NONE); + /* If actually changing to another company, several windows need closing */ + bool switching_company = _local_company != new_company; + #ifdef ENABLE_NETWORK /* Delete the chat window, if you were team chatting. */ - InvalidateWindowData(WC_SEND_NETWORK_MSG, DESTTYPE_TEAM, _local_company); + if (switching_company) InvalidateWindowData(WC_SEND_NETWORK_MSG, DESTTYPE_TEAM, _local_company); #endif assert(IsLocalCompany()); @@ -114,7 +117,7 @@ void SetLocalCompany(CompanyID new_company) _current_company = _local_company = new_company; /* Delete any construction windows... */ - DeleteConstructionWindows(); + if (switching_company) DeleteConstructionWindows(); /* ... and redraw the whole screen. */ MarkWholeScreenDirty(); diff --git a/src/fios.cpp b/src/fios.cpp index 73365ddc29..c2727d2d5b 100644 --- a/src/fios.cpp +++ b/src/fios.cpp @@ -56,7 +56,7 @@ int CDECL CompareFiosItems(const FiosItem *da, const FiosItem *db) if ((_savegame_sort_order & SORT_BY_NAME) == 0 && da->mtime != db->mtime) { r = da->mtime < db->mtime ? -1 : 1; } else { - r = strcasecmp(da->title, db->title); + r = strnatcmp(da->title, db->title); } if (_savegame_sort_order & SORT_DESCENDING) r = -r; @@ -319,13 +319,29 @@ bool FiosFileScanner::AddFile(const char *filename, size_t basepath_length, cons FiosItem *fios = file_list.Append(); #ifdef _WIN32 - struct _stat sb; - if (_tstat(OTTD2FS(filename), &sb) == 0) { + // Retrieve the file modified date using GetFileTime rather than stat to work around an obscure MSVC bug that affects Windows XP + HANDLE fh = CreateFile(OTTD2FS(filename), GENERIC_READ, FILE_SHARE_READ | FILE_SHARE_WRITE, nullptr, OPEN_EXISTING, 0, nullptr); + + if (fh != INVALID_HANDLE_VALUE) { + FILETIME ft; + ULARGE_INTEGER ft_int64; + + if (GetFileTime(fh, nullptr, nullptr, &ft) != 0) { + ft_int64.HighPart = ft.dwHighDateTime; + ft_int64.LowPart = ft.dwLowDateTime; + + // Convert from hectonanoseconds since 01/01/1601 to seconds since 01/01/1970 + fios->mtime = ft_int64.QuadPart / 10000000ULL - 11644473600ULL; + } else { + fios->mtime = 0; + } + + CloseHandle(fh); #else struct stat sb; if (stat(filename, &sb) == 0) { -#endif fios->mtime = sb.st_mtime; +#endif } else { fios->mtime = 0; } diff --git a/src/rev.cpp b/src/rev.cpp index fee7e0c7d6..fc1554110e 100644 --- a/src/rev.cpp +++ b/src/rev.cpp @@ -37,7 +37,7 @@ bool IsReleasedVersion() * * shows a "M", if the binary is made from modified source code. */ -const char _openttd_revision[] = "1.9.3-RC1"; +const char _openttd_revision[] = "1.9.3"; /** * The text version of OpenTTD's build date. @@ -50,7 +50,7 @@ const char _openttd_build_date[] = __DATE__ " " __TIME__; /** * The git revision hash of this version. */ -const char _openttd_revision_hash[] = "e5021a0587c504df89a3e549544f3c9b78e8a4bd"; +const char _openttd_revision_hash[] = "f6643952ce53b1823c2273964466f785a907ec1a"; /** * Let us know if current build was modified. This detection @@ -82,11 +82,11 @@ const byte _openttd_revision_tagged = 1; * final release will always have a lower version number than the released * version, thus making comparisons on specific revisions easy. */ -const uint32 _openttd_newgrf_version = 1 << 28 | 9 << 24 | 3 << 20 | 0 << 19 | 28004; +const uint32 _openttd_newgrf_version = 1 << 28 | 9 << 24 | 3 << 20 | 1 << 19 | 28004; #ifdef __MORPHOS__ /** * Variable used by MorphOS to show the version. */ -extern const char morphos_versions_tag[] = "$VER: OpenTTD 1.9.3-RC1 (08.09.19) OpenTTD Team [MorphOS, PowerPC]"; +extern const char morphos_versions_tag[] = "$VER: OpenTTD 1.9.3 (16.09.19) OpenTTD Team [MorphOS, PowerPC]"; #endif diff --git a/src/video/cocoa/cocoa_v.h b/src/video/cocoa/cocoa_v.h index 564daefe0f..ecaba02bdc 100644 --- a/src/video/cocoa/cocoa_v.h +++ b/src/video/cocoa/cocoa_v.h @@ -271,6 +271,7 @@ uint QZ_ListModes(OTTD_Point *modes, uint max_modes, CGDirectDisplayID display_i - (BOOL)windowShouldClose:(id)sender; - (void)windowDidEnterFullScreen:(NSNotification *)aNotification; +- (void)windowDidChangeScreenProfile:(NSNotification *)aNotification; @end diff --git a/src/video/cocoa/cocoa_v.mm b/src/video/cocoa/cocoa_v.mm index d165610245..52a25f94fb 100644 --- a/src/video/cocoa/cocoa_v.mm +++ b/src/video/cocoa/cocoa_v.mm @@ -1362,6 +1362,11 @@ static const char *Utf8AdvanceByUtf16Units(const char *str, NSUInteger count) [ e release ]; } } +/** The colour profile of the screen the window is on changed. */ +- (void)windowDidChangeScreenProfile:(NSNotification *)aNotification +{ + if (!driver->setup) driver->WindowResized(); +} @end diff --git a/src/video/cocoa/wnd_quartz.mm b/src/video/cocoa/wnd_quartz.mm index bd5d8bdaa0..4115113cdc 100644 --- a/src/video/cocoa/wnd_quartz.mm +++ b/src/video/cocoa/wnd_quartz.mm @@ -106,35 +106,6 @@ public: }; -static CGColorSpaceRef QZ_GetCorrectColorSpace() -{ - static CGColorSpaceRef colorSpace = NULL; - - if (colorSpace == NULL) { -#if (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5) - if (MacOSVersionIsAtLeast(10, 5, 0)) { - colorSpace = CGColorSpaceCreateWithName(kCGColorSpaceSRGB); - } else -#endif - { -#if (MAC_OS_X_VERSION_MIN_REQUIRED < MAC_OS_X_VERSION_10_5) && !defined(HAVE_OSX_1011_SDK) - CMProfileRef sysProfile; - if (CMGetSystemProfile(&sysProfile) == noErr) { - colorSpace = CGColorSpaceCreateWithPlatformColorSpace(sysProfile); - CMCloseProfile(sysProfile); - } -#endif - } - - if (colorSpace == NULL) colorSpace = CGColorSpaceCreateDeviceRGB(); - - if (colorSpace == NULL) error("Could not get system colour space. You might need to recalibrate your monitor."); - } - - return colorSpace; -} - - @implementation OTTD_QuartzView - (void)setDriver:(WindowQuartzSubdriver*)drv @@ -289,9 +260,7 @@ bool WindowQuartzSubdriver::SetVideoMode(int width, int height, int bpp) styleMask:style backing:NSBackingStoreBuffered defer:NO ]; - if ([ this->window respondsToSelector:@selector(setColorSpace:) ]) { - [ this->window setColorSpace:[ [ [ NSColorSpace alloc ] initWithCGColorSpace:QZ_GetCorrectColorSpace() ] autorelease ] ]; - } + if (this->window == nil) { DEBUG(driver, 0, "Could not create the Cocoa window."); this->setup = false; @@ -598,20 +567,36 @@ bool WindowQuartzSubdriver::WindowResized() this->window_width = (int)newframe.size.width; this->window_height = (int)newframe.size.height; + /* Get screen colour space. */ + CGColorSpaceRef color_space = NULL; + +#if (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_6) + if ([ this->window respondsToSelector:@selector(colorSpace) ]) { + color_space = [ [ this->window colorSpace ] CGColorSpace ]; + CGColorSpaceRetain(color_space); + } +#endif +#if (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5) + if (color_space == NULL && MacOSVersionIsAtLeast(10, 5, 0)) color_space = CGColorSpaceCreateWithName(kCGColorSpaceSRGB); +#endif + if (color_space == NULL) color_space = CGColorSpaceCreateDeviceRGB(); + if (color_space == NULL) error("Could not get system colour space. You might need to recalibrate your monitor."); + /* Create Core Graphics Context */ free(this->window_buffer); this->window_buffer = (uint32*)malloc(this->window_width * this->window_height * 4); CGContextRelease(this->cgcontext); this->cgcontext = CGBitmapContextCreate( - this->window_buffer, // data + this->window_buffer, // data this->window_width, // width this->window_height, // height 8, // bits per component this->window_width * 4, // bytes per row - QZ_GetCorrectColorSpace(), // color space + color_space, // color space kCGImageAlphaNoneSkipFirst | kCGBitmapByteOrder32Host ); + CGColorSpaceRelease(color_space); assert(this->cgcontext != NULL); CGContextSetShouldAntialias(this->cgcontext, FALSE);