jpaver / opengametools

A set of open c++ game development tools that are lightweight, easy-to-integrate and free to use. Currently hosting a magicavoxel .vox full scene loader.
MIT License
375 stars 36 forks source link

ogt_vox: Order of input models is changes on save/load #21

Closed mgerhardy closed 2 years ago

mgerhardy commented 2 years ago

The order of models that I hand over to ogt_vox_write_scene is changed in ogt_vox_read_scene. It would be nice if I could disable this feature with a flag.

mgerhardy commented 2 years ago

Linking the issue from my project: https://github.com/mgerhardy/vengi/issues/113

I wonder whether it's related to the qsort not being stable and the model_index not being unique?

jpaver commented 2 years ago

Thanks for filing the issue. Can you confirm that with the qsort removed that you get the expected behavior? If so, I'd just be inclined to remove that. Otherwise, I will have to investigate deeper when I get a bit of time.

mgerhardy commented 2 years ago

Yes, without the qsort it works fine for me.

jpaver commented 2 years ago

Great, in that case I think we should just remove the sort. Callers can always do this step themselves if they require it.

jpaver commented 2 years ago

Closing as this has been addressed with this commit: https://github.com/jpaver/opengametools/commit/1eb03035e95ae9405a21d214dac747921d965ec4