Closed cwfitzgerald closed 4 years ago
All changes should be addressed :)
Are the commits buildable independently? Otherwise we'll squash it (no bors here)
I think they all build. I don't recall running tests on all of them but I only committed once I got things working.
Resolves #11.
This PR removes all instances of panics where the user didn't ask for a panic. I've tested the tests and against my codebase using it, and everything seems still in order.
Notable changes
ObjError
,MtlError
, andMtlMissingType
Obj::{parse_vertex, parse_texture, parse_normal}
to return their output instead of modifying state. Combined them intoparse_two
andparse_three
to reduce duplicate code.Obj::load_single_mtl
to make error handling more concise and remove duplicate code.Breaking Changes:
ObjError
orMtlError
instead of aio::Error
ObjError
norMtlError
implementDisplay
. Should they?Now that I've dug a bit into the codebase, there are a couple of improvements I still want to make. Feel free to comment on any of them 😄. Vaguely in order of importance:
Obj::load_mtl_fn
that takes a function which takes the base directory and the mtllib name and returns something thatimpl Read
. This will allow special file lookup or file loading if need be.Obj::load_mtl
will just callObj::load_mtl_fn
with a function that uses how it currently resolves now. Will file an issue about this tmmr.