Merge pull request #2190 from Areloch/AssetCodeCleanupRoundOne

Some code cleanup on assets, entities and components, round 1
This commit is contained in:
Areloch 2018-02-13 14:54:50 -06:00 committed by GitHub
commit e18661d861
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
15 changed files with 59 additions and 41 deletions

View file

@ -613,6 +613,9 @@ void AnimationComponent::advanceThreads(F32 dt)
if (!mOwnerRenderInst)
return;
if (mOwnerShapeInstance == nullptr || !getShape())
return;
for (U32 i = 0; i < MaxScriptThreads; i++)
{
Thread& st = mAnimationThreads[i];

View file

@ -142,10 +142,12 @@ CollisionComponent::CollisionComponent() : Component()
StaticShapeObjectType | VehicleObjectType |
VehicleBlockerObjectType | DynamicShapeObjectType | StaticObjectType | EntityObjectType | TriggerObjectType);
mPhysicsRep = NULL;
mPhysicsWorld = NULL;
mPhysicsRep = nullptr;
mPhysicsWorld = nullptr;
mTimeoutList = NULL;
mTimeoutList = nullptr;
mAnimated = false;
}
CollisionComponent::~CollisionComponent()

View file

@ -67,6 +67,13 @@ Component::Component()
mOriginatingAssetId = StringTable->EmptyString();
mIsServerObject = true;
componentIdx = 0;
mHidden = false;
mEnabled = true;
mDirtyMaskBits = 0;
}
Component::~Component()
@ -535,7 +542,7 @@ const char * Component::getDescriptionText(const char *desc)
if (desc == NULL)
return NULL;
char *newDesc;
char *newDesc = "";
// [tom, 1/12/2007] If it isn't a file, just do it the easy way
if (!Platform::isFile(desc))
@ -568,7 +575,7 @@ const char * Component::getDescriptionText(const char *desc)
}
str.close();
delete stream;
//delete stream;
return newDesc;
}

View file

@ -30,6 +30,10 @@ StateMachine::StateMachine()
mStartingState = "";
mCurCreateState = NULL;
mStateMachineFile = StringTable->EmptyString();
mCurCreateState = nullptr;
}
StateMachine::~StateMachine()

View file

@ -158,6 +158,8 @@ public:
{
if (index <= mFields.size())
return mFields[index];
return StateField(); //return a blank one
}
Signal< void(StateMachine*, S32 stateIdx) > onStateChanged;

View file

@ -119,8 +119,11 @@ PlayerControllerComponent::PlayerControllerComponent() : Component()
mInputVelocity = Point3F(0, 0, 0);
mPhysicsRep = NULL;
mPhysicsWorld = NULL;
mPhysicsRep = nullptr;
mPhysicsWorld = nullptr;
mOwnerCollisionInterface = nullptr;
mIntegrationCount = 0;
}
PlayerControllerComponent::~PlayerControllerComponent()

View file

@ -59,7 +59,7 @@ ImplementEnumType(BatchingMode,
//////////////////////////////////////////////////////////////////////////
// Constructor/Destructor
//////////////////////////////////////////////////////////////////////////
MeshComponent::MeshComponent() : Component()
MeshComponent::MeshComponent() : Component(), mShape(nullptr), mRenderMode(Individual)
{
mFriendlyName = "Mesh Component";
mComponentType = "Render";