mirror of
https://github.com/overte-org/overte.git
synced 2025-08-06 18:50:00 +02:00
Merge branch 'master' of https://github.com/highfidelity/hifi into hdr
This commit is contained in:
commit
846c5a7b9a
4 changed files with 33 additions and 8 deletions
|
@ -56,7 +56,7 @@ void AssetServer::run() {
|
||||||
if (!_resourcesDirectory.exists()) {
|
if (!_resourcesDirectory.exists()) {
|
||||||
qDebug() << "Asset resources directory not found, searching for existing asset resources";
|
qDebug() << "Asset resources directory not found, searching for existing asset resources";
|
||||||
QString oldDataDirectory = QCoreApplication::applicationDirPath();
|
QString oldDataDirectory = QCoreApplication::applicationDirPath();
|
||||||
auto oldResourcesDirectory = QDir(oldDataDirectory).filePath(RESOURCES_PATH);
|
auto oldResourcesDirectory = QDir(oldDataDirectory).filePath("resources/" + RESOURCES_PATH);
|
||||||
|
|
||||||
if (QDir(oldResourcesDirectory).exists()) {
|
if (QDir(oldResourcesDirectory).exists()) {
|
||||||
qDebug() << "Existing assets found in " << oldResourcesDirectory << ", copying to " << _resourcesDirectory;
|
qDebug() << "Existing assets found in " << oldResourcesDirectory << ", copying to " << _resourcesDirectory;
|
||||||
|
|
|
@ -1145,13 +1145,35 @@ void OctreeServer::domainSettingsRequestComplete() {
|
||||||
if (_wantPersist) {
|
if (_wantPersist) {
|
||||||
// If persist filename does not exist, let's see if there is one beside the application binary
|
// If persist filename does not exist, let's see if there is one beside the application binary
|
||||||
// If there is, let's copy it over to our target persist directory
|
// If there is, let's copy it over to our target persist directory
|
||||||
QString oldResourcesDirectory = QCoreApplication::applicationDirPath();
|
|
||||||
auto oldPersistPath = QDir(oldResourcesDirectory).absoluteFilePath(_persistFilename);
|
|
||||||
auto persistPath = ServerPathUtils::getDataFilePath("entities/" + QString(_persistFilename));
|
auto persistPath = ServerPathUtils::getDataFilePath("entities/" + QString(_persistFilename));
|
||||||
if (oldPersistPath != persistPath && !QFile::exists(persistPath)) {
|
if (!QFile::exists(persistPath)) {
|
||||||
qDebug() << "Persist file does not exist, checking for existence of persist file next to application";
|
qDebug() << "Persist file does not exist, checking for existence of persist file next to application";
|
||||||
|
|
||||||
|
static const QString OLD_DEFAULT_PERSIST_FILENAME = "resources/models.json.gz";
|
||||||
|
QString oldResourcesDirectory = QCoreApplication::applicationDirPath();
|
||||||
|
|
||||||
|
// This is the old persist path, based on the current persist filename, which could
|
||||||
|
// be a custom filename set by the user.
|
||||||
|
auto oldPersistPath = QDir(oldResourcesDirectory).absoluteFilePath(_persistFilename);
|
||||||
|
|
||||||
|
// This is the old default persist path.
|
||||||
|
auto oldDefaultPersistPath = QDir(oldResourcesDirectory).absoluteFilePath(OLD_DEFAULT_PERSIST_FILENAME);
|
||||||
|
|
||||||
|
qDebug() << "Checking for existing persist file at " << oldPersistPath << " and " << oldDefaultPersistPath;
|
||||||
|
|
||||||
|
QString pathToCopyFrom;
|
||||||
|
bool shouldCopy = false;
|
||||||
|
|
||||||
if (QFile::exists(oldPersistPath)) {
|
if (QFile::exists(oldPersistPath)) {
|
||||||
qDebug() << "Old persist file found, copying from " << oldPersistPath << " to " << persistPath;
|
shouldCopy = true;
|
||||||
|
pathToCopyFrom = oldPersistPath;
|
||||||
|
} else if (QFile::exists(oldDefaultPersistPath)) {
|
||||||
|
shouldCopy = true;
|
||||||
|
pathToCopyFrom = oldDefaultPersistPath;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (shouldCopy) {
|
||||||
|
qDebug() << "Old persist file found, copying from " << pathToCopyFrom << " to " << persistPath;
|
||||||
|
|
||||||
QDir persistFileDirectory = QDir(persistPath).filePath("..");
|
QDir persistFileDirectory = QDir(persistPath).filePath("..");
|
||||||
|
|
||||||
|
@ -1159,7 +1181,7 @@ void OctreeServer::domainSettingsRequestComplete() {
|
||||||
qDebug() << "Creating data directory " << persistFileDirectory.path();
|
qDebug() << "Creating data directory " << persistFileDirectory.path();
|
||||||
persistFileDirectory.mkpath(".");
|
persistFileDirectory.mkpath(".");
|
||||||
}
|
}
|
||||||
QFile::copy(oldPersistPath, persistPath);
|
QFile::copy(pathToCopyFrom, persistPath);
|
||||||
} else {
|
} else {
|
||||||
qDebug() << "No existing persist file found";
|
qDebug() << "No existing persist file found";
|
||||||
}
|
}
|
||||||
|
|
|
@ -142,6 +142,7 @@ void PhysicalEntitySimulation::clearEntitiesInternal() {
|
||||||
// finally clear all lists maintained by this class
|
// finally clear all lists maintained by this class
|
||||||
_physicalObjects.clear();
|
_physicalObjects.clear();
|
||||||
_entitiesToRemoveFromPhysics.clear();
|
_entitiesToRemoveFromPhysics.clear();
|
||||||
|
_entitiesToRelease.clear();
|
||||||
_entitiesToAddToPhysics.clear();
|
_entitiesToAddToPhysics.clear();
|
||||||
_pendingChanges.clear();
|
_pendingChanges.clear();
|
||||||
_outgoingChanges.clear();
|
_outgoingChanges.clear();
|
||||||
|
@ -157,6 +158,7 @@ void PhysicalEntitySimulation::prepareEntityForDelete(EntityItemPointer entity)
|
||||||
// end EntitySimulation overrides
|
// end EntitySimulation overrides
|
||||||
|
|
||||||
void PhysicalEntitySimulation::getObjectsToRemoveFromPhysics(VectorOfMotionStates& result) {
|
void PhysicalEntitySimulation::getObjectsToRemoveFromPhysics(VectorOfMotionStates& result) {
|
||||||
|
_entitiesToRelease.clear();
|
||||||
result.clear();
|
result.clear();
|
||||||
QMutexLocker lock(&_mutex);
|
QMutexLocker lock(&_mutex);
|
||||||
for (auto entity: _entitiesToRemoveFromPhysics) {
|
for (auto entity: _entitiesToRemoveFromPhysics) {
|
||||||
|
@ -171,7 +173,7 @@ void PhysicalEntitySimulation::getObjectsToRemoveFromPhysics(VectorOfMotionState
|
||||||
_entitiesToDelete.insert(entity);
|
_entitiesToDelete.insert(entity);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
_entitiesToRemoveFromPhysics.clear();
|
_entitiesToRemoveFromPhysics.swap(_entitiesToRelease);
|
||||||
}
|
}
|
||||||
|
|
||||||
void PhysicalEntitySimulation::getObjectsToAddToPhysics(VectorOfMotionStates& result) {
|
void PhysicalEntitySimulation::getObjectsToAddToPhysics(VectorOfMotionStates& result) {
|
||||||
|
|
|
@ -60,6 +60,7 @@ public:
|
||||||
|
|
||||||
private:
|
private:
|
||||||
SetOfEntities _entitiesToRemoveFromPhysics;
|
SetOfEntities _entitiesToRemoveFromPhysics;
|
||||||
|
SetOfEntities _entitiesToRelease;
|
||||||
SetOfEntities _entitiesToAddToPhysics;
|
SetOfEntities _entitiesToAddToPhysics;
|
||||||
|
|
||||||
SetOfEntityMotionStates _pendingChanges; // EntityMotionStates already in PhysicsEngine that need their physics changed
|
SetOfEntityMotionStates _pendingChanges; // EntityMotionStates already in PhysicsEngine that need their physics changed
|
||||||
|
@ -70,7 +71,7 @@ private:
|
||||||
PhysicsEnginePointer _physicsEngine = nullptr;
|
PhysicsEnginePointer _physicsEngine = nullptr;
|
||||||
EntityEditPacketSender* _entityPacketSender = nullptr;
|
EntityEditPacketSender* _entityPacketSender = nullptr;
|
||||||
|
|
||||||
uint32_t _lastStepSendPackets = 0;
|
uint32_t _lastStepSendPackets { 0 };
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue