summaryrefslogtreecommitdiff
path: root/src/video/cocoa
diff options
context:
space:
mode:
authorMichael Lutz <michi@icosahedron.de>2021-01-07 22:09:43 +0100
committerMichael Lutz <michi@icosahedron.de>2021-02-14 11:50:18 +0100
commite5c325364285b1e6e93afa2a0a79b1ec437f238e (patch)
tree8e2b58ad6cb1ff9b6bff8bb8f69308d72ff5d5b2 /src/video/cocoa
parent0fc763bc5597e04ee528a34ca2730f780d25fb5e (diff)
downloadopenttd-e5c325364285b1e6e93afa2a0a79b1ec437f238e.tar.xz
Add: [OSX] Setting to disable HiDPI graphics rendering.
Diffstat (limited to 'src/video/cocoa')
-rw-r--r--src/video/cocoa/cocoa_wnd.mm6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/video/cocoa/cocoa_wnd.mm b/src/video/cocoa/cocoa_wnd.mm
index cd194f712..afe2cece6 100644
--- a/src/video/cocoa/cocoa_wnd.mm
+++ b/src/video/cocoa/cocoa_wnd.mm
@@ -46,6 +46,8 @@
* 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>
@end
@@ -417,13 +419,13 @@ void CocoaDialog(const char *title, const char *message, const char *buttonLabel
float _current_magnification;
NSUInteger _current_mods;
bool _emulated_down;
- bool _use_hidpi;
+ bool _use_hidpi; ///< Render content in native resolution?
}
- (instancetype)initWithFrame:(NSRect)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;
}