forked from keendreams/keen
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathid_ca.h
131 lines (95 loc) · 3.32 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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
/* Keen Dreams (SDL2/Steam Port) Source Code
* Copyright (C) 2014 Javier M. Chavez
* Copyright (C) 2015 David Gow <[email protected]>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
// ID_CA.H
#ifndef __TYPES__
#include "id_types.h"
#endif
#ifndef __ID_MM__
#include "id_mm.h"
#endif
#ifndef __ID_GLOB__
#include "id_glob.h"
#endif
#ifndef __WIN_UTILS__
#include "win_utils.h"
#endif
#define __ID_CA__
//===========================================================================
//#define MAPHEADERLINKED
//#define GRHEADERLINKED
//#define AUDIOHEADERLINKED
#define MAPSCOMPRESSED
#define AUDIOCOMPRESSED
#define NUMMAPS 30
//
// tile info defines, as bytes after tinf the table starts
//
#define SPEED 502
#define ANIM (SPEED+NUMTILE16)
#define NORTHWALL (ANIM+NUMTILE16)
#define EASTWALL (NORTHWALL+NUMTILE16M)
#define SOUTHWALL (EASTWALL+NUMTILE16M)
#define WESTWALL (SOUTHWALL+NUMTILE16M)
#define MANIM (WESTWALL+NUMTILE16M)
#define INTILE (MANIM+NUMTILE16M)
#define MSPEED (INTILE+NUMTILE16M)
//===========================================================================
PACKED(maptype)
{
int32_t planestart[3];
uint16_t planelength[3];
uint16_t width,height;
char name[16];
} maptype;
//===========================================================================
extern byte *tinf;
extern int mapon;
extern uint16_t *mapsegs[3];
extern maptype *mapheaderseg[NUMMAPS];
extern byte *audiosegs[NUMSNDCHUNKS];
extern void *grsegs[NUMCHUNKS];
extern byte grneeded[NUMCHUNKS];
extern byte ca_levelbit,ca_levelnum;
extern char *titleptr[8];
extern int profilehandle;
//===========================================================================
// just for the score box reshifting
void CAL_ShiftSprite (unsigned segment,unsigned source,unsigned dest,
unsigned width, unsigned height, unsigned pixshift);
//===========================================================================
boolean CA_FarRead (int handle, byte *dest, long length);
boolean CA_FarWrite (int handle, byte *source, long length);
boolean CA_LoadFile (char *filename, memptr *ptr);
long CA_RLEWCompress (word *source, int length, word *dest,
word rlewtag);
void CA_RLEWexpand (word *source, word *dest, int length,
word rlewtag);
void CA_Startup (void);
void CA_Shutdown (void);
void CA_CacheAudioChunk (int chunk);
void CA_LoadAllSounds (void);
void CA_UpLevel (void);
void CA_DownLevel (void);
void CA_ClearMarks (void);
void CA_ClearAllMarks (void);
#define CA_MarkGrChunk(chunk) grneeded[chunk]|=ca_levelbit
void CA_CacheGrChunk (int chunk);
void CA_CacheMap (int mapnum);
void CA_CacheMarks (char *title, boolean cachedownlevel);
off_t CAL_filelength(int fd);