Content-Length: 233541 | pFad | https://github.com/jpaver/opengametools/pull/47

6B Added asserts to catch saving and loading of a model with zero size by dougbinks · Pull Request #47 · jpaver/opengametools · GitHub
Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added asserts to catch saving and loading of a model with zero size #47

Merged
merged 1 commit into from
Jun 11, 2023

Conversation

dougbinks
Copy link
Collaborator

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.

@jpaver jpaver merged commit f7c760b into jpaver:master Jun 11, 2023
@dougbinks dougbinks deleted the ogt-vox-model-size-asserts branch August 1, 2023 09:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants








ApplySandwichStrip

pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

Fetched URL: https://github.com/jpaver/opengametools/pull/47

Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy