Rename server "free" functions to "free_rid" to match exposed API

This commit is contained in:
Aaron Franke
2025-06-05 00:49:35 -07:00
parent 4d231b5bf8
commit 9fbf5808a0
158 changed files with 724 additions and 696 deletions

View File

@ -618,11 +618,11 @@ bool GridMap::_octant_update(const OctantKey &p_key) {
//erase navigation
for (KeyValue<IndexKey, Octant::NavigationCell> &E : g.navigation_cell_ids) {
if (E.value.region.is_valid()) {
NavigationServer3D::get_singleton()->free(E.value.region);
NavigationServer3D::get_singleton()->free_rid(E.value.region);
E.value.region = RID();
}
if (E.value.navigation_mesh_debug_instance.is_valid()) {
RS::get_singleton()->free(E.value.navigation_mesh_debug_instance);
RS::get_singleton()->free_rid(E.value.navigation_mesh_debug_instance);
E.value.navigation_mesh_debug_instance = RID();
}
}
@ -632,8 +632,8 @@ bool GridMap::_octant_update(const OctantKey &p_key) {
//erase multimeshes
for (int i = 0; i < g.multimesh_instances.size(); i++) {
RS::get_singleton()->free(g.multimesh_instances[i].instance);
RS::get_singleton()->free(g.multimesh_instances[i].multimesh);
RS::get_singleton()->free_rid(g.multimesh_instances[i].instance);
RS::get_singleton()->free_rid(g.multimesh_instances[i].multimesh);
}
g.multimesh_instances.clear();
@ -945,11 +945,11 @@ void GridMap::_octant_exit_world(const OctantKey &p_key) {
#ifndef NAVIGATION_3D_DISABLED
for (KeyValue<IndexKey, Octant::NavigationCell> &F : g.navigation_cell_ids) {
if (F.value.region.is_valid()) {
NavigationServer3D::get_singleton()->free(F.value.region);
NavigationServer3D::get_singleton()->free_rid(F.value.region);
F.value.region = RID();
}
if (F.value.navigation_mesh_debug_instance.is_valid()) {
RS::get_singleton()->free(F.value.navigation_mesh_debug_instance);
RS::get_singleton()->free_rid(F.value.navigation_mesh_debug_instance);
F.value.navigation_mesh_debug_instance = RID();
}
}
@ -958,7 +958,7 @@ void GridMap::_octant_exit_world(const OctantKey &p_key) {
#ifdef DEBUG_ENABLED
if (bake_navigation) {
if (g.navigation_debug_edge_connections_instance.is_valid()) {
RenderingServer::get_singleton()->free(g.navigation_debug_edge_connections_instance);
RenderingServer::get_singleton()->free_rid(g.navigation_debug_edge_connections_instance);
g.navigation_debug_edge_connections_instance = RID();
}
if (g.navigation_debug_edge_connections_mesh.is_valid()) {
@ -982,23 +982,23 @@ void GridMap::_octant_clean_up(const OctantKey &p_key) {
#ifndef PHYSICS_3D_DISABLED
if (g.collision_debug.is_valid()) {
RS::get_singleton()->free(g.collision_debug);
RS::get_singleton()->free_rid(g.collision_debug);
}
if (g.collision_debug_instance.is_valid()) {
RS::get_singleton()->free(g.collision_debug_instance);
RS::get_singleton()->free_rid(g.collision_debug_instance);
}
PhysicsServer3D::get_singleton()->free(g.static_body);
PhysicsServer3D::get_singleton()->free_rid(g.static_body);
#endif // PHYSICS_3D_DISABLED
#ifndef NAVIGATION_3D_DISABLED
// Erase navigation
for (const KeyValue<IndexKey, Octant::NavigationCell> &E : g.navigation_cell_ids) {
if (E.value.region.is_valid()) {
NavigationServer3D::get_singleton()->free(E.value.region);
NavigationServer3D::get_singleton()->free_rid(E.value.region);
}
if (E.value.navigation_mesh_debug_instance.is_valid()) {
RS::get_singleton()->free(E.value.navigation_mesh_debug_instance);
RS::get_singleton()->free_rid(E.value.navigation_mesh_debug_instance);
}
}
g.navigation_cell_ids.clear();
@ -1007,7 +1007,7 @@ void GridMap::_octant_clean_up(const OctantKey &p_key) {
#ifdef DEBUG_ENABLED
if (bake_navigation) {
if (g.navigation_debug_edge_connections_instance.is_valid()) {
RenderingServer::get_singleton()->free(g.navigation_debug_edge_connections_instance);
RenderingServer::get_singleton()->free_rid(g.navigation_debug_edge_connections_instance);
g.navigation_debug_edge_connections_instance = RID();
}
if (g.navigation_debug_edge_connections_mesh.is_valid()) {
@ -1019,8 +1019,8 @@ void GridMap::_octant_clean_up(const OctantKey &p_key) {
//erase multimeshes
for (int i = 0; i < g.multimesh_instances.size(); i++) {
RS::get_singleton()->free(g.multimesh_instances[i].instance);
RS::get_singleton()->free(g.multimesh_instances[i].multimesh);
RS::get_singleton()->free_rid(g.multimesh_instances[i].instance);
RS::get_singleton()->free_rid(g.multimesh_instances[i].multimesh);
}
g.multimesh_instances.clear();
}
@ -1349,7 +1349,7 @@ Vector3 GridMap::_get_offset() const {
void GridMap::clear_baked_meshes() {
ERR_FAIL_NULL(RenderingServer::get_singleton());
for (int i = 0; i < baked_meshes.size(); i++) {
RS::get_singleton()->free(baked_meshes[i].instance);
RS::get_singleton()->free_rid(baked_meshes[i].instance);
}
baked_meshes.clear();