mirror of
https://github.com/overte-org/overte.git
synced 2025-08-10 00:36:30 +02:00
Merge pull request #1117 from ZappoMan/bugfixes
removed asserts and replaced with error messages
This commit is contained in:
commit
e57f966ede
1 changed files with 14 additions and 4 deletions
|
@ -1011,9 +1011,16 @@ bool VoxelTree::findCapsulePenetration(const glm::vec3& start, const glm::vec3&
|
||||||
int VoxelTree::encodeTreeBitstream(VoxelNode* node, unsigned char* outputBuffer, int availableBytes, VoxelNodeBag& bag,
|
int VoxelTree::encodeTreeBitstream(VoxelNode* node, unsigned char* outputBuffer, int availableBytes, VoxelNodeBag& bag,
|
||||||
EncodeBitstreamParams& params) {
|
EncodeBitstreamParams& params) {
|
||||||
|
|
||||||
startEncoding(node);
|
|
||||||
// How many bytes have we written so far at this level;
|
// How many bytes have we written so far at this level;
|
||||||
int bytesWritten = 0;
|
int bytesWritten = 0;
|
||||||
|
|
||||||
|
// you can't call this without a valid node
|
||||||
|
if (!node) {
|
||||||
|
qDebug("WARNING! encodeTreeBitstream() called with node=NULL\n");
|
||||||
|
return bytesWritten;
|
||||||
|
}
|
||||||
|
|
||||||
|
startEncoding(node);
|
||||||
|
|
||||||
// If we're at a node that is out of view, then we can return, because no nodes below us will be in view!
|
// If we're at a node that is out of view, then we can return, because no nodes below us will be in view!
|
||||||
if (params.viewFrustum && !node->isInView(*params.viewFrustum)) {
|
if (params.viewFrustum && !node->isInView(*params.viewFrustum)) {
|
||||||
|
@ -1076,12 +1083,15 @@ int VoxelTree::encodeTreeBitstream(VoxelNode* node, unsigned char* outputBuffer,
|
||||||
int VoxelTree::encodeTreeBitstreamRecursion(VoxelNode* node, unsigned char* outputBuffer, int availableBytes, VoxelNodeBag& bag,
|
int VoxelTree::encodeTreeBitstreamRecursion(VoxelNode* node, unsigned char* outputBuffer, int availableBytes, VoxelNodeBag& bag,
|
||||||
EncodeBitstreamParams& params, int& currentEncodeLevel) const {
|
EncodeBitstreamParams& params, int& currentEncodeLevel) const {
|
||||||
|
|
||||||
// you can't call this without a valid node
|
|
||||||
assert(node);
|
|
||||||
|
|
||||||
// How many bytes have we written so far at this level;
|
// How many bytes have we written so far at this level;
|
||||||
int bytesAtThisLevel = 0;
|
int bytesAtThisLevel = 0;
|
||||||
|
|
||||||
|
// you can't call this without a valid node
|
||||||
|
if (!node) {
|
||||||
|
qDebug("WARNING! encodeTreeBitstreamRecursion() called with node=NULL\n");
|
||||||
|
return bytesAtThisLevel;
|
||||||
|
}
|
||||||
|
|
||||||
// Keep track of how deep we've encoded.
|
// Keep track of how deep we've encoded.
|
||||||
currentEncodeLevel++;
|
currentEncodeLevel++;
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue