thisistherk / fast_obj

Fast C OBJ parser
MIT License
632 stars 48 forks source link

Virtual filesystem support #23

Closed BeastLe9enD closed 3 years ago

BeastLe9enD commented 3 years ago

Extended fast_obj_read_with_callbacks function to load from virtual file systems :)

thisistherk commented 3 years ago

Awesome - thanks! Few little nits:

clang -Wall -Wextra fast_obj.c if your on Mac/Linux should point most of them out :)

BeastLe9enD commented 3 years ago

Ok, fixed it, also noticed that there is a warning with fopen on Windows which forces you to use Windows-specific fopen_s. Fixed it through _CRT_SECURE_NO_WARNINGS, hope thats ok !:)

thisistherk commented 3 years ago

Thanks! Couple of further tiny things, sorry! Think we should probably not define _CRT_SECURE_NO_WARNINGS. Generally I think we should write code to avoid warnings where possible, but we probably shouldn't actually turn warnings off - leave that up to the user :)

Also need to tweak the unused var stuff a tiny bit. The variable declarations need to go at the top to work with C89 - so like:

{
    FILE* f;
    (void)(user_data);
BeastLe9enD commented 3 years ago

its fine!:) Incidentally, did not know that the variables must first be declared in C89

thisistherk commented 3 years ago

Brilliant - thanks!