mirror of
https://github.com/overte-org/overte.git
synced 2025-08-09 03:37:49 +02:00
don't recompute meshes if nothing changed
This commit is contained in:
parent
f6c440756c
commit
3c35d90908
1 changed files with 12 additions and 4 deletions
|
@ -162,9 +162,13 @@ bool RenderablePolyVoxEntityItem::setVoxel(int x, int y, int z, uint8_t toValue)
|
||||||
|
|
||||||
_volDataLock.lockForWrite();
|
_volDataLock.lockForWrite();
|
||||||
bool result = setVoxelInternal(x, y, z, toValue);
|
bool result = setVoxelInternal(x, y, z, toValue);
|
||||||
_volDataDirty = true;
|
if (result) {
|
||||||
|
_volDataDirty = true;
|
||||||
|
}
|
||||||
_volDataLock.unlock();
|
_volDataLock.unlock();
|
||||||
compressVolumeDataAndSendEditPacket();
|
if (result) {
|
||||||
|
compressVolumeDataAndSendEditPacket();
|
||||||
|
}
|
||||||
|
|
||||||
auto timeSpent = usecTimestampNow() - now;
|
auto timeSpent = usecTimestampNow() - now;
|
||||||
qDebug() << "RenderablePolyVoxEntityItem::setVoxel timeSpent =" << timeSpent;
|
qDebug() << "RenderablePolyVoxEntityItem::setVoxel timeSpent =" << timeSpent;
|
||||||
|
@ -188,7 +192,9 @@ bool RenderablePolyVoxEntityItem::setAll(uint8_t toValue) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
_volDataLock.unlock();
|
_volDataLock.unlock();
|
||||||
compressVolumeDataAndSendEditPacket();
|
if (result) {
|
||||||
|
compressVolumeDataAndSendEditPacket();
|
||||||
|
}
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -227,7 +233,9 @@ bool RenderablePolyVoxEntityItem::setSphereInVolume(glm::vec3 center, float radi
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
_volDataLock.unlock();
|
_volDataLock.unlock();
|
||||||
compressVolumeDataAndSendEditPacket();
|
if (result) {
|
||||||
|
compressVolumeDataAndSendEditPacket();
|
||||||
|
}
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue