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