Team Fortress 2 Source Code as on 22/4/2020
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

61 lines
1.2 KiB

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