#include #include "functions.h" //short comp_vert[4] = { 0 }; /* contains compressed vertex */ int main(int argc, char *argv[]) { FILE *dff; int currentint; /* the current 4 bytes in file */ int i; float vertex; dff = fopen(argv[1], "r"); if(dff == NULL) { printf("Error: Could not open file %s\n", argv[1]); return 1; } currentint = getint(dff); printf("%X: Just leave it at 4\n", currentint); currentint = getint(dff); printf("%X: The block's size\n", currentint); currentint = getint(dff); printf("%X ", currentint); currentint = getint(dff); printf("%X: Unknown\n", currentint); currentint = getint(dff); printf("%X: Unknown data multiplier, multiply with 16 and subtract 8 to get offset of vertex section\n", currentint); fseek(dff, currentint*16-8, SEEK_CUR); /* skip the unknown block */ printf("%X", ftell(dff)); vertex = getword(dff)/128; printf("%f", vertex); for(i = 0; i <= 100; i++) { vertex = getword(dff)/128; printf("%f, ", vertex); vertex = getword(dff)/128; printf("%f, ", vertex); vertex = getword(dff)/128; printf("%f\n", vertex); fseek(dff, 0x08, SEEK_CUR); } fclose(dff); return 0; }