Moved out for loop & fixed getting mesh headers

This commit is contained in:
2018-04-07 04:39:16 -07:00
parent 0e5c96b83b
commit 8016deae86
3 changed files with 52 additions and 10 deletions

View File

@@ -111,17 +111,15 @@ void extractmeshes(const char* filedata,
if (filedata == NULL || filesize <= 0) {
return;
}
struct Header *h = NULL;
h = (struct Header*)filedata;
printf("pointer %x\n", h);
printgheader(h);
struct MeshHeader **mh = NULL;
mh = (struct MeshHeader**)
malloc(sizeof(struct MeshHeader*) * h -> numMesh);
getmeshheaders(mh, filedata, filesize);
struct Header *h = (struct Header*)filedata;
struct MeshHeader *mh = NULL;
unsigned int i;
bool ok;
for (i = 0; i < h -> numMesh; i++) {
printf("returning %x \n", mh[i]);
ok = getmeshheader(&mh, i, filedata);
if (ok) {
printmeshheader(mh);
}
}
}