1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-06 12:20:30 +00:00

Use const ref parameters in the OpenXR module

This commit is contained in:
Aaron Franke
2025-09-26 17:02:33 -07:00
parent b4472f4670
commit c3e6002c6e
36 changed files with 183 additions and 185 deletions

View File

@@ -73,7 +73,7 @@ void OpenXRActionMapEditor::_notification(int p_what) {
}
}
OpenXRActionSetEditor *OpenXRActionMapEditor::_add_action_set_editor(Ref<OpenXRActionSet> p_action_set) {
OpenXRActionSetEditor *OpenXRActionMapEditor::_add_action_set_editor(const Ref<OpenXRActionSet> &p_action_set) {
ERR_FAIL_COND_V(p_action_set.is_null(), nullptr);
OpenXRActionSetEditor *action_set_editor = memnew(OpenXRActionSetEditor(action_map, p_action_set));
@@ -95,7 +95,7 @@ void OpenXRActionMapEditor::_create_action_sets() {
}
}
OpenXRInteractionProfileEditorBase *OpenXRActionMapEditor::_add_interaction_profile_editor(Ref<OpenXRInteractionProfile> p_interaction_profile) {
OpenXRInteractionProfileEditorBase *OpenXRActionMapEditor::_add_interaction_profile_editor(const Ref<OpenXRInteractionProfile> &p_interaction_profile) {
ERR_FAIL_COND_V(p_interaction_profile.is_null(), nullptr);
String profile_path = p_interaction_profile->get_interaction_profile_path();
@@ -141,7 +141,7 @@ void OpenXRActionMapEditor::_create_interaction_profiles() {
}
}
OpenXRActionSetEditor *OpenXRActionMapEditor::_add_action_set(String p_name) {
OpenXRActionSetEditor *OpenXRActionMapEditor::_add_action_set(const String &p_name) {
ERR_FAIL_COND_V(action_map.is_null(), nullptr);
Ref<OpenXRActionSet> new_action_set;
@@ -163,7 +163,7 @@ OpenXRActionSetEditor *OpenXRActionMapEditor::_add_action_set(String p_name) {
return action_set_editor;
}
void OpenXRActionMapEditor::_remove_action_set(String p_name) {
void OpenXRActionMapEditor::_remove_action_set(const String &p_name) {
ERR_FAIL_COND(action_map.is_null());
Ref<OpenXRActionSet> action_set = action_map->find_action_set(p_name);
ERR_FAIL_COND(action_set.is_null());
@@ -231,7 +231,7 @@ void OpenXRActionMapEditor::_on_remove_action_set(Object *p_action_set_editor) {
action_map->set_edited(true);
}
void OpenXRActionMapEditor::_on_action_removed(Ref<OpenXRAction> p_action) {
void OpenXRActionMapEditor::_on_action_removed(const Ref<OpenXRAction> &p_action) {
for (int i = 0; i < tabs->get_tab_count(); i++) {
// First tab won't be an interaction profile editor, but being thorough..
OpenXRInteractionProfileEditorBase *interaction_profile_editor = Object::cast_to<OpenXRInteractionProfileEditorBase>(tabs->get_tab_control(i));
@@ -253,7 +253,7 @@ void OpenXRActionMapEditor::_on_add_interaction_profile() {
select_interaction_profile_dialog->open(already_selected);
}
void OpenXRActionMapEditor::_on_interaction_profile_selected(const String p_path) {
void OpenXRActionMapEditor::_on_interaction_profile_selected(const String &p_path) {
ERR_FAIL_COND(action_map.is_null());
Ref<OpenXRInteractionProfile> new_profile;
@@ -272,7 +272,7 @@ void OpenXRActionMapEditor::_on_interaction_profile_selected(const String p_path
tabs->set_current_tab(tabs->get_tab_count() - 1);
}
void OpenXRActionMapEditor::_load_action_map(const String p_path, bool p_create_new_if_missing) {
void OpenXRActionMapEditor::_load_action_map(const String &p_path, bool p_create_new_if_missing) {
Error err = OK;
Ref<DirAccess> da = DirAccess::create(DirAccess::ACCESS_RESOURCES);
if (da->file_exists(p_path)) {
@@ -382,7 +382,7 @@ void OpenXRActionMapEditor::_do_remove_interaction_profile_editor(OpenXRInteract
action_map->remove_interaction_profile(interaction_profile);
}
void OpenXRActionMapEditor::open_action_map(String p_path) {
void OpenXRActionMapEditor::open_action_map(const String &p_path) {
EditorNode::get_bottom_panel()->make_item_visible(this);
// out with the old...