mirror of
https://github.com/OpenTTD/OpenTTD.git
synced 2025-08-16 11:09:11 +00:00
Compare commits
7 Commits
Author | SHA1 | Date | |
---|---|---|---|
|
f6643952ce | ||
|
8808c6d033 | ||
|
c7ace459a7 | ||
|
acb63cb4d4 | ||
|
fb8f4119f3 | ||
|
7653def300 | ||
|
224bb105bc |
@@ -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)
|
||||
|
@@ -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
|
||||
------------------------------------------------------------------------
|
||||
|
||||
|
||||
|
@@ -1,3 +1,9 @@
|
||||
openttd (1.9.3-0) unstable; urgency=low
|
||||
|
||||
* New upstream release 1.9.3
|
||||
|
||||
-- OpenTTD <info@openttd.org> Mon, 16 Sep 2019 21:00:00 +0200
|
||||
|
||||
openttd (1.9.3~RC1-0) unstable; urgency=low
|
||||
|
||||
* New upstream release 1.9.3-RC1
|
||||
|
@@ -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
|
||||
|
@@ -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
|
||||
|
@@ -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(); }
|
||||
};
|
||||
|
||||
|
@@ -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();
|
||||
|
24
src/fios.cpp
24
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;
|
||||
}
|
||||
|
@@ -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
|
||||
|
||||
|
||||
|
@@ -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
|
||||
|
||||
|
@@ -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);
|
||||
|
Reference in New Issue
Block a user