This repository has been archived by the owner on May 19, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 27
/
Copy pathid_ca.h
52 lines (35 loc) · 1.39 KB
/
id_ca.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
#ifndef __ID_CA_H_
#define __ID_CA_H_
//===========================================================================
#define NUMMAPS 60
#define MAPPLANES 3
#define UNCACHEAUDIOCHUNK(chunk) {if(audiosegs[chunk]) {free(audiosegs[chunk]); audiosegs[chunk]=NULL;}}
//===========================================================================
typedef struct
{
int32_t planestart[MAPPLANES];
word planelength[MAPPLANES];
word width,height;
char name[16];
} maptype;
//===========================================================================
extern word *mapsegs[MAPPLANES];
extern maptype *mapheaderseg[NUMMAPS];
extern byte *audiosegs[NUMSNDCHUNKS];
extern byte *grsegs[NUMCHUNKS];
extern char extension[5];
extern char graphext[5];
extern char audioext[5];
//===========================================================================
void CA_LoadFile (const char *filename, void **ptr);
void CA_WriteFile (const char *filename, void *ptr, int32_t length);
int32_t CA_RLEWCompress (word *source, int32_t length, word *dest, word rlewtag);
void CA_RLEWexpand (word *source, word *dest, int32_t length, word rlewtag);
void CA_Startup (void);
void CA_Shutdown (void);
int32_t CA_CacheAudioChunk (int chunk);
void CA_LoadAllSounds (void);
void CA_CacheGrChunks (FILE *file);
void CA_CacheMap (int mapnum);
void CA_CannotOpen (const char *name);
#endif