From e9ed8fc5f9219b0b8be09dbceddbe9ca3de78017 Mon Sep 17 00:00:00 2001 From: Alexander M Pickering Date: Sun, 7 Aug 2022 23:23:14 -0500 Subject: API update to tinyobj Update to tinyobj makes minor changes to the API --- src/shared/lua_api/phys/bphysmodel.cpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'src/shared/lua_api/phys/bphysmodel.cpp') diff --git a/src/shared/lua_api/phys/bphysmodel.cpp b/src/shared/lua_api/phys/bphysmodel.cpp index d4a689a..e5a9949 100644 --- a/src/shared/lua_api/phys/bphysmodel.cpp +++ b/src/shared/lua_api/phys/bphysmodel.cpp @@ -28,7 +28,7 @@ extern std::list Objects; //btTriangleMesh *trimesh = new btTriangleMesh(); //} -static void get_file_data(const char* filename, int is_mtl, const char *obj_filename, char **data, size_t *len){ +static void get_file_data(void* ctx, const char* filename, int is_mtl, const char *obj_filename, char **data, size_t *len){ FILE *objfile = fopen(filename,"rb"); fseek(objfile,0,SEEK_END); *len = (size_t)ftell(objfile); @@ -77,7 +77,13 @@ void makebphysmodel(lua_State *L){ fread(objdata, sizeof(char), data_len, objfile); fclose(objfile); //printf("About to tinyobj_parse_obj\n"); - int err = tinyobj_parse_obj(&attrib, &shapes, &meshcount, &materials, &num_materials, ppath, get_file_data, TINYOBJ_FLAG_TRIANGULATE); + int err = tinyobj_parse_obj( + &attrib, &shapes, + &meshcount, &materials, + &num_materials, ppath, + get_file_data, (void*)NULL, + TINYOBJ_FLAG_TRIANGULATE + ); //printf("Finished parsing tinyobj\n"); if(err != TINYOBJ_SUCCESS){ printf("Tinyobj failed to load model:%s\n",ppath); -- cgit v1.2.3-70-g09d2