]> 4ch.mooo.com Git - 16.git/blob - 16/cawat/GELIB.H
wwww
[16.git] / 16 / cawat / GELIB.H
1 /* Catacomb Armageddon 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 #include "SL_FILE.h"\r
20 \r
21 \r
22 ///////////////////////////////////////////////////////////////////////////\r
23 //\r
24 // Defines\r
25 //\r
26 \r
27 #define ANIM_USES_SHAPE_TABLE false\r
28 #define PI_MAX_ANIMS 10\r
29 #define PI_MAX_PAGES    40\r
30 \r
31 #define SAVEVER_DATA "0.01"\r
32 #define FILENAME_LEN 15\r
33 \r
34 #define  GAMENAME               "CATACOMB ARMAGEDDON 3-D"\r
35 #define VERSION         "V1.02"\r
36 #define  REVISION               "  rev 1 "\r
37 \r
38 //#define BOBLIST 1                          //SP - Undefine if not using BOBList\r
39 \r
40 #define AUDIO_DISK              (2)\r
41 #define VIDEO_DISK              (1)\r
42 #define LEVEL_DISK              (2)\r
43 \r
44 #define BIO_BUFFER_LEN  (512)\r
45 \r
46 #define TrashProg Quit\r
47 \r
48 //   #define AMIGA\r
49 \r
50 \r
51 typedef struct Sample {\r
52                 char *filename;\r
53                 memptr *data;\r
54 } Sample;\r
55 \r
56 typedef enum {ged_none, ged_SoundSource,ged_SoundBlaster} AudioDeviceType;\r
57 \r
58 //typedef struct {\r
59 //      memptr textptr;\r
60 //      char far *pages[MAX_TEXT_PAGES];\r
61 //      short totalpages;\r
62 //} textinfo;\r
63 \r
64 typedef struct {\r
65         int handle;                     // handle of file\r
66         memptr buffer;          // pointer to buffer\r
67         word offset;            // offset into buffer\r
68         word status;            // read/write status\r
69 } BufferedIO;\r
70 \r
71 typedef enum ANIMINFO {at_NONE,at_INIT,at_WAIT,at_ONCE,at_CYCLE,\r
72                                                           at_REBOUND,at_EXTRA,\r
73                                                           at_FWD,at_REV\r
74 } ANIMINFO;\r
75 \r
76 struct BitMapHeader {\r
77         unsigned int    w,h,x,y;\r
78         unsigned char   d,trans,comp,pad;\r
79 };\r
80 \r
81 struct BitMap {\r
82         unsigned int Width;\r
83         unsigned int Height;\r
84         unsigned int Depth;\r
85         unsigned int BytesPerRow;\r
86         char far *Planes[8];\r
87 };\r
88 \r
89 struct Shape {\r
90         memptr Data;\r
91         long size;\r
92         unsigned int BPR;\r
93         struct BitMapHeader bmHdr;\r
94 };\r
95 \r
96 #ifdef AMIGA\r
97 typedef struct {\r
98         char *script[PI_MAX_PAGES];\r
99         XBitMap **shapes;\r
100         XBitMap **font;\r
101         short xl,yl,xh,yh;\r
102         struct BitMap *dst;\r
103         char numpages,bgcolor;\r
104 } PresenterInfo;\r
105 #else\r
106 typedef struct {\r
107         char far *script[PI_MAX_PAGES];\r
108         memptr scriptstart;\r
109         short xl,yl,xh,yh;\r
110         char numpages,bgcolor,ltcolor,dkcolor;\r
111 } PresenterInfo;\r
112 #endif\r
113 \r
114 \r
115 ///////////////////////////////////////////////////////////////////////////\r
116 //\r
117 // Externs\r
118 //\r
119 \r
120 extern char Filename[], ID[], VER[];\r
121 extern boolean ge_textmode;\r
122 extern short PPT_LeftEdge,PPT_RightEdge;\r
123 //extern boolean ConserveMemory;\r
124 extern BufferedIO lzwBIO;\r
125 extern short wall_anim_delay,wall_anim_time;\r
126 \r
127 \r
128 \r
129 ///////////////////////////////////////////////////////////////////////////\r
130 //\r
131 // Function prototypes\r
132 //\r
133 void WaitKeyVBL(short key, short vbls);\r
134 void CalibrateJoystick(short joynum);\r
135 void MoveScreen(short x, short y);\r
136 void MoveGfxDst(short x, short y);\r
137 void DoPiracy(void);\r
138 void PrintPropText(char far *text);\r
139 //void DisplayText(textinfo *textinfo);\r
140 //long LoadTextFile(char *filename,textinfo *textinfo);\r
141 //void FreeTextFile(textinfo *textinfo);\r
142 //void InitTextFile(textinfo *textinfo);\r
143 long Verify(char *filename);\r
144 void GE_SaveGame(void);\r
145 boolean GE_LoadGame(void);\r
146 int GE_HardError(word errval,int ax,int bp,int si);\r
147 \r
148 #ifdef BOBLIST\r
149 \r
150 \r
151 boolean UpdateBOBList(objtype *obj,struct Simple_Shape *Shape,shapeclass Class, short priority, spriteflags sprflags);\r
152 boolean RemoveBOBShape(objtype *obj, shapeclass Class);\r
153 void RemoveBOBList(objtype *obj);\r
154 void InitBOBList(objtype *obj, struct BOB_Shape *BOB_Shape, short NumElements);\r
155 void RefreshBOBList(objtype *obj);\r
156 #endif\r
157 \r
158 \r
159 unsigned long BLoad(char *SourceFile, memptr *DstPtr);\r
160 void lzwDecompressFromRAM(byte far *SrcPtr, byte far *DstPtr, longword SrcLen);\r
161 void lzwDecompressFromFile(BufferedIO *SrcPtr, byte far *DstPtr, longword SrcLen);\r
162 byte readch(int handle);\r
163 \r
164 memptr InitBufferedIO(int handle, BufferedIO *bio);\r
165 void FreeBufferedIO(BufferedIO *bio);\r
166 byte bio_readch(BufferedIO *bio);\r
167 void bio_fillbuffer(BufferedIO *bio);\r
168 \r
169 \r
170 void SwapLong(long far *Var);\r
171 void SwapWord(unsigned int far *Var);\r
172 int LoadShape(char *Filename,struct Shape *SHP);\r
173 void FreeShape(struct Shape *shape);\r
174 int UnpackEGAShapeToScreen(struct Shape *SHP,int startx,int starty);\r
175 char GetKeyChoice(char *choices,boolean clear);\r
176 boolean AnimateObj(objtype *obj);\r
177 void AdvanceAnimFWD(objtype *obj);\r
178 void AdvanceAnimREV(objtype *obj);\r
179 \r
180 void LoadASArray(struct Sample *ASArray);\r
181 void FreeASArray(struct Sample *ASArray);\r
182 //void SelectDigiAudio(AudioDeviceType Device);\r
183 void PlaySample(unsigned SampleNum);\r
184 void GE_FreeAllDigiSounds(void);\r
185 void GE_LoadAllDigiSounds(void);\r
186 void DisplayGameList(short winx, short winy, short list_width, short list_height);\r
187 void ReadGameList(void);\r
188 void CheckStack(void);\r
189 void CenterObj(objtype *obj, unsigned x, unsigned y);\r
190 void cachein(short s,short e);\r
191 void cacheout(short s,short e);\r
192 void FizzleFade (unsigned source, unsigned dest,unsigned width,unsigned height, boolean abortable);\r
193 void mprintf(char *msg, ...);\r
194 boolean FindFile(char *filename,char *disktext,char disknum);\r
195 void CacheAV(char *title);\r
196 void BlackPalette(void);\r
197 void ColoredPalette(void);\r
198 void Presenter(PresenterInfo *pi);\r
199 unsigned PI_VALUE(char far *ptr,char num_nybbles);\r
200 long LoadPresenterScript(char *filename,PresenterInfo *pi);\r
201 void FreePresenterScript(PresenterInfo *pi);\r
202 void InitPresenterScript(PresenterInfo *pi);\r
203 \r
204 void AnimatePage(short numanims);\r
205 short BoxAroundPic(short x1, short y1, unsigned picnum, PresenterInfo *pi);\r
206 void PurgeAllGfx(void);\r
207 void CachePage(char far *script);\r
208 \r
209 \r
210 void AnimateWallList(void);\r