Clean up redundant variables

This commit is contained in:
suncaller 2019-02-06 15:03:06 -05:00
parent 7f7e402c42
commit 5e8e7e7bf8
17 changed files with 1 additions and 50 deletions

View file

@ -621,8 +621,6 @@ void AnimationComponent::advanceThreads(F32 dt)
Thread& st = mAnimationThreads[i];
if (st.thread && st.sequence != -1)
{
bool cyclic = getShape()->sequences[st.sequence].isCyclic();
if (!getShape()->sequences[st.sequence].isCyclic() &&
!st.atEnd &&
((st.timescale > 0.f) ? mOwnerShapeInstance->getPos(st.thread) >= 1.0 : mOwnerShapeInstance->getPos(st.thread) <= 0))

View file

@ -237,8 +237,6 @@ bool CameraComponent::getCameraTransform(F32* pos,MatrixF* mat)
{
// Returns camera to world space transform
// Handles first person / third person camera position
bool isServer = isServerObject();
if (mTargetNodeIdx == -1)
{
if (mUseParentTransform)
@ -479,7 +477,6 @@ void CameraComponent::setRotation(RotationF newRot)
Frustum CameraComponent::getFrustum()
{
Frustum visFrustum;
F32 left, right, top, bottom;
F32 aspectRatio = mClientScreen.x / mClientScreen.y;
visFrustum.set(false, mDegToRad(mCameraFov), aspectRatio, 0.1f, 1000, mOwner->getTransform());

View file

@ -538,7 +538,6 @@ PhysicsCollision* CollisionComponent::buildColShapes()
for (S32 o = start; o < end; o++)
{
const TSShape::Object &object = shape->objects[o];
const String &meshName = shape->names[object.nameIndex];
if (object.numMeshes <= detail.objectDetailNum)
continue;

View file

@ -152,7 +152,6 @@ void StateMachine::readConditions(StateTransition &currentTransition)
//get our first state
StateTransition::Condition firstCondition;
StateField firstField;
bool fieldRead = false;
readFieldName(&firstField, reader);
firstCondition.field = firstField;

View file

@ -239,8 +239,6 @@ bool TriggerComponent::testObject(SceneObject* enter)
myList.setObject(mOwner);
myCI->buildPolyList(PLC_Collision, &myList, enterBox, sphere);
bool test = true;
}
}
}

View file

@ -330,9 +330,6 @@ void PlayerControllerComponent::updateMove()
}
// Update current orientation
bool doStandardMove = true;
GameConnection* con = mOwner->getControllingClient();
MatrixF zRot;
zRot.set(EulerF(0.0f, 0.0f, mOwner->getRotation().asEulerF().z));
@ -355,7 +352,6 @@ void PlayerControllerComponent::updateMove()
mContactInfo.jump = false;
mContactInfo.run = false;
bool jumpSurface = false, runSurface = false;
if (!mOwner->isMounted())
findContact(&mContactInfo.run, &mContactInfo.jump, &mContactInfo.contactNormal);
if (mContactInfo.jump)
@ -577,7 +573,6 @@ void PlayerControllerComponent::updatePos(const F32 travelTime)
newPos = mPhysicsRep->move(mVelocity * travelTime, collisionList);
bool haveCollisions = false;
bool wasFalling = mFalling;
if (collisionList.getCount() > 0)
{
mFalling = false;

View file

@ -719,8 +719,6 @@ bool ConvexShape::buildExportPolyList(ColladaUtils::ExportData* exportData, cons
//Convex shapes only have the one 'level', so we'll just rely on the export post-process to back-fill
if (isServerObject() && getClientObject())
{
ConvexShape* clientShape = dynamic_cast<ConvexShape*>(getClientObject());
exportData->meshData.increment();
//Prep a meshData for this shape in particular

View file

@ -306,8 +306,6 @@ void Entity::onPostAdd()
bool Entity::_setGameObject(void *object, const char *index, const char *data)
{
Entity *e = static_cast<Entity*>(object);
// Sanity!
AssertFatal(data != NULL, "Cannot use a NULL asset Id.");
@ -513,8 +511,6 @@ U32 Entity::packUpdate(NetConnection *con, U32 mask, BitStream *stream)
for (U32 i = 0; i < mNetworkedComponents.size(); i++)
{
NetworkedComponent::UpdateState state = mNetworkedComponents[i].updateState;
if (mNetworkedComponents[i].updateState == NetworkedComponent::Adding)
{
const char* className = mComponents[mNetworkedComponents[i].componentIndex]->getClassName();
@ -1381,7 +1377,6 @@ bool Entity::removeComponent(Component *comp, bool deleteComponent)
//to re-add them. Need to implement a clean clear function that will clear the local list, and only delete unused behaviors during an update.
void Entity::clearComponents(bool deleteComponents)
{
bool srv = isServerObject();
if (!deleteComponents)
{
while (mComponents.size() > 0)
@ -1399,8 +1394,6 @@ void Entity::clearComponents(bool deleteComponents)
{
comp->onComponentRemove(); //in case the behavior needs to do cleanup on the owner
bool removed = mComponents.remove(comp);
//we only need to delete them on the server side. they'll be cleaned up on the client side
//via the ghosting system for us
if (isServerObject())
@ -1663,7 +1656,6 @@ void Entity::notifyComponents(String signalFunction, String argA, String argB, S
void Entity::setComponentsDirty()
{
bool tmp = true;
/*if (mToLoadComponents.empty())
mStartComponentUpdate = true;
@ -1694,7 +1686,6 @@ void Entity::setComponentsDirty()
void Entity::setComponentDirty(Component *comp, bool forceUpdate)
{
bool found = false;
for (U32 i = 0; i < mComponents.size(); i++)
{
if (mComponents[i]->getId() == comp->getId())

View file

@ -309,7 +309,6 @@ Vector<T*> Entity::getComponents()
Vector<T*> foundObjects;
T *curObj;
Component* comp;
// Loop through our child objects.
for (U32 i = 0; i < mComponents.size(); i++)

View file

@ -553,7 +553,6 @@ void renderFrame(GFXTextureTargetRef* target, MatrixF transform, Frustum frustum
GFX->setStateBlock(mDefaultGuiSB);
GFXTargetRef origTarget = GFX->getActiveRenderTarget();
U32 origStyle = GFX->getCurrentRenderStyle();
// Clear the zBuffer so GUI doesn't hose object rendering accidentally
GFX->clear(GFXClearZBuffer, ColorI(20, 20, 20), 1.0f, 0);

View file

@ -21,11 +21,9 @@ void MeshRenderSystem::render(SceneManager *sceneManager, SceneRenderState* stat
for (U32 i = 0; i < count; i++)
{
//Server side items exist for data, but we don't actually render them
bool isClient = MeshRenderSystemInterface::all[i]->mIsClient;
if (!MeshRenderSystemInterface::all[i]->mIsClient)
continue;
bool isStatic = MeshRenderSystemInterface::all[i]->mStatic;
if (MeshRenderSystemInterface::all[i]->mStatic)
continue;

View file

@ -1131,7 +1131,6 @@ bool TSStatic::buildExportPolyList(ColladaUtils::ExportData* exportData, const B
if (isServerObject() && getClientObject())
{
TSStatic* clientShape = dynamic_cast<TSStatic*>(getClientObject());
U32 numDetails = clientShape->mShapeInstance->getNumDetails() - 1;
exportData->meshData.increment();

View file

@ -1611,9 +1611,7 @@ static void handleExtendedMasterServerListResponse(BitStream* stream, U32 key, U
{
U16 packetIndex, packetTotal;
U32 i;
U16 serverCount, port;
U8 netNum[16];
char addressBuffer[256];
U16 serverCount;
NetAddress addr;
stream->read(&packetIndex);

View file

@ -89,9 +89,6 @@ bool GuiConsole::onWake()
S32 GuiConsole::getMaxWidth(S32 startIndex, S32 endIndex)
{
//sanity check
U32 size;
ConsoleLogEntry *log;
if (startIndex < 0 || (U32)endIndex >= mFilteredLog.size() || startIndex > endIndex)
return 0;
@ -190,9 +187,6 @@ void GuiConsole::onPreRender()
void GuiConsole::onRenderCell(Point2I offset, Point2I cell, bool /*selected*/, bool /*mouseOver*/)
{
U32 size;
ConsoleLogEntry *log;
ConsoleLogEntry &entry = mFilteredLog[cell.y];
switch (entry.mLevel)
{
@ -210,9 +204,6 @@ void GuiConsole::onCellSelected( Point2I cell )
{
Parent::onCellSelected( cell );
U32 size;
ConsoleLogEntry* log;
ConsoleLogEntry& entry = mFilteredLog[cell.y];
onMessageSelected_callback( entry.mLevel, entry.mString );
}

View file

@ -133,9 +133,6 @@ bool GuiInspectorMountingGroup::inspectGroup()
clearFields();
bool bNewItems = false;
bool bMakingArray = false;
GuiStackControl *pArrayStack = NULL;
GuiRolloutCtrl *pArrayRollout = NULL;
bool bGrabItems = false;
AbstractClassRep* commonAncestorClass = findCommonAncestorClass();
@ -240,7 +237,6 @@ void GuiInspectorMountingGroup::updateAllFields()
void GuiInspectorMountingGroup::onMouseMove(const GuiEvent &event)
{
//mParent->mOverDivider = false;
bool test = false;
}
DefineEngineMethod(GuiInspectorMountingGroup, inspectGroup, bool, (),, "Refreshes the dynamic fields in the inspector.")

View file

@ -3877,8 +3877,6 @@ void WorldEditor::makeSelectionAMesh(const char *filename)
fabMat.inverse();
MatrixF objMat;
SimObject *obj = NULL;
SceneObject *sObj = NULL;
Vector< SceneObject* > objectList;

View file

@ -230,7 +230,6 @@ namespace PlatformNetState
// which are required for LAN queries (PC->Xbox connectivity). The wire protocol still
// uses the VDP packet structure, though.
S32 protocol = IPPROTO_UDP;
bool useVDP = false;
#ifdef TORQUE_DISABLE_PC_CONNECTIVITY
// Xbox uses a VDP (voice/data protocol) socket for networking
protocol = IPPROTO_VDP;
@ -1956,7 +1955,6 @@ void Net::enableMulticast()
if (error == NoError)
{
NetAddress listenAddress;
char listenAddressStr[256];
Net::addressToString(&multicastAddress, listenAddressStr);
Con::printf("Multicast initialized on %s", listenAddressStr);