summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--doc/classes/AudioStreamPlayer3D.xml2
-rw-r--r--doc/classes/EditorDebuggerPlugin.xml7
-rw-r--r--doc/classes/EditorExportPlugin.xml3
-rw-r--r--doc/classes/EditorImportPlugin.xml3
-rw-r--r--doc/classes/EditorInspectorPlugin.xml4
-rw-r--r--doc/classes/EditorNode3DGizmoPlugin.xml3
-rw-r--r--doc/classes/EditorSceneFormatImporter.xml2
-rw-r--r--doc/classes/EditorTranslationParserPlugin.xml3
-rw-r--r--doc/translations/extract.py1
-rw-r--r--editor/plugin_config_dialog.cpp8
-rw-r--r--editor/plugin_config_dialog.h1
-rw-r--r--methods.py176
-rw-r--r--modules/gdscript/gdscript_analyzer.cpp2
-rw-r--r--modules/mono/build_scripts/mono_reg_utils.py1
-rw-r--r--modules/mono/mono_gd/gd_mono_marshal.cpp11
-rw-r--r--modules/text_server_adv/SCsub2
-rw-r--r--platform/iphone/export/export_plugin.cpp2
-rw-r--r--scene/3d/audio_stream_player_3d.cpp4
-rw-r--r--scene/resources/default_theme/SCsub2
-rw-r--r--scene/resources/surface_tool.cpp2
20 files changed, 170 insertions, 69 deletions
diff --git a/doc/classes/AudioStreamPlayer3D.xml b/doc/classes/AudioStreamPlayer3D.xml
index bd344fad29..e8a78d5a4c 100644
--- a/doc/classes/AudioStreamPlayer3D.xml
+++ b/doc/classes/AudioStreamPlayer3D.xml
@@ -123,7 +123,7 @@
Logarithmic dampening of loudness according to distance.
</constant>
<constant name="ATTENUATION_DISABLED" value="3" enum="AttenuationModel">
- No dampening of loudness according to distance. The sound will still be heard positionally, unlike an [AudioStreamPlayer].
+ No dampening of loudness according to distance. The sound will still be heard positionally, unlike an [AudioStreamPlayer]. [constant ATTENUATION_DISABLED] can be combined with a [member max_distance] value greater than [code]0.0[/code] to achieve linear attenuation clamped to a sphere of a defined size.
</constant>
<constant name="DOPPLER_TRACKING_DISABLED" value="0" enum="DopplerTracking">
Disables doppler tracking.
diff --git a/doc/classes/EditorDebuggerPlugin.xml b/doc/classes/EditorDebuggerPlugin.xml
index 0773e176b3..6687d3c3ac 100644
--- a/doc/classes/EditorDebuggerPlugin.xml
+++ b/doc/classes/EditorDebuggerPlugin.xml
@@ -4,9 +4,10 @@
A base class to implement debugger plugins.
</brief_description>
<description>
- All debugger plugin scripts must extend [EditorDebuggerPlugin]. It provides functions related to editor side of debugger.
- You don't need to instantiate this class. That is handled by the debugger itself. [Control] nodes can be added as child nodes to provide a GUI front-end for the plugin.
- Do not queue_free/reparent it's instance otherwise the instance becomes unusable.
+ [EditorDebuggerPlugin] provides functions related to the editor side of the debugger.
+ You don't need to instantiate this class; that is automatically handled by the debugger. [Control] nodes can be added as child nodes to provide a GUI for the plugin.
+ Do not free or reparent this node, otherwise it becomes unusable.
+ To use [EditorDebuggerPlugin], register it using the [method EditorPlugin.add_debugger_plugin] method first.
</description>
<tutorials>
</tutorials>
diff --git a/doc/classes/EditorExportPlugin.xml b/doc/classes/EditorExportPlugin.xml
index fca7bb350d..3830bfc60e 100644
--- a/doc/classes/EditorExportPlugin.xml
+++ b/doc/classes/EditorExportPlugin.xml
@@ -4,7 +4,8 @@
A script that is executed when exporting the project.
</brief_description>
<description>
- Editor export plugins are automatically activated whenever the user exports the project. Their most common use is to determine what files are being included in the exported project. For each plugin, [method _export_begin] is called at the beginning of the export process and then [method _export_file] is called for each exported file.
+ [EditorExportPlugin]s are automatically invoked whenever the user exports the project. Their most common use is to determine what files are being included in the exported project. For each plugin, [method _export_begin] is called at the beginning of the export process and then [method _export_file] is called for each exported file.
+ To use [EditorExportPlugin], register it using the [method EditorPlugin.add_export_plugin] method first.
</description>
<tutorials>
</tutorials>
diff --git a/doc/classes/EditorImportPlugin.xml b/doc/classes/EditorImportPlugin.xml
index c5a44009d2..6011a5411d 100644
--- a/doc/classes/EditorImportPlugin.xml
+++ b/doc/classes/EditorImportPlugin.xml
@@ -4,7 +4,7 @@
Registers a custom resource importer in the editor. Use the class to parse any file and import it as a new resource type.
</brief_description>
<description>
- EditorImportPlugins provide a way to extend the editor's resource import functionality. Use them to import resources from custom files or to provide alternatives to the editor's existing importers. Register your [EditorPlugin] with [method EditorPlugin.add_import_plugin].
+ [EditorImportPlugin]s provide a way to extend the editor's resource import functionality. Use them to import resources from custom files or to provide alternatives to the editor's existing importers.
EditorImportPlugins work by associating with specific file extensions and a resource type. See [method _get_recognized_extensions] and [method _get_resource_type]. They may optionally specify some import presets that affect the import process. EditorImportPlugins are responsible for creating the resources and saving them in the [code].godot/imported[/code] directory (see [member ProjectSettings.application/config/project_data_dir_name]).
Below is an example EditorImportPlugin that imports a [Mesh] from a file with the extension ".special" or ".spec":
[codeblocks]
@@ -108,6 +108,7 @@
}
[/csharp]
[/codeblocks]
+ To use [EditorImportPlugin], register it using the [method EditorPlugin.add_import_plugin] method first.
</description>
<tutorials>
<link title="Import plugins">https://docs.godotengine.org/en/latest/tutorials/plugins/editor/import_plugins.html</link>
diff --git a/doc/classes/EditorInspectorPlugin.xml b/doc/classes/EditorInspectorPlugin.xml
index 17397b80bf..f65e974d47 100644
--- a/doc/classes/EditorInspectorPlugin.xml
+++ b/doc/classes/EditorInspectorPlugin.xml
@@ -4,13 +4,13 @@
Plugin for adding custom property editors on inspector.
</brief_description>
<description>
- These plugins allow adding custom property editors to [EditorInspector].
- Plugins are registered via [method EditorPlugin.add_inspector_plugin].
+ [EditorInspectorPlugin] allows adding custom property editors to [EditorInspector].
When an object is edited, the [method _can_handle] function is called and must return [code]true[/code] if the object type is supported.
If supported, the function [method _parse_begin] will be called, allowing to place custom controls at the beginning of the class.
Subsequently, the [method _parse_category] and [method _parse_property] are called for every category and property. They offer the ability to add custom controls to the inspector too.
Finally, [method _parse_end] will be called.
On each of these calls, the "add" functions can be called.
+ To use [EditorInspectorPlugin], register it using the [method EditorPlugin.add_inspector_plugin] method first.
</description>
<tutorials>
<link title="Inspector plugins">https://docs.godotengine.org/en/latest/tutorials/plugins/editor/inspector_plugins.html</link>
diff --git a/doc/classes/EditorNode3DGizmoPlugin.xml b/doc/classes/EditorNode3DGizmoPlugin.xml
index 424d5dd310..08423c4577 100644
--- a/doc/classes/EditorNode3DGizmoPlugin.xml
+++ b/doc/classes/EditorNode3DGizmoPlugin.xml
@@ -4,7 +4,8 @@
Used by the editor to define Node3D gizmo types.
</brief_description>
<description>
- EditorNode3DGizmoPlugin allows you to define a new type of Gizmo. There are two main ways to do so: extending [EditorNode3DGizmoPlugin] for the simpler gizmos, or creating a new [EditorNode3DGizmo] type. See the tutorial in the documentation for more info.
+ [EditorNode3DGizmoPlugin] allows you to define a new type of Gizmo. There are two main ways to do so: extending [EditorNode3DGizmoPlugin] for the simpler gizmos, or creating a new [EditorNode3DGizmo] type. See the tutorial in the documentation for more info.
+ To use [EditorNode3DGizmoPlugin], register it using the [method EditorPlugin.add_spatial_gizmo_plugin] method first.
</description>
<tutorials>
<link title="Spatial gizmo plugins">https://docs.godotengine.org/en/latest/tutorials/plugins/editor/spatial_gizmos.html</link>
diff --git a/doc/classes/EditorSceneFormatImporter.xml b/doc/classes/EditorSceneFormatImporter.xml
index d890188092..6dbd80604e 100644
--- a/doc/classes/EditorSceneFormatImporter.xml
+++ b/doc/classes/EditorSceneFormatImporter.xml
@@ -4,6 +4,8 @@
Imports scenes from third-parties' 3D files.
</brief_description>
<description>
+ [EditorSceneFormatImporter] allows to define an importer script for a third-party 3D format.
+ To use [EditorSceneFormatImporter], register it using the [method EditorPlugin.add_scene_format_importer_plugin] method first.
</description>
<tutorials>
</tutorials>
diff --git a/doc/classes/EditorTranslationParserPlugin.xml b/doc/classes/EditorTranslationParserPlugin.xml
index de8204def3..900d877f12 100644
--- a/doc/classes/EditorTranslationParserPlugin.xml
+++ b/doc/classes/EditorTranslationParserPlugin.xml
@@ -4,7 +4,7 @@
Plugin for adding custom parsers to extract strings that are to be translated from custom files (.csv, .json etc.).
</brief_description>
<description>
- Plugins are registered via [method EditorPlugin.add_translation_parser_plugin] method. To define the parsing and string extraction logic, override the [method _parse_file] method in script.
+ [EditorTranslationParserPlugin] is invoked when a file is being parsed to extract strings that require translation. To define the parsing and string extraction logic, override the [method _parse_file] method in script.
Add the extracted strings to argument [code]msgids[/code] or [code]msgids_context_plural[/code] if context or plural is used.
When adding to [code]msgids_context_plural[/code], you must add the data using the format [code]["A", "B", "C"][/code], where [code]A[/code] represents the extracted string, [code]B[/code] represents the context, and [code]C[/code] represents the plural version of the extracted string. If you want to add only context but not plural, put [code]""[/code] for the plural slot. The idea is the same if you only want to add plural but not context. See the code below for concrete examples.
The extracted strings will be written into a POT file selected by user under "POT Generation" in "Localization" tab in "Project Settings" menu.
@@ -98,6 +98,7 @@
}
[/csharp]
[/codeblocks]
+ To use [EditorTranslationParserPlugin], register it using the [method EditorPlugin.add_translation_parser_plugin] method first.
</description>
<tutorials>
</tutorials>
diff --git a/doc/translations/extract.py b/doc/translations/extract.py
index a2bc5e37ec..a13680a613 100644
--- a/doc/translations/extract.py
+++ b/doc/translations/extract.py
@@ -2,7 +2,6 @@
import argparse
import os
-import re
import shutil
from collections import OrderedDict
diff --git a/editor/plugin_config_dialog.cpp b/editor/plugin_config_dialog.cpp
index a3ff312497..91ca1465df 100644
--- a/editor/plugin_config_dialog.cpp
+++ b/editor/plugin_config_dialog.cpp
@@ -124,6 +124,10 @@ void PluginConfigDialog::_on_cancelled() {
_clear_fields();
}
+void PluginConfigDialog::_on_language_changed(const int) {
+ _on_required_text_changed(String());
+}
+
void PluginConfigDialog::_on_required_text_changed(const String &) {
int lang_idx = script_option_edit->get_selected();
String ext = ScriptServer::get_language(lang_idx)->get_extension();
@@ -161,6 +165,9 @@ void PluginConfigDialog::_on_required_text_changed(const String &) {
is_valid = false;
subfolder_validation->set_texture(invalid_icon);
subfolder_validation->set_tooltip(TTR("Subfolder cannot be blank."));
+ } else if (!subfolder_edit->get_text().is_valid_filename()) {
+ subfolder_validation->set_texture(invalid_icon);
+ subfolder_validation->set_tooltip(TTR("Subfolder name is not a valid folder name."));
} else {
DirAccessRef dir = DirAccess::create(DirAccess::ACCESS_RESOURCES);
String path = "res://addons/" + subfolder_edit->get_text();
@@ -330,6 +337,7 @@ PluginConfigDialog::PluginConfigDialog() {
}
script_option_edit->select(default_lang);
grid->add_child(script_option_edit);
+ script_option_edit->connect("item_selected", callable_mp(this, &PluginConfigDialog::_on_language_changed));
// Plugin Script Name
Label *script_lb = memnew(Label);
diff --git a/editor/plugin_config_dialog.h b/editor/plugin_config_dialog.h
index ad5b96735f..45fcdb6b6e 100644
--- a/editor/plugin_config_dialog.h
+++ b/editor/plugin_config_dialog.h
@@ -59,6 +59,7 @@ class PluginConfigDialog : public ConfirmationDialog {
void _clear_fields();
void _on_confirmed();
void _on_cancelled();
+ void _on_language_changed(const int p_language);
void _on_required_text_changed(const String &p_text);
static String _to_absolute_plugin_path(const String &p_plugin_name);
diff --git a/methods.py b/methods.py
index 428405fb04..77a1085baf 100644
--- a/methods.py
+++ b/methods.py
@@ -1,8 +1,10 @@
+import collections
import os
import re
import glob
import subprocess
from collections import OrderedDict
+from typing import Iterator
# We need to define our own `Action` method to control the verbosity of output
# and whenever we need to run those commands in a subprocess on some platforms.
@@ -604,7 +606,11 @@ def detect_visual_c_compiler_version(tools_env):
def find_visual_c_batch_file(env):
- from SCons.Tool.MSCommon.vc import get_default_version, get_host_target, find_batch_file
+ from SCons.Tool.MSCommon.vc import (
+ get_default_version,
+ get_host_target,
+ find_batch_file,
+ )
version = get_default_version(env)
(host_platform, target_platform, _) = get_host_target(env)
@@ -656,36 +662,107 @@ def generate_vs_project(env, num_jobs):
batch_file = find_visual_c_batch_file(env)
if batch_file:
- def build_commandline(commands):
- common_build_prefix = [
- 'cmd /V /C set "plat=$(PlatformTarget)"',
- '(if "$(PlatformTarget)"=="x64" (set "plat=x86_amd64"))',
- 'set "tools=%s"' % env["tools"],
- '(if "$(Configuration)"=="release" (set "tools=no"))',
- 'call "' + batch_file + '" !plat!',
- ]
-
- # Windows allows us to have spaces in paths, so we need
- # to double quote off the directory. However, the path ends
- # in a backslash, so we need to remove this, lest it escape the
- # last double quote off, confusing MSBuild
- common_build_postfix = [
- "--directory=\"$(ProjectDir.TrimEnd('\\'))\"",
- "platform=windows",
- "target=$(Configuration)",
- "progress=no",
- "tools=!tools!",
- "-j%s" % num_jobs,
- ]
-
- if env["tests"]:
- common_build_postfix.append("tests=yes")
-
- if env["custom_modules"]:
- common_build_postfix.append("custom_modules=%s" % env["custom_modules"])
-
- result = " ^& ".join(common_build_prefix + [" ".join([commands] + common_build_postfix)])
- return result
+ class ModuleConfigs(collections.Mapping):
+ # This version information (Win32, x64, Debug, Release, Release_Debug seems to be
+ # required for Visual Studio to understand that it needs to generate an NMAKE
+ # project. Do not modify without knowing what you are doing.
+ PLATFORMS = ["Win32", "x64"]
+ PLATFORM_IDS = ["32", "64"]
+ CONFIGURATIONS = ["debug", "release", "release_debug"]
+ CONFIGURATION_IDS = ["tools", "opt", "opt.tools"]
+
+ @staticmethod
+ def for_every_variant(value):
+ return [value for _ in range(len(ModuleConfigs.CONFIGURATIONS) * len(ModuleConfigs.PLATFORMS))]
+
+ def __init__(self):
+
+ shared_targets_array = []
+ self.names = []
+ self.arg_dict = {
+ "variant": [],
+ "runfile": shared_targets_array,
+ "buildtarget": shared_targets_array,
+ "cpppaths": [],
+ "cppdefines": [],
+ "cmdargs": [],
+ }
+ self.add_mode() # default
+
+ def add_mode(
+ self,
+ name: str = "",
+ includes: str = "",
+ cli_args: str = "",
+ defines=None,
+ ):
+ if defines is None:
+ defines = []
+ self.names.append(name)
+ self.arg_dict["variant"] += [
+ f'{config}{f"_[{name}]" if name else ""}|{platform}'
+ for config in ModuleConfigs.CONFIGURATIONS
+ for platform in ModuleConfigs.PLATFORMS
+ ]
+ self.arg_dict["runfile"] += [
+ f'bin\\godot.windows.{config_id}.{plat_id}{f".{name}" if name else ""}.exe'
+ for config_id in ModuleConfigs.CONFIGURATION_IDS
+ for plat_id in ModuleConfigs.PLATFORM_IDS
+ ]
+ self.arg_dict["cpppaths"] += ModuleConfigs.for_every_variant(env["CPPPATH"] + [includes])
+ self.arg_dict["cppdefines"] += ModuleConfigs.for_every_variant(env["CPPDEFINES"] + defines)
+ self.arg_dict["cmdargs"] += ModuleConfigs.for_every_variant(cli_args)
+
+ def build_commandline(self, commands):
+
+ configuration_getter = (
+ "$(Configuration"
+ + "".join([f'.Replace("{name}", "")' for name in self.names[1:]])
+ + '.Replace("_[]", "")'
+ + ")"
+ )
+
+ common_build_prefix = [
+ 'cmd /V /C set "plat=$(PlatformTarget)"',
+ '(if "$(PlatformTarget)"=="x64" (set "plat=x86_amd64"))',
+ 'set "tools=%s"' % env["tools"],
+ f'(if "{configuration_getter}"=="release" (set "tools=no"))',
+ 'call "' + batch_file + '" !plat!',
+ ]
+
+ # Windows allows us to have spaces in paths, so we need
+ # to double quote off the directory. However, the path ends
+ # in a backslash, so we need to remove this, lest it escape the
+ # last double quote off, confusing MSBuild
+ common_build_postfix = [
+ "--directory=\"$(ProjectDir.TrimEnd('\\'))\"",
+ "platform=windows",
+ f"target={configuration_getter}",
+ "progress=no",
+ "tools=!tools!",
+ "-j%s" % num_jobs,
+ ]
+
+ if env["tests"]:
+ common_build_postfix.append("tests=yes")
+
+ if env["custom_modules"]:
+ common_build_postfix.append("custom_modules=%s" % env["custom_modules"])
+
+ result = " ^& ".join(common_build_prefix + [" ".join([commands] + common_build_postfix)])
+ return result
+
+ # Mappings interface definitions
+
+ def __iter__(self) -> Iterator[str]:
+ for x in self.arg_dict:
+ yield x
+
+ def __len__(self) -> int:
+ return len(self.names)
+
+ def __getitem__(self, k: str):
+ return self.arg_dict[k]
add_to_vs_project(env, env.core_sources)
add_to_vs_project(env, env.drivers_sources)
@@ -700,21 +777,24 @@ def generate_vs_project(env, num_jobs):
for header in glob_recursive("**/*.h"):
env.vs_incs.append(str(header))
- env["MSVSBUILDCOM"] = build_commandline("scons")
- env["MSVSREBUILDCOM"] = build_commandline("scons vsproj=yes")
- env["MSVSCLEANCOM"] = build_commandline("scons --clean")
-
- # This version information (Win32, x64, Debug, Release, Release_Debug seems to be
- # required for Visual Studio to understand that it needs to generate an NMAKE
- # project. Do not modify without knowing what you are doing.
- debug_variants = ["debug|Win32"] + ["debug|x64"]
- release_variants = ["release|Win32"] + ["release|x64"]
- release_debug_variants = ["release_debug|Win32"] + ["release_debug|x64"]
- variants = debug_variants + release_variants + release_debug_variants
- debug_targets = ["bin\\godot.windows.tools.32.exe"] + ["bin\\godot.windows.tools.64.exe"]
- release_targets = ["bin\\godot.windows.opt.32.exe"] + ["bin\\godot.windows.opt.64.exe"]
- release_debug_targets = ["bin\\godot.windows.opt.tools.32.exe"] + ["bin\\godot.windows.opt.tools.64.exe"]
- targets = debug_targets + release_targets + release_debug_targets
+ module_configs = ModuleConfigs()
+ import modules.mono.build_scripts.mono_reg_utils as mono_reg
+
+ if env.get("module_mono_enabled"):
+ mono_root = env.get("mono_prefix") or mono_reg.find_mono_root_dir(env["bits"])
+ if mono_root:
+ module_configs.add_mode(
+ "mono",
+ includes=os.path.join(mono_root, "include", "mono-2.0"),
+ cli_args="module_mono_enabled=yes mono_glue=yes",
+ defines=[("MONO_GLUE_ENABLED",)],
+ )
+ else:
+ print("Mono installation directory not found. Generated project will not have build variants for Mono.")
+
+ env["MSVSBUILDCOM"] = module_configs.build_commandline("scons")
+ env["MSVSREBUILDCOM"] = module_configs.build_commandline("scons vsproj=yes")
+ env["MSVSCLEANCOM"] = module_configs.build_commandline("scons --clean")
if not env.get("MSVS"):
env["MSVS"]["PROJECTSUFFIX"] = ".vcxproj"
env["MSVS"]["SOLUTIONSUFFIX"] = ".sln"
@@ -722,10 +802,8 @@ def generate_vs_project(env, num_jobs):
target=["#godot" + env["MSVSPROJECTSUFFIX"]],
incs=env.vs_incs,
srcs=env.vs_srcs,
- runfile=targets,
- buildtarget=targets,
auto_build_solution=1,
- variant=variants,
+ **module_configs,
)
else:
print("Could not locate Visual Studio batch file to set up the build environment. Not generating VS project.")
diff --git a/modules/gdscript/gdscript_analyzer.cpp b/modules/gdscript/gdscript_analyzer.cpp
index a5b75cbfe4..cd8fd361c5 100644
--- a/modules/gdscript/gdscript_analyzer.cpp
+++ b/modules/gdscript/gdscript_analyzer.cpp
@@ -980,7 +980,7 @@ void GDScriptAnalyzer::resolve_class_body(GDScriptParser::ClassNode *p_class) {
has_valid_setter = true;
#ifdef DEBUG_ENABLED
- if (member.variable->datatype.builtin_type == Variant::INT && setter_function->return_type->datatype.builtin_type == Variant::FLOAT) {
+ if (member.variable->datatype.builtin_type == Variant::FLOAT && setter_function->parameters[0]->datatype.builtin_type == Variant::INT) {
parser->push_warning(member.variable, GDScriptWarning::NARROWING_CONVERSION);
}
#endif
diff --git a/modules/mono/build_scripts/mono_reg_utils.py b/modules/mono/build_scripts/mono_reg_utils.py
index 0ec7e2f433..93a66ebf6f 100644
--- a/modules/mono/build_scripts/mono_reg_utils.py
+++ b/modules/mono/build_scripts/mono_reg_utils.py
@@ -2,7 +2,6 @@ import os
import platform
if os.name == "nt":
- import sys
import winreg
diff --git a/modules/mono/mono_gd/gd_mono_marshal.cpp b/modules/mono/mono_gd/gd_mono_marshal.cpp
index f8736dd043..1904634132 100644
--- a/modules/mono/mono_gd/gd_mono_marshal.cpp
+++ b/modules/mono/mono_gd/gd_mono_marshal.cpp
@@ -1256,6 +1256,17 @@ Variant mono_object_to_variant_impl(MonoObject *p_obj, const ManagedType &p_type
GDMonoUtils::Marshal::array_get_element_type(reftype, &elem_reftype);
return system_generic_list_to_Array_variant(p_obj, p_type.type_class, elem_reftype);
}
+
+ // GodotObject
+ GDMonoClass *type_class = p_type.type_class;
+ if (CACHED_CLASS(GodotObject)->is_assignable_from(type_class)) {
+ Object *ptr = unbox<Object *>(CACHED_FIELD(GodotObject, ptr)->get_value(p_obj));
+ if (ptr != nullptr) {
+ RefCounted *rc = Object::cast_to<RefCounted>(ptr);
+ return rc ? Variant(Ref<RefCounted>(rc)) : Variant(ptr);
+ }
+ return Variant();
+ }
} break;
}
diff --git a/modules/text_server_adv/SCsub b/modules/text_server_adv/SCsub
index 7cd4db6f67..68d1af84df 100644
--- a/modules/text_server_adv/SCsub
+++ b/modules/text_server_adv/SCsub
@@ -7,7 +7,6 @@ env_text_server_adv = env_modules.Clone()
def make_icu_data(target, source, env):
- import os
dst = target[0].srcnode().abspath
@@ -24,7 +23,6 @@ def make_icu_data(target, source, env):
f = open(source[0].srcnode().abspath, "rb")
buf = f.read()
- import os.path
g.write('extern "C" U_EXPORT const size_t U_ICUDATA_SIZE = ' + str(len(buf)) + ";\n")
g.write('extern "C" U_EXPORT const unsigned char U_ICUDATA_ENTRY_POINT[] = {\n')
diff --git a/platform/iphone/export/export_plugin.cpp b/platform/iphone/export/export_plugin.cpp
index a561da41c0..60fcbb68d3 100644
--- a/platform/iphone/export/export_plugin.cpp
+++ b/platform/iphone/export/export_plugin.cpp
@@ -1105,7 +1105,7 @@ Error EditorExportPlatformIOS::_export_additional_assets(const String &p_out_dir
for (int j = 0; j < project_static_libs.size(); j++) {
project_static_libs.write[j] = project_static_libs[j].get_file(); // Only the file name as it's copied to the project
}
- err = _export_additional_assets(p_out_dir, project_static_libs, true, true, r_exported_assets);
+ err = _export_additional_assets(p_out_dir, project_static_libs, true, false, r_exported_assets);
ERR_FAIL_COND_V(err, err);
Vector<String> ios_bundle_files = export_plugins[i]->get_ios_bundle_files();
diff --git a/scene/3d/audio_stream_player_3d.cpp b/scene/3d/audio_stream_player_3d.cpp
index c422070480..44a685f506 100644
--- a/scene/3d/audio_stream_player_3d.cpp
+++ b/scene/3d/audio_stream_player_3d.cpp
@@ -835,7 +835,7 @@ void AudioStreamPlayer3D::_bind_methods() {
ClassDB::bind_method(D_METHOD("get_stream_playback"), &AudioStreamPlayer3D::get_stream_playback);
ADD_PROPERTY(PropertyInfo(Variant::OBJECT, "stream", PROPERTY_HINT_RESOURCE_TYPE, "AudioStream"), "set_stream", "get_stream");
- ADD_PROPERTY(PropertyInfo(Variant::INT, "attenuation_model", PROPERTY_HINT_ENUM, "Inverse,Inverse Square,Log,Disabled"), "set_attenuation_model", "get_attenuation_model");
+ ADD_PROPERTY(PropertyInfo(Variant::INT, "attenuation_model", PROPERTY_HINT_ENUM, "Inverse,Inverse Square,Logarithmic,Disabled"), "set_attenuation_model", "get_attenuation_model");
ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "unit_db", PROPERTY_HINT_RANGE, "-80,80"), "set_unit_db", "get_unit_db");
ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "unit_size", PROPERTY_HINT_RANGE, "0.1,100,0.01,or_greater"), "set_unit_size", "get_unit_size");
ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "max_db", PROPERTY_HINT_RANGE, "-24,6"), "set_max_db", "get_max_db");
@@ -843,7 +843,7 @@ void AudioStreamPlayer3D::_bind_methods() {
ADD_PROPERTY(PropertyInfo(Variant::BOOL, "playing", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_EDITOR), "_set_playing", "is_playing");
ADD_PROPERTY(PropertyInfo(Variant::BOOL, "autoplay"), "set_autoplay", "is_autoplay_enabled");
ADD_PROPERTY(PropertyInfo(Variant::BOOL, "stream_paused", PROPERTY_HINT_NONE, ""), "set_stream_paused", "get_stream_paused");
- ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "max_distance", PROPERTY_HINT_RANGE, "0,4096,1,or_greater,exp"), "set_max_distance", "get_max_distance");
+ ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "max_distance", PROPERTY_HINT_RANGE, "0,4096,0.01,or_greater"), "set_max_distance", "get_max_distance");
ADD_PROPERTY(PropertyInfo(Variant::INT, "max_polyphony", PROPERTY_HINT_NONE, ""), "set_max_polyphony", "get_max_polyphony");
ADD_PROPERTY(PropertyInfo(Variant::STRING_NAME, "bus", PROPERTY_HINT_ENUM, ""), "set_bus", "get_bus");
ADD_PROPERTY(PropertyInfo(Variant::INT, "area_mask", PROPERTY_HINT_LAYERS_2D_PHYSICS), "set_area_mask", "get_area_mask");
diff --git a/scene/resources/default_theme/SCsub b/scene/resources/default_theme/SCsub
index 0fb6bb2c62..3667ab7c14 100644
--- a/scene/resources/default_theme/SCsub
+++ b/scene/resources/default_theme/SCsub
@@ -2,8 +2,6 @@
Import("env")
-import os
-import os.path
from platform_methods import run_in_subprocess
import default_theme_builders
diff --git a/scene/resources/surface_tool.cpp b/scene/resources/surface_tool.cpp
index a8cd872408..455af8a40c 100644
--- a/scene/resources/surface_tool.cpp
+++ b/scene/resources/surface_tool.cpp
@@ -1174,9 +1174,11 @@ Vector<int> SurfaceTool::generate_lod(float p_threshold, int p_target_index_coun
Vector<int> lod;
ERR_FAIL_COND_V(simplify_func == nullptr, lod);
+ ERR_FAIL_COND_V(p_target_index_count < 0, lod);
ERR_FAIL_COND_V(vertex_array.size() == 0, lod);
ERR_FAIL_COND_V(index_array.size() == 0, lod);
ERR_FAIL_COND_V(index_array.size() % 3 != 0, lod);
+ ERR_FAIL_COND_V(index_array.size() < (unsigned int)p_target_index_count, lod);
lod.resize(index_array.size());
LocalVector<float> vertices; //uses floats