1 /* Reconstructed Commander Keen 4-6 Source Code
\r
2 * Copyright (C) 2021 K1n9_Duk3
\r
4 * This file is primarily based on:
\r
5 * Catacomb 3-D Source Code
\r
6 * Copyright (C) 1993-2014 Flat Rock Software
\r
8 * This program is free software; you can redistribute it and/or modify
\r
9 * it under the terms of the GNU General Public License as published by
\r
10 * the Free Software Foundation; either version 2 of the License, or
\r
11 * (at your option) any later version.
\r
13 * This program is distributed in the hope that it will be useful,
\r
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
\r
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
\r
16 * GNU General Public License for more details.
\r
18 * You should have received a copy of the GNU General Public License along
\r
19 * with this program; if not, write to the Free Software Foundation, Inc.,
\r
20 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
\r
26 #include "ID_TYPES.H"
\r
34 #include "ID_GLOB.H"
\r
39 //===========================================================================
\r
42 //#define NOGRAPHICS
\r
45 #define MAPHEADERLINKED
\r
46 #define GRHEADERLINKED
\r
47 #define AUDIOHEADERLINKED
\r
54 // tile info defines, as bytes after tinf the table starts
\r
62 #define ANIM (SPEED+NUMTILE16)
\r
65 // TILEINFOM offsets
\r
67 #define NORTHWALL (ANIM+NUMTILE16)
\r
68 #define EASTWALL (NORTHWALL+NUMTILE16M)
\r
69 #define SOUTHWALL (EASTWALL+NUMTILE16M)
\r
70 #define WESTWALL (SOUTHWALL+NUMTILE16M)
\r
71 #define MANIM (WESTWALL+NUMTILE16M)
\r
72 #define INTILE (MANIM+NUMTILE16M)
\r
73 #define MSPEED (INTILE+NUMTILE16M)
\r
76 //===========================================================================
\r
81 unsigned planelength[3];
\r
82 unsigned width,height;
\r
86 //===========================================================================
\r
88 extern byte _seg *tinf;
\r
91 extern unsigned _seg *mapsegs[3];
\r
92 extern maptype _seg *mapheaderseg[NUMMAPS];
\r
93 extern byte _seg *audiosegs[NUMSNDCHUNKS];
\r
94 extern void _seg *grsegs[NUMCHUNKS];
\r
96 extern byte far grneeded[NUMCHUNKS];
\r
97 extern byte ca_levelbit,ca_levelnum;
\r
99 extern char *titleptr[8];
\r
101 extern int profilehandle,debughandle;
\r
104 // hooks for custom cache dialogs
\r
106 extern void (*drawcachebox) (char *title, unsigned numcache);
\r
107 extern void (*updatecachebox) (void);
\r
108 extern void (*finishcachebox) (void);
\r
110 //===========================================================================
\r
112 // just for the score box reshifting
\r
114 void CAL_ShiftSprite (unsigned segment,unsigned source,unsigned dest,
\r
115 unsigned width, unsigned height, unsigned pixshift);
\r
117 //===========================================================================
\r
119 void CA_OpenDebug (void);
\r
120 void CA_CloseDebug (void);
\r
121 boolean CA_FarRead (int handle, byte far *dest, long length);
\r
122 boolean CA_FarWrite (int handle, byte far *source, long length);
\r
123 boolean CA_ReadFile (char *filename, memptr *ptr);
\r
124 boolean CA_LoadFile (char *filename, memptr *ptr);
\r
126 long CA_RLEWCompress (unsigned huge *source, long length, unsigned huge *dest,
\r
129 void CA_RLEWexpand (unsigned huge *source, unsigned huge *dest,long length,
\r
132 void CA_Startup (void);
\r
133 void CA_Shutdown (void);
\r
135 void CA_CacheAudioChunk (int chunk);
\r
136 void CA_LoadAllSounds (void);
\r
138 void CA_UpLevel (void);
\r
139 void CA_DownLevel (void);
\r
141 void CA_SetAllPurge (void);
\r
143 void CA_ClearMarks (void);
\r
144 void CA_ClearAllMarks (void);
\r
146 #define CA_MarkGrChunk(chunk) grneeded[chunk]|=ca_levelbit
\r
148 void CA_CacheGrChunk (int chunk);
\r
149 void CA_CacheMap (int mapnum);
\r
151 void CA_CacheMarks (char *title);
\r