uninitialized variables-environment and forrest

This commit is contained in:
AzaezelX 2020-05-11 14:56:04 -05:00
parent 2c1508c169
commit 1efb687867
20 changed files with 74 additions and 34 deletions

View file

@ -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);
}
}

View file

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

View file

@ -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;

View file

@ -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.

View file

@ -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");

View file

@ -159,6 +159,9 @@ class GuiMeshRoadEditorUndoAction : public UndoAction
GuiMeshRoadEditorUndoAction( const UTF8* actionName ) : UndoAction( actionName )
{
mEditor = NULL;
mObjId = 0;
mMetersPerSegment = 1.0f;
}
GuiMeshRoadEditorCtrl *mEditor;

View file

@ -84,6 +84,7 @@ GuiRiverEditorCtrl::GuiRiverEditorCtrl()
mStartHeight = -1.0f;
mStartX = 0;
mSavedDrag = false;
mIsDirty = false;
mNodeHalfSize.set(4,4);

View file

@ -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;

View file

@ -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");

View file

@ -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;

View file

@ -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()

View file

@ -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_

View file

@ -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*);

View file

@ -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),

View file

@ -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_

View file

@ -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 );

View file

@ -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;
}
}

View file

@ -161,7 +161,9 @@ ForestSelectionTool::ForestSelectionTool()
: Parent(),
mGizmo( NULL ),
mCurrAction( NULL ),
mGizmoProfile( NULL )
mGizmoProfile( NULL ),
mMouseDragged(false),
mUsingGizmo(false)
{
mBounds = Box3F::Invalid;

View file

@ -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_

View file

@ -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 )