The Build Engine

- Main Page
- Classes
- Files

- File List
- File Members

engine_protos.h
1 //-------------------------------------------------------------------------
2 /*
3 Copyright (C) 1996, 2003 - 3D Realms Entertainment
4
5 This file is part of Duke Nukem 3D version 1.5 - Atomic Edition
6
7 Duke Nukem 3D is free software; you can redistribute it and/or
8 modify it under the terms of the GNU General Public License
9 as published by the Free Software Foundation; either version 2
10 of the License, or (at your option) any later version.
11
12 This program is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
15
16 See the GNU General Public License for more details.
17
18 You should have received a copy of the GNU General Public License
19 along with this program; if not, write to the Free Software
20 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
21
22 */
23 //-------------------------------------------------------------------------
24
25 /* Prototypes for the build engine */
26
27 #if 0
28 /* game.c */
29 extern void initsb(char dadigistat, char damusistat, long dasamplerate, char danumspeakers, char dabytespersample, char daintspersec, char daquality);
30 extern void uninitsb(void);
31 extern int loadsong(char *filename);
32 extern void musicon(void);
33 extern void musicoff(void);
34 extern void wsayfollow(char *dafilename, long dafreq, long davol, long *daxplc, long *dayplc, char followstat);
35 extern void wsay(char *dafilename, long dafreq, long volume1, long volume2);
36 extern void preparesndbuf(void);
37 extern void setears(long daposx, long daposy, long daxvect, long dayvect);
38 extern void timerhandler(void);
39 extern void keyhandler(void);
40 extern void initlava(void);
41 extern void movelava(char *dapic);
42 extern void drawtilebackground(long thex, long they, short tilenum, signed char shade, long cx1, long cy1, long cx2, long cy2, char dapalnum);
43 extern void printext(long x, long y, char *buffer, short tilenum, char invisiblecol);
44 extern void drawstatusflytime(short snum);
45 extern void drawstatusbar(short snum);
46 extern void setup3dscreen(void);
47 extern void setinterpolation(long *posptr);
48 extern void stopinterpolation(long *posptr);
49 extern void updateinterpolations(void);
50 extern void restoreinterpolations(void);
51 extern void searchmap(short startsector);
52 extern void prepareboard(char *daboardfilename);
53 extern long changehealth(short snum, short deltahealth);
54 extern void changenumbombs(short snum, short deltanumbombs);
55 extern void changenummissiles(short snum, short deltanummissiles);
56 extern void changenumgrabbers(short snum, short deltanumgrabbers);
57 extern void findrandomspot(long *x, long *y, short *sectnum);
58 extern void operatesector(short dasector);
59 extern void shootgun(short snum, long x, long y, long z, short daang, long dahoriz, short dasectnum, char guntype);
60 extern void operatesprite(short dasprite);
61 extern void checktouchsprite(short snum, short sectnum);
62 extern void checkgrabbertouchsprite(short snum, short sectnum);
63 extern void activatehitag(short dahitag);
64 extern void processinput(short snum);
65 extern void movethings(void);
66 extern void fakedomovethings(void);
67 extern void fakedomovethingscorrect(void);
68 extern void doanimations(void);
69 extern void warp(long *x, long *y, long *z, short *daang, short *dasector);
70 extern void warpsprite(short spritenum);
71 extern int testneighborsectors(short sect1, short sect2);
72 extern void tagcode(void);
73 extern void bombexplode(long i);
74 extern void statuslistcode(void);
75 extern void checkmasterslaveswitch(void);
76 extern void getpackets(void);
77 extern void initplayersprite(short snum);
78 extern void analyzesprites(long dax, long day);
79 extern void updatesectorz(long x, long y, long z, short *sectnum);
80 extern void drawoverheadmap(long cposx, long cposy, long czoom, short cang);
81 extern void drawscreen(short snum, long dasmoothratio);
82 extern int loadgame(void);
83 extern int savegame(void);
84 extern void faketimerhandler(void);
85 extern void waitforeverybody(void);
86 #endif
87
88 /* cache1d.c */
89 extern void initcache(long dacachestart, long dacachesize);
90 extern void allocache(long *newhandle, long newbytes, unsigned char *newlockptr);
91 extern void suckcache(long *suckptr);
92 extern void agecache(void);
93 extern void reportandexit(char *errormessage);
94 extern long initgroupfile(const char *filename);
95 extern void uninitgroupfile(void);
96 extern long kopen4load(const char *filename, char searchfirst);
97 extern long kread(long handle, void *buffer, long leng);
98 extern int kread8(long handle, char *buffer);
99 extern int kread16(long handle, short *buffer);
100 extern int kread32(long handle, long *buffer);
101 extern long klseek(long handle, long offset, long whence);
102 extern long kfilelength(long handle);
103 extern void kclose(long handle);
104 extern void kdfread(void *buffer, size_t dasizeof, size_t count, long fil);
105 extern void kdfread8(char *buffer, size_t count, long fil);
106 extern void kdfread16(short *buffer, size_t count, long fil);
107 extern void kdfread32(long *buffer, size_t count, long fil);
108 extern void dfread(void *buffer, size_t dasizeof, size_t count, FILE *fil);
109 extern void dfread8(char *buffer, size_t count, FILE *fil);
110 extern void dfread16(short *buffer, size_t count, FILE *fil);
111 extern void dfread32(long *buffer, size_t count, FILE *fil);
112 extern void dfwrite(void *buffer, size_t dasizeof, size_t count, FILE *fil);
113 extern void dfwrite8(char *buffer, size_t count, FILE *fil);
114 extern void dfwrite16(short *buffer, size_t count, FILE *fil);
115 extern void dfwrite32(long *buffer, size_t count, FILE *fil);
116 extern long compress(char *lzwinbuf, long uncompleng, char *lzwoutbuf);
117 extern long uncompress(char *lzwinbuf, long compleng, char *lzwoutbuf);
118
119 /* sdl_driver.c */
120 extern int using_opengl(void);
121 extern void _handle_events(void);
122 extern unsigned char _readlastkeyhit(void);
123 extern int mprotect_align(const void *addr, size_t len, int prot);
124 extern void unprotect_ASM_pages(void);
125 extern void _platform_init(int argc, char **argv, const char *title, const char *icon);
126 extern int setvesa(long x, long y);
127 extern int screencapture(char *filename, char inverseit);
128 extern void setvmode(int mode);
129 extern int _setgamemode(char davidoption, long daxdim, long daydim);
130 extern void qsetmode640350(void);
131 extern void qsetmode640480(void);
132 extern void getvalidvesamodes(void);
133 extern int VBE_setPalette(long start, long num, char *palettebuffer);
134 extern int VBE_getPalette(long start, long num, char *palettebuffer);
135 extern void _uninitengine(void);
136 extern void uninitvesa(void);
137 extern int setupmouse(void);
138 extern void readmousexy(short *x, short *y);
139 extern void readmousebstatus(short *bstatus);
140 extern void _updateScreenRect(long x, long y, long w, long h);
141 extern void _nextpage(void);
142 extern unsigned char readpixel(long offset);
143 extern void drawpixel(long offset, unsigned char pixel);
144 extern void drawpixels(long offset, unsigned short pixels);
145 extern void drawpixelses(long offset, unsigned int pixelses);
146 extern void setcolor16(int col);
147 extern void drawpixel16(long offset);
148 extern void fillscreen16(long offset, long color, long blocksize);
149 extern void drawline16(long XStart, long YStart, long XEnd, long YEnd, char Color);
150 extern void clear2dscreen(void);
151 extern void _idle(void);
152 extern void *_getVideoBase(void);
153 extern void setactivepage(long dapagenum);
154 extern void limitrate(void);
155 extern void inittimer(void);
156 extern void uninittimer(void);
157 extern void initkeys(void);
158 extern void uninitkeys(void);
159 extern void set16color_palette(void);
160 extern void restore256_palette(void);
161 extern unsigned long getticks(void);
162
163 /* mmulti.c */
164 extern void callcommit(void);
165 extern void initcrc(void);
166 extern long getcrc(char *buffer, short bufleng);
167 extern void initmultiplayers(char damultioption, char dacomrateoption, char dapriority);
168 extern void sendpacket(long other, char *bufptr, long messleng);
169 extern void setpackettimeout(long datimeoutcount, long daresendagaincount);
170 extern void uninitmultiplayers(void);
171 extern void sendlogon(void);
172 extern void sendlogoff(void);
173 extern int getoutputcirclesize(void);
174 extern void setsocket(short newsocket);
175 extern short getpacket(short *other, char *bufptr);
176 extern void flushpackets(void);
177 extern void genericmultifunction(long other, char *bufptr, long messleng, long command);
178
179 /* engine.c */
180 extern int setgotpic(long i1);
181 extern long getclipmask(int i1, int i2, int i3, int i4);
182 extern int wallfront(long l1, long l2);
183 extern void drawrooms(long daposx, long daposy, long daposz, short daang, long dahoriz, short dacursectnum);
184 extern int loadboard(char *filename, long *daposx, long *daposy, long *daposz, short *daang, short *dacursectnum);
185 extern int saveboard(char *filename, long *daposx, long *daposy, long *daposz, short *daang, short *dacursectnum);
186 extern int setgamemode(char davidoption, long daxdim, long daydim);
187 extern void setmmxoverlay(int isenabled);
188 extern int getmmxoverlay(void);
189 extern void initengine(void);
190 extern void uninitengine(void);
191 extern void nextpage(void);
192 extern void loadtile(short tilenume);
193 extern int allocatepermanenttile(short tilenume, long xsiz, long ysiz);
194 extern int loadpics(char *filename);
195 extern void qloadkvx(long voxindex, char *filename);
196 extern int clipinsidebox(long x, long y, short wallnum, long walldist);
197 extern void drawline256(long x1, long y1, long x2, long y2, unsigned char col);
198 extern int inside(long x, long y, short sectnum);
199 extern int getangle(long xvect, long yvect);
200 extern int ksqrt(long num);
201 extern void copytilepiece(long tilenume1, long sx1, long sy1, long xsiz, long ysiz, long tilenume2, long sx2, long sy2);
202 extern void drawmasks(void);
203 extern int setsprite(short spritenum, long newx, long newy, long newz);
204 extern void initspritelists(void);
205 extern int insertsprite(short sectnum, short statnum);
206 extern int insertspritesect(short sectnum);
207 extern int insertspritestat(short statnum);
208 extern int deletesprite(short spritenum);
209 extern int deletespritesect(short deleteme);
210 extern int deletespritestat(short deleteme);
211 extern int changespritesect(short spritenum, short newsectnum);
212 extern int changespritestat(short spritenum, short newstatnum);
213 extern int nextsectorneighborz(short sectnum, long thez, short topbottom, short direction);
214 extern int cansee(long x1, long y1, long z1, short sect1, long x2, long y2, long z2, short sect2);
215 extern int lintersect(long x1, long y1, long z1, long x2, long y2, long z2, long x3, long y3, long x4, long y4, long *intx, long *inty, long *intz);
216 extern int rintersect(long x1, long y1, long z1, long vx, long vy, long vz, long x3, long y3, long x4, long y4, long *intx, long *inty, long *intz);
217 extern int hitscan(long xs, long ys, long zs, short sectnum, long vx, long vy, long vz, short *hitsect, short *hitwall, short *hitsprite, long *hitx, long *hity, long *hitz, unsigned long cliptype);
218 extern int neartag(long xs, long ys, long zs, short sectnum, short ange, short *neartagsector, short *neartagwall, short *neartagsprite, long *neartaghitdist, long neartagrange, char tagsearch);
219 extern void dragpoint(short pointhighlight, long dax, long day);
220 extern int lastwall(short point);
221 extern int clipmove(long *x, long *y, long *z, short *sectnum, long xvect, long yvect, long walldist, long ceildist, long flordist, unsigned long cliptype);
222 extern int pushmove(long *x, long *y, long *z, short *sectnum, long walldist, long ceildist, long flordist, unsigned long cliptype);
223 extern void updatesector(long x, long y, short *sectnum);
224 extern void rotatepoint(long xpivot, long ypivot, long x, long y, short daang, long *x2, long *y2);
225 extern int initmouse(void);
226 extern void getmousevalues(short *mousx, short *mousy, short *bstatus);
227 extern void draw2dgrid(long posxe, long posye, short ange, long zoome, short gride);
228 extern void draw2dscreen(long posxe, long posye, short ange, long zoome, short gride);
229 extern void printext256(long xpos, long ypos, short col, short backcol, char name[82], char fontsize);
230 extern void printext256_noupdate(long xpos, long ypos, short col, short backcol, char name[82], char fontsize);
231 extern int krand(void);
232 extern void getzrange(long x, long y, long z, short sectnum, long *ceilz, long *ceilhit, long *florz, long *florhit, long walldist, unsigned long cliptype);
233 extern void setview(long x1, long y1, long x2, long y2);
234 extern void setaspect(long daxrange, long daaspect);
235 extern void flushperms(void);
236 extern void rotatesprite(long sx, long sy, long z, short a, short picnum, signed char dashade, char dapalnum, char dastat, long cx1, long cy1, long cx2, long cy2);
237 extern void makepalookup(long palnum, char *remapbuf, signed char r, signed char g, signed char b, char dastat);
238 extern void setbrightness(char dabrightness, unsigned char *dapal);
239 extern void drawmapview(long dax, long day, long zoome, short ang);
240 extern void clearview(long dacol);
241 extern void clearallviews(long dacol);
242 extern void plotpixel(long x, long y, char col);
243 extern unsigned char getpixel(long x, long y);
244 extern void setviewtotile(short tilenume, long xsiz, long ysiz);
245 extern void setviewback(void);
246 extern void squarerotatetile(short tilenume);
247 extern void preparemirror(long dax, long day, long daz, short daang, long dahoriz, short dawall, short dasector, long *tposx, long *tposy, short *tang);
248 extern void completemirror(void);
249 extern int sectorofwall(short theline);
250 extern int getceilzofslope(short sectnum, long dax, long day);
251 extern int getflorzofslope(short sectnum, long dax, long day);
252 extern void getzsofslope(short sectnum, long dax, long day, long *ceilz, long *florz);
253 extern void alignceilslope(short dasect, long x, long y, long z);
254 extern void alignflorslope(short dasect, long x, long y, long z);
255 extern int loopnumofsector(short sectnum, short wallnum);
256 extern void setfirstwall(short sectnum, short newfirstwall);