Переглянути джерело

uninitialized variables-environment and forrest

AzaezelX 5 роки тому
батько
коміт
1efb687867

+ 4 - 1
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);
-}
+}

+ 7 - 6
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();
    } 
-}
+}

+ 10 - 9
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;
 

+ 3 - 0
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.

+ 2 - 1
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");

+ 3 - 0
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;         

+ 1 - 0
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);

+ 4 - 0
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;         

+ 1 - 0
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");

+ 5 - 0
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;

+ 5 - 0
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()

+ 4 - 3
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_
+#endif // _MESHROAD_H_

+ 3 - 3
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*);

+ 5 - 1
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),

+ 2 - 2
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_
+#endif // _RIVER_H_

+ 2 - 1
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 );

+ 4 - 1
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;
-}
+}

+ 3 - 1
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;
 

+ 1 - 4
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_
+#endif // _H_FOREST_

+ 5 - 1
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 )