home *** CD-ROM | disk | FTP | other *** search
/ PC World Komputer 1996 December / PCWKCD1296.iso / sharewar / quake106 / utils / common / wadlib.h < prev   
Encoding:
C/C++ Source or Header  |  1996-09-12  |  1.0 KB  |  54 lines

  1. // wadlib.h
  2.  
  3. //
  4. // wad reading
  5. //
  6.  
  7. #define    CMP_NONE        0
  8. #define    CMP_LZSS        1
  9.  
  10. #define    TYP_NONE        0
  11. #define    TYP_LABEL        1
  12. #define    TYP_LUMPY        64                // 64 + grab command number
  13.  
  14. typedef struct
  15. {
  16.     char        identification[4];        // should be WAD2 or 2DAW
  17.     int            numlumps;
  18.     int            infotableofs;
  19. } wadinfo_t;
  20.  
  21.  
  22. typedef struct
  23. {
  24.     int            filepos;
  25.     int            disksize;
  26.     int            size;                    // uncompressed
  27.     char        type;
  28.     char        compression;
  29.     char        pad1, pad2;
  30.     char        name[16];                // must be null terminated
  31. } lumpinfo_t;
  32.  
  33. extern    lumpinfo_t        *lumpinfo;        // location of each lump on disk
  34. extern    int                numlumps;
  35. extern    wadinfo_t        header;
  36.  
  37. void    W_OpenWad (char *filename);
  38. int        W_CheckNumForName (char *name);
  39. int        W_GetNumForName (char *name);
  40. int        W_LumpLength (int lump);
  41. void    W_ReadLumpNum (int lump, void *dest);
  42. void    *W_LoadLumpNum (int lump);
  43. void    *W_LoadLumpName (char *name);
  44.  
  45. void CleanupName (char *in, char *out);
  46.  
  47. //
  48. // wad creation
  49. //
  50. void    NewWad (char *pathname, qboolean bigendien);
  51. void    AddLump (char *name, void *buffer, int length, int type, int compress);
  52. void    WriteWad (void);
  53.  
  54.