Skip to content

Commit 3927809

Browse files
authored
Merge branch 'godotengine:master' into anim-smch-node-drag-ux
2 parents 267a038 + f50d7fa commit 3927809

File tree

163 files changed

+3223
-2394
lines changed

Some content is hidden

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

163 files changed

+3223
-2394
lines changed

.github/workflows/ios_builds.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ env:
1212
1313
jobs:
1414
ios-template:
15+
# From https://docs.github.com/en/actions/how-tos/write-workflows/choose-where-workflows-run/choose-the-runner-for-a-job#choosing-github-hosted-runners
1516
runs-on: macos-latest
1617
name: Template (target=template_release)
1718
timeout-minutes: 60
@@ -22,6 +23,10 @@ jobs:
2223
with:
2324
submodules: recursive
2425

26+
# From https://github.com/actions/runner-images/blob/main/images/macos
27+
- name: Select Xcode 26
28+
run: sudo xcode-select -s /Applications/Xcode_26.0.1.app
29+
2530
- name: Restore Godot build cache
2631
uses: ./.github/actions/godot-cache-restore
2732
continue-on-error: true

.github/workflows/macos_builds.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ env:
1111
1212
jobs:
1313
build-macos:
14+
# From https://docs.github.com/en/actions/how-tos/write-workflows/choose-where-workflows-run/choose-the-runner-for-a-job#choosing-github-hosted-runners
1415
runs-on: macos-latest
1516
name: ${{ matrix.name }}
1617
timeout-minutes: 120
@@ -35,8 +36,9 @@ jobs:
3536
with:
3637
submodules: recursive
3738

38-
- name: Select Xcode 16
39-
run: sudo xcode-select -s /Applications/Xcode_16.2.app
39+
# From https://github.com/actions/runner-images/blob/main/images/macos
40+
- name: Select Xcode 26
41+
run: sudo xcode-select -s /Applications/Xcode_26.0.1.app
4042

4143
- name: Restore Godot build cache
4244
uses: ./.github/actions/godot-cache-restore

core/input/input_event.cpp

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -277,7 +277,7 @@ String InputEventWithModifiers::as_text() const {
277277
}
278278
}
279279

280-
String InputEventWithModifiers::to_string() {
280+
String InputEventWithModifiers::_to_string() {
281281
return as_text();
282282
}
283283

@@ -488,7 +488,7 @@ String InputEventKey::as_text() const {
488488
return mods_text.is_empty() ? kc : mods_text + "+" + kc;
489489
}
490490

491-
String InputEventKey::to_string() {
491+
String InputEventKey::_to_string() {
492492
String p = is_pressed() ? "true" : "false";
493493
String e = is_echo() ? "true" : "false";
494494

@@ -848,7 +848,7 @@ String InputEventMouseButton::as_text() const {
848848
return full_string;
849849
}
850850

851-
String InputEventMouseButton::to_string() {
851+
String InputEventMouseButton::_to_string() {
852852
String p = is_pressed() ? "true" : "false";
853853
String canceled_state = is_canceled() ? "true" : "false";
854854
String d = double_click ? "true" : "false";
@@ -988,7 +988,7 @@ String InputEventMouseMotion::as_text() const {
988988
return vformat(RTR("Mouse motion at position (%s) with velocity (%s)"), String(get_position()), String(get_velocity()));
989989
}
990990

991-
String InputEventMouseMotion::to_string() {
991+
String InputEventMouseMotion::_to_string() {
992992
BitField<MouseButtonMask> mouse_button_mask = get_button_mask();
993993
String button_mask_string = itos((int64_t)mouse_button_mask);
994994

@@ -1184,7 +1184,7 @@ String InputEventJoypadMotion::as_text() const {
11841184
return vformat(RTR("Joypad Motion on Axis %d (%s) with Value %.2f"), axis, desc, axis_value);
11851185
}
11861186

1187-
String InputEventJoypadMotion::to_string() {
1187+
String InputEventJoypadMotion::_to_string() {
11881188
return vformat("InputEventJoypadMotion: axis=%d, axis_value=%.2f", axis, axis_value);
11891189
}
11901190

@@ -1303,7 +1303,7 @@ String InputEventJoypadButton::as_text() const {
13031303
return text;
13041304
}
13051305

1306-
String InputEventJoypadButton::to_string() {
1306+
String InputEventJoypadButton::_to_string() {
13071307
String p = is_pressed() ? "true" : "false";
13081308
return vformat("InputEventJoypadButton: button_index=%d, pressed=%s, pressure=%.2f", button_index, p, pressure);
13091309
}
@@ -1386,7 +1386,7 @@ String InputEventScreenTouch::as_text() const {
13861386
return vformat(RTR("Screen %s at (%s) with %s touch points"), status, String(get_position()), itos(index));
13871387
}
13881388

1389-
String InputEventScreenTouch::to_string() {
1389+
String InputEventScreenTouch::_to_string() {
13901390
String p = pressed ? "true" : "false";
13911391
String canceled_state = canceled ? "true" : "false";
13921392
String double_tap_string = double_tap ? "true" : "false";
@@ -1514,7 +1514,7 @@ String InputEventScreenDrag::as_text() const {
15141514
return vformat(RTR("Screen dragged with %s touch points at position (%s) with velocity of (%s)"), itos(index), String(get_position()), String(get_velocity()));
15151515
}
15161516

1517-
String InputEventScreenDrag::to_string() {
1517+
String InputEventScreenDrag::_to_string() {
15181518
return vformat("InputEventScreenDrag: index=%d, position=(%s), relative=(%s), velocity=(%s), pressure=%.2f, tilt=(%s), pen_inverted=(%s)", index, String(get_position()), String(get_relative()), String(get_velocity()), get_pressure(), String(get_tilt()), get_pen_inverted());
15191519
}
15201520

@@ -1656,7 +1656,7 @@ String InputEventAction::as_text() const {
16561656
return String();
16571657
}
16581658

1659-
String InputEventAction::to_string() {
1659+
String InputEventAction::_to_string() {
16601660
String p = is_pressed() ? "true" : "false";
16611661
return vformat("InputEventAction: action=\"%s\", pressed=%s", action, p);
16621662
}
@@ -1727,7 +1727,7 @@ String InputEventMagnifyGesture::as_text() const {
17271727
return vformat(RTR("Magnify Gesture at (%s) with factor %s"), String(get_position()), rtos(get_factor()));
17281728
}
17291729

1730-
String InputEventMagnifyGesture::to_string() {
1730+
String InputEventMagnifyGesture::_to_string() {
17311731
return vformat("InputEventMagnifyGesture: factor=%.2f, position=(%s)", factor, String(get_position()));
17321732
}
17331733

@@ -1769,7 +1769,7 @@ String InputEventPanGesture::as_text() const {
17691769
return vformat(RTR("Pan Gesture at (%s) with delta (%s)"), String(get_position()), String(get_delta()));
17701770
}
17711771

1772-
String InputEventPanGesture::to_string() {
1772+
String InputEventPanGesture::_to_string() {
17731773
return vformat("InputEventPanGesture: delta=(%s), position=(%s)", String(get_delta()), String(get_position()));
17741774
}
17751775

@@ -1850,7 +1850,7 @@ String InputEventMIDI::as_text() const {
18501850
return vformat(RTR("MIDI Input on Channel=%s Message=%s"), itos(channel), itos((int64_t)message));
18511851
}
18521852

1853-
String InputEventMIDI::to_string() {
1853+
String InputEventMIDI::_to_string() {
18541854
String ret;
18551855
switch (message) {
18561856
case MIDIMessage::NOTE_ON:
@@ -1926,7 +1926,7 @@ String InputEventShortcut::as_text() const {
19261926
return vformat(RTR("Input Event with Shortcut=%s"), shortcut->get_as_text());
19271927
}
19281928

1929-
String InputEventShortcut::to_string() {
1929+
String InputEventShortcut::_to_string() {
19301930
ERR_FAIL_COND_V(shortcut.is_null(), "None");
19311931

19321932
return vformat("InputEventShortcut: shortcut=%s", shortcut->get_as_text());

core/input/input_event.h

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ class InputEventWithModifiers : public InputEventFromWindow {
146146
BitField<KeyModifierMask> get_modifiers_mask() const;
147147

148148
virtual String as_text() const override;
149-
virtual String to_string() override;
149+
virtual String _to_string() override;
150150

151151
InputEventWithModifiers() {}
152152
};
@@ -200,7 +200,7 @@ class InputEventKey : public InputEventWithModifiers {
200200
virtual String as_text_key_label() const;
201201
virtual String as_text_location() const;
202202
virtual String as_text() const override;
203-
virtual String to_string() override;
203+
virtual String _to_string() override;
204204

205205
static Ref<InputEventKey> create_reference(Key p_keycode_with_modifier_masks, bool p_physical = false);
206206

@@ -263,7 +263,7 @@ class InputEventMouseButton : public InputEventMouse {
263263

264264
virtual bool is_action_type() const override { return true; }
265265
virtual String as_text() const override;
266-
virtual String to_string() override;
266+
virtual String _to_string() override;
267267

268268
InputEventType get_type() const final override { return InputEventType::MOUSE_BUTTON; }
269269

@@ -308,7 +308,7 @@ class InputEventMouseMotion : public InputEventMouse {
308308

309309
virtual Ref<InputEvent> xformed_by(const Transform2D &p_xform, const Vector2 &p_local_ofs = Vector2()) const override;
310310
virtual String as_text() const override;
311-
virtual String to_string() override;
311+
virtual String _to_string() override;
312312

313313
virtual bool accumulate(const Ref<InputEvent> &p_event) override;
314314

@@ -337,7 +337,7 @@ class InputEventJoypadMotion : public InputEvent {
337337

338338
virtual bool is_action_type() const override { return true; }
339339
virtual String as_text() const override;
340-
virtual String to_string() override;
340+
virtual String _to_string() override;
341341

342342
// The default device ID is `InputMap::ALL_DEVICES`.
343343
static Ref<InputEventJoypadMotion> create_reference(JoyAxis p_axis, float p_value, int p_device = -1);
@@ -370,7 +370,7 @@ class InputEventJoypadButton : public InputEvent {
370370
virtual bool is_action_type() const override { return true; }
371371

372372
virtual String as_text() const override;
373-
virtual String to_string() override;
373+
virtual String _to_string() override;
374374

375375
// The default device ID is `InputMap::ALL_DEVICES`.
376376
static Ref<InputEventJoypadButton> create_reference(JoyButton p_btn_index, int p_device = -1);
@@ -404,7 +404,7 @@ class InputEventScreenTouch : public InputEventFromWindow {
404404

405405
virtual Ref<InputEvent> xformed_by(const Transform2D &p_xform, const Vector2 &p_local_ofs = Vector2()) const override;
406406
virtual String as_text() const override;
407-
virtual String to_string() override;
407+
virtual String _to_string() override;
408408

409409
InputEventType get_type() const final override { return InputEventType::SCREEN_TOUCH; }
410410

@@ -456,7 +456,7 @@ class InputEventScreenDrag : public InputEventFromWindow {
456456

457457
virtual Ref<InputEvent> xformed_by(const Transform2D &p_xform, const Vector2 &p_local_ofs = Vector2()) const override;
458458
virtual String as_text() const override;
459-
virtual String to_string() override;
459+
virtual String _to_string() override;
460460

461461
virtual bool accumulate(const Ref<InputEvent> &p_event) override;
462462

@@ -495,7 +495,7 @@ class InputEventAction : public InputEvent {
495495
virtual bool is_action_type() const override { return true; }
496496

497497
virtual String as_text() const override;
498-
virtual String to_string() override;
498+
virtual String _to_string() override;
499499

500500
InputEventType get_type() const final override { return InputEventType::ACTION; }
501501

@@ -528,7 +528,7 @@ class InputEventMagnifyGesture : public InputEventGesture {
528528

529529
virtual Ref<InputEvent> xformed_by(const Transform2D &p_xform, const Vector2 &p_local_ofs = Vector2()) const override;
530530
virtual String as_text() const override;
531-
virtual String to_string() override;
531+
virtual String _to_string() override;
532532

533533
InputEventType get_type() const final override { return InputEventType::MAGNIFY_GESTURE; }
534534

@@ -548,7 +548,7 @@ class InputEventPanGesture : public InputEventGesture {
548548

549549
virtual Ref<InputEvent> xformed_by(const Transform2D &p_xform, const Vector2 &p_local_ofs = Vector2()) const override;
550550
virtual String as_text() const override;
551-
virtual String to_string() override;
551+
virtual String _to_string() override;
552552

553553
InputEventType get_type() const final override { return InputEventType::PAN_GESTURE; }
554554

@@ -596,7 +596,7 @@ class InputEventMIDI : public InputEvent {
596596
int get_controller_value() const;
597597

598598
virtual String as_text() const override;
599-
virtual String to_string() override;
599+
virtual String _to_string() override;
600600

601601
InputEventType get_type() const final override { return InputEventType::MIDI; }
602602

@@ -616,7 +616,7 @@ class InputEventShortcut : public InputEvent {
616616
Ref<Shortcut> get_shortcut();
617617

618618
virtual String as_text() const override;
619-
virtual String to_string() override;
619+
virtual String _to_string() override;
620620

621621
InputEventType get_type() const final override { return InputEventType::SHORTCUT; }
622622

core/io/image.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4575,9 +4575,9 @@ void Image::renormalize_uint8(uint8_t *p_rgb) {
45754575
n += Vector3(1, 1, 1);
45764576
n *= 0.5;
45774577
n *= 255;
4578-
p_rgb[0] = CLAMP(int(n.x), 0, 255);
4579-
p_rgb[1] = CLAMP(int(n.y), 0, 255);
4580-
p_rgb[2] = CLAMP(int(n.z), 0, 255);
4578+
p_rgb[0] = CLAMP(int(Math::round(n.x)), 0, 255);
4579+
p_rgb[1] = CLAMP(int(Math::round(n.y)), 0, 255);
4580+
p_rgb[2] = CLAMP(int(Math::round(n.z)), 0, 255);
45814581
}
45824582

45834583
void Image::renormalize_float(float *p_rgb) {
@@ -4604,9 +4604,9 @@ void Image::renormalize_uint16(uint16_t *p_rgb) {
46044604
n += Vector3(1, 1, 1);
46054605
n *= 0.5;
46064606
n *= 65535;
4607-
p_rgb[0] = CLAMP(int(n.x), 0, 65535);
4608-
p_rgb[1] = CLAMP(int(n.y), 0, 65535);
4609-
p_rgb[2] = CLAMP(int(n.z), 0, 65535);
4607+
p_rgb[0] = CLAMP(int(Math::round(n.x)), 0, 65535);
4608+
p_rgb[1] = CLAMP(int(Math::round(n.y)), 0, 65535);
4609+
p_rgb[2] = CLAMP(int(Math::round(n.z)), 0, 65535);
46104610
}
46114611

46124612
Image::Image(const uint8_t *p_mem_png_jpg, int p_len) {

core/io/resource.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -660,6 +660,10 @@ void Resource::reset_local_to_scene() {
660660
// Restores the state as if setup_local_to_scene() hadn't been called.
661661
}
662662

663+
String Resource::_to_string() {
664+
return (name.is_empty() ? "" : String(name) + " ") + "(" + path_cache + "):" + Object::_to_string();
665+
}
666+
663667
Node *(*Resource::_get_local_scene_func)() = nullptr;
664668
void (*Resource::_update_configuration_warning)() = nullptr;
665669

core/io/resource.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,7 @@ class Resource : public RefCounted {
122122
GDVIRTUAL0(_reset_state);
123123

124124
virtual Ref<Resource> _duplicate(const DuplicateParams &p_params) const;
125+
virtual String _to_string() override;
125126

126127
public:
127128
static Node *(*_get_local_scene_func)(); // Used by the editor.

core/io/translation_loader_po.cpp

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -31,15 +31,16 @@
3131
#include "translation_loader_po.h"
3232

3333
#include "core/io/file_access.h"
34-
#include "core/string/translation_po.h"
34+
#include "core/string/translation.h"
3535

3636
Ref<Resource> TranslationLoaderPO::load_translation(Ref<FileAccess> f, Error *r_error) {
3737
if (r_error) {
3838
*r_error = ERR_FILE_CORRUPT;
3939
}
4040

4141
const String path = f->get_path();
42-
Ref<TranslationPO> translation = Ref<TranslationPO>(memnew(TranslationPO));
42+
Ref<Translation> translation;
43+
translation.instantiate();
4344
String config;
4445

4546
uint32_t magic = f->get_32();
@@ -112,7 +113,7 @@ Ref<Resource> TranslationLoaderPO::load_translation(Ref<FileAccess> f, Error *r_
112113
int p_start = config.find("Plural-Forms");
113114
if (p_start != -1) {
114115
int p_end = config.find_char('\n', p_start);
115-
translation->set_plural_rule(config.substr(p_start, p_end - p_start));
116+
translation->set_plural_rules_override(config.substr(p_start, p_end - p_start));
116117
}
117118
} else {
118119
uint32_t str_start = 0;
@@ -228,8 +229,8 @@ Ref<Resource> TranslationLoaderPO::load_translation(Ref<FileAccess> f, Error *r_
228229
int p_start = config.find("Plural-Forms");
229230
if (p_start != -1) {
230231
int p_end = config.find_char('\n', p_start);
231-
translation->set_plural_rule(config.substr(p_start, p_end - p_start));
232-
plural_forms = translation->get_plural_forms();
232+
translation->set_plural_rules_override(config.substr(p_start, p_end - p_start));
233+
plural_forms = translation->get_nplurals();
233234
}
234235
}
235236

core/io/translation_loader_po.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@
3232

3333
#include "core/io/file_access.h"
3434
#include "core/io/resource_loader.h"
35-
#include "core/string/translation.h"
3635

3736
class TranslationLoaderPO : public ResourceFormatLoader {
3837
GDSOFTCLASS(TranslationLoaderPO, ResourceFormatLoader);

core/math/geometry_2d.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,9 @@
3030

3131
#include "geometry_2d.h"
3232

33+
GODOT_GCC_WARNING_PUSH_AND_IGNORE("-Walloc-zero")
3334
#include "thirdparty/clipper2/include/clipper2/clipper.h"
35+
GODOT_GCC_WARNING_POP
3436
#include "thirdparty/misc/polypartition.h"
3537
#define STB_RECT_PACK_IMPLEMENTATION
3638
#include "thirdparty/misc/stb_rect_pack.h"

0 commit comments

Comments
 (0)