diff options
Diffstat (limited to 'core/os/os.cpp')
-rw-r--r-- | core/os/os.cpp | 54 |
1 files changed, 17 insertions, 37 deletions
diff --git a/core/os/os.cpp b/core/os/os.cpp index b44487b908..1ed9484208 100644 --- a/core/os/os.cpp +++ b/core/os/os.cpp @@ -5,8 +5,8 @@ /* GODOT ENGINE */ /* https://godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2019 Juan Linietsky, Ariel Manzur. */ -/* Copyright (c) 2014-2019 Godot Engine contributors (cf. AUTHORS.md) */ +/* Copyright (c) 2007-2020 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2014-2020 Godot Engine contributors (cf. AUTHORS.md). */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -196,29 +196,6 @@ bool OS::is_stdout_verbose() const { return _verbose_stdout; } -void OS::set_last_error(const char *p_error) { - - GLOBAL_LOCK_FUNCTION - if (p_error == NULL) - p_error = "Unknown Error"; - - if (last_error) - memfree(last_error); - last_error = NULL; - int len = 0; - while (p_error[len++]) - ; - - last_error = (char *)memalloc(len); - for (int i = 0; i < len; i++) - last_error[i] = p_error[i]; -} - -const char *OS::get_last_error() const { - GLOBAL_LOCK_FUNCTION - return last_error ? last_error : ""; -} - void OS::dump_memory_to_file(const char *p_file) { //Memory::dump_static_mem_to_file(p_file); @@ -244,7 +221,7 @@ bool OS::has_virtual_keyboard() const { return false; } -void OS::show_virtual_keyboard(const String &p_existing_text, const Rect2 &p_screen_rect) { +void OS::show_virtual_keyboard(const String &p_existing_text, const Rect2 &p_screen_rect, int p_max_input_length) { } void OS::hide_virtual_keyboard() { @@ -297,14 +274,6 @@ void OS::dump_resources_to_file(const char *p_file) { ResourceCache::dump(p_file); } -void OS::clear_last_error() { - - GLOBAL_LOCK_FUNCTION - if (last_error) - memfree(last_error); - last_error = NULL; -} - void OS::set_no_window_mode(bool p_enable) { _no_window = p_enable; @@ -374,6 +343,12 @@ String OS::get_cache_path() const { return "."; } +// Path to macOS .app bundle resources +String OS::get_bundle_resource_dir() const { + + return "."; +}; + // OS specific path for user:// String OS::get_user_data_dir() const { @@ -603,6 +578,14 @@ bool OS::is_vsync_enabled() const { return _use_vsync; } +void OS::set_vsync_via_compositor(bool p_enable) { + _vsync_via_compositor = p_enable; +} + +bool OS::is_vsync_via_compositor_enabled() const { + return _vsync_via_compositor; +} + OS::PowerState OS::get_power_state() { return POWERSTATE_UNKNOWN; } @@ -764,7 +747,6 @@ OS::OS() { void *volatile stack_bottom; restart_on_exit = false; - last_error = NULL; singleton = this; _keep_screen_on = true; // set default value to true, because this had been true before godot 2.0. low_processor_usage_mode = false; @@ -790,8 +772,6 @@ OS::OS() { } OS::~OS() { - if (last_error) - memfree(last_error); memdelete(_logger); singleton = NULL; } |