Skip to content

Commit d89cc01

Browse files
committed
Merge branch 'refs/heads/master' into sgc/metal
2 parents bd0421d + 1af4262 commit d89cc01

10 files changed

+153
-116
lines changed

core/variant/variant_call.cpp

+33-26
Original file line numberDiff line numberDiff line change
@@ -657,22 +657,28 @@ static _FORCE_INLINE_ void vc_ptrcall(void (*method)(T *, P...), void *p_base, c
657657
} \
658658
};
659659

660-
#define VARCALL_PACKED_GETTER(m_packed_type, m_return_type) \
661-
static m_return_type func_##m_packed_type##_get(m_packed_type *p_instance, int64_t p_index) { \
662-
return p_instance->get(p_index); \
660+
#define VARCALL_ARRAY_GETTER_SETTER(m_packed_type, m_type) \
661+
static m_type func_##m_packed_type##_get(m_packed_type *p_instance, int64_t p_index) { \
662+
ERR_FAIL_INDEX_V(p_index, p_instance->size(), m_type()); \
663+
return p_instance->get(p_index); \
664+
} \
665+
static void func_##m_packed_type##_set(m_packed_type *p_instance, int64_t p_index, const m_type &p_value) { \
666+
ERR_FAIL_INDEX(p_index, p_instance->size()); \
667+
p_instance->set(p_index, p_value); \
663668
}
664669

665670
struct _VariantCall {
666-
VARCALL_PACKED_GETTER(PackedByteArray, uint8_t)
667-
VARCALL_PACKED_GETTER(PackedColorArray, Color)
668-
VARCALL_PACKED_GETTER(PackedFloat32Array, float)
669-
VARCALL_PACKED_GETTER(PackedFloat64Array, double)
670-
VARCALL_PACKED_GETTER(PackedInt32Array, int32_t)
671-
VARCALL_PACKED_GETTER(PackedInt64Array, int64_t)
672-
VARCALL_PACKED_GETTER(PackedStringArray, String)
673-
VARCALL_PACKED_GETTER(PackedVector2Array, Vector2)
674-
VARCALL_PACKED_GETTER(PackedVector3Array, Vector3)
675-
VARCALL_PACKED_GETTER(PackedVector4Array, Vector4)
671+
VARCALL_ARRAY_GETTER_SETTER(PackedByteArray, uint8_t)
672+
VARCALL_ARRAY_GETTER_SETTER(PackedColorArray, Color)
673+
VARCALL_ARRAY_GETTER_SETTER(PackedFloat32Array, float)
674+
VARCALL_ARRAY_GETTER_SETTER(PackedFloat64Array, double)
675+
VARCALL_ARRAY_GETTER_SETTER(PackedInt32Array, int32_t)
676+
VARCALL_ARRAY_GETTER_SETTER(PackedInt64Array, int64_t)
677+
VARCALL_ARRAY_GETTER_SETTER(PackedStringArray, String)
678+
VARCALL_ARRAY_GETTER_SETTER(PackedVector2Array, Vector2)
679+
VARCALL_ARRAY_GETTER_SETTER(PackedVector3Array, Vector3)
680+
VARCALL_ARRAY_GETTER_SETTER(PackedVector4Array, Vector4)
681+
VARCALL_ARRAY_GETTER_SETTER(Array, Variant)
676682

677683
static String func_PackedByteArray_get_string_from_ascii(PackedByteArray *p_instance) {
678684
String s;
@@ -2354,8 +2360,8 @@ static void _register_variant_builtin_methods_array() {
23542360
bind_method(Array, clear, sarray(), varray());
23552361
bind_method(Array, hash, sarray(), varray());
23562362
bind_method(Array, assign, sarray("array"), varray());
2357-
bind_method(Array, get, sarray("index"), varray());
2358-
bind_method(Array, set, sarray("index", "value"), varray());
2363+
bind_function(Array, get, _VariantCall::func_Array_get, sarray("index"), varray());
2364+
bind_functionnc(Array, set, _VariantCall::func_Array_set, sarray("index", "value"), varray());
23592365
bind_method(Array, push_back, sarray("value"), varray());
23602366
bind_method(Array, push_front, sarray("value"), varray());
23612367
bind_method(Array, append, sarray("value"), varray());
@@ -2400,7 +2406,7 @@ static void _register_variant_builtin_methods_array() {
24002406
bind_method(Array, make_read_only, sarray(), varray());
24012407
bind_method(Array, is_read_only, sarray(), varray());
24022408

2403-
/* Packed*Array get (see VARCALL_PACKED_GETTER macro) */
2409+
/* Packed*Array get/set (see VARCALL_ARRAY_GETTER_SETTER macro) */
24042410
bind_function(PackedByteArray, get, _VariantCall::func_PackedByteArray_get, sarray("index"), varray());
24052411
bind_function(PackedColorArray, get, _VariantCall::func_PackedColorArray_get, sarray("index"), varray());
24062412
bind_function(PackedFloat32Array, get, _VariantCall::func_PackedFloat32Array_get, sarray("index"), varray());
@@ -2412,10 +2418,20 @@ static void _register_variant_builtin_methods_array() {
24122418
bind_function(PackedVector3Array, get, _VariantCall::func_PackedVector3Array_get, sarray("index"), varray());
24132419
bind_function(PackedVector4Array, get, _VariantCall::func_PackedVector4Array_get, sarray("index"), varray());
24142420

2421+
bind_functionnc(PackedByteArray, set, _VariantCall::func_PackedByteArray_set, sarray("index", "value"), varray());
2422+
bind_functionnc(PackedColorArray, set, _VariantCall::func_PackedColorArray_set, sarray("index", "value"), varray());
2423+
bind_functionnc(PackedFloat32Array, set, _VariantCall::func_PackedFloat32Array_set, sarray("index", "value"), varray());
2424+
bind_functionnc(PackedFloat64Array, set, _VariantCall::func_PackedFloat64Array_set, sarray("index", "value"), varray());
2425+
bind_functionnc(PackedInt32Array, set, _VariantCall::func_PackedInt32Array_set, sarray("index", "value"), varray());
2426+
bind_functionnc(PackedInt64Array, set, _VariantCall::func_PackedInt64Array_set, sarray("index", "value"), varray());
2427+
bind_functionnc(PackedStringArray, set, _VariantCall::func_PackedStringArray_set, sarray("index", "value"), varray());
2428+
bind_functionnc(PackedVector2Array, set, _VariantCall::func_PackedVector2Array_set, sarray("index", "value"), varray());
2429+
bind_functionnc(PackedVector3Array, set, _VariantCall::func_PackedVector3Array_set, sarray("index", "value"), varray());
2430+
bind_functionnc(PackedVector4Array, set, _VariantCall::func_PackedVector4Array_set, sarray("index", "value"), varray());
2431+
24152432
/* Byte Array */
24162433
bind_method(PackedByteArray, size, sarray(), varray());
24172434
bind_method(PackedByteArray, is_empty, sarray(), varray());
2418-
bind_method(PackedByteArray, set, sarray("index", "value"), varray());
24192435
bind_method(PackedByteArray, push_back, sarray("value"), varray());
24202436
bind_method(PackedByteArray, append, sarray("value"), varray());
24212437
bind_method(PackedByteArray, append_array, sarray("array"), varray());
@@ -2481,7 +2497,6 @@ static void _register_variant_builtin_methods_array() {
24812497

24822498
bind_method(PackedInt32Array, size, sarray(), varray());
24832499
bind_method(PackedInt32Array, is_empty, sarray(), varray());
2484-
bind_method(PackedInt32Array, set, sarray("index", "value"), varray());
24852500
bind_method(PackedInt32Array, push_back, sarray("value"), varray());
24862501
bind_method(PackedInt32Array, append, sarray("value"), varray());
24872502
bind_method(PackedInt32Array, append_array, sarray("array"), varray());
@@ -2505,7 +2520,6 @@ static void _register_variant_builtin_methods_array() {
25052520

25062521
bind_method(PackedInt64Array, size, sarray(), varray());
25072522
bind_method(PackedInt64Array, is_empty, sarray(), varray());
2508-
bind_method(PackedInt64Array, set, sarray("index", "value"), varray());
25092523
bind_method(PackedInt64Array, push_back, sarray("value"), varray());
25102524
bind_method(PackedInt64Array, append, sarray("value"), varray());
25112525
bind_method(PackedInt64Array, append_array, sarray("array"), varray());
@@ -2529,7 +2543,6 @@ static void _register_variant_builtin_methods_array() {
25292543

25302544
bind_method(PackedFloat32Array, size, sarray(), varray());
25312545
bind_method(PackedFloat32Array, is_empty, sarray(), varray());
2532-
bind_method(PackedFloat32Array, set, sarray("index", "value"), varray());
25332546
bind_method(PackedFloat32Array, push_back, sarray("value"), varray());
25342547
bind_method(PackedFloat32Array, append, sarray("value"), varray());
25352548
bind_method(PackedFloat32Array, append_array, sarray("array"), varray());
@@ -2553,7 +2566,6 @@ static void _register_variant_builtin_methods_array() {
25532566

25542567
bind_method(PackedFloat64Array, size, sarray(), varray());
25552568
bind_method(PackedFloat64Array, is_empty, sarray(), varray());
2556-
bind_method(PackedFloat64Array, set, sarray("index", "value"), varray());
25572569
bind_method(PackedFloat64Array, push_back, sarray("value"), varray());
25582570
bind_method(PackedFloat64Array, append, sarray("value"), varray());
25592571
bind_method(PackedFloat64Array, append_array, sarray("array"), varray());
@@ -2577,7 +2589,6 @@ static void _register_variant_builtin_methods_array() {
25772589

25782590
bind_method(PackedStringArray, size, sarray(), varray());
25792591
bind_method(PackedStringArray, is_empty, sarray(), varray());
2580-
bind_method(PackedStringArray, set, sarray("index", "value"), varray());
25812592
bind_method(PackedStringArray, push_back, sarray("value"), varray());
25822593
bind_method(PackedStringArray, append, sarray("value"), varray());
25832594
bind_method(PackedStringArray, append_array, sarray("array"), varray());
@@ -2601,7 +2612,6 @@ static void _register_variant_builtin_methods_array() {
26012612

26022613
bind_method(PackedVector2Array, size, sarray(), varray());
26032614
bind_method(PackedVector2Array, is_empty, sarray(), varray());
2604-
bind_method(PackedVector2Array, set, sarray("index", "value"), varray());
26052615
bind_method(PackedVector2Array, push_back, sarray("value"), varray());
26062616
bind_method(PackedVector2Array, append, sarray("value"), varray());
26072617
bind_method(PackedVector2Array, append_array, sarray("array"), varray());
@@ -2625,7 +2635,6 @@ static void _register_variant_builtin_methods_array() {
26252635

26262636
bind_method(PackedVector3Array, size, sarray(), varray());
26272637
bind_method(PackedVector3Array, is_empty, sarray(), varray());
2628-
bind_method(PackedVector3Array, set, sarray("index", "value"), varray());
26292638
bind_method(PackedVector3Array, push_back, sarray("value"), varray());
26302639
bind_method(PackedVector3Array, append, sarray("value"), varray());
26312640
bind_method(PackedVector3Array, append_array, sarray("array"), varray());
@@ -2649,7 +2658,6 @@ static void _register_variant_builtin_methods_array() {
26492658

26502659
bind_method(PackedColorArray, size, sarray(), varray());
26512660
bind_method(PackedColorArray, is_empty, sarray(), varray());
2652-
bind_method(PackedColorArray, set, sarray("index", "value"), varray());
26532661
bind_method(PackedColorArray, push_back, sarray("value"), varray());
26542662
bind_method(PackedColorArray, append, sarray("value"), varray());
26552663
bind_method(PackedColorArray, append_array, sarray("array"), varray());
@@ -2673,7 +2681,6 @@ static void _register_variant_builtin_methods_array() {
26732681

26742682
bind_method(PackedVector4Array, size, sarray(), varray());
26752683
bind_method(PackedVector4Array, is_empty, sarray(), varray());
2676-
bind_method(PackedVector4Array, set, sarray("index", "value"), varray());
26772684
bind_method(PackedVector4Array, push_back, sarray("value"), varray());
26782685
bind_method(PackedVector4Array, append, sarray("value"), varray());
26792686
bind_method(PackedVector4Array, append_array, sarray("array"), varray());

drivers/metal/rendering_device_driver_metal.mm

+1
Original file line numberDiff line numberDiff line change
@@ -2056,6 +2056,7 @@ void deserialize(BufReader &p_reader) {
20562056

20572057
#if TARGET_OS_IPHONE
20582058
msl_options.ios_use_simdgroup_functions = (*device_properties).features.simdPermute;
2059+
msl_options.ios_support_base_vertex_instance = true;
20592060
#endif
20602061

20612062
bool disable_argument_buffers = false;

modules/mono/editor/hostfxr_resolver.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ typedef BOOL(WINAPI *LPFN_ISWOW64PROCESS)(HANDLE, PBOOL);
135135
BOOL is_wow64() {
136136
BOOL wow64 = FALSE;
137137

138-
LPFN_ISWOW64PROCESS fnIsWow64Process = (LPFN_ISWOW64PROCESS)GetProcAddress(GetModuleHandle(TEXT("kernel32")), "IsWow64Process");
138+
LPFN_ISWOW64PROCESS fnIsWow64Process = (LPFN_ISWOW64PROCESS)(void *)GetProcAddress(GetModuleHandle(TEXT("kernel32")), "IsWow64Process");
139139

140140
if (fnIsWow64Process) {
141141
if (!fnIsWow64Process(GetCurrentProcess(), &wow64)) {

modules/openxr/openxr_api.cpp

+3-3
Original file line numberDiff line numberDiff line change
@@ -3641,10 +3641,10 @@ void OpenXRAPI::set_emulate_environment_blend_mode_alpha_blend(bool p_enabled) {
36413641
}
36423642

36433643
OpenXRAPI::OpenXRAlphaBlendModeSupport OpenXRAPI::is_environment_blend_mode_alpha_blend_supported() {
3644-
if (is_environment_blend_mode_supported(XR_ENVIRONMENT_BLEND_MODE_ALPHA_BLEND)) {
3645-
return OPENXR_ALPHA_BLEND_MODE_SUPPORT_REAL;
3646-
} else if (emulate_environment_blend_mode_alpha_blend) {
3644+
if (emulate_environment_blend_mode_alpha_blend) {
36473645
return OPENXR_ALPHA_BLEND_MODE_SUPPORT_EMULATING;
3646+
} else if (is_environment_blend_mode_supported(XR_ENVIRONMENT_BLEND_MODE_ALPHA_BLEND)) {
3647+
return OPENXR_ALPHA_BLEND_MODE_SUPPORT_REAL;
36483648
}
36493649
return OPENXR_ALPHA_BLEND_MODE_SUPPORT_NONE;
36503650
}

platform/linuxbsd/x11/display_server_x11.cpp

+36-9
Original file line numberDiff line numberDiff line change
@@ -2171,7 +2171,10 @@ void DisplayServerX11::window_set_current_screen(int p_screen, WindowID p_window
21712171
return;
21722172
}
21732173

2174-
ERR_FAIL_COND_MSG(wd.embed_parent, "Embedded window can't be moved to another screen.");
2174+
if (wd.embed_parent) {
2175+
print_line("Embedded window can't be moved to another screen.");
2176+
return;
2177+
}
21752178

21762179
if (window_get_mode(p_window) == WINDOW_MODE_FULLSCREEN || window_get_mode(p_window) == WINDOW_MODE_MAXIMIZED) {
21772180
Point2i position = screen_get_position(p_screen);
@@ -2330,7 +2333,10 @@ void DisplayServerX11::window_set_position(const Point2i &p_position, WindowID p
23302333
ERR_FAIL_COND(!windows.has(p_window));
23312334
WindowData &wd = windows[p_window];
23322335

2333-
ERR_FAIL_COND_MSG(wd.embed_parent, "Embedded window can't be moved.");
2336+
if (wd.embed_parent) {
2337+
print_line("Embedded window can't be moved.");
2338+
return;
2339+
}
23342340

23352341
int x = 0;
23362342
int y = 0;
@@ -2364,7 +2370,10 @@ void DisplayServerX11::window_set_max_size(const Size2i p_size, WindowID p_windo
23642370
ERR_FAIL_COND(!windows.has(p_window));
23652371
WindowData &wd = windows[p_window];
23662372

2367-
ERR_FAIL_COND_MSG(wd.embed_parent, "Embedded windows can't have a maximum size.");
2373+
if (wd.embed_parent) {
2374+
print_line("Embedded windows can't have a maximum size.");
2375+
return;
2376+
}
23682377

23692378
if ((p_size != Size2i()) && ((p_size.x < wd.min_size.x) || (p_size.y < wd.min_size.y))) {
23702379
ERR_PRINT("Maximum window size can't be smaller than minimum window size!");
@@ -2391,7 +2400,10 @@ void DisplayServerX11::window_set_min_size(const Size2i p_size, WindowID p_windo
23912400
ERR_FAIL_COND(!windows.has(p_window));
23922401
WindowData &wd = windows[p_window];
23932402

2394-
ERR_FAIL_COND_MSG(wd.embed_parent, "Embedded windows can't have a minimum size.");
2403+
if (wd.embed_parent) {
2404+
print_line("Embedded windows can't have a minimum size.");
2405+
return;
2406+
}
23952407

23962408
if ((p_size != Size2i()) && (wd.max_size != Size2i()) && ((p_size.x > wd.max_size.x) || (p_size.y > wd.max_size.y))) {
23972409
ERR_PRINT("Minimum window size can't be larger than maximum window size!");
@@ -2422,7 +2434,10 @@ void DisplayServerX11::window_set_size(const Size2i p_size, WindowID p_window) {
24222434

24232435
WindowData &wd = windows[p_window];
24242436

2425-
ERR_FAIL_COND_MSG(wd.embed_parent, "Embedded window can't be resized.");
2437+
if (wd.embed_parent) {
2438+
print_line("Embedded window can't be resized.");
2439+
return;
2440+
}
24262441

24272442
if (wd.size.width == size.width && wd.size.height == size.height) {
24282443
return;
@@ -2842,7 +2857,10 @@ void DisplayServerX11::window_set_mode(WindowMode p_mode, WindowID p_window) {
28422857
return; // do nothing
28432858
}
28442859

2845-
ERR_FAIL_COND_MSG(p_mode != WINDOW_MODE_WINDOWED && wd.embed_parent, "Embedded window only supports Windowed mode.");
2860+
if (p_mode != WINDOW_MODE_WINDOWED && wd.embed_parent) {
2861+
print_line("Embedded window only supports Windowed mode.");
2862+
return;
2863+
}
28462864

28472865
// Remove all "extra" modes.
28482866
switch (old_mode) {
@@ -2944,7 +2962,10 @@ void DisplayServerX11::window_set_flag(WindowFlags p_flag, bool p_enabled, Windo
29442962

29452963
switch (p_flag) {
29462964
case WINDOW_FLAG_RESIZE_DISABLED: {
2947-
ERR_FAIL_COND_MSG(p_enabled && wd.embed_parent, "Embedded window resize can't be disabled.");
2965+
if (p_enabled && wd.embed_parent) {
2966+
print_line("Embedded window resize can't be disabled.");
2967+
return;
2968+
}
29482969

29492970
wd.resize_disabled = p_enabled;
29502971
_update_size_hints(p_window);
@@ -2971,7 +2992,10 @@ void DisplayServerX11::window_set_flag(WindowFlags p_flag, bool p_enabled, Windo
29712992
} break;
29722993
case WINDOW_FLAG_ALWAYS_ON_TOP: {
29732994
ERR_FAIL_COND_MSG(wd.transient_parent != INVALID_WINDOW_ID, "Can't make a window transient if the 'on top' flag is active.");
2974-
ERR_FAIL_COND_MSG(p_enabled && wd.embed_parent, "Embedded window can't become on top.");
2995+
if (p_enabled && wd.embed_parent) {
2996+
print_line("Embedded window can't become on top.");
2997+
return;
2998+
}
29752999
if (p_enabled && wd.fullscreen) {
29763000
_set_wm_maximized(p_window, true);
29773001
}
@@ -3013,7 +3037,10 @@ void DisplayServerX11::window_set_flag(WindowFlags p_flag, bool p_enabled, Windo
30133037

30143038
ERR_FAIL_COND_MSG(p_window == MAIN_WINDOW_ID, "Main window can't be popup.");
30153039
ERR_FAIL_COND_MSG((xwa.map_state == IsViewable) && (wd.is_popup != p_enabled), "Popup flag can't changed while window is opened.");
3016-
ERR_FAIL_COND_MSG(p_enabled && wd.embed_parent, "Embedded window can't be popup.");
3040+
if (p_enabled && wd.embed_parent) {
3041+
print_line("Embedded window can't be popup.");
3042+
return;
3043+
}
30173044
wd.is_popup = p_enabled;
30183045
} break;
30193046
default: {

0 commit comments

Comments
 (0)