From 1efb687867ecc2c9d14562c9bd9b238fcc448884 Mon Sep 17 00:00:00 2001 From: AzaezelX Date: Mon, 11 May 2020 14:56:04 -0500 Subject: [PATCH] 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 )