summaryrefslogtreecommitdiff
path: root/servers/visual
diff options
context:
space:
mode:
authormarxin <mliska@suse.cz>2019-01-25 12:06:44 +0100
committermarxin <mliska@suse.cz>2019-01-25 12:41:55 +0100
commit3e4dab538656c0fb71ac0e2535a1e51c2b9ebe06 (patch)
tree280d44bb2728dbed878119cccacf62d876a7d45e /servers/visual
parent32713e60ab2c6ae1056e058b9d3a2cacca741595 (diff)
Use placement new in visual_server_scene.cpp (#24417).
Diffstat (limited to 'servers/visual')
-rw-r--r--servers/visual/visual_server_scene.cpp5
1 files changed, 4 insertions, 1 deletions
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 <new>
/* 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<Instance *>::Element *E = geom->lightmap_captures.front(); E; E = E->next()) {
const PoolVector<RasterizerStorage::LightmapCaptureOctree> *octree = VSG::storage->lightmap_capture_get_octree_ptr(E->get()->base);