mirror of
https://notabug.org/scuti/lib3ddevil1
synced 2025-05-31 14:11:42 +05:30
Added texture pack headers correctly read in
This commit is contained in:
19
test/main.c
19
test/main.c
@@ -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;
|
||||
}
|
||||
|
Reference in New Issue
Block a user