summaryrefslogtreecommitdiff
path: root/modules
diff options
context:
space:
mode:
Diffstat (limited to 'modules')
-rw-r--r--modules/basis_universal/SCsub7
-rw-r--r--modules/basis_universal/register_types.cpp15
-rw-r--r--modules/fbx/data/fbx_mesh_data.cpp11
-rw-r--r--modules/freetype/SCsub17
-rw-r--r--modules/gdscript/gdscript.cpp4
-rw-r--r--modules/gdscript/gdscript_analyzer.cpp17
-rw-r--r--modules/gdscript/gdscript_parser.cpp11
-rw-r--r--modules/gltf/gltf_document.cpp7
-rw-r--r--modules/mono/editor/bindings_generator.cpp65
-rw-r--r--modules/mono/editor/bindings_generator.h5
-rw-r--r--modules/openxr/openxr_api.cpp28
-rw-r--r--modules/openxr/openxr_api.h4
-rw-r--r--modules/openxr/openxr_interface.cpp4
-rw-r--r--modules/openxr/openxr_interface.h2
-rw-r--r--modules/openxr/register_types.cpp15
-rw-r--r--modules/text_server_adv/text_server_adv.cpp2
-rw-r--r--modules/websocket/library_godot_websocket.js2
17 files changed, 147 insertions, 69 deletions
diff --git a/modules/basis_universal/SCsub b/modules/basis_universal/SCsub
index 1f9fde966d..a3bd85089d 100644
--- a/modules/basis_universal/SCsub
+++ b/modules/basis_universal/SCsub
@@ -13,16 +13,15 @@ thirdparty_obj = []
thirdparty_dir = "#thirdparty/basis_universal/"
# Sync list with upstream CMakeLists.txt
encoder_sources = [
- "apg_bmp.c",
- "basisu_astc_decomp.cpp",
+ "basisu_uastc_enc.cpp",
"basisu_backend.cpp",
"basisu_basis_file.cpp",
"basisu_bc7enc.cpp",
+ "basisu_opencl.cpp",
"basisu_comp.cpp",
"basisu_enc.cpp",
"basisu_etc.cpp",
"basisu_frontend.cpp",
- "basisu_global_selector_palette_helpers.cpp",
"basisu_gpu_texture.cpp",
"basisu_kernels_sse.cpp",
"basisu_pvrtc1_4.cpp",
@@ -31,7 +30,7 @@ encoder_sources = [
"basisu_ssim.cpp",
"basisu_uastc_enc.cpp",
"jpgd.cpp",
- "lodepng.cpp",
+ "pvpngreader.cpp",
]
encoder_sources = [thirdparty_dir + "encoder/" + file for file in encoder_sources]
transcoder_sources = [thirdparty_dir + "transcoder/basisu_transcoder.cpp"]
diff --git a/modules/basis_universal/register_types.cpp b/modules/basis_universal/register_types.cpp
index a3c662ba08..8e328a519d 100644
--- a/modules/basis_universal/register_types.cpp
+++ b/modules/basis_universal/register_types.cpp
@@ -49,8 +49,6 @@ enum BasisDecompressFormat {
//workaround for lack of ETC2 RG
#define USE_RG_AS_RGBA
-basist::etc1_global_selector_codebook *sel_codebook = nullptr;
-
#ifdef TOOLS_ENABLED
static Vector<uint8_t> basis_universal_packer(const Ref<Image> &p_image, Image::UsedChannels p_channels) {
Vector<uint8_t> budata;
@@ -77,18 +75,14 @@ static Vector<uint8_t> basis_universal_packer(const Ref<Image> &p_image, Image::
memcpy(buimg.get_ptr(), r, vec.size());
}
- //image->save_png("pepeche.png");
-
basisu::basis_compressor_params params;
+ params.m_uastc = true;
params.m_max_endpoint_clusters = 512;
params.m_max_selector_clusters = 512;
params.m_multithreading = true;
- //params.m_no_hybrid_sel_cb = true; //fixme, default on this causes crashes //seems fixed?
- params.m_pSel_codebook = sel_codebook;
//params.m_quality_level = 0;
//params.m_disable_hierarchical_endpoint_codebooks = true;
//params.m_no_selector_rdo = true;
- params.m_auto_global_sel_pal = false;
basisu::job_pool jpool(OS::get_singleton()->get_processor_count());
params.m_pJob_pool = &jpool;
@@ -225,7 +219,7 @@ static Ref<Image> basis_universal_unpacker(const Vector<uint8_t> &p_buffer) {
ptr += 4;
size -= 4;
- basist::basisu_transcoder tr(nullptr);
+ basist::basisu_transcoder tr;
ERR_FAIL_COND_V(!tr.validate_header(ptr, size), image);
@@ -267,7 +261,9 @@ static Ref<Image> basis_universal_unpacker(const Vector<uint8_t> &p_buffer) {
void register_basis_universal_types() {
#ifdef TOOLS_ENABLED
- sel_codebook = new basist::etc1_global_selector_codebook(basist::g_global_selector_cb_size, basist::g_global_selector_cb);
+ using namespace basisu;
+ using namespace basist;
+ basisu_encoder_init();
Image::basis_universal_packer = basis_universal_packer;
#endif
Image::basis_universal_unpacker = basis_universal_unpacker;
@@ -275,7 +271,6 @@ void register_basis_universal_types() {
void unregister_basis_universal_types() {
#ifdef TOOLS_ENABLED
- delete sel_codebook;
Image::basis_universal_packer = nullptr;
#endif
Image::basis_universal_unpacker = nullptr;
diff --git a/modules/fbx/data/fbx_mesh_data.cpp b/modules/fbx/data/fbx_mesh_data.cpp
index 643a74f83e..1d59851778 100644
--- a/modules/fbx/data/fbx_mesh_data.cpp
+++ b/modules/fbx/data/fbx_mesh_data.cpp
@@ -371,6 +371,17 @@ ImporterMeshInstance3D *FBXMeshData::create_fbx_mesh(const ImportState &state, c
Array mesh_array = surface->surface_tool->commit_to_arrays();
Array blend_shapes = surface->morphs;
+ // Enforce blend shape mask array format
+ for (int i = 0; i < blend_shapes.size(); i++) {
+ Array bsdata = blend_shapes[i];
+
+ for (int j = 0; j < Mesh::ARRAY_MAX; j++) {
+ if (!(Mesh::ARRAY_FORMAT_BLEND_SHAPE_MASK & (1 << j))) {
+ bsdata[j] = Variant();
+ }
+ }
+ }
+
if (surface->material.is_valid()) {
mesh->add_surface(Mesh::PRIMITIVE_TRIANGLES, mesh_array, blend_shapes, Dictionary(), surface->material, surface->material->get_name());
} else {
diff --git a/modules/freetype/SCsub b/modules/freetype/SCsub
index 27d0777c17..e41e2a9acf 100644
--- a/modules/freetype/SCsub
+++ b/modules/freetype/SCsub
@@ -57,6 +57,23 @@ if env["builtin_freetype"]:
]
thirdparty_sources = [thirdparty_dir + file for file in thirdparty_sources]
+ thirdparty_brotli_dir = "#thirdparty/brotli/"
+ thirdparty_brotli_sources = [
+ "common/constants.c",
+ "common/context.c",
+ "common/dictionary.c",
+ "common/platform.c",
+ "common/shared_dictionary.c",
+ "common/transform.c",
+ "dec/bit_reader.c",
+ "dec/decode.c",
+ "dec/huffman.c",
+ "dec/state.c",
+ ]
+ thirdparty_sources += [thirdparty_brotli_dir + file for file in thirdparty_brotli_sources]
+ env_freetype.Append(CPPDEFINES=["FT_CONFIG_OPTION_USE_BROTLI"])
+ env_freetype.Prepend(CPPPATH=[thirdparty_brotli_dir + "include"])
+
if env["platform"] == "uwp":
# Include header for UWP to fix build issues
env_freetype.Append(CCFLAGS=["/FI", '"modules/freetype/uwpdef.h"'])
diff --git a/modules/gdscript/gdscript.cpp b/modules/gdscript/gdscript.cpp
index c12c1a43a3..d415684d10 100644
--- a/modules/gdscript/gdscript.cpp
+++ b/modules/gdscript/gdscript.cpp
@@ -827,10 +827,6 @@ Error GDScript::reload(bool p_keep_state) {
if (basedir.begins_with(EditorSettings::get_singleton()->get_project_script_templates_dir())) {
return OK;
}
-#else
- if (source.contains("_BASE_")) {
- return OK;
- }
#endif
{
diff --git a/modules/gdscript/gdscript_analyzer.cpp b/modules/gdscript/gdscript_analyzer.cpp
index 326720ce86..af3d65d4d6 100644
--- a/modules/gdscript/gdscript_analyzer.cpp
+++ b/modules/gdscript/gdscript_analyzer.cpp
@@ -277,6 +277,7 @@ Error GDScriptAnalyzer::resolve_inheritance(GDScriptParser::ClassNode *p_class,
base = parser->get_parser()->head->get_datatype();
} else {
if (p_class->extends.is_empty()) {
+ push_error("Could not resolve an empty super class path.", p_class);
return ERR_PARSE_ERROR;
}
const StringName &name = p_class->extends[extends_index++];
@@ -1124,6 +1125,10 @@ void GDScriptAnalyzer::resolve_function_signature(GDScriptParser::FunctionNode *
GDScriptParser::FunctionNode *previous_function = parser->current_function;
parser->current_function = p_function;
+#ifdef TOOLS_ENABLED
+ int default_value_count = 0;
+#endif // TOOLS_ENABLED
+
for (int i = 0; i < p_function->parameters.size(); i++) {
resolve_parameter(p_function->parameters[i]);
#ifdef DEBUG_ENABLED
@@ -1133,8 +1138,12 @@ void GDScriptAnalyzer::resolve_function_signature(GDScriptParser::FunctionNode *
is_shadowing(p_function->parameters[i]->identifier, "function parameter");
#endif // DEBUG_ENABLED
#ifdef TOOLS_ENABLED
- if (p_function->parameters[i]->default_value && p_function->parameters[i]->default_value->is_constant) {
- p_function->default_arg_values.push_back(p_function->parameters[i]->default_value->reduced_value);
+ if (p_function->parameters[i]->default_value) {
+ default_value_count++;
+
+ if (p_function->parameters[i]->default_value->is_constant) {
+ p_function->default_arg_values.push_back(p_function->parameters[i]->default_value->reduced_value);
+ }
}
#endif // TOOLS_ENABLED
}
@@ -1169,7 +1178,7 @@ void GDScriptAnalyzer::resolve_function_signature(GDScriptParser::FunctionNode *
int par_count_diff = p_function->parameters.size() - parameters_types.size();
valid = valid && par_count_diff >= 0;
- valid = valid && p_function->default_arg_values.size() >= default_par_count + par_count_diff;
+ valid = valid && default_value_count >= default_par_count + par_count_diff;
int i = 0;
for (const GDScriptParser::DataType &par_type : parameters_types) {
@@ -1203,7 +1212,7 @@ void GDScriptAnalyzer::resolve_function_signature(GDScriptParser::FunctionNode *
push_error(vformat(R"(The function signature doesn't match the parent. Parent signature is "%s".)", parent_signature), p_function);
}
}
-#endif
+#endif // TOOLS_ENABLED
}
parser->current_function = previous_function;
diff --git a/modules/gdscript/gdscript_parser.cpp b/modules/gdscript/gdscript_parser.cpp
index 725b62f6d6..10709d3667 100644
--- a/modules/gdscript/gdscript_parser.cpp
+++ b/modules/gdscript/gdscript_parser.cpp
@@ -1380,6 +1380,7 @@ GDScriptParser::AnnotationNode *GDScriptParser::parse_annotation(uint32_t p_vali
push_completion_call(annotation);
make_completion_context(COMPLETION_ANNOTATION_ARGUMENTS, annotation, 0, true);
if (!check(GDScriptTokenizer::Token::PARENTHESIS_CLOSE) && !is_at_end()) {
+ push_multiline(true);
int argument_index = 0;
do {
make_completion_context(COMPLETION_ANNOTATION_ARGUMENTS, annotation, argument_index, true);
@@ -1391,6 +1392,7 @@ GDScriptParser::AnnotationNode *GDScriptParser::parse_annotation(uint32_t p_vali
}
annotation->arguments.push_back(argument);
} while (match(GDScriptTokenizer::Token::COMMA));
+ pop_multiline();
consume(GDScriptTokenizer::Token::PARENTHESIS_CLOSE, R"*(Expected ")" after annotation arguments.)*");
}
@@ -3480,6 +3482,15 @@ template <PropertyHint t_hint, Variant::Type t_type>
bool GDScriptParser::export_annotations(const AnnotationNode *p_annotation, Node *p_node) {
ERR_FAIL_COND_V_MSG(p_node->type != Node::VARIABLE, false, vformat(R"("%s" annotation can only be applied to variables.)", p_annotation->name));
+ {
+ const int max_flags = 32;
+
+ if (t_hint == PropertyHint::PROPERTY_HINT_FLAGS && p_annotation->resolved_arguments.size() > max_flags) {
+ push_error(vformat(R"(The argument count limit for "@export_flags" is exceeded (%d/%d).)", p_annotation->resolved_arguments.size(), max_flags), p_annotation);
+ return false;
+ }
+ }
+
VariableNode *variable = static_cast<VariableNode *>(p_node);
if (variable->exported) {
push_error(vformat(R"(Annotation "%s" cannot be used with another "@export" annotation.)", p_annotation->name), p_annotation);
diff --git a/modules/gltf/gltf_document.cpp b/modules/gltf/gltf_document.cpp
index c70081a620..a8211569eb 100644
--- a/modules/gltf/gltf_document.cpp
+++ b/modules/gltf/gltf_document.cpp
@@ -2907,6 +2907,13 @@ Error GLTFDocument::_parse_meshes(Ref<GLTFState> state) {
}
array_copy = blend_surface_tool->commit_to_arrays();
+ // Enforce blend shape mask array format
+ for (int l = 0; l < Mesh::ARRAY_MAX; l++) {
+ if (!(Mesh::ARRAY_FORMAT_BLEND_SHAPE_MASK & (1 << l))) {
+ array_copy[l] = Variant();
+ }
+ }
+
morphs.push_back(array_copy);
}
}
diff --git a/modules/mono/editor/bindings_generator.cpp b/modules/mono/editor/bindings_generator.cpp
index 272283432d..d8f5b814e4 100644
--- a/modules/mono/editor/bindings_generator.cpp
+++ b/modules/mono/editor/bindings_generator.cpp
@@ -100,6 +100,9 @@
#define BINDINGS_GENERATOR_VERSION UINT32_C(13)
+// Types that will be ignored by the generator and won't be available in C#.
+const Vector<String> ignored_types = { "PhysicsServer3DExtension" };
+
const char *BindingsGenerator::TypeInterface::DEFAULT_VARARG_C_IN("\t%0 %1_in = %1;\n");
static String fix_doc_description(const String &p_bbcode) {
@@ -799,10 +802,13 @@ void BindingsGenerator::_generate_method_icalls(const TypeInterface &p_itype) {
const TypeInterface *return_type = _get_type_or_placeholder(imethod.return_type);
- String im_sig = "IntPtr " CS_PARAM_METHODBIND ", ";
- String im_unique_sig = imethod.return_type.cname.operator String() + ",IntPtr,IntPtr";
+ String im_sig = "IntPtr " CS_PARAM_METHODBIND;
+ String im_unique_sig = imethod.return_type.cname.operator String() + ",IntPtr";
- im_sig += "IntPtr " CS_PARAM_INSTANCE;
+ if (!imethod.is_static) {
+ im_sig += ", IntPtr " CS_PARAM_INSTANCE;
+ im_unique_sig += ",IntPtr";
+ }
// Get arguments information
int i = 0;
@@ -1730,8 +1736,10 @@ Error BindingsGenerator::_generate_cs_method(const BindingsGenerator::TypeInterf
String arguments_sig;
String cs_in_statements;
- String icall_params = method_bind_field + ", ";
- icall_params += sformat(p_itype.cs_in, "this");
+ String icall_params = method_bind_field;
+ if (!p_imethod.is_static) {
+ icall_params += ", " + sformat(p_itype.cs_in, "this");
+ }
StringBuilder default_args_doc;
@@ -1889,7 +1897,7 @@ Error BindingsGenerator::_generate_cs_method(const BindingsGenerator::TypeInterf
p_output.append(MEMBER_BEGIN);
p_output.append(p_imethod.is_internal ? "internal " : "public ");
- if (p_itype.is_singleton) {
+ if (p_itype.is_singleton || p_imethod.is_static) {
p_output.append("static ");
} else if (p_imethod.is_virtual) {
p_output.append("virtual ");
@@ -2268,7 +2276,10 @@ Error BindingsGenerator::_generate_glue_method(const BindingsGenerator::TypeInte
String argc_str = itos(p_imethod.arguments.size());
- String c_func_sig = "MethodBind* " CS_PARAM_METHODBIND ", " + p_itype.c_type_in + " " CS_PARAM_INSTANCE;
+ String c_func_sig = "MethodBind* " CS_PARAM_METHODBIND;
+ if (!p_imethod.is_static) {
+ c_func_sig += ", " + p_itype.c_type_in + " " CS_PARAM_INSTANCE;
+ }
String c_in_statements;
String c_args_var_content;
@@ -2360,17 +2371,21 @@ Error BindingsGenerator::_generate_glue_method(const BindingsGenerator::TypeInte
String fail_ret = return_type->c_type_out.ends_with("*") && !return_type->ret_as_byref_arg ? "nullptr" : return_type->c_type_out + "()";
- if (return_type->ret_as_byref_arg) {
- p_output.append("\tif (" CS_PARAM_INSTANCE " == nullptr) { *arg_ret = ");
- p_output.append(fail_ret);
- p_output.append("; ERR_FAIL_MSG(\"Parameter ' " CS_PARAM_INSTANCE " ' is null.\"); }\n");
- } else {
- p_output.append("\tERR_FAIL_NULL_V(" CS_PARAM_INSTANCE ", ");
- p_output.append(fail_ret);
- p_output.append(");\n");
+ if (!p_imethod.is_static) {
+ if (return_type->ret_as_byref_arg) {
+ p_output.append("\tif (" CS_PARAM_INSTANCE " == nullptr) { *arg_ret = ");
+ p_output.append(fail_ret);
+ p_output.append("; ERR_FAIL_MSG(\"Parameter ' " CS_PARAM_INSTANCE " ' is null.\"); }\n");
+ } else {
+ p_output.append("\tERR_FAIL_NULL_V(" CS_PARAM_INSTANCE ", ");
+ p_output.append(fail_ret);
+ p_output.append(");\n");
+ }
}
} else {
- p_output.append("\tERR_FAIL_NULL(" CS_PARAM_INSTANCE ");\n");
+ if (!p_imethod.is_static) {
+ p_output.append("\tERR_FAIL_NULL(" CS_PARAM_INSTANCE ");\n");
+ }
}
if (p_imethod.arguments.size()) {
@@ -2414,7 +2429,9 @@ Error BindingsGenerator::_generate_glue_method(const BindingsGenerator::TypeInte
}
}
- p_output.append(CS_PARAM_METHODBIND "->call(" CS_PARAM_INSTANCE ", ");
+ p_output.append(CS_PARAM_METHODBIND "->call(");
+ p_output.append(p_imethod.is_static ? "nullptr" : CS_PARAM_INSTANCE);
+ p_output.append(", ");
p_output.append(p_imethod.arguments.size() ? C_LOCAL_PTRCALL_ARGS ".ptr()" : "nullptr");
p_output.append(", total_length, vcall_error);\n");
@@ -2425,7 +2442,9 @@ Error BindingsGenerator::_generate_glue_method(const BindingsGenerator::TypeInte
}
}
} else {
- p_output.append("\t" CS_PARAM_METHODBIND "->ptrcall(" CS_PARAM_INSTANCE ", ");
+ p_output.append("\t" CS_PARAM_METHODBIND "->ptrcall(");
+ p_output.append(p_imethod.is_static ? "nullptr" : CS_PARAM_INSTANCE);
+ p_output.append(", ");
p_output.append(p_imethod.arguments.size() ? C_LOCAL_PTRCALL_ARGS ", " : "nullptr, ");
p_output.append(!ret_void ? "&" C_LOCAL_RET ");\n" : "nullptr);\n");
}
@@ -2645,6 +2664,12 @@ bool BindingsGenerator::_populate_object_type_interfaces() {
continue;
}
+ if (ignored_types.has(type_cname)) {
+ _log("Ignoring type '%s' because it's in the list of ignored types\n", String(type_cname).utf8().get_data());
+ class_list.pop_front();
+ continue;
+ }
+
if (!ClassDB::is_class_exposed(type_cname)) {
_log("Ignoring type '%s' because it's not exposed\n", String(type_cname).utf8().get_data());
class_list.pop_front();
@@ -2763,6 +2788,10 @@ bool BindingsGenerator::_populate_object_type_interfaces() {
imethod.name = method_info.name;
imethod.cname = cname;
+ if (method_info.flags & METHOD_FLAG_STATIC) {
+ imethod.is_static = true;
+ }
+
if (method_info.flags & METHOD_FLAG_VIRTUAL) {
imethod.is_virtual = true;
}
diff --git a/modules/mono/editor/bindings_generator.h b/modules/mono/editor/bindings_generator.h
index f601ffde2b..dec4fae8cd 100644
--- a/modules/mono/editor/bindings_generator.h
+++ b/modules/mono/editor/bindings_generator.h
@@ -137,6 +137,11 @@ class BindingsGenerator {
bool is_vararg = false;
/**
+ * Determines if the method is static.
+ */
+ bool is_static = false;
+
+ /**
* Virtual methods ("virtual" as defined by the Godot API) are methods that by default do nothing,
* but can be overridden by the user to add custom functionality.
* e.g.: _ready, _process, etc.
diff --git a/modules/openxr/openxr_api.cpp b/modules/openxr/openxr_api.cpp
index 4d533337f3..bf668bac27 100644
--- a/modules/openxr/openxr_api.cpp
+++ b/modules/openxr/openxr_api.cpp
@@ -99,17 +99,7 @@ bool OpenXRAPI::openxr_is_enabled() {
}
OpenXRAPI *OpenXRAPI::get_singleton() {
- if (singleton != nullptr) {
- // already constructed, return our singleton
- return singleton;
- } else if (openxr_is_enabled()) {
- // construct our singleton and return it
- singleton = memnew(OpenXRAPI);
- return singleton;
- } else {
- // not enabled, don't instantiate, return nullptr
- return nullptr;
- }
+ return singleton;
}
String OpenXRAPI::get_default_action_map_resource_name() {
@@ -145,7 +135,7 @@ String OpenXRAPI::get_swapchain_format_name(int64_t p_swapchain_format) const {
}
bool OpenXRAPI::load_layer_properties() {
- // This queries additional layers that are available and can be initialised when we create our OpenXR instance
+ // This queries additional layers that are available and can be initialized when we create our OpenXR instance
if (layer_properties != nullptr) {
// already retrieved this
return true;
@@ -175,7 +165,7 @@ bool OpenXRAPI::load_layer_properties() {
}
bool OpenXRAPI::load_supported_extensions() {
- // This queries supported extensions that are available and can be initialised when we create our OpenXR instance
+ // This queries supported extensions that are available and can be initialized when we create our OpenXR instance
if (supported_extensions != nullptr) {
// already retrieved this
@@ -1010,7 +1000,7 @@ bool OpenXRAPI::is_running() {
return running;
}
-bool OpenXRAPI::initialise(const String &p_rendering_driver) {
+bool OpenXRAPI::initialize(const String &p_rendering_driver) {
ERR_FAIL_COND_V_MSG(instance != XR_NULL_HANDLE, false, "OpenXR instance was already created");
if (p_rendering_driver == "vulkan") {
@@ -1034,7 +1024,7 @@ bool OpenXRAPI::initialise(const String &p_rendering_driver) {
ERR_FAIL_V_MSG(false, "OpenXR: Unsupported rendering device.");
}
- // initialise
+ // initialize
if (!load_layer_properties()) {
destroy_instance();
return false;
@@ -1068,7 +1058,7 @@ bool OpenXRAPI::initialise(const String &p_rendering_driver) {
return true;
}
-bool OpenXRAPI::initialise_session() {
+bool OpenXRAPI::initialize_session() {
if (!create_session()) {
destroy_session();
return false;
@@ -1599,7 +1589,7 @@ void OpenXRAPI::end_frame() {
OpenXRAPI::OpenXRAPI() {
// OpenXRAPI is only constructed if OpenXR is enabled.
- // It will be constructed when the rendering device first accesses OpenXR (be it the Vulkan or OpenGL rendering system)
+ singleton = this;
if (Engine::get_singleton()->is_editor_hint()) {
// Enabled OpenXR in the editor? Adjust our settings for the editor
@@ -1656,7 +1646,7 @@ OpenXRAPI::OpenXRAPI() {
frame_state.predictedDisplayPeriod = 0;
#ifdef ANDROID_ENABLED
- // our android wrapper will initialise our android loader at this point
+ // our android wrapper will initialize our android loader at this point
register_extension_wrapper(memnew(OpenXRAndroidExtension(this)));
#endif
}
@@ -1683,6 +1673,8 @@ OpenXRAPI::~OpenXRAPI() {
memfree(layer_properties);
layer_properties = nullptr;
}
+
+ singleton = nullptr;
}
Transform3D OpenXRAPI::transform_from_pose(const XrPosef &p_pose) {
diff --git a/modules/openxr/openxr_api.h b/modules/openxr/openxr_api.h
index e20826c849..5d1cea1217 100644
--- a/modules/openxr/openxr_api.h
+++ b/modules/openxr/openxr_api.h
@@ -234,8 +234,8 @@ public:
bool is_initialized();
bool is_running();
- bool initialise(const String &p_rendering_driver);
- bool initialise_session();
+ bool initialize(const String &p_rendering_driver);
+ bool initialize_session();
void finish();
XrTime get_next_frame_time() { return frame_state.predictedDisplayTime + frame_state.predictedDisplayPeriod; };
diff --git a/modules/openxr/openxr_interface.cpp b/modules/openxr/openxr_interface.cpp
index 39f9153f0d..7152cdb605 100644
--- a/modules/openxr/openxr_interface.cpp
+++ b/modules/openxr/openxr_interface.cpp
@@ -466,7 +466,7 @@ void OpenXRInterface::free_interaction_profiles() {
interaction_profiles.clear();
}
-bool OpenXRInterface::initialise_on_startup() const {
+bool OpenXRInterface::initialize_on_startup() const {
if (openxr_api == nullptr) {
return false;
} else if (!openxr_api->is_initialized()) {
@@ -495,7 +495,7 @@ bool OpenXRInterface::initialize() {
// load up our action sets before setting up our session, note that our profiles are suggestions, OpenXR takes ownership of (re)binding
_load_action_map();
- if (!openxr_api->initialise_session()) {
+ if (!openxr_api->initialize_session()) {
return false;
}
diff --git a/modules/openxr/openxr_interface.h b/modules/openxr/openxr_interface.h
index 421838e445..a223acfed0 100644
--- a/modules/openxr/openxr_interface.h
+++ b/modules/openxr/openxr_interface.h
@@ -106,7 +106,7 @@ public:
virtual PackedStringArray get_suggested_tracker_names() const override;
virtual TrackingStatus get_tracking_status() const override;
- bool initialise_on_startup() const;
+ bool initialize_on_startup() const;
virtual bool is_initialized() const override;
virtual bool initialize() override;
virtual void uninitialize() override;
diff --git a/modules/openxr/register_types.cpp b/modules/openxr/register_types.cpp
index 7a74c8c089..bb550980cf 100644
--- a/modules/openxr/register_types.cpp
+++ b/modules/openxr/register_types.cpp
@@ -45,9 +45,13 @@ void preregister_openxr_types() {
// For now we create our openxr device here. If we merge it with openxr_interface we'll create that here soon.
OpenXRAPI::setup_global_defs();
- openxr_api = OpenXRAPI::get_singleton();
- if (openxr_api) {
- if (!openxr_api->initialise(Main::get_rendering_driver_name())) {
+ if (OpenXRAPI::openxr_is_enabled()) {
+ openxr_api = memnew(OpenXRAPI);
+ ERR_FAIL_NULL(openxr_api);
+
+ if (!openxr_api->initialize(Main::get_rendering_driver_name())) {
+ memdelete(openxr_api);
+ openxr_api = nullptr;
return;
}
}
@@ -67,7 +71,7 @@ void register_openxr_types() {
openxr_interface.instantiate();
xr_server->add_interface(openxr_interface);
- if (openxr_interface->initialise_on_startup()) {
+ if (openxr_interface->initialize_on_startup()) {
openxr_interface->initialize();
}
}
@@ -75,7 +79,7 @@ void register_openxr_types() {
void unregister_openxr_types() {
if (openxr_interface.is_valid()) {
- // uninitialise just in case
+ // uninitialize just in case
if (openxr_interface->is_initialized()) {
openxr_interface->uninitialize();
}
@@ -96,5 +100,6 @@ void unregister_openxr_types() {
if (openxr_api) {
openxr_api->finish();
memdelete(openxr_api);
+ openxr_api = nullptr;
}
}
diff --git a/modules/text_server_adv/text_server_adv.cpp b/modules/text_server_adv/text_server_adv.cpp
index b5912893b1..e02ddbb3f4 100644
--- a/modules/text_server_adv/text_server_adv.cpp
+++ b/modules/text_server_adv/text_server_adv.cpp
@@ -1355,6 +1355,8 @@ _FORCE_INLINE_ bool TextServerAdvanced::_ensure_cache_for_size(FontDataAdvanced
fd->underline_position = (-FT_MulFix(fd->face->underline_position, fd->face->size->metrics.y_scale) / 64.0) / fd->oversampling * fd->scale;
fd->underline_thickness = (FT_MulFix(fd->face->underline_thickness, fd->face->size->metrics.y_scale) / 64.0) / fd->oversampling * fd->scale;
+ hb_font_set_synthetic_slant(fd->hb_handle, p_font_data->transform.elements[0][1]);
+
if (!p_font_data->face_init) {
// Get style flags and name.
if (fd->face->family_name != nullptr) {
diff --git a/modules/websocket/library_godot_websocket.js b/modules/websocket/library_godot_websocket.js
index c88986fbe3..57f1f10b02 100644
--- a/modules/websocket/library_godot_websocket.js
+++ b/modules/websocket/library_godot_websocket.js
@@ -135,7 +135,7 @@ const GodotWebSocket = {
if (!ref) {
return;
}
- GodotWebSocket.close(p_id, 1001, '');
+ GodotWebSocket.close(p_id, 3001, 'destroyed');
IDHandler.remove(p_id);
ref.onopen = null;
ref.onmessage = null;