mirror of
https://github.com/overte-org/overte.git
synced 2025-08-06 19:59:28 +02:00
Remove redundant read of octree data on startup
This commit is contained in:
parent
4e230c9e5d
commit
6b159d6124
1 changed files with 5 additions and 2 deletions
|
@ -109,9 +109,12 @@ void OctreePersistThread::handleOctreeDataFileReply(QSharedPointer<ReceivedMessa
|
||||||
bool includesNewData;
|
bool includesNewData;
|
||||||
message->readPrimitive(&includesNewData);
|
message->readPrimitive(&includesNewData);
|
||||||
QByteArray replacementData;
|
QByteArray replacementData;
|
||||||
|
OctreeUtils::RawOctreeData data;
|
||||||
|
bool hasValidOctreeData { false };
|
||||||
if (includesNewData) {
|
if (includesNewData) {
|
||||||
replacementData = message->readAll();
|
replacementData = message->readAll();
|
||||||
replaceData(replacementData);
|
replaceData(replacementData);
|
||||||
|
hasValidOctreeData = data.readOctreeDataInfoFromFile(_filename);
|
||||||
qDebug() << "Got OctreeDataFileReply, new data sent";
|
qDebug() << "Got OctreeDataFileReply, new data sent";
|
||||||
} else {
|
} else {
|
||||||
qDebug() << "Got OctreeDataFileReply, current entity data is sufficient";
|
qDebug() << "Got OctreeDataFileReply, current entity data is sufficient";
|
||||||
|
@ -119,6 +122,7 @@ void OctreePersistThread::handleOctreeDataFileReply(QSharedPointer<ReceivedMessa
|
||||||
OctreeUtils::RawEntityData data;
|
OctreeUtils::RawEntityData data;
|
||||||
qCDebug(octree) << "Reading octree data from" << _filename;
|
qCDebug(octree) << "Reading octree data from" << _filename;
|
||||||
if (data.readOctreeDataInfoFromFile(_filename)) {
|
if (data.readOctreeDataInfoFromFile(_filename)) {
|
||||||
|
hasValidOctreeData = true;
|
||||||
if (data.id.isNull()) {
|
if (data.id.isNull()) {
|
||||||
qCDebug(octree) << "Current octree data has a null id, updating";
|
qCDebug(octree) << "Current octree data has a null id, updating";
|
||||||
data.resetIdAndVersion();
|
data.resetIdAndVersion();
|
||||||
|
@ -138,8 +142,7 @@ void OctreePersistThread::handleOctreeDataFileReply(QSharedPointer<ReceivedMessa
|
||||||
quint64 loadStarted = usecTimestampNow();
|
quint64 loadStarted = usecTimestampNow();
|
||||||
qCDebug(octree) << "loading Octrees from file: " << _filename << "...";
|
qCDebug(octree) << "loading Octrees from file: " << _filename << "...";
|
||||||
|
|
||||||
OctreeUtils::RawOctreeData data;
|
if (hasValidOctreeData) {
|
||||||
if (data.readOctreeDataInfoFromFile(_filename)) {
|
|
||||||
qDebug() << "Setting entity version info to: " << data.id << data.version;
|
qDebug() << "Setting entity version info to: " << data.id << data.version;
|
||||||
_tree->setOctreeVersionInfo(data.id, data.version);
|
_tree->setOctreeVersionInfo(data.id, data.version);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue