From 3c0360fd2ff7596ea1302388c6adf4eed07bb564 Mon Sep 17 00:00:00 2001 From: AzaezelX Date: Mon, 11 May 2020 13:54:23 -0500 Subject: [PATCH 01/25] uninitialized variables-afx --- Engine/source/T3D/fx/lightning.cpp | 8 ++++++++ Engine/source/afx/afxCamera.h | 2 -- Engine/source/afx/afxConstraint.cpp | 6 ++++++ Engine/source/afx/afxEffectVector.cpp | 1 + Engine/source/afx/afxEffectWrapper.h | 2 -- Engine/source/afx/afxMagicMissile.cpp | 5 +++-- .../source/afx/afxZodiacGroundPlaneRenderer_T3D.cpp | 8 ++++++++ Engine/source/afx/afxZodiacMeshRoadRenderer_T3D.cpp | 8 ++++++++ Engine/source/afx/afxZodiacPolysoupRenderer_T3D.cpp | 8 ++++++++ Engine/source/afx/afxZodiacTerrainRenderer_T3D.cpp | 8 ++++++++ Engine/source/afx/ce/afxModel.cpp | 7 ++++++- Engine/source/afx/ce/afxMooring.cpp | 4 +++- Engine/source/afx/ce/afxParticleEmitter.cpp | 5 +++++ Engine/source/afx/ce/afxStaticShape.cpp | 3 ++- Engine/source/afx/ce/afxZodiac.cpp | 1 + Engine/source/afx/ce/afxZodiacPlane.cpp | 4 ++-- Engine/source/afx/ea/afxEA_PhraseEffect.cpp | 1 + Engine/source/afx/forces/afxF_Drag.cpp | 13 +++++++------ Engine/source/afx/forces/afxF_Gravity.cpp | 9 +++++---- Engine/source/afx/util/afxAnimCurve.cpp | 4 +++- Engine/source/afx/util/afxCurve3D.cpp | 4 ++-- Engine/source/afx/util/afxPath3D.cpp | 2 +- 22 files changed, 88 insertions(+), 25 deletions(-) diff --git a/Engine/source/T3D/fx/lightning.cpp b/Engine/source/T3D/fx/lightning.cpp index c951f022e..3aef6acf4 100644 --- a/Engine/source/T3D/fx/lightning.cpp +++ b/Engine/source/T3D/fx/lightning.cpp @@ -1033,6 +1033,14 @@ LightningBolt::LightningBolt() elapsedTime = 0.0f; lifetime = 1.0f; startRender = false; + endPoint.zero(); + width = 1; + numMajorNodes = 10; + maxMajorAngle = 30.0f; + numMinorNodes = 4; + maxMinorAngle = 15.0f; + fadeTime = 0.2f; + renderTime = 0.125; } //-------------------------------------------------------------------------- diff --git a/Engine/source/afx/afxCamera.h b/Engine/source/afx/afxCamera.h index 957f182f6..e04afaa13 100644 --- a/Engine/source/afx/afxCamera.h +++ b/Engine/source/afx/afxCamera.h @@ -147,8 +147,6 @@ public: DECLARE_CATEGORY("AFX"); private: // 3POV SECTION - U32 mBlockers_mask_3pov; - void cam_update_3pov(F32 dt, bool on_server); bool avoid_blocked_view(const Point3F& start, const Point3F& end, Point3F& newpos); bool test_blocked_line(const Point3F& start, const Point3F& end); diff --git a/Engine/source/afx/afxConstraint.cpp b/Engine/source/afx/afxConstraint.cpp index a739148f5..e2d4e0321 100644 --- a/Engine/source/afx/afxConstraint.cpp +++ b/Engine/source/afx/afxConstraint.cpp @@ -1904,6 +1904,9 @@ afxEffectConstraint::afxEffectConstraint(afxConstraintMgr* mgr) { mEffect_name = ST_NULLSTRING; mEffect = 0; + mClip_tag = 0; + mIs_death_clip = false; + mLock_tag = 0; } afxEffectConstraint::afxEffectConstraint(afxConstraintMgr* mgr, StringTableEntry effect_name) @@ -1911,6 +1914,9 @@ afxEffectConstraint::afxEffectConstraint(afxConstraintMgr* mgr, StringTableEntry { mEffect_name = effect_name; mEffect = 0; + mClip_tag = 0; + mIs_death_clip = false; + mLock_tag = 0; } afxEffectConstraint::~afxEffectConstraint() diff --git a/Engine/source/afx/afxEffectVector.cpp b/Engine/source/afx/afxEffectVector.cpp index 5de0a5e40..a364a2688 100644 --- a/Engine/source/afx/afxEffectVector.cpp +++ b/Engine/source/afx/afxEffectVector.cpp @@ -98,6 +98,7 @@ afxEffectVector::afxEffectVector() mOn_server = false; mTotal_fx_dur = 0; mAfter_life = 0; + mPhrase_dur = 0; } afxEffectVector::~afxEffectVector() diff --git a/Engine/source/afx/afxEffectWrapper.h b/Engine/source/afx/afxEffectWrapper.h index 79459f76f..37a0e9fcb 100644 --- a/Engine/source/afx/afxEffectWrapper.h +++ b/Engine/source/afx/afxEffectWrapper.h @@ -298,8 +298,6 @@ protected: bool mIn_scope; bool mIs_aborted; - U8 mEffect_flags; - afxXM_Base* mXfm_modifiers[MAX_XFM_MODIFIERS]; F32 mLive_scale_factor; diff --git a/Engine/source/afx/afxMagicMissile.cpp b/Engine/source/afx/afxMagicMissile.cpp index 87d919510..2c4d9e64d 100644 --- a/Engine/source/afx/afxMagicMissile.cpp +++ b/Engine/source/afx/afxMagicMissile.cpp @@ -168,13 +168,14 @@ afxMagicMissileData::afxMagicMissileData() impactForce = 0.0f; armingDelay = 0; - fadeDelay = 20000 / 32; - lifetime = 20000 / 32; activateSeq = -1; maintainSeq = -1; */ + lifetime = 20000 / 32; + fadeDelay = 20000 / 32; + gravityMod = 1.0; /* From stock Projectile code... bounceElasticity = 0.999f; diff --git a/Engine/source/afx/afxZodiacGroundPlaneRenderer_T3D.cpp b/Engine/source/afx/afxZodiacGroundPlaneRenderer_T3D.cpp index 442751a1f..0e1ad2a71 100644 --- a/Engine/source/afx/afxZodiacGroundPlaneRenderer_T3D.cpp +++ b/Engine/source/afx/afxZodiacGroundPlaneRenderer_T3D.cpp @@ -58,6 +58,10 @@ afxZodiacGroundPlaneRenderer::afxZodiacGroundPlaneRenderer() if (!master) master = this; shader_initialized = false; + zodiac_shader = NULL; + shader_consts = NULL; + projection_sc = NULL; + color_sc = NULL; } afxZodiacGroundPlaneRenderer::afxZodiacGroundPlaneRenderer(F32 renderOrder, F32 processAddOrder) @@ -66,6 +70,10 @@ afxZodiacGroundPlaneRenderer::afxZodiacGroundPlaneRenderer(F32 renderOrder, F32 if (!master) master = this; shader_initialized = false; + zodiac_shader = NULL; + shader_consts = NULL; + projection_sc = NULL; + color_sc = NULL; } afxZodiacGroundPlaneRenderer::~afxZodiacGroundPlaneRenderer() diff --git a/Engine/source/afx/afxZodiacMeshRoadRenderer_T3D.cpp b/Engine/source/afx/afxZodiacMeshRoadRenderer_T3D.cpp index cafb3dca7..30af55b02 100644 --- a/Engine/source/afx/afxZodiacMeshRoadRenderer_T3D.cpp +++ b/Engine/source/afx/afxZodiacMeshRoadRenderer_T3D.cpp @@ -58,6 +58,10 @@ afxZodiacMeshRoadRenderer::afxZodiacMeshRoadRenderer() if (!master) master = this; shader_initialized = false; + zodiac_shader = NULL; + shader_consts = NULL; + projection_sc = NULL; + color_sc = NULL; } afxZodiacMeshRoadRenderer::afxZodiacMeshRoadRenderer(F32 renderOrder, F32 processAddOrder) @@ -66,6 +70,10 @@ afxZodiacMeshRoadRenderer::afxZodiacMeshRoadRenderer(F32 renderOrder, F32 proces if (!master) master = this; shader_initialized = false; + zodiac_shader = NULL; + shader_consts = NULL; + projection_sc = NULL; + color_sc = NULL; } afxZodiacMeshRoadRenderer::~afxZodiacMeshRoadRenderer() diff --git a/Engine/source/afx/afxZodiacPolysoupRenderer_T3D.cpp b/Engine/source/afx/afxZodiacPolysoupRenderer_T3D.cpp index 84d55a092..63e17b12e 100644 --- a/Engine/source/afx/afxZodiacPolysoupRenderer_T3D.cpp +++ b/Engine/source/afx/afxZodiacPolysoupRenderer_T3D.cpp @@ -58,6 +58,10 @@ afxZodiacPolysoupRenderer::afxZodiacPolysoupRenderer() if (!master) master = this; shader_initialized = false; + zodiac_shader = NULL; + shader_consts = NULL; + projection_sc = NULL; + color_sc = NULL; } afxZodiacPolysoupRenderer::afxZodiacPolysoupRenderer(F32 renderOrder, F32 processAddOrder) @@ -66,6 +70,10 @@ afxZodiacPolysoupRenderer::afxZodiacPolysoupRenderer(F32 renderOrder, F32 proces if (!master) master = this; shader_initialized = false; + zodiac_shader = NULL; + shader_consts = NULL; + projection_sc = NULL; + color_sc = NULL; } afxZodiacPolysoupRenderer::~afxZodiacPolysoupRenderer() diff --git a/Engine/source/afx/afxZodiacTerrainRenderer_T3D.cpp b/Engine/source/afx/afxZodiacTerrainRenderer_T3D.cpp index 651a0fad0..aafc17020 100644 --- a/Engine/source/afx/afxZodiacTerrainRenderer_T3D.cpp +++ b/Engine/source/afx/afxZodiacTerrainRenderer_T3D.cpp @@ -68,6 +68,10 @@ afxZodiacTerrainRenderer::afxZodiacTerrainRenderer() if (!master) master = this; shader_initialized = false; + zodiac_shader = NULL; + shader_consts = NULL; + projection_sc = NULL; + color_sc = NULL; } afxZodiacTerrainRenderer::afxZodiacTerrainRenderer(F32 renderOrder, F32 processAddOrder) @@ -76,6 +80,10 @@ afxZodiacTerrainRenderer::afxZodiacTerrainRenderer(F32 renderOrder, F32 processA if (!master) master = this; shader_initialized = false; + zodiac_shader = NULL; + shader_consts = NULL; + projection_sc = NULL; + color_sc = NULL; } afxZodiacTerrainRenderer::~afxZodiacTerrainRenderer() diff --git a/Engine/source/afx/ce/afxModel.cpp b/Engine/source/afx/ce/afxModel.cpp index 6962aea51..95a190deb 100644 --- a/Engine/source/afx/ce/afxModel.cpp +++ b/Engine/source/afx/ce/afxModel.cpp @@ -105,6 +105,11 @@ afxModelData::afxModelData(const afxModelData& other, bool temp_clone) : GameBas customAmbientForSelfIllumination = other.customAmbientForSelfIllumination; customAmbientLighting = other.customAmbientLighting; shadowEnable = other.shadowEnable; + + shadowSize = other.shadowSize; + shadowMaxVisibleDistance = other.shadowMaxVisibleDistance; + shadowProjectionDistance = other.shadowProjectionDistance; + shadowSphereAdjust = other.shadowSphereAdjust; } afxModelData::~afxModelData() @@ -360,7 +365,7 @@ afxModel::afxModel() fade_amt = 1.0f; is_visible = true; sort_priority = 0; - + mDataBlock = NULL; mNetFlags.set( IsGhost ); } diff --git a/Engine/source/afx/ce/afxMooring.cpp b/Engine/source/afx/ce/afxMooring.cpp index b9cda9ec7..9adf47526 100644 --- a/Engine/source/afx/ce/afxMooring.cpp +++ b/Engine/source/afx/ce/afxMooring.cpp @@ -133,6 +133,7 @@ afxMooring::afxMooring() chor_id = 0; hookup_with_chor = false; ghost_cons_name = ST_NULLSTRING; + mDataBlock = NULL; } afxMooring::afxMooring(U32 networking, U32 chor_id, StringTableEntry cons_name) @@ -160,6 +161,7 @@ afxMooring::afxMooring(U32 networking, U32 chor_id, StringTableEntry cons_name) this->chor_id = chor_id; hookup_with_chor = false; this->ghost_cons_name = cons_name; + mDataBlock = NULL; } afxMooring::~afxMooring() @@ -275,4 +277,4 @@ void afxMooring::onRemove() Parent::onRemove(); } -//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~~// \ No newline at end of file +//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~~// diff --git a/Engine/source/afx/ce/afxParticleEmitter.cpp b/Engine/source/afx/ce/afxParticleEmitter.cpp index 1d76b2475..c34bd5510 100644 --- a/Engine/source/afx/ce/afxParticleEmitter.cpp +++ b/Engine/source/afx/ce/afxParticleEmitter.cpp @@ -687,6 +687,7 @@ bool afxParticleEmitterDiscData::preload(bool server, String &errorStr) afxParticleEmitter::afxParticleEmitter() { + mDataBlock = NULL; pe_vector.set(0,0,1); pe_vector_norm.set(0,0,1); tpaths.clear(); @@ -1086,6 +1087,7 @@ void afxParticleEmitter::emitParticlesExt(const MatrixF& xfm, const Point3F& poi afxParticleEmitterVector::afxParticleEmitterVector() { + mDataBlock = NULL; } afxParticleEmitterVector::~afxParticleEmitterVector() @@ -1151,6 +1153,7 @@ void afxParticleEmitterVector::sub_preCompute(const MatrixF& mat) afxParticleEmitterCone::afxParticleEmitterCone() { + mDataBlock = NULL; cone_v.set(0,0,1); cone_s0.set(0,0,1); cone_s1.set(0,0,1); @@ -1266,6 +1269,7 @@ void afxParticleEmitterCone::sub_preCompute(const MatrixF& mat) afxParticleEmitterPath::afxParticleEmitterPath() { + mDataBlock = NULL; epaths.clear(); epath_mults.clear(); n_epath_points = 0; @@ -1521,6 +1525,7 @@ void afxParticleEmitterPath::groundConformPoint(Point3F& point, const MatrixF& m afxParticleEmitterDisc::afxParticleEmitterDisc() { + mDataBlock = NULL; disc_v.set(0,0,1); disc_r.set(1,0,0); } diff --git a/Engine/source/afx/ce/afxStaticShape.cpp b/Engine/source/afx/ce/afxStaticShape.cpp index 4bef19629..ffe731b55 100644 --- a/Engine/source/afx/ce/afxStaticShape.cpp +++ b/Engine/source/afx/ce/afxStaticShape.cpp @@ -122,6 +122,7 @@ ConsoleDocClass( afxStaticShape, afxStaticShape::afxStaticShape() { + mDataBlock = NULL; mAFX_data = 0; mIs_visible = true; mChor_id = 0; @@ -238,4 +239,4 @@ void afxStaticShape::prepRenderImage(SceneRenderState* state) Parent::prepRenderImage(state); } -//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~~// \ No newline at end of file +//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~~// diff --git a/Engine/source/afx/ce/afxZodiac.cpp b/Engine/source/afx/ce/afxZodiac.cpp index 3b1e976d2..62f6996ae 100644 --- a/Engine/source/afx/ce/afxZodiac.cpp +++ b/Engine/source/afx/ce/afxZodiac.cpp @@ -114,6 +114,7 @@ afxZodiacData::afxZodiacData() grade_range_user.set(0.0f, 45.0f); afxZodiacData::convertGradientRangeFromDegrees(grade_range, grade_range_user); inv_grade_range = false; + zflags = 0; } afxZodiacData::afxZodiacData(const afxZodiacData& other, bool temp_clone) : GameBaseData(other, temp_clone) diff --git a/Engine/source/afx/ce/afxZodiacPlane.cpp b/Engine/source/afx/ce/afxZodiacPlane.cpp index 2a4740298..7af581f2f 100644 --- a/Engine/source/afx/ce/afxZodiacPlane.cpp +++ b/Engine/source/afx/ce/afxZodiacPlane.cpp @@ -61,7 +61,7 @@ afxZodiacPlaneData::afxZodiacPlaneData() color.set(1,1,1,1); blend_flags = BLEND_NORMAL; respect_ori_cons = false; - + zflags = 0; double_sided = true; face_dir = FACES_UP; use_full_xfm = false; @@ -310,4 +310,4 @@ void afxZodiacPlane::onRemove() Parent::onRemove(); } -//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~~// \ No newline at end of file +//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~~// diff --git a/Engine/source/afx/ea/afxEA_PhraseEffect.cpp b/Engine/source/afx/ea/afxEA_PhraseEffect.cpp index 1e14d2c6a..84a75ee7e 100644 --- a/Engine/source/afx/ea/afxEA_PhraseEffect.cpp +++ b/Engine/source/afx/ea/afxEA_PhraseEffect.cpp @@ -75,6 +75,7 @@ afxEA_PhraseEffect::afxEA_PhraseEffect() { phrase_fx_data = 0; active_phrases = &_phrases_a; + last_trigger_mask = 0; } afxEA_PhraseEffect::~afxEA_PhraseEffect() diff --git a/Engine/source/afx/forces/afxF_Drag.cpp b/Engine/source/afx/forces/afxF_Drag.cpp index 7fb52deb1..f006fc2ad 100644 --- a/Engine/source/afx/forces/afxF_Drag.cpp +++ b/Engine/source/afx/forces/afxF_Drag.cpp @@ -60,7 +60,7 @@ class afxF_Drag : public afxForce typedef afxForce Parent; private: - afxF_DragData* datablock; + afxF_DragData* mDatablock; F32 air_friction_constant; public: @@ -149,13 +149,14 @@ afxForceData* afxF_DragData::cloneAndPerformSubstitutions(const SimObject* owner afxF_Drag::afxF_Drag() : afxForce() { + mDatablock = NULL; air_friction_constant = 1.0f; } bool afxF_Drag::onNewDataBlock(afxForceData* dptr, bool reload) { - datablock = dynamic_cast(dptr); - if (!datablock || !Parent::onNewDataBlock(dptr, reload)) + mDatablock = dynamic_cast(dptr); + if (!mDatablock || !Parent::onNewDataBlock(dptr, reload)) return false; return true; @@ -163,9 +164,9 @@ bool afxF_Drag::onNewDataBlock(afxForceData* dptr, bool reload) void afxF_Drag::start() { - air_friction_constant = 0.5f * datablock->drag_coefficient - * datablock->air_density - * datablock->cross_sectional_area; + air_friction_constant = 0.5f * mDatablock->drag_coefficient + * mDatablock->air_density + * mDatablock->cross_sectional_area; //Con::printf("Air Friction: %f", air_friction_constant); } diff --git a/Engine/source/afx/forces/afxF_Gravity.cpp b/Engine/source/afx/forces/afxF_Gravity.cpp index fc5ed1d80..cbe9e6ad2 100644 --- a/Engine/source/afx/forces/afxF_Gravity.cpp +++ b/Engine/source/afx/forces/afxF_Gravity.cpp @@ -58,7 +58,7 @@ class afxF_Gravity : public afxForce typedef afxForce Parent; private: - afxF_GravityData* datablock; + afxF_GravityData* mDatablock; public: /*C*/ afxF_Gravity(); @@ -133,12 +133,13 @@ afxForceData* afxF_GravityData::cloneAndPerformSubstitutions(const SimObject* ow afxF_Gravity::afxF_Gravity() : afxForce() { + mDatablock = NULL; } bool afxF_Gravity::onNewDataBlock(afxForceData* dptr, bool reload) { - datablock = dynamic_cast(dptr); - if (!datablock || !Parent::onNewDataBlock(dptr, reload)) + mDatablock = dynamic_cast(dptr); + if (!mDatablock || !Parent::onNewDataBlock(dptr, reload)) return false; return true; @@ -146,7 +147,7 @@ bool afxF_Gravity::onNewDataBlock(afxForceData* dptr, bool reload) Point3F afxF_Gravity::evaluate(Point3F pos, Point3F v, F32 mass) { - return Point3F(0,0,-datablock->gravity)*mass; + return Point3F(0,0,-mDatablock->gravity)*mass; } diff --git a/Engine/source/afx/util/afxAnimCurve.cpp b/Engine/source/afx/util/afxAnimCurve.cpp index 4074c15d7..2343bf9f8 100644 --- a/Engine/source/afx/util/afxAnimCurve.cpp +++ b/Engine/source/afx/util/afxAnimCurve.cpp @@ -29,6 +29,8 @@ afxAnimCurve::afxAnimCurve() : usable( false ), final_value( 0.0f ), start_value( 0.0f ) { evaluator = new afxHermiteEval(); + final_time = 0.0f; + start_time = 0.0f; } afxAnimCurve::~afxAnimCurve() @@ -277,4 +279,4 @@ void afxAnimCurve::printKey( int index ) { Key &k = keys[index]; Con::printf( "%f: %f", k.time, k.value ); -} \ No newline at end of file +} diff --git a/Engine/source/afx/util/afxCurve3D.cpp b/Engine/source/afx/util/afxCurve3D.cpp index 860cb4c4a..798cf71f4 100644 --- a/Engine/source/afx/util/afxCurve3D.cpp +++ b/Engine/source/afx/util/afxCurve3D.cpp @@ -27,7 +27,7 @@ #include "afx/util/afxCurveEval.h" #include "afx/util/afxCurve3D.h" -afxCurve3D::afxCurve3D() : usable( false ), default_vector( 0, 0, 0 ) +afxCurve3D::afxCurve3D() : usable( false ), default_vector( 0, 0, 0 ), flip(false) { evaluator = new afxHermiteEval(); } @@ -329,4 +329,4 @@ void afxCurve3D::print() Con::printf( "%f: %f %f %f", p.parameter, p.point.x, p.point.y, p.point.z ); } Con::printf( "---------------------------------" ); -} \ No newline at end of file +} diff --git a/Engine/source/afx/util/afxPath3D.cpp b/Engine/source/afx/util/afxPath3D.cpp index 5997bdc12..c82717ee0 100644 --- a/Engine/source/afx/util/afxPath3D.cpp +++ b/Engine/source/afx/util/afxPath3D.cpp @@ -29,7 +29,7 @@ #include "afx/util/afxPath3D.h" -afxPath3D::afxPath3D() : mStart_time(0), mNum_points(0), mLoop_type(LOOP_CONSTANT) +afxPath3D::afxPath3D() : mStart_time(0), mNum_points(0), mLoop_type(LOOP_CONSTANT), mEnd_time(0.0f) { } From 1cea8ffacb07b0abb82633e812b2c45d029be4ab Mon Sep 17 00:00:00 2001 From: AzaezelX Date: Mon, 11 May 2020 14:00:35 -0500 Subject: [PATCH 02/25] uninitialized variables-core --- Engine/source/app/net/httpObject.cpp | 20 +++++++++++++++----- Engine/source/app/net/serverQuery.h | 1 + 2 files changed, 16 insertions(+), 5 deletions(-) diff --git a/Engine/source/app/net/httpObject.cpp b/Engine/source/app/net/httpObject.cpp index 6d815ad35..b3d26b6f4 100644 --- a/Engine/source/app/net/httpObject.cpp +++ b/Engine/source/app/net/httpObject.cpp @@ -114,12 +114,22 @@ ConsoleDocClass( HTTPObject, //-------------------------------------- HTTPObject::HTTPObject() + : mParseState(ParsingStatusLine), + mTotalBytes(0), + mBytesRemaining(0), + mStatus(0), + mVersion(0.0f), + mContentLength(0), + mChunkedEncoding(false), + mChunkSize(0), + mContentType(""), + mHostName(NULL), + mPath(NULL), + mQuery(NULL), + mPost(NULL), + mBufferSave(NULL), + mBufferSaveSize(0) { - mHostName = 0; - mPath = 0; - mQuery = 0; - mPost = 0; - mBufferSave = 0; } HTTPObject::~HTTPObject() diff --git a/Engine/source/app/net/serverQuery.h b/Engine/source/app/net/serverQuery.h index bfa5b7381..fcdcaa6c1 100644 --- a/Engine/source/app/net/serverQuery.h +++ b/Engine/source/app/net/serverQuery.h @@ -80,6 +80,7 @@ struct ServerInfo statusString = NULL; infoString = NULL; version = 0; + dMemset(&address, '\0', sizeof(NetAddress)); ping = 0; cpuSpeed = 0; isFavorite = false; From e9415a099496c61eb3c258dc2a580408b6565919 Mon Sep 17 00:00:00 2001 From: AzaezelX Date: Mon, 11 May 2020 14:33:59 -0500 Subject: [PATCH 03/25] uninitialized variables-collision --- Engine/source/T3D/convexShape.cpp | 4 ++-- Engine/source/T3D/tsStatic.cpp | 2 +- Engine/source/collision/boxConvex.cpp | 2 +- Engine/source/collision/clippedPolyList.h | 4 +++- Engine/source/collision/collision.h | 6 +++++- Engine/source/collision/concretePolyList.h | 3 +++ Engine/source/collision/convex.cpp | 17 +++++++++++------ Engine/source/collision/convex.h | 4 ++-- Engine/source/collision/depthSortList.cpp | 7 +++++++ Engine/source/collision/extrudedPolyList.cpp | 1 + Engine/source/collision/extrudedPolyList.h | 7 +++++-- Engine/source/collision/gjk.cpp | 13 +++++++++++++ Engine/source/collision/optimizedPolyList.h | 2 ++ Engine/source/collision/planeExtractor.cpp | 1 + Engine/source/collision/polytope.h | 1 + Engine/source/environment/meshRoad.cpp | 2 +- Engine/source/forest/forestCollision.cpp | 4 ++-- Engine/source/terrain/terrCollision.cpp | 2 +- 18 files changed, 62 insertions(+), 20 deletions(-) diff --git a/Engine/source/T3D/convexShape.cpp b/Engine/source/T3D/convexShape.cpp index 12deb300d..8f73b564d 100644 --- a/Engine/source/T3D/convexShape.cpp +++ b/Engine/source/T3D/convexShape.cpp @@ -92,12 +92,12 @@ void ConvexShapeCollisionConvex::getFeatures( const MatrixF &mat, const VectorF if ( pShape->mGeometry.points.empty() ) { cf->material = 0; - cf->object = NULL; + cf->mObject = NULL; return; } cf->material = 0; - cf->object = mObject; + cf->mObject = mObject; // Simple implementation... Add all Points, Edges and Faces. diff --git a/Engine/source/T3D/tsStatic.cpp b/Engine/source/T3D/tsStatic.cpp index bf7dc6882..51b825c99 100644 --- a/Engine/source/T3D/tsStatic.cpp +++ b/Engine/source/T3D/tsStatic.cpp @@ -1486,7 +1486,7 @@ void TSStaticPolysoupConvex::getPolyList(AbstractPolyList* list) void TSStaticPolysoupConvex::getFeatures(const MatrixF& mat, const VectorF& n, ConvexFeature* cf) { cf->material = 0; - cf->object = mObject; + cf->mObject = mObject; // For a tetrahedron this is pretty easy... first // convert everything into world space. diff --git a/Engine/source/collision/boxConvex.cpp b/Engine/source/collision/boxConvex.cpp index 298fc50bb..2bd80ba44 100644 --- a/Engine/source/collision/boxConvex.cpp +++ b/Engine/source/collision/boxConvex.cpp @@ -85,7 +85,7 @@ inline bool isOnPlane(const Point3F& p,PlaneF& plane) void BoxConvex::getFeatures(const MatrixF& mat,const VectorF& n, ConvexFeature* cf) { cf->material = 0; - cf->object = mObject; + cf->mObject = mObject; S32 v = 0; v += (n.x >= 0)? 1: 0; diff --git a/Engine/source/collision/clippedPolyList.h b/Engine/source/collision/clippedPolyList.h index affce3401..c9ebcc932 100644 --- a/Engine/source/collision/clippedPolyList.h +++ b/Engine/source/collision/clippedPolyList.h @@ -49,7 +49,7 @@ class ClippedPolyList : public AbstractPolyList public: struct Vertex { Point3F point; - U32 mask; + U32 mask = 0; }; struct Poly { @@ -61,6 +61,8 @@ public: U32 vertexCount; U32 surfaceKey; U32 polyFlags; + Poly() :object(NULL), material(NULL), vertexStart(0), vertexCount(0), surfaceKey(0), polyFlags(0) {} + ~Poly() {} }; /// ??? diff --git a/Engine/source/collision/collision.h b/Engine/source/collision/collision.h index 8dec9791c..7495e5f08 100644 --- a/Engine/source/collision/collision.h +++ b/Engine/source/collision/collision.h @@ -65,7 +65,11 @@ struct Collision object( NULL ), material( NULL ), generateTexCoord(false), - texCoord(-1.0f, -1.0f) + texCoord(-1.0f, -1.0f), + face(0), + faceDot(-1.0f), + distance(FLT_MAX) + { } }; diff --git a/Engine/source/collision/concretePolyList.h b/Engine/source/collision/concretePolyList.h index adb23688e..482ff3ee0 100644 --- a/Engine/source/collision/concretePolyList.h +++ b/Engine/source/collision/concretePolyList.h @@ -48,6 +48,9 @@ class ConcretePolyList : public AbstractPolyList Poly() { + vertexStart = 0; + vertexCount = 0; + surfaceKey = 0; object = NULL; material = NULL; } diff --git a/Engine/source/collision/convex.cpp b/Engine/source/collision/convex.cpp index 01583c9f0..b818ffa6d 100644 --- a/Engine/source/collision/convex.cpp +++ b/Engine/source/collision/convex.cpp @@ -52,7 +52,9 @@ F32 sqrDistanceEdges(const Point3F& start0, CollisionState::CollisionState() { - mLista = mListb = 0; + mB = mA = NULL; + mDist = 0.0f; + mListb = mLista = 0; } CollisionState::~CollisionState() @@ -85,7 +87,7 @@ F32 CollisionState::distance(const MatrixF& a2w, const MatrixF& b2w, const F32 d void ConvexFeature::reset() { material = NULL; - object = NULL; + mObject = NULL; mVertexList.clear(); mEdgeList.clear(); mFaceList.clear(); @@ -114,7 +116,7 @@ bool ConvexFeature::collide(ConvexFeature& cf,CollisionList* cList, F32 tol) { Collision &col = (*cList)[cList->getCount() - 1]; col.material = cf.material; - col.object = cf.object; + col.object = cf.mObject; } vert++; } @@ -167,7 +169,7 @@ void ConvexFeature::testVertex(const Point3F& v,CollisionList* cList,bool flip, if (flip) info.normal.neg(); info.material = material; - info.object = object; + info.object = mObject; info.distance = distance; } } @@ -213,7 +215,7 @@ void ConvexFeature::testEdge(ConvexFeature* cf,const Point3F& s1, const Point3F& info.normal = normal; info.distance = distance; info.material = material; - info.object = object; + info.object = mObject; } } @@ -282,6 +284,7 @@ CollisionWorkingList::CollisionWorkingList() { wLink.mPrev = wLink.mNext = this; rLink.mPrev = rLink.mNext = this; + mConvex = NULL; } void CollisionWorkingList::wLinkAfter(CollisionWorkingList* ptr) @@ -340,6 +343,8 @@ Convex::Convex() { mNext = mPrev = this; mTag = 0; + mObject = NULL; + mType = ConvexType::BoxConvexType; } Convex::~Convex() @@ -418,7 +423,7 @@ Point3F Convex::support(const VectorF&) const void Convex::getFeatures(const MatrixF&,const VectorF&,ConvexFeature* f) { - f->object = NULL; + f->mObject = NULL; } const MatrixF& Convex::getTransform() const diff --git a/Engine/source/collision/convex.h b/Engine/source/collision/convex.h index fa6106f83..6ad33b2b5 100644 --- a/Engine/source/collision/convex.h +++ b/Engine/source/collision/convex.h @@ -56,10 +56,10 @@ public: Vector mEdgeList; Vector mFaceList; BaseMatInstance* material; - SceneObject* object; + SceneObject* mObject; ConvexFeature() - : mVertexList(64), mEdgeList(128), mFaceList(64), material( 0 ) + : mVertexList(64), mEdgeList(128), mFaceList(64), material( 0 ), mObject(NULL) { VECTOR_SET_ASSOCIATION(mVertexList); VECTOR_SET_ASSOCIATION(mEdgeList); diff --git a/Engine/source/collision/depthSortList.cpp b/Engine/source/collision/depthSortList.cpp index 2ead81479..7d5e0e337 100644 --- a/Engine/source/collision/depthSortList.cpp +++ b/Engine/source/collision/depthSortList.cpp @@ -46,6 +46,13 @@ S32 gBadSpots = 0; DepthSortList::DepthSortList() { + mBase = 0; + mBasePoly = NULL; + mBaseNormal = NULL; + mBaseDot = 0.0f; + mBaseYMax = 0.0f; + mMaxTouched = 0; + mBaseExtents = NULL; VECTOR_SET_ASSOCIATION(mPolyExtentsList); VECTOR_SET_ASSOCIATION(mPolyIndexList); } diff --git a/Engine/source/collision/extrudedPolyList.cpp b/Engine/source/collision/extrudedPolyList.cpp index 24de5af29..3c2fc0777 100644 --- a/Engine/source/collision/extrudedPolyList.cpp +++ b/Engine/source/collision/extrudedPolyList.cpp @@ -47,6 +47,7 @@ ExtrudedPolyList::ExtrudedPolyList() mPolyPlaneList.reserve(64); mPlaneList.reserve(64); mCollisionList = 0; + dMemset(&mPoly, 0, sizeof(mPoly)); } ExtrudedPolyList::~ExtrudedPolyList() diff --git a/Engine/source/collision/extrudedPolyList.h b/Engine/source/collision/extrudedPolyList.h index a802e3eba..cea6a76ef 100644 --- a/Engine/source/collision/extrudedPolyList.h +++ b/Engine/source/collision/extrudedPolyList.h @@ -56,13 +56,15 @@ class ExtrudedPolyList: public AbstractPolyList public: struct Vertex { Point3F point; - U32 mask; + U32 mask = 0; }; struct Poly { PlaneF plane; SceneObject* object; BaseMatInstance* material; + Poly() : object(NULL), material(NULL) {} + ~Poly() {} }; struct ExtrudedFace { @@ -75,6 +77,8 @@ public: F32 time; Point3F point; F32 height; + ExtrudedFace(): active(false), maxDistance(0.0f), planeMask(0), faceDot(0.0f), faceShift(0.0f), time(0.0f), height(0.0f) {} + ~ExtrudedFace() {} }; typedef Vector ExtrudedList; @@ -92,7 +96,6 @@ public: PlaneList mPlaneList; VectorF mVelocity; VectorF mNormalVelocity; - F32 mFaceShift; Poly mPoly; // Returned info diff --git a/Engine/source/collision/gjk.cpp b/Engine/source/collision/gjk.cpp index e9debee81..f07fade8e 100644 --- a/Engine/source/collision/gjk.cpp +++ b/Engine/source/collision/gjk.cpp @@ -46,6 +46,19 @@ S32 num_irregularities = 0; GjkCollisionState::GjkCollisionState() { + mBits = 0; + mAll_bits = 0; + U32 x, y; + for (x = 0; x < 16; x++) + for (y = 0; y < 4; y++) + mDet[x][y] = 0.0f; + + for (x = 0; x < 4; x++) + for (y = 0; y < 4; y++) + mDP[x][y] = 0.0f; + + mLast = 0; + mLast_bit = 0; mA = mB = 0; } diff --git a/Engine/source/collision/optimizedPolyList.h b/Engine/source/collision/optimizedPolyList.h index d8cac8df3..b66cc76c0 100644 --- a/Engine/source/collision/optimizedPolyList.h +++ b/Engine/source/collision/optimizedPolyList.h @@ -88,7 +88,9 @@ class OptimizedPolyList : public AbstractPolyList Poly() : plane( -1 ), material( NULL ), + vertexStart(0), vertexCount( 0 ), + surfaceKey(0), object( NULL ), type( TriangleFan ) { diff --git a/Engine/source/collision/planeExtractor.cpp b/Engine/source/collision/planeExtractor.cpp index f4e9ffdbb..91458e81c 100644 --- a/Engine/source/collision/planeExtractor.cpp +++ b/Engine/source/collision/planeExtractor.cpp @@ -37,6 +37,7 @@ PlaneExtractorPolyList::PlaneExtractorPolyList() { VECTOR_SET_ASSOCIATION(mVertexList); VECTOR_SET_ASSOCIATION(mPolyPlaneList); + mPlaneList = NULL; } PlaneExtractorPolyList::~PlaneExtractorPolyList() diff --git a/Engine/source/collision/polytope.h b/Engine/source/collision/polytope.h index c96a54979..347a85c70 100644 --- a/Engine/source/collision/polytope.h +++ b/Engine/source/collision/polytope.h @@ -76,6 +76,7 @@ public: Collision() { object = NULL; + material = NULL; distance = 0.0; } }; diff --git a/Engine/source/environment/meshRoad.cpp b/Engine/source/environment/meshRoad.cpp index 1ed6768fb..65d9b2087 100644 --- a/Engine/source/environment/meshRoad.cpp +++ b/Engine/source/environment/meshRoad.cpp @@ -309,7 +309,7 @@ Point3F MeshRoadConvex::support(const VectorF& vec) const void MeshRoadConvex::getFeatures(const MatrixF& mat, const VectorF& n, ConvexFeature* cf) { cf->material = 0; - cf->object = mObject; + cf->mObject = mObject; // For a tetrahedron this is pretty easy... first // convert everything into world space. diff --git a/Engine/source/forest/forestCollision.cpp b/Engine/source/forest/forestCollision.cpp index 468c901dc..6c1038a7d 100644 --- a/Engine/source/forest/forestCollision.cpp +++ b/Engine/source/forest/forestCollision.cpp @@ -124,7 +124,7 @@ Point3F ForestConvex::support(const VectorF& v) const void ForestConvex::getFeatures( const MatrixF &mat, const VectorF &n, ConvexFeature *cf ) { cf->material = 0; - cf->object = mObject; + cf->mObject = mObject; TSShapeInstance *si = mData->getShapeInstance(); @@ -475,4 +475,4 @@ bool ForestItem::castRay( const Point3F &start, const Point3F &end, RayInfo *out *(ForestItem*)(outInfo->userData) = *this; return true; -} \ No newline at end of file +} diff --git a/Engine/source/terrain/terrCollision.cpp b/Engine/source/terrain/terrCollision.cpp index 6b0ee6f8d..bb8211199 100644 --- a/Engine/source/terrain/terrCollision.cpp +++ b/Engine/source/terrain/terrCollision.cpp @@ -231,7 +231,7 @@ void TerrainConvex::getFeatures(const MatrixF& mat,const VectorF& n, ConvexFeatu { U32 i; cf->material = 0; - cf->object = mObject; + cf->mObject = mObject; // Plane is normal n + support point PlaneF plane; From 2c1508c169d39a2e85748ba9a973cc7989b80238 Mon Sep 17 00:00:00 2001 From: AzaezelX Date: Mon, 11 May 2020 14:40:31 -0500 Subject: [PATCH 04/25] uninitialized variables-console --- Engine/source/console/astNodes.cpp | 1 + Engine/source/console/codeBlock.cpp | 3 +++ Engine/source/console/codeInterpreter.cpp | 3 +++ Engine/source/console/compiler.h | 2 +- Engine/source/console/consoleInternal.cpp | 13 ++++++++++++- Engine/source/console/consoleInternal.h | 1 + Engine/source/console/consoleObject.h | 17 ++++++++++++++++- Engine/source/console/engineAPI.h | 2 +- Engine/source/console/engineExports.h | 3 ++- Engine/source/console/engineObject.cpp | 2 +- Engine/source/console/engineTypeInfo.cpp | 1 + Engine/source/console/simDatablock.cpp | 1 + Engine/source/console/simDictionary.cpp | 2 ++ Engine/source/console/simEvents.h | 2 +- Engine/source/console/simFieldDictionary.h | 4 ++-- Engine/source/console/simObject.cpp | 1 + Engine/source/console/stringStack.cpp | 6 ++++++ Engine/source/console/telnetConsole.cpp | 3 +++ Engine/source/console/telnetConsole.h | 1 + Engine/source/console/telnetDebugger.cpp | 3 +++ Engine/source/console/typeValidators.h | 3 ++- Engine/source/core/color.h | 2 +- Engine/source/core/frameAllocator.h | 1 + 23 files changed, 66 insertions(+), 11 deletions(-) diff --git a/Engine/source/console/astNodes.cpp b/Engine/source/console/astNodes.cpp index 876a4383a..51bde9d61 100644 --- a/Engine/source/console/astNodes.cpp +++ b/Engine/source/console/astNodes.cpp @@ -142,6 +142,7 @@ StmtNode::StmtNode() { mNext = NULL; dbgFileName = CodeBlock::smCurrentParser->getCurrentFile(); + dbgLineNumber = 0; } void StmtNode::setPackage(StringTableEntry) diff --git a/Engine/source/console/codeBlock.cpp b/Engine/source/console/codeBlock.cpp index f414d7473..b4dd6b2c6 100644 --- a/Engine/source/console/codeBlock.cpp +++ b/Engine/source/console/codeBlock.cpp @@ -56,6 +56,9 @@ CodeBlock::CodeBlock() name = NULL; fullPath = NULL; modPath = NULL; + codeSize = 0; + lineBreakPairCount = 0; + nextFile = NULL; } CodeBlock::~CodeBlock() diff --git a/Engine/source/console/codeInterpreter.cpp b/Engine/source/console/codeInterpreter.cpp index 186354869..838e105ef 100644 --- a/Engine/source/console/codeInterpreter.cpp +++ b/Engine/source/console/codeInterpreter.cpp @@ -224,6 +224,9 @@ CodeInterpreter::CodeInterpreter(CodeBlock *cb) : mSaveCodeBlock(nullptr), mCurrentInstruction(0) { + dMemset(&mExec, 0, sizeof(mExec)); + dMemset(&mObjectCreationStack, 0, sizeof(mObjectCreationStack)); + dMemset(&mNSDocBlockClass, 0, sizeof(mNSDocBlockClass)); } CodeInterpreter::~CodeInterpreter() diff --git a/Engine/source/console/compiler.h b/Engine/source/console/compiler.h index df69d0819..26dc93c13 100644 --- a/Engine/source/console/compiler.h +++ b/Engine/source/console/compiler.h @@ -317,7 +317,7 @@ protected: U32 addr; ///< Address to patch U32 value; ///< Value to place at addr - PatchEntry() { ; } + PatchEntry(): addr(0), value(0) { ; } PatchEntry(U32 a, U32 v) : addr(a), value(v) { ; } } PatchEntry; diff --git a/Engine/source/console/consoleInternal.cpp b/Engine/source/console/consoleInternal.cpp index 61a63ae1e..d3d838f05 100644 --- a/Engine/source/console/consoleInternal.cpp +++ b/Engine/source/console/consoleInternal.cpp @@ -475,7 +475,7 @@ Dictionary::Entry::Entry(StringTableEntry in_name) nextEntry = NULL; mUsage = NULL; mIsConstant = false; - + mNext = NULL; // NOTE: This is data inside a nameless // union, so we don't need to init the rest. value.init(); @@ -856,6 +856,7 @@ ExprEvalState::ExprEvalState() stack.reserve(64); mShouldReset = false; mResetLocked = false; + copyVariable = NULL; } ExprEvalState::~ExprEvalState() @@ -927,6 +928,15 @@ Namespace::Entry::Entry() mUsage = NULL; mHeader = NULL; mNamespace = NULL; + cb.mStringCallbackFunc = NULL; + mFunctionLineNumber = 0; + mFunctionName = StringTable->EmptyString(); + mFunctionOffset = 0; + mMinArgs = 0; + mMaxArgs = 0; + mNext = NULL; + mPackage = StringTable->EmptyString(); + mToolOnly = false; } void Namespace::Entry::clear() @@ -959,6 +969,7 @@ Namespace::Namespace() mHashSequence = 0; mRefCountToParent = 0; mClassRep = 0; + lastUsage = NULL; } Namespace::~Namespace() diff --git a/Engine/source/console/consoleInternal.h b/Engine/source/console/consoleInternal.h index d673bb39c..129da9dfb 100644 --- a/Engine/source/console/consoleInternal.h +++ b/Engine/source/console/consoleInternal.h @@ -306,6 +306,7 @@ public: nextEntry = NULL; mUsage = NULL; mIsConstant = false; + mNext = NULL; value.init(); } diff --git a/Engine/source/console/consoleObject.h b/Engine/source/console/consoleObject.h index b15cd88ab..784e294ff 100644 --- a/Engine/source/console/consoleObject.h +++ b/Engine/source/console/consoleObject.h @@ -220,7 +220,21 @@ public: : Parent( sizeof( void* ), conIdPtr, typeName ) { VECTOR_SET_ASSOCIATION( mFieldList ); - + mCategory = StringTable->EmptyString(); + mClassGroupMask = 0; + std::fill_n(mClassId, NetClassGroupsCount, -1); + mClassName = StringTable->EmptyString(); + mClassSizeof = 0; + mClassType = 0; + mDescription = StringTable->EmptyString(); +#ifdef TORQUE_NET_STATS + dMemset(mDirtyMaskFrequency, 0, sizeof(mDirtyMaskFrequency)); + dMemset(mDirtyMaskTotal, 0, sizeof(mDirtyMaskTotal)); +#endif + mDynamicGroupExpand = false; + mNamespace = NULL; + mNetEventDir = 0; + nextClass = NULL; parentClass = NULL; mIsRenderEnabled = true; mIsSelectionEnabled = true; @@ -496,6 +510,7 @@ public: validator( NULL ), setDataFn( NULL ), getDataFn( NULL ), + writeDataFn(NULL), networkMask(0) { doNotSubstitute = keepClearSubsOnly = false; diff --git a/Engine/source/console/engineAPI.h b/Engine/source/console/engineAPI.h index 78a469522..5c9d00dd4 100644 --- a/Engine/source/console/engineAPI.h +++ b/Engine/source/console/engineAPI.h @@ -1190,7 +1190,7 @@ public: ConsoleValueRef _exec(); ConsoleValueRef _execLater(SimConsoleThreadExecEvent *evt); - _BaseEngineConsoleCallbackHelper() {;} + _BaseEngineConsoleCallbackHelper(): mThis(NULL), mInitialArgc(0), mArgc(0), mCallbackName(StringTable->EmptyString()){;} }; diff --git a/Engine/source/console/engineExports.h b/Engine/source/console/engineExports.h index 7659eeac9..1303315f8 100644 --- a/Engine/source/console/engineExports.h +++ b/Engine/source/console/engineExports.h @@ -123,6 +123,7 @@ class EngineExport : public StaticEngineObject : mExportName( "" ), mExportKind( EngineExportKindScope ), mExportScope( NULL ), + mDocString(""), mNextExport( NULL ) {} }; @@ -165,7 +166,7 @@ class EngineExportScope : public EngineExport private: /// Constructor for the global scope. - EngineExportScope() {} + EngineExportScope():mExports(NULL){} }; diff --git a/Engine/source/console/engineObject.cpp b/Engine/source/console/engineObject.cpp index f82114388..ff19c1acb 100644 --- a/Engine/source/console/engineObject.cpp +++ b/Engine/source/console/engineObject.cpp @@ -53,7 +53,7 @@ void*& _USERDATA( EngineObject* object ) //----------------------------------------------------------------------------- EngineObject::EngineObject() - : mEngineObjectUserData( NULL ) + : mEngineObjectPool(NULL), mEngineObjectUserData( NULL ) { #ifdef TORQUE_DEBUG // Add to instance list. diff --git a/Engine/source/console/engineTypeInfo.cpp b/Engine/source/console/engineTypeInfo.cpp index e258696d3..14c661c82 100644 --- a/Engine/source/console/engineTypeInfo.cpp +++ b/Engine/source/console/engineTypeInfo.cpp @@ -58,6 +58,7 @@ EngineTypeInfo::EngineTypeInfo( const char* typeName, EngineExportScope* scope, mEnumTable( NULL ), mFieldTable( NULL ), mPropertyTable( NULL ), + mArgumentTypeTable(NULL), mSuperType( NULL ), mNext( smFirst ) { diff --git a/Engine/source/console/simDatablock.cpp b/Engine/source/console/simDatablock.cpp index 7944fb889..ae0fd9c63 100644 --- a/Engine/source/console/simDatablock.cpp +++ b/Engine/source/console/simDatablock.cpp @@ -55,6 +55,7 @@ ConsoleDocClass( SimDataBlock, SimDataBlock::SimDataBlock() { + modifiedKey = 0; setModDynamicFields(true); setModStaticFields(true); } diff --git a/Engine/source/console/simDictionary.cpp b/Engine/source/console/simDictionary.cpp index 4f5aac411..93491fd1c 100644 --- a/Engine/source/console/simDictionary.cpp +++ b/Engine/source/console/simDictionary.cpp @@ -31,6 +31,8 @@ SimNameDictionary::SimNameDictionary() { #ifndef USE_NEW_SIMDICTIONARY hashTable = NULL; + hashTableSize = DefaultTableSize; + hashEntryCount = 0; #endif mutex = Mutex::createMutex(); } diff --git a/Engine/source/console/simEvents.h b/Engine/source/console/simEvents.h index 362bdb325..861c7cdde 100644 --- a/Engine/source/console/simEvents.h +++ b/Engine/source/console/simEvents.h @@ -62,7 +62,7 @@ public: /// of addition to the list. SimObject *destObject; ///< Object on which this event will be applied. - SimEvent() { destObject = NULL; } + SimEvent() { nextEvent = NULL; startTime = 0; time = 0; sequenceCount = 0; destObject = NULL; } virtual ~SimEvent() {} ///< Destructor /// /// A dummy virtual destructor is required diff --git a/Engine/source/console/simFieldDictionary.h b/Engine/source/console/simFieldDictionary.h index c89bd5b57..9701f2e1d 100644 --- a/Engine/source/console/simFieldDictionary.h +++ b/Engine/source/console/simFieldDictionary.h @@ -47,7 +47,7 @@ class SimFieldDictionary public: struct Entry { - Entry() : type(NULL) {}; + Entry() : slotName(StringTable->EmptyString()), value(NULL), next(NULL), type(NULL) {}; StringTableEntry slotName; char *value; @@ -112,4 +112,4 @@ public: }; -#endif // _SIMFIELDDICTIONARY_H_ \ No newline at end of file +#endif // _SIMFIELDDICTIONARY_H_ diff --git a/Engine/source/console/simObject.cpp b/Engine/source/console/simObject.cpp index 6cf6fd029..0fc222e11 100644 --- a/Engine/source/console/simObject.cpp +++ b/Engine/source/console/simObject.cpp @@ -1380,6 +1380,7 @@ SimObject::SimObject(const SimObject& other, bool temp_clone) nextIdObject = other.nextIdObject; mGroup = other.mGroup; mFlags = other.mFlags; + mProgenitorFile = other.mProgenitorFile; mCopySource = other.mCopySource; mFieldDictionary = other.mFieldDictionary; //mIdString = other.mIdString; // special treatment (see below) diff --git a/Engine/source/console/stringStack.cpp b/Engine/source/console/stringStack.cpp index 7081756c0..96aef1c86 100644 --- a/Engine/source/console/stringStack.cpp +++ b/Engine/source/console/stringStack.cpp @@ -30,7 +30,12 @@ StringStack::StringStack() mBuffer = NULL; mArgBufferSize = 0; mArgBuffer = NULL; + for (U32 i = 0; i < MaxArgs; i++) + mArgV[i] = ""; + dMemset(mFrameOffsets, 0, sizeof(mFrameOffsets)); + dMemset(mStartOffsets, 0, sizeof(mStartOffsets)); mNumFrames = 0; + mArgc = 0; mStart = 0; mLen = 0; mStartStackSize = 0; @@ -232,6 +237,7 @@ mStackPos(0) mStack[i].init(); mStack[i].type = ConsoleValue::TypeInternalString; } + dMemset(mStackFrames, 0, sizeof(mStackFrames)); } ConsoleValueStack::~ConsoleValueStack() diff --git a/Engine/source/console/telnetConsole.cpp b/Engine/source/console/telnetConsole.cpp index 620c669bf..8eaa3b3db 100644 --- a/Engine/source/console/telnetConsole.cpp +++ b/Engine/source/console/telnetConsole.cpp @@ -88,6 +88,9 @@ TelnetConsole::TelnetConsole() mAcceptPort = -1; mClientList = NULL; mRemoteEchoEnabled = false; + + dStrncpy(mTelnetPassword, "", PasswordMaxLength); + dStrncpy(mListenPassword, "", PasswordMaxLength); } TelnetConsole::~TelnetConsole() diff --git a/Engine/source/console/telnetConsole.h b/Engine/source/console/telnetConsole.h index 96677942c..4d848a0b5 100644 --- a/Engine/source/console/telnetConsole.h +++ b/Engine/source/console/telnetConsole.h @@ -78,6 +78,7 @@ class TelnetConsole S32 state; ///< State of the client. /// @see TelnetConsole::State TelnetClient *nextClient; + TelnetClient() { dStrncpy(curLine, "", Con::MaxLineLength); curPos = 0; state = 0; nextClient = NULL; } }; TelnetClient *mClientList; TelnetConsole(); diff --git a/Engine/source/console/telnetDebugger.cpp b/Engine/source/console/telnetDebugger.cpp index 161ed5695..719ed7d32 100644 --- a/Engine/source/console/telnetDebugger.cpp +++ b/Engine/source/console/telnetDebugger.cpp @@ -163,6 +163,9 @@ TelnetDebugger::TelnetDebugger() mProgramPaused = false; mWaitForClient = false; + dStrncpy(mDebuggerPassword, "", PasswordMaxLength); + dStrncpy(mLineBuffer, "", sizeof(mLineBuffer)); + // Add the version number in a global so that // scripts can detect the presence of the // "enhanced" debugger features. diff --git a/Engine/source/console/typeValidators.h b/Engine/source/console/typeValidators.h index 9ca949fa7..c4982a781 100644 --- a/Engine/source/console/typeValidators.h +++ b/Engine/source/console/typeValidators.h @@ -27,7 +27,8 @@ class TypeValidator { public: S32 fieldIndex; - + TypeValidator() : fieldIndex(0) {} + ~TypeValidator() {} /// Prints a console error message for the validator. /// /// The message is prefaced with with: diff --git a/Engine/source/core/color.h b/Engine/source/core/color.h index afc62353e..9a21d6df2 100644 --- a/Engine/source/core/color.h +++ b/Engine/source/core/color.h @@ -203,7 +203,7 @@ public: class StockColorItem { private: - StockColorItem() {} + StockColorItem():mColorName("") {} public: StockColorItem( const char* pName, const U8 red, const U8 green, const U8 blue, const U8 alpha = 255 ) diff --git a/Engine/source/core/frameAllocator.h b/Engine/source/core/frameAllocator.h index 2e03e6fc2..98bf8b110 100644 --- a/Engine/source/core/frameAllocator.h +++ b/Engine/source/core/frameAllocator.h @@ -295,6 +295,7 @@ public: AssertFatal( count > 0, "Allocating a FrameTemp with less than one instance" ); \ mWaterMark = FrameAllocator::getWaterMark(); \ mMemory = reinterpret_cast( FrameAllocator::alloc( sizeof( type ) * count ) ); \ + mNumObjectsInMemory = 0; \ } \ template<>\ inline FrameTemp::~FrameTemp() \ From 1efb687867ecc2c9d14562c9bd9b238fcc448884 Mon Sep 17 00:00:00 2001 From: AzaezelX Date: Mon, 11 May 2020 14:56:04 -0500 Subject: [PATCH 05/25] uninitialized variables-environment and forrest --- .../environment/VolumetricFogRTManager.cpp | 5 ++++- Engine/source/environment/basicClouds.cpp | 13 +++++++------ Engine/source/environment/cloudLayer.cpp | 19 ++++++++++--------- Engine/source/environment/decalRoad.cpp | 3 +++ .../editors/guiMeshRoadEditorCtrl.cpp | 3 ++- .../editors/guiMeshRoadEditorCtrl.h | 3 +++ .../editors/guiRiverEditorCtrl.cpp | 1 + .../environment/editors/guiRiverEditorCtrl.h | 4 ++++ .../environment/editors/guiRoadEditorCtrl.cpp | 1 + .../environment/editors/guiRoadEditorCtrl.h | 5 +++++ Engine/source/environment/meshRoad.cpp | 5 +++++ Engine/source/environment/meshRoad.h | 7 ++++--- Engine/source/environment/nodeListManager.h | 6 +++--- Engine/source/environment/river.cpp | 6 +++++- Engine/source/environment/river.h | 4 ++-- Engine/source/environment/waterBlock.cpp | 3 ++- Engine/source/environment/waterObject.cpp | 5 ++++- .../forest/editor/forestSelectionTool.cpp | 4 +++- Engine/source/forest/forest.h | 5 +---- Engine/source/forest/forestCollision.h | 6 +++++- 20 files changed, 74 insertions(+), 34 deletions(-) diff --git a/Engine/source/environment/VolumetricFogRTManager.cpp b/Engine/source/environment/VolumetricFogRTManager.cpp index c9caf29e4..d291bb999 100644 --- a/Engine/source/environment/VolumetricFogRTManager.cpp +++ b/Engine/source/environment/VolumetricFogRTManager.cpp @@ -87,8 +87,11 @@ VolumetricFogRTManager::VolumetricFogRTManager() setGlobalBounds(); mTypeMask |= EnvironmentObjectType; mNetFlags.set(IsGhost); + mPlatformWindow = NULL; mIsInitialized = false; mNumFogObjects = 0; + mWidth = 0; + mHeight = 0; } VolumetricFogRTManager::~VolumetricFogRTManager() @@ -291,4 +294,4 @@ DefineEngineFunction(SetFogVolumeQuality, S32, (U32 new_quality), , if (VFRTM == NULL) return -1; return VFRTM->setQuality(new_quality); -} \ No newline at end of file +} diff --git a/Engine/source/environment/basicClouds.cpp b/Engine/source/environment/basicClouds.cpp index 88cd394e9..0352c4e1a 100644 --- a/Engine/source/environment/basicClouds.cpp +++ b/Engine/source/environment/basicClouds.cpp @@ -63,11 +63,12 @@ BasicClouds::BasicClouds() mTypeMask |= EnvironmentObjectType | StaticObjectType; mNetFlags.set(Ghostable | ScopeAlways); - mTimeSC = 0; - mModelViewProjSC = 0; - mTexScaleSC = 0; - mTexDirectionSC = 0; - mTexOffsetSC = 0; + mTimeSC = NULL; + mModelViewProjSC = NULL; + mTexScaleSC = NULL; + mTexDirectionSC = NULL; + mTexOffsetSC = NULL; + mDiffuseMapSC = NULL; mLayerEnabled[0] = true; mLayerEnabled[1] = true; @@ -414,4 +415,4 @@ void BasicClouds::_initBuffers() mVB[i].unlock(); } -} \ No newline at end of file +} diff --git a/Engine/source/environment/cloudLayer.cpp b/Engine/source/environment/cloudLayer.cpp index 08cb6ce00..6c7fafb7f 100644 --- a/Engine/source/environment/cloudLayer.cpp +++ b/Engine/source/environment/cloudLayer.cpp @@ -82,15 +82,16 @@ CloudLayer::CloudLayer() mTypeMask |= EnvironmentObjectType | StaticObjectType; mNetFlags.set(Ghostable | ScopeAlways); - mModelViewProjSC = - mAmbientColorSC = - mSunColorSC = - mSunVecSC = - mTexScaleSC = - mBaseColorSC = - mCoverageSC = - mExposureSC = - mEyePosWorldSC = 0; + mModelViewProjSC = NULL; + mAmbientColorSC = NULL; + mSunColorSC = NULL; + mSunVecSC = NULL; + mTexScaleSC = NULL; + mBaseColorSC = NULL; + mCoverageSC = NULL; + mExposureSC = NULL; + mEyePosWorldSC = NULL; + mNormalHeightMapSC = NULL; mTexOffsetSC[0] = mTexOffsetSC[1] = mTexOffsetSC[2] = 0; diff --git a/Engine/source/environment/decalRoad.cpp b/Engine/source/environment/decalRoad.cpp index 00359f7bb..668bfcaae 100644 --- a/Engine/source/environment/decalRoad.cpp +++ b/Engine/source/environment/decalRoad.cpp @@ -279,7 +279,10 @@ DecalRoad::DecalRoad() mLoadRenderData( true ), mMaterial( NULL ), mMatInst( NULL ), + mTriangleCount(0), + mVertCount(0), mUpdateEventId( -1 ), + mLastEvent(NULL), mTerrainUpdateRect( Box3F::Invalid ) { // Setup NetObject. diff --git a/Engine/source/environment/editors/guiMeshRoadEditorCtrl.cpp b/Engine/source/environment/editors/guiMeshRoadEditorCtrl.cpp index 95dfe4ad9..c9bd76d33 100644 --- a/Engine/source/environment/editors/guiMeshRoadEditorCtrl.cpp +++ b/Engine/source/environment/editors/guiMeshRoadEditorCtrl.cpp @@ -67,6 +67,7 @@ GuiMeshRoadEditorCtrl::GuiMeshRoadEditorCtrl() mMovePointMode("MeshRoadEditorMoveMode"), mScalePointMode("MeshRoadEditorScaleMode"), mRotatePointMode("MeshRoadEditorRotateMode"), + mSavedDrag(false), mIsDirty( false ), mRoadSet( NULL ), mSelNode( -1 ), @@ -82,7 +83,7 @@ GuiMeshRoadEditorCtrl::GuiMeshRoadEditorCtrl() mHoverSplineColor( 255,0,0,255 ), mSelectedSplineColor( 0,255,0,255 ), mHoverNodeColor( 255,255,255,255 ), - mHasCopied( false ) + mHasCopied( false ) { mMaterialName[Top] = StringTable->insert("DefaultRoadMaterialTop"); mMaterialName[Bottom] = StringTable->insert("DefaultRoadMaterialOther"); diff --git a/Engine/source/environment/editors/guiMeshRoadEditorCtrl.h b/Engine/source/environment/editors/guiMeshRoadEditorCtrl.h index 3109c538b..f4b34004f 100644 --- a/Engine/source/environment/editors/guiMeshRoadEditorCtrl.h +++ b/Engine/source/environment/editors/guiMeshRoadEditorCtrl.h @@ -159,6 +159,9 @@ class GuiMeshRoadEditorUndoAction : public UndoAction GuiMeshRoadEditorUndoAction( const UTF8* actionName ) : UndoAction( actionName ) { + mEditor = NULL; + mObjId = 0; + mMetersPerSegment = 1.0f; } GuiMeshRoadEditorCtrl *mEditor; diff --git a/Engine/source/environment/editors/guiRiverEditorCtrl.cpp b/Engine/source/environment/editors/guiRiverEditorCtrl.cpp index 23df5900d..97b8b7912 100644 --- a/Engine/source/environment/editors/guiRiverEditorCtrl.cpp +++ b/Engine/source/environment/editors/guiRiverEditorCtrl.cpp @@ -84,6 +84,7 @@ GuiRiverEditorCtrl::GuiRiverEditorCtrl() mStartHeight = -1.0f; mStartX = 0; + mSavedDrag = false; mIsDirty = false; mNodeHalfSize.set(4,4); diff --git a/Engine/source/environment/editors/guiRiverEditorCtrl.h b/Engine/source/environment/editors/guiRiverEditorCtrl.h index d8aa2efb5..a5dae237d 100644 --- a/Engine/source/environment/editors/guiRiverEditorCtrl.h +++ b/Engine/source/environment/editors/guiRiverEditorCtrl.h @@ -181,6 +181,10 @@ class GuiRiverEditorUndoAction : public UndoAction GuiRiverEditorUndoAction( const UTF8* actionName ) : UndoAction( actionName ) { + mRiverEditor = NULL; + mObjId = 0; + mMetersPerSegment = 1.0f; + mSegmentsPerBatch = 10; } GuiRiverEditorCtrl *mRiverEditor; diff --git a/Engine/source/environment/editors/guiRoadEditorCtrl.cpp b/Engine/source/environment/editors/guiRoadEditorCtrl.cpp index c3b3f0e99..409739b38 100644 --- a/Engine/source/environment/editors/guiRoadEditorCtrl.cpp +++ b/Engine/source/environment/editors/guiRoadEditorCtrl.cpp @@ -82,6 +82,7 @@ GuiRoadEditorCtrl::GuiRoadEditorCtrl() mSelectedSplineColor.set( 0,255,0,255 ); mHoverNodeColor.set( 255,255,255,255 ); + mSavedDrag = false; mIsDirty = false; mMaterialName = StringTable->insert("DefaultDecalRoadMaterial"); diff --git a/Engine/source/environment/editors/guiRoadEditorCtrl.h b/Engine/source/environment/editors/guiRoadEditorCtrl.h index f6383e548..5993f5e13 100644 --- a/Engine/source/environment/editors/guiRoadEditorCtrl.h +++ b/Engine/source/environment/editors/guiRoadEditorCtrl.h @@ -146,6 +146,11 @@ class GuiRoadEditorUndoAction : public UndoAction GuiRoadEditorUndoAction( const UTF8* actionName ) : UndoAction( actionName ) { + mRoadEditor = NULL; + mObjId = 0; + mBreakAngle = 3.0f; + mSegmentsPerBatch = 0; + mTextureLength = 0.0f; } GuiRoadEditorCtrl *mRoadEditor; diff --git a/Engine/source/environment/meshRoad.cpp b/Engine/source/environment/meshRoad.cpp index 65d9b2087..f9f853ada 100644 --- a/Engine/source/environment/meshRoad.cpp +++ b/Engine/source/environment/meshRoad.cpp @@ -629,6 +629,11 @@ MeshRoad::MeshRoad() mMatInst[Bottom] = NULL; mMatInst[Side] = NULL; mTypeMask |= TerrainLikeObjectType; + for (U32 i = 0; i < SurfaceCount; i++) + { + mVertCount[i] = 0; + mTriangleCount[i] = 0; + } } MeshRoad::~MeshRoad() diff --git a/Engine/source/environment/meshRoad.h b/Engine/source/environment/meshRoad.h index 06157b343..6279e20fa 100644 --- a/Engine/source/environment/meshRoad.h +++ b/Engine/source/environment/meshRoad.h @@ -85,7 +85,7 @@ public: public: - MeshRoadConvex() { mType = MeshRoadConvexType; } + MeshRoadConvex():pRoad(NULL), faceId(0), triangleId(0), segmentId(0) { mType = MeshRoadConvexType; } MeshRoadConvex( const MeshRoadConvex& cv ) { mType = MeshRoadConvexType; @@ -122,7 +122,7 @@ struct ObjectRenderInst; class MeshRoadSplineNode { public: - MeshRoadSplineNode() {} + MeshRoadSplineNode() :x(0.0f), y(0.0f), z(0.0f), width(0.0f), depth(0.0f) {} F32 x; F32 y; @@ -257,6 +257,7 @@ struct MeshRoadSlice depth = 0.0f; normal.set(0,0,1); texCoordV = 0.0f; + t = 0.0f; parentNodeIdx = -1; }; @@ -572,4 +573,4 @@ public: }; -#endif // _MESHROAD_H_ \ No newline at end of file +#endif // _MESHROAD_H_ diff --git a/Engine/source/environment/nodeListManager.h b/Engine/source/environment/nodeListManager.h index c4f42d3f2..f6e46b23a 100644 --- a/Engine/source/environment/nodeListManager.h +++ b/Engine/source/environment/nodeListManager.h @@ -50,7 +50,7 @@ public: U32 mTotalValidNodes; bool mListComplete; - NodeList() { mTotalValidNodes=0; mListComplete=false; } + NodeList() { mId = 0; mTotalValidNodes = 0; mListComplete = false; } virtual ~NodeList() { } }; @@ -93,7 +93,7 @@ protected: U32 mListId; public: - NodeListNotify() { } + NodeListNotify() { mListId = 0; } virtual ~NodeListNotify() { } U32 getListId() { return mListId; } @@ -115,7 +115,7 @@ public: NodeListManager::NodeList* mNodeList; public: - NodeListEvent() { mNodeList=NULL; mTotalNodes = mLocalListStart = 0; } + NodeListEvent() { mId = 0; mNodeList = NULL; mTotalNodes = mLocalListStart = 0; } virtual ~NodeListEvent(); virtual void pack(NetConnection*, BitStream*); diff --git a/Engine/source/environment/river.cpp b/Engine/source/environment/river.cpp index 0ff02c6d9..9606584f7 100644 --- a/Engine/source/environment/river.cpp +++ b/Engine/source/environment/river.cpp @@ -593,7 +593,11 @@ IMPLEMENT_CO_NETOBJECT_V1(River); River::River() - : mSegmentsPerBatch(10), + : mLowVertCount(0), + mHighVertCount(0), + mLowTriangleCount(0), + mHighTriangleCount(0), + mSegmentsPerBatch(10), mMetersPerSegment(10.0f), mDepthScale(1.0f), mFlowMagnitude(1.0f), diff --git a/Engine/source/environment/river.h b/Engine/source/environment/river.h index acb7f2926..f91217955 100644 --- a/Engine/source/environment/river.h +++ b/Engine/source/environment/river.h @@ -58,7 +58,7 @@ struct ObjectRenderInst; class RiverSplineNode { public: - RiverSplineNode() {} + RiverSplineNode() :x(0.0f), y(0.0f), z(0.0f), width(0.0f), depth(0.0f) {} F32 x; F32 y; @@ -529,4 +529,4 @@ protected: U32 mColumnCount; }; -#endif // _RIVER_H_ \ No newline at end of file +#endif // _RIVER_H_ diff --git a/Engine/source/environment/waterBlock.cpp b/Engine/source/environment/waterBlock.cpp index 4a4edc15f..23345985a 100644 --- a/Engine/source/environment/waterBlock.cpp +++ b/Engine/source/environment/waterBlock.cpp @@ -56,7 +56,8 @@ WaterBlock::WaterBlock() { mGridElementSize = 5.0f; mObjScale.set( 100.0f, 100.0f, 10.0f ); - + mWidth = 2; + mHeight = 2; mNetFlags.set(Ghostable | ScopeAlways); mObjBox.minExtents.set( -0.5f, -0.5f, -0.5f ); diff --git a/Engine/source/environment/waterObject.cpp b/Engine/source/environment/waterObject.cpp index adb81e6d1..0698cdce6 100644 --- a/Engine/source/environment/waterObject.cpp +++ b/Engine/source/environment/waterObject.cpp @@ -204,6 +204,7 @@ WaterObject::WaterObject() mCubemap( NULL ), mSpecularColor( 1.0f, 1.0f, 1.0f, 1.0f ), mEmissive( false ), + mFullReflect(true), mDepthGradientMax( 50.0f ) { mTypeMask = WaterObjectType; @@ -248,6 +249,8 @@ WaterObject::WaterObject() mSurfMatName[BasicUnderWaterMat] = "UnderWaterBasicMat"; dMemset( mMatInstances, 0, sizeof(mMatInstances) ); + dMemset(mMatParamHandles, 0, sizeof(mMatParamHandles)); + mUnderwater = false; mWaterPos.set( 0,0,0 ); mWaterPlane.set( mWaterPos, Point3F(0,0,1) ); @@ -1211,4 +1214,4 @@ S32 WaterObject::getMaterialIndex( const Point3F &camPos ) } return matIdx; -} \ No newline at end of file +} diff --git a/Engine/source/forest/editor/forestSelectionTool.cpp b/Engine/source/forest/editor/forestSelectionTool.cpp index f6689c9b8..aafd473da 100644 --- a/Engine/source/forest/editor/forestSelectionTool.cpp +++ b/Engine/source/forest/editor/forestSelectionTool.cpp @@ -161,7 +161,9 @@ ForestSelectionTool::ForestSelectionTool() : Parent(), mGizmo( NULL ), mCurrAction( NULL ), - mGizmoProfile( NULL ) + mGizmoProfile( NULL ), + mMouseDragged(false), + mUsingGizmo(false) { mBounds = Box3F::Invalid; diff --git a/Engine/source/forest/forest.h b/Engine/source/forest/forest.h index b44764b70..42f026976 100644 --- a/Engine/source/forest/forest.h +++ b/Engine/source/forest/forest.h @@ -114,9 +114,6 @@ protected: static bool smDrawCells; static bool smDrawBounds; - /// - bool mRegen; - enum MaskBits { MediaMask = Parent::NextFreeMask << 1, @@ -211,4 +208,4 @@ public: void updateCollision(); }; -#endif // _H_FOREST_ \ No newline at end of file +#endif // _H_FOREST_ diff --git a/Engine/source/forest/forestCollision.h b/Engine/source/forest/forestCollision.h index 716ec8991..0118307ec 100644 --- a/Engine/source/forest/forestCollision.h +++ b/Engine/source/forest/forestCollision.h @@ -46,7 +46,11 @@ public: ForestConvex() { mType = ForestConvexType; - mTransform.identity(); + mTransform.identity(); + hullId = 0; + mForestItemKey = 0; + mData = NULL; + mScale = 1.0f; } ForestConvex( const ForestConvex &cv ) From b9c207765e18604f35fb4713718b01ffb168447d Mon Sep 17 00:00:00 2001 From: AzaezelX Date: Mon, 11 May 2020 15:00:25 -0500 Subject: [PATCH 06/25] uninitialized variables-gfx --- Engine/source/gfx/D3D11/gfxD3D11Device.cpp | 7 +++++- Engine/source/gfx/D3D11/gfxD3D11Device.h | 1 + .../gfx/D3D11/gfxD3D11PrimitiveBuffer.h | 4 ++-- Engine/source/gfx/D3D11/gfxD3D11Shader.h | 22 +++++++++---------- Engine/source/gfx/D3D11/gfxD3D11Target.cpp | 2 ++ .../gfx/D3D11/gfxD3D11TextureObject.cpp | 5 ++++- .../source/gfx/D3D11/gfxD3D11VertexBuffer.h | 4 ++-- Engine/source/gfx/Null/gfxNullDevice.cpp | 2 +- Engine/source/gfx/bitmap/ddsFile.h | 12 ++++++++-- Engine/source/gfx/bitmap/gBitmap.cpp | 3 +-- Engine/source/gfx/bitmap/gBitmap.h | 3 +++ Engine/source/gfx/bitmap/imageUtils.cpp | 3 +-- Engine/source/gfx/gFont.cpp | 7 ++++-- Engine/source/gfx/gFont.h | 3 ++- Engine/source/gfx/gfxAdapter.h | 1 + Engine/source/gfx/gfxCubemap.h | 2 +- Engine/source/gfx/gfxFontRenderBatcher.cpp | 4 +++- Engine/source/gfx/gfxFormatUtils.h | 2 +- Engine/source/gfx/gfxStructs.h | 7 +++++- Engine/source/gfx/gfxVertexBuffer.h | 4 ++++ Engine/source/gfx/gfxVertexFormat.cpp | 1 + .../gfx/gl/gfxGLCircularVolatileBuffer.h | 3 ++- Engine/source/gfx/gl/gfxGLCubemap.cpp | 3 +++ Engine/source/gfx/gl/gfxGLDevice.cpp | 1 + Engine/source/gfx/gl/gfxGLDeviceProfiler.cpp | 2 +- Engine/source/gfx/gl/gfxGLPrimitiveBuffer.cpp | 6 +++-- Engine/source/gfx/gl/gfxGLShader.cpp | 1 + Engine/source/gfx/gl/gfxGLTextureObject.cpp | 9 ++++++++ Engine/source/gfx/gl/gfxGLVertexDecl.h | 4 ++-- Engine/source/gfx/video/theoraTexture.cpp | 4 +++- Engine/source/gfx/video/videoCapture.cpp | 6 ++++- Engine/source/gfx/video/videoCapture.h | 6 ++--- .../source/gfx/video/videoEncoderTheora.cpp | 7 +++++- 33 files changed, 108 insertions(+), 43 deletions(-) diff --git a/Engine/source/gfx/D3D11/gfxD3D11Device.cpp b/Engine/source/gfx/D3D11/gfxD3D11Device.cpp index a544452f8..1bbd68e6d 100644 --- a/Engine/source/gfx/D3D11/gfxD3D11Device.cpp +++ b/Engine/source/gfx/D3D11/gfxD3D11Device.cpp @@ -90,6 +90,8 @@ GFXD3D11Device::GFXD3D11Device(U32 index) mDeviceSwizzle24 = &Swizzles::bgr; mAdapterIndex = index; + mSwapChain = NULL; + mD3DDevice = NULL; mD3DDeviceContext = NULL; mVolatileVB = NULL; @@ -107,6 +109,8 @@ GFXD3D11Device::GFXD3D11Device(U32 index) mPixVersion = 0.0; + mFeatureLevel = D3D_FEATURE_LEVEL_9_1; //lowest listed. should be overridden by init + mVertexShaderTarget = String::EmptyString; mPixelShaderTarget = String::EmptyString; mShaderModel = String::EmptyString; @@ -123,7 +127,8 @@ GFXD3D11Device::GFXD3D11Device(U32 index) mCreateFenceType = -1; // Unknown, test on first allocate mCurrentConstBuffer = NULL; - + mMultisampleDesc.Count = 0; + mMultisampleDesc.Quality = 0; mOcclusionQuerySupported = false; mDebugLayers = false; diff --git a/Engine/source/gfx/D3D11/gfxD3D11Device.h b/Engine/source/gfx/D3D11/gfxD3D11Device.h index 9fd853b86..75525ce95 100644 --- a/Engine/source/gfx/D3D11/gfxD3D11Device.h +++ b/Engine/source/gfx/D3D11/gfxD3D11Device.h @@ -79,6 +79,7 @@ protected: class D3D11VertexDecl : public GFXVertexDecl { public: + D3D11VertexDecl() :decl(NULL) {} virtual ~D3D11VertexDecl() { SAFE_RELEASE( decl ); diff --git a/Engine/source/gfx/D3D11/gfxD3D11PrimitiveBuffer.h b/Engine/source/gfx/D3D11/gfxD3D11PrimitiveBuffer.h index 1be1952d4..948176af6 100644 --- a/Engine/source/gfx/D3D11/gfxD3D11PrimitiveBuffer.h +++ b/Engine/source/gfx/D3D11/gfxD3D11PrimitiveBuffer.h @@ -73,11 +73,11 @@ inline GFXD3D11PrimitiveBuffer::GFXD3D11PrimitiveBuffer( GFXDevice *device, mLocked = false; #ifdef TORQUE_DEBUG mDebugGuardBuffer = NULL; - mLockedBuffer = NULL; mLockedSize = 0; +#endif mIndexStart = 0; mIndexEnd = 0; -#endif + mLockedBuffer = NULL; } #endif diff --git a/Engine/source/gfx/D3D11/gfxD3D11Shader.h b/Engine/source/gfx/D3D11/gfxD3D11Shader.h index b20ea8e3c..8ae17a979 100644 --- a/Engine/source/gfx/D3D11/gfxD3D11Shader.h +++ b/Engine/source/gfx/D3D11/gfxD3D11Shader.h @@ -77,17 +77,17 @@ enum REGISTER_TYPE struct ConstantDesc { - String Name; - S32 RegisterIndex; - S32 RegisterCount; - S32 Rows; - S32 Columns; - S32 Elements; - S32 StructMembers; - REGISTER_TYPE RegisterSet; - CONST_CLASS Class; - CONST_TYPE Type; - U32 Bytes; + String Name = String::EmptyString; + S32 RegisterIndex = 0; + S32 RegisterCount = 0; + S32 Rows = 0; + S32 Columns = 0; + S32 Elements = 0; + S32 StructMembers = 0; + REGISTER_TYPE RegisterSet = D3DRS_FLOAT4; + CONST_CLASS Class = D3DPC_SCALAR; + CONST_TYPE Type = D3DPT_FLOAT; + U32 Bytes = 0; }; class ConstantTable diff --git a/Engine/source/gfx/D3D11/gfxD3D11Target.cpp b/Engine/source/gfx/D3D11/gfxD3D11Target.cpp index 45aabbf07..29eb8fb46 100644 --- a/Engine/source/gfx/D3D11/gfxD3D11Target.cpp +++ b/Engine/source/gfx/D3D11/gfxD3D11Target.cpp @@ -324,6 +324,8 @@ GFXD3D11WindowTarget::GFXD3D11WindowTarget() mDepthStencilView = NULL; mDepthStencil = NULL; mBackBufferView = NULL; + mSwapChain = NULL; + dMemset(&mPresentationParams, 0, sizeof(mPresentationParams)); mSecondaryWindow = false; } diff --git a/Engine/source/gfx/D3D11/gfxD3D11TextureObject.cpp b/Engine/source/gfx/D3D11/gfxD3D11TextureObject.cpp index e2508eb40..27965a7da 100644 --- a/Engine/source/gfx/D3D11/gfxD3D11TextureObject.cpp +++ b/Engine/source/gfx/D3D11/gfxD3D11TextureObject.cpp @@ -46,10 +46,13 @@ GFXD3D11TextureObject::GFXD3D11TextureObject( GFXDevice * d, GFXTextureProfile * mLocked = false; mD3DSurface = NULL; + dMemset(&mLockRect, 0, sizeof(mLockRect)); + dMemset(&mLockBox, 0, sizeof(mLockBox)); mLockedSubresource = 0; mDSView = NULL; mRTView = NULL; mSRView = NULL; + isManaged = false; } GFXD3D11TextureObject::~GFXD3D11TextureObject() @@ -318,4 +321,4 @@ ID3D11RenderTargetView** GFXD3D11TextureObject::getRTViewPtr() ID3D11DepthStencilView** GFXD3D11TextureObject::getDSViewPtr() { return &mDSView; -} \ No newline at end of file +} diff --git a/Engine/source/gfx/D3D11/gfxD3D11VertexBuffer.h b/Engine/source/gfx/D3D11/gfxD3D11VertexBuffer.h index 380a0f93b..9e961cc87 100644 --- a/Engine/source/gfx/D3D11/gfxD3D11VertexBuffer.h +++ b/Engine/source/gfx/D3D11/gfxD3D11VertexBuffer.h @@ -68,10 +68,10 @@ inline GFXD3D11VertexBuffer::GFXD3D11VertexBuffer() : GFXVertexBuffer(0,0,0,0,(G mIsFirstLock = true; lockedVertexEnd = lockedVertexStart = 0; mClearAtFrameEnd = false; + mLockedBuffer = NULL; #ifdef TORQUE_DEBUG mDebugGuardBuffer = NULL; - mLockedBuffer = NULL; #endif } @@ -92,4 +92,4 @@ inline GFXD3D11VertexBuffer::GFXD3D11VertexBuffer( GFXDevice *device, #endif } -#endif // _GFXD3D_VERTEXBUFFER_H_ \ No newline at end of file +#endif // _GFXD3D_VERTEXBUFFER_H_ diff --git a/Engine/source/gfx/Null/gfxNullDevice.cpp b/Engine/source/gfx/Null/gfxNullDevice.cpp index 83933733c..8767d4eee 100644 --- a/Engine/source/gfx/Null/gfxNullDevice.cpp +++ b/Engine/source/gfx/Null/gfxNullDevice.cpp @@ -187,7 +187,7 @@ public: const GFXVertexFormat *vertexFormat, U32 vertexSize, GFXBufferType bufferType ) : - GFXVertexBuffer(device, numVerts, vertexFormat, vertexSize, bufferType) { }; + GFXVertexBuffer(device, numVerts, vertexFormat, vertexSize, bufferType) {tempBuf =NULL;}; virtual void lock(U32 vertexStart, U32 vertexEnd, void **vertexPtr); virtual void unlock(); virtual void prepare(); diff --git a/Engine/source/gfx/bitmap/ddsFile.h b/Engine/source/gfx/bitmap/ddsFile.h index 8e726c54a..7aae54ff4 100644 --- a/Engine/source/gfx/bitmap/ddsFile.h +++ b/Engine/source/gfx/bitmap/ddsFile.h @@ -176,7 +176,15 @@ struct DDSFile // For debugging fun! static S32 smActiveCopies; - DDSFile() + DDSFile(): + mBytesPerPixel(0), + mHeight(0), + mWidth(0), + mDepth(0), + mFormat(GFXFormat_FIRST), + mFourCC(0), + mMipMapCount(0), + mPitchOrLinearSize(0) { VECTOR_SET_ASSOCIATION( mSurfaces ); smActiveCopies++; @@ -203,4 +211,4 @@ struct DDSFile bool decompressToGBitmap(GBitmap *dest); }; -#endif // _DDSFILE_H_ \ No newline at end of file +#endif // _DDSFILE_H_ diff --git a/Engine/source/gfx/bitmap/gBitmap.cpp b/Engine/source/gfx/bitmap/gBitmap.cpp index fe73ecf7e..380070346 100644 --- a/Engine/source/gfx/bitmap/gBitmap.cpp +++ b/Engine/source/gfx/bitmap/gBitmap.cpp @@ -50,8 +50,7 @@ GBitmap::GBitmap() mNumMipLevels(0), mHasTransparency(false) { - for (U32 i = 0; i < c_maxMipLevels; i++) - mMipLevelOffsets[i] = 0xffffffff; + std::fill_n(mMipLevelOffsets, c_maxMipLevels, 0xffffffff); } GBitmap::GBitmap(const GBitmap& rCopy) diff --git a/Engine/source/gfx/bitmap/gBitmap.h b/Engine/source/gfx/bitmap/gBitmap.h index 7ff215a81..16cb24985 100644 --- a/Engine/source/gfx/bitmap/gBitmap.h +++ b/Engine/source/gfx/bitmap/gBitmap.h @@ -82,6 +82,9 @@ public: Registration() { + readFunc = NULL; + writeFunc = NULL; + defaultCompression = 0; priority = 0; VECTOR_SET_ASSOCIATION( extensions ); } diff --git a/Engine/source/gfx/bitmap/imageUtils.cpp b/Engine/source/gfx/bitmap/imageUtils.cpp index 2d9e7ab8d..ed8d108da 100644 --- a/Engine/source/gfx/bitmap/imageUtils.cpp +++ b/Engine/source/gfx/bitmap/imageUtils.cpp @@ -69,7 +69,6 @@ namespace ImageUtil { S32 width; S32 height; - S32 flags; const U8 *pSrc; U8 *pDst; GFXFormat format; @@ -306,4 +305,4 @@ namespace ImageUtil { return mFloor(mLog2(mMax(width, height))) + 1; } -} \ No newline at end of file +} diff --git a/Engine/source/gfx/gFont.cpp b/Engine/source/gfx/gFont.cpp index 9193b1e58..d64e1066e 100644 --- a/Engine/source/gfx/gFont.cpp +++ b/Engine/source/gfx/gFont.cpp @@ -198,14 +198,17 @@ GFont::GFont() VECTOR_SET_ASSOCIATION(mCharInfoList); VECTOR_SET_ASSOCIATION(mTextureSheets); - for (U32 i = 0; i < (sizeof(mRemapTable) / sizeof(S32)); i++) - mRemapTable[i] = -1; + std::fill_n(mRemapTable, Font_Table_MAX,-1); mCurX = mCurY = mCurSheet = -1; mPlatformFont = NULL; mSize = 0; mCharSet = 0; + mHeight = 0; + mBaseline = 0; + mAscent = 0; + mDescent = 0; mNeedSave = false; mMutex = Mutex::createMutex(); diff --git a/Engine/source/gfx/gFont.h b/Engine/source/gfx/gFont.h index b67d7e72f..2f5274af2 100644 --- a/Engine/source/gfx/gFont.h +++ b/Engine/source/gfx/gFont.h @@ -42,6 +42,7 @@ GFX_DeclareTextureProfile(GFXFontTextureProfile); +#define Font_Table_MAX 65536 class GFont { @@ -159,7 +160,7 @@ private: Vector mCharInfoList; /// Index remapping - S32 mRemapTable[65536]; + S32 mRemapTable[Font_Table_MAX]; }; inline U32 GFont::getCharXIncrement(const UTF16 in_charIndex) diff --git a/Engine/source/gfx/gfxAdapter.h b/Engine/source/gfx/gfxAdapter.h index a7988e910..80435618c 100644 --- a/Engine/source/gfx/gfxAdapter.h +++ b/Engine/source/gfx/gfxAdapter.h @@ -82,6 +82,7 @@ public: mShaderModel = 0.f; mIndex = 0; dMemset(&mLUID, '\0', sizeof(mLUID)); + mType = GFXAdapterType::NullDevice; } ~GFXAdapter() diff --git a/Engine/source/gfx/gfxCubemap.h b/Engine/source/gfx/gfxCubemap.h index 798251d12..b3c6eac0e 100644 --- a/Engine/source/gfx/gfxCubemap.h +++ b/Engine/source/gfx/gfxCubemap.h @@ -125,7 +125,7 @@ protected: GFXFormat mFormat; public: - + GFXCubemapArray() :mNumCubemaps(0), mSize(0), mMipMapLevels(0), mFormat(GFXFormat_FIRST) {} virtual ~GFXCubemapArray() {}; /// Initialize from an array of cubemaps virtual void init(GFXCubemapHandle *cubemaps, const U32 cubemapCount) = 0; diff --git a/Engine/source/gfx/gfxFontRenderBatcher.cpp b/Engine/source/gfx/gfxFontRenderBatcher.cpp index fd4cb11cb..4b7722b7e 100644 --- a/Engine/source/gfx/gfxFontRenderBatcher.cpp +++ b/Engine/source/gfx/gfxFontRenderBatcher.cpp @@ -25,6 +25,8 @@ FontRenderBatcher::FontRenderBatcher() : mStorage(8096) { + mFont = NULL; + mLength = 0; if (!mFontSB) { GFXStateBlockDesc f; @@ -246,4 +248,4 @@ void FontRenderBatcher::init( GFont *font, U32 n ) mFont = font; mLength = n; -} \ No newline at end of file +} diff --git a/Engine/source/gfx/gfxFormatUtils.h b/Engine/source/gfx/gfxFormatUtils.h index 9000dcf3a..4d5729f00 100644 --- a/Engine/source/gfx/gfxFormatUtils.h +++ b/Engine/source/gfx/gfxFormatUtils.h @@ -57,7 +57,7 @@ struct GFXFormatInfo /// If true, channels are in floating-point. bool mIsFloatingPoint; - Data() {} + Data() :mBytesPerPixel(0), mHasAlpha(false), mIsCompressed(false), mIsFloatingPoint(false) {} Data( U32 bpp, bool hasAlpha = false, bool isCompressed = false, bool isFP = false ) : mBytesPerPixel( bpp ), mHasAlpha( hasAlpha ), diff --git a/Engine/source/gfx/gfxStructs.h b/Engine/source/gfx/gfxStructs.h index 3f2602331..65d0781bb 100644 --- a/Engine/source/gfx/gfxStructs.h +++ b/Engine/source/gfx/gfxStructs.h @@ -159,7 +159,12 @@ struct GFXPrimitive GFXPrimitive() { - dMemset( this, 0, sizeof( GFXPrimitive ) ); + type = GFXPT_FIRST; + startVertex = 0; + minIndex = 0; + startIndex = 0; + numPrimitives = 0; + numVertices = 0; } }; diff --git a/Engine/source/gfx/gfxVertexBuffer.h b/Engine/source/gfx/gfxVertexBuffer.h index 329d0cf72..b37769ad5 100644 --- a/Engine/source/gfx/gfxVertexBuffer.h +++ b/Engine/source/gfx/gfxVertexBuffer.h @@ -68,6 +68,10 @@ public: mVertexSize( vertexSize ), mBufferType( bufferType ), mDevice( device ), + isLocked(false), + lockedVertexStart(0), + lockedVertexEnd(0), + lockedVertexPtr(NULL), mVolatileStart( 0 ) { if ( vertexFormat ) diff --git a/Engine/source/gfx/gfxVertexFormat.cpp b/Engine/source/gfx/gfxVertexFormat.cpp index 943813d3c..bafd56da4 100644 --- a/Engine/source/gfx/gfxVertexFormat.cpp +++ b/Engine/source/gfx/gfxVertexFormat.cpp @@ -77,6 +77,7 @@ GFXVertexFormat::GFXVertexFormat() mHasColor( false ), mHasTangent( false ), mHasInstancing( false ), + mHasBlendIndices(false), mTexCoordCount( 0 ), mSizeInBytes( 0 ), mDecl( NULL ) diff --git a/Engine/source/gfx/gl/gfxGLCircularVolatileBuffer.h b/Engine/source/gfx/gl/gfxGLCircularVolatileBuffer.h index a3d2cb1dd..6abeaf8e4 100644 --- a/Engine/source/gfx/gl/gfxGLCircularVolatileBuffer.h +++ b/Engine/source/gfx/gl/gfxGLCircularVolatileBuffer.h @@ -174,7 +174,8 @@ public: struct { - U32 mOffset, mSize; + U32 mOffset = 0; + U32 mSize = 0; }_getBufferData; void lock(const U32 size, U32 offsetAlign, U32 &outOffset, void* &outPtr) diff --git a/Engine/source/gfx/gl/gfxGLCubemap.cpp b/Engine/source/gfx/gl/gfxGLCubemap.cpp index 40bf88f91..541cd4fc7 100644 --- a/Engine/source/gfx/gl/gfxGLCubemap.cpp +++ b/Engine/source/gfx/gl/gfxGLCubemap.cpp @@ -41,6 +41,8 @@ static GLenum faceList[6] = GFXGLCubemap::GFXGLCubemap() : mCubemap(0), mDynamicTexSize(0), + mWidth(0), + mHeight(0), mFaceFormat( GFXFormatR8G8B8A8 ) { for(U32 i = 0; i < 6; i++) @@ -313,6 +315,7 @@ U8* GFXGLCubemap::getTextureData(U32 face, U32 mip) GFXGLCubemapArray::GFXGLCubemapArray() { + mCubemap = NULL; } GFXGLCubemapArray::~GFXGLCubemapArray() diff --git a/Engine/source/gfx/gl/gfxGLDevice.cpp b/Engine/source/gfx/gl/gfxGLDevice.cpp index 9c09d324f..0b1932f6e 100644 --- a/Engine/source/gfx/gl/gfxGLDevice.cpp +++ b/Engine/source/gfx/gl/gfxGLDevice.cpp @@ -235,6 +235,7 @@ GFXGLDevice::GFXGLDevice(U32 adapterIndex) : mActiveTextureType[i] = GL_ZERO; mNumVertexStream = 2; + mSupportsAnisotropic = false; for(int i = 0; i < GS_COUNT; ++i) mModelViewProjSC[i] = NULL; diff --git a/Engine/source/gfx/gl/gfxGLDeviceProfiler.cpp b/Engine/source/gfx/gl/gfxGLDeviceProfiler.cpp index 423fbcc6c..d12ddb923 100644 --- a/Engine/source/gfx/gl/gfxGLDeviceProfiler.cpp +++ b/Engine/source/gfx/gl/gfxGLDeviceProfiler.cpp @@ -53,7 +53,7 @@ public: typedef Data DataType; - GLTimer(GFXDevice *device, Data &data) : mData(&data) + GLTimer(GFXDevice *device, Data &data) : mName(NULL), mData(&data) { glGenQueries(1, &mQueryId); } diff --git a/Engine/source/gfx/gl/gfxGLPrimitiveBuffer.cpp b/Engine/source/gfx/gl/gfxGLPrimitiveBuffer.cpp index 3df694de9..1c1b81171 100644 --- a/Engine/source/gfx/gl/gfxGLPrimitiveBuffer.cpp +++ b/Engine/source/gfx/gl/gfxGLPrimitiveBuffer.cpp @@ -38,7 +38,9 @@ GLCircularVolatileBuffer* getCircularVolatileIndexBuffer() GFXGLPrimitiveBuffer::GFXGLPrimitiveBuffer(GFXDevice *device, U32 indexCount, U32 primitiveCount, GFXBufferType bufferType) : GFXPrimitiveBuffer(device, indexCount, primitiveCount, bufferType), mBufferOffset(0), - mZombieCache(NULL) + mZombieCache(NULL), + lockedIndexEnd(0), + lockedIndexStart(0) { if( mBufferType == GFXBufferTypeVolatile ) { @@ -185,4 +187,4 @@ MODULE_BEGIN( GFX_GL_PrimitiveBuffer ) { GFXDevice::getDeviceEventSignal( ).remove( &onGFXDeviceSignal ); } -MODULE_END \ No newline at end of file +MODULE_END diff --git a/Engine/source/gfx/gl/gfxGLShader.cpp b/Engine/source/gfx/gl/gfxGLShader.cpp index 267924163..5d9d4d380 100644 --- a/Engine/source/gfx/gl/gfxGLShader.cpp +++ b/Engine/source/gfx/gl/gfxGLShader.cpp @@ -69,6 +69,7 @@ public: GFXGLShaderConstHandle::GFXGLShaderConstHandle( GFXGLShader *shader ) : mShader( shader ), mLocation(0), mOffset(0), mSize(0), mSamplerNum(-1), mInstancingConstant(false) { + dMemset(&mDesc, 0, sizeof(mDesc)); mValid = false; } diff --git a/Engine/source/gfx/gl/gfxGLTextureObject.cpp b/Engine/source/gfx/gl/gfxGLTextureObject.cpp index e326664b3..a7bc1d4f7 100644 --- a/Engine/source/gfx/gl/gfxGLTextureObject.cpp +++ b/Engine/source/gfx/gl/gfxGLTextureObject.cpp @@ -33,15 +33,24 @@ GFXGLTextureObject::GFXGLTextureObject(GFXDevice * aDevice, GFXTextureProfile *profile) : GFXTextureObject(aDevice, profile), + mIsNPoT2(false), mBinding(GL_TEXTURE_2D), mBytesPerTexel(4), mLockedRectRect(0, 0, 0, 0), mGLDevice(static_cast(mDevice)), + mIsZombie(false), mZombieCache(NULL), mNeedInitSamplerState(true), mFrameAllocatorMark(0), mFrameAllocatorPtr(NULL) { + +#if TORQUE_DEBUG + mFrameAllocatorMarkGuard == FrameAllocator::getWaterMark(); +#endif + + dMemset(&mLockedRect, 0, sizeof(mLockedRect)); + AssertFatal(dynamic_cast(mDevice), "GFXGLTextureObject::GFXGLTextureObject - Invalid device type, expected GFXGLDevice!"); glGenTextures(1, &mHandle); glGenBuffers(1, &mBuffer); diff --git a/Engine/source/gfx/gl/gfxGLVertexDecl.h b/Engine/source/gfx/gl/gfxGLVertexDecl.h index 545694323..dd80dd852 100644 --- a/Engine/source/gfx/gl/gfxGLVertexDecl.h +++ b/Engine/source/gfx/gl/gfxGLVertexDecl.h @@ -7,7 +7,7 @@ class GFXGLDevice; class GFXGLVertexDecl : public GFXVertexDecl { public: - GFXGLVertexDecl() : mFormat(NULL), mVertexAttribActiveMask(0) {} + GFXGLVertexDecl() : mFormat(NULL), mVertexAttribActiveMask(0) { std::fill_n(mVertexSize, 4, 0); } void init(const GFXVertexFormat *format); void prepareVertexFormat() const; @@ -36,4 +36,4 @@ protected: void _initVerticesFormat2(); }; -#endif //GFX_GL_VERTEX_DECL \ No newline at end of file +#endif //GFX_GL_VERTEX_DECL diff --git a/Engine/source/gfx/video/theoraTexture.cpp b/Engine/source/gfx/video/theoraTexture.cpp index 4ac7bb41e..1b85837b7 100644 --- a/Engine/source/gfx/video/theoraTexture.cpp +++ b/Engine/source/gfx/video/theoraTexture.cpp @@ -278,7 +278,9 @@ bool TheoraTexture::AsyncState::isAtEnd() TheoraTexture::TheoraTexture() : mCurrentFrame( NULL ), mPlaybackQueue( NULL ), - mIsPaused( true ) + mIsPaused( true ), + mLastFrameNumber(0), + mNumDroppedFrames(0) { GFXTextureManager::addEventDelegate( this, &TheoraTexture::_onTextureEvent ); } diff --git a/Engine/source/gfx/video/videoCapture.cpp b/Engine/source/gfx/video/videoCapture.cpp index c147cf8ae..101f784e3 100644 --- a/Engine/source/gfx/video/videoCapture.cpp +++ b/Engine/source/gfx/video/videoCapture.cpp @@ -52,12 +52,16 @@ MODULE_BEGIN( VideoCapture ) MODULE_END; -VideoCapture::VideoCapture() : +VideoCapture::VideoCapture() : + mCapturedFramePos(-1.0f), mEncoder(NULL), mFrameGrabber(NULL), mCanvas(NULL), mIsRecording(false), + mVideoCaptureStartTime(0), + mNextFramePosition(0.0f), mFrameRate(30.0f), + mMsPerFrame(1000.0f / mFrameRate), mResolution(0,0), mWaitingForCanvas(false), mEncoderName("THEORA"), diff --git a/Engine/source/gfx/video/videoCapture.h b/Engine/source/gfx/video/videoCapture.h index 7f46b133f..ca3598067 100644 --- a/Engine/source/gfx/video/videoCapture.h +++ b/Engine/source/gfx/video/videoCapture.h @@ -126,12 +126,12 @@ private: /// Frame to be captured next F32 mNextFramePosition; - /// The per-frame time (in milliseconds) - F32 mMsPerFrame; - /// The framerate we'll use to record F32 mFrameRate; + /// The per-frame time (in milliseconds) + F32 mMsPerFrame; + /// Accumulated error when converting the per-frame-time to integer /// this is used to dither the value and keep overall time advancing /// correct diff --git a/Engine/source/gfx/video/videoEncoderTheora.cpp b/Engine/source/gfx/video/videoEncoderTheora.cpp index f3c1e4674..d64f76487 100644 --- a/Engine/source/gfx/video/videoEncoderTheora.cpp +++ b/Engine/source/gfx/video/videoEncoderTheora.cpp @@ -195,6 +195,11 @@ public: VideoEncoderTheora() : mCurrentFrame(0), td(NULL), mLastFrame(NULL) { + dMemset(&to, 0, sizeof(to)); + dMemset(&ti, 0, sizeof(ti)); + dMemset(&tc, 0, sizeof(tc)); + dMemset(&mBuffer, 0, sizeof(mBuffer)); + setStatus(false); } @@ -458,4 +463,4 @@ public: REGISTER_VIDEO_ENCODER(VideoEncoderTheora, THEORA) -#endif \ No newline at end of file +#endif From 9fef1b3cd1908262bdfc8e0b67474a60ffb2394f Mon Sep 17 00:00:00 2001 From: AzaezelX Date: Mon, 11 May 2020 15:03:27 -0500 Subject: [PATCH 07/25] uninitialized variables-gui --- Engine/source/gui/3d/guiTSControl.cpp | 2 ++ Engine/source/gui/buttons/guiButtonCtrl.cpp | 3 ++- Engine/source/gui/containers/guiAutoScrollCtrl.cpp | 4 +++- Engine/source/gui/containers/guiFormCtrl.cpp | 1 + Engine/source/gui/containers/guiFrameCtrl.h | 4 ---- Engine/source/gui/containers/guiRolloutCtrl.cpp | 3 +++ Engine/source/gui/containers/guiScrollCtrl.cpp | 14 +++++++++++++- Engine/source/gui/containers/guiWindowCtrl.cpp | 5 +++++ Engine/source/gui/controls/guiDecoyCtrl.cpp | 5 +++-- Engine/source/gui/controls/guiPopUpCtrl.cpp | 4 ++++ Engine/source/gui/controls/guiPopUpCtrlEx.cpp | 4 ++++ Engine/source/gui/controls/guiSliderCtrl.cpp | 4 +++- Engine/source/gui/controls/guiTabPageCtrl.cpp | 1 + .../gui/controls/guiTextEditSliderBitmapCtrl.cpp | 4 +++- .../source/gui/controls/guiTextEditSliderCtrl.cpp | 1 + Engine/source/gui/core/guiCanvas.cpp | 1 + Engine/source/gui/core/guiScriptNotifyControl.cpp | 2 ++ Engine/source/gui/core/guiTypes.cpp | 1 + Engine/source/gui/editor/guiDebugger.cpp | 6 ++++++ Engine/source/gui/editor/guiEditCtrl.cpp | 14 +++++++++++++- Engine/source/gui/editor/guiInspectorTypes.cpp | 2 +- Engine/source/gui/editor/guiParticleGraphCtrl.cpp | 2 ++ Engine/source/gui/editor/guiPopupMenuCtrl.cpp | 3 ++- Engine/source/gui/editor/guiShapeEdPreview.cpp | 1 + Engine/source/gui/editor/inspector/customField.cpp | 4 +++- Engine/source/gui/editor/inspector/dynamicField.h | 2 +- Engine/source/gui/editor/inspector/dynamicGroup.h | 4 ++-- Engine/source/gui/editor/inspector/field.cpp | 6 +++++- .../source/gui/editor/inspector/variableField.cpp | 5 ++++- Engine/source/gui/game/guiMessageVectorCtrl.cpp | 1 + Engine/source/gui/game/guiProgressBitmapCtrl.cpp | 4 +++- Engine/source/gui/utility/guiBubbleTextCtrl.h | 2 +- Engine/source/gui/worldEditor/creator.cpp | 4 +++- Engine/source/gui/worldEditor/editTSCtrl.cpp | 2 +- Engine/source/gui/worldEditor/gizmo.cpp | 12 +++++++++--- Engine/source/gui/worldEditor/gizmo.h | 2 +- .../gui/worldEditor/guiConvexShapeEditorCtrl.cpp | 1 + .../gui/worldEditor/guiConvexShapeEditorCtrl.h | 2 +- Engine/source/gui/worldEditor/guiMissionArea.h | 2 +- Engine/source/gui/worldEditor/terrainActions.cpp | 4 ++-- Engine/source/gui/worldEditor/terrainActions.h | 2 +- Engine/source/gui/worldEditor/undoActions.cpp | 1 + Engine/source/gui/worldEditor/worldEditor.h | 1 + 43 files changed, 119 insertions(+), 33 deletions(-) diff --git a/Engine/source/gui/3d/guiTSControl.cpp b/Engine/source/gui/3d/guiTSControl.cpp index 0be010272..7183e0877 100644 --- a/Engine/source/gui/3d/guiTSControl.cpp +++ b/Engine/source/gui/3d/guiTSControl.cpp @@ -164,6 +164,8 @@ GuiTSCtrl::GuiTSCtrl() mLastCameraQuery.hasStereoTargets = false; mLastCameraQuery.ortho = false; + mOrthoWidth = 0.1f; + mOrthoHeight = 0.1f; } //----------------------------------------------------------------------------- diff --git a/Engine/source/gui/buttons/guiButtonCtrl.cpp b/Engine/source/gui/buttons/guiButtonCtrl.cpp index 14d6f1aa7..c0d5f4e08 100644 --- a/Engine/source/gui/buttons/guiButtonCtrl.cpp +++ b/Engine/source/gui/buttons/guiButtonCtrl.cpp @@ -58,6 +58,7 @@ GuiButtonCtrl::GuiButtonCtrl() { setExtent(140, 30); mButtonText = StringTable->EmptyString(); + mHasTheme = false; } //----------------------------------------------------------------------------- @@ -121,4 +122,4 @@ void GuiButtonCtrl::onRender(Point2I offset, //render the children renderChildControls( offset, updateRect); -} \ No newline at end of file +} diff --git a/Engine/source/gui/containers/guiAutoScrollCtrl.cpp b/Engine/source/gui/containers/guiAutoScrollCtrl.cpp index 08104d0f3..5d252bc53 100644 --- a/Engine/source/gui/containers/guiAutoScrollCtrl.cpp +++ b/Engine/source/gui/containers/guiAutoScrollCtrl.cpp @@ -90,8 +90,10 @@ EndImplementEnumType; GuiAutoScrollCtrl::GuiAutoScrollCtrl() : mDirection( Up ), mIsLooping( true ), - mCurrentPhase( PhaseComplete ), + mCurrentPhase( GuiAutoScrollCtrl::PhaseComplete ), mCurrentTime( 0.f ), + mCompleteTime(FLT_MAX), + mCurrentPosition(0.0f), mStartDelay( 3.f ), mResetDelay( 5.f ), mChildBorder( 10 ), diff --git a/Engine/source/gui/containers/guiFormCtrl.cpp b/Engine/source/gui/containers/guiFormCtrl.cpp index 0c562d49d..4cbb7ffa9 100644 --- a/Engine/source/gui/containers/guiFormCtrl.cpp +++ b/Engine/source/gui/containers/guiFormCtrl.cpp @@ -59,6 +59,7 @@ GuiFormCtrl::GuiFormCtrl() // The attached menu bar mHasMenu = false; mMenuBar = NULL; + mMouseMovingWin = false; } GuiFormCtrl::~GuiFormCtrl() diff --git a/Engine/source/gui/containers/guiFrameCtrl.h b/Engine/source/gui/containers/guiFrameCtrl.h index 682946198..8f5ff99db 100644 --- a/Engine/source/gui/containers/guiFrameCtrl.h +++ b/Engine/source/gui/containers/guiFrameCtrl.h @@ -114,10 +114,6 @@ protected: /* member variables */ Vector mColumnOffsets; Vector mRowOffsets; - GuiCursor *mMoveCursor; - GuiCursor *mUpDownCursor; - GuiCursor *mLeftRightCursor; - GuiCursor *mDefaultCursor; FrameDetail mFramesetDetails; VectorPtr mFrameDetails; bool mAutoBalance; diff --git a/Engine/source/gui/containers/guiRolloutCtrl.cpp b/Engine/source/gui/containers/guiRolloutCtrl.cpp index 6f2272d9a..095a6a358 100644 --- a/Engine/source/gui/containers/guiRolloutCtrl.cpp +++ b/Engine/source/gui/containers/guiRolloutCtrl.cpp @@ -74,7 +74,10 @@ GuiRolloutCtrl::GuiRolloutCtrl() mIsContainer = true; mCanCollapse = true; mAutoCollapseSiblings = false; + mDefaultCursor = NULL; + mVertSizingCursor = NULL; mHasTexture = false; + mBitmapBounds = NULL; // Make sure we receive our ticks. setProcessTicks(); } diff --git a/Engine/source/gui/containers/guiScrollCtrl.cpp b/Engine/source/gui/containers/guiScrollCtrl.cpp index bea540e19..a52a5816e 100644 --- a/Engine/source/gui/containers/guiScrollCtrl.cpp +++ b/Engine/source/gui/containers/guiScrollCtrl.cpp @@ -74,10 +74,22 @@ GuiScrollCtrl::GuiScrollCtrl() mChildPos(0, 0), mChildExt(0, 0), mScrollTargetPos( -1, -1 ), - mBaseThumbSize(0) + mBaseThumbSize(0), + mHBarEnabled(false), + mVBarEnabled(false), + mHasHScrollBar(false), + mHasVScrollBar(false), + mHThumbSize(1), + mHThumbPos(0), + mVThumbSize(1), + mVThumbPos(0), + mThumbMouseDelta(0) { + mBitmapBounds = NULL; mIsContainer = true; setExtent(200,200); + mLastPreRender = Platform::getVirtualMilliseconds(); + mLastUpdated = Platform::getVirtualMilliseconds(); } //----------------------------------------------------------------------------- diff --git a/Engine/source/gui/containers/guiWindowCtrl.cpp b/Engine/source/gui/containers/guiWindowCtrl.cpp index 20af7fc2e..17000909b 100644 --- a/Engine/source/gui/containers/guiWindowCtrl.cpp +++ b/Engine/source/gui/containers/guiWindowCtrl.cpp @@ -116,6 +116,11 @@ GuiWindowCtrl::GuiWindowCtrl() mMaximizeButtonPressed = false; mMinimizeButtonPressed = false; + mRepositionWindow = false; + mResizeWindow = false; + mSnapSignal = false; + mPreCollapsedYExtent = 200; + mPreCollapsedYMinExtent = 176; mText = "New Window"; } diff --git a/Engine/source/gui/controls/guiDecoyCtrl.cpp b/Engine/source/gui/controls/guiDecoyCtrl.cpp index f7fd881e8..61b489995 100644 --- a/Engine/source/gui/controls/guiDecoyCtrl.cpp +++ b/Engine/source/gui/controls/guiDecoyCtrl.cpp @@ -54,7 +54,8 @@ ConsoleDocClass( GuiDecoyCtrl, GuiDecoyCtrl::GuiDecoyCtrl() : mMouseOver(false), mIsDecoy(true), - mDecoyReference(NULL) + mDecoyReference(NULL), + mMouseOverDecoy(false) { } @@ -235,4 +236,4 @@ void GuiDecoyCtrl::onMiddleMouseUp(const GuiEvent &) void GuiDecoyCtrl::onMiddleMouseDragged(const GuiEvent &) { -} \ No newline at end of file +} diff --git a/Engine/source/gui/controls/guiPopUpCtrl.cpp b/Engine/source/gui/controls/guiPopUpCtrl.cpp index 418f1a0de..40649b920 100644 --- a/Engine/source/gui/controls/guiPopUpCtrl.cpp +++ b/Engine/source/gui/controls/guiPopUpCtrl.cpp @@ -280,6 +280,10 @@ GuiPopUpMenuCtrl::GuiPopUpMenuCtrl(void) mBitmapName = StringTable->EmptyString(); // Added mBitmapBounds.set(16, 16); // Added mIdMax = -1; + mBackground = NULL; + mTl = NULL; + mSc = NULL; + mReplaceText = false; } //------------------------------------------------------------------------------ diff --git a/Engine/source/gui/controls/guiPopUpCtrlEx.cpp b/Engine/source/gui/controls/guiPopUpCtrlEx.cpp index bec481163..bd8462ecd 100644 --- a/Engine/source/gui/controls/guiPopUpCtrlEx.cpp +++ b/Engine/source/gui/controls/guiPopUpCtrlEx.cpp @@ -332,6 +332,10 @@ GuiPopUpMenuCtrlEx::GuiPopUpMenuCtrlEx(void) mBitmapBounds.set(16, 16); // Added mHotTrackItems = false; mIdMax = -1; + mBackground = NULL; + mTl = NULL; + mSc = NULL; + mReplaceText = false; } //------------------------------------------------------------------------------ diff --git a/Engine/source/gui/controls/guiSliderCtrl.cpp b/Engine/source/gui/controls/guiSliderCtrl.cpp index d84d6311b..3b2090427 100644 --- a/Engine/source/gui/controls/guiSliderCtrl.cpp +++ b/Engine/source/gui/controls/guiSliderCtrl.cpp @@ -100,8 +100,10 @@ GuiSliderCtrl::GuiSliderCtrl() mMouseOver( false ), mDepressed( false ), mMouseDragged( false ), + mHasTexture(false), mUseFillBar(false), - mFillBarColor(ColorI(255,255,255)) + mFillBarColor(ColorI(255,255,255)), + mBitmapBounds(NULL) { } diff --git a/Engine/source/gui/controls/guiTabPageCtrl.cpp b/Engine/source/gui/controls/guiTabPageCtrl.cpp index c87363cde..b8c84ff0b 100644 --- a/Engine/source/gui/controls/guiTabPageCtrl.cpp +++ b/Engine/source/gui/controls/guiTabPageCtrl.cpp @@ -53,6 +53,7 @@ GuiTabPageCtrl::GuiTabPageCtrl(void) dStrcpy(mText,(UTF8*)"TabPage", MAX_STRING_LENGTH); mActive = true; mIsContainer = true; + mTabIndex = -1; } void GuiTabPageCtrl::initPersistFields() diff --git a/Engine/source/gui/controls/guiTextEditSliderBitmapCtrl.cpp b/Engine/source/gui/controls/guiTextEditSliderBitmapCtrl.cpp index 37ed5fe54..055b7890f 100644 --- a/Engine/source/gui/controls/guiTextEditSliderBitmapCtrl.cpp +++ b/Engine/source/gui/controls/guiTextEditSliderBitmapCtrl.cpp @@ -95,6 +95,8 @@ GuiTextEditSliderBitmapCtrl::GuiTextEditSliderBitmapCtrl() mTextAreaHit = None; mFocusOnMouseWheel = false; mBitmapName = StringTable->insert( "" ); + mMouseDownTime = 0; + mNumberOfBitmaps = 0; } GuiTextEditSliderBitmapCtrl::~GuiTextEditSliderBitmapCtrl() @@ -444,4 +446,4 @@ void GuiTextEditSliderBitmapCtrl::setBitmap(const char *name) if(awake) onWake(); setUpdate(); -} \ No newline at end of file +} diff --git a/Engine/source/gui/controls/guiTextEditSliderCtrl.cpp b/Engine/source/gui/controls/guiTextEditSliderCtrl.cpp index a3e9c884f..599678fc3 100644 --- a/Engine/source/gui/controls/guiTextEditSliderCtrl.cpp +++ b/Engine/source/gui/controls/guiTextEditSliderCtrl.cpp @@ -62,6 +62,7 @@ GuiTextEditSliderCtrl::GuiTextEditSliderCtrl() mFormat = StringTable->insert("%3.2f"); mTextAreaHit = None; mFocusOnMouseWheel = false; + mMouseDownTime = 0.0f; } GuiTextEditSliderCtrl::~GuiTextEditSliderCtrl() diff --git a/Engine/source/gui/core/guiCanvas.cpp b/Engine/source/gui/core/guiCanvas.cpp index 7e8d95190..a7d5442e5 100644 --- a/Engine/source/gui/core/guiCanvas.cpp +++ b/Engine/source/gui/core/guiCanvas.cpp @@ -150,6 +150,7 @@ GuiCanvas::GuiCanvas(): GuiControl(), #else mNumFences = 0; #endif + mConsumeLastInputEvent = false; } GuiCanvas::~GuiCanvas() diff --git a/Engine/source/gui/core/guiScriptNotifyControl.cpp b/Engine/source/gui/core/guiScriptNotifyControl.cpp index bd1cc63de..93ec5bb90 100644 --- a/Engine/source/gui/core/guiScriptNotifyControl.cpp +++ b/Engine/source/gui/core/guiScriptNotifyControl.cpp @@ -57,6 +57,8 @@ GuiScriptNotifyCtrl::GuiScriptNotifyCtrl() mOnResize = false; mOnChildResized = false; mOnParentResized = false; + mOnLoseFirstResponder = true; + mOnGainFirstResponder = true; } GuiScriptNotifyCtrl::~GuiScriptNotifyCtrl() diff --git a/Engine/source/gui/core/guiTypes.cpp b/Engine/source/gui/core/guiTypes.cpp index 7fbbe62c0..7ef0ef4ad 100644 --- a/Engine/source/gui/core/guiTypes.cpp +++ b/Engine/source/gui/core/guiTypes.cpp @@ -79,6 +79,7 @@ GuiCursor::GuiCursor() mRenderOffset.set(0.0f,0.0f); mExtent.set(1,1); mTextureObject = NULL; + mBitmapName = StringTable->EmptyString(); } GuiCursor::~GuiCursor() diff --git a/Engine/source/gui/editor/guiDebugger.cpp b/Engine/source/gui/editor/guiDebugger.cpp index 7c60d4359..4ad0e6683 100644 --- a/Engine/source/gui/editor/guiDebugger.cpp +++ b/Engine/source/gui/editor/guiDebugger.cpp @@ -64,6 +64,12 @@ DbgFileView::DbgFileView() mFindLineNumber = -1; mSize.set(1, 0); + mbMouseDragging = false; + mMouseDownChar = -1; + mMouseOverVariable[0] = '\0'; + mMouseOverValue[0] = '\0'; + mMouseVarStart = -1; + mMouseVarEnd = -1; } DefineEngineMethod(DbgFileView, setCurrentLine, void, (S32 line, bool selected), , "(int line, bool selected)" diff --git a/Engine/source/gui/editor/guiEditCtrl.cpp b/Engine/source/gui/editor/guiEditCtrl.cpp index 208c9b4fc..6be77962c 100644 --- a/Engine/source/gui/editor/guiEditCtrl.cpp +++ b/Engine/source/gui/editor/guiEditCtrl.cpp @@ -101,7 +101,9 @@ GuiEditCtrl::GuiEditCtrl() mDrawBorderLines( true ), mFullBoxSelection( false ), mSnapSensitivity( 2 ), - mDrawGuides( true ) + mDrawGuides( true ), + mDragAddSelection(false), + mDragMoveUndo(false) { VECTOR_SET_ASSOCIATION( mSelectedControls ); VECTOR_SET_ASSOCIATION( mDragBeginPoints ); @@ -116,11 +118,21 @@ GuiEditCtrl::GuiEditCtrl() mDragGuide[ GuideVertical ] = false; mDragGuide[ GuideHorizontal ] = false; + mDragGuideIndex[0] = 0; + mDragGuideIndex[1] = 1; + + std::fill_n(mSnapOffset, 2, 0); + std::fill_n(mSnapEdge, 2, SnapEdgeMin); if( !smGuidesPropertyName[ GuideVertical ] ) smGuidesPropertyName[ GuideVertical ] = StringTable->insert( "guidesVertical" ); if( !smGuidesPropertyName[ GuideHorizontal ] ) smGuidesPropertyName[ GuideHorizontal ] = StringTable->insert( "guidesHorizontal" ); + + mTrash = NULL; + mSelectedSet = NULL; + mMouseDownMode = GuiEditCtrl::Selecting; + mSizingMode = GuiEditCtrl::sizingNone; } //----------------------------------------------------------------------------- diff --git a/Engine/source/gui/editor/guiInspectorTypes.cpp b/Engine/source/gui/editor/guiInspectorTypes.cpp index 0e8f341a4..818df2ba1 100644 --- a/Engine/source/gui/editor/guiInspectorTypes.cpp +++ b/Engine/source/gui/editor/guiInspectorTypes.cpp @@ -1087,7 +1087,7 @@ bool GuiInspectorTypeEaseF::updateRects() // GuiInspectorTypeColor (Base for ColorI/LinearColorF) //----------------------------------------------------------------------------- GuiInspectorTypeColor::GuiInspectorTypeColor() - : mBrowseButton( NULL ) + : mColorFunction(NULL), mBrowseButton( NULL ) { } diff --git a/Engine/source/gui/editor/guiParticleGraphCtrl.cpp b/Engine/source/gui/editor/guiParticleGraphCtrl.cpp index 4b71a1518..d27be2f1a 100644 --- a/Engine/source/gui/editor/guiParticleGraphCtrl.cpp +++ b/Engine/source/gui/editor/guiParticleGraphCtrl.cpp @@ -102,6 +102,8 @@ GuiParticleGraphCtrl::GuiParticleGraphCtrl() mPointXMovementClamped = false; mOutlineColor = ColorI(1, 1, 1); mCursorPos = Point2I(0, 0); + mTooltipSelectedPlot = 0; + mRenderNextGraphTooltip = false; } ImplementEnumType( GuiParticleGraphType, diff --git a/Engine/source/gui/editor/guiPopupMenuCtrl.cpp b/Engine/source/gui/editor/guiPopupMenuCtrl.cpp index 9fb25c497..e405864cf 100644 --- a/Engine/source/gui/editor/guiPopupMenuCtrl.cpp +++ b/Engine/source/gui/editor/guiPopupMenuCtrl.cpp @@ -95,6 +95,7 @@ GuiPopupMenuTextListCtrl::GuiPopupMenuTextListCtrl() mPopup = nullptr; mLastHighlightedMenuIdx = -1; + mBackground = NULL; } void GuiPopupMenuTextListCtrl::onRenderCell(Point2I offset, Point2I cell, bool selected, bool mouseOver) @@ -258,4 +259,4 @@ void GuiPopupMenuTextListCtrl::onCellHighlighted(Point2I cell) list->mSubMenu->showPopup(getRoot(), getPosition().x + mCellSize.x, getPosition().y + (selectionIndex * mCellSize.y)); } } -} \ No newline at end of file +} diff --git a/Engine/source/gui/editor/guiShapeEdPreview.cpp b/Engine/source/gui/editor/guiShapeEdPreview.cpp index bb83d85d7..5f8a80279 100644 --- a/Engine/source/gui/editor/guiShapeEdPreview.cpp +++ b/Engine/source/gui/editor/guiShapeEdPreview.cpp @@ -69,6 +69,7 @@ GuiShapeEdPreview::GuiShapeEdPreview() mRenderNodes( false ), mRenderBounds( false ), mRenderObjBox( false ), + mRenderColMeshes( false ), mRenderMounts( true ), mSunDiffuseColor( 255, 255, 255, 255 ), mSelectedNode( -1 ), diff --git a/Engine/source/gui/editor/inspector/customField.cpp b/Engine/source/gui/editor/inspector/customField.cpp index 27feb7ebe..ac92f37bd 100644 --- a/Engine/source/gui/editor/inspector/customField.cpp +++ b/Engine/source/gui/editor/inspector/customField.cpp @@ -42,13 +42,15 @@ GuiInspectorCustomField::GuiInspectorCustomField( GuiInspector *inspector, { mInspector = inspector; mParent = parent; - setBounds(0,0,100,20); + setBounds(0,0,100,20); + mDoc = StringTable->insert("no Docs Found!"); } GuiInspectorCustomField::GuiInspectorCustomField() { mInspector = NULL; mParent = NULL; + mDoc = StringTable->insert("no Docs Found!"); } void GuiInspectorCustomField::setData( const char* data, bool callbacks ) diff --git a/Engine/source/gui/editor/inspector/dynamicField.h b/Engine/source/gui/editor/inspector/dynamicField.h index 405717295..477873395 100644 --- a/Engine/source/gui/editor/inspector/dynamicField.h +++ b/Engine/source/gui/editor/inspector/dynamicField.h @@ -34,7 +34,7 @@ class GuiInspectorDynamicField : public GuiInspectorField public: GuiInspectorDynamicField( GuiInspector *inspector, GuiInspectorGroup* parent, SimFieldDictionary::Entry* field ); - GuiInspectorDynamicField() {}; + GuiInspectorDynamicField() :mDynField(NULL), mDeleteButton(NULL) {}; ~GuiInspectorDynamicField() {}; DECLARE_CONOBJECT( GuiInspectorDynamicField ); diff --git a/Engine/source/gui/editor/inspector/dynamicGroup.h b/Engine/source/gui/editor/inspector/dynamicGroup.h index 65708159d..fdc8d19c2 100644 --- a/Engine/source/gui/editor/inspector/dynamicGroup.h +++ b/Engine/source/gui/editor/inspector/dynamicGroup.h @@ -37,9 +37,9 @@ private: public: DECLARE_CONOBJECT(GuiInspectorDynamicGroup); - GuiInspectorDynamicGroup() { /*mNeedScroll=false;*/ }; + GuiInspectorDynamicGroup() { mAddCtrl = NULL;/*mNeedScroll=false;*/ }; GuiInspectorDynamicGroup( StringTableEntry groupName, SimObjectPtr parent ) - : GuiInspectorGroup( groupName, parent) { /*mNeedScroll=false;*/}; + : GuiInspectorGroup( groupName, parent) { mAddCtrl = NULL;/*mNeedScroll=false;*/}; //----------------------------------------------------------------------------- // inspectGroup is overridden in GuiInspectorDynamicGroup to inspect an diff --git a/Engine/source/gui/editor/inspector/field.cpp b/Engine/source/gui/editor/inspector/field.cpp index ccbb2f55f..84fc4ccfc 100644 --- a/Engine/source/gui/editor/inspector/field.cpp +++ b/Engine/source/gui/editor/inspector/field.cpp @@ -52,7 +52,11 @@ GuiInspectorField::GuiInspectorField( GuiInspector* inspector, mEdit( NULL ), mTargetObject(NULL), mUseHeightOverride(false), - mHeightOverride(18) + mHighlighted(false), + mHeightOverride(18), + mSpecialEditField(false), + mVariableName(StringTable->EmptyString()), + mCallbackName(StringTable->EmptyString()) { if( field != NULL ) mCaption = field->pFieldname; diff --git a/Engine/source/gui/editor/inspector/variableField.cpp b/Engine/source/gui/editor/inspector/variableField.cpp index 8f39fb65d..63ed1cb1d 100644 --- a/Engine/source/gui/editor/inspector/variableField.cpp +++ b/Engine/source/gui/editor/inspector/variableField.cpp @@ -41,7 +41,10 @@ ConsoleDocClass( GuiInspectorVariableField, "@internal" ); -GuiInspectorVariableField::GuiInspectorVariableField() +GuiInspectorVariableField::GuiInspectorVariableField() + : mVariableName(StringTable->EmptyString()), + mSetCallbackName(StringTable->EmptyString()), + mOwnerObject(NULL) { } diff --git a/Engine/source/gui/game/guiMessageVectorCtrl.cpp b/Engine/source/gui/game/guiMessageVectorCtrl.cpp index 9f5f45800..2b2d12fc0 100644 --- a/Engine/source/gui/game/guiMessageVectorCtrl.cpp +++ b/Engine/source/gui/game/guiMessageVectorCtrl.cpp @@ -164,6 +164,7 @@ GuiMessageVectorCtrl::GuiMessageVectorCtrl() VECTOR_SET_ASSOCIATION(mLineElements); mMessageVector = NULL; + mMinSensibleWidth = 1; mLineSpacingPixels = 0; mLineContinuationIndent = 10; diff --git a/Engine/source/gui/game/guiProgressBitmapCtrl.cpp b/Engine/source/gui/game/guiProgressBitmapCtrl.cpp index df06e242d..1d7d621e7 100644 --- a/Engine/source/gui/game/guiProgressBitmapCtrl.cpp +++ b/Engine/source/gui/game/guiProgressBitmapCtrl.cpp @@ -121,7 +121,9 @@ GuiProgressBitmapCtrl::GuiProgressBitmapCtrl() : mProgress( 0.f ), mBitmapName( StringTable->EmptyString() ), mUseVariable( false ), - mTile( false ) + mTile( false ), + mNumberOfBitmaps(0), + mDim(0) { } diff --git a/Engine/source/gui/utility/guiBubbleTextCtrl.h b/Engine/source/gui/utility/guiBubbleTextCtrl.h index 909644c74..c8175d0f7 100644 --- a/Engine/source/gui/utility/guiBubbleTextCtrl.h +++ b/Engine/source/gui/utility/guiBubbleTextCtrl.h @@ -52,7 +52,7 @@ class GuiBubbleTextCtrl : public GuiTextCtrl DECLARE_DESCRIPTION( "A single-line text control that displays its text in a multi-line\n" "popup when clicked." ); - GuiBubbleTextCtrl() { mInAction = false; } + GuiBubbleTextCtrl() :mInAction(false), mDlg(NULL), mPopup(NULL), mMLText(NULL) {} virtual void onMouseDown(const GuiEvent &event); }; diff --git a/Engine/source/gui/worldEditor/creator.cpp b/Engine/source/gui/worldEditor/creator.cpp index 99264f4ba..c268787eb 100644 --- a/Engine/source/gui/worldEditor/creator.cpp +++ b/Engine/source/gui/worldEditor/creator.cpp @@ -146,7 +146,9 @@ S32 CreatorTree::Node::getSelected() CreatorTree::CreatorTree() : mCurId(0), mRoot(0), - mTxtOffset(5) + mTxtOffset(5), + mTabSize(11), + mMaxWidth(0) { VECTOR_SET_ASSOCIATION(mNodeList); clear(); diff --git a/Engine/source/gui/worldEditor/editTSCtrl.cpp b/Engine/source/gui/worldEditor/editTSCtrl.cpp index 8d9f98809..fbe4ff090 100644 --- a/Engine/source/gui/worldEditor/editTSCtrl.cpp +++ b/Engine/source/gui/worldEditor/editTSCtrl.cpp @@ -106,7 +106,7 @@ EditTSCtrl::EditTSCtrl() mMiddleMouseDown = false; mMiddleMouseTriggered = false; mMouseLeft = false; - + mLastMouseClamping = false; mBlendSB = NULL; } diff --git a/Engine/source/gui/worldEditor/gizmo.cpp b/Engine/source/gui/worldEditor/gizmo.cpp index 4b0ac19ab..7bfe554c4 100644 --- a/Engine/source/gui/worldEditor/gizmo.cpp +++ b/Engine/source/gui/worldEditor/gizmo.cpp @@ -202,6 +202,7 @@ GizmoProfile::GizmoProfile() centroidColor.set( 255, 255, 255 ); centroidHighlightColor.set( 255, 0, 255 ); + hideDisabledAxes = true; restoreDefaultState(); } @@ -297,6 +298,7 @@ Gizmo::Gizmo() mObjectMat( true ), mTransform( true ), mCameraMat( true ), + mProjLen(1000.0f), mSelectionIdx( -1 ), mObjectMatInv( true ), mCurrentTransform( true ), @@ -308,10 +310,13 @@ Gizmo::Gizmo() mCurrentAlignment( World ), mDeltaTotalScale( 0,0,0 ), mDeltaTotalRot( 0,0,0 ), + mDeltaAngle(0.0f), + mLastAngle(0.0f), mDeltaTotalPos( 0,0,0 ), mCurrentMode( MoveMode ), mMouseDownPos( -1,-1 ), mDirty( false ), + mSign(0.0f), mMouseDown( false ), mLastWorldMat( true ), mLastProjMat( true ), @@ -324,9 +329,10 @@ Gizmo::Gizmo() mHighlightAll( false ), mMoveGridEnabled( true ), mMoveGridSize( 20.f ), - mMoveGridSpacing( 1.f ) -{ - mUniformHandleEnabled = true; + mMoveGridSpacing( 1.f ), + mUniformHandleEnabled(true), + mScreenRotateHandleEnabled(false) +{ mAxisEnabled[0] = mAxisEnabled[1] = mAxisEnabled[2] = true; } diff --git a/Engine/source/gui/worldEditor/gizmo.h b/Engine/source/gui/worldEditor/gizmo.h index a9baf1aa1..5cc64514a 100644 --- a/Engine/source/gui/worldEditor/gizmo.h +++ b/Engine/source/gui/worldEditor/gizmo.h @@ -391,9 +391,9 @@ protected: /// Spacing between grid lines on the move grid. U32 mMoveGridSpacing; - bool mAxisEnabled[3]; bool mUniformHandleEnabled; bool mScreenRotateHandleEnabled; + bool mAxisEnabled[3]; // Used to override rendering of handles. bool mHighlightCentroidHandle; diff --git a/Engine/source/gui/worldEditor/guiConvexShapeEditorCtrl.cpp b/Engine/source/gui/worldEditor/guiConvexShapeEditorCtrl.cpp index 5f1b32638..a53b0e641 100644 --- a/Engine/source/gui/worldEditor/guiConvexShapeEditorCtrl.cpp +++ b/Engine/source/gui/worldEditor/guiConvexShapeEditorCtrl.cpp @@ -68,6 +68,7 @@ GuiConvexEditorCtrl::GuiConvexEditorCtrl() mFaceHL( -1 ), mFaceSavedXfm( true ), mSavedUndo( false ), + mHasGeometry(false), mDragging( false ), mGizmoMatOffset( Point3F::Zero ), mPivotPos( Point3F::Zero ), diff --git a/Engine/source/gui/worldEditor/guiConvexShapeEditorCtrl.h b/Engine/source/gui/worldEditor/guiConvexShapeEditorCtrl.h index 3f4b91606..6ede0cf61 100644 --- a/Engine/source/gui/worldEditor/guiConvexShapeEditorCtrl.h +++ b/Engine/source/gui/worldEditor/guiConvexShapeEditorCtrl.h @@ -248,7 +248,7 @@ class GuiConvexEditorUndoAction : public UndoAction friend class GuiConvexEditorCtrl; public: - GuiConvexEditorUndoAction( const UTF8* actionName ) : UndoAction( actionName ) + GuiConvexEditorUndoAction( const UTF8* actionName ) : UndoAction( actionName ), mEditor(NULL), mObjId(NULL) { } diff --git a/Engine/source/gui/worldEditor/guiMissionArea.h b/Engine/source/gui/worldEditor/guiMissionArea.h index fb1d1cd85..caa0527cb 100644 --- a/Engine/source/gui/worldEditor/guiMissionArea.h +++ b/Engine/source/gui/worldEditor/guiMissionArea.h @@ -142,7 +142,7 @@ class GuiMissionAreaUndoAction : public UndoAction { public: - GuiMissionAreaUndoAction( const UTF8* actionName ) : UndoAction( actionName ) + GuiMissionAreaUndoAction( const UTF8* actionName ) : UndoAction( actionName ), mMissionAreaEditor(NULL), mObjId(NULL) { } diff --git a/Engine/source/gui/worldEditor/terrainActions.cpp b/Engine/source/gui/worldEditor/terrainActions.cpp index b64cade26..3fc07205d 100644 --- a/Engine/source/gui/worldEditor/terrainActions.cpp +++ b/Engine/source/gui/worldEditor/terrainActions.cpp @@ -773,7 +773,7 @@ ConsoleDocClass( TerrainSmoothAction, ); TerrainSmoothAction::TerrainSmoothAction() - : UndoAction( "Terrain Smoothing" ) + : UndoAction("Terrain Smoothing"), mFactor(1.0), mSteps(1), mTerrainId(NULL) { } @@ -836,4 +836,4 @@ void TerrainSmoothAction::redo() // Tell the terrain to update itself. terrain->updateGrid( Point2I::Zero, Point2I::Max, true ); -} \ No newline at end of file +} diff --git a/Engine/source/gui/worldEditor/terrainActions.h b/Engine/source/gui/worldEditor/terrainActions.h index e0e31d988..2fc0b2df5 100644 --- a/Engine/source/gui/worldEditor/terrainActions.h +++ b/Engine/source/gui/worldEditor/terrainActions.h @@ -211,7 +211,7 @@ class ScaleHeightAction : public TerrainAction class BrushAdjustHeightAction : public TerrainAction { public: - BrushAdjustHeightAction(TerrainEditor * editor) : TerrainAction(editor){} + BrushAdjustHeightAction(TerrainEditor* editor) : TerrainAction(editor) { mPreviousZ = 0.0f; } StringTableEntry getName(){return("brushAdjustHeight");} void process(Selection * sel, const Gui3DMouseEvent & event, bool selChanged, Type type); diff --git a/Engine/source/gui/worldEditor/undoActions.cpp b/Engine/source/gui/worldEditor/undoActions.cpp index de23353d8..2f137bc72 100644 --- a/Engine/source/gui/worldEditor/undoActions.cpp +++ b/Engine/source/gui/worldEditor/undoActions.cpp @@ -219,6 +219,7 @@ ConsoleDocClass( InspectorFieldUndoAction, InspectorFieldUndoAction::InspectorFieldUndoAction() { + mInspector = NULL; mObjId = 0; mField = NULL; mSlotName = StringTable->EmptyString(); diff --git a/Engine/source/gui/worldEditor/worldEditor.h b/Engine/source/gui/worldEditor/worldEditor.h index d52ecd699..e903e024b 100644 --- a/Engine/source/gui/worldEditor/worldEditor.h +++ b/Engine/source/gui/worldEditor/worldEditor.h @@ -133,6 +133,7 @@ class WorldEditor : public EditTSCtrl WorldEditorUndoAction( const UTF8* actionName ) : UndoAction( actionName ) { + mWorldEditor = NULL; } WorldEditor *mWorldEditor; From f52c3d5ed283628fe8183485c1df275b8405f782 Mon Sep 17 00:00:00 2001 From: AzaezelX Date: Mon, 11 May 2020 15:07:21 -0500 Subject: [PATCH 08/25] uninitialized variables-lighting --- Engine/source/lighting/advanced/advancedLightBinManager.h | 2 +- Engine/source/lighting/advanced/advancedLightManager.cpp | 3 +++ Engine/source/lighting/common/blobShadow.cpp | 2 +- Engine/source/lighting/common/sceneLighting.cpp | 5 +++-- Engine/source/lighting/shadowMap/pssmLightShadowMap.cpp | 8 ++++++-- Engine/source/lighting/shadowMap/shadowMapPass.h | 2 +- 6 files changed, 15 insertions(+), 7 deletions(-) diff --git a/Engine/source/lighting/advanced/advancedLightBinManager.h b/Engine/source/lighting/advanced/advancedLightBinManager.h index aca1d2024..8b256f533 100644 --- a/Engine/source/lighting/advanced/advancedLightBinManager.h +++ b/Engine/source/lighting/advanced/advancedLightBinManager.h @@ -70,7 +70,7 @@ protected: GFXStateBlockRef mLitState[NUM_LIT_STATES][2]; public: - LightMatInstance(Material &mat) : Parent(mat), mLightMapParamsSC(NULL), mInternalPass(false) {} + LightMatInstance(Material &mat) : Parent(mat), mLightMapParamsSC(NULL), mInternalPass(false), mSpecialLight(NULL) {} virtual bool init( const FeatureSet &features, const GFXVertexFormat *vertexFormat ); virtual bool setupPass( SceneRenderState *state, const SceneData &sgData ); diff --git a/Engine/source/lighting/advanced/advancedLightManager.cpp b/Engine/source/lighting/advanced/advancedLightManager.cpp index bc16efe7a..00704c2bc 100644 --- a/Engine/source/lighting/advanced/advancedLightManager.cpp +++ b/Engine/source/lighting/advanced/advancedLightManager.cpp @@ -63,6 +63,9 @@ AdvancedLightManager::AdvancedLightManager() { mLightBinManager = NULL; mLastShader = NULL; + mLastConstants = NULL; + mSpherePrimitiveCount = 0; + mConePrimitiveCount = 0; mAvailableSLInterfaces = NULL; } diff --git a/Engine/source/lighting/common/blobShadow.cpp b/Engine/source/lighting/common/blobShadow.cpp index f0d87be28..34da7fcb4 100644 --- a/Engine/source/lighting/common/blobShadow.cpp +++ b/Engine/source/lighting/common/blobShadow.cpp @@ -55,7 +55,7 @@ BlobShadow::BlobShadow(SceneObject* parentObject, LightInfo* light, TSShapeInsta mRadius = 0.0f; mLastRenderTime = 0; mDepthBias = -0.0002f; - + mInvShadowDistance = 1.0f; generateGenericShadowBitmap(smGenericShadowDim); setupStateBlocks(); } diff --git a/Engine/source/lighting/common/sceneLighting.cpp b/Engine/source/lighting/common/sceneLighting.cpp index cdaf4a2b8..afc83f9ba 100644 --- a/Engine/source/lighting/common/sceneLighting.cpp +++ b/Engine/source/lighting/common/sceneLighting.cpp @@ -440,7 +440,8 @@ SceneLighting::SceneLighting(AvailableSLInterfaces* lightingInterfaces) mStartTime = 0; mFileName[0] = '\0'; mSceneManager = NULL; - + sgTimeTemp = 0; + sgTimeTemp2 = 0; // Registering vars more than once doesn't hurt anything. Con::addVariable("$sceneLighting::terminateLighting", TypeBool, &gTerminateLighting); Con::addVariable("$sceneLighting::lightingProgress", TypeF32, &gLightingProgress); @@ -1084,4 +1085,4 @@ bool SceneLighting::ObjectProxy::setPersistInfo(PersistInfo::PersistChunk * chun { mChunkCRC = chunk->mChunkCRC; return(true); -} \ No newline at end of file +} diff --git a/Engine/source/lighting/shadowMap/pssmLightShadowMap.cpp b/Engine/source/lighting/shadowMap/pssmLightShadowMap.cpp index 3bdf6a8b7..86e4bc6bc 100644 --- a/Engine/source/lighting/shadowMap/pssmLightShadowMap.cpp +++ b/Engine/source/lighting/shadowMap/pssmLightShadowMap.cpp @@ -64,8 +64,12 @@ F32 PSSMLightShadowMap::smSmallestVisiblePixelSize = 25.0f; PSSMLightShadowMap::PSSMLightShadowMap( LightInfo *light ) : LightShadowMap( light ), - mNumSplits( 1 ) -{ + mNumSplits( 1 ), + mLogWeight(0.91f) +{ + for (U32 i = 0; i <= MAX_SPLITS; i++) //% depth distance + mSplitDist[i] = mPow(F32(i/MAX_SPLITS),2.0f); + mIsViewDependent = true; } diff --git a/Engine/source/lighting/shadowMap/shadowMapPass.h b/Engine/source/lighting/shadowMap/shadowMapPass.h index d860da79b..8e1fa0ef5 100644 --- a/Engine/source/lighting/shadowMap/shadowMapPass.h +++ b/Engine/source/lighting/shadowMap/shadowMapPass.h @@ -52,7 +52,7 @@ class ShadowMapPass { public: - ShadowMapPass() {} // Only called by ConsoleSystem + ShadowMapPass() : mTimer(NULL), mLightManager(NULL), mShadowManager(NULL), mActiveLights(0), mPrevCamFov(90.0f) {} // Only called by ConsoleSystem ShadowMapPass(LightManager* LightManager, ShadowMapManager* ShadowManager); virtual ~ShadowMapPass(); From a46bf3d7e52808dcf1cba40db23cd11d61449948 Mon Sep 17 00:00:00 2001 From: AzaezelX Date: Mon, 11 May 2020 15:08:57 -0500 Subject: [PATCH 09/25] uninitialized variables-navigation --- Engine/source/navigation/duDebugDrawTorque.cpp | 1 + Engine/source/navigation/guiNavEditorCtrl.h | 5 +---- Engine/source/navigation/navMesh.cpp | 1 + Engine/source/navigation/navMesh.h | 4 ++-- Engine/source/navigation/navPath.cpp | 1 + 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/Engine/source/navigation/duDebugDrawTorque.cpp b/Engine/source/navigation/duDebugDrawTorque.cpp index d3928ca76..29ea9ab70 100644 --- a/Engine/source/navigation/duDebugDrawTorque.cpp +++ b/Engine/source/navigation/duDebugDrawTorque.cpp @@ -45,6 +45,7 @@ duDebugDrawTorque::duDebugDrawTorque() mCurrColor = 0; mOverrideColor = 0; mOverride = false; + dMemset(&mStore, 0, sizeof(mStore)); } duDebugDrawTorque::~duDebugDrawTorque() diff --git a/Engine/source/navigation/guiNavEditorCtrl.h b/Engine/source/navigation/guiNavEditorCtrl.h index 3250f6f54..4a6780b33 100644 --- a/Engine/source/navigation/guiNavEditorCtrl.h +++ b/Engine/source/navigation/guiNavEditorCtrl.h @@ -125,7 +125,6 @@ protected: GFXStateBlockRef mZDisableSB; GFXStateBlockRef mZEnableSB; - bool mSavedDrag; bool mIsDirty; String mMode; @@ -169,15 +168,13 @@ protected: class GuiNavEditorUndoAction : public UndoAction { public: - GuiNavEditorUndoAction(const UTF8* actionName) : UndoAction(actionName) + GuiNavEditorUndoAction(const UTF8* actionName) : UndoAction(actionName), mNavEditor(NULL), mObjId(NULL) { } GuiNavEditorCtrl *mNavEditor; SimObjectId mObjId; - F32 mMetersPerSegment; - U32 mSegmentsPerBatch; virtual void undo(); virtual void redo() { undo(); } diff --git a/Engine/source/navigation/navMesh.cpp b/Engine/source/navigation/navMesh.cpp index c6189c366..0c3cd3a5a 100644 --- a/Engine/source/navigation/navMesh.cpp +++ b/Engine/source/navigation/navMesh.cpp @@ -213,6 +213,7 @@ NavMesh::NavMesh() mAlwaysRender = false; mBuilding = false; + mCurLinkID = 0; } NavMesh::~NavMesh() diff --git a/Engine/source/navigation/navMesh.h b/Engine/source/navigation/navMesh.h index 75efcdacb..a4096cdfc 100644 --- a/Engine/source/navigation/navMesh.h +++ b/Engine/source/navigation/navMesh.h @@ -166,14 +166,14 @@ public: /// @name Annotations /// @{ - + /* not implemented /// Should we automatically generate jump-down links? bool mJumpDownLinks; /// Height of a 'small' jump link. F32 mJumpLinkSmall; /// Height of a 'large' jump link. F32 mJumpLinkLarge; - + */ /// Distance to search for cover. F32 mCoverDist; diff --git a/Engine/source/navigation/navPath.cpp b/Engine/source/navigation/navPath.cpp index a66afe136..7d055b78e 100644 --- a/Engine/source/navigation/navPath.cpp +++ b/Engine/source/navigation/navPath.cpp @@ -70,6 +70,7 @@ NavPath::NavPath() : mRenderSearch = false; mQuery = NULL; + mStatus = DT_FAILURE; } NavPath::~NavPath() From b6c33bdd2be40b25fb90ef56cc6ceb8807d3c8a4 Mon Sep 17 00:00:00 2001 From: AzaezelX Date: Mon, 11 May 2020 15:12:50 -0500 Subject: [PATCH 10/25] uninitialized variables-persistence --- Engine/source/persistence/taml/json/tamlJSONParser.h | 4 ++-- Engine/source/persistence/taml/taml.cpp | 1 + Engine/source/persistence/taml/xml/tamlXmlParser.h | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/Engine/source/persistence/taml/json/tamlJSONParser.h b/Engine/source/persistence/taml/json/tamlJSONParser.h index ff74f0d79..6ef9c1020 100644 --- a/Engine/source/persistence/taml/json/tamlJSONParser.h +++ b/Engine/source/persistence/taml/json/tamlJSONParser.h @@ -38,7 +38,7 @@ class TamlJSONParser : public TamlParser { public: - TamlJSONParser() {} + TamlJSONParser() :mDocumentDirty(false) {} virtual ~TamlJSONParser() {} /// Whether the parser can change a property or not. @@ -54,4 +54,4 @@ private: bool mDocumentDirty; }; -#endif // _TAML_JSONPARSER_H_ \ No newline at end of file +#endif // _TAML_JSONPARSER_H_ diff --git a/Engine/source/persistence/taml/taml.cpp b/Engine/source/persistence/taml/taml.cpp index 82369a7c0..b8390a70c 100644 --- a/Engine/source/persistence/taml/taml.cpp +++ b/Engine/source/persistence/taml/taml.cpp @@ -140,6 +140,7 @@ ImplementEnumType(_TamlFormatMode, // The string-table-entries are set to string literals below because Taml is used in a static scope and the string-table cannot currently be used like that. Taml::Taml() : + mMasterNodeId(0), mFormatMode(XmlFormat), mJSONStrict(true), mBinaryCompression(true), diff --git a/Engine/source/persistence/taml/xml/tamlXmlParser.h b/Engine/source/persistence/taml/xml/tamlXmlParser.h index 28b51a472..467fcba3a 100644 --- a/Engine/source/persistence/taml/xml/tamlXmlParser.h +++ b/Engine/source/persistence/taml/xml/tamlXmlParser.h @@ -38,7 +38,7 @@ class TamlXmlParser : public TamlParser { public: - TamlXmlParser() {} + TamlXmlParser() :mDocumentDirty(false) {} virtual ~TamlXmlParser() {} /// Whether the parser can change a property or not. From bfcc83638d9af8aac56c8da29b3bd94c3d8e9b40 Mon Sep 17 00:00:00 2001 From: AzaezelX Date: Wed, 29 Apr 2020 13:14:39 -0500 Subject: [PATCH 11/25] uninitialized variables-core-2 (cherry picked from commit 7c329699e4e4d13a164b2483e174b5f555ea9344) --- Engine/source/core/color.h | 1 + Engine/source/core/ogg/oggTheoraDecoder.h | 4 ++-- Engine/source/core/stream/fileStream.cpp | 1 + Engine/source/core/stringBuffer.cpp | 2 ++ Engine/source/core/util/journal/journal.h | 1 + Engine/source/core/util/str.h | 5 +++-- Engine/source/core/util/tList.h | 2 +- Engine/source/core/util/tSignal.h | 2 +- 8 files changed, 12 insertions(+), 6 deletions(-) diff --git a/Engine/source/core/color.h b/Engine/source/core/color.h index 9a21d6df2..12b590f4e 100644 --- a/Engine/source/core/color.h +++ b/Engine/source/core/color.h @@ -529,6 +529,7 @@ inline void ColorI::set(const Hsb& color) red = (U32)((((F64)r) / 100) * 255); green = (U32)((((F64)g) / 100) * 255); blue = (U32)((((F64)b) / 100) * 255); + alpha = 255; } // This is a subfunction of HSLtoRGB diff --git a/Engine/source/core/ogg/oggTheoraDecoder.h b/Engine/source/core/ogg/oggTheoraDecoder.h index f4ef5899b..b148aba1f 100644 --- a/Engine/source/core/ogg/oggTheoraDecoder.h +++ b/Engine/source/core/ogg/oggTheoraDecoder.h @@ -48,9 +48,9 @@ class OggTheoraFrame : public RawData typedef RawData Parent; - OggTheoraFrame() {} + OggTheoraFrame() :mFrameNumber(0), mFrameTime(0), mFrameDuration(0) {} OggTheoraFrame( S8* data, U32 size, bool ownMemory = false ) - : Parent( data, size, ownMemory ) {} + : Parent( data, size, ownMemory ), mFrameNumber(0), mFrameTime(0), mFrameDuration(0) {} /// Serial number of this frame in the stream. U32 mFrameNumber; diff --git a/Engine/source/core/stream/fileStream.cpp b/Engine/source/core/stream/fileStream.cpp index 3d681db4d..29ce3a933 100644 --- a/Engine/source/core/stream/fileStream.cpp +++ b/Engine/source/core/stream/fileStream.cpp @@ -31,6 +31,7 @@ //----------------------------------------------------------------------------- FileStream::FileStream() { + dMemset(mBuffer, 0, sizeof(mBuffer)); // initialize the file stream init(); } diff --git a/Engine/source/core/stringBuffer.cpp b/Engine/source/core/stringBuffer.cpp index a55446885..2bc3fb069 100644 --- a/Engine/source/core/stringBuffer.cpp +++ b/Engine/source/core/stringBuffer.cpp @@ -38,6 +38,8 @@ StringBufferManager() { + request8 = 0.0; + request16 = 0.0; VECTOR_SET_ASSOCIATION( strings ); } diff --git a/Engine/source/core/util/journal/journal.h b/Engine/source/core/util/journal/journal.h index 9db84e2f6..a6b0b8957 100644 --- a/Engine/source/core/util/journal/journal.h +++ b/Engine/source/core/util/journal/journal.h @@ -335,6 +335,7 @@ class Journal struct FuncDecl { FuncDecl* next; Id id; + FuncDecl() :next(NULL), id(0){} virtual ~FuncDecl() {} virtual bool match(VoidPtr,VoidMethod) const = 0; virtual Functor* create() const = 0; diff --git a/Engine/source/core/util/str.h b/Engine/source/core/util/str.h index 046bc1f6f..f5264cfd6 100644 --- a/Engine/source/core/util/str.h +++ b/Engine/source/core/util/str.h @@ -29,6 +29,7 @@ #include "platform/types.h" #endif +#include template< class T > class Vector; @@ -244,7 +245,7 @@ public: _dynamicSize( 0 ), _len( 0 ) { - _fixedBuffer[0] = '\0'; + strncpy(_fixedBuffer, "", 2048); } StrFormat(const char *formatStr, va_list args) @@ -269,7 +270,7 @@ public: void reset() { _len = 0; - _fixedBuffer[0] = '\0'; + strncpy(_fixedBuffer, "", 2048); } /// Copy the formatted string into the output buffer which must be at least size() characters. diff --git a/Engine/source/core/util/tList.h b/Engine/source/core/util/tList.h index 4a2bcfd34..1ed9312b4 100644 --- a/Engine/source/core/util/tList.h +++ b/Engine/source/core/util/tList.h @@ -141,7 +141,7 @@ private: { Link* next; Link* prev; - Link() {} + Link(): next(NULL), prev(NULL) {} Link(Link* p,Link* n): next(n),prev(p) {} }; diff --git a/Engine/source/core/util/tSignal.h b/Engine/source/core/util/tSignal.h index f5531e217..b249aa6fd 100644 --- a/Engine/source/core/util/tSignal.h +++ b/Engine/source/core/util/tSignal.h @@ -76,7 +76,7 @@ protected: void insert(DelegateLink* node, F32 order); void unlink(); - + DelegateLink() :next(NULL), prev(NULL), mOrder(0) {} virtual ~DelegateLink() {} }; From bd8a72005ea27d59e7816ab5b9c6ae1440fdfcbf Mon Sep 17 00:00:00 2001 From: AzaezelX Date: Sun, 26 Apr 2020 16:00:48 -0500 Subject: [PATCH 12/25] uninitialized variables-platform (cherry picked from commit 36fd324de7a29a8f4bb84b7622ae925acb1d3760) --- Engine/source/platform/async/asyncPacketQueue.h | 2 -- Engine/source/platform/nativeDialogs/fileDialog.cpp | 2 ++ Engine/source/platformSDL/threads/thread.cpp | 1 + Engine/source/platformWin32/winAsync.cpp | 1 + Engine/source/platformWin32/winDirectInput.cpp | 7 +++++++ Engine/source/platformWin32/winFont.cpp | 1 + Engine/source/platformWin32/winTimer.cpp | 9 +++++---- 7 files changed, 17 insertions(+), 6 deletions(-) diff --git a/Engine/source/platform/async/asyncPacketQueue.h b/Engine/source/platform/async/asyncPacketQueue.h index 513d6ab29..3bf36e9a5 100644 --- a/Engine/source/platform/async/asyncPacketQueue.h +++ b/Engine/source/platform/async/asyncPacketQueue.h @@ -164,9 +164,7 @@ class AsyncPacketQueue mConsumer( consumer ) { - #ifdef TORQUE_DEBUG mTotalQueuedPackets = 0; - #endif } /// Return true if there are currently diff --git a/Engine/source/platform/nativeDialogs/fileDialog.cpp b/Engine/source/platform/nativeDialogs/fileDialog.cpp index 067458e9f..4e85cbf07 100644 --- a/Engine/source/platform/nativeDialogs/fileDialog.cpp +++ b/Engine/source/platform/nativeDialogs/fileDialog.cpp @@ -54,6 +54,7 @@ FileDialogData::FileDialogData() mTitle = StringTable->EmptyString(); mStyle = 0; + mOpaqueData = NULL; } FileDialogData::~FileDialogData() @@ -123,6 +124,7 @@ FileDialog::FileDialog() : mData() mData.mStyle = FileDialogData::FDS_OPEN | FileDialogData::FDS_MUSTEXIST; mChangePath = false; mForceRelativePath = true; + mBoolTranslator = false; } FileDialog::~FileDialog() diff --git a/Engine/source/platformSDL/threads/thread.cpp b/Engine/source/platformSDL/threads/thread.cpp index 08409fe11..a7de28753 100644 --- a/Engine/source/platformSDL/threads/thread.cpp +++ b/Engine/source/platformSDL/threads/thread.cpp @@ -83,6 +83,7 @@ Thread::Thread(ThreadRunFunction func, void* arg, bool start_thread, bool autode mData->mDead = false; mData->mSdlThread = NULL; autoDelete = autodelete; + shouldStop = true; } Thread::~Thread() diff --git a/Engine/source/platformWin32/winAsync.cpp b/Engine/source/platformWin32/winAsync.cpp index 8910ee420..277b698fe 100644 --- a/Engine/source/platformWin32/winAsync.cpp +++ b/Engine/source/platformWin32/winAsync.cpp @@ -59,6 +59,7 @@ AsyncPeriodicUpdateThread::AsyncPeriodicUpdateThread( String name, // This is a bit contrived. The 'dueTime' is in 100 nanosecond intervals // and relative if it is negative. The period is in milliseconds. + mIntervalMS = intervalMS; LARGE_INTEGER deltaTime; deltaTime.QuadPart = - LONGLONG( intervalMS * 10 /* micro */ * 1000 /* milli */ ); diff --git a/Engine/source/platformWin32/winDirectInput.cpp b/Engine/source/platformWin32/winDirectInput.cpp index fd016496f..b5ba6d2ce 100644 --- a/Engine/source/platformWin32/winDirectInput.cpp +++ b/Engine/source/platformWin32/winDirectInput.cpp @@ -47,6 +47,13 @@ DInputManager::DInputManager() mJoystickActive = mXInputActive = true; mXInputLib = NULL; + mfnXInputGetState = NULL; + mfnXInputSetState = NULL; + dMemset(mXInputStateOld, 0, sizeof(mXInputStateOld)); + dMemset(mXInputStateNew, 0, sizeof(mXInputStateNew)); + mXInputStateReset = false; + mXInputDeadZoneOn = true; + for(S32 i=0; i<4; i++) mLastDisconnectTime[i] = -1; } diff --git a/Engine/source/platformWin32/winFont.cpp b/Engine/source/platformWin32/winFont.cpp index a67b096b3..2efdd6a08 100644 --- a/Engine/source/platformWin32/winFont.cpp +++ b/Engine/source/platformWin32/winFont.cpp @@ -129,6 +129,7 @@ PlatformFont *createPlatformFont(const char *name, dsize_t size, U32 charset /* WinFont::WinFont() : mFont(NULL) { + dMemset(&mTextMetric, 0, sizeof(mTextMetric)); } WinFont::~WinFont() diff --git a/Engine/source/platformWin32/winTimer.cpp b/Engine/source/platformWin32/winTimer.cpp index 940e2c7b8..77e820b07 100644 --- a/Engine/source/platformWin32/winTimer.cpp +++ b/Engine/source/platformWin32/winTimer.cpp @@ -49,11 +49,12 @@ public: mUsingPerfCounter = QueryPerformanceFrequency((LARGE_INTEGER *) &mFrequency); if(mUsingPerfCounter) mUsingPerfCounter = QueryPerformanceCounter((LARGE_INTEGER *) &mPerfCountCurrent); - if(!mUsingPerfCounter) - { + mPerfCountNext = 0.0; + if (!mUsingPerfCounter) mTickCountCurrent = GetTickCount(); - mTickCountNext = 0; - } + else + mTickCountCurrent = 0; + mTickCountNext = 0; } const S32 getElapsedMs() From 522578074cf258d1cd10e3d2066a82b0dabec341 Mon Sep 17 00:00:00 2001 From: AzaezelX Date: Tue, 28 Apr 2020 10:33:10 -0500 Subject: [PATCH 13/25] looks like distance needs to default to 0, not max, for raycast purposes. (cherry picked from commit 00ee743559e19bc2dd3cbf92060b8bf089d5aceb) --- Engine/source/collision/collision.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Engine/source/collision/collision.h b/Engine/source/collision/collision.h index 7495e5f08..e5134c1a7 100644 --- a/Engine/source/collision/collision.h +++ b/Engine/source/collision/collision.h @@ -67,8 +67,8 @@ struct Collision generateTexCoord(false), texCoord(-1.0f, -1.0f), face(0), - faceDot(-1.0f), - distance(FLT_MAX) + faceDot(0.0f), + distance(0) { } From 8aa03a4ac9bc74cfa3d0d10eccad70d84030e293 Mon Sep 17 00:00:00 2001 From: AzaezelX Date: Sun, 26 Apr 2020 16:47:29 -0500 Subject: [PATCH 14/25] uninitialized variables-renderinstance (cherry picked from commit dcbc22bf8450250f192ae56b303affd760f63db1) --- Engine/source/renderInstance/renderDeferredMgr.cpp | 2 +- Engine/source/renderInstance/renderProbeMgr.cpp | 13 ++++++++++++- Engine/source/renderInstance/renderProbeMgr.h | 4 ++-- 3 files changed, 15 insertions(+), 4 deletions(-) diff --git a/Engine/source/renderInstance/renderDeferredMgr.cpp b/Engine/source/renderInstance/renderDeferredMgr.cpp index 8632b36a3..8d34c809d 100644 --- a/Engine/source/renderInstance/renderDeferredMgr.cpp +++ b/Engine/source/renderInstance/renderDeferredMgr.cpp @@ -584,7 +584,7 @@ const GFXStateBlockDesc & RenderDeferredMgr::getOpaqueStencilTestDesc() ProcessedDeferredMaterial::ProcessedDeferredMaterial( Material& mat, const RenderDeferredMgr *deferredMgr ) -: Parent(mat), mDeferredMgr(deferredMgr) +: Parent(mat), mDeferredMgr(deferredMgr), mIsLightmappedGeometry(false) { } diff --git a/Engine/source/renderInstance/renderProbeMgr.cpp b/Engine/source/renderInstance/renderProbeMgr.cpp index 4d7bf39c7..c77cc3e3e 100644 --- a/Engine/source/renderInstance/renderProbeMgr.cpp +++ b/Engine/source/renderInstance/renderProbeMgr.cpp @@ -213,6 +213,7 @@ RenderProbeMgr::RenderProbeMgr() smProbeManager = this; mCubeMapCount = 0; + mCubeSlotCount = PROBE_ARRAY_SLOT_BUFFER_SIZE; for (U32 i = 0; i < PROBE_MAX_COUNT; i++) { @@ -222,7 +223,17 @@ RenderProbeMgr::RenderProbeMgr() RenderProbeMgr::RenderProbeMgr(RenderInstType riType, F32 renderOrder, F32 processAddOrder) : RenderBinManager(riType, renderOrder, processAddOrder) -{ +{ + mCubeMapCount = 0; + dMemset(mCubeMapSlots, false, sizeof(mCubeMapSlots)); + mCubeSlotCount = PROBE_ARRAY_SLOT_BUFFER_SIZE; + mDefaultSkyLight = nullptr; + mEffectiveProbeCount = 0; + mHasSkylight = false; + mSkylightCubemapIdx = -1; + mLastConstants = nullptr; + mMipCount = 0; + mProbesDirty = false; } RenderProbeMgr::~RenderProbeMgr() diff --git a/Engine/source/renderInstance/renderProbeMgr.h b/Engine/source/renderInstance/renderProbeMgr.h index 50391ff20..24faccb65 100644 --- a/Engine/source/renderInstance/renderProbeMgr.h +++ b/Engine/source/renderInstance/renderProbeMgr.h @@ -100,8 +100,6 @@ struct ProbeRenderInst U32 mProbeIdx; - F32 mMultiplier; - public: ProbeRenderInst(); @@ -202,6 +200,8 @@ struct ProbeDataSet dMemset(refBoxMaxArray.getBuffer(), 0, refBoxMaxArray.getBufferSize()); dMemset(probeRefPositionArray.getBuffer(), 0, probeRefPositionArray.getBufferSize()); dMemset(probeConfigArray.getBuffer(), 0, probeConfigArray.getBufferSize()); + skyLightIdx = -1; + effectiveProbeCount = 0; } }; From 7392d598dad3de3263db48638cf3fe11447165bb Mon Sep 17 00:00:00 2001 From: AzaezelX Date: Mon, 11 May 2020 15:20:03 -0500 Subject: [PATCH 15/25] uninitialized variables-scene --- Engine/source/scene/culling/sceneCullingVolume.h | 2 +- Engine/source/scene/culling/sceneZoneCullingState.h | 4 ++-- Engine/source/scene/pathManager.h | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Engine/source/scene/culling/sceneCullingVolume.h b/Engine/source/scene/culling/sceneCullingVolume.h index 7cc64d1e8..6d3306269 100644 --- a/Engine/source/scene/culling/sceneCullingVolume.h +++ b/Engine/source/scene/culling/sceneCullingVolume.h @@ -75,7 +75,7 @@ class SceneCullingVolume public: /// Create an *uninitialized* culling volume. - SceneCullingVolume() {} + SceneCullingVolume() : mType(Includer), mSortPoint(1.f) {} /// SceneCullingVolume( Type type, const PlaneSetF& planes ) diff --git a/Engine/source/scene/culling/sceneZoneCullingState.h b/Engine/source/scene/culling/sceneZoneCullingState.h index 3420442dd..48494296b 100644 --- a/Engine/source/scene/culling/sceneZoneCullingState.h +++ b/Engine/source/scene/culling/sceneZoneCullingState.h @@ -66,7 +66,7 @@ class SceneZoneCullingState CullingVolumeLink* mNext; CullingVolumeLink( const SceneCullingVolume& volume ) - : mVolume( volume ) {} + : mVolume( volume ) {mNext=NULL;} }; /// Iterator over the culling volumes assigned to a zone. @@ -134,7 +134,7 @@ class SceneZoneCullingState /// Zone states are constructed by SceneCullingState. This constructor should not /// be used otherwise. It is public due to the use through Vector in SceneCullingState. - SceneZoneCullingState() {} + SceneZoneCullingState():mCanShortcuit(false), mCullingVolumes(NULL), mHaveSortedVolumes(false), mHaveIncluders(false), mHaveOccluders(false){} /// Return true if the zone is visible. This is the case if any /// includers have been added to the zone's rendering state. diff --git a/Engine/source/scene/pathManager.h b/Engine/source/scene/pathManager.h index d239c275f..2a9590706 100644 --- a/Engine/source/scene/pathManager.h +++ b/Engine/source/scene/pathManager.h @@ -56,6 +56,7 @@ class PathManager Vector msToNext; PathEntry() { + totalTime = 0; VECTOR_SET_ASSOCIATION(positions); VECTOR_SET_ASSOCIATION(rotations); VECTOR_SET_ASSOCIATION(smoothingType); @@ -105,7 +106,6 @@ class PathManager private: bool mIsServer; - bool mPathsSent; }; struct PathNode { From a1a6143e0174e24b0e3b95f278adfec90e74eebd Mon Sep 17 00:00:00 2001 From: AzaezelX Date: Mon, 11 May 2020 15:24:49 -0500 Subject: [PATCH 16/25] uninitialized variables-sfx --- Engine/source/sfx/media/sfxVorbisStream.cpp | 4 ++++ Engine/source/sfx/media/sfxWavStream.cpp | 1 + Engine/source/sfx/openal/sfxALDevice.cpp | 11 +++++++++-- Engine/source/sfx/openal/sfxALProvider.cpp | 2 +- Engine/source/sfx/sfxController.cpp | 3 ++- Engine/source/sfx/sfxController.h | 15 ++++++++------- Engine/source/sfx/sfxInternal.h | 2 +- Engine/source/sfx/sfxModifier.cpp | 2 ++ Engine/source/sfx/sfxModifier.h | 2 +- Engine/source/sfx/sfxSound.cpp | 4 ++-- Engine/source/sfx/sfxWorld.h | 2 +- 11 files changed, 32 insertions(+), 16 deletions(-) diff --git a/Engine/source/sfx/media/sfxVorbisStream.cpp b/Engine/source/sfx/media/sfxVorbisStream.cpp index 3a2f12ba6..38e4e5d95 100644 --- a/Engine/source/sfx/media/sfxVorbisStream.cpp +++ b/Engine/source/sfx/media/sfxVorbisStream.cpp @@ -40,6 +40,7 @@ SFXVorbisStream* SFXVorbisStream::create( Stream *stream ) SFXVorbisStream::SFXVorbisStream() : mVF( NULL ), + mBitstream(-1), mBytesRead( 0 ) { } @@ -47,6 +48,9 @@ SFXVorbisStream::SFXVorbisStream() SFXVorbisStream::SFXVorbisStream( const SFXVorbisStream& cloneFrom ) : Parent( cloneFrom ) { + mVF = NULL; + mBitstream = -1; + mBytesRead = 0; if( !mStream->hasCapability( Stream::StreamPosition ) ) { Con::errorf( "SFXVorbisStream::SFXVorbisStream() - Source stream does not allow seeking" ); diff --git a/Engine/source/sfx/media/sfxWavStream.cpp b/Engine/source/sfx/media/sfxWavStream.cpp index 3e5f4b983..e3833c401 100644 --- a/Engine/source/sfx/media/sfxWavStream.cpp +++ b/Engine/source/sfx/media/sfxWavStream.cpp @@ -94,6 +94,7 @@ SFXWavStream* SFXWavStream::create( Stream *stream ) } SFXWavStream::SFXWavStream() + :mDataStart(-1) { } diff --git a/Engine/source/sfx/openal/sfxALDevice.cpp b/Engine/source/sfx/openal/sfxALDevice.cpp index 080d77d6d..58d7c0146 100644 --- a/Engine/source/sfx/openal/sfxALDevice.cpp +++ b/Engine/source/sfx/openal/sfxALDevice.cpp @@ -35,8 +35,11 @@ SFXALDevice::SFXALDevice( SFXProvider *provider, : Parent( name, provider, useHardware, maxBuffers ), mOpenAL( openal ), mContext( NULL ), - mDevice( NULL ), - mRolloffFactor( 1.0f ) + mDevice( NULL ), + mDistanceModel(SFXDistanceModelLinear), + mDistanceFactor(1.0f), + mRolloffFactor( 1.0f ), + mUserRolloffFactor(1.0f) { mMaxBuffers = getMax( maxBuffers, 8 ); @@ -80,6 +83,10 @@ SFXALDevice::SFXALDevice( SFXProvider *provider, SFXInternal::gUpdateThread->start(); } #endif + + dMemset(effectSlot, 0, sizeof(effectSlot)); + dMemset(effect, 0, sizeof(effect)); + uLoop = 0; } //----------------------------------------------------------------------------- diff --git a/Engine/source/sfx/openal/sfxALProvider.cpp b/Engine/source/sfx/openal/sfxALProvider.cpp index 47b2444b3..434d4a44c 100644 --- a/Engine/source/sfx/openal/sfxALProvider.cpp +++ b/Engine/source/sfx/openal/sfxALProvider.cpp @@ -36,7 +36,7 @@ class SFXALProvider : public SFXProvider public: SFXALProvider() - : SFXProvider( "OpenAL" ) { mALDL = NULL; } + : SFXProvider( "OpenAL" ) { dMemset(&mOpenAL,0,sizeof(mOpenAL)); mALDL = NULL; } virtual ~SFXALProvider(); protected: diff --git a/Engine/source/sfx/sfxController.cpp b/Engine/source/sfx/sfxController.cpp index 2d9592eef..6bb5924b9 100644 --- a/Engine/source/sfx/sfxController.cpp +++ b/Engine/source/sfx/sfxController.cpp @@ -75,7 +75,8 @@ ConsoleDocClass( SFXController, SFXController::SFXController( SFXPlayList* playList ) : Parent( playList ), - mTrace( playList->trace() ) + mTrace( playList->trace() ), + mLoopCounter(0) { VECTOR_SET_ASSOCIATION( mInsns ); VECTOR_SET_ASSOCIATION( mSources ); diff --git a/Engine/source/sfx/sfxController.h b/Engine/source/sfx/sfxController.h index 32039d7c4..7d2ee4980 100644 --- a/Engine/source/sfx/sfxController.h +++ b/Engine/source/sfx/sfxController.h @@ -93,13 +93,14 @@ class SFXController : public SFXSource U32 mLoopCount; } mArg; - Insn() {} + Insn() + : mOpcode(SFXController::OP_Delay), mSlotIndex(0), mState(NULL) {mArg.mLoopCount=0;} Insn( EOp opcode ) - : mOpcode( opcode ), mSlotIndex( U32_MAX ), mState( NULL ) {} + : mOpcode( opcode ), mSlotIndex( U32_MAX ), mState( NULL ) {mArg.mLoopCount=0;} Insn( U32 slotIndex, SFXState* state ) - : mSlotIndex( slotIndex ), mState( state ) {} + : mOpcode(SFXController::OP_Delay), mSlotIndex( slotIndex ), mState( state ){mArg.mLoopCount=0;} Insn( EOp opcode, U32 slotIndex, SFXState* state ) - : mOpcode( opcode ), mSlotIndex( slotIndex ), mState( state ) {} + : mOpcode( opcode ), mSlotIndex( slotIndex ), mState( state ) {mArg.mLoopCount=0;} }; /// @@ -130,7 +131,7 @@ class SFXController : public SFXSource F32 mFadeOutTime; Source() - : mState( 0 ) {} + : mState( 0 ), mSlotIndex(0), mVolumeScale(1.0f), mPitchScale(1.0f), mFadeInTime(0), mFadeOutTime(0) {} }; /// The current instruction in "mInsns". @@ -169,7 +170,7 @@ class SFXController : public SFXSource void _genTransition( Insn& insn, SFXPlayList::ETransitionMode transition ); /// - void _dumpInsns(); + void _dumpInsns() {}; /// void _initInsn(); @@ -198,7 +199,7 @@ class SFXController : public SFXSource ~SFXController(); /// Constructor for the sake of ConsoleObject. - explicit SFXController() {} + explicit SFXController(): mIp(0), mTrace(false), mDelayEndTime(0), mLoopCounter(0) {} /// Return the playlist being played back by the controller. SFXPlayList* getPlayList() const; diff --git a/Engine/source/sfx/sfxInternal.h b/Engine/source/sfx/sfxInternal.h index 137456eac..4d0a922f5 100644 --- a/Engine/source/sfx/sfxInternal.h +++ b/Engine/source/sfx/sfxInternal.h @@ -324,7 +324,7 @@ class SFXWrapAroundBuffer : public SFXBuffer SFXWrapAroundBuffer( const ThreadSafeRef< SFXStream >& stream, SFXDescription* description ); SFXWrapAroundBuffer( SFXDescription* description ) - : Parent( description ), mBufferSize( 0 ) {} + : Parent( description ), mBufferSize( 0 ), mWriteOffset(0) {} virtual U32 getMemoryUsed() const { return mBufferSize; } }; diff --git a/Engine/source/sfx/sfxModifier.cpp b/Engine/source/sfx/sfxModifier.cpp index 3bc98c31f..bf63f392e 100644 --- a/Engine/source/sfx/sfxModifier.cpp +++ b/Engine/source/sfx/sfxModifier.cpp @@ -107,6 +107,8 @@ bool SFXRangeModifier::update() SFXFadeModifier::SFXFadeModifier( SFXSource* source, F32 time, F32 endVolume, F32 startTime, EOnEnd onEndDo, bool removeWhenDone ) : Parent( source, startTime, startTime + time, removeWhenDone ), + mStartVolume(source->getVolume()), + mCurrentVolume(source->getVolume()), mEndVolume( endVolume ), mOnEnd( onEndDo ) { diff --git a/Engine/source/sfx/sfxModifier.h b/Engine/source/sfx/sfxModifier.h index 182609964..39f2a7316 100644 --- a/Engine/source/sfx/sfxModifier.h +++ b/Engine/source/sfx/sfxModifier.h @@ -47,7 +47,7 @@ class SFXModifier : public IPolled /// Create an effect that operates on "source". SFXModifier( SFXSource* source, bool removeWhenDone = false ) - : mSource( source ) {} + : mSource( source ), mRemoveWhenDone(removeWhenDone) {} virtual ~SFXModifier() {} }; diff --git a/Engine/source/sfx/sfxSound.cpp b/Engine/source/sfx/sfxSound.cpp index 6b4895f80..c62c41605 100644 --- a/Engine/source/sfx/sfxSound.cpp +++ b/Engine/source/sfx/sfxSound.cpp @@ -68,7 +68,7 @@ ConsoleDocClass( SFXSound, //----------------------------------------------------------------------------- SFXSound::SFXSound() - : mVoice( NULL ) + : mVoice( NULL ), mDuration(0), mSetPositionValue(0) { // NOTE: This should never be used directly // and is only here to satisfy satisfy the @@ -79,7 +79,7 @@ SFXSound::SFXSound() SFXSound::SFXSound( SFXProfile *profile, SFXDescription* desc ) : Parent( profile, desc ), - mVoice( NULL ) + mVoice( NULL ), mDuration(0) { mSetPositionValue = 0; } diff --git a/Engine/source/sfx/sfxWorld.h b/Engine/source/sfx/sfxWorld.h index 289455b69..427e4721d 100644 --- a/Engine/source/sfx/sfxWorld.h +++ b/Engine/source/sfx/sfxWorld.h @@ -208,7 +208,7 @@ class SFXWorld : public ScopeTracker< NUM_DIMENSIONS, Object > /// between this space and the space above us in the stack. Object mObject; - Scope() {} + Scope() :mSortValue(0), mSoundscape(NULL) {} Scope( F32 sortValue, Object object ) : mSortValue( sortValue ), mSoundscape( NULL ), From 87603029dbbab86ecec38158c21b78f172718ca8 Mon Sep 17 00:00:00 2001 From: AzaezelX Date: Mon, 11 May 2020 15:26:52 -0500 Subject: [PATCH 17/25] uninitialized variables-sim --- Engine/source/sim/actionMap.h | 2 +- Engine/source/sim/netConnection.cpp | 2 ++ Engine/source/sim/netConnection.h | 6 +++--- Engine/source/sim/netInterface.cpp | 3 ++- Engine/source/sim/netStringTable.h | 1 - 5 files changed, 8 insertions(+), 6 deletions(-) diff --git a/Engine/source/sim/actionMap.h b/Engine/source/sim/actionMap.h index c2c4cbd72..26caffe7b 100644 --- a/Engine/source/sim/actionMap.h +++ b/Engine/source/sim/actionMap.h @@ -92,7 +92,7 @@ class ActionMap : public SimObject U32 deviceInst; Vector nodeMap; - DeviceMap() { + DeviceMap():deviceType(NULL), deviceInst(NULL){ VECTOR_SET_ASSOCIATION(nodeMap); } ~DeviceMap(); diff --git a/Engine/source/sim/netConnection.cpp b/Engine/source/sim/netConnection.cpp index c952a0258..9d70ff2dc 100644 --- a/Engine/source/sim/netConnection.cpp +++ b/Engine/source/sim/netConnection.cpp @@ -469,6 +469,8 @@ NetConnection::PacketNotify::PacketNotify() sendTime = 0; eventList = 0; ghostList = 0; + subList = NULL; + nextPacket = NULL; } bool NetConnection::checkTimeout(U32 time) diff --git a/Engine/source/sim/netConnection.h b/Engine/source/sim/netConnection.h index 55422f9eb..ab58ac0e0 100644 --- a/Engine/source/sim/netConnection.h +++ b/Engine/source/sim/netConnection.h @@ -273,7 +273,7 @@ public: /// @{ /// - NetEvent() { mGuaranteeType = GuaranteedOrdered; } + NetEvent() { mSourceId = -1; mGuaranteeType = GuaranteedOrdered; } virtual ~NetEvent(); virtual void write(NetConnection *ps, BitStream *bstream) = 0; @@ -863,7 +863,7 @@ public: void setScopeObject(NetObject *object); /// Get the object around which we are currently scoping network traffic. - NetObject *getScopeObject(); + NetObject* getScopeObject() {}; /// Add an object to scope. void objectInScope(NetObject *object); @@ -1047,7 +1047,7 @@ public: bool startDemoRecord(const char *fileName); bool replayDemoRecord(const char *fileName); - void startDemoRead(); + void startDemoRead() {}; void stopRecording(); void stopDemoPlayback(); diff --git a/Engine/source/sim/netInterface.cpp b/Engine/source/sim/netInterface.cpp index fd2c51bc4..e11d65383 100644 --- a/Engine/source/sim/netInterface.cpp +++ b/Engine/source/sim/netInterface.cpp @@ -42,7 +42,8 @@ NetInterface::NetInterface() mLastTimeoutCheckTime = 0; mAllowConnections = false; - + dMemset(mRandomHashData, 0, sizeof(mRandomHashData)); + mRandomDataInitialized = false; } void NetInterface::initRandomData() diff --git a/Engine/source/sim/netStringTable.h b/Engine/source/sim/netStringTable.h index 948d497ce..a3cc9f530 100644 --- a/Engine/source/sim/netStringTable.h +++ b/Engine/source/sim/netStringTable.h @@ -64,7 +64,6 @@ class NetStringTable U32 size; U32 firstFree; U32 firstValid; - U32 sequenceCount; Entry *table; U32 hashTable[HashTableSize]; From fabd5864fa9124e8cb4ca8ac381b0805c9df881b Mon Sep 17 00:00:00 2001 From: AzaezelX Date: Mon, 11 May 2020 15:30:21 -0500 Subject: [PATCH 18/25] uninitialized variables-t3d --- Engine/source/T3D/assets/ImageAsset.cpp | 2 +- Engine/source/T3D/cameraSpline.cpp | 3 +++ Engine/source/T3D/convexShape.h | 4 ++-- Engine/source/T3D/debris.cpp | 5 +++++ Engine/source/T3D/decal/decalInstance.cpp | 17 +++++++++++++++++ Engine/source/T3D/decal/decalInstance.h | 2 +- Engine/source/T3D/fx/explosion.cpp | 4 ++++ Engine/source/T3D/fx/fxFoliageReplicator.cpp | 12 +++++++++++- Engine/source/T3D/fx/lightning.cpp | 5 ++++- Engine/source/T3D/fx/particleEmitter.cpp | 3 ++- Engine/source/T3D/fx/ribbon.cpp | 1 + Engine/source/T3D/fx/ribbonNode.h | 3 --- Engine/source/T3D/fx/splash.cpp | 4 +++- Engine/source/T3D/gameBase/gameBase.cpp | 2 ++ Engine/source/T3D/gameBase/moveList.cpp | 1 + Engine/source/T3D/guiMaterialPreview.cpp | 2 ++ Engine/source/T3D/physics/physicsForce.cpp | 1 + Engine/source/T3D/player.cpp | 8 ++++++++ Engine/source/T3D/rigidShape.cpp | 1 + Engine/source/T3D/shapeBase.h | 2 +- Engine/source/T3D/shapeImage.cpp | 4 ++++ Engine/source/T3D/turret/aiTurretShape.cpp | 1 + Engine/source/T3D/turret/turretShape.cpp | 12 +++++++++--- Engine/source/T3D/vehicles/flyingVehicle.cpp | 5 +++++ Engine/source/T3D/vehicles/flyingVehicle.h | 1 - Engine/source/T3D/vehicles/hoverVehicle.cpp | 18 ++++++++++++------ Engine/source/T3D/vehicles/wheeledVehicle.cpp | 2 +- 27 files changed, 102 insertions(+), 23 deletions(-) diff --git a/Engine/source/T3D/assets/ImageAsset.cpp b/Engine/source/T3D/assets/ImageAsset.cpp index 046d98b4c..254d05837 100644 --- a/Engine/source/T3D/assets/ImageAsset.cpp +++ b/Engine/source/T3D/assets/ImageAsset.cpp @@ -103,7 +103,7 @@ EndImplementEnumType; //----------------------------------------------------------------------------- -ImageAsset::ImageAsset() : AssetBase(), mImage(nullptr), mUseMips(true), mIsHDRImage(false), mIsValidImage(false) +ImageAsset::ImageAsset() : AssetBase(), mImage(nullptr), mUseMips(true), mIsHDRImage(false), mIsValidImage(false), mImageType(Albedo) { mImageFileName = StringTable->EmptyString(); } diff --git a/Engine/source/T3D/cameraSpline.cpp b/Engine/source/T3D/cameraSpline.cpp index 1129f91f8..d7c525e33 100644 --- a/Engine/source/T3D/cameraSpline.cpp +++ b/Engine/source/T3D/cameraSpline.cpp @@ -36,6 +36,7 @@ CameraSpline::Knot::Knot() mSpeed = 0.0f; mType = NORMAL; mPath = SPLINE; + mDistance = 0.0f; prev = NULL; next = NULL; }; @@ -46,6 +47,7 @@ CameraSpline::Knot::Knot(const Knot &k) mSpeed = k.mSpeed; mType = k.mType; mPath = k.mPath; + mDistance = k.mDistance; prev = NULL; next = NULL; } @@ -56,6 +58,7 @@ CameraSpline::Knot::Knot(const Point3F &p, const QuatF &r, F32 s, Knot::Type typ mSpeed = s; mType = type; mPath = path; + mDistance = 0.0f; prev = NULL; next = NULL; } diff --git a/Engine/source/T3D/convexShape.h b/Engine/source/T3D/convexShape.h index 6145937b7..3bbd2e657 100644 --- a/Engine/source/T3D/convexShape.h +++ b/Engine/source/T3D/convexShape.h @@ -50,7 +50,7 @@ protected: public: - ConvexShapeCollisionConvex() { mType = ConvexShapeCollisionConvexType; } + ConvexShapeCollisionConvex() { pShape = NULL; mType = ConvexShapeCollisionConvexType; } ConvexShapeCollisionConvex( const ConvexShapeCollisionConvex& cv ) { mType = ConvexShapeCollisionConvexType; @@ -297,4 +297,4 @@ protected: }; -#endif // _CONVEXSHAPE_H_ \ No newline at end of file +#endif // _CONVEXSHAPE_H_ diff --git a/Engine/source/T3D/debris.cpp b/Engine/source/T3D/debris.cpp index 24014d5c8..b581b8261 100644 --- a/Engine/source/T3D/debris.cpp +++ b/Engine/source/T3D/debris.cpp @@ -157,6 +157,9 @@ DebrisData::DebrisData(const DebrisData& other, bool temp_clone) : GameBaseData( explosion = other.explosion; dMemcpy( emitterList, other.emitterList, sizeof( emitterList ) ); dMemcpy( emitterIDList, other.emitterIDList, sizeof( emitterIDList ) ); // -- for pack/unpack of emitterList ptrs + mShatter = other.mShatter; + mProbBreak = other.mProbBreak; + mProbDepth = other.mProbDepth; } DebrisData::~DebrisData() @@ -533,6 +536,8 @@ Debris::Debris() mInitialTrans.identity(); mRadius = 0.2f; mStatic = false; + mElasticity = 0.5f; + mFriction = 0.5f; dMemset( mEmitterList, 0, sizeof( mEmitterList ) ); diff --git a/Engine/source/T3D/decal/decalInstance.cpp b/Engine/source/T3D/decal/decalInstance.cpp index 935361b6d..a0b2d8748 100644 --- a/Engine/source/T3D/decal/decalInstance.cpp +++ b/Engine/source/T3D/decal/decalInstance.cpp @@ -24,6 +24,23 @@ #include "T3D/decal/decalInstance.h" #include "scene/sceneRenderState.h" +DecalInstance::DecalInstance() + : mDataBlock(NULL), + mRotAroundNormal(0.0f), + mSize(0.0f), + mCreateTime(0), + mVisibility(1.0f), + mLastAlpha(1.0f), + mTextureRectIdx(0), + mVerts(NULL), + mIndices(NULL), + mVertCount(0), + mIndxCount(0), + mFlags(0), + mRenderPriority(0), + mId(-1), + mCustomTex(NULL) +{} void DecalInstance::getWorldMatrix( MatrixF *outMat, bool flip ) { outMat->setPosition( mPosition ); diff --git a/Engine/source/T3D/decal/decalInstance.h b/Engine/source/T3D/decal/decalInstance.h index 52402e89a..9365f4a3a 100644 --- a/Engine/source/T3D/decal/decalInstance.h +++ b/Engine/source/T3D/decal/decalInstance.h @@ -87,7 +87,7 @@ class DecalInstance /// Calculates the size of this decal onscreen in pixels, used for LOD. F32 calcPixelSize( U32 viewportHeight, const Point3F &cameraPos, F32 worldToScreenScaleY ) const; - DecalInstance() : mId(-1) {} + DecalInstance(); }; #endif // _DECALINSTANCE_H_ diff --git a/Engine/source/T3D/fx/explosion.cpp b/Engine/source/T3D/fx/explosion.cpp index 4da7b2902..6640cb9ab 100644 --- a/Engine/source/T3D/fx/explosion.cpp +++ b/Engine/source/T3D/fx/explosion.cpp @@ -238,6 +238,9 @@ ExplosionData::ExplosionData() explosionScale.set(1.0f, 1.0f, 1.0f); playSpeed = 1.0f; + explosionShape = NULL; + explosionAnimation = -1; + dMemset( emitterList, 0, sizeof( emitterList ) ); dMemset( emitterIDList, 0, sizeof( emitterIDList ) ); dMemset( debrisList, 0, sizeof( debrisList ) ); @@ -924,6 +927,7 @@ Explosion::Explosion() ss_index = 0; mDataBlock = 0; soundProfile_clone = 0; + mRandomVal = 0; } Explosion::~Explosion() diff --git a/Engine/source/T3D/fx/fxFoliageReplicator.cpp b/Engine/source/T3D/fx/fxFoliageReplicator.cpp index bd8389486..4f21482f8 100644 --- a/Engine/source/T3D/fx/fxFoliageReplicator.cpp +++ b/Engine/source/T3D/fx/fxFoliageReplicator.cpp @@ -286,6 +286,7 @@ fxFoliageReplicator::fxFoliageReplicator() // Reset Foliage Count. mCurrentFoliageCount = 0; + dMemset(&mFrustumRenderSet, 0, sizeof(mFrustumRenderSet)); // Reset Creation Area Angle Animation. mCreationAreaAngle = 0; @@ -299,8 +300,15 @@ fxFoliageReplicator::fxFoliageReplicator() // Reset Frame Serial ID. mFrameSerialID = 0; - + mQuadTreeLevels = 0; + mNextAllocatedNodeIdx = 0; mAlphaLookup = NULL; + mFadeInGradient = 0.0f; + mFadeOutGradient = 0.0f; + mGlobalSwayPhase = 0.0f; + mGlobalSwayTimeRatio = 1.0f; + mGlobalLightPhase = 0.0f; + mGlobalLightTimeRatio = 1.0f; mDirty = true; @@ -317,6 +325,8 @@ fxFoliageReplicator::fxFoliageReplicator() mFoliageShaderTrueBillboardSC = NULL; mFoliageShaderGroundAlphaSC = NULL; mFoliageShaderAmbientColorSC = NULL; + mDiffuseTextureSC = NULL; + mAlphaMapTextureSC = NULL; mShaderData = NULL; } diff --git a/Engine/source/T3D/fx/lightning.cpp b/Engine/source/T3D/fx/lightning.cpp index 3aef6acf4..e808fb406 100644 --- a/Engine/source/T3D/fx/lightning.cpp +++ b/Engine/source/T3D/fx/lightning.cpp @@ -248,7 +248,7 @@ LightningData::LightningData() strikeTextureNames[i] = NULL; strikeTextures[i] = NULL; } - + numThunders = 0; mNumStrikeTextures = 0; } @@ -371,6 +371,7 @@ Lightning::Lightning() mNetFlags.set(Ghostable|ScopeAlways); mTypeMask |= StaticObjectType|EnvironmentObjectType; + mDataBlock = NULL; mLastThink = 0; mStrikeListHead = NULL; @@ -1041,6 +1042,8 @@ LightningBolt::LightningBolt() maxMinorAngle = 15.0f; fadeTime = 0.2f; renderTime = 0.125; + dMemset(&mMajorNodes, 0, sizeof(mMajorNodes)); + percentFade = 0.0f; } //-------------------------------------------------------------------------- diff --git a/Engine/source/T3D/fx/particleEmitter.cpp b/Engine/source/T3D/fx/particleEmitter.cpp index f5b705bd5..5cbe35409 100644 --- a/Engine/source/T3D/fx/particleEmitter.cpp +++ b/Engine/source/T3D/fx/particleEmitter.cpp @@ -846,6 +846,7 @@ ParticleEmitterData::ParticleEmitterData(const ParticleEmitterData& other, bool textureName = other.textureName; textureHandle = other.textureHandle; // -- TextureHandle loads using textureName highResOnly = other.highResOnly; + glow = other.glow; renderReflection = other.renderReflection; fade_color = other.fade_color; fade_size = other.fade_size; @@ -965,7 +966,7 @@ ParticleEmitter::ParticleEmitter() pos_pe.set(0,0,0); sort_priority = 0; mDataBlock = 0; - + std::fill_n(sizes, ParticleData::PDC_NUM_KEYS, 0.0f); #if defined(AFX_CAP_PARTICLE_POOLS) pool = 0; #endif diff --git a/Engine/source/T3D/fx/ribbon.cpp b/Engine/source/T3D/fx/ribbon.cpp index a3d788590..42fa1e63e 100644 --- a/Engine/source/T3D/fx/ribbon.cpp +++ b/Engine/source/T3D/fx/ribbon.cpp @@ -170,6 +170,7 @@ void RibbonData::unpackData(BitStream* stream) // Ribbon::Ribbon() { + mDataBlock = NULL; mTypeMask |= StaticObjectType; VECTOR_SET_ASSOCIATION(mSegmentPoints); diff --git a/Engine/source/T3D/fx/ribbonNode.h b/Engine/source/T3D/fx/ribbonNode.h index cdd86ef33..d4be52fa8 100644 --- a/Engine/source/T3D/fx/ribbonNode.h +++ b/Engine/source/T3D/fx/ribbonNode.h @@ -37,9 +37,6 @@ class RibbonNodeData : public GameBaseData { typedef GameBaseData Parent; -public: - F32 timeMultiple; - public: RibbonNodeData(); ~RibbonNodeData(); diff --git a/Engine/source/T3D/fx/splash.cpp b/Engine/source/T3D/fx/splash.cpp index 812c1bb2f..d77c46edb 100644 --- a/Engine/source/T3D/fx/splash.cpp +++ b/Engine/source/T3D/fx/splash.cpp @@ -309,6 +309,7 @@ Splash::Splash() mDelayMS = 0; mCurrMS = 0; + mRandAngle = 0; mEndingMS = 1000; mActive = false; mRadius = 0.0; @@ -319,7 +320,8 @@ Splash::Splash() mElapsedTime = 0.0; mInitialNormal.set( 0.0, 0.0, 1.0 ); - + mFade = 0; + mFog = 0; // Only allocated client side. mNetFlags.set( IsGhost ); } diff --git a/Engine/source/T3D/gameBase/gameBase.cpp b/Engine/source/T3D/gameBase/gameBase.cpp index 3d0e8bd1e..a1616751a 100644 --- a/Engine/source/T3D/gameBase/gameBase.cpp +++ b/Engine/source/T3D/gameBase/gameBase.cpp @@ -254,6 +254,8 @@ GameBase::GameBase() mTicksSinceLastMove = 0; mIsAiControlled = false; #endif + mTickCount = 0; + mCameraFov = 90.f; } GameBase::~GameBase() diff --git a/Engine/source/T3D/gameBase/moveList.cpp b/Engine/source/T3D/gameBase/moveList.cpp index c4eea88ee..f91ff291c 100644 --- a/Engine/source/T3D/gameBase/moveList.cpp +++ b/Engine/source/T3D/gameBase/moveList.cpp @@ -26,6 +26,7 @@ MoveList::MoveList() { + mConnection = NULL; mControlMismatch = false; reset(); } diff --git a/Engine/source/T3D/guiMaterialPreview.cpp b/Engine/source/T3D/guiMaterialPreview.cpp index 05d42b87f..ad1de4c2d 100644 --- a/Engine/source/T3D/guiMaterialPreview.cpp +++ b/Engine/source/T3D/guiMaterialPreview.cpp @@ -61,6 +61,8 @@ GuiMaterialPreview::GuiMaterialPreview() // By default don't do dynamic reflection // updates for this viewport. mReflectPriority = 0.0f; + mMountedModel = NULL; + mSkinTag = 0; } GuiMaterialPreview::~GuiMaterialPreview() diff --git a/Engine/source/T3D/physics/physicsForce.cpp b/Engine/source/T3D/physics/physicsForce.cpp index a8f16dca5..a64cf71f7 100644 --- a/Engine/source/T3D/physics/physicsForce.cpp +++ b/Engine/source/T3D/physics/physicsForce.cpp @@ -43,6 +43,7 @@ ConsoleDocClass( PhysicsForce, PhysicsForce::PhysicsForce() : mWorld( NULL ), + mForce(0.0f), mPhysicsTick( false ), mBody( NULL ) { diff --git a/Engine/source/T3D/player.cpp b/Engine/source/T3D/player.cpp index 06ec7171a..91444bb53 100644 --- a/Engine/source/T3D/player.cpp +++ b/Engine/source/T3D/player.cpp @@ -311,6 +311,11 @@ PlayerData::PlayerData() jumpEnergyDrain = 0.0f; minJumpEnergy = 0.0f; jumpSurfaceAngle = 78.0f; + jumpSurfaceCos = mCos(mDegToRad(jumpSurfaceAngle)); + + for (U32 i = 0; i < NumRecoilSequences; i++) + recoilSequence[i] = -1; + jumpDelay = 30; minJumpSpeed = 500.0f; maxJumpSpeed = 2.0f * minJumpSpeed; @@ -370,6 +375,9 @@ PlayerData::PlayerData() actionCount = 0; lookAction = 0; + dMemset(spineNode, 0, sizeof(spineNode)); + + pickupDelta = 0.0f; // size of bounding box boxSize.set(1.0f, 1.0f, 2.3f); diff --git a/Engine/source/T3D/rigidShape.cpp b/Engine/source/T3D/rigidShape.cpp index e2ba4606c..005ef8c98 100644 --- a/Engine/source/T3D/rigidShape.cpp +++ b/Engine/source/T3D/rigidShape.cpp @@ -253,6 +253,7 @@ RigidShapeData::RigidShapeData() dustEmitter = NULL; dustID = 0; + triggerDustHeight = 3.0; dustHeight = 1.0; dMemset( splashEmitterList, 0, sizeof( splashEmitterList ) ); diff --git a/Engine/source/T3D/shapeBase.h b/Engine/source/T3D/shapeBase.h index 364d1cbe7..71b221036 100644 --- a/Engine/source/T3D/shapeBase.h +++ b/Engine/source/T3D/shapeBase.h @@ -111,7 +111,7 @@ class ShapeBaseConvex : public Convex Box3F box; public: - ShapeBaseConvex() { mType = ShapeBaseConvexType; nodeTransform = 0; } + ShapeBaseConvex() :pShapeBase(NULL), transform(NULL), hullId(NULL), nodeTransform(0) { mType = ShapeBaseConvexType; } ShapeBaseConvex(const ShapeBaseConvex& cv) { mObject = cv.mObject; pShapeBase = cv.pShapeBase; diff --git a/Engine/source/T3D/shapeImage.cpp b/Engine/source/T3D/shapeImage.cpp index a12be19c2..8293b24a0 100644 --- a/Engine/source/T3D/shapeImage.cpp +++ b/Engine/source/T3D/shapeImage.cpp @@ -134,6 +134,8 @@ ShapeBaseImageData::StateData::StateData() recoil = NoRecoil; sound = 0; emitter = NULL; + shapeSequence = NULL; + shapeSequenceScale = true; script = 0; ignoreLoadedForReady = false; @@ -1396,6 +1398,7 @@ ShapeBase::MountedImage::MountedImage() dataBlock = 0; nextImage = InvalidImagePtr; delayTime = 0; + rDT = 0.0f; ammo = false; target = false; triggerDown = false; @@ -1408,6 +1411,7 @@ ShapeBase::MountedImage::MountedImage() motion = false; lightStart = 0; lightInfo = NULL; + dMemset(emitter, 0, sizeof(emitter)); for (U32 i=0; i Date: Mon, 11 May 2020 15:37:43 -0500 Subject: [PATCH 19/25] uninitialized variables-terrain --- Engine/source/terrain/terrCell.cpp | 6 +++++- Engine/source/terrain/terrCellMaterial.cpp | 3 ++- Engine/source/terrain/terrCellMaterial.h | 12 +++++++++++- Engine/source/terrain/terrCollision.cpp | 9 ++++++++- Engine/source/terrain/terrData.cpp | 1 + Engine/source/terrain/terrFile.cpp | 1 + 6 files changed, 28 insertions(+), 4 deletions(-) diff --git a/Engine/source/terrain/terrCell.cpp b/Engine/source/terrain/terrCell.cpp index ba1262df1..e1b0caecb 100644 --- a/Engine/source/terrain/terrCell.cpp +++ b/Engine/source/terrain/terrCell.cpp @@ -58,7 +58,11 @@ TerrCell::TerrCell() mHasEmpty( false ), mMaterial( NULL ), mMaterials( 0 ), - mIsInteriorOnly( false ) + mIsInteriorOnly( false ), + mSize(smMinCellSize), + mLevel(0), + mTerrain(NULL), + mRadius(0.5f) { dMemset( mChildren, 0, sizeof( mChildren ) ); zode_vertexBuffer = 0; diff --git a/Engine/source/terrain/terrCellMaterial.cpp b/Engine/source/terrain/terrCellMaterial.cpp index 66ecfb4c2..fbcac6f1e 100644 --- a/Engine/source/terrain/terrCellMaterial.cpp +++ b/Engine/source/terrain/terrCellMaterial.cpp @@ -73,7 +73,8 @@ TerrainCellMaterial::TerrainCellMaterial() : mTerrain( NULL ), mCurrPass( 0 ), mDeferredMat( NULL ), - mReflectMat( NULL ) + mReflectMat( NULL ), + mMaterials(0) { smAllMaterials.push_back( this ); } diff --git a/Engine/source/terrain/terrCellMaterial.h b/Engine/source/terrain/terrCellMaterial.h index d762dd4d5..a635486ba 100644 --- a/Engine/source/terrain/terrCellMaterial.h +++ b/Engine/source/terrain/terrCellMaterial.h @@ -58,6 +58,8 @@ protected: public: MaterialInfo() + :mat(NULL), layerId(0), detailTexConst(NULL), macroTexConst(NULL), normalTexConst(NULL), + compositeTexConst(NULL), detailInfoVConst(NULL), detailInfoPConst(NULL), macroInfoVConst(NULL), macroInfoPConst(NULL) { } @@ -92,7 +94,15 @@ protected: public: Pass() - : shader( NULL ) + : shader( NULL ), + modelViewProjConst(NULL), worldViewOnly(NULL), viewToObj(NULL), + eyePosWorldConst(NULL), eyePosConst(NULL), + objTransConst(NULL), worldToObjConst(NULL), vEyeConst(NULL), + layerSizeConst(NULL), lightParamsConst(NULL), lightInfoBufferConst(NULL), + baseTexMapConst(NULL), layerTexConst(NULL), + lightMapTexConst(NULL), + squareSize(NULL), oneOverTerrainSize(NULL), + fogDataConst(NULL), fogColorConst(NULL) { } diff --git a/Engine/source/terrain/terrCollision.cpp b/Engine/source/terrain/terrCollision.cpp index bb8211199..0d2cb905f 100644 --- a/Engine/source/terrain/terrCollision.cpp +++ b/Engine/source/terrain/terrCollision.cpp @@ -167,13 +167,20 @@ S32 sFaceList135[16][9] = { TerrainConvex::TerrainConvex() { + halfA = true; + square = NULL; + squareId = 0; + material = 0; + split45 = false; + mType = TerrainConvexType; } TerrainConvex::TerrainConvex( const TerrainConvex &cv ) { mType = TerrainConvexType; - + halfA = false; + square = NULL; // Only a partial copy... mObject = cv.mObject; split45 = cv.split45; diff --git a/Engine/source/terrain/terrData.cpp b/Engine/source/terrain/terrData.cpp index a9c70080f..7abfbc867 100644 --- a/Engine/source/terrain/terrData.cpp +++ b/Engine/source/terrain/terrData.cpp @@ -190,6 +190,7 @@ TerrainBlock::TerrainBlock() mMaxDetailDistance( 0.0f ), mBaseTexScaleConst( NULL ), mBaseTexIdConst( NULL ), + mBaseLayerSizeConst(NULL), mDetailsDirty( false ), mLayerTexDirty( false ), mBaseTexSize( 1024 ), diff --git a/Engine/source/terrain/terrFile.cpp b/Engine/source/terrain/terrFile.cpp index 0970f48bc..727074106 100644 --- a/Engine/source/terrain/terrFile.cpp +++ b/Engine/source/terrain/terrFile.cpp @@ -46,6 +46,7 @@ template<> ResourceBase::Signature Resource::signature() TerrainFile::TerrainFile() : mSize( 256 ), + mGridLevels(0), mFileVersion( FILE_VERSION ), mNeedsResaving( false ) { From 9e1c22204f3f6c1553c398a8f536839a82a354ec Mon Sep 17 00:00:00 2001 From: AzaezelX Date: Mon, 11 May 2020 15:40:55 -0500 Subject: [PATCH 20/25] uninitialized variables-ts --- Engine/source/ts/assimp/assimpAppMaterial.cpp | 2 +- Engine/source/ts/collada/colladaUtils.h | 2 +- Engine/source/ts/loader/appMesh.cpp | 2 +- Engine/source/ts/loader/appNode.cpp | 1 + Engine/source/ts/loader/appSequence.h | 2 +- Engine/source/ts/loader/tsShapeLoader.h | 2 +- Engine/source/ts/tsMesh.cpp | 9 ++++++++- Engine/source/ts/tsMesh.h | 4 ++-- Engine/source/ts/tsPartInstance.cpp | 1 + Engine/source/ts/tsShape.cpp | 9 ++++++++- Engine/source/ts/tsShapeConstruct.h | 2 +- Engine/source/ts/tsShapeInstance.cpp | 2 ++ Engine/source/ts/tsSortedMesh.h | 1 + 13 files changed, 29 insertions(+), 10 deletions(-) diff --git a/Engine/source/ts/assimp/assimpAppMaterial.cpp b/Engine/source/ts/assimp/assimpAppMaterial.cpp index 138085036..979cf8318 100644 --- a/Engine/source/ts/assimp/assimpAppMaterial.cpp +++ b/Engine/source/ts/assimp/assimpAppMaterial.cpp @@ -57,7 +57,7 @@ AssimpAppMaterial::AssimpAppMaterial(const char* matName) { name = ColladaUtils::getOptions().matNamePrefix; name += matName; - + mAIMat = NULL; // Set some defaults flags |= TSMaterialList::S_Wrap; flags |= TSMaterialList::T_Wrap; diff --git a/Engine/source/ts/collada/colladaUtils.h b/Engine/source/ts/collada/colladaUtils.h index 9dad22056..781c41eee 100644 --- a/Engine/source/ts/collada/colladaUtils.h +++ b/Engine/source/ts/collada/colladaUtils.h @@ -886,7 +886,7 @@ struct AnimData return element ? (AnimChannels*)const_cast(element)->getUserData() : 0; } - AnimData() : enabled(false) { } + AnimData() : enabled(false), targetValueOffset(0), targetValueCount(0){ } void parseTargetString(const char* target, S32 fullCount, const char* elements[]); diff --git a/Engine/source/ts/loader/appMesh.cpp b/Engine/source/ts/loader/appMesh.cpp index bd5c291e0..a51b91002 100644 --- a/Engine/source/ts/loader/appMesh.cpp +++ b/Engine/source/ts/loader/appMesh.cpp @@ -26,7 +26,7 @@ Vector AppMesh::appMaterials; AppMesh::AppMesh() - : flags(0), vertsPerFrame(0),numFrames(0), numMatFrames(0) + : flags(0), vertsPerFrame(0),numFrames(0), numMatFrames(0), detailSize(1) { } diff --git a/Engine/source/ts/loader/appNode.cpp b/Engine/source/ts/loader/appNode.cpp index 6616d8120..e869cf02b 100644 --- a/Engine/source/ts/loader/appNode.cpp +++ b/Engine/source/ts/loader/appNode.cpp @@ -26,6 +26,7 @@ AppNode::AppNode() { mName = NULL; mParentName = NULL; + mParentIndex = 0; } AppNode::~AppNode() diff --git a/Engine/source/ts/loader/appSequence.h b/Engine/source/ts/loader/appSequence.h index c31683321..f5fdfae12 100644 --- a/Engine/source/ts/loader/appSequence.h +++ b/Engine/source/ts/loader/appSequence.h @@ -39,7 +39,7 @@ public: F32 fps; public: - AppSequence() { } + AppSequence():fps(30.0f) { } //default based on TSShapeLoader::XXXFrameRate(s) and AssimpAppSequence fallback virtual ~AppSequence() { } virtual void setActive(bool active) { } diff --git a/Engine/source/ts/loader/tsShapeLoader.h b/Engine/source/ts/loader/tsShapeLoader.h index 5ff189245..bfd0f687c 100644 --- a/Engine/source/ts/loader/tsShapeLoader.h +++ b/Engine/source/ts/loader/tsShapeLoader.h @@ -182,7 +182,7 @@ protected: void install(); public: - TSShapeLoader() : boundsNode(0) { } + TSShapeLoader() : boundsNode(0), shape(NULL) { } virtual ~TSShapeLoader(); static const Torque::Path& getShapePath() { return shapePath; } diff --git a/Engine/source/ts/tsMesh.cpp b/Engine/source/ts/tsMesh.cpp index 5800e7e7c..4f9dd434a 100644 --- a/Engine/source/ts/tsMesh.cpp +++ b/Engine/source/ts/tsMesh.cpp @@ -1182,7 +1182,14 @@ TSMesh::TSMesh() : mMeshType( StandardMeshType ) mNumVerts = 0; mVertSize = 0; mVertOffset = 0; - + mRadius = 0.0f; + mVertexFormat = NULL; + mPrimBufferOffset = 0; + numFrames = 0; + numMatFrames = 0; + vertsPerFrame = 0; + mPlanesPerFrame = 0; + mMergeBufferStart = 0; mParentMeshObject = NULL; } diff --git a/Engine/source/ts/tsMesh.h b/Engine/source/ts/tsMesh.h index cd53a04fc..b20a9a2fb 100644 --- a/Engine/source/ts/tsMesh.h +++ b/Engine/source/ts/tsMesh.h @@ -198,7 +198,7 @@ public: bool ownsData; public: - TSMeshVertexArray() : base(NULL), numElements(0), colorOffset(0), boneOffset(0), vertexDataReady(false), ownsData(false) {} + TSMeshVertexArray() : base(NULL), vertSz(0), numElements(0), colorOffset(0), boneOffset(0), vertexDataReady(false), ownsData(false) {} virtual ~TSMeshVertexArray() { set(NULL, 0, 0, 0, 0); } virtual void set(void *b, dsize_t s, U32 n, S32 inColorOffset, S32 inBoneOffset, bool nowOwnsData = true) @@ -339,7 +339,7 @@ protected: Point3F mBillboardAxis; /// @name Convex Hull Data - /// Convex hulls are convex (no angles >= 180º) meshes used for collision + /// Convex hulls are convex (no angles >= 180º) meshes used for collision /// @{ Vector mPlaneNormals; diff --git a/Engine/source/ts/tsPartInstance.cpp b/Engine/source/ts/tsPartInstance.cpp index 4c0875c3f..0c1a1b35c 100644 --- a/Engine/source/ts/tsPartInstance.cpp +++ b/Engine/source/ts/tsPartInstance.cpp @@ -51,6 +51,7 @@ void TSPartInstance::init(TSShapeInstance * sourceShape) mCurrentObjectDetail = 0; mCurrentIntraDL = 1.0f; mData = 0; + mRadius = 0.125; } TSPartInstance::~TSPartInstance() diff --git a/Engine/source/ts/tsShape.cpp b/Engine/source/ts/tsShape.cpp index 9ffef7b56..ef87b1cf2 100644 --- a/Engine/source/ts/tsShape.cpp +++ b/Engine/source/ts/tsShape.cpp @@ -68,12 +68,19 @@ U32 TSShape::smMaxSkinBones = 70; TSShape::TSShape() { + mExporterVersion = 124; + mSmallestVisibleSize = 2; + mSmallestVisibleDL = 0; + mRadius = 0; + mFlags = 0; + tubeRadius = 0; + data = NULL; materialList = NULL; mReadVersion = -1; // -1 means constructed from scratch (e.g., in exporter or no read yet) mSequencesConstructed = false; mShapeData = NULL; mShapeDataSize = 0; - + mVertexSize = 0; mUseDetailFromScreenError = false; mNeedReinit = false; diff --git a/Engine/source/ts/tsShapeConstruct.h b/Engine/source/ts/tsShapeConstruct.h index dba25d0ac..49b157f17 100644 --- a/Engine/source/ts/tsShapeConstruct.h +++ b/Engine/source/ts/tsShapeConstruct.h @@ -196,7 +196,7 @@ public: public: TSShapeConstructor(); - TSShapeConstructor(const String& path) : mShapePath(path) { } + TSShapeConstructor(const String& path) : mShapePath(path), mShape(NULL), mLoadingShape(false){ } ~TSShapeConstructor(); DECLARE_CONOBJECT(TSShapeConstructor); diff --git a/Engine/source/ts/tsShapeInstance.cpp b/Engine/source/ts/tsShapeInstance.cpp index d6889c2fe..4665efde3 100644 --- a/Engine/source/ts/tsShapeInstance.cpp +++ b/Engine/source/ts/tsShapeInstance.cpp @@ -118,6 +118,7 @@ TSShapeInstance::TSShapeInstance( const Resource &shape, bool loadMater mShapeResource = shape; mShape = mShapeResource; + mUseOverrideTexture = false; buildInstanceData( mShape, loadMaterials ); } @@ -135,6 +136,7 @@ TSShapeInstance::TSShapeInstance( TSShape *shape, bool loadMaterials ) mShapeResource = NULL; mShape = shape; + mUseOverrideTexture = false; buildInstanceData( mShape, loadMaterials ); } diff --git a/Engine/source/ts/tsSortedMesh.h b/Engine/source/ts/tsSortedMesh.h index 671fb7823..df0e58ddd 100644 --- a/Engine/source/ts/tsSortedMesh.h +++ b/Engine/source/ts/tsSortedMesh.h @@ -71,6 +71,7 @@ public: void disassemble(); TSSortedMesh() { + alwaysWriteDepth = false; mMeshType = SortedMeshType; } }; From 43259e29c155f64c118a7004acb9ba415ac65937 Mon Sep 17 00:00:00 2001 From: AzaezelX Date: Mon, 11 May 2020 15:46:44 -0500 Subject: [PATCH 21/25] uninitialized variables-util --- Engine/source/util/noise2d.cpp | 2 ++ Engine/source/util/sampler.cpp | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/Engine/source/util/noise2d.cpp b/Engine/source/util/noise2d.cpp index 6c51dfc19..2e9d9870f 100644 --- a/Engine/source/util/noise2d.cpp +++ b/Engine/source/util/noise2d.cpp @@ -26,6 +26,8 @@ //-------------------------------------- Noise2D::Noise2D() { + dMemset(mPermutation, 0, sizeof(mPermutation)); + dMemset(mGradient, 0, sizeof(mGradient)); mSeed = 0; } diff --git a/Engine/source/util/sampler.cpp b/Engine/source/util/sampler.cpp index f4d051e1e..405a81800 100644 --- a/Engine/source/util/sampler.cpp +++ b/Engine/source/util/sampler.cpp @@ -118,9 +118,9 @@ class CSVSamplerBackend : public ISamplerBackend const char* mString; } mValue; - SampleRecord() {} + SampleRecord() : mKey(0), mSet(false), mType(TypeBool) { mValue.mBool = false; } SampleRecord( U32 key ) - : mKey( key ), mSet( false ) {} + : mKey( key ), mSet( false ), mType(TypeBool) { mValue.mBool = false; } void set( bool value ) { From 36cbc4c962bb04d1bf188380926d4d0a54ed5dba Mon Sep 17 00:00:00 2001 From: AzaezelX Date: Mon, 11 May 2020 15:53:14 -0500 Subject: [PATCH 22/25] uninitialized variables-verve --- .../Verve/Extension/Game/VSpawnSphereSpawnTargetTrack.cpp | 6 ++++-- Engine/source/Verve/VActor/VActorPhysicsController.cpp | 5 +++-- Engine/source/Verve/VPath/VPathEditor.h | 8 +++++--- 3 files changed, 12 insertions(+), 7 deletions(-) diff --git a/Engine/source/Verve/Extension/Game/VSpawnSphereSpawnTargetTrack.cpp b/Engine/source/Verve/Extension/Game/VSpawnSphereSpawnTargetTrack.cpp index d0cc2930a..220362290 100644 --- a/Engine/source/Verve/Extension/Game/VSpawnSphereSpawnTargetTrack.cpp +++ b/Engine/source/Verve/Extension/Game/VSpawnSphereSpawnTargetTrack.cpp @@ -29,7 +29,9 @@ IMPLEMENT_CONOBJECT( VSpawnSphereSpawnTargetTrack ); VSpawnSphereSpawnTargetTrack::VSpawnSphereSpawnTargetTrack( void ) { - setLabel( "SpawnTargetTrack" ); + mDespawnOnStop = false; + mDespawnOnLoop = false; + setLabel( "SpawnTargetTrack" ); } void VSpawnSphereSpawnTargetTrack::initPersistFields( void ) @@ -152,4 +154,4 @@ void VSpawnSphereSpawnTargetTrack::despawnTargets( void ) // Delete the Object. object->deleteObject(); } -} \ No newline at end of file +} diff --git a/Engine/source/Verve/VActor/VActorPhysicsController.cpp b/Engine/source/Verve/VActor/VActorPhysicsController.cpp index 5e3332d59..326626015 100644 --- a/Engine/source/Verve/VActor/VActorPhysicsController.cpp +++ b/Engine/source/Verve/VActor/VActorPhysicsController.cpp @@ -49,7 +49,8 @@ VActorPhysicsController::VActorPhysicsController( void ) : mControlState( k_NullControlState ), mMoveState( k_NullMove ), mVelocity( VectorF::Zero ), - mGravity( 0.f, 0.f, -9.8f ) + mGravity( 0.f, 0.f, -9.8f ), + mOnGround(false) { // Void. } @@ -1274,4 +1275,4 @@ void VActorPhysicsController::unpackUpdate( NetConnection *pConnection, BitStrea // Apply. setPosition( position ); } -} \ No newline at end of file +} diff --git a/Engine/source/Verve/VPath/VPathEditor.h b/Engine/source/Verve/VPath/VPathEditor.h index c337edd0c..69c925bd5 100644 --- a/Engine/source/Verve/VPath/VPathEditor.h +++ b/Engine/source/Verve/VPath/VPathEditor.h @@ -199,7 +199,7 @@ private: public: VPathEditorEditPathAction( const UTF8 *pName = "" ) : - UndoAction( pName ) + UndoAction( pName ), mEditor(NULL), mPath(NULL) { // Void. }; @@ -218,9 +218,11 @@ private: public: VPathEditorEditNodeAction( const UTF8 *pName = "" ) : - UndoAction( pName ) + UndoAction( pName ), mEditor(NULL), mPath(NULL), mNodeIndex(0), mNodeWeight(0.0f) { // Void. + mNodeOrientation.Type = VPathNode::k_OrientationFree; + mNodeOrientation.Point = Point3F(0.0f, 0.0f, 0.0f); }; VPathEditor *mEditor; @@ -290,4 +292,4 @@ namespace Utility //----------------------------------------------------------------------------- -#endif // _VT_VPATHEDITOR_H_ \ No newline at end of file +#endif // _VT_VPATHEDITOR_H_ From 5f59ebbaccf9f57a9b6ad8242de2084f065bc881 Mon Sep 17 00:00:00 2001 From: AzaezelX Date: Mon, 11 May 2020 15:59:22 -0500 Subject: [PATCH 23/25] uninitialized variables-materials --- .../materials/customShaderBindingData.h | 8 +- .../source/materials/materialDefinition.cpp | 92 ++++++++++--------- Engine/source/materials/materialDefinition.h | 4 + 3 files changed, 59 insertions(+), 45 deletions(-) diff --git a/Engine/source/materials/customShaderBindingData.h b/Engine/source/materials/customShaderBindingData.h index 29271d33f..444fa6b9a 100644 --- a/Engine/source/materials/customShaderBindingData.h +++ b/Engine/source/materials/customShaderBindingData.h @@ -29,13 +29,13 @@ public: Matrix4x4 }; private: - StringTableEntry targetedUniformName; + StringTableEntry targetedUniformName = StringTable->EmptyString(); //ShaderConstHandles shaderConstHandle; - UniformType type; + UniformType type = CustomShaderBindingData::Float; - F32 mFloat; + F32 mFloat = 0.0f; Point2F mFloat2; Point3F mFloat3; Point4F mFloat4; @@ -49,7 +49,7 @@ public: { targetedUniformName = shaderConstName; mFloat = f; - type = Float; + type = UniformType::Float; } F32 getFloat() { return mFloat; } diff --git a/Engine/source/materials/materialDefinition.cpp b/Engine/source/materials/materialDefinition.cpp index 8f7e110ac..250af18d6 100644 --- a/Engine/source/materials/materialDefinition.cpp +++ b/Engine/source/materials/materialDefinition.cpp @@ -97,6 +97,8 @@ ImplementEnumType( MaterialWaveType, { Material::Square, "Square", "Warps the material along a wave which transitions between two oppposite states. As a Square Wave, the transition is quick and sudden." }, EndImplementEnumType; +#define initMapSlot(name,id) name##Filename[id##] = String::EmptyString; name##AssetId[id##] = StringTable->EmptyString(); name##Asset[id##] = NULL; +#define bindMapSlot(name,id) if (name##AssetId[id##] != String::EmptyString) name##Asset[id##] = name##AssetId[id##]; bool Material::sAllowTextureTargetAssignment = false; @@ -111,14 +113,13 @@ GFXCubemap * Material::GetNormalizeCube() GFXCubemapHandle Material::smNormalizeCube; + Material::Material() { for( U32 i=0; iEmptyString(); - mDiffuseMapAssetId[i] = StringTable->EmptyString(); mSmoothness[i] = 0.0f; mMetalness[i] = 0.0f; @@ -136,7 +137,20 @@ Material::Material() mAccuStrength[i] = 0.6f; mAccuCoverage[i] = 0.9f; mAccuSpecular[i] = 16.0f; - + + initMapSlot(mDiffuseMap, i); + initMapSlot(mOverlayMap, i); + initMapSlot(mLightMap, i); + initMapSlot(mToneMap, i); + initMapSlot(mDetailMap, i); + initMapSlot(mNormalMap, i); + initMapSlot(mPBRConfigMap, i); + initMapSlot(mRoughMap, i); + initMapSlot(mAOMap, i); + initMapSlot(mMetalMap, i); + initMapSlot(mGlowMap, i); + initMapSlot(mDetailNormalMap, i); + mParallaxScale[i] = 0.0f; mVertLit[i] = false; @@ -225,6 +239,11 @@ Material::Material() mReverbSoundOcclusion = 1.0; } + +#define assetText(x,suff) (String::String(#x) + String::String(#suff)).c_str() +#define scriptBindMapSlot(name) addField(#name, TypeImageFilename, Offset(m##name##Filename, Material), MAX_STAGES, assetText(name,texture map.)); \ + addField(assetText(name,Asset), TypeImageAssetPtr, Offset(m##name##AssetId, Material), MAX_STAGES, assetText(name,asset reference.)); + void Material::initPersistFields() { addField("mapTo", TypeRealString, Offset(mMapTo, Material), @@ -236,38 +255,26 @@ void Material::initPersistFields() "This color is multiplied against the diffuse texture color. If no diffuse texture " "is present this is the material color." ); - addField("diffuseMap", TypeImageFilename, Offset(mDiffuseMapFilename, Material), MAX_STAGES, - "The diffuse color texture map." ); - - addField("diffuseMapAsset", TypeImageAssetPtr, Offset(mDiffuseMapAssetId, Material), MAX_STAGES, - "The diffuse color texture map." ); + scriptBindMapSlot(DiffuseMap); + scriptBindMapSlot(DiffuseMap); + scriptBindMapSlot(OverlayMap); + scriptBindMapSlot(LightMap); + scriptBindMapSlot(ToneMap); + scriptBindMapSlot(DetailMap); + scriptBindMapSlot(NormalMap); + scriptBindMapSlot(PBRConfigMap); + scriptBindMapSlot(RoughMap); + scriptBindMapSlot(AOMap); + scriptBindMapSlot(MetalMap); + scriptBindMapSlot(GlowMap); + scriptBindMapSlot(DetailNormalMap); addField("diffuseMapSRGB", TypeBool, Offset(mDiffuseMapSRGB, Material), MAX_STAGES, "Enable sRGB for the diffuse color texture map."); - addField("overlayMap", TypeImageFilename, Offset(mOverlayMapFilename, Material), MAX_STAGES, - "A secondary diffuse color texture map which will use the second texcoord of a mesh." ); - - addField("lightMap", TypeImageFilename, Offset(mLightMapFilename, Material), MAX_STAGES, - "The lightmap texture used with pureLight." ); - - addField("toneMap", TypeImageFilename, Offset(mToneMapFilename, Material), MAX_STAGES, - "The tonemap texture used with pureLight."); - - addField("detailMap", TypeImageFilename, Offset(mDetailMapFilename, Material), MAX_STAGES, - "A typically greyscale detail texture additively blended into the material." ); - addField("detailScale", TypePoint2F, Offset(mDetailScale, Material), MAX_STAGES, "The scale factor for the detail map." ); - addField( "normalMap", TypeImageFilename, Offset(mNormalMapFilename, Material), MAX_STAGES, - "The normal map texture. You can use the DXTnm format only when per-pixel " - "specular highlights are disabled, or a specular map is in use." ); - - addField( "detailNormalMap", TypeImageFilename, Offset(mDetailNormalMapFilename, Material), MAX_STAGES, - "A second normal map texture applied at the detail scale. You can use the DXTnm " - "format only when per-pixel specular highlights are disabled." ); - addField( "detailNormalMapStrength", TypeF32, Offset(mDetailNormalMapStrength, Material), MAX_STAGES, "Used to scale the strength of the detail normal map when blended with the base normal map." ); @@ -304,27 +311,14 @@ void Material::initPersistFields() addField("invertSmoothness", TypeBool, Offset(mInvertSmoothness, Material), MAX_STAGES, "Treat Smoothness as Roughness"); - addField( "PBRConfigMap", TypeImageFilename, Offset(mPBRConfigMapFilename, Material), MAX_STAGES, - "Prepacked specular map texture. The RGB channels of this texture provide per-pixel reference values for: " - "smoothness (R), Ambient Occlusion (G), and metalness(B)"); - - addField("roughMap", TypeImageFilename, Offset(mRoughMapFilename, Material), MAX_STAGES, - "smoothness map. will be packed into the R channel of a packed 'specular' map"); addField("smoothnessChan", TypeF32, Offset(mSmoothnessChan, Material), MAX_STAGES, "The input channel smoothness maps use."); - addField("aoMap", TypeImageFilename, Offset(mAOMapFilename, Material), MAX_STAGES, - "Ambient Occlusion map. will be packed into the G channel of a packed 'specular' map"); addField("AOChan", TypeF32, Offset(mAOChan, Material), MAX_STAGES, "The input channel AO maps use."); - - addField("metalMap", TypeImageFilename, Offset(mMetalMapFilename, Material), MAX_STAGES, - "Metalness map. will be packed into the B channel of a packed 'specular' map"); addField("metalChan", TypeF32, Offset(mMetalChan, Material), MAX_STAGES, "The input channel metalness maps use."); - addField("glowMap", TypeImageFilename, Offset(mGlowMapFilename, Material), MAX_STAGES, - "Metalness map. will be packed into the B channel of a packed 'specular' map"); addField("glowMul", TypeF32, Offset(mGlowMul, Material), MAX_STAGES, "The input channel metalness maps use."); addField("glow", TypeBool, Offset(mGlow, Material), MAX_STAGES, @@ -589,6 +583,7 @@ bool Material::onAdd() if ( slash != String::NPos ) mPath = scriptFile.substr( 0, slash + 1 ); + /* //bind any assets we have for (U32 i = 0; i < MAX_STAGES; i++) { @@ -597,6 +592,21 @@ bool Material::onAdd() mDiffuseMapAsset[0] = mDiffuseMapAssetId[0]; } } + */ + for (U32 i = 0; i < MAX_STAGES; i++) + { + bindMapSlot(mDiffuseMap, i); + bindMapSlot(mOverlayMap, i); + bindMapSlot(mLightMap, i); + bindMapSlot(mToneMap, i); + bindMapSlot(mDetailMap, i); + bindMapSlot(mPBRConfigMap, i); + bindMapSlot(mRoughMap, i); + bindMapSlot(mAOMap, i); + bindMapSlot(mMetalMap, i); + bindMapSlot(mGlowMap, i); + bindMapSlot(mDetailNormalMap, i); + } _mapMaterial(); diff --git a/Engine/source/materials/materialDefinition.h b/Engine/source/materials/materialDefinition.h index 481176a4b..a8adbf34e 100644 --- a/Engine/source/materials/materialDefinition.h +++ b/Engine/source/materials/materialDefinition.h @@ -61,6 +61,10 @@ class MaterialSoundProfile; class MaterialPhysicsProfile; class CustomShaderFeatureData; +#define DECLARE_TEXTUREARRAY(name,max) FileName m##name##Filename[max];\ + StringTableEntry m##name##AssetId[max];\ + AssetPtr m##name##Asset[max]; + /// The basic material definition. class Material : public BaseMaterialDefinition { From ebb7ed1b782f58b254d43f3fa127f99a786c914f Mon Sep 17 00:00:00 2001 From: AzaezelX Date: Mon, 11 May 2020 16:17:40 -0500 Subject: [PATCH 24/25] uninitialized variables-math --- Engine/source/math/mAngAxis.h | 2 ++ Engine/source/math/mMatrix.h | 4 +++- Engine/source/math/mPlane.h | 3 ++- Engine/source/math/mPlaneSet.h | 2 +- Engine/source/math/mPoint2.h | 6 +++--- Engine/source/math/mPoint3.h | 7 +++---- Engine/source/math/mPoint4.h | 3 ++- Engine/source/math/mPolyhedron.h | 2 +- Engine/source/math/mQuat.h | 2 +- Engine/source/math/mRandom.h | 2 +- Engine/source/math/mSphere.h | 2 +- Engine/source/math/util/frustum.h | 14 +++++++++++--- Engine/source/math/util/tResponseCurve.h | 2 +- 13 files changed, 32 insertions(+), 19 deletions(-) diff --git a/Engine/source/math/mAngAxis.h b/Engine/source/math/mAngAxis.h index a61b8e4f6..fd02ad8ec 100644 --- a/Engine/source/math/mAngAxis.h +++ b/Engine/source/math/mAngAxis.h @@ -67,6 +67,8 @@ class AngAxisF inline AngAxisF::AngAxisF() { + axis = Point3F(0.0f,0.0f,1.0f); + angle = 0.0f; } inline AngAxisF::AngAxisF( const Point3F & _axis, F32 _angle ) diff --git a/Engine/source/math/mMatrix.h b/Engine/source/math/mMatrix.h index 71a95946b..5c2f3e8ae 100644 --- a/Engine/source/math/mMatrix.h +++ b/Engine/source/math/mMatrix.h @@ -22,7 +22,7 @@ #ifndef _MMATRIX_H_ #define _MMATRIX_H_ - +#include #ifndef _MPLANE_H_ #include "math/mPlane.h" #endif @@ -232,6 +232,8 @@ inline MatrixF::MatrixF(bool _identity) { if (_identity) identity(); + else + std::fill_n(m, 16, 0); } inline MatrixF::MatrixF( const EulerF &e ) diff --git a/Engine/source/math/mPlane.h b/Engine/source/math/mPlane.h index a67d5c60b..6191251ff 100644 --- a/Engine/source/math/mPlane.h +++ b/Engine/source/math/mPlane.h @@ -66,7 +66,7 @@ class PlaneF : public Point3F /// @name Initialization /// @{ - PlaneF() {} + PlaneF() :d(0.0f) {} PlaneF( const Point3F& p, const Point3F& n ); /// NOTE: d is the NEGATIVE distance along the xyz normal. PlaneF( F32 _x, F32 _y, F32 _z, F32 _d); @@ -571,6 +571,7 @@ public: inline PlaneD::PlaneD() { + d = 0.0; } inline PlaneD:: diff --git a/Engine/source/math/mPlaneSet.h b/Engine/source/math/mPlaneSet.h index 511c7bd92..8c83b01d6 100644 --- a/Engine/source/math/mPlaneSet.h +++ b/Engine/source/math/mPlaneSet.h @@ -76,7 +76,7 @@ class PlaneSet /// Create an uninitialized set. /// @warn None of the members will be initialized. - PlaneSet() {} + PlaneSet() :mNumPlanes(0), mPlanes(NULL) {} /// Use the given set of planes to initialize the set. /// diff --git a/Engine/source/math/mPoint2.h b/Engine/source/math/mPoint2.h index c141400b9..d48fea3c9 100644 --- a/Engine/source/math/mPoint2.h +++ b/Engine/source/math/mPoint2.h @@ -266,8 +266,8 @@ class Point2D //-------------------------------------- Point2I // inline Point2I::Point2I() + :x(0),y(0) { - // } @@ -448,8 +448,8 @@ inline Point2I& Point2I::operator/=(const Point2I &_vec) //-------------------------------------- Point2F // inline Point2F::Point2F() + :x(0.0f), y(0.0f) { - // } @@ -692,8 +692,8 @@ inline void Point2F::normalizeSafe() //-------------------------------------- Point2D // inline Point2D::Point2D() + :x(0.0), y(0.0) { - // } diff --git a/Engine/source/math/mPoint3.h b/Engine/source/math/mPoint3.h index 12af91c4b..c1bb72923 100644 --- a/Engine/source/math/mPoint3.h +++ b/Engine/source/math/mPoint3.h @@ -276,8 +276,8 @@ public: //-------------------------------------- Point3I // inline Point3I::Point3I() + : x(0), y(0), z(0) { - // } inline Point3I::Point3I(const Point3I& _copy) @@ -431,9 +431,7 @@ inline Point3I& Point3I::operator/=(S32 div) //-------------------------------------- Point3F // inline Point3F::Point3F() -#if defined(TORQUE_OS_LINUX) - : x(0.f), y(0.f), z(0.f) -#endif + : x(0.0f), y(0.0f), z(0.0f) { // Uninitialized points are definitely a problem. // Enable the following code to see how often they crop up. @@ -761,6 +759,7 @@ inline Point3F& Point3F::operator=(const Point3D &_vec) //-------------------------------------- Point3D // inline Point3D::Point3D() + : x(0.0), y(0.0), z(0.0) { // } diff --git a/Engine/source/math/mPoint4.h b/Engine/source/math/mPoint4.h index 793ff06fc..6fd371af3 100644 --- a/Engine/source/math/mPoint4.h +++ b/Engine/source/math/mPoint4.h @@ -39,7 +39,7 @@ class Point4I { public: - Point4I() {} + Point4I() :x(0), y(0), z(0), w(0) {} Point4I(S32 _x, S32 _y, S32 _z, S32 _w); void zero(); ///< Zero all values @@ -127,6 +127,7 @@ inline void Point4I::zero() //-------------------------------------- Point4F // inline Point4F::Point4F() + :x(0.0f), y(0.0f), z(0.0f), w(0.0f) { } diff --git a/Engine/source/math/mPolyhedron.h b/Engine/source/math/mPolyhedron.h index 3da780e0c..c52d40b8a 100644 --- a/Engine/source/math/mPolyhedron.h +++ b/Engine/source/math/mPolyhedron.h @@ -98,7 +98,7 @@ struct PolyhedronData /// it defines a *clockwise* orientation for face[ 0 ]. This is important! U32 vertex[ 2 ]; - Edge() {} + Edge() { std::fill_n(face, 2, 0), std::fill_n(vertex, 0, 0); } Edge( U32 face1, U32 face2, U32 vertex1, U32 vertex2 ) { face[ 0 ] = face1; diff --git a/Engine/source/math/mQuat.h b/Engine/source/math/mQuat.h index 261b66a88..d713b405d 100644 --- a/Engine/source/math/mQuat.h +++ b/Engine/source/math/mQuat.h @@ -42,7 +42,7 @@ public: public: F32 x,y,z,w; - QuatF() {} // no init constructor + QuatF() :x(0.0f), y(0.0f), z(0.0f), w(1.0f) {} //identity constructor QuatF( F32 _x, F32 _y, F32 _z, F32 w ); QuatF( const Point3F &axis, F32 angle ); QuatF( const MatrixF & m ); diff --git a/Engine/source/math/mRandom.h b/Engine/source/math/mRandom.h index 632925228..c69c06477 100644 --- a/Engine/source/math/mRandom.h +++ b/Engine/source/math/mRandom.h @@ -33,7 +33,7 @@ class MRandomGenerator { protected: - MRandomGenerator() {} + MRandomGenerator() :mSeed(-1) {} S32 mSeed; public: diff --git a/Engine/source/math/mSphere.h b/Engine/source/math/mSphere.h index 7990f8f21..8f76dce86 100644 --- a/Engine/source/math/mSphere.h +++ b/Engine/source/math/mSphere.h @@ -35,7 +35,7 @@ public: F32 radius; public: - SphereF() { } + SphereF() :radius(1.0f) {} SphereF( const Point3F& in_rPosition, const F32 in_rRadius ) : center(in_rPosition), radius(in_rRadius) diff --git a/Engine/source/math/util/frustum.h b/Engine/source/math/util/frustum.h index 9de0c4c6a..2129abd7d 100644 --- a/Engine/source/math/util/frustum.h +++ b/Engine/source/math/util/frustum.h @@ -186,8 +186,16 @@ struct FrustumData : public PolyhedronData void _update() const; FrustumData() - : mDirty( false ), - mIsInverted( false ) {} + : mIsOrtho(false), + mNearLeft(-1.0f), + mNearRight(1.0f), + mNearTop(1.0f), + mNearBottom(-1.0f), + mNearDist(0.1f), + mFarDist(1.0f), + mTransform(MatrixF(true)), + mDirty( false ), + mIsInverted( false ) {} public: @@ -478,4 +486,4 @@ class Frustum : public PolyhedronImpl< FrustumData > /// @} }; -#endif // _MATHUTIL_FRUSTUM_H_ \ No newline at end of file +#endif // _MATHUTIL_FRUSTUM_H_ diff --git a/Engine/source/math/util/tResponseCurve.h b/Engine/source/math/util/tResponseCurve.h index ad5329bda..cf282acc5 100644 --- a/Engine/source/math/util/tResponseCurve.h +++ b/Engine/source/math/util/tResponseCurve.h @@ -73,7 +73,7 @@ public: struct Sample { - Sample() {} + Sample() :mF(0) { dMemset(&mVal, 0, sizeof(mVal)); } Sample( F32 f, const T &val ) : mF(f), mVal(val) {} F32 mF; From 9b907e77ee0101d316c16f50a9804f8ce51b5a07 Mon Sep 17 00:00:00 2001 From: Areloch Date: Wed, 13 May 2020 02:10:11 -0500 Subject: [PATCH 25/25] Swaps some references from the windows SDK-specific FLT_MAX to T3D's F32_MAX Takes the makeFullPath in findTSShapeConstructor and turn it into a string before passing it along to the Filename to make stricter compilers happy Removed some referenced to fields that don't exist in the current build Removed unneeded ASM language activation for the cmake files Adjustments to material map assembling macros to better comply to stricter compilers --- Engine/source/T3D/debris.cpp | 3 - Engine/source/T3D/gameBase/gameBase.cpp | 1 - Engine/source/T3D/shapeBase.cpp | 2 +- .../gui/containers/guiAutoScrollCtrl.cpp | 2 +- .../source/materials/materialDefinition.cpp | 126 +++++++++++------- Engine/source/materials/materialDefinition.h | 82 +++++------- Engine/source/sfx/openal/sfxALDevice.cpp | 2 + Engine/source/ts/tsShapeConstruct.cpp | 2 +- Tools/CMake/torque3d.cmake | 4 - 9 files changed, 116 insertions(+), 108 deletions(-) diff --git a/Engine/source/T3D/debris.cpp b/Engine/source/T3D/debris.cpp index b581b8261..de991db51 100644 --- a/Engine/source/T3D/debris.cpp +++ b/Engine/source/T3D/debris.cpp @@ -157,9 +157,6 @@ DebrisData::DebrisData(const DebrisData& other, bool temp_clone) : GameBaseData( explosion = other.explosion; dMemcpy( emitterList, other.emitterList, sizeof( emitterList ) ); dMemcpy( emitterIDList, other.emitterIDList, sizeof( emitterIDList ) ); // -- for pack/unpack of emitterList ptrs - mShatter = other.mShatter; - mProbBreak = other.mProbBreak; - mProbDepth = other.mProbDepth; } DebrisData::~DebrisData() diff --git a/Engine/source/T3D/gameBase/gameBase.cpp b/Engine/source/T3D/gameBase/gameBase.cpp index a1616751a..2f6fd36d2 100644 --- a/Engine/source/T3D/gameBase/gameBase.cpp +++ b/Engine/source/T3D/gameBase/gameBase.cpp @@ -254,7 +254,6 @@ GameBase::GameBase() mTicksSinceLastMove = 0; mIsAiControlled = false; #endif - mTickCount = 0; mCameraFov = 90.f; } diff --git a/Engine/source/T3D/shapeBase.cpp b/Engine/source/T3D/shapeBase.cpp index 9042f3a82..d9830785d 100644 --- a/Engine/source/T3D/shapeBase.cpp +++ b/Engine/source/T3D/shapeBase.cpp @@ -3571,7 +3571,7 @@ Point3F ShapeBaseConvex::support(const VectorF& v) const void ShapeBaseConvex::getFeatures(const MatrixF& mat, const VectorF& n, ConvexFeature* cf) { cf->material = 0; - cf->object = mObject; + cf->mObject = mObject; TSShape::ConvexHullAccelerator* pAccel = pShapeBase->mShapeInstance->getShape()->getAccelerator(pShapeBase->mDataBlock->collisionDetails[hullId]); diff --git a/Engine/source/gui/containers/guiAutoScrollCtrl.cpp b/Engine/source/gui/containers/guiAutoScrollCtrl.cpp index 5d252bc53..bb3432bce 100644 --- a/Engine/source/gui/containers/guiAutoScrollCtrl.cpp +++ b/Engine/source/gui/containers/guiAutoScrollCtrl.cpp @@ -92,7 +92,7 @@ GuiAutoScrollCtrl::GuiAutoScrollCtrl() mIsLooping( true ), mCurrentPhase( GuiAutoScrollCtrl::PhaseComplete ), mCurrentTime( 0.f ), - mCompleteTime(FLT_MAX), + mCompleteTime(F32_MAX), mCurrentPosition(0.0f), mStartDelay( 3.f ), mResetDelay( 5.f ), diff --git a/Engine/source/materials/materialDefinition.cpp b/Engine/source/materials/materialDefinition.cpp index 250af18d6..83a711343 100644 --- a/Engine/source/materials/materialDefinition.cpp +++ b/Engine/source/materials/materialDefinition.cpp @@ -97,8 +97,8 @@ ImplementEnumType( MaterialWaveType, { Material::Square, "Square", "Warps the material along a wave which transitions between two oppposite states. As a Square Wave, the transition is quick and sudden." }, EndImplementEnumType; -#define initMapSlot(name,id) name##Filename[id##] = String::EmptyString; name##AssetId[id##] = StringTable->EmptyString(); name##Asset[id##] = NULL; -#define bindMapSlot(name,id) if (name##AssetId[id##] != String::EmptyString) name##Asset[id##] = name##AssetId[id##]; +#define initMapSlot(name,id) m##name##Filename[id] = String::EmptyString; m##name##AssetId[id] = StringTable->EmptyString(); m##name##Asset[id] = NULL; +#define bindMapSlot(name,id) if (m##name##AssetId[id] != String::EmptyString) m##name##Asset[id] = m##name##AssetId[id]; bool Material::sAllowTextureTargetAssignment = false; @@ -124,7 +124,7 @@ Material::Material() mSmoothness[i] = 0.0f; mMetalness[i] = 0.0f; - mIsSRGb[i] = false; + mIsSRGb[i] = true; mInvertSmoothness[i] = false; mSmoothnessChan[i] = 0; @@ -138,18 +138,23 @@ Material::Material() mAccuCoverage[i] = 0.9f; mAccuSpecular[i] = 16.0f; - initMapSlot(mDiffuseMap, i); - initMapSlot(mOverlayMap, i); - initMapSlot(mLightMap, i); - initMapSlot(mToneMap, i); - initMapSlot(mDetailMap, i); - initMapSlot(mNormalMap, i); - initMapSlot(mPBRConfigMap, i); - initMapSlot(mRoughMap, i); - initMapSlot(mAOMap, i); - initMapSlot(mMetalMap, i); - initMapSlot(mGlowMap, i); - initMapSlot(mDetailNormalMap, i); + initMapSlot(DiffuseMap, i); + initMapSlot(OverlayMap, i); + initMapSlot(LightMap, i); + initMapSlot(ToneMap, i); + initMapSlot(DetailMap, i); + initMapSlot(NormalMap, i); + initMapSlot(PBRConfigMap, i); + initMapSlot(RoughMap, i); + initMapSlot(AOMap, i); + initMapSlot(MetalMap, i); + initMapSlot(GlowMap, i); + initMapSlot(DetailNormalMap, i); + + //cogs specific + initMapSlot(AlbedoDamageMap, i); + initMapSlot(NormalDamageMap, i); + initMapSlot(CompositeDamageMap, i); mParallaxScale[i] = 0.0f; @@ -188,13 +193,10 @@ Material::Material() // Deferred Shading mMatInfoFlags[i] = 0.0f; - mRoughMapFilename[i].clear(); - mRoughMapAsset[i] = StringTable->EmptyString(); - mAOMapFilename[i].clear(); - mMetalMapFilename[i].clear(); - mMetalMapAsset[i] = StringTable->EmptyString(); - mGlowMapFilename[i].clear(); - mGlowMapAsset[i] = StringTable->EmptyString(); + + // Damage + mMaterialDamageMin[i] = 0.0f; + mAlbedoDamageMapSRGB[i] = true; mGlowMul[i] = 0.0f; } @@ -232,6 +234,7 @@ Material::Material() dMemset( mEffectColor, 0, sizeof( mEffectColor ) ); mFootstepSoundId = -1; mImpactSoundId = -1; + mImpactFXIndex = -1; mFootstepSoundCustom = 0; mImpactSoundCustom = 0; mFriction = 0.0; @@ -240,9 +243,9 @@ Material::Material() } -#define assetText(x,suff) (String::String(#x) + String::String(#suff)).c_str() -#define scriptBindMapSlot(name) addField(#name, TypeImageFilename, Offset(m##name##Filename, Material), MAX_STAGES, assetText(name,texture map.)); \ - addField(assetText(name,Asset), TypeImageAssetPtr, Offset(m##name##AssetId, Material), MAX_STAGES, assetText(name,asset reference.)); +#define assetText(x,suff) std::string(std::string(#x) + std::string(#suff)).c_str() +#define scriptBindMapSlot(name,arraySize) addField(#name, TypeImageFilename, Offset(m##name##Filename, Material), arraySize, assetText(name,texture map.)); \ + addField(assetText(name,Asset), TypeImageAssetPtr, Offset(m##name##AssetId, Material), arraySize, assetText(name,asset reference.)); void Material::initPersistFields() { @@ -255,19 +258,18 @@ void Material::initPersistFields() "This color is multiplied against the diffuse texture color. If no diffuse texture " "is present this is the material color." ); - scriptBindMapSlot(DiffuseMap); - scriptBindMapSlot(DiffuseMap); - scriptBindMapSlot(OverlayMap); - scriptBindMapSlot(LightMap); - scriptBindMapSlot(ToneMap); - scriptBindMapSlot(DetailMap); - scriptBindMapSlot(NormalMap); - scriptBindMapSlot(PBRConfigMap); - scriptBindMapSlot(RoughMap); - scriptBindMapSlot(AOMap); - scriptBindMapSlot(MetalMap); - scriptBindMapSlot(GlowMap); - scriptBindMapSlot(DetailNormalMap); + scriptBindMapSlot(DiffuseMap, MAX_STAGES); + scriptBindMapSlot(OverlayMap, MAX_STAGES); + scriptBindMapSlot(LightMap, MAX_STAGES); + scriptBindMapSlot(ToneMap, MAX_STAGES); + scriptBindMapSlot(DetailMap, MAX_STAGES); + scriptBindMapSlot(NormalMap, MAX_STAGES); + scriptBindMapSlot(PBRConfigMap, MAX_STAGES); + scriptBindMapSlot(RoughMap, MAX_STAGES); + scriptBindMapSlot(AOMap, MAX_STAGES); + scriptBindMapSlot(MetalMap, MAX_STAGES); + scriptBindMapSlot(GlowMap, MAX_STAGES); + scriptBindMapSlot(DetailNormalMap, MAX_STAGES); addField("diffuseMapSRGB", TypeBool, Offset(mDiffuseMapSRGB, Material), MAX_STAGES, "Enable sRGB for the diffuse color texture map."); @@ -420,6 +422,22 @@ void Material::initPersistFields() endArray( "Stages" ); + addGroup("Damage"); + + //cogs + scriptBindMapSlot(AlbedoDamageMap, MAX_STAGES); + /// Damage blend maps (normal) + scriptBindMapSlot(NormalDamageMap, MAX_STAGES); + /// Damage blend maps (Roughness, AO, Metalness) + scriptBindMapSlot(CompositeDamageMap, MAX_STAGES); + + addField("albedoDamageSRGB", TypeBool, Offset(mAlbedoDamageMapSRGB, Material), MAX_STAGES, + "Enable sRGB for the albedo damage map"); + + addField("minDamage", TypeF32, Offset(mMaterialDamageMin, Material), MAX_STAGES, + "The minimum ammount of blended damage."); + endGroup("Damage"); + addField( "castShadows", TypeBool, Offset(mCastShadows, Material), "If set to false the lighting system will not cast shadows from this material." ); @@ -492,6 +510,10 @@ void Material::initPersistFields() "What sound to play from the PlayerData sound list when the player impacts on the surface with a velocity equal or greater " "than PlayerData::groundImpactMinSpeed.\n\n" "For a list of IDs, see #footstepSoundId" ); + addField("ImpactFXIndex", TypeS32, Offset(mImpactFXIndex, Material), + "What FX to play from the PlayerData sound list when the player impacts on the surface with a velocity equal or greater " + "than PlayerData::groundImpactMinSpeed.\n\n" + "For a list of IDs, see #impactFXId"); addField( "customImpactSound", TypeSFXTrackName, Offset( mImpactSoundCustom, Material ), "The sound to play when the player impacts on the surface with a velocity equal or greater than PlayerData::groundImpactMinSpeed. " "If this is set, it overrides #impactSoundId. This field is useful for directly assigning custom impact sounds to materials " @@ -559,6 +581,7 @@ bool Material::protectedSetCustomShaderFeatureUniforms(void *object, const char return false; } + bool Material::onAdd() { if (Parent::onAdd() == false) @@ -595,17 +618,22 @@ bool Material::onAdd() */ for (U32 i = 0; i < MAX_STAGES; i++) { - bindMapSlot(mDiffuseMap, i); - bindMapSlot(mOverlayMap, i); - bindMapSlot(mLightMap, i); - bindMapSlot(mToneMap, i); - bindMapSlot(mDetailMap, i); - bindMapSlot(mPBRConfigMap, i); - bindMapSlot(mRoughMap, i); - bindMapSlot(mAOMap, i); - bindMapSlot(mMetalMap, i); - bindMapSlot(mGlowMap, i); - bindMapSlot(mDetailNormalMap, i); + bindMapSlot(DiffuseMap, i); + bindMapSlot(OverlayMap, i); + bindMapSlot(LightMap, i); + bindMapSlot(ToneMap, i); + bindMapSlot(DetailMap, i); + bindMapSlot(PBRConfigMap, i); + bindMapSlot(RoughMap, i); + bindMapSlot(AOMap, i); + bindMapSlot(MetalMap, i); + bindMapSlot(GlowMap, i); + bindMapSlot(DetailNormalMap, i); + + //cogs specific + bindMapSlot(AlbedoDamageMap, i); + bindMapSlot(NormalDamageMap, i); + bindMapSlot(CompositeDamageMap, i); } _mapMaterial(); diff --git a/Engine/source/materials/materialDefinition.h b/Engine/source/materials/materialDefinition.h index a8adbf34e..b41c495dd 100644 --- a/Engine/source/materials/materialDefinition.h +++ b/Engine/source/materials/materialDefinition.h @@ -213,63 +213,48 @@ public: //----------------------------------------------------------------------- // Data //----------------------------------------------------------------------- - FileName mDiffuseMapFilename[MAX_STAGES]; - StringTableEntry mDiffuseMapAssetId[MAX_STAGES]; - AssetPtr mDiffuseMapAsset[MAX_STAGES]; + DECLARE_TEXTUREARRAY(DiffuseMap, MAX_STAGES); bool mDiffuseMapSRGB[MAX_STAGES]; // SRGB diffuse + DECLARE_TEXTUREARRAY(OverlayMap, MAX_STAGES); + DECLARE_TEXTUREARRAY(LightMap, MAX_STAGES);; + DECLARE_TEXTUREARRAY(ToneMap, MAX_STAGES); + DECLARE_TEXTUREARRAY(DetailMap, MAX_STAGES);; + DECLARE_TEXTUREARRAY(NormalMap, MAX_STAGES); + DECLARE_TEXTUREARRAY(PBRConfigMap, MAX_STAGES); + bool mIsSRGb[MAX_STAGES]; + DECLARE_TEXTUREARRAY(RoughMap, MAX_STAGES); + bool mInvertSmoothness[MAX_STAGES]; + F32 mSmoothnessChan[MAX_STAGES]; + DECLARE_TEXTUREARRAY(AOMap, MAX_STAGES); + F32 mAOChan[MAX_STAGES]; + DECLARE_TEXTUREARRAY(MetalMap, MAX_STAGES); + F32 mMetalChan[MAX_STAGES]; + DECLARE_TEXTUREARRAY(GlowMap, MAX_STAGES); + F32 mGlowMul[MAX_STAGES]; + /// A second normal map which repeats at the detail map + /// scale and blended with the base normal map. + DECLARE_TEXTUREARRAY(DetailNormalMap, MAX_STAGES); + /// The strength scalar for the detail normal map. + F32 mDetailNormalMapStrength[MAX_STAGES]; + bool mAccuEnabled[MAX_STAGES]; F32 mAccuScale[MAX_STAGES]; F32 mAccuDirection[MAX_STAGES]; F32 mAccuStrength[MAX_STAGES]; F32 mAccuCoverage[MAX_STAGES]; F32 mAccuSpecular[MAX_STAGES]; - FileName mOverlayMapFilename[MAX_STAGES]; - StringTableEntry mOverlayMapAssetId[MAX_STAGES]; - AssetPtr mOverlayMapAsset[MAX_STAGES]; - FileName mLightMapFilename[MAX_STAGES]; - StringTableEntry mLightMapAssetId[MAX_STAGES]; - AssetPtr mLightMapAsset[MAX_STAGES]; - FileName mToneMapFilename[MAX_STAGES]; - StringTableEntry mToneMapAssetId[MAX_STAGES]; - AssetPtr mToneMapAsset[MAX_STAGES]; - FileName mDetailMapFilename[MAX_STAGES]; - StringTableEntry mDetailMapAssetId[MAX_STAGES]; - AssetPtr mDetailMapAsset[MAX_STAGES]; - FileName mNormalMapFilename[MAX_STAGES]; - StringTableEntry mNormalMapAssetId[MAX_STAGES]; - AssetPtr mNormalMapAsset[MAX_STAGES]; - bool mIsSRGb[MAX_STAGES]; - bool mInvertSmoothness[MAX_STAGES]; - FileName mPBRConfigMapFilename[MAX_STAGES]; - StringTableEntry mPBRConfigMapAssetId[MAX_STAGES]; - AssetPtr mPBRConfigMapAsset[MAX_STAGES]; - FileName mRoughMapFilename[MAX_STAGES]; - StringTableEntry mRoughMapAssetId[MAX_STAGES]; - AssetPtr mRoughMapAsset[MAX_STAGES]; - F32 mSmoothnessChan[MAX_STAGES]; - FileName mAOMapFilename[MAX_STAGES]; - StringTableEntry mAOMapAssetId[MAX_STAGES]; - AssetPtr mAOMapAsset[MAX_STAGES]; - F32 mAOChan[MAX_STAGES]; - FileName mMetalMapFilename[MAX_STAGES]; - StringTableEntry mMetalMapAssetId[MAX_STAGES]; - AssetPtr mMetalMapAsset[MAX_STAGES]; - F32 mMetalChan[MAX_STAGES]; + //cogs specific + /// Damage blend maps (albedo) + DECLARE_TEXTUREARRAY(AlbedoDamageMap, MAX_STAGES); + bool mAlbedoDamageMapSRGB[MAX_STAGES]; + /// Damage blend maps (normal) + DECLARE_TEXTUREARRAY(NormalDamageMap, MAX_STAGES); + /// Damage blend maps (Roughness, AO, Metalness) + DECLARE_TEXTUREARRAY(CompositeDamageMap, MAX_STAGES); + /// Damage blend minimum + F32 mMaterialDamageMin[MAX_STAGES]; - FileName mGlowMapFilename[MAX_STAGES]; - StringTableEntry mGlowMapAssetId[MAX_STAGES]; - AssetPtr mGlowMapAsset[MAX_STAGES]; - F32 mGlowMul[MAX_STAGES]; - /// A second normal map which repeats at the detail map - /// scale and blended with the base normal map. - FileName mDetailNormalMapFilename[MAX_STAGES]; - StringTableEntry mDetailNormalMapAssetId[MAX_STAGES]; - AssetPtr mDetailNormalMapAsset[MAX_STAGES]; - - /// The strength scalar for the detail normal map. - F32 mDetailNormalMapStrength[MAX_STAGES]; - /// This color is the diffuse color of the material /// or if it has a texture it is multiplied against /// the diffuse texture color. @@ -373,6 +358,7 @@ public: /// @see mFootstepSoundCustom S32 mFootstepSoundId; S32 mImpactSoundId; + S32 mImpactFXIndex; /// Sound effect to play when walking on surface with this material. /// If defined, overrides mFootstepSoundId. diff --git a/Engine/source/sfx/openal/sfxALDevice.cpp b/Engine/source/sfx/openal/sfxALDevice.cpp index 58d7c0146..9dd308c58 100644 --- a/Engine/source/sfx/openal/sfxALDevice.cpp +++ b/Engine/source/sfx/openal/sfxALDevice.cpp @@ -84,9 +84,11 @@ SFXALDevice::SFXALDevice( SFXProvider *provider, } #endif +#if defined(AL_ALEXT_PROTOTYPES) dMemset(effectSlot, 0, sizeof(effectSlot)); dMemset(effect, 0, sizeof(effect)); uLoop = 0; +#endif } //----------------------------------------------------------------------------- diff --git a/Engine/source/ts/tsShapeConstruct.cpp b/Engine/source/ts/tsShapeConstruct.cpp index 40004e98b..0de7478c3 100644 --- a/Engine/source/ts/tsShapeConstruct.cpp +++ b/Engine/source/ts/tsShapeConstruct.cpp @@ -393,7 +393,7 @@ TSShapeConstructor* TSShapeConstructor::findShapeConstructor(const FileName& pat FileName shapePath = tss->mShapePath; char buf[1024]; - FileName fullShapePath = Platform::makeFullPathName(shapePath, buf, sizeof(buf)); + FileName fullShapePath = String(Platform::makeFullPathName(shapePath, buf, sizeof(buf))); if (shapePath.equal( path, String::NoCase ) || fullShapePath.equal(path, String::NoCase)) return tss; } diff --git a/Tools/CMake/torque3d.cmake b/Tools/CMake/torque3d.cmake index 990030ec3..6337f35e9 100644 --- a/Tools/CMake/torque3d.cmake +++ b/Tools/CMake/torque3d.cmake @@ -38,10 +38,6 @@ if(UNIX) endif() - # for asm files - SET (CMAKE_ASM_NASM_OBJECT_FORMAT "elf") - ENABLE_LANGUAGE (ASM_NASM) - set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11") endif()