Added asserts to catch saving and loading of a model with zero size #47
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Currently ogt_vox.h will assert on loading a model with 0 size when reading the
CHUNK_ID_XYZI
at line:1320
ogt_assert(size_x && size_y && size_z, "expected a SIZE chunk before XYZI chunk");
https://github.com/jpaver/opengametools/blob/master/src/ogt_vox.h#L1320
This can be a little confusing, as the actual error can be due to the model having zero size. In addition I discovered this by saving out a .vox file with a model of zero size, so here I have also added an assert for this case in the write code.
Whilst MV appears to handle loading a 0 size model you can't create one using it's UI, so it's likely still good practice to assert on this.