Skip to content

Commit

Permalink
Merge pull request #8 from V-Sekai/next-2
Browse files Browse the repository at this point in the history
Merge next into main.
  • Loading branch information
fire authored Dec 6, 2024
2 parents bc62849 + 4e47898 commit ee13cf4
Show file tree
Hide file tree
Showing 407 changed files with 2,863 additions and 162,082 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ jobs:
fail-fast: false
matrix:
precision: [double]
platform: [linuxbsd, windows, android, web]
platform: [linuxbsd, windows, web]
target: [editor, template_release, template_debug]

concurrency:
Expand Down
2 changes: 1 addition & 1 deletion .vscode/tasks.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
}
},
"command": [
"scons werror=no compiledb=yes dev_build=no generate_bundle=no vulkan=no precision=double target=editor tests=yes debug_symbols=yes"
"scons dev_build=yes werror=no compiledb=yes dev_build=no generate_bundle=no vulkan=no precision=double target=editor tests=yes debug_symbols=yes"
],
},
]
Expand Down
6 changes: 3 additions & 3 deletions godot/.gitrepo
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
;
[subrepo]
remote = https://github.com/V-Sekai/godot.git
branch = groups-4.4
commit = 44d2bc3ab61be9576a941f9c5931db4426215af4
parent = 671983d2cb7b4c5ad5e3c70fc81624058be03227
branch = groups-4.3
commit = 75727b08dc2c675f5912562e89aa80bca91de269
parent = 53928cca22d1f63cdf3062282dfbeac8eb98cabf
method = merge
cmdver = 0.4.9
5 changes: 5 additions & 0 deletions godot/COPYRIGHT.txt
Original file line number Diff line number Diff line change
Expand Up @@ -247,6 +247,11 @@ Comment: Noto Sans font
Copyright: 2012, Google Inc.
License: OFL-1.1

Files: ./thirdparty/fonts/Vazirmatn*.woff2
Comment: Vazirmatn font
Copyright: 2015, The Vazirmatn Project Authors.
License: OFL-1.1

Files: ./thirdparty/freetype/
Comment: The FreeType Project
Copyright: 1996-2023, David Turner, Robert Wilhelm, and Werner Lemberg.
Expand Down
2 changes: 0 additions & 2 deletions godot/SConstruct
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,6 @@ opts.Add(BoolVariable("threads", "Enable threading support", True))
# Components
opts.Add(BoolVariable("deprecated", "Enable compatibility code for deprecated and removed features", True))
opts.Add(EnumVariable("precision", "Set the floating-point precision level", "single", ("single", "double")))
opts.Add(BoolVariable("libdatachannel", "Enable the built-in libdatachannel webrtc implementation", True))
opts.Add(BoolVariable("minizip", "Enable ZIP archive support using minizip", True))
opts.Add(BoolVariable("brotli", "Enable Brotli for decompresson and WOFF2 fonts support", True))
opts.Add(BoolVariable("xaudio2", "Enable the XAudio2 audio driver on supported platforms", False))
Expand Down Expand Up @@ -286,7 +285,6 @@ opts.Add(BoolVariable("builtin_glslang", "Use the built-in glslang library", Tru
opts.Add(BoolVariable("builtin_graphite", "Use the built-in Graphite library", True))
opts.Add(BoolVariable("builtin_harfbuzz", "Use the built-in HarfBuzz library", True))
opts.Add(BoolVariable("builtin_icu4c", "Use the built-in ICU library", True))
opts.Add(BoolVariable("builtin_libdatachannel", "Use the built-in libdatachannel library", True))
opts.Add(BoolVariable("builtin_libogg", "Use the built-in libogg library", True))
opts.Add(BoolVariable("builtin_libpng", "Use the built-in libpng library", True))
opts.Add(BoolVariable("builtin_libtheora", "Use the built-in libtheora library", True))
Expand Down
3 changes: 3 additions & 0 deletions godot/core/config/engine.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -248,6 +248,9 @@ String Engine::get_architecture_name() const {
return "ppc";
#endif

#elif defined(__loongarch64)
return "loongarch64";

#elif defined(__wasm__)
#if defined(__wasm64__)
return "wasm64";
Expand Down
4 changes: 4 additions & 0 deletions godot/core/os/os.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -518,6 +518,10 @@ bool OS::has_feature(const String &p_feature) {
if (p_feature == "wasm") {
return true;
}
#elif defined(__loongarch64)
if (p_feature == "loongarch64") {
return true;
}
#endif

#if defined(IOS_SIMULATOR)
Expand Down
63 changes: 32 additions & 31 deletions godot/core/string/ustring.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,15 @@ const char16_t Char16String::_null = 0;
const char32_t String::_null = 0;
const char32_t String::_replacement_char = 0xfffd;

// strlen equivalent function for char32_t * arguments.
_FORCE_INLINE_ size_t strlen(const char32_t *p_str) {
const char32_t *ptr = p_str;
while (*ptr != 0) {
++ptr;
}
return ptr - p_str;
}

bool select_word(const String &p_s, int p_col, int &r_beg, int &r_end) {
const String &s = p_s;
int beg = CLAMP(p_col, 0, s.length());
Expand Down Expand Up @@ -424,11 +433,7 @@ void String::copy_from(const char32_t *p_cstr) {
return;
}

int len = 0;
const char32_t *ptr = p_cstr;
while (*(ptr++) != 0) {
len++;
}
const int len = strlen(p_cstr);

if (len == 0) {
resize(0);
Expand Down Expand Up @@ -629,12 +634,7 @@ String &String::operator+=(char32_t p_char) {

bool String::operator==(const char *p_str) const {
// compare Latin-1 encoded c-string
int len = 0;
const char *aux = p_str;

while (*(aux++) != 0) {
len++;
}
int len = strlen(p_str);

if (length() != len) {
return false;
Expand Down Expand Up @@ -668,12 +668,7 @@ bool String::operator==(const wchar_t *p_str) const {
}

bool String::operator==(const char32_t *p_str) const {
int len = 0;
const char32_t *aux = p_str;

while (*(aux++) != 0) {
len++;
}
const int len = strlen(p_str);

if (length() != len) {
return false;
Expand Down Expand Up @@ -1109,17 +1104,21 @@ String String::_camelcase_to_underscore() const {
String new_string;
int start_index = 0;

for (int i = 1; i < size(); i++) {
bool is_prev_upper = is_unicode_upper_case(cstr[i - 1]);
bool is_prev_lower = is_unicode_lower_case(cstr[i - 1]);
bool is_prev_digit = is_digit(cstr[i - 1]);
if (length() == 0) {
return *this;
}

bool is_curr_upper = is_unicode_upper_case(cstr[i]);
bool is_curr_lower = is_unicode_lower_case(cstr[i]);
bool is_curr_digit = is_digit(cstr[i]);
bool is_prev_upper = is_unicode_upper_case(cstr[0]);
bool is_prev_lower = is_unicode_lower_case(cstr[0]);
bool is_prev_digit = is_digit(cstr[0]);

for (int i = 1; i < length(); i++) {
const bool is_curr_upper = is_unicode_upper_case(cstr[i]);
const bool is_curr_lower = is_unicode_lower_case(cstr[i]);
const bool is_curr_digit = is_digit(cstr[i]);

bool is_next_lower = false;
if (i + 1 < size()) {
if (i + 1 < length()) {
is_next_lower = is_unicode_lower_case(cstr[i + 1]);
}

Expand All @@ -1132,6 +1131,10 @@ String String::_camelcase_to_underscore() const {
new_string += substr(start_index, i - start_index) + "_";
start_index = i;
}

is_prev_upper = is_curr_upper;
is_prev_lower = is_curr_lower;
is_prev_digit = is_curr_digit;
}

new_string += substr(start_index, size() - start_index);
Expand Down Expand Up @@ -5286,7 +5289,7 @@ bool String::is_valid_html_color() const {
}

// Changes made to the set of invalid filename characters must also be reflected in the String documentation for is_valid_filename.
static const char *invalid_filename_characters = ": / \\ ? * \" | % < >";
static const char *invalid_filename_characters[] = { ":", "/", "\\", "?", "*", "\"", "|", "%", "<", ">" };

bool String::is_valid_filename() const {
String stripped = strip_edges();
Expand All @@ -5298,8 +5301,7 @@ bool String::is_valid_filename() const {
return false;
}

Vector<String> chars = String(invalid_filename_characters).split(" ");
for (const String &ch : chars) {
for (const char *ch : invalid_filename_characters) {
if (contains(ch)) {
return false;
}
Expand All @@ -5308,10 +5310,9 @@ bool String::is_valid_filename() const {
}

String String::validate_filename() const {
Vector<String> chars = String(invalid_filename_characters).split(" ");
String name = strip_edges();
for (int i = 0; i < chars.size(); i++) {
name = name.replace(chars[i], "_");
for (const char *ch : invalid_filename_characters) {
name = name.replace(ch, "_");
}
return name;
}
Expand Down
2 changes: 1 addition & 1 deletion godot/doc/classes/PackedFloat32Array.xml
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@
<method name="to_byte_array" qualifiers="const">
<return type="PackedByteArray" />
<description>
Returns a copy of the data converted to a [PackedByteArray], where each element have been encoded as 4 bytes.
Returns a copy of the data converted to a [PackedByteArray], where each element has been encoded as 4 bytes.
The size of the new array will be [code]float32_array.size() * 4[/code].
</description>
</method>
Expand Down
2 changes: 1 addition & 1 deletion godot/doc/classes/PackedFloat64Array.xml
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@
<method name="to_byte_array" qualifiers="const">
<return type="PackedByteArray" />
<description>
Returns a copy of the data converted to a [PackedByteArray], where each element have been encoded as 8 bytes.
Returns a copy of the data converted to a [PackedByteArray], where each element has been encoded as 8 bytes.
The size of the new array will be [code]float64_array.size() * 8[/code].
</description>
</method>
Expand Down
2 changes: 1 addition & 1 deletion godot/doc/classes/PackedInt32Array.xml
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@
<method name="to_byte_array" qualifiers="const">
<return type="PackedByteArray" />
<description>
Returns a copy of the data converted to a [PackedByteArray], where each element have been encoded as 4 bytes.
Returns a copy of the data converted to a [PackedByteArray], where each element has been encoded as 4 bytes.
The size of the new array will be [code]int32_array.size() * 4[/code].
</description>
</method>
Expand Down
2 changes: 1 addition & 1 deletion godot/doc/classes/PackedInt64Array.xml
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@
<method name="to_byte_array" qualifiers="const">
<return type="PackedByteArray" />
<description>
Returns a copy of the data converted to a [PackedByteArray], where each element have been encoded as 8 bytes.
Returns a copy of the data converted to a [PackedByteArray], where each element has been encoded as 8 bytes.
The size of the new array will be [code]int64_array.size() * 8[/code].
</description>
</method>
Expand Down
33 changes: 33 additions & 0 deletions godot/doc/classes/ShaderIncludeDB.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
<?xml version="1.0" encoding="UTF-8" ?>
<class name="ShaderIncludeDB" inherits="Object" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd">
<brief_description>
Internal database of built in shader include files.
</brief_description>
<description>
This object contains shader fragments from Godot's internal shaders. These can be used when access to internal uniform buffers and/or internal functions is required for instance when composing compositor effects or compute shaders. Only fragments for the current rendering device are loaded.
</description>
<tutorials>
</tutorials>
<methods>
<method name="get_built_in_include_file" qualifiers="static">
<return type="String" />
<param index="0" name="filename" type="String" />
<description>
Returns the code for the built-in shader fragment. You can also access this in your shader code through [code]#include "filename"[/code].
</description>
</method>
<method name="has_built_in_include_file" qualifiers="static">
<return type="bool" />
<param index="0" name="filename" type="String" />
<description>
Returns [code]true[/code] if an include file with this name exists.
</description>
</method>
<method name="list_built_in_include_files" qualifiers="static">
<return type="PackedStringArray" />
<description>
Returns a list of built-in include files that are currently registered.
</description>
</method>
</methods>
</class>
2 changes: 1 addition & 1 deletion godot/doc/classes/SurfaceTool.xml
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@
<method name="generate_tangents">
<return type="void" />
<description>
Generates a tangent vector for each vertex. Requires that each vertex have UVs and normals set already (see [method generate_normals]).
Generates a tangent vector for each vertex. Requires that each vertex already has UVs and normals set (see [method generate_normals]).
</description>
</method>
<method name="get_aabb" qualifiers="const">
Expand Down
10 changes: 10 additions & 0 deletions godot/drivers/d3d12/rendering_device_driver_d3d12.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6144,6 +6144,16 @@ uint64_t RenderingDeviceDriverD3D12::limit_get(Limit p_limit) {
switch (p_limit) {
case LIMIT_MAX_BOUND_UNIFORM_SETS:
return safe_unbounded;
case LIMIT_MAX_TEXTURE_ARRAY_LAYERS:
return D3D12_REQ_TEXTURE2D_ARRAY_AXIS_DIMENSION;
case LIMIT_MAX_TEXTURE_SIZE_1D:
return D3D12_REQ_TEXTURE1D_U_DIMENSION;
case LIMIT_MAX_TEXTURE_SIZE_2D:
return D3D12_REQ_TEXTURE2D_U_OR_V_DIMENSION;
case LIMIT_MAX_TEXTURE_SIZE_3D:
return D3D12_REQ_TEXTURE3D_U_V_OR_W_DIMENSION;
case LIMIT_MAX_TEXTURE_SIZE_CUBE:
return D3D12_REQ_TEXTURECUBE_DIMENSION;
case LIMIT_MAX_TEXTURES_PER_SHADER_STAGE:
return device_limits.max_srvs_per_shader_stage;
case LIMIT_MAX_UNIFORM_BUFFER_SIZE:
Expand Down
2 changes: 1 addition & 1 deletion godot/drivers/gles3/storage/light_storage.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1405,7 +1405,7 @@ bool LightStorage::shadow_atlas_update_light(RID p_atlas, RID p_light_instance,
old_shadow = old_key & SHADOW_INDEX_MASK;

// Only re-allocate if a better option is available, and enough time has passed.
should_realloc = shadow_atlas->quadrants[old_quadrant].subdivision != (uint32_t)best_subdiv && (shadow_atlas->quadrants[old_quadrant].shadows[old_shadow].alloc_tick - tick > shadow_atlas_realloc_tolerance_msec);
should_realloc = shadow_atlas->quadrants[old_quadrant].subdivision != (uint32_t)best_subdiv && (tick - shadow_atlas->quadrants[old_quadrant].shadows[old_shadow].alloc_tick > shadow_atlas_realloc_tolerance_msec);
should_redraw = shadow_atlas->quadrants[old_quadrant].shadows[old_shadow].version != p_light_version;

if (!should_realloc) {
Expand Down
2 changes: 1 addition & 1 deletion godot/editor/connections_dialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -907,7 +907,7 @@ ConnectDialog::~ConnectDialog() {

Control *ConnectionsDockTree::make_custom_tooltip(const String &p_text) const {
// If it's not a doc tooltip, fallback to the default one.
if (p_text.contains("::")) {
if (p_text.is_empty() || p_text.contains("::")) {
return nullptr;
}

Expand Down
6 changes: 6 additions & 0 deletions godot/editor/editor_inspector.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,12 @@ bool EditorInspector::_property_path_matches(const String &p_property_path, cons
return false;
}

String EditorProperty::get_tooltip_string(const String &p_string) const {
// Trim to 100 characters to prevent the tooltip from being too long.
constexpr int TOOLTIP_MAX_LENGTH = 100;
return p_string.left(TOOLTIP_MAX_LENGTH).strip_edges() + String((p_string.length() > TOOLTIP_MAX_LENGTH) ? "..." : "");
}

Size2 EditorProperty::get_minimum_size() const {
Size2 ms;
Ref<Font> font = get_theme_font(SceneStringName(font), SNAME("Tree"));
Expand Down
2 changes: 2 additions & 0 deletions godot/editor/editor_inspector.h
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,8 @@ class EditorProperty : public Container {
public:
void emit_changed(const StringName &p_property, const Variant &p_value, const StringName &p_field = StringName(), bool p_changing = false);

String get_tooltip_string(const String &p_string) const;

virtual Size2 get_minimum_size() const override;

void set_label(const String &p_label);
Expand Down
16 changes: 7 additions & 9 deletions godot/editor/editor_node.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1427,7 +1427,7 @@ void EditorNode::save_resource_as(const Ref<Resource> &p_resource, const String
if (p_resource->get_path().is_resource_file()) {
file->set_current_file(p_resource->get_path().get_file());
} else {
if (extensions.size()) {
if (!preferred.is_empty()) {
String resource_name_snake_case = p_resource->get_class().to_snake_case();
file->set_current_file("new_" + resource_name_snake_case + "." + preferred.front()->get().to_lower());
} else {
Expand All @@ -1436,18 +1436,15 @@ void EditorNode::save_resource_as(const Ref<Resource> &p_resource, const String
}
} else if (!p_resource->get_path().is_empty()) {
file->set_current_path(p_resource->get_path());
if (extensions.size()) {
String ext = p_resource->get_path().get_extension().to_lower();
if (!extensions.is_empty()) {
const String ext = p_resource->get_path().get_extension().to_lower();
if (extensions.find(ext) == nullptr) {
file->set_current_path(p_resource->get_path().replacen("." + ext, "." + extensions.front()->get()));
}
}
} else if (preferred.size()) {
String existing;
if (extensions.size()) {
String resource_name_snake_case = p_resource->get_class().to_snake_case();
existing = "new_" + resource_name_snake_case + "." + preferred.front()->get().to_lower();
}
} else if (!preferred.is_empty()) {
const String resource_name_snake_case = p_resource->get_class().to_snake_case();
const String existing = "new_" + resource_name_snake_case + "." + preferred.front()->get().to_lower();
file->set_current_path(existing);
}
file->set_title(TTR("Save Resource As..."));
Expand Down Expand Up @@ -7173,6 +7170,7 @@ EditorNode::EditorNode() {
main_menu = memnew(MenuBar);
main_menu->set_mouse_filter(Control::MOUSE_FILTER_STOP);
title_bar->add_child(main_menu);
main_menu->set_v_size_flags(Control::SIZE_SHRINK_CENTER);
main_menu->set_theme_type_variation("MainMenuBar");
main_menu->set_start_index(0); // Main menu, add to the start of global menu.
main_menu->set_prefer_global_menu(global_menu);
Expand Down
Loading

0 comments on commit ee13cf4

Please sign in to comment.