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(); setGlobalBounds();
mTypeMask |= EnvironmentObjectType; mTypeMask |= EnvironmentObjectType;
mNetFlags.set(IsGhost); mNetFlags.set(IsGhost);
mPlatformWindow = NULL;
mIsInitialized = false; mIsInitialized = false;
mNumFogObjects = 0; mNumFogObjects = 0;
mWidth = 0;
mHeight = 0;
} }
VolumetricFogRTManager::~VolumetricFogRTManager() VolumetricFogRTManager::~VolumetricFogRTManager()
@ -291,4 +294,4 @@ DefineEngineFunction(SetFogVolumeQuality, S32, (U32 new_quality), ,
if (VFRTM == NULL) if (VFRTM == NULL)
return -1; return -1;
return VFRTM->setQuality(new_quality); return VFRTM->setQuality(new_quality);
} }

View file

@ -63,11 +63,12 @@ BasicClouds::BasicClouds()
mTypeMask |= EnvironmentObjectType | StaticObjectType; mTypeMask |= EnvironmentObjectType | StaticObjectType;
mNetFlags.set(Ghostable | ScopeAlways); mNetFlags.set(Ghostable | ScopeAlways);
mTimeSC = 0; mTimeSC = NULL;
mModelViewProjSC = 0; mModelViewProjSC = NULL;
mTexScaleSC = 0; mTexScaleSC = NULL;
mTexDirectionSC = 0; mTexDirectionSC = NULL;
mTexOffsetSC = 0; mTexOffsetSC = NULL;
mDiffuseMapSC = NULL;
mLayerEnabled[0] = true; mLayerEnabled[0] = true;
mLayerEnabled[1] = true; mLayerEnabled[1] = true;
@ -414,4 +415,4 @@ void BasicClouds::_initBuffers()
mVB[i].unlock(); mVB[i].unlock();
} }
} }

View file

@ -82,15 +82,16 @@ CloudLayer::CloudLayer()
mTypeMask |= EnvironmentObjectType | StaticObjectType; mTypeMask |= EnvironmentObjectType | StaticObjectType;
mNetFlags.set(Ghostable | ScopeAlways); mNetFlags.set(Ghostable | ScopeAlways);
mModelViewProjSC = mModelViewProjSC = NULL;
mAmbientColorSC = mAmbientColorSC = NULL;
mSunColorSC = mSunColorSC = NULL;
mSunVecSC = mSunVecSC = NULL;
mTexScaleSC = mTexScaleSC = NULL;
mBaseColorSC = mBaseColorSC = NULL;
mCoverageSC = mCoverageSC = NULL;
mExposureSC = mExposureSC = NULL;
mEyePosWorldSC = 0; mEyePosWorldSC = NULL;
mNormalHeightMapSC = NULL;
mTexOffsetSC[0] = mTexOffsetSC[1] = mTexOffsetSC[2] = 0; mTexOffsetSC[0] = mTexOffsetSC[1] = mTexOffsetSC[2] = 0;

View file

@ -279,7 +279,10 @@ DecalRoad::DecalRoad()
mLoadRenderData( true ), mLoadRenderData( true ),
mMaterial( NULL ), mMaterial( NULL ),
mMatInst( NULL ), mMatInst( NULL ),
mTriangleCount(0),
mVertCount(0),
mUpdateEventId( -1 ), mUpdateEventId( -1 ),
mLastEvent(NULL),
mTerrainUpdateRect( Box3F::Invalid ) mTerrainUpdateRect( Box3F::Invalid )
{ {
// Setup NetObject. // Setup NetObject.

View file

@ -67,6 +67,7 @@ GuiMeshRoadEditorCtrl::GuiMeshRoadEditorCtrl()
mMovePointMode("MeshRoadEditorMoveMode"), mMovePointMode("MeshRoadEditorMoveMode"),
mScalePointMode("MeshRoadEditorScaleMode"), mScalePointMode("MeshRoadEditorScaleMode"),
mRotatePointMode("MeshRoadEditorRotateMode"), mRotatePointMode("MeshRoadEditorRotateMode"),
mSavedDrag(false),
mIsDirty( false ), mIsDirty( false ),
mRoadSet( NULL ), mRoadSet( NULL ),
mSelNode( -1 ), mSelNode( -1 ),
@ -82,7 +83,7 @@ GuiMeshRoadEditorCtrl::GuiMeshRoadEditorCtrl()
mHoverSplineColor( 255,0,0,255 ), mHoverSplineColor( 255,0,0,255 ),
mSelectedSplineColor( 0,255,0,255 ), mSelectedSplineColor( 0,255,0,255 ),
mHoverNodeColor( 255,255,255,255 ), mHoverNodeColor( 255,255,255,255 ),
mHasCopied( false ) mHasCopied( false )
{ {
mMaterialName[Top] = StringTable->insert("DefaultRoadMaterialTop"); mMaterialName[Top] = StringTable->insert("DefaultRoadMaterialTop");
mMaterialName[Bottom] = StringTable->insert("DefaultRoadMaterialOther"); mMaterialName[Bottom] = StringTable->insert("DefaultRoadMaterialOther");

View file

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

View file

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

View file

@ -181,6 +181,10 @@ class GuiRiverEditorUndoAction : public UndoAction
GuiRiverEditorUndoAction( const UTF8* actionName ) : UndoAction( actionName ) GuiRiverEditorUndoAction( const UTF8* actionName ) : UndoAction( actionName )
{ {
mRiverEditor = NULL;
mObjId = 0;
mMetersPerSegment = 1.0f;
mSegmentsPerBatch = 10;
} }
GuiRiverEditorCtrl *mRiverEditor; GuiRiverEditorCtrl *mRiverEditor;

View file

@ -82,6 +82,7 @@ GuiRoadEditorCtrl::GuiRoadEditorCtrl()
mSelectedSplineColor.set( 0,255,0,255 ); mSelectedSplineColor.set( 0,255,0,255 );
mHoverNodeColor.set( 255,255,255,255 ); mHoverNodeColor.set( 255,255,255,255 );
mSavedDrag = false;
mIsDirty = false; mIsDirty = false;
mMaterialName = StringTable->insert("DefaultDecalRoadMaterial"); mMaterialName = StringTable->insert("DefaultDecalRoadMaterial");

View file

@ -146,6 +146,11 @@ class GuiRoadEditorUndoAction : public UndoAction
GuiRoadEditorUndoAction( const UTF8* actionName ) : UndoAction( actionName ) GuiRoadEditorUndoAction( const UTF8* actionName ) : UndoAction( actionName )
{ {
mRoadEditor = NULL;
mObjId = 0;
mBreakAngle = 3.0f;
mSegmentsPerBatch = 0;
mTextureLength = 0.0f;
} }
GuiRoadEditorCtrl *mRoadEditor; GuiRoadEditorCtrl *mRoadEditor;

View file

@ -629,6 +629,11 @@ MeshRoad::MeshRoad()
mMatInst[Bottom] = NULL; mMatInst[Bottom] = NULL;
mMatInst[Side] = NULL; mMatInst[Side] = NULL;
mTypeMask |= TerrainLikeObjectType; mTypeMask |= TerrainLikeObjectType;
for (U32 i = 0; i < SurfaceCount; i++)
{
mVertCount[i] = 0;
mTriangleCount[i] = 0;
}
} }
MeshRoad::~MeshRoad() MeshRoad::~MeshRoad()

View file

@ -85,7 +85,7 @@ public:
public: public:
MeshRoadConvex() { mType = MeshRoadConvexType; } MeshRoadConvex():pRoad(NULL), faceId(0), triangleId(0), segmentId(0) { mType = MeshRoadConvexType; }
MeshRoadConvex( const MeshRoadConvex& cv ) { MeshRoadConvex( const MeshRoadConvex& cv ) {
mType = MeshRoadConvexType; mType = MeshRoadConvexType;
@ -122,7 +122,7 @@ struct ObjectRenderInst;
class MeshRoadSplineNode class MeshRoadSplineNode
{ {
public: public:
MeshRoadSplineNode() {} MeshRoadSplineNode() :x(0.0f), y(0.0f), z(0.0f), width(0.0f), depth(0.0f) {}
F32 x; F32 x;
F32 y; F32 y;
@ -257,6 +257,7 @@ struct MeshRoadSlice
depth = 0.0f; depth = 0.0f;
normal.set(0,0,1); normal.set(0,0,1);
texCoordV = 0.0f; texCoordV = 0.0f;
t = 0.0f;
parentNodeIdx = -1; parentNodeIdx = -1;
}; };
@ -572,4 +573,4 @@ public:
}; };
#endif // _MESHROAD_H_ #endif // _MESHROAD_H_

View file

@ -50,7 +50,7 @@ public:
U32 mTotalValidNodes; U32 mTotalValidNodes;
bool mListComplete; bool mListComplete;
NodeList() { mTotalValidNodes=0; mListComplete=false; } NodeList() { mId = 0; mTotalValidNodes = 0; mListComplete = false; }
virtual ~NodeList() { } virtual ~NodeList() { }
}; };
@ -93,7 +93,7 @@ protected:
U32 mListId; U32 mListId;
public: public:
NodeListNotify() { } NodeListNotify() { mListId = 0; }
virtual ~NodeListNotify() { } virtual ~NodeListNotify() { }
U32 getListId() { return mListId; } U32 getListId() { return mListId; }
@ -115,7 +115,7 @@ public:
NodeListManager::NodeList* mNodeList; NodeListManager::NodeList* mNodeList;
public: public:
NodeListEvent() { mNodeList=NULL; mTotalNodes = mLocalListStart = 0; } NodeListEvent() { mId = 0; mNodeList = NULL; mTotalNodes = mLocalListStart = 0; }
virtual ~NodeListEvent(); virtual ~NodeListEvent();
virtual void pack(NetConnection*, BitStream*); virtual void pack(NetConnection*, BitStream*);

View file

@ -593,7 +593,11 @@ IMPLEMENT_CO_NETOBJECT_V1(River);
River::River() River::River()
: mSegmentsPerBatch(10), : mLowVertCount(0),
mHighVertCount(0),
mLowTriangleCount(0),
mHighTriangleCount(0),
mSegmentsPerBatch(10),
mMetersPerSegment(10.0f), mMetersPerSegment(10.0f),
mDepthScale(1.0f), mDepthScale(1.0f),
mFlowMagnitude(1.0f), mFlowMagnitude(1.0f),

View file

@ -58,7 +58,7 @@ struct ObjectRenderInst;
class RiverSplineNode class RiverSplineNode
{ {
public: public:
RiverSplineNode() {} RiverSplineNode() :x(0.0f), y(0.0f), z(0.0f), width(0.0f), depth(0.0f) {}
F32 x; F32 x;
F32 y; F32 y;
@ -529,4 +529,4 @@ protected:
U32 mColumnCount; U32 mColumnCount;
}; };
#endif // _RIVER_H_ #endif // _RIVER_H_

View file

@ -56,7 +56,8 @@ WaterBlock::WaterBlock()
{ {
mGridElementSize = 5.0f; mGridElementSize = 5.0f;
mObjScale.set( 100.0f, 100.0f, 10.0f ); mObjScale.set( 100.0f, 100.0f, 10.0f );
mWidth = 2;
mHeight = 2;
mNetFlags.set(Ghostable | ScopeAlways); mNetFlags.set(Ghostable | ScopeAlways);
mObjBox.minExtents.set( -0.5f, -0.5f, -0.5f ); mObjBox.minExtents.set( -0.5f, -0.5f, -0.5f );

View file

@ -204,6 +204,7 @@ WaterObject::WaterObject()
mCubemap( NULL ), mCubemap( NULL ),
mSpecularColor( 1.0f, 1.0f, 1.0f, 1.0f ), mSpecularColor( 1.0f, 1.0f, 1.0f, 1.0f ),
mEmissive( false ), mEmissive( false ),
mFullReflect(true),
mDepthGradientMax( 50.0f ) mDepthGradientMax( 50.0f )
{ {
mTypeMask = WaterObjectType; mTypeMask = WaterObjectType;
@ -248,6 +249,8 @@ WaterObject::WaterObject()
mSurfMatName[BasicUnderWaterMat] = "UnderWaterBasicMat"; mSurfMatName[BasicUnderWaterMat] = "UnderWaterBasicMat";
dMemset( mMatInstances, 0, sizeof(mMatInstances) ); dMemset( mMatInstances, 0, sizeof(mMatInstances) );
dMemset(mMatParamHandles, 0, sizeof(mMatParamHandles));
mUnderwater = false;
mWaterPos.set( 0,0,0 ); mWaterPos.set( 0,0,0 );
mWaterPlane.set( mWaterPos, Point3F(0,0,1) ); mWaterPlane.set( mWaterPos, Point3F(0,0,1) );
@ -1211,4 +1214,4 @@ S32 WaterObject::getMaterialIndex( const Point3F &camPos )
} }
return matIdx; return matIdx;
} }

View file

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

View file

@ -114,9 +114,6 @@ protected:
static bool smDrawCells; static bool smDrawCells;
static bool smDrawBounds; static bool smDrawBounds;
///
bool mRegen;
enum MaskBits enum MaskBits
{ {
MediaMask = Parent::NextFreeMask << 1, MediaMask = Parent::NextFreeMask << 1,
@ -211,4 +208,4 @@ public:
void updateCollision(); void updateCollision();
}; };
#endif // _H_FOREST_ #endif // _H_FOREST_

View file

@ -46,7 +46,11 @@ public:
ForestConvex() ForestConvex()
{ {
mType = ForestConvexType; mType = ForestConvexType;
mTransform.identity(); mTransform.identity();
hullId = 0;
mForestItemKey = 0;
mData = NULL;
mScale = 1.0f;
} }
ForestConvex( const ForestConvex &cv ) ForestConvex( const ForestConvex &cv )