summaryrefslogtreecommitdiff
path: root/scene
diff options
context:
space:
mode:
authorHein-Pieter van Braam <hp@tmm.cx>2019-01-30 02:12:41 +0100
committerHein-Pieter van Braam <hp@tmm.cx>2019-01-30 06:43:56 +0100
commitd308eb091a6c6d73442a118d7069e855ec2b1c6d (patch)
treef5c0a90604b707a9149446abc9dc3126b7621af5 /scene
parent35bb52011a4cbcd8ca3779ab1761244f06a33127 (diff)
Fix many asan and ubsan reported issues
This allows most demos to run without any ubsan or asan errors. There are still some things in thirdpart/ and some things in AudioServer that needs a look but this fixes a lot of issues. This should help debug less obvious issues, hopefully. This fixes #25217 and fixes #25218
Diffstat (limited to 'scene')
-rw-r--r--scene/animation/animation_player.h43
-rw-r--r--scene/animation/animation_tree_player.h8
-rw-r--r--scene/resources/environment.cpp9
3 files changed, 40 insertions, 20 deletions
diff --git a/scene/animation/animation_player.h b/scene/animation/animation_player.h
index 175072edcf..9bba848298 100644
--- a/scene/animation/animation_player.h
+++ b/scene/animation/animation_player.h
@@ -114,10 +114,12 @@ private:
Variant value_accum;
uint64_t accum_pass;
Variant capture;
- PropertyAnim() {
- accum_pass = 0;
- object = NULL;
- }
+
+ PropertyAnim() :
+ owner(NULL),
+ special(SP_NONE),
+ object(NULL),
+ accum_pass(0) {}
};
Map<StringName, PropertyAnim> property_anim;
@@ -129,25 +131,28 @@ private:
float bezier_accum;
Object *object;
uint64_t accum_pass;
- BezierAnim() {
- accum_pass = 0;
- bezier_accum = 0;
- object = NULL;
- }
+
+ BezierAnim() :
+ owner(NULL),
+ bezier_accum(0.0),
+ object(NULL),
+ accum_pass(0) {}
};
Map<StringName, BezierAnim> bezier_anim;
- TrackNodeCache() {
- skeleton = NULL;
- spatial = NULL;
- node = NULL;
- accum_pass = 0;
- bone_idx = -1;
- node_2d = NULL;
- audio_playing = false;
- animation_playing = false;
- }
+ TrackNodeCache() :
+ id(0),
+ node(NULL),
+ spatial(NULL),
+ node_2d(NULL),
+ skeleton(NULL),
+ bone_idx(-1),
+ accum_pass(0),
+ audio_playing(false),
+ audio_start(0.0),
+ audio_len(0.0),
+ animation_playing(false) {}
};
struct TrackNodeCacheKey {
diff --git a/scene/animation/animation_tree_player.h b/scene/animation/animation_tree_player.h
index 12e514f7d5..9ec6325969 100644
--- a/scene/animation/animation_tree_player.h
+++ b/scene/animation/animation_tree_player.h
@@ -109,6 +109,14 @@ private:
Variant value;
bool skip;
+
+ Track() :
+ id(0),
+ object(NULL),
+ spatial(NULL),
+ skeleton(NULL),
+ bone_idx(-1),
+ skip(false) {}
};
typedef Map<TrackKey, Track> TrackMap;
diff --git a/scene/resources/environment.cpp b/scene/resources/environment.cpp
index a57b7bbb42..d09ac0ee6c 100644
--- a/scene/resources/environment.cpp
+++ b/scene/resources/environment.cpp
@@ -1291,7 +1291,14 @@ void Environment::_bind_methods() {
BIND_ENUM_CONSTANT(SSAO_QUALITY_HIGH);
}
-Environment::Environment() {
+Environment::Environment() :
+ bg_mode(BG_CLEAR_COLOR),
+ tone_mapper(TONE_MAPPER_LINEAR),
+ ssao_blur(SSAO_BLUR_DISABLED),
+ ssao_quality(SSAO_QUALITY_LOW),
+ glow_blend_mode(GLOW_BLEND_MODE_ADDITIVE),
+ dof_blur_far_quality(DOF_BLUR_QUALITY_LOW),
+ dof_blur_near_quality(DOF_BLUR_QUALITY_LOW) {
environment = VS::get_singleton()->environment_create();