Skip to content

Commit ac1a497

Browse files
authored
Merge pull request #855 from Spartan322/merge/cb411fa
Merge commit godotengine/godot@cb411fa
2 parents 5094c2a + 3a73c6e commit ac1a497

File tree

347 files changed

+8915
-4237
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

347 files changed

+8915
-4237
lines changed

.github/workflows/android_builds.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ concurrency:
1414

1515
jobs:
1616
build-android:
17-
runs-on: ubuntu-20.04
17+
runs-on: ubuntu-24.04
1818
name: ${{ matrix.name }}
1919
strategy:
2020
fail-fast: false

.github/workflows/godot_cpp_test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ concurrency:
1515

1616
jobs:
1717
godot-cpp-tests:
18-
runs-on: ubuntu-20.04
18+
runs-on: ubuntu-24.04
1919
name: Build and test Godot CPP
2020
steps:
2121
- name: Checkout

.github/workflows/linux_builds.yml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,8 @@ concurrency:
1717

1818
jobs:
1919
build-linux:
20-
runs-on: ubuntu-20.04
20+
# If unspecified, stay one LTS before latest to increase portability of Linux artifacts.
21+
runs-on: ${{ matrix.os || 'ubuntu-22.04' }}
2122
name: ${{ matrix.name }}
2223
strategy:
2324
fail-fast: false
@@ -60,6 +61,8 @@ jobs:
6061
artifact: false
6162
# Test our oldest supported SCons/Python versions on one arbitrary editor build.
6263
legacy-scons: true
64+
# Python 3.6 unavailable on 22.04.
65+
os: ubuntu-20.04
6366

6467
- name: Editor with ThreadSanitizer (target=editor, tests=yes, dev_build=yes, use_tsan=yes, use_llvm=yes, linker=lld)
6568
cache-name: linux-editor-thread-sanitizer
@@ -100,7 +103,7 @@ jobs:
100103
run: |
101104
sudo rm -f /etc/apt/sources.list.d/microsoft-prod.list
102105
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys EB8B81E14DA65431D7504EA8F63F0F2B90935439
103-
sudo add-apt-repository "deb https://ppa.launchpadcontent.net/kisak/turtle/ubuntu focal main"
106+
sudo add-apt-repository "deb https://ppa.launchpadcontent.net/kisak/turtle/ubuntu ${{ matrix.os == 'ubuntu-20.04' && 'focal' || 'jammy' }} main"
104107
sudo apt-get install -qq mesa-vulkan-drivers
105108
106109
# TODO: Figure out somehow how to embed this one.

.github/workflows/static_checks.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ concurrency:
99
jobs:
1010
static-checks:
1111
name: Code style, file formatting, and docs
12-
runs-on: ubuntu-22.04
12+
runs-on: ubuntu-24.04
1313
steps:
1414
- name: Checkout
1515
uses: actions/checkout@v4

.github/workflows/web_builds.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ concurrency:
1515

1616
jobs:
1717
web-template:
18-
runs-on: ubuntu-22.04
18+
runs-on: ubuntu-24.04
1919
name: ${{ matrix.name }}
2020
strategy:
2121
fail-fast: false

.pre-commit-config.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,14 +50,14 @@ repos:
5050
stages: [manual] # Not automatically triggered, invoked via `pre-commit run --hook-stage manual clang-tidy`
5151

5252
- repo: https://github.com/astral-sh/ruff-pre-commit
53-
rev: v0.6.6
53+
rev: v0.7.3
5454
hooks:
5555
- id: ruff
5656
args: [--fix]
5757
- id: ruff-format
5858

5959
- repo: https://github.com/pre-commit/mirrors-mypy
60-
rev: v1.11.2
60+
rev: v1.13.0
6161
hooks:
6262
- id: mypy
6363
files: \.py$

core/core_bind.compat.inc

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,11 +46,16 @@ void Semaphore::_bind_compatibility_methods() {
4646

4747
// OS
4848

49+
String OS::_read_string_from_stdin_bind_compat_91201() {
50+
return read_string_from_stdin(1024);
51+
}
52+
4953
Dictionary OS::_execute_with_pipe_bind_compat_94434(const String &p_path, const Vector<String> &p_arguments) {
5054
return execute_with_pipe(p_path, p_arguments, true);
5155
}
5256

5357
void OS::_bind_compatibility_methods() {
58+
ClassDB::bind_compatibility_method(D_METHOD("read_string_from_stdin"), &OS::_read_string_from_stdin_bind_compat_91201);
5459
ClassDB::bind_compatibility_method(D_METHOD("execute_with_pipe", "path", "arguments"), &OS::_execute_with_pipe_bind_compat_94434);
5560
}
5661

core/core_bind.cpp

Lines changed: 36 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,10 @@ ResourceUID::ID ResourceLoader::get_resource_uid(const String &p_path) {
134134
return ::ResourceLoader::get_resource_uid(p_path);
135135
}
136136

137+
Vector<String> ResourceLoader::list_directory(const String &p_directory) {
138+
return ::ResourceLoader::list_directory(p_directory);
139+
}
140+
137141
void ResourceLoader::_bind_methods() {
138142
ClassDB::bind_method(D_METHOD("load_threaded_request", "path", "type_hint", "use_sub_threads", "cache_mode"), &ResourceLoader::load_threaded_request, DEFVAL(""), DEFVAL(false), DEFVAL(CACHE_MODE_REUSE));
139143
ClassDB::bind_method(D_METHOD("load_threaded_get_status", "path", "progress"), &ResourceLoader::load_threaded_get_status, DEFVAL_ARRAY);
@@ -149,6 +153,7 @@ void ResourceLoader::_bind_methods() {
149153
ClassDB::bind_method(D_METHOD("get_cached_ref", "path"), &ResourceLoader::get_cached_ref);
150154
ClassDB::bind_method(D_METHOD("exists", "path", "type_hint"), &ResourceLoader::exists, DEFVAL(""));
151155
ClassDB::bind_method(D_METHOD("get_resource_uid", "path"), &ResourceLoader::get_resource_uid);
156+
ClassDB::bind_method(D_METHOD("list_directory", "directory_path"), &ResourceLoader::list_directory);
152157

153158
BIND_ENUM_CONSTANT(THREAD_LOAD_INVALID_RESOURCE);
154159
BIND_ENUM_CONSTANT(THREAD_LOAD_IN_PROGRESS);
@@ -305,8 +310,24 @@ Error OS::shell_show_in_file_manager(const String &p_path, bool p_open_folder) {
305310
return ::OS::get_singleton()->shell_show_in_file_manager(p_path, p_open_folder);
306311
}
307312

308-
String OS::read_string_from_stdin() {
309-
return ::OS::get_singleton()->get_stdin_string();
313+
String OS::read_string_from_stdin(int64_t p_buffer_size) {
314+
return ::OS::get_singleton()->get_stdin_string(p_buffer_size);
315+
}
316+
317+
PackedByteArray OS::read_buffer_from_stdin(int64_t p_buffer_size) {
318+
return ::OS::get_singleton()->get_stdin_buffer(p_buffer_size);
319+
}
320+
321+
OS::StdHandleType OS::get_stdin_type() const {
322+
return (OS::StdHandleType)::OS::get_singleton()->get_stdin_type();
323+
}
324+
325+
OS::StdHandleType OS::get_stdout_type() const {
326+
return (OS::StdHandleType)::OS::get_singleton()->get_stdout_type();
327+
}
328+
329+
OS::StdHandleType OS::get_stderr_type() const {
330+
return (OS::StdHandleType)::OS::get_singleton()->get_stderr_type();
310331
}
311332

312333
int OS::execute(const String &p_path, const Vector<String> &p_arguments, Array r_output, bool p_read_stderr, bool p_open_console) {
@@ -630,7 +651,13 @@ void OS::_bind_methods() {
630651
ClassDB::bind_method(D_METHOD("get_system_font_path", "font_name", "weight", "stretch", "italic"), &OS::get_system_font_path, DEFVAL(400), DEFVAL(100), DEFVAL(false));
631652
ClassDB::bind_method(D_METHOD("get_system_font_path_for_text", "font_name", "text", "locale", "script", "weight", "stretch", "italic"), &OS::get_system_font_path_for_text, DEFVAL(String()), DEFVAL(String()), DEFVAL(400), DEFVAL(100), DEFVAL(false));
632653
ClassDB::bind_method(D_METHOD("get_executable_path"), &OS::get_executable_path);
633-
ClassDB::bind_method(D_METHOD("read_string_from_stdin"), &OS::read_string_from_stdin);
654+
655+
ClassDB::bind_method(D_METHOD("read_string_from_stdin", "buffer_size"), &OS::read_string_from_stdin);
656+
ClassDB::bind_method(D_METHOD("read_buffer_from_stdin", "buffer_size"), &OS::read_buffer_from_stdin);
657+
ClassDB::bind_method(D_METHOD("get_stdin_type"), &OS::get_stdin_type);
658+
ClassDB::bind_method(D_METHOD("get_stdout_type"), &OS::get_stdout_type);
659+
ClassDB::bind_method(D_METHOD("get_stderr_type"), &OS::get_stderr_type);
660+
634661
ClassDB::bind_method(D_METHOD("execute", "path", "arguments", "output", "read_stderr", "open_console"), &OS::execute, DEFVAL_ARRAY, DEFVAL(false), DEFVAL(false));
635662
ClassDB::bind_method(D_METHOD("execute_with_pipe", "path", "arguments", "blocking"), &OS::execute_with_pipe, DEFVAL(true));
636663
ClassDB::bind_method(D_METHOD("create_process", "path", "arguments", "open_console"), &OS::create_process, DEFVAL(false));
@@ -722,6 +749,12 @@ void OS::_bind_methods() {
722749
BIND_ENUM_CONSTANT(SYSTEM_DIR_MUSIC);
723750
BIND_ENUM_CONSTANT(SYSTEM_DIR_PICTURES);
724751
BIND_ENUM_CONSTANT(SYSTEM_DIR_RINGTONES);
752+
753+
BIND_ENUM_CONSTANT(STD_HANDLE_INVALID);
754+
BIND_ENUM_CONSTANT(STD_HANDLE_CONSOLE);
755+
BIND_ENUM_CONSTANT(STD_HANDLE_FILE);
756+
BIND_ENUM_CONSTANT(STD_HANDLE_PIPE);
757+
BIND_ENUM_CONSTANT(STD_HANDLE_UNKNOWN);
725758
}
726759

727760
////// Geometry2D //////

core/core_bind.h

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,8 @@ class ResourceLoader : public Object {
8888
bool exists(const String &p_path, const String &p_type_hint = "");
8989
ResourceUID::ID get_resource_uid(const String &p_path);
9090

91+
Vector<String> list_directory(const String &p_directory);
92+
9193
ResourceLoader() { singleton = this; }
9294
};
9395

@@ -134,6 +136,7 @@ class OS : public Object {
134136
#ifndef DISABLE_DEPRECATED
135137
Dictionary _execute_with_pipe_bind_compat_94434(const String &p_path, const Vector<String> &p_arguments);
136138

139+
String _read_string_from_stdin_bind_compat_91201();
137140
static void _bind_compatibility_methods();
138141
#endif
139142

@@ -148,6 +151,14 @@ class OS : public Object {
148151
PackedByteArray get_entropy(int p_bytes);
149152
String get_system_ca_certificates();
150153

154+
enum StdHandleType {
155+
STD_HANDLE_INVALID,
156+
STD_HANDLE_CONSOLE,
157+
STD_HANDLE_FILE,
158+
STD_HANDLE_PIPE,
159+
STD_HANDLE_UNKNOWN,
160+
};
161+
151162
virtual PackedStringArray get_connected_midi_inputs();
152163
virtual void open_midi_inputs();
153164
virtual void close_midi_inputs();
@@ -168,7 +179,13 @@ class OS : public Object {
168179
String get_system_font_path(const String &p_font_name, int p_weight = 400, int p_stretch = 100, bool p_italic = false) const;
169180
Vector<String> get_system_font_path_for_text(const String &p_font_name, const String &p_text, const String &p_locale = String(), const String &p_script = String(), int p_weight = 400, int p_stretch = 100, bool p_italic = false) const;
170181
String get_executable_path() const;
171-
String read_string_from_stdin();
182+
183+
String read_string_from_stdin(int64_t p_buffer_size = 1024);
184+
PackedByteArray read_buffer_from_stdin(int64_t p_buffer_size = 1024);
185+
StdHandleType get_stdin_type() const;
186+
StdHandleType get_stdout_type() const;
187+
StdHandleType get_stderr_type() const;
188+
172189
int execute(const String &p_path, const Vector<String> &p_arguments, Array r_output = ClassDB::default_array_arg, bool p_read_stderr = false, bool p_open_console = false);
173190
Dictionary execute_with_pipe(const String &p_path, const Vector<String> &p_arguments, bool p_blocking = true);
174191
int create_process(const String &p_path, const Vector<String> &p_arguments, bool p_open_console = false);
@@ -647,6 +664,7 @@ VARIANT_BITFIELD_CAST(core_bind::ResourceSaver::SaverFlags);
647664

648665
VARIANT_ENUM_CAST(core_bind::OS::RenderingDriver);
649666
VARIANT_ENUM_CAST(core_bind::OS::SystemDir);
667+
VARIANT_ENUM_CAST(core_bind::OS::StdHandleType);
650668

651669
VARIANT_ENUM_CAST(core_bind::Geometry2D::PolyBooleanOperation);
652670
VARIANT_ENUM_CAST(core_bind::Geometry2D::PolyJoinType);

core/debugger/local_debugger.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -210,10 +210,10 @@ void LocalDebugger::debug(bool p_can_continue, bool p_is_error_breakpoint) {
210210
print_variables(members, values, variable_prefix);
211211

212212
} else if (line.begins_with("p") || line.begins_with("print")) {
213-
if (line.get_slice_count(" ") <= 1) {
214-
print_line("Usage: print <expre>");
213+
if (line.find_char(' ') < 0) {
214+
print_line("Usage: print <expression>");
215215
} else {
216-
String expr = line.get_slicec(' ', 2);
216+
String expr = line.split(" ", true, 1)[1];
217217
String res = script_lang->debug_parse_stack_level_expression(current_frame, expr);
218218
print_line(res);
219219
}

0 commit comments

Comments
 (0)