home *** CD-ROM | disk | FTP | other *** search
/ Instant Doom Levels / Instant.Doom.Levels.-.Level.Master.II.iso / EDITORS / ZIPPED / WSCDEU52.ZIP / INCLUDE / WADS.H < prev    next >
C/C++ Source or Header  |  1995-03-05  |  4KB  |  108 lines

  1. /*----------------------------------------------------------------------------*
  2.  | This file is part of WinDEU, the port of DEU to Windows.                   |
  3.  | WinDEU was created by the DEU team:                                        |
  4.  |  Renaud Paquay, Raphael Quinet, Brendon Wyber and others...                |
  5.  |                                                                            |
  6.  | DEU is an open project: if you think that you can contribute, please join  |
  7.  | the DEU team.  You will be credited for any code (or ideas) included in    |
  8.  | the next version of the program.                                           |
  9.  |                                                                            |
  10.  | If you want to make any modifications and re-distribute them on your own,  |
  11.  | you must follow the conditions of the WinDEU license. Read the file        |
  12.  | LICENSE or README.TXT in the top directory.  If do not  have a copy of     |
  13.  | these files, you can request them from any member of the DEU team, or by   |
  14.  | mail: Raphael Quinet, Rue des Martyrs 9, B-4550 Nandrin (Belgium).         |
  15.  |                                                                            |
  16.  | This program comes with absolutely no warranty.  Use it at your own risks! |
  17.  *----------------------------------------------------------------------------*
  18.  
  19.     Project WinDEU
  20.     DEU team
  21.     Jul-Dec 1994, Jan-Mar 1995
  22.  
  23.     FILE:         wads.h
  24. */
  25. #ifndef __wads_h
  26. #define __wads_h
  27.  
  28. #ifndef __common_h
  29.     #include "common.h"
  30. #endif
  31.  
  32. /*
  33.    the directory structure is the structre used by DOOM to order the
  34.    data in it's WAD files
  35. */
  36.  
  37. typedef struct Directory *DirPtr;
  38. struct Directory
  39. {
  40.    LONG start;      /* offset to start of data */
  41.    LONG size;       /* byte size of data */
  42.    char name[8];    /* name of data block */
  43. };
  44.  
  45.  
  46.  
  47. /*
  48.    The wad file pointer structure is used for holding the information
  49.    on the wad files in a linked list.
  50.  
  51.    The first wad file is the main wad file. The rest are patches.
  52. */
  53.  
  54. typedef struct WadFileInfo *WadPtr;
  55. struct WadFileInfo
  56. {
  57.    WadPtr next;         /* next file in linked list */
  58.    char *filename;      /* name of the wad file */
  59.    FILE *fileinfo;      /* C file stream information */
  60.    char type[4];        /* type of wad file (IWAD or PWAD) */
  61.    LONG dirsize;        /* directory size of WAD */
  62.    LONG dirstart;       /* offset to start of directory */
  63.    DirPtr directory;    /* array of directory information */
  64. };
  65.  
  66.  
  67.  
  68. /*
  69.    the master directory structure is used to build a complete directory
  70.    of all the data blocks from all the various wad files
  71. */
  72.  
  73. typedef struct MasterDirectory *MDirPtr;
  74. struct MasterDirectory
  75. {
  76.    MDirPtr   next;            /* next in list */
  77.    WadPtr    wadfile;          /* file of origin */
  78.    Directory dir;            /* directory data */
  79. };
  80.  
  81.  
  82.  
  83. /* from wads.cpp */
  84. extern WadPtr  WadFileList; /* list of wad files */
  85. extern MDirPtr MasterDir;   /* the master directory */
  86.  
  87.  
  88. /* from wads.c */
  89. void OpenMainWad (char *);
  90. void OpenPatchWad (char *);
  91. void CloseWadFiles (void);
  92. void CloseUnusedWadFiles (void);
  93. WadPtr BasicWadOpen (char *);
  94. void BasicWadRead (WadPtr, void *, long);
  95. void BasicWadSeek (WadPtr, long);
  96. MDirPtr FindMasterDir( MDirPtr, char *);
  97. void ListMasterDirectory( FILE *);
  98. void ListFileDirectory( FILE *, WadPtr);
  99. void BuildNewMainWad( char *, Bool);
  100. void WriteBytes( FILE *, void *, long);
  101. void CopyBytes( FILE *, FILE *, long);
  102. int Exists( char *);
  103. void DumpDirectoryEntry( FILE *, char *);
  104. void SaveDirectoryEntry( FILE *, char *);
  105. void SaveEntryToRawFile( FILE *, char *);
  106. void SaveEntryFromRawFile( FILE *, FILE *, char *);
  107.  
  108. #endif