mirror of https://github.com/OpenTTD/OpenTTD
Add: [OSX] Setting to disable HiDPI graphics rendering.
parent
0fc763bc55
commit
e5c3253642
|
@ -9,6 +9,10 @@ extern std::string _config_language_file;
|
||||||
|
|
||||||
static const char *_support8bppmodes = "no|system|hardware";
|
static const char *_support8bppmodes = "no|system|hardware";
|
||||||
|
|
||||||
|
#ifdef WITH_COCOA
|
||||||
|
extern bool _allow_hidpi_window;
|
||||||
|
#endif
|
||||||
|
|
||||||
static const SettingDescGlobVarList _misc_settings[] = {
|
static const SettingDescGlobVarList _misc_settings[] = {
|
||||||
[post-amble]
|
[post-amble]
|
||||||
};
|
};
|
||||||
|
@ -317,5 +321,11 @@ min = ZOOM_LVL_MIN
|
||||||
max = ZOOM_LVL_OUT_4X
|
max = ZOOM_LVL_OUT_4X
|
||||||
cat = SC_BASIC
|
cat = SC_BASIC
|
||||||
|
|
||||||
|
[SDTG_BOOL]
|
||||||
|
ifdef = WITH_COCOA
|
||||||
|
name = ""allow_hidpi""
|
||||||
|
var = _allow_hidpi_window
|
||||||
|
def = true
|
||||||
|
|
||||||
[SDTG_END]
|
[SDTG_END]
|
||||||
|
|
||||||
|
|
|
@ -46,6 +46,8 @@
|
||||||
* Read http://developer.apple.com/releasenotes/Cocoa/Objective-C++.html for more information.
|
* Read http://developer.apple.com/releasenotes/Cocoa/Objective-C++.html for more information.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
bool _allow_hidpi_window = true; // Referenced from table/misc_settings.ini
|
||||||
|
|
||||||
@interface OTTDMain : NSObject <NSApplicationDelegate>
|
@interface OTTDMain : NSObject <NSApplicationDelegate>
|
||||||
@end
|
@end
|
||||||
|
|
||||||
|
@ -417,13 +419,13 @@ void CocoaDialog(const char *title, const char *message, const char *buttonLabel
|
||||||
float _current_magnification;
|
float _current_magnification;
|
||||||
NSUInteger _current_mods;
|
NSUInteger _current_mods;
|
||||||
bool _emulated_down;
|
bool _emulated_down;
|
||||||
bool _use_hidpi;
|
bool _use_hidpi; ///< Render content in native resolution?
|
||||||
}
|
}
|
||||||
|
|
||||||
- (instancetype)initWithFrame:(NSRect)frameRect
|
- (instancetype)initWithFrame:(NSRect)frameRect
|
||||||
{
|
{
|
||||||
if (self = [ super initWithFrame:frameRect ]) {
|
if (self = [ super initWithFrame:frameRect ]) {
|
||||||
self->_use_hidpi = [ self respondsToSelector:@selector(convertRectToBacking:) ] && [ self respondsToSelector:@selector(convertRectFromBacking:) ];
|
self->_use_hidpi = _allow_hidpi_window && [ self respondsToSelector:@selector(convertRectToBacking:) ] && [ self respondsToSelector:@selector(convertRectFromBacking:) ];
|
||||||
}
|
}
|
||||||
return self;
|
return self;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue