From 5629cf425ec5bb0b464ad8b3fed9908a1aecdad8 Mon Sep 17 00:00:00 2001 From: samcake Date: Wed, 5 Apr 2017 13:49:07 -0700 Subject: [PATCH] Cleaning up the files updated --- libraries/physics/src/PhysicalEntitySimulation.cpp | 14 +++++++------- libraries/physics/src/PhysicalEntitySimulation.h | 2 +- libraries/render/src/render/Scene.cpp | 12 ++++++------ libraries/render/src/render/Scene.h | 2 +- libraries/shared/src/SettingManager.cpp | 12 ++++++------ libraries/shared/src/SettingManager.h | 2 +- 6 files changed, 22 insertions(+), 22 deletions(-) diff --git a/libraries/physics/src/PhysicalEntitySimulation.cpp b/libraries/physics/src/PhysicalEntitySimulation.cpp index 72b0ef5623..6f5b474810 100644 --- a/libraries/physics/src/PhysicalEntitySimulation.cpp +++ b/libraries/physics/src/PhysicalEntitySimulation.cpp @@ -96,7 +96,7 @@ void PhysicalEntitySimulation::changeEntityInternal(EntityItemPointer entity) { if (motionState) { if (!entity->shouldBePhysical()) { // the entity should be removed from the physical simulation - _transaction.remove(motionState); + _pendingChanges.remove(motionState); _physicalObjects.remove(motionState); _outgoingChanges.remove(motionState); _entitiesToRemoveFromPhysics.insert(entity); @@ -104,7 +104,7 @@ void PhysicalEntitySimulation::changeEntityInternal(EntityItemPointer entity) { _simpleKinematicEntities.insert(entity); } } else { - _transaction.insert(motionState); + _pendingChanges.insert(motionState); } } else if (entity->shouldBePhysical()) { // The intent is for this object to be in the PhysicsEngine, but it has no MotionState yet. @@ -148,7 +148,7 @@ void PhysicalEntitySimulation::clearEntitiesInternal() { _entitiesToRemoveFromPhysics.clear(); _entitiesToRelease.clear(); _entitiesToAddToPhysics.clear(); - _transaction.clear(); + _pendingChanges.clear(); _outgoingChanges.clear(); } @@ -170,7 +170,7 @@ void PhysicalEntitySimulation::getObjectsToRemoveFromPhysics(VectorOfMotionState EntityMotionState* motionState = static_cast(entity->getPhysicsInfo()); if (motionState) { - _transaction.remove(motionState); + _pendingChanges.remove(motionState); _outgoingChanges.remove(motionState); _physicalObjects.remove(motionState); result.push_back(motionState); @@ -246,18 +246,18 @@ void PhysicalEntitySimulation::getObjectsToAddToPhysics(VectorOfMotionStates& re void PhysicalEntitySimulation::setObjectsToChange(const VectorOfMotionStates& objectsToChange) { QMutexLocker lock(&_mutex); for (auto object : objectsToChange) { - _transaction.insert(static_cast(object)); + _pendingChanges.insert(static_cast(object)); } } void PhysicalEntitySimulation::getObjectsToChange(VectorOfMotionStates& result) { result.clear(); QMutexLocker lock(&_mutex); - for (auto stateItr : _transaction) { + for (auto stateItr : _pendingChanges) { EntityMotionState* motionState = &(*stateItr); result.push_back(motionState); } - _transaction.clear(); + _pendingChanges.clear(); } void PhysicalEntitySimulation::handleDeactivatedMotionStates(const VectorOfMotionStates& motionStates) { diff --git a/libraries/physics/src/PhysicalEntitySimulation.h b/libraries/physics/src/PhysicalEntitySimulation.h index c12f9316fc..5f6185add3 100644 --- a/libraries/physics/src/PhysicalEntitySimulation.h +++ b/libraries/physics/src/PhysicalEntitySimulation.h @@ -67,7 +67,7 @@ private: SetOfEntities _entitiesToRelease; SetOfEntities _entitiesToAddToPhysics; - SetOfEntityMotionStates _transaction; // EntityMotionStates already in PhysicsEngine that need their physics changed + SetOfEntityMotionStates _pendingChanges; // EntityMotionStates already in PhysicsEngine that need their physics changed SetOfEntityMotionStates _outgoingChanges; // EntityMotionStates for which we may need to send updates to entity-server SetOfMotionStates _physicalObjects; // MotionStates of entities in PhysicsEngine diff --git a/libraries/render/src/render/Scene.cpp b/libraries/render/src/render/Scene.cpp index 45685a9407..537d8c1337 100644 --- a/libraries/render/src/render/Scene.cpp +++ b/libraries/render/src/render/Scene.cpp @@ -35,12 +35,12 @@ void Transaction::updateItem(ItemID id, const UpdateFunctorPointer& functor) { _updateFunctors.push_back(functor); } -void Transaction::merge(const Transaction& change) { - _resetItems.insert(_resetItems.end(), change._resetItems.begin(), change._resetItems.end()); - _resetPayloads.insert(_resetPayloads.end(), change._resetPayloads.begin(), change._resetPayloads.end()); - _removedItems.insert(_removedItems.end(), change._removedItems.begin(), change._removedItems.end()); - _updatedItems.insert(_updatedItems.end(), change._updatedItems.begin(), change._updatedItems.end()); - _updateFunctors.insert(_updateFunctors.end(), change._updateFunctors.begin(), change._updateFunctors.end()); +void Transaction::merge(const Transaction& transaction) { + _resetItems.insert(_resetItems.end(), transaction._resetItems.begin(), transaction._resetItems.end()); + _resetPayloads.insert(_resetPayloads.end(), transaction._resetPayloads.begin(), transaction._resetPayloads.end()); + _removedItems.insert(_removedItems.end(), transaction._removedItems.begin(), transaction._removedItems.end()); + _updatedItems.insert(_updatedItems.end(), transaction._updatedItems.begin(), transaction._updatedItems.end()); + _updateFunctors.insert(_updateFunctors.end(), transaction._updateFunctors.begin(), transaction._updateFunctors.end()); } Scene::Scene(glm::vec3 origin, float size) : diff --git a/libraries/render/src/render/Scene.h b/libraries/render/src/render/Scene.h index d277f50650..dcbd87b74a 100644 --- a/libraries/render/src/render/Scene.h +++ b/libraries/render/src/render/Scene.h @@ -34,7 +34,7 @@ public: void updateItem(ItemID id, const UpdateFunctorPointer& functor); void updateItem(ItemID id) { updateItem(id, nullptr); } - void merge(const Transaction& change); + void merge(const Transaction& transaction); ItemIDs _resetItems; Payloads _resetPayloads; diff --git a/libraries/shared/src/SettingManager.cpp b/libraries/shared/src/SettingManager.cpp index 6acd758ad7..6c246d4cea 100644 --- a/libraries/shared/src/SettingManager.cpp +++ b/libraries/shared/src/SettingManager.cpp @@ -53,8 +53,8 @@ namespace Setting { const auto& key = handle->getKey(); withWriteLock([&] { QVariant loadedValue; - if (_transaction.contains(key) && _transaction[key] != UNSET_VALUE) { - loadedValue = _transaction[key]; + if (_pendingChanges.contains(key) && _pendingChanges[key] != UNSET_VALUE) { + loadedValue = _pendingChanges[key]; } else { loadedValue = value(key); } @@ -73,7 +73,7 @@ namespace Setting { } withWriteLock([&] { - _transaction[key] = handleValue; + _pendingChanges[key] = handleValue; }); } @@ -98,8 +98,8 @@ namespace Setting { void Manager::saveAll() { bool forceSync = false; withWriteLock([&] { - for (auto key : _transaction.keys()) { - auto newValue = _transaction[key]; + for (auto key : _pendingChanges.keys()) { + auto newValue = _pendingChanges[key]; auto savedValue = value(key, UNSET_VALUE); if (newValue == savedValue) { continue; @@ -112,7 +112,7 @@ namespace Setting { setValue(key, newValue); } } - _transaction.clear(); + _pendingChanges.clear(); }); if (forceSync) { diff --git a/libraries/shared/src/SettingManager.h b/libraries/shared/src/SettingManager.h index 507e11edaa..ffdd4ba42a 100644 --- a/libraries/shared/src/SettingManager.h +++ b/libraries/shared/src/SettingManager.h @@ -47,7 +47,7 @@ namespace Setting { QHash _handles; QPointer _saveTimer = nullptr; const QVariant UNSET_VALUE { QUuid::createUuid() }; - QHash _transaction; + QHash _pendingChanges; friend class Interface; friend void cleanupPrivateInstance();