Jelajahi Sumber

uninitialized variables-ts

AzaezelX 5 tahun lalu
induk
melakukan
9e1c22204f

+ 1 - 1
Engine/source/ts/assimp/assimpAppMaterial.cpp

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

+ 1 - 1
Engine/source/ts/collada/colladaUtils.h

@@ -886,7 +886,7 @@ struct AnimData
       return element ? (AnimChannels*)const_cast<daeElement*>(element)->getUserData() : 0;
       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[]);
    void parseTargetString(const char* target, S32 fullCount, const char* elements[]);
 
 

+ 1 - 1
Engine/source/ts/loader/appMesh.cpp

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

+ 1 - 0
Engine/source/ts/loader/appNode.cpp

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

+ 1 - 1
Engine/source/ts/loader/appSequence.h

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

+ 1 - 1
Engine/source/ts/loader/tsShapeLoader.h

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

+ 8 - 1
Engine/source/ts/tsMesh.cpp

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

+ 2 - 2
Engine/source/ts/tsMesh.h

@@ -198,7 +198,7 @@ public:
       bool ownsData;
       bool ownsData;
 
 
    public:
    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 ~TSMeshVertexArray() { set(NULL, 0, 0, 0, 0); }
 
 
       virtual void set(void *b, dsize_t s, U32 n, S32 inColorOffset, S32 inBoneOffset, bool nowOwnsData = true)
       virtual void set(void *b, dsize_t s, U32 n, S32 inColorOffset, S32 inBoneOffset, bool nowOwnsData = true)
@@ -339,7 +339,7 @@ protected:
    Point3F mBillboardAxis;
    Point3F mBillboardAxis;
 
 
    /// @name Convex Hull Data
    /// @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;
    Vector<Point3F> mPlaneNormals;

+ 1 - 0
Engine/source/ts/tsPartInstance.cpp

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

+ 8 - 1
Engine/source/ts/tsShape.cpp

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

+ 1 - 1
Engine/source/ts/tsShapeConstruct.h

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

+ 2 - 0
Engine/source/ts/tsShapeInstance.cpp

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

+ 1 - 0
Engine/source/ts/tsSortedMesh.h

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