mirror of
https://github.com/JGRennison/OpenTTD-patches.git
synced 2024-11-17 21:25:40 +00:00
(svn r17711) -Codechange: [OSX] Don't use deprecated methods to construct a Cocoa string.
This commit is contained in:
parent
5517e5371c
commit
3bf4f13f3b
@ -59,7 +59,7 @@ void GetMacOSVersion(int *return_major, int *return_minor, int *return_bugfix)
|
|||||||
|
|
||||||
void ShowMacDialog(const char *title, const char *message, const char *buttonLabel)
|
void ShowMacDialog(const char *title, const char *message, const char *buttonLabel)
|
||||||
{
|
{
|
||||||
NSRunAlertPanel([NSString stringWithCString: title], [NSString stringWithCString: message], [NSString stringWithCString: buttonLabel], nil, nil);
|
NSRunAlertPanel([ NSString stringWithUTF8String:title ], [ NSString stringWithUTF8String:message ], [ NSString stringWithUTF8String:buttonLabel ], nil, nil);
|
||||||
}
|
}
|
||||||
|
|
||||||
#elif defined WITH_COCOA
|
#elif defined WITH_COCOA
|
||||||
|
@ -405,7 +405,7 @@ void CocoaDialog(const char *title, const char *message, const char *buttonLabel
|
|||||||
}
|
}
|
||||||
|
|
||||||
QZ_ShowMouse();
|
QZ_ShowMouse();
|
||||||
NSRunAlertPanel([NSString stringWithCString: title], [NSString stringWithCString: message], [NSString stringWithCString: buttonLabel], nil, nil);
|
NSRunAlertPanel([ NSString stringWithUTF8String:title ], [ NSString stringWithUTF8String:message ], [ NSString stringWithUTF8String:buttonLabel ], nil, nil);
|
||||||
|
|
||||||
if (!wasstarted && _video_driver != NULL) _video_driver->Stop();
|
if (!wasstarted && _video_driver != NULL) _video_driver->Stop();
|
||||||
|
|
||||||
|
@ -428,7 +428,6 @@ void WindowQuartzSubdriver::GetDeviceInfo()
|
|||||||
bool WindowQuartzSubdriver::SetVideoMode(int width, int height)
|
bool WindowQuartzSubdriver::SetVideoMode(int width, int height)
|
||||||
{
|
{
|
||||||
char caption[50];
|
char caption[50];
|
||||||
NSString *nsscaption;
|
|
||||||
unsigned int style;
|
unsigned int style;
|
||||||
NSRect contentRect;
|
NSRect contentRect;
|
||||||
BOOL isCustom = NO;
|
BOOL isCustom = NO;
|
||||||
@ -470,7 +469,7 @@ bool WindowQuartzSubdriver::SetVideoMode(int width, int height)
|
|||||||
[ window setDriver:this ];
|
[ window setDriver:this ];
|
||||||
|
|
||||||
snprintf(caption, sizeof(caption), "OpenTTD %s", _openttd_revision);
|
snprintf(caption, sizeof(caption), "OpenTTD %s", _openttd_revision);
|
||||||
nsscaption = [ [ NSString alloc ] initWithCString:caption ];
|
NSString *nsscaption = [ [ NSString alloc ] initWithUTF8String:caption ];
|
||||||
[ window setTitle: nsscaption ];
|
[ window setTitle: nsscaption ];
|
||||||
[ window setMiniwindowTitle: nsscaption ];
|
[ window setMiniwindowTitle: nsscaption ];
|
||||||
[ nsscaption release ];
|
[ nsscaption release ];
|
||||||
|
@ -402,7 +402,7 @@ bool WindowQuickdrawSubdriver::SetVideoMode(int width, int height)
|
|||||||
[ window setDriver:this ];
|
[ window setDriver:this ];
|
||||||
|
|
||||||
snprintf(caption, sizeof(caption), "OpenTTD %s", _openttd_revision);
|
snprintf(caption, sizeof(caption), "OpenTTD %s", _openttd_revision);
|
||||||
nsscaption = [ [ NSString alloc ] initWithCString:caption ];
|
nsscaption = [ [ NSString alloc ] initWithUTF8String:caption ];
|
||||||
[ window setTitle:nsscaption ];
|
[ window setTitle:nsscaption ];
|
||||||
[ window setMiniwindowTitle:nsscaption ];
|
[ window setMiniwindowTitle:nsscaption ];
|
||||||
[ nsscaption release ];
|
[ nsscaption release ];
|
||||||
|
Loading…
Reference in New Issue
Block a user