uninitialized variables-ts

This commit is contained in:
AzaezelX 2020-05-11 15:40:55 -05:00
parent c2e74f375a
commit 9e1c22204f
13 changed files with 29 additions and 10 deletions

View file

@ -57,7 +57,7 @@ AssimpAppMaterial::AssimpAppMaterial(const char* matName)
{
name = ColladaUtils::getOptions().matNamePrefix;
name += matName;
mAIMat = NULL;
// Set some defaults
flags |= TSMaterialList::S_Wrap;
flags |= TSMaterialList::T_Wrap;

View file

@ -886,7 +886,7 @@ struct AnimData
return element ? (AnimChannels*)const_cast<daeElement*>(element)->getUserData() : 0;
}
AnimData() : enabled(false) { }
AnimData() : enabled(false), targetValueOffset(0), targetValueCount(0){ }
void parseTargetString(const char* target, S32 fullCount, const char* elements[]);

View file

@ -26,7 +26,7 @@
Vector<AppMaterial*> AppMesh::appMaterials;
AppMesh::AppMesh()
: flags(0), vertsPerFrame(0),numFrames(0), numMatFrames(0)
: flags(0), vertsPerFrame(0),numFrames(0), numMatFrames(0), detailSize(1)
{
}

View file

@ -26,6 +26,7 @@ AppNode::AppNode()
{
mName = NULL;
mParentName = NULL;
mParentIndex = 0;
}
AppNode::~AppNode()

View file

@ -39,7 +39,7 @@ public:
F32 fps;
public:
AppSequence() { }
AppSequence():fps(30.0f) { } //default based on TSShapeLoader::XXXFrameRate(s) and AssimpAppSequence fallback
virtual ~AppSequence() { }
virtual void setActive(bool active) { }

View file

@ -182,7 +182,7 @@ protected:
void install();
public:
TSShapeLoader() : boundsNode(0) { }
TSShapeLoader() : boundsNode(0), shape(NULL) { }
virtual ~TSShapeLoader();
static const Torque::Path& getShapePath() { return shapePath; }

View file

@ -1182,7 +1182,14 @@ TSMesh::TSMesh() : mMeshType( StandardMeshType )
mNumVerts = 0;
mVertSize = 0;
mVertOffset = 0;
mRadius = 0.0f;
mVertexFormat = NULL;
mPrimBufferOffset = 0;
numFrames = 0;
numMatFrames = 0;
vertsPerFrame = 0;
mPlanesPerFrame = 0;
mMergeBufferStart = 0;
mParentMeshObject = NULL;
}

View file

@ -198,7 +198,7 @@ public:
bool ownsData;
public:
TSMeshVertexArray() : base(NULL), numElements(0), colorOffset(0), boneOffset(0), vertexDataReady(false), ownsData(false) {}
TSMeshVertexArray() : base(NULL), vertSz(0), numElements(0), colorOffset(0), boneOffset(0), vertexDataReady(false), ownsData(false) {}
virtual ~TSMeshVertexArray() { set(NULL, 0, 0, 0, 0); }
virtual void set(void *b, dsize_t s, U32 n, S32 inColorOffset, S32 inBoneOffset, bool nowOwnsData = true)
@ -339,7 +339,7 @@ protected:
Point3F mBillboardAxis;
/// @name Convex Hull Data
/// Convex hulls are convex (no angles >= 180º) meshes used for collision
/// Convex hulls are convex (no angles >= 180º) meshes used for collision
/// @{
Vector<Point3F> mPlaneNormals;

View file

@ -51,6 +51,7 @@ void TSPartInstance::init(TSShapeInstance * sourceShape)
mCurrentObjectDetail = 0;
mCurrentIntraDL = 1.0f;
mData = 0;
mRadius = 0.125;
}
TSPartInstance::~TSPartInstance()

View file

@ -68,12 +68,19 @@ U32 TSShape::smMaxSkinBones = 70;
TSShape::TSShape()
{
mExporterVersion = 124;
mSmallestVisibleSize = 2;
mSmallestVisibleDL = 0;
mRadius = 0;
mFlags = 0;
tubeRadius = 0;
data = NULL;
materialList = NULL;
mReadVersion = -1; // -1 means constructed from scratch (e.g., in exporter or no read yet)
mSequencesConstructed = false;
mShapeData = NULL;
mShapeDataSize = 0;
mVertexSize = 0;
mUseDetailFromScreenError = false;
mNeedReinit = false;

View file

@ -196,7 +196,7 @@ public:
public:
TSShapeConstructor();
TSShapeConstructor(const String& path) : mShapePath(path) { }
TSShapeConstructor(const String& path) : mShapePath(path), mShape(NULL), mLoadingShape(false){ }
~TSShapeConstructor();
DECLARE_CONOBJECT(TSShapeConstructor);

View file

@ -118,6 +118,7 @@ TSShapeInstance::TSShapeInstance( const Resource<TSShape> &shape, bool loadMater
mShapeResource = shape;
mShape = mShapeResource;
mUseOverrideTexture = false;
buildInstanceData( mShape, loadMaterials );
}
@ -135,6 +136,7 @@ TSShapeInstance::TSShapeInstance( TSShape *shape, bool loadMaterials )
mShapeResource = NULL;
mShape = shape;
mUseOverrideTexture = false;
buildInstanceData( mShape, loadMaterials );
}

View file

@ -71,6 +71,7 @@ public:
void disassemble();
TSSortedMesh() {
alwaysWriteDepth = false;
mMeshType = SortedMeshType;
}
};