Implemented function that correctly acquires TextureBatchDescriptors

This commit is contained in:
_
2018-04-04 10:12:29 -07:00
parent 756f28cd41
commit a446dd8741
3 changed files with 39 additions and 33 deletions
+10 -6
View File
@@ -97,17 +97,21 @@ int main(int argc, char ** argv) {
unsigned int bufsize = 0;
char *buffer = loadfile(f, &bufsize);
// unpackpld(buffer, bufsize, f);
struct TexturePack *tp = (struct TexturePack*)malloc
(sizeof(struct TexturePack));
struct TexturePack *tp = NULL;
printf("%d %d %d %d \n", buffer[0],
buffer[1],
buffer[2],
buffer[3]);
gettph(tp, buffer);
printf("%x %x \n", buffer + 0, tp -> id[0]);
tp = (struct TexturePack*)buffer;
struct TextureBatchDescriptor **bds = NULL;
bds = (struct TextureBatchDescriptor**)malloc(tp -> batchNumber);
gettbd(bds, buffer, bufsize);
printtph(tp);
free(tp);
int i;
for (i = 0; i < tp -> batchNumber; i++) {
printtbd(bds[i]);
}
free(bds);
free(buffer);
return 0;
}