ID_CA.H 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125
  1. /* Catacomb Armageddon Source Code
  2. * Copyright (C) 1993-2014 Flat Rock Software
  3. *
  4. * This program is free software; you can redistribute it and/or modify
  5. * it under the terms of the GNU General Public License as published by
  6. * the Free Software Foundation; either version 2 of the License, or
  7. * (at your option) any later version.
  8. *
  9. * This program is distributed in the hope that it will be useful,
  10. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  12. * GNU General Public License for more details.
  13. *
  14. * You should have received a copy of the GNU General Public License along
  15. * with this program; if not, write to the Free Software Foundation, Inc.,
  16. * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
  17. */
  18. // ID_CA.H
  19. #ifndef __TYPES__
  20. #include "ID_TYPES.H"
  21. #endif
  22. #ifndef __ID_MM__
  23. #include "ID_MM.H"
  24. #endif
  25. #ifndef __ID_GLOB__
  26. #include "ID_GLOB.H"
  27. #endif
  28. #define __ID_CA__
  29. //===========================================================================
  30. //#define NOMAPS
  31. //#define NOGRAPHICS
  32. //#define NOAUDIO
  33. #define MAPHEADERLINKED
  34. #define GRHEADERLINKED
  35. #define AUDIOHEADERLINKED
  36. #define NUMMAPS 39
  37. #define MAPPLANES 3
  38. //===========================================================================
  39. typedef struct
  40. {
  41. long planestart[3];
  42. unsigned planelength[3];
  43. unsigned width,height;
  44. char name[16];
  45. } maptype;
  46. //===========================================================================
  47. extern byte _seg *tinf;
  48. extern int mapon;
  49. extern unsigned _seg *mapsegs[3];
  50. extern maptype _seg *mapheaderseg[NUMMAPS];
  51. extern byte _seg *audiosegs[NUMSNDCHUNKS];
  52. extern void _seg *grsegs[NUMCHUNKS];
  53. extern byte far grneeded[NUMCHUNKS];
  54. extern byte ca_levelbit,ca_levelnum;
  55. extern char *titleptr[8];
  56. extern int profilehandle,debughandle;
  57. //
  58. // hooks for custom cache dialogs
  59. //
  60. extern void (*drawcachebox) (char *title, unsigned numcache);
  61. extern void (*updatecachebox) (void);
  62. extern void (*finishcachebox) (void);
  63. //===========================================================================
  64. // just for the score box reshifting
  65. void CAL_ShiftSprite (unsigned segment,unsigned source,unsigned dest,
  66. unsigned width, unsigned height, unsigned pixshift, boolean domask);
  67. //===========================================================================
  68. void CA_OpenDebug (void);
  69. void CA_CloseDebug (void);
  70. boolean CA_FarRead (int handle, byte far *dest, long length);
  71. boolean CA_FarWrite (int handle, byte far *source, long length);
  72. boolean CA_ReadFile (char *filename, memptr *ptr);
  73. boolean CA_LoadFile (char *filename, memptr *ptr);
  74. long CA_RLEWCompress (unsigned huge *source, long length, unsigned huge *dest,
  75. unsigned rlewtag);
  76. void CA_RLEWexpand (unsigned huge *source, unsigned huge *dest,long length,
  77. unsigned rlewtag);
  78. void CA_Startup (void);
  79. void CA_Shutdown (void);
  80. void CA_CacheAudioChunk (int chunk);
  81. void CA_LoadAllSounds (void);
  82. void CA_UpLevel (void);
  83. void CA_DownLevel (void);
  84. void CA_SetAllPurge (void);
  85. void CA_ClearMarks (void);
  86. void CA_ClearAllMarks (void);
  87. #define CA_MarkGrChunk(chunk) grneeded[chunk]|=ca_levelbit
  88. void CA_CacheGrChunk (int chunk);
  89. void CA_CacheMap (int mapnum);
  90. void CA_CacheMarks (char *title);