Added function that determines size of pld section

This commit is contained in:
2018-04-06 15:48:44 -07:00
parent c9e4e99f1a
commit 0ea47e44c3
3 changed files with 30 additions and 3 deletions

View File

@@ -96,7 +96,12 @@ bool unpackpld(const char *filedata,
struct PldHeader h;
if (filedata != NULL && filesize > 0) {
getpldh(&h, filedata);
printpldh(&h);
}
int size = 0;
unsigned int i = 0;
for (i = 0; i < h.numOffset; i++) {
size = sizeofpldstruct(&h, i, filesize);
printf("%x\n", size);
}
}
@@ -152,8 +157,8 @@ int main(int argc, char ** argv) {
char *f = argv[1];
unsigned int bufsize = 0;
char *buffer = loadfile(f, &bufsize);
// unpackpld(buffer, bufsize, f);
exporttextures(buffer, bufsize, f);
unpackpld(buffer, bufsize, f);
// exporttextures(buffer, bufsize, f);
free(buffer);
return 0;
}