Added texture pack headers correctly read in

This commit is contained in:
_
2018-04-04 01:36:28 -07:00
parent a188a19d77
commit 756f28cd41
4 changed files with 125 additions and 3 deletions

View File

@@ -1,9 +1,11 @@
#include "devil1pld.h"
#include <stdbool.h>
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include "devil1pld.h"
#include "devil1tex.h"
bool writedata(const char *basename,
unsigned int id,
const char *data,
@@ -88,11 +90,24 @@ bool unpackpld (const char *filedata,
return status;
}
int main(int argc, char ** argv) {
char *f = argv[1];
unsigned int bufsize = 0;
char *buffer = loadfile(f, &bufsize);
unpackpld(buffer, bufsize, f);
// unpackpld(buffer, bufsize, f);
struct TexturePack *tp = (struct TexturePack*)malloc
(sizeof(struct TexturePack));
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]);
printtph(tp);
free(tp);
free(buffer);
return 0;
}