mirror of
https://github.com/overte-org/overte.git
synced 2025-08-04 01:23:38 +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();
|
||||
bool result = setVoxelInternal(x, y, z, toValue);
|
||||
_volDataDirty = true;
|
||||
if (result) {
|
||||
_volDataDirty = true;
|
||||
}
|
||||
_volDataLock.unlock();
|
||||
compressVolumeDataAndSendEditPacket();
|
||||
if (result) {
|
||||
compressVolumeDataAndSendEditPacket();
|
||||
}
|
||||
|
||||
auto timeSpent = usecTimestampNow() - now;
|
||||
qDebug() << "RenderablePolyVoxEntityItem::setVoxel timeSpent =" << timeSpent;
|
||||
|
@ -188,7 +192,9 @@ bool RenderablePolyVoxEntityItem::setAll(uint8_t toValue) {
|
|||
}
|
||||
}
|
||||
_volDataLock.unlock();
|
||||
compressVolumeDataAndSendEditPacket();
|
||||
if (result) {
|
||||
compressVolumeDataAndSendEditPacket();
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
|
@ -227,7 +233,9 @@ bool RenderablePolyVoxEntityItem::setSphereInVolume(glm::vec3 center, float radi
|
|||
}
|
||||
}
|
||||
_volDataLock.unlock();
|
||||
compressVolumeDataAndSendEditPacket();
|
||||
if (result) {
|
||||
compressVolumeDataAndSendEditPacket();
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue