diff options
Diffstat (limited to 'core')
-rw-r--r-- | core/core_bind.cpp | 16 | ||||
-rw-r--r-- | core/core_bind.h | 3 | ||||
-rw-r--r-- | core/core_builders.py | 4 | ||||
-rw-r--r-- | core/doc_data.h | 2 | ||||
-rw-r--r-- | core/os/os.cpp | 9 | ||||
-rw-r--r-- | core/os/os.h | 20 |
6 files changed, 51 insertions, 3 deletions
diff --git a/core/core_bind.cpp b/core/core_bind.cpp index 3a4fddc670..b1858c6b32 100644 --- a/core/core_bind.cpp +++ b/core/core_bind.cpp @@ -235,6 +235,19 @@ int OS::execute(const String &p_path, const Vector<String> &p_arguments, Array r return exitcode; } +int OS::create_instance(const Vector<String> &p_arguments) { + List<String> args; + for (int i = 0; i < p_arguments.size(); i++) { + args.push_back(p_arguments[i]); + } + ::OS::ProcessID pid = 0; + Error err = ::OS::get_singleton()->create_instance(args, &pid); + if (err != OK) { + return -1; + } + return pid; +} + int OS::create_process(const String &p_path, const Vector<String> &p_arguments) { List<String> args; for (int i = 0; i < p_arguments.size(); i++) { @@ -537,6 +550,7 @@ void OS::_bind_methods() { ClassDB::bind_method(D_METHOD("get_executable_path"), &OS::get_executable_path); ClassDB::bind_method(D_METHOD("execute", "path", "arguments", "output", "read_stderr"), &OS::execute, DEFVAL(Array()), DEFVAL(false)); ClassDB::bind_method(D_METHOD("create_process", "path", "arguments"), &OS::create_process); + ClassDB::bind_method(D_METHOD("create_instance", "arguments"), &OS::create_instance); ClassDB::bind_method(D_METHOD("kill", "pid"), &OS::kill); ClassDB::bind_method(D_METHOD("shell_open", "uri"), &OS::shell_open); ClassDB::bind_method(D_METHOD("get_process_id"), &OS::get_process_id); @@ -603,8 +617,8 @@ void OS::_bind_methods() { ADD_PROPERTY_DEFAULT("low_processor_usage_mode", false); ADD_PROPERTY_DEFAULT("low_processor_usage_mode_sleep_usec", 6900); - BIND_ENUM_CONSTANT(VIDEO_DRIVER_GLES2); BIND_ENUM_CONSTANT(VIDEO_DRIVER_VULKAN); + BIND_ENUM_CONSTANT(VIDEO_DRIVER_OPENGL_3); BIND_ENUM_CONSTANT(DAY_SUNDAY); BIND_ENUM_CONSTANT(DAY_MONDAY); diff --git a/core/core_bind.h b/core/core_bind.h index 3eb4c914a1..72865f583c 100644 --- a/core/core_bind.h +++ b/core/core_bind.h @@ -119,8 +119,8 @@ protected: public: enum VideoDriver { - VIDEO_DRIVER_GLES2, VIDEO_DRIVER_VULKAN, + VIDEO_DRIVER_OPENGL_3, }; enum Weekday { @@ -165,6 +165,7 @@ public: String get_executable_path() const; int execute(const String &p_path, const Vector<String> &p_arguments, Array r_output = Array(), bool p_read_stderr = false); int create_process(const String &p_path, const Vector<String> &p_arguments); + int create_instance(const Vector<String> &p_arguments); Error kill(int p_pid); Error shell_open(String p_uri); diff --git a/core/core_builders.py b/core/core_builders.py index 004475faa7..b07daa80ae 100644 --- a/core/core_builders.py +++ b/core/core_builders.py @@ -35,7 +35,9 @@ def make_certs_header(target, source, env): decomp_size = len(buf) import zlib - buf = zlib.compress(buf) + # Use maximum zlib compression level to further reduce file size + # (at the cost of initial build times). + buf = zlib.compress(buf, zlib.Z_BEST_COMPRESSION) g.write("/* THIS FILE IS GENERATED DO NOT EDIT */\n") g.write("#ifndef CERTS_COMPRESSED_GEN_H\n") diff --git a/core/doc_data.h b/core/doc_data.h index 19dec71927..c75cdfcde5 100644 --- a/core/doc_data.h +++ b/core/doc_data.h @@ -140,7 +140,9 @@ public: String brief_description; String description; Vector<TutorialDoc> tutorials; + Vector<MethodDoc> constructors; Vector<MethodDoc> methods; + Vector<MethodDoc> operators; Vector<MethodDoc> signals; Vector<ConstantDoc> constants; Map<String, String> enums; diff --git a/core/os/os.cpp b/core/os/os.cpp index 5892f91ff3..03e251880f 100644 --- a/core/os/os.cpp +++ b/core/os/os.cpp @@ -440,6 +440,15 @@ bool OS::has_feature(const String &p_feature) { if (p_feature == "riscv") { return true; } +#elif defined(__powerpc__) +#if defined(__powerpc64__) + if (p_feature == "ppc64") { + return true; + } +#endif + if (p_feature == "ppc") { + return true; + } #endif if (_check_internal_feature_support(p_feature)) { diff --git a/core/os/os.h b/core/os/os.h index 2700759fef..52bf731501 100644 --- a/core/os/os.h +++ b/core/os/os.h @@ -68,6 +68,11 @@ class OS { bool restart_on_exit = false; List<String> restart_commandline; + // for the user interface we keep a record of the current display driver + // so we can retrieve the rendering drivers available + int _display_driver_id = -1; + String _current_rendering_driver_name = ""; + protected: void _set_logger(CompositeLogger *p_logger); @@ -81,6 +86,11 @@ public: RENDER_SEPARATE_THREAD }; + enum RenderMainThreadMode { + RENDER_MAIN_THREAD_ONLY, + RENDER_ANY_THREAD, + }; + protected: friend class Main; // Needed by tests to setup command-line args. @@ -88,6 +98,7 @@ protected: HasServerFeatureCallback has_server_feature_callback = nullptr; RenderThreadMode _render_thread_mode = RENDER_THREAD_SAFE; + RenderMainThreadMode _render_main_thread_mode = RENDER_ANY_THREAD; // Functions used by Main to initialize/deinitialize the OS. void add_logger(Logger *p_logger); @@ -95,6 +106,9 @@ protected: virtual void initialize() = 0; virtual void initialize_joypads() = 0; + void set_current_rendering_driver_name(String p_driver_name) { _current_rendering_driver_name = p_driver_name; } + void set_display_driver_id(int p_display_driver_id) { _display_driver_id = p_display_driver_id; } + virtual void set_main_loop(MainLoop *p_main_loop) = 0; virtual void delete_main_loop() = 0; @@ -110,6 +124,9 @@ public: static OS *get_singleton(); + String get_current_rendering_driver_name() const { return _current_rendering_driver_name; } + int get_display_driver_id() const { return _display_driver_id; } + void print_error(const char *p_function, const char *p_file, int p_line, const char *p_code, const char *p_rationale, bool p_editor_notify = false, Logger::ErrorType p_type = Logger::ERR_ERROR); void print(const char *p_format, ...) _PRINTF_FORMAT_ATTRIBUTE_2_3; void printerr(const char *p_format, ...) _PRINTF_FORMAT_ATTRIBUTE_2_3; @@ -134,6 +151,7 @@ public: virtual String get_executable_path() const; virtual Error execute(const String &p_path, const List<String> &p_arguments, String *r_pipe = nullptr, int *r_exitcode = nullptr, bool read_stderr = false, Mutex *p_pipe_mutex = nullptr) = 0; virtual Error create_process(const String &p_path, const List<String> &p_arguments, ProcessID *r_child_id = nullptr) = 0; + virtual Error create_instance(const List<String> &p_arguments, ProcessID *r_child_id = nullptr) { return create_process(get_executable_path(), p_arguments, r_child_id); }; virtual Error kill(const ProcessID &p_pid) = 0; virtual int get_process_id() const; virtual void vibrate_handheld(int p_duration_ms = 500); @@ -241,6 +259,8 @@ public: virtual uint64_t get_free_static_memory() const; RenderThreadMode get_render_thread_mode() const { return _render_thread_mode; } + RenderMainThreadMode get_render_main_thread_mode() const { return _render_main_thread_mode; } + void set_render_main_thread_mode(RenderMainThreadMode p_thread_mode) { _render_main_thread_mode = p_thread_mode; } virtual String get_locale() const; String get_locale_language() const; |