Skip to content
This repository has been archived by the owner on Nov 14, 2024. It is now read-only.

Commit

Permalink
git subrepo pull (merge) --force godot
Browse files Browse the repository at this point in the history
subrepo:
  subdir:   "godot"
  merged:   "72728eab20"
upstream:
  origin:   "https://github.com/V-Sekai/godot.git"
  branch:   "groups-staging-4.4"
  commit:   "72728eab20"
git-subrepo:
  version:  "0.4.6"
  origin:   "https://github.com/ingydotnet/git-subrepo"
  commit:   "73a0129"
  • Loading branch information
fire committed Oct 25, 2024
1 parent 36f0f60 commit 5ceca1d
Show file tree
Hide file tree
Showing 31 changed files with 140 additions and 160 deletions.
4 changes: 2 additions & 2 deletions godot/.gitrepo
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
[subrepo]
remote = https://github.com/V-Sekai/godot.git
branch = groups-staging-4.4
commit = 1ac4c768de7e807777d0a6d34ac01784ca033de4
parent = cc40962b6777efabf477d133a526f38532041b7f
commit = 72728eab208b88681e4fe134e6803fd0c221338a
parent = 36f0f607371ee76888b532cf09ab705cfeca3267
method = merge
cmdver = 0.4.6
6 changes: 3 additions & 3 deletions godot/core/config/project_settings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -515,9 +515,9 @@ void ProjectSettings::_convert_to_last_version(int p_from_version) {
Dictionary action = E.value.variant;
Array events = action["events"];
for (int i = 0; i < events.size(); i++) {
Ref<InputEvent> x = events[i];
if (x->get_device() == -1) { // -1 was the previous value (GH-97707).
x->set_device(InputEvent::DEVICE_ID_ALL_DEVICES);
Ref<InputEvent> ev = events[i];
if (ev.is_valid() && ev->get_device() == -1) { // -1 was the previous value (GH-97707).
ev->set_device(InputEvent::DEVICE_ID_ALL_DEVICES);
}
}
}
Expand Down
2 changes: 2 additions & 0 deletions godot/core/input/input.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -690,6 +690,7 @@ void Input::_parse_input_event_impl(const Ref<InputEvent> &p_event, bool p_is_em
button_event->set_canceled(st->is_canceled());
button_event->set_button_index(MouseButton::LEFT);
button_event->set_double_click(st->is_double_tap());
button_event->set_window_id(st->get_window_id());

BitField<MouseButtonMask> ev_bm = mouse_button_mask;
if (st->is_pressed()) {
Expand Down Expand Up @@ -727,6 +728,7 @@ void Input::_parse_input_event_impl(const Ref<InputEvent> &p_event, bool p_is_em
motion_event->set_velocity(sd->get_velocity());
motion_event->set_screen_velocity(sd->get_screen_velocity());
motion_event->set_button_mask(mouse_button_mask);
motion_event->set_window_id(sd->get_window_id());

_parse_input_event_impl(motion_event, true);
}
Expand Down
4 changes: 4 additions & 0 deletions godot/core/string/ustring.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1850,6 +1850,8 @@ String String::num(double p_num, int p_decimals) {
}

String String::num_int64(int64_t p_num, int base, bool capitalize_hex) {
ERR_FAIL_COND_V_MSG(base < 2 || base > 36, "", "Cannot convert to base " + itos(base) + ", since the value is " + (base < 2 ? "less than 2." : "greater than 36."));

bool sign = p_num < 0;

int64_t n = p_num;
Expand Down Expand Up @@ -1888,6 +1890,8 @@ String String::num_int64(int64_t p_num, int base, bool capitalize_hex) {
}

String String::num_uint64(uint64_t p_num, int base, bool capitalize_hex) {
ERR_FAIL_COND_V_MSG(base < 2 || base > 36, "", "Cannot convert to base " + itos(base) + ", since the value is " + (base < 2 ? "less than 2." : "greater than 36."));

uint64_t n = p_num;

int chars = 0;
Expand Down
2 changes: 2 additions & 0 deletions godot/core/variant/variant_op.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -980,6 +980,7 @@ void Variant::_register_variant_operators() {
register_op<OperatorEvaluatorInDictionaryHas<Color>>(Variant::OP_IN, Variant::COLOR, Variant::DICTIONARY);
register_op<OperatorEvaluatorInDictionaryHas<StringName>>(Variant::OP_IN, Variant::STRING_NAME, Variant::DICTIONARY);
register_op<OperatorEvaluatorInDictionaryHas<NodePath>>(Variant::OP_IN, Variant::NODE_PATH, Variant::DICTIONARY);
register_op<OperatorEvaluatorInDictionaryHas<::RID>>(Variant::OP_IN, Variant::RID, Variant::DICTIONARY);
register_op<OperatorEvaluatorInDictionaryHasObject>(Variant::OP_IN, Variant::OBJECT, Variant::DICTIONARY);
register_op<OperatorEvaluatorInDictionaryHas<Callable>>(Variant::OP_IN, Variant::CALLABLE, Variant::DICTIONARY);
register_op<OperatorEvaluatorInDictionaryHas<Signal>>(Variant::OP_IN, Variant::SIGNAL, Variant::DICTIONARY);
Expand Down Expand Up @@ -1021,6 +1022,7 @@ void Variant::_register_variant_operators() {
register_op<OperatorEvaluatorInArrayFind<Color, Array>>(Variant::OP_IN, Variant::COLOR, Variant::ARRAY);
register_op<OperatorEvaluatorInArrayFind<StringName, Array>>(Variant::OP_IN, Variant::STRING_NAME, Variant::ARRAY);
register_op<OperatorEvaluatorInArrayFind<NodePath, Array>>(Variant::OP_IN, Variant::NODE_PATH, Variant::ARRAY);
register_op<OperatorEvaluatorInArrayFind<::RID, Array>>(Variant::OP_IN, Variant::RID, Variant::ARRAY);
register_op<OperatorEvaluatorInArrayFindObject>(Variant::OP_IN, Variant::OBJECT, Variant::ARRAY);
register_op<OperatorEvaluatorInArrayFind<Callable, Array>>(Variant::OP_IN, Variant::CALLABLE, Variant::ARRAY);
register_op<OperatorEvaluatorInArrayFind<Signal, Array>>(Variant::OP_IN, Variant::SIGNAL, Variant::ARRAY);
Expand Down
1 change: 1 addition & 0 deletions godot/doc/classes/ProjectSettings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
[b]Overriding:[/b] Any project setting can be overridden by creating a file named [code]override.cfg[/code] in the project's root directory. This can also be used in exported projects by placing this file in the same directory as the project binary. Overriding will still take the base project settings' [url=$DOCS_URL/tutorials/export/feature_tags.html]feature tags[/url] in account. Therefore, make sure to [i]also[/i] override the setting with the desired feature tags if you want them to override base project settings on all platforms and configurations.
</description>
<tutorials>
<link title="Project Settings">$DOCS_URL/tutorials/editor/project_settings.html</link>
<link title="3D Physics Tests Demo">https://godotengine.org/asset-library/asset/2747</link>
<link title="3D Platformer Demo">https://godotengine.org/asset-library/asset/2748</link>
<link title="Operating System Testing Demo">https://godotengine.org/asset-library/asset/2789</link>
Expand Down
2 changes: 1 addition & 1 deletion godot/drivers/coreaudio/audio_driver_coreaudio.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,7 @@ OSStatus AudioDriverCoreAudio::input_callback(void *inRefCon,
}

void AudioDriverCoreAudio::start() {
if (!active) {
if (!active && audio_unit != nullptr) {
OSStatus result = AudioOutputUnitStart(audio_unit);
if (result != noErr) {
ERR_PRINT("AudioOutputUnitStart failed, code: " + itos(result));
Expand Down
4 changes: 2 additions & 2 deletions godot/drivers/gles3/storage/material_storage.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1237,6 +1237,8 @@ MaterialStorage::MaterialStorage() {
actions.renames["PI"] = _MKSTR(Math_PI);
actions.renames["TAU"] = _MKSTR(Math_TAU);
actions.renames["E"] = _MKSTR(Math_E);
actions.renames["OUTPUT_IS_SRGB"] = "SHADER_IS_SRGB";
actions.renames["CLIP_SPACE_FAR"] = "SHADER_SPACE_FAR";
actions.renames["VIEWPORT_SIZE"] = "scene_data.viewport_size";

actions.renames["FRAGCOORD"] = "gl_FragCoord";
Expand Down Expand Up @@ -1276,8 +1278,6 @@ MaterialStorage::MaterialStorage() {
actions.renames["CUSTOM1"] = "custom1_attrib";
actions.renames["CUSTOM2"] = "custom2_attrib";
actions.renames["CUSTOM3"] = "custom3_attrib";
actions.renames["OUTPUT_IS_SRGB"] = "SHADER_IS_SRGB";
actions.renames["CLIP_SPACE_FAR"] = "SHADER_SPACE_FAR";
actions.renames["LIGHT_VERTEX"] = "light_vertex";

actions.renames["NODE_POSITION_WORLD"] = "model_matrix[3].xyz";
Expand Down
17 changes: 4 additions & 13 deletions godot/editor/import_dock.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -790,23 +790,14 @@ ImportDock::ImportDock() {
import->set_text(TTR("Reimport"));
import->set_disabled(true);
import->connect(SceneStringName(pressed), callable_mp(this, &ImportDock::_reimport_pressed));
if (!DisplayServer::get_singleton()->get_swap_cancel_ok()) {
advanced_spacer = hb->add_spacer();
advanced = memnew(Button);
advanced->set_text(TTR("Advanced..."));
hb->add_child(advanced);
}
advanced_spacer = hb->add_spacer();
advanced = memnew(Button);
advanced->set_text(TTR("Advanced..."));
hb->add_child(advanced);
hb->add_spacer();
hb->add_child(import);
hb->add_spacer();

if (DisplayServer::get_singleton()->get_swap_cancel_ok()) {
advanced = memnew(Button);
advanced->set_text(TTR("Advanced..."));
hb->add_child(advanced);
advanced_spacer = hb->add_spacer();
}

advanced->hide();
advanced_spacer->hide();
advanced->connect(SceneStringName(pressed), callable_mp(this, &ImportDock::_advanced_options));
Expand Down
8 changes: 4 additions & 4 deletions godot/modules/gdscript/gdscript.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2553,11 +2553,11 @@ void GDScriptLanguage::reload_all_scripts() {
}
}
}
#endif
#endif // TOOLS_ENABLED
}

reload_scripts(scripts, true);
#endif
#endif // DEBUG_ENABLED
}

void GDScriptLanguage::reload_scripts(const Array &p_scripts, bool p_soft_reload) {
Expand Down Expand Up @@ -2627,7 +2627,7 @@ void GDScriptLanguage::reload_scripts(const Array &p_scripts, bool p_soft_reload
}
}

#endif
#endif // TOOLS_ENABLED

for (const KeyValue<ObjectID, List<Pair<StringName, Variant>>> &F : scr->pending_reload_state) {
map[F.key] = F.value; //pending to reload, use this one instead
Expand Down Expand Up @@ -2695,7 +2695,7 @@ void GDScriptLanguage::reload_scripts(const Array &p_scripts, bool p_soft_reload
//if instance states were saved, set them!
}

#endif
#endif // DEBUG_ENABLED
}

void GDScriptLanguage::reload_tool_script(const Ref<Script> &p_script, bool p_soft_reload) {
Expand Down
14 changes: 9 additions & 5 deletions godot/modules/gdscript/gdscript_analyzer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -940,8 +940,8 @@ void GDScriptAnalyzer::resolve_class_member(GDScriptParser::ClassNode *p_class,
Finally finally([&]() {
ensure_cached_external_parser_for_class(member.get_datatype().class_type, p_class, "Trying to resolve datatype of class member", p_source);
GDScriptParser::DataType member_type = member.get_datatype();
if (member_type.has_container_element_type(0)) {
ensure_cached_external_parser_for_class(member_type.get_container_element_type(0).class_type, p_class, "Trying to resolve datatype of class member", p_source);
for (int i = 0; i < member_type.get_container_element_type_count(); ++i) {
ensure_cached_external_parser_for_class(member_type.get_container_element_type(i).class_type, p_class, "Trying to resolve datatype of class member", p_source);
}
});

Expand Down Expand Up @@ -3816,6 +3816,12 @@ GDScriptParser::DataType GDScriptAnalyzer::make_global_class_meta_type(const Str
}

Ref<GDScriptParserRef> GDScriptAnalyzer::ensure_cached_external_parser_for_class(const GDScriptParser::ClassNode *p_class, const GDScriptParser::ClassNode *p_from_class, const char *p_context, const GDScriptParser::Node *p_source) {
// Delicate piece of code that intentionally doesn't use the GDScript cache or `get_depended_parser_for`.
// Search dependencies for the parser that owns `p_class` and make a cache entry for it.
// Required for how we store pointers to classes owned by other parser trees and need to call `resolve_class_member` and such on the same parser tree.
// Since https://github.com/godotengine/godot/pull/94871 there can technically be multiple parsers for the same script in the same parser tree.
// Even if unlikely, getting the wrong parser could lead to strange undefined behavior without errors.

if (p_class == nullptr) {
return nullptr;
}
Expand All @@ -3832,8 +3838,6 @@ Ref<GDScriptParserRef> GDScriptAnalyzer::ensure_cached_external_parser_for_class
p_from_class = parser->head;
}

String script_path = p_class->get_datatype().script_path;

Ref<GDScriptParserRef> parser_ref;
for (const GDScriptParser::ClassNode *look_class = p_from_class; look_class != nullptr; look_class = look_class->base_type.class_type) {
if (parser->has_class(look_class)) {
Expand Down Expand Up @@ -5867,7 +5871,7 @@ void GDScriptAnalyzer::is_shadowing(GDScriptParser::IdentifierNode *p_identifier
parent = ClassDB::get_parent_class(parent);
}
}
#endif
#endif // DEBUG_ENABLED

GDScriptParser::DataType GDScriptAnalyzer::get_operation_type(Variant::Operator p_operation, const GDScriptParser::DataType &p_a, bool &r_valid, const GDScriptParser::Node *p_source) {
// Unary version.
Expand Down
6 changes: 3 additions & 3 deletions godot/modules/gdscript/gdscript_editor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3534,13 +3534,13 @@ ::Error GDScriptLanguage::complete_code(const String &p_code, const String &p_pa
return OK;
}

#else
#else // !TOOLS_ENABLED

Error GDScriptLanguage::complete_code(const String &p_code, const String &p_path, Object *p_owner, List<ScriptLanguage::CodeCompletionOption> *r_options, bool &r_forced, String &r_call_hint) {
return OK;
}

#endif
#endif // TOOLS_ENABLED

//////// END COMPLETION //////////

Expand Down Expand Up @@ -4125,4 +4125,4 @@ ::Error GDScriptLanguage::lookup_code(const String &p_code, const String &p_symb
return ERR_CANT_RESOLVE;
}

#endif
#endif // TOOLS_ENABLED
2 changes: 1 addition & 1 deletion godot/modules/gdscript/gdscript_parser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,7 @@ void GDScriptParser::apply_pending_warnings() {

pending_warnings.clear();
}
#endif
#endif // DEBUG_ENABLED

void GDScriptParser::override_completion_context(const Node *p_for_node, CompletionType p_type, Node *p_node, int p_argument) {
if (!for_completion) {
Expand Down
4 changes: 4 additions & 0 deletions godot/modules/gdscript/gdscript_parser.h
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,10 @@ class GDScriptParser {
container_element_types.write[p_index] = DataType(p_type);
}

_FORCE_INLINE_ int get_container_element_type_count() const {
return container_element_types.size();
}

_FORCE_INLINE_ DataType get_container_element_type(int p_index) const {
ERR_FAIL_INDEX_V(p_index, container_element_types.size(), get_variant_type());
return container_element_types[p_index];
Expand Down
4 changes: 2 additions & 2 deletions godot/modules/gdscript/gdscript_utility_functions.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -74,13 +74,13 @@
return; \
}

#else
#else // !DEBUG_ENABLED

#define VALIDATE_ARG_COUNT(m_count)
#define VALIDATE_ARG_INT(m_arg)
#define VALIDATE_ARG_NUM(m_arg)

#endif
#endif // DEBUG_ENABLED

struct GDScriptUtilityFunctionsDefinitions {
#ifndef DISABLE_DEPRECATED
Expand Down
22 changes: 13 additions & 9 deletions godot/modules/gdscript/gdscript_vm.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -397,32 +397,36 @@ void (*type_init_function_table[])(Variant *) = {
#define OPCODES_OUT \
OPSOUT:
#define OPCODE_SWITCH(m_test) goto *switch_table_ops[m_test];

#ifdef DEBUG_ENABLED
#define DISPATCH_OPCODE \
last_opcode = _code_ptr[ip]; \
goto *switch_table_ops[last_opcode]
#else
#else // !DEBUG_ENABLED
#define DISPATCH_OPCODE goto *switch_table_ops[_code_ptr[ip]]
#endif
#endif // DEBUG_ENABLED

#define OPCODE_BREAK goto OPSEXIT
#define OPCODE_OUT goto OPSOUT
#else
#else // !(defined(__GNUC__) || defined(__clang__))
#define OPCODES_TABLE
#define OPCODE(m_op) case m_op:
#define OPCODE_WHILE(m_test) while (m_test)
#define OPCODES_END
#define OPCODES_OUT
#define DISPATCH_OPCODE continue

#ifdef _MSC_VER
#define OPCODE_SWITCH(m_test) \
__assume(m_test <= OPCODE_END); \
switch (m_test)
#else
#else // !_MSC_VER
#define OPCODE_SWITCH(m_test) switch (m_test)
#endif
#endif // _MSC_VER

#define OPCODE_BREAK break
#define OPCODE_OUT break
#endif
#endif // defined(__GNUC__) || defined(__clang__)

// Helpers for VariantInternal methods in macros.
#define OP_GET_BOOL get_bool
Expand Down Expand Up @@ -663,7 +667,7 @@ Variant GDScriptFunction::call(GDScriptInstance *p_instance, const Variant **p_a
OPCODE_BREAK; \
}

#else
#else // !DEBUG_ENABLED
#define GD_ERR_BREAK(m_cond)
#define CHECK_SPACE(m_space)

Expand All @@ -676,7 +680,7 @@ Variant GDScriptFunction::call(GDScriptInstance *p_instance, const Variant **p_a
OPCODE_BREAK; \
}

#endif
#endif // DEBUG_ENABLED

#define LOAD_INSTRUCTION_ARGS \
int instr_arg_count = _code_ptr[ip + 1]; \
Expand Down Expand Up @@ -1965,7 +1969,7 @@ Variant GDScriptFunction::call(GDScriptInstance *p_instance, const Variant **p_a
err_text = _get_call_error("function '" + methodstr + (is_callable ? "" : "' in base '" + basestr) + "'", (const Variant **)argptrs, temp_ret, err);
OPCODE_BREAK;
}
#endif
#endif // DEBUG_ENABLED

ip += 3;
}
Expand Down
4 changes: 4 additions & 0 deletions godot/modules/openxr/scene/openxr_composition_layer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,10 @@ OpenXRCompositionLayer::OpenXRCompositionLayer(XrCompositionLayerBaseHeader *p_c
openxr_api = OpenXRAPI::get_singleton();
composition_layer_extension = OpenXRCompositionLayerExtension::get_singleton();

if (openxr_api) {
openxr_session_running = openxr_api->is_running();
}

Ref<OpenXRInterface> openxr_interface = XRServer::get_singleton()->find_interface("OpenXR");
if (openxr_interface.is_valid()) {
openxr_interface->connect("session_begun", callable_mp(this, &OpenXRCompositionLayer::_on_openxr_session_begun));
Expand Down
12 changes: 1 addition & 11 deletions godot/modules/raycast/raycast_occlusion_cull.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -181,17 +181,7 @@ void RaycastOcclusionCull::RaycastHZBuffer::sort_rays(const Vector3 &p_camera_di
}
int k = tile_i * TILE_SIZE + tile_j;
int tile_index = i * tile_grid_size.x + j;
float d = camera_rays[tile_index].ray.tfar[k];

if (!p_orthogonal) {
const float &dir_x = camera_rays[tile_index].ray.dir_x[k];
const float &dir_y = camera_rays[tile_index].ray.dir_y[k];
const float &dir_z = camera_rays[tile_index].ray.dir_z[k];
float cos_theta = p_camera_dir.x * dir_x + p_camera_dir.y * dir_y + p_camera_dir.z * dir_z;
d *= cos_theta;
}

mips[0][y * buffer_size.x + x] = d;
mips[0][y * buffer_size.x + x] = camera_rays[tile_index].ray.tfar[k];
}
}
}
Expand Down
17 changes: 5 additions & 12 deletions godot/scene/gui/button.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -296,19 +296,12 @@ void Button::_notification(int p_what) {
}
} break;
case DRAW_HOVER_PRESSED: {
// Edge case for CheckButton and CheckBox.
if (has_theme_stylebox("hover_pressed")) {
if (has_theme_color(SNAME("font_hover_pressed_color"))) {
font_color = theme_cache.font_hover_pressed_color;
}
if (has_theme_color(SNAME("icon_hover_pressed_color"))) {
icon_modulate_color = theme_cache.icon_hover_pressed_color;
}

break;
font_color = theme_cache.font_hover_pressed_color;
if (has_theme_color(SNAME("icon_hover_pressed_color"))) {
icon_modulate_color = theme_cache.icon_hover_pressed_color;
}
}
[[fallthrough]];

} break;
case DRAW_PRESSED: {
if (has_theme_color(SNAME("font_pressed_color"))) {
font_color = theme_cache.font_pressed_color;
Expand Down
Loading

0 comments on commit 5ceca1d

Please sign in to comment.