#include #include "../libtxd/txd.h" #include "../libdff/dff.h" #ifndef DFFVIEWER_H #define DFFVIEWER_H #define DIRBLOCKSIZE 2048 typedef struct Model { clump *clp; int texturecount; char **texturefiles; int txdcount; Texture *texlist; GLuint *textures; } Model; typedef struct Objs { int Id; char Model[64]; char Texture[64]; Model *mdl; int ObjCount; float *DrawDist; int Flags; } Objs; typedef struct IPL { int ID; char Name[64]; /* VC & SA */ int interior; float positionv[3]; /* III & VC */ float scalev[3]; float rotation[4]; /* SA */ int lod; } IPL; typedef struct DirEntry { int start; int size; char filename[24]; } DirEntry; typedef struct IdeFile { FILE *Ide; int IsOpen; char Path[64]; } IdeFile; typedef struct TxdFile { FILE *Txd; int IsOpen; char Path[64]; } TxdFile; typedef struct DffFile { FILE *Dff; int IsOpen; char Path[64]; } DffFile; typedef struct IplFile { FILE *Ipl; int IsOpen; char Path[64]; } IplFile; typedef struct ImgFile { FILE *Img; int IsOpen; char DirPath[64]; char ImgPath[64]; } ImgFile; int TxdToOglTex(int start, FILE *txd, Texture **texlist); void GetTextures(clump *clp, char ***texturefiles); int GetTextureIndex(char **imagefiles, char *filename); int ReadDir(FILE *dir, DirEntry **filelist); DirEntry *GetFileOffset(int entries, DirEntry *filelist, char *filename); Objs *ReadIde(FILE *file); Model *LoadModel(char *dfffile, char *txdfile, FILE **img, int arnum); void DestroyModel(Model *mdl); void DestroyObjs(Objs *objs); void exitprog(int sig); void InitOGL(int argc, char *argv[]); void ToUpperLine(char *in); DirEntry **filelist; int *filenum; int archivenum; FILE *logfile; FILE *ide; FILE **dir, **img; FILE *generic; int UseTextures; Objs *objs; int objscount; char GtaPath[512]; char DatPath[512]; /* Contents of the main dat file */ int IdeCount; IdeFile *Ide; int TxdCount; TxdFile *Txd; int DffCount; DffFile *Dff; int IplCount; IplFile *Ipl; int ImgCount; ImgFile *Img; #endif