wad.h 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. /*
  2. Copyright (C) 1996-1997 Id Software, Inc.
  3. This program is free software; you can redistribute it and/or
  4. modify it under the terms of the GNU General Public License
  5. as published by the Free Software Foundation; either version 2
  6. of the License, or (at your option) any later version.
  7. This program is distributed in the hope that it will be useful,
  8. but WITHOUT ANY WARRANTY; without even the implied warranty of
  9. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  10. See the GNU General Public License for more details.
  11. You should have received a copy of the GNU General Public License
  12. along with this program; if not, write to the Free Software
  13. Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
  14. */
  15. // wad.h
  16. //===============
  17. // TYPES
  18. //===============
  19. #define CMP_NONE 0
  20. #define CMP_LZSS 1
  21. #define TYP_NONE 0
  22. #define TYP_LABEL 1
  23. #define TYP_LUMPY 64 // 64 + grab command number
  24. #define TYP_PALETTE 64
  25. #define TYP_QTEX 65
  26. #define TYP_QPIC 66
  27. #define TYP_SOUND 67
  28. #define TYP_MIPTEX 68
  29. typedef struct
  30. {
  31. int width, height;
  32. byte data[4]; // variably sized
  33. } qpic_t;
  34. typedef struct
  35. {
  36. char identification[4]; // should be WAD2 or 2DAW
  37. int numlumps;
  38. int infotableofs;
  39. } wadinfo_t;
  40. typedef struct
  41. {
  42. int filepos;
  43. int disksize;
  44. int size; // uncompressed
  45. char type;
  46. char compression;
  47. char pad1, pad2;
  48. char name[16]; // must be null terminated
  49. } lumpinfo_t;
  50. extern int wad_numlumps;
  51. extern lumpinfo_t *wad_lumps;
  52. extern byte *wad_base;
  53. void W_LoadWadFile (char *filename);
  54. void W_CleanupName (char *in, char *out);
  55. lumpinfo_t *W_GetLumpinfo (char *name);
  56. void *W_GetLumpName (char *name);
  57. void *W_GetLumpNum (int num);
  58. void SwapPic (qpic_t *pic);