diff options
Diffstat (limited to 'platform/osx/os_osx.mm')
-rw-r--r-- | platform/osx/os_osx.mm | 32 |
1 files changed, 24 insertions, 8 deletions
diff --git a/platform/osx/os_osx.mm b/platform/osx/os_osx.mm index f502fb9a9c..da7321d72a 100644 --- a/platform/osx/os_osx.mm +++ b/platform/osx/os_osx.mm @@ -910,6 +910,8 @@ OS::VideoMode OS_OSX::get_default_video_mode() const { void OS_OSX::initialize_core() { + crash_handler.initialize(); + OS_Unix::initialize_core(); DirAccess::make_default<DirAccessOSX>(DirAccess::ACCESS_RESOURCES); @@ -1086,12 +1088,7 @@ void OS_OSX::initialize(const VideoMode &p_desired, int p_video_driver, int p_au visual_server->init(); // visual_server->cursor_set_visible(false, 0); - AudioDriverManager::get_driver(p_audio_driver)->set_singleton(); - - if (AudioDriverManager::get_driver(p_audio_driver)->init() != OK) { - - ERR_PRINT("Initializing audio failed."); - } + AudioDriverManager::initialize(p_audio_driver); // physics_server = memnew(PhysicsServerSW); @@ -1243,7 +1240,7 @@ bool OS_OSX::is_mouse_grab_enabled() const { return mouse_grab; } -void OS_OSX::warp_mouse_pos(const Point2 &p_to) { +void OS_OSX::warp_mouse_position(const Point2 &p_to) { //copied from windows impl with osx native calls if (mouse_mode == MOUSE_MODE_CAPTURED) { @@ -1736,6 +1733,17 @@ String OS_OSX::get_executable_path() const { } } +String OS_OSX::get_resource_dir() const { + // start with our executable path + String path = get_executable_path(); + + int pos = path.find_last("/Contents/MacOS/"); + if (pos < 0) + return OS::get_resource_dir(); + + return path.substr(0, pos) + "/Contents/Resources/"; +} + // Returns string representation of keys, if they are printable. // static NSString *createStringForKeys(const CGKeyCode *keyCode, int length) { @@ -1901,7 +1909,7 @@ String OS_OSX::get_joy_guid(int p_device) const { return input->get_joy_guid_remapped(p_device); } -PowerState OS_OSX::get_power_state() { +OS::PowerState OS_OSX::get_power_state() { return power_manager->get_power_state(); } @@ -2011,3 +2019,11 @@ OS_OSX::OS_OSX() { bool OS_OSX::_check_internal_feature_support(const String &p_feature) { return p_feature == "pc" || p_feature == "s3tc"; } + +void OS_OSX::disable_crash_handler() { + crash_handler.disable(); +} + +bool OS_OSX::is_disable_crash_handler() const { + return crash_handler.is_disabled(); +} |