summaryrefslogtreecommitdiff
path: root/modules/gridmap
diff options
context:
space:
mode:
authorHein-Pieter van Braam <hp@tmm.cx>2018-07-26 01:26:46 +0200
committerGitHub <noreply@github.com>2018-07-26 01:26:46 +0200
commit832e2bfcd38965a01a9149d509169dd197e42f58 (patch)
tree18b7ff35f1eeee39031a16e9c1d834ebf03d44cf /modules/gridmap
parent9423f23ffb80c946dec380f73f3f313ec44d0d18 (diff)
parent0e29f7974b59e4440cf02e1388fb9d8ab2b5c5fd (diff)
Merge pull request #20137 from hpvb/reduce-vector-cow
Reduce unnecessary COW on Vector by make writing explicit
Diffstat (limited to 'modules/gridmap')
-rw-r--r--modules/gridmap/grid_map.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/modules/gridmap/grid_map.cpp b/modules/gridmap/grid_map.cpp
index 234a59e516..0c5df57d49 100644
--- a/modules/gridmap/grid_map.cpp
+++ b/modules/gridmap/grid_map.cpp
@@ -508,7 +508,7 @@ bool GridMap::_octant_update(const OctantKey &p_key) {
continue;
PhysicsServer::get_singleton()->body_add_shape(g.static_body, shapes[i].shape->get_rid(), xform * shapes[i].local_transform);
if (g.collision_debug.is_valid()) {
- shapes[i].shape->add_vertices_to_array(col_debug, xform * shapes[i].local_transform);
+ shapes.write[i].shape->add_vertices_to_array(col_debug, xform * shapes[i].local_transform);
}
//print_line("PHIS x: "+xform);
@@ -758,7 +758,7 @@ void GridMap::_update_visibility() {
for (Map<OctantKey, Octant *>::Element *e = octant_map.front(); e; e = e->next()) {
Octant *octant = e->value();
for (int i = 0; i < octant->multimesh_instances.size(); i++) {
- Octant::MultimeshInstance &mi = octant->multimesh_instances[i];
+ const Octant::MultimeshInstance &mi = octant->multimesh_instances[i];
VS::get_singleton()->instance_set_visible(mi.instance, is_visible());
}
}