uninitialized variables-t3d

This commit is contained in:
AzaezelX 2020-05-11 15:30:21 -05:00
parent 87603029db
commit fabd5864fa
27 changed files with 102 additions and 23 deletions

View file

@ -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(); mImageFileName = StringTable->EmptyString();
} }

View file

@ -36,6 +36,7 @@ CameraSpline::Knot::Knot()
mSpeed = 0.0f; mSpeed = 0.0f;
mType = NORMAL; mType = NORMAL;
mPath = SPLINE; mPath = SPLINE;
mDistance = 0.0f;
prev = NULL; next = NULL; prev = NULL; next = NULL;
}; };
@ -46,6 +47,7 @@ CameraSpline::Knot::Knot(const Knot &k)
mSpeed = k.mSpeed; mSpeed = k.mSpeed;
mType = k.mType; mType = k.mType;
mPath = k.mPath; mPath = k.mPath;
mDistance = k.mDistance;
prev = NULL; next = NULL; prev = NULL; next = NULL;
} }
@ -56,6 +58,7 @@ CameraSpline::Knot::Knot(const Point3F &p, const QuatF &r, F32 s, Knot::Type typ
mSpeed = s; mSpeed = s;
mType = type; mType = type;
mPath = path; mPath = path;
mDistance = 0.0f;
prev = NULL; next = NULL; prev = NULL; next = NULL;
} }

View file

@ -50,7 +50,7 @@ protected:
public: public:
ConvexShapeCollisionConvex() { mType = ConvexShapeCollisionConvexType; } ConvexShapeCollisionConvex() { pShape = NULL; mType = ConvexShapeCollisionConvexType; }
ConvexShapeCollisionConvex( const ConvexShapeCollisionConvex& cv ) { ConvexShapeCollisionConvex( const ConvexShapeCollisionConvex& cv ) {
mType = ConvexShapeCollisionConvexType; mType = ConvexShapeCollisionConvexType;

View file

@ -157,6 +157,9 @@ DebrisData::DebrisData(const DebrisData& other, bool temp_clone) : GameBaseData(
explosion = other.explosion; explosion = other.explosion;
dMemcpy( emitterList, other.emitterList, sizeof( emitterList ) ); dMemcpy( emitterList, other.emitterList, sizeof( emitterList ) );
dMemcpy( emitterIDList, other.emitterIDList, sizeof( emitterIDList ) ); // -- for pack/unpack of emitterList ptrs dMemcpy( emitterIDList, other.emitterIDList, sizeof( emitterIDList ) ); // -- for pack/unpack of emitterList ptrs
mShatter = other.mShatter;
mProbBreak = other.mProbBreak;
mProbDepth = other.mProbDepth;
} }
DebrisData::~DebrisData() DebrisData::~DebrisData()
@ -533,6 +536,8 @@ Debris::Debris()
mInitialTrans.identity(); mInitialTrans.identity();
mRadius = 0.2f; mRadius = 0.2f;
mStatic = false; mStatic = false;
mElasticity = 0.5f;
mFriction = 0.5f;
dMemset( mEmitterList, 0, sizeof( mEmitterList ) ); dMemset( mEmitterList, 0, sizeof( mEmitterList ) );

View file

@ -24,6 +24,23 @@
#include "T3D/decal/decalInstance.h" #include "T3D/decal/decalInstance.h"
#include "scene/sceneRenderState.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 ) void DecalInstance::getWorldMatrix( MatrixF *outMat, bool flip )
{ {
outMat->setPosition( mPosition ); outMat->setPosition( mPosition );

View file

@ -87,7 +87,7 @@ class DecalInstance
/// Calculates the size of this decal onscreen in pixels, used for LOD. /// Calculates the size of this decal onscreen in pixels, used for LOD.
F32 calcPixelSize( U32 viewportHeight, const Point3F &cameraPos, F32 worldToScreenScaleY ) const; F32 calcPixelSize( U32 viewportHeight, const Point3F &cameraPos, F32 worldToScreenScaleY ) const;
DecalInstance() : mId(-1) {} DecalInstance();
}; };
#endif // _DECALINSTANCE_H_ #endif // _DECALINSTANCE_H_

View file

@ -238,6 +238,9 @@ ExplosionData::ExplosionData()
explosionScale.set(1.0f, 1.0f, 1.0f); explosionScale.set(1.0f, 1.0f, 1.0f);
playSpeed = 1.0f; playSpeed = 1.0f;
explosionShape = NULL;
explosionAnimation = -1;
dMemset( emitterList, 0, sizeof( emitterList ) ); dMemset( emitterList, 0, sizeof( emitterList ) );
dMemset( emitterIDList, 0, sizeof( emitterIDList ) ); dMemset( emitterIDList, 0, sizeof( emitterIDList ) );
dMemset( debrisList, 0, sizeof( debrisList ) ); dMemset( debrisList, 0, sizeof( debrisList ) );
@ -924,6 +927,7 @@ Explosion::Explosion()
ss_index = 0; ss_index = 0;
mDataBlock = 0; mDataBlock = 0;
soundProfile_clone = 0; soundProfile_clone = 0;
mRandomVal = 0;
} }
Explosion::~Explosion() Explosion::~Explosion()

View file

@ -286,6 +286,7 @@ fxFoliageReplicator::fxFoliageReplicator()
// Reset Foliage Count. // Reset Foliage Count.
mCurrentFoliageCount = 0; mCurrentFoliageCount = 0;
dMemset(&mFrustumRenderSet, 0, sizeof(mFrustumRenderSet));
// Reset Creation Area Angle Animation. // Reset Creation Area Angle Animation.
mCreationAreaAngle = 0; mCreationAreaAngle = 0;
@ -299,8 +300,15 @@ fxFoliageReplicator::fxFoliageReplicator()
// Reset Frame Serial ID. // Reset Frame Serial ID.
mFrameSerialID = 0; mFrameSerialID = 0;
mQuadTreeLevels = 0;
mNextAllocatedNodeIdx = 0;
mAlphaLookup = NULL; mAlphaLookup = NULL;
mFadeInGradient = 0.0f;
mFadeOutGradient = 0.0f;
mGlobalSwayPhase = 0.0f;
mGlobalSwayTimeRatio = 1.0f;
mGlobalLightPhase = 0.0f;
mGlobalLightTimeRatio = 1.0f;
mDirty = true; mDirty = true;
@ -317,6 +325,8 @@ fxFoliageReplicator::fxFoliageReplicator()
mFoliageShaderTrueBillboardSC = NULL; mFoliageShaderTrueBillboardSC = NULL;
mFoliageShaderGroundAlphaSC = NULL; mFoliageShaderGroundAlphaSC = NULL;
mFoliageShaderAmbientColorSC = NULL; mFoliageShaderAmbientColorSC = NULL;
mDiffuseTextureSC = NULL;
mAlphaMapTextureSC = NULL;
mShaderData = NULL; mShaderData = NULL;
} }

View file

@ -248,7 +248,7 @@ LightningData::LightningData()
strikeTextureNames[i] = NULL; strikeTextureNames[i] = NULL;
strikeTextures[i] = NULL; strikeTextures[i] = NULL;
} }
numThunders = 0;
mNumStrikeTextures = 0; mNumStrikeTextures = 0;
} }
@ -371,6 +371,7 @@ Lightning::Lightning()
mNetFlags.set(Ghostable|ScopeAlways); mNetFlags.set(Ghostable|ScopeAlways);
mTypeMask |= StaticObjectType|EnvironmentObjectType; mTypeMask |= StaticObjectType|EnvironmentObjectType;
mDataBlock = NULL;
mLastThink = 0; mLastThink = 0;
mStrikeListHead = NULL; mStrikeListHead = NULL;
@ -1041,6 +1042,8 @@ LightningBolt::LightningBolt()
maxMinorAngle = 15.0f; maxMinorAngle = 15.0f;
fadeTime = 0.2f; fadeTime = 0.2f;
renderTime = 0.125; renderTime = 0.125;
dMemset(&mMajorNodes, 0, sizeof(mMajorNodes));
percentFade = 0.0f;
} }
//-------------------------------------------------------------------------- //--------------------------------------------------------------------------

View file

@ -846,6 +846,7 @@ ParticleEmitterData::ParticleEmitterData(const ParticleEmitterData& other, bool
textureName = other.textureName; textureName = other.textureName;
textureHandle = other.textureHandle; // -- TextureHandle loads using textureName textureHandle = other.textureHandle; // -- TextureHandle loads using textureName
highResOnly = other.highResOnly; highResOnly = other.highResOnly;
glow = other.glow;
renderReflection = other.renderReflection; renderReflection = other.renderReflection;
fade_color = other.fade_color; fade_color = other.fade_color;
fade_size = other.fade_size; fade_size = other.fade_size;
@ -965,7 +966,7 @@ ParticleEmitter::ParticleEmitter()
pos_pe.set(0,0,0); pos_pe.set(0,0,0);
sort_priority = 0; sort_priority = 0;
mDataBlock = 0; mDataBlock = 0;
std::fill_n(sizes, ParticleData::PDC_NUM_KEYS, 0.0f);
#if defined(AFX_CAP_PARTICLE_POOLS) #if defined(AFX_CAP_PARTICLE_POOLS)
pool = 0; pool = 0;
#endif #endif

View file

@ -170,6 +170,7 @@ void RibbonData::unpackData(BitStream* stream)
// //
Ribbon::Ribbon() Ribbon::Ribbon()
{ {
mDataBlock = NULL;
mTypeMask |= StaticObjectType; mTypeMask |= StaticObjectType;
VECTOR_SET_ASSOCIATION(mSegmentPoints); VECTOR_SET_ASSOCIATION(mSegmentPoints);

View file

@ -37,9 +37,6 @@ class RibbonNodeData : public GameBaseData
{ {
typedef GameBaseData Parent; typedef GameBaseData Parent;
public:
F32 timeMultiple;
public: public:
RibbonNodeData(); RibbonNodeData();
~RibbonNodeData(); ~RibbonNodeData();

View file

@ -309,6 +309,7 @@ Splash::Splash()
mDelayMS = 0; mDelayMS = 0;
mCurrMS = 0; mCurrMS = 0;
mRandAngle = 0;
mEndingMS = 1000; mEndingMS = 1000;
mActive = false; mActive = false;
mRadius = 0.0; mRadius = 0.0;
@ -319,7 +320,8 @@ Splash::Splash()
mElapsedTime = 0.0; mElapsedTime = 0.0;
mInitialNormal.set( 0.0, 0.0, 1.0 ); mInitialNormal.set( 0.0, 0.0, 1.0 );
mFade = 0;
mFog = 0;
// Only allocated client side. // Only allocated client side.
mNetFlags.set( IsGhost ); mNetFlags.set( IsGhost );
} }

View file

@ -254,6 +254,8 @@ GameBase::GameBase()
mTicksSinceLastMove = 0; mTicksSinceLastMove = 0;
mIsAiControlled = false; mIsAiControlled = false;
#endif #endif
mTickCount = 0;
mCameraFov = 90.f;
} }
GameBase::~GameBase() GameBase::~GameBase()

View file

@ -26,6 +26,7 @@
MoveList::MoveList() MoveList::MoveList()
{ {
mConnection = NULL;
mControlMismatch = false; mControlMismatch = false;
reset(); reset();
} }

View file

@ -61,6 +61,8 @@ GuiMaterialPreview::GuiMaterialPreview()
// By default don't do dynamic reflection // By default don't do dynamic reflection
// updates for this viewport. // updates for this viewport.
mReflectPriority = 0.0f; mReflectPriority = 0.0f;
mMountedModel = NULL;
mSkinTag = 0;
} }
GuiMaterialPreview::~GuiMaterialPreview() GuiMaterialPreview::~GuiMaterialPreview()

View file

@ -43,6 +43,7 @@ ConsoleDocClass( PhysicsForce,
PhysicsForce::PhysicsForce() PhysicsForce::PhysicsForce()
: :
mWorld( NULL ), mWorld( NULL ),
mForce(0.0f),
mPhysicsTick( false ), mPhysicsTick( false ),
mBody( NULL ) mBody( NULL )
{ {

View file

@ -311,6 +311,11 @@ PlayerData::PlayerData()
jumpEnergyDrain = 0.0f; jumpEnergyDrain = 0.0f;
minJumpEnergy = 0.0f; minJumpEnergy = 0.0f;
jumpSurfaceAngle = 78.0f; jumpSurfaceAngle = 78.0f;
jumpSurfaceCos = mCos(mDegToRad(jumpSurfaceAngle));
for (U32 i = 0; i < NumRecoilSequences; i++)
recoilSequence[i] = -1;
jumpDelay = 30; jumpDelay = 30;
minJumpSpeed = 500.0f; minJumpSpeed = 500.0f;
maxJumpSpeed = 2.0f * minJumpSpeed; maxJumpSpeed = 2.0f * minJumpSpeed;
@ -370,6 +375,9 @@ PlayerData::PlayerData()
actionCount = 0; actionCount = 0;
lookAction = 0; lookAction = 0;
dMemset(spineNode, 0, sizeof(spineNode));
pickupDelta = 0.0f;
// size of bounding box // size of bounding box
boxSize.set(1.0f, 1.0f, 2.3f); boxSize.set(1.0f, 1.0f, 2.3f);

View file

@ -253,6 +253,7 @@ RigidShapeData::RigidShapeData()
dustEmitter = NULL; dustEmitter = NULL;
dustID = 0; dustID = 0;
triggerDustHeight = 3.0;
dustHeight = 1.0; dustHeight = 1.0;
dMemset( splashEmitterList, 0, sizeof( splashEmitterList ) ); dMemset( splashEmitterList, 0, sizeof( splashEmitterList ) );

View file

@ -111,7 +111,7 @@ class ShapeBaseConvex : public Convex
Box3F box; Box3F box;
public: public:
ShapeBaseConvex() { mType = ShapeBaseConvexType; nodeTransform = 0; } ShapeBaseConvex() :pShapeBase(NULL), transform(NULL), hullId(NULL), nodeTransform(0) { mType = ShapeBaseConvexType; }
ShapeBaseConvex(const ShapeBaseConvex& cv) { ShapeBaseConvex(const ShapeBaseConvex& cv) {
mObject = cv.mObject; mObject = cv.mObject;
pShapeBase = cv.pShapeBase; pShapeBase = cv.pShapeBase;

View file

@ -134,6 +134,8 @@ ShapeBaseImageData::StateData::StateData()
recoil = NoRecoil; recoil = NoRecoil;
sound = 0; sound = 0;
emitter = NULL; emitter = NULL;
shapeSequence = NULL;
shapeSequenceScale = true;
script = 0; script = 0;
ignoreLoadedForReady = false; ignoreLoadedForReady = false;
@ -1396,6 +1398,7 @@ ShapeBase::MountedImage::MountedImage()
dataBlock = 0; dataBlock = 0;
nextImage = InvalidImagePtr; nextImage = InvalidImagePtr;
delayTime = 0; delayTime = 0;
rDT = 0.0f;
ammo = false; ammo = false;
target = false; target = false;
triggerDown = false; triggerDown = false;
@ -1408,6 +1411,7 @@ ShapeBase::MountedImage::MountedImage()
motion = false; motion = false;
lightStart = 0; lightStart = 0;
lightInfo = NULL; lightInfo = NULL;
dMemset(emitter, 0, sizeof(emitter));
for (U32 i=0; i<ShapeBaseImageData::MaxGenericTriggers; ++i) for (U32 i=0; i<ShapeBaseImageData::MaxGenericTriggers; ++i)
{ {

View file

@ -119,6 +119,7 @@ AITurretShapeData::AITurretShapeData()
} }
isAnimated = false; isAnimated = false;
statesLoaded = false; statesLoaded = false;
fireState = -1;
} }
void AITurretShapeData::initPersistFields() void AITurretShapeData::initPersistFields()

View file

@ -114,17 +114,21 @@ TurretShapeData::TurretShapeData()
headingNode = -1; headingNode = -1;
pitchNode = -1; pitchNode = -1;
U32 i = 0;
for (U32 i=0; i<NumMirrorDirectionNodes; ++i) for (i=0; i<NumMirrorDirectionNodes; ++i)
{ {
pitchNodes[i] = -1; pitchNodes[i] = -1;
headingNodes[i] = -1; headingNodes[i] = -1;
} }
for (U32 i=0; i<ShapeBase::MaxMountedImages; ++i) for (i=0; i<ShapeBase::MaxMountedImages; ++i)
{ {
weaponMountNode[i] = -1; weaponMountNode[i] = -1;
} }
for (i = 0; i < NumRecoilSequences;i++)
recoilSequence[i] = -1;
pitchSequence = -1;
headingSequence = -1;
} }
void TurretShapeData::initPersistFields() void TurretShapeData::initPersistFields()
@ -284,6 +288,8 @@ TurretShape::TurretShape()
// For the Item class // For the Item class
mSubclassItemHandlesScene = true; mSubclassItemHandlesScene = true;
mRecoilThread = NULL;
mImageStateThread = NULL;
} }
TurretShape::~TurretShape() TurretShape::~TurretShape()

View file

@ -322,6 +322,7 @@ ConsoleDocClass( FlyingVehicle,
FlyingVehicle::FlyingVehicle() FlyingVehicle::FlyingVehicle()
{ {
mDataBlock = NULL;
mSteering.set(0,0); mSteering.set(0,0);
mThrottle = 0; mThrottle = 0;
mJetting = false; mJetting = false;
@ -332,6 +333,10 @@ FlyingVehicle::FlyingVehicle()
mBackMaintainOn = false; mBackMaintainOn = false;
mBottomMaintainOn = false; mBottomMaintainOn = false;
createHeightOn = false; createHeightOn = false;
mCeilingFactor = 1.0f;
mThrustDirection = FlyingVehicle::ThrustForward;
for (U32 i=0;i< JetAnimCount;i++)
mJetSeq[i] = -1;
for (S32 i = 0; i < JetAnimCount; i++) for (S32 i = 0; i < JetAnimCount; i++)
mJetThread[i] = 0; mJetThread[i] = 0;

View file

@ -77,7 +77,6 @@ struct FlyingVehicleData: public VehicleData {
// Initialized in preload // Initialized in preload
ClippedPolyList rigidBody; ClippedPolyList rigidBody;
S32 surfaceCount;
F32 maxSpeed; F32 maxSpeed;
enum JetNodes { enum JetNodes {

View file

@ -139,6 +139,7 @@ HoverVehicleData::HoverVehicleData()
dustTrailID = 0; dustTrailID = 0;
dustTrailOffset.set( 0.0f, 0.0f, 0.0f ); dustTrailOffset.set( 0.0f, 0.0f, 0.0f );
dustTrailFreqMod = 15.0f; dustTrailFreqMod = 15.0f;
maxThrustSpeed = 0;
triggerTrailHeight = 2.5f; triggerTrailHeight = 2.5f;
floatingGravMag = 1; floatingGravMag = 1;
@ -436,24 +437,29 @@ void HoverVehicleData::unpackData(BitStream* stream)
// //
HoverVehicle::HoverVehicle() HoverVehicle::HoverVehicle()
{ {
mDataBlock = NULL;
// Todo: ScopeAlways? // Todo: ScopeAlways?
mNetFlags.set(Ghostable); mNetFlags.set(Ghostable);
mFloating = false; mFloating = false;
mForwardThrust = 0; mThrustLevel = 0.0f;
mReverseThrust = 0; mForwardThrust = 0.0f;
mLeftThrust = 0; mReverseThrust = 0.0f;
mRightThrust = 0; mLeftThrust = 0.0f;
mRightThrust = 0.0f;
mJetSound = NULL; mJetSound = NULL;
mEngineSound = NULL; mEngineSound = NULL;
mFloatSound = NULL; mFloatSound = NULL;
mThrustDirection = HoverVehicle::ThrustForward;
mDustTrailEmitter = NULL; mDustTrailEmitter = NULL;
mBackMaintainOn = false; mBackMaintainOn = false;
for (S32 i = 0; i < JetAnimCount; i++) for (S32 i = 0; i < JetAnimCount; i++)
mJetThread[i] = 0; {
mJetSeq[i] = -1;
mJetThread[i] = NULL;
}
} }
HoverVehicle::~HoverVehicle() HoverVehicle::~HoverVehicle()

View file

@ -304,7 +304,7 @@ WheeledVehicleData::WheeledVehicleData()
brakeLightSequence = -1; brakeLightSequence = -1;
steeringSequence = -1; steeringSequence = -1;
wheelCount = 0; wheelCount = 0;
dMemset(&wheel, 0, sizeof(wheel));
for (S32 i = 0; i < MaxSounds; i++) for (S32 i = 0; i < MaxSounds; i++)
sound[i] = 0; sound[i] = 0;
} }