limit size of polyvox data property to below MTU

This commit is contained in:
Seth Alves 2015-05-27 09:48:32 -07:00
parent 3af916e27e
commit 429cc631f3
2 changed files with 9 additions and 3 deletions

View file

@ -39,3 +39,5 @@ function keyReleaseEvent(event) {
Controller.mousePressEvent.connect(mousePressEvent);
Controller.keyPressEvent.connect(keyPressEvent);
Controller.keyReleaseEvent.connect(keyReleaseEvent);

View file

@ -289,8 +289,12 @@ void RenderablePolyVoxEntityItem::compressVolumeData() {
}
}
_voxelData = qCompress(uncompressedData, 9);
qDebug() << "-------------- voxel compresss ------------------------------------------------------------";
QByteArray newVoxelData = qCompress(uncompressedData, 9);
// HACK -- until we have a way to allow for properties larger than MTU, don't update.
if (newVoxelData.length() < 1300) {
_voxelData = newVoxelData;
}
qDebug() << "-------------- voxel compresss --------------";
qDebug() << "raw-size =" << rawSize << " compressed-size =" << _voxelData.size();
}
@ -312,6 +316,6 @@ void RenderablePolyVoxEntityItem::decompressVolumeData() {
_needsModelReload = true;
qDebug() << "--------------- voxel decompress -----------------------------------------------------------";
qDebug() << "--------------- voxel decompress ---------------";
qDebug() << "raw-size =" << rawSize << " compressed-size =" << _voxelData.size();
}