diff options
author | RĂ©mi Verschelde <rverschelde@gmail.com> | 2019-01-27 21:32:26 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-01-27 21:32:26 +0100 |
commit | d0f289b0d91297c5a1094cc4f6fa98186fbfb804 (patch) | |
tree | 116fa991c278e6012bb23feb0ef9df997cd74ec1 /servers/visual/visual_server_scene.cpp | |
parent | 45a400d90e4013dc4772616e294def4ab88c71f2 (diff) | |
parent | 3e4dab538656c0fb71ac0e2535a1e51c2b9ebe06 (diff) |
Merge pull request #25314 from marxin/fix-24417-class-memaccess
Fix class memaccess
Diffstat (limited to 'servers/visual/visual_server_scene.cpp')
-rw-r--r-- | servers/visual/visual_server_scene.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/servers/visual/visual_server_scene.cpp b/servers/visual/visual_server_scene.cpp index d2046241f0..c8d64fca45 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() { @@ -1253,7 +1254,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); |