From 3e4dab538656c0fb71ac0e2535a1e51c2b9ebe06 Mon Sep 17 00:00:00 2001 From: marxin Date: Fri, 25 Jan 2019 12:06:44 +0100 Subject: Use placement new in visual_server_scene.cpp (#24417). --- servers/visual/visual_server_scene.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'servers/visual') diff --git a/servers/visual/visual_server_scene.cpp b/servers/visual/visual_server_scene.cpp index 23ad2ec1ec..4c8b9e03fd 100644 --- a/servers/visual/visual_server_scene.cpp +++ b/servers/visual/visual_server_scene.cpp @@ -32,6 +32,7 @@ #include "core/os/os.h" #include "visual_server_global.h" #include "visual_server_raster.h" +#include /* CAMERA API */ RID VisualServerScene::camera_create() { @@ -1240,7 +1241,9 @@ void VisualServerScene::_update_instance_lightmap_captures(Instance *p_instance) //print_line("update captures for pos: " + p_instance->transform.origin); - zeromem(p_instance->lightmap_capture_data.ptrw(), 12 * sizeof(Color)); + for (int i = 0; i < 12; i++) + new (&p_instance->lightmap_capture_data.ptrw()[i]) Color; + //this could use some sort of blending.. for (List::Element *E = geom->lightmap_captures.front(); E; E = E->next()) { const PoolVector *octree = VSG::storage->lightmap_capture_get_octree_ptr(E->get()->base); -- cgit v1.2.3