Change RID_Owner::get_owned_list.
This commit is contained in:
@ -32,6 +32,7 @@
|
||||
|
||||
#include "core/os/mutex.h"
|
||||
#include "scene/main/node.h"
|
||||
#include <cstdint>
|
||||
|
||||
#ifdef CLIPPER2_ENABLED
|
||||
#include "nav_mesh_generator_2d.h"
|
||||
@ -193,11 +194,12 @@ void GodotNavigationServer2D::add_command(SetCommand2D *p_command) {
|
||||
|
||||
TypedArray<RID> GodotNavigationServer2D::get_maps() const {
|
||||
TypedArray<RID> all_map_rids;
|
||||
List<RID> maps_owned;
|
||||
map_owner.get_owned_list(&maps_owned);
|
||||
if (maps_owned.size()) {
|
||||
for (const RID &E : maps_owned) {
|
||||
all_map_rids.push_back(E);
|
||||
LocalVector<RID> maps_owned = map_owner.get_owned_list();
|
||||
uint32_t map_count = maps_owned.size();
|
||||
if (map_count) {
|
||||
all_map_rids.resize(map_count);
|
||||
for (uint32_t i = 0; i < map_count; i++) {
|
||||
all_map_rids[i] = maps_owned[i];
|
||||
}
|
||||
}
|
||||
return all_map_rids;
|
||||
|
||||
@ -94,11 +94,12 @@ void GodotNavigationServer3D::add_command(SetCommand3D *command) {
|
||||
|
||||
TypedArray<RID> GodotNavigationServer3D::get_maps() const {
|
||||
TypedArray<RID> all_map_rids;
|
||||
List<RID> maps_owned;
|
||||
map_owner.get_owned_list(&maps_owned);
|
||||
if (maps_owned.size()) {
|
||||
for (const RID &E : maps_owned) {
|
||||
all_map_rids.push_back(E);
|
||||
LocalVector<RID> maps_owned = map_owner.get_owned_list();
|
||||
uint32_t map_count = maps_owned.size();
|
||||
if (map_count) {
|
||||
all_map_rids.resize(map_count);
|
||||
for (uint32_t i = 0; i < map_count; i++) {
|
||||
all_map_rids[i] = maps_owned[i];
|
||||
}
|
||||
}
|
||||
return all_map_rids;
|
||||
|
||||
@ -1415,9 +1415,7 @@ bool OpenXRAPI::on_state_synchronized() {
|
||||
print_verbose("On state synchronized");
|
||||
|
||||
// Just in case, see if we already have active trackers...
|
||||
List<RID> trackers;
|
||||
tracker_owner.get_owned_list(&trackers);
|
||||
for (const RID &tracker : trackers) {
|
||||
for (const RID &tracker : tracker_owner.get_owned_list()) {
|
||||
tracker_check_profile(tracker);
|
||||
}
|
||||
|
||||
@ -2066,9 +2064,7 @@ bool OpenXRAPI::poll_events() {
|
||||
|
||||
XrEventDataInteractionProfileChanged *event = (XrEventDataInteractionProfileChanged *)&runtimeEvent;
|
||||
|
||||
List<RID> trackers;
|
||||
tracker_owner.get_owned_list(&trackers);
|
||||
for (const RID &tracker : trackers) {
|
||||
for (const RID &tracker : tracker_owner.get_owned_list()) {
|
||||
tracker_check_profile(tracker, event->session);
|
||||
}
|
||||
|
||||
@ -2897,12 +2893,10 @@ XrPath OpenXRAPI::get_xr_path(const String &p_path) {
|
||||
}
|
||||
|
||||
RID OpenXRAPI::get_tracker_rid(XrPath p_path) {
|
||||
List<RID> current;
|
||||
tracker_owner.get_owned_list(¤t);
|
||||
for (const RID &E : current) {
|
||||
Tracker *tracker = tracker_owner.get_or_null(E);
|
||||
for (const RID &tracker_rid : tracker_owner.get_owned_list()) {
|
||||
Tracker *tracker = tracker_owner.get_or_null(tracker_rid);
|
||||
if (tracker && tracker->toplevel_path == p_path) {
|
||||
return E;
|
||||
return tracker_rid;
|
||||
}
|
||||
}
|
||||
|
||||
@ -2910,12 +2904,10 @@ RID OpenXRAPI::get_tracker_rid(XrPath p_path) {
|
||||
}
|
||||
|
||||
RID OpenXRAPI::find_tracker(const String &p_name) {
|
||||
List<RID> current;
|
||||
tracker_owner.get_owned_list(¤t);
|
||||
for (const RID &E : current) {
|
||||
Tracker *tracker = tracker_owner.get_or_null(E);
|
||||
for (const RID &tracker_rid : tracker_owner.get_owned_list()) {
|
||||
Tracker *tracker = tracker_owner.get_or_null(tracker_rid);
|
||||
if (tracker && tracker->name == p_name) {
|
||||
return E;
|
||||
return tracker_rid;
|
||||
}
|
||||
}
|
||||
|
||||
@ -3023,12 +3015,10 @@ RID OpenXRAPI::action_set_create(const String p_name, const String p_localized_n
|
||||
}
|
||||
|
||||
RID OpenXRAPI::find_action_set(const String p_name) {
|
||||
List<RID> current;
|
||||
action_set_owner.get_owned_list(¤t);
|
||||
for (const RID &E : current) {
|
||||
ActionSet *action_set = action_set_owner.get_or_null(E);
|
||||
for (const RID &action_set_rid : action_set_owner.get_owned_list()) {
|
||||
ActionSet *action_set = action_set_owner.get_or_null(action_set_rid);
|
||||
if (action_set && action_set->name == p_name) {
|
||||
return E;
|
||||
return action_set_rid;
|
||||
}
|
||||
}
|
||||
|
||||
@ -3127,12 +3117,10 @@ void OpenXRAPI::action_set_free(RID p_action_set) {
|
||||
}
|
||||
|
||||
RID OpenXRAPI::get_action_rid(XrAction p_action) {
|
||||
List<RID> current;
|
||||
action_owner.get_owned_list(¤t);
|
||||
for (const RID &E : current) {
|
||||
Action *action = action_owner.get_or_null(E);
|
||||
for (const RID &action_rid : action_owner.get_owned_list()) {
|
||||
Action *action = action_owner.get_or_null(action_rid);
|
||||
if (action && action->handle == p_action) {
|
||||
return E;
|
||||
return action_rid;
|
||||
}
|
||||
}
|
||||
|
||||
@ -3140,12 +3128,10 @@ RID OpenXRAPI::get_action_rid(XrAction p_action) {
|
||||
}
|
||||
|
||||
RID OpenXRAPI::find_action(const String &p_name, const RID &p_action_set) {
|
||||
List<RID> current;
|
||||
action_owner.get_owned_list(¤t);
|
||||
for (const RID &E : current) {
|
||||
Action *action = action_owner.get_or_null(E);
|
||||
for (const RID &action_rid : action_owner.get_owned_list()) {
|
||||
Action *action = action_owner.get_or_null(action_rid);
|
||||
if (action && action->name == p_name && (p_action_set.is_null() || action->action_set_rid == p_action_set)) {
|
||||
return E;
|
||||
return action_rid;
|
||||
}
|
||||
}
|
||||
|
||||
@ -3257,12 +3243,10 @@ void OpenXRAPI::action_free(RID p_action) {
|
||||
}
|
||||
|
||||
RID OpenXRAPI::get_interaction_profile_rid(XrPath p_path) {
|
||||
List<RID> current;
|
||||
interaction_profile_owner.get_owned_list(¤t);
|
||||
for (const RID &E : current) {
|
||||
InteractionProfile *ip = interaction_profile_owner.get_or_null(E);
|
||||
for (const RID &ip_rid : interaction_profile_owner.get_owned_list()) {
|
||||
InteractionProfile *ip = interaction_profile_owner.get_or_null(ip_rid);
|
||||
if (ip && ip->path == p_path) {
|
||||
return E;
|
||||
return ip_rid;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user