Implemented correct initialization of batch and positions array

This commit is contained in:
_
2018-04-07 19:37:43 -07:00
parent cc31734e44
commit fb962d2ffe
3 changed files with 61 additions and 4 deletions

View File

@@ -105,7 +105,7 @@ void exporttextures(const char *filedata,
return;
}
void extractmeshes(const char* filedata,
void extractmeshes(const char *filedata,
unsigned int filesize,
const char *filename) {
if (filedata == NULL || filesize <= 0) {
@@ -113,12 +113,15 @@ void extractmeshes(const char* filedata,
}
struct Header *h = (struct Header*)filedata;
struct MeshHeader *mh = NULL;
struct Batch *b = NULL;
unsigned int i;
bool ok;
for (i = 0; i < h -> numMesh; i++) {
//h -> numMesh
for (i = 0; i < 3; i++) {
ok = getmeshheader(&mh, i, filedata);
if (ok) {
printmeshheader(mh);
getmeshbatch(&b, mh, filedata);
printmeshbatch(b);
}
}
}