]> icculus.org git repositories - btb/d2x.git/blob - ChangeLog-old
move old per-file change logs into new file ChangeLog-old
[btb/d2x.git] / ChangeLog-old
1 This file contains the per-file change logs written before CVS was used
2
3 ------------------------------------------------------------------------
4 2d/2dsline.c:
5
6  * Revision 1.6  1995/09/14  14:24:03  allender
7  * fixed MW compile error
8  *
9  * Revision 1.5  1995/09/14  13:45:17  allender
10  * quick optimization for scanline
11  *
12  * Revision 1.4  1995/04/27  07:36:05  allender
13  * remove some memsets since all old is here now
14  *
15  * Revision 1.3  1995/04/19  14:35:33  allender
16  * *** empty log message ***
17  *
18  * Revision 1.2  1995/04/18  12:03:40  allender
19  * *** empty log message ***
20  *
21  * Revision 1.1  1995/03/09  09:24:06  allender
22  * Initial revision
23  *
24  *
25  * --- PC RCS information ---
26  * Revision 1.7  1994/11/18  22:50:48  john
27  * Changed a bunch of shorts to ints in calls.
28  *
29  * Revision 1.6  1994/09/02  11:40:32  john
30  * fixed bug with urect scanline drakening still
31  * only using 16 levels of fade.
32  *
33  * Revision 1.5  1994/04/08  16:59:12  john
34  * Add fading poly's; Made palette fade 32 instead of 16.
35  *
36  * Revision 1.4  1994/03/22  18:36:27  john
37  * Added darkening scanlines
38  *
39  * Revision 1.3  1993/10/15  16:22:52  john
40  * y
41  *
42  * Revision 1.2  1993/09/08  11:56:29  john
43  * neatened
44  *
45  * Revision 1.1  1993/09/08  11:44:27  john
46  * Initial revision
47  *
48
49 ------------------------------------------------------------------------
50 2d/bitblt.c:
51
52  * Revision 1.29  1995/03/14  12:14:28  john
53  * Added code to double horz/vert bitblts.
54  *
55  * Revision 1.28  1995/03/13  09:01:48  john
56  * Fixed bug with VFX1 screen not tall enough.
57  *
58  * Revision 1.27  1995/03/01  15:38:10  john
59  * Better ModeX support.
60  *
61  * Revision 1.26  1994/12/15  12:19:00  john
62  * Added gr_bm_bitblt (clipped!) function.
63  *
64  * Revision 1.25  1994/12/09  18:58:42  matt
65  * Took out include of 3d.h
66  *
67  * Revision 1.24  1994/11/28  17:08:32  john
68  * Took out some unused functions in linear.asm, moved
69  * gr_linear_movsd from linear.asm to bitblt.c, made sure that
70  * the code in ibiblt.c sets the direction flags before rep movsing.
71  *
72  * Revision 1.22  1994/11/23  16:04:00  john
73  * Fixed generic rle'ing to use new bit method.
74  *
75  * Revision 1.21  1994/11/18  22:51:03  john
76  * Changed a bunch of shorts to ints in calls.
77  *
78  * Revision 1.20  1994/11/10  15:59:48  john
79  * Fixed bugs with canvas's being created with bogus bm_flags.
80  *
81  * Revision 1.19  1994/11/09  21:03:35  john
82  * Added RLE for svga gr_ubitmap.
83  *
84  * Revision 1.18  1994/11/09  17:41:29  john
85  * Made a slow version of rle bitblt to svga, modex.
86  *
87  * Revision 1.17  1994/11/09  16:35:15  john
88  * First version with working RLE bitmaps.
89  *
90  * Revision 1.16  1994/11/04  10:06:58  john
91  * Added fade table for fading fonts. Made font that partially clips
92  * not print a warning message.
93  *
94  * Revision 1.15  1994/09/22  16:08:38  john
95  * Fixed some palette stuff.
96  *
97  * Revision 1.14  1994/09/19  11:44:27  john
98  * Changed call to allocate selector to the dpmi module.
99  *
100  * Revision 1.13  1994/08/08  13:03:00  john
101  * Fixed bug in gr_bitmap in modex
102  *
103  * Revision 1.12  1994/07/13  19:47:23  john
104  * Fixed bug with modex bitblt to page 2 not working.
105  *
106  * Revision 1.11  1994/05/31  11:10:52  john
107  * *** empty log message ***
108  *
109  * Revision 1.10  1994/03/18  15:24:34  matt
110  * Removed interlace stuff
111  *
112  * Revision 1.9  1994/02/18  15:32:20  john
113  * *** empty log message ***
114  *
115  * Revision 1.8  1994/02/01  13:22:54  john
116  * *** empty log message ***
117  *
118  * Revision 1.7  1994/01/13  08:28:25  mike
119  * Modify rect copy to copy alternate scanlines when in interlaced mode.
120  *
121  * Revision 1.6  1993/12/28  12:09:46  john
122  * added lbitblt.asm
123  *
124  * Revision 1.5  1993/10/26  13:18:09  john
125  * *** empty log message ***
126  *
127  * Revision 1.4  1993/10/15  16:23:30  john
128  * y
129  *
130  * Revision 1.3  1993/09/13  17:52:58  john
131  * Fixed bug in BitBlt linear to SVGA
132  *
133  * Revision 1.2  1993/09/08  14:47:00  john
134  * Made bitmap00 add rowsize instead of bitmap width.
135  * Other routines might have this problem too.
136  *
137  * Revision 1.1  1993/09/08  11:43:01  john
138  * Initial revision
139
140 ------------------------------------------------------------------------
141 2d/bitmap.c:
142
143  * Revision 1.11  1995/08/23  18:46:06  allender
144  * fixed compiler warning
145  *
146  * Revision 1.10  1995/08/14  14:25:45  allender
147  * changed transparency color to 0
148  *
149  * Revision 1.9  1995/07/05  16:04:51  allender
150  * transparency/game kitchen changes
151  *
152  * Revision 1.8  1995/06/15  09:50:48  allender
153  * new malloc to align bitmap on 8 byte bountry
154  *
155  * Revision 1.7  1995/05/12  11:52:19  allender
156  * changed memory stuff again
157  *
158  * Revision 1.6  1995/05/11  12:48:34  allender
159  * nge transparency color
160  *
161  * Revision 1.5  1995/05/04  19:59:21  allender
162  * use NewPtr instead of malloc
163  *
164  * Revision 1.4  1995/04/27  07:33:04  allender
165  * rearrange functions
166  *
167  * Revision 1.3  1995/04/19  14:37:17  allender
168  * removed dead asm code
169  *
170  * Revision 1.2  1995/04/18  12:04:51  allender
171  * *** empty log message ***
172  *
173  * Revision 1.1  1995/03/09  08:48:06  allender
174  * Initial revision
175  *
176  *
177  * -------  PC version RCS information
178  * Revision 1.17  1994/11/18  22:50:25  john
179  * Changed shorts to ints in parameters.
180  *
181  * Revision 1.16  1994/11/10  15:59:46  john
182  * Fixed bugs with canvas's being created with bogus bm_flags.
183  *
184  * Revision 1.15  1994/10/26  23:55:53  john
185  * Took out roller; Took out inverse table.
186  *
187  * Revision 1.14  1994/09/19  14:40:21  john
188  * Changed dpmi stuff.
189  *
190  * Revision 1.13  1994/09/19  11:44:04  john
191  * Changed call to allocate selector to the dpmi module.
192  *
193  * Revision 1.12  1994/06/09  13:14:57  john
194  * Made selectors zero our
195  * out, I meant.
196  *
197  * Revision 1.11  1994/05/06  12:50:07  john
198  * Added supertransparency; neatend things up; took out warnings.
199  *
200  * Revision 1.10  1994/04/08  16:59:39  john
201  * Add fading poly's; Made palette fade 32 instead of 16.
202  *
203  * Revision 1.9  1994/03/16  17:21:09  john
204  * Added slow palette searching options.
205  *
206  * Revision 1.8  1994/03/14  17:59:35  john
207  * Added function to check bitmap's transparency.
208  *
209  * Revision 1.7  1994/03/14  17:16:21  john
210  * fixed bug with counting freq of pixels.
211  *
212  * Revision 1.6  1994/03/14  16:55:47  john
213  * Changed grs_bitmap structure to include bm_flags.
214  *
215  * Revision 1.5  1994/02/18  15:32:22  john
216  * *** empty log message ***
217  *
218  * Revision 1.4  1993/10/15  16:22:49  john
219  * *** empty log message ***
220  *
221  * Revision 1.3  1993/09/08  17:37:11  john
222  * Checking for errors with Yuan...
223  *
224  * Revision 1.2  1993/09/08  14:46:27  john
225  * looking for possible bugs...
226  *
227  * Revision 1.1  1993/09/08  11:43:05  john
228  * Initial revision
229  *
230
231 ------------------------------------------------------------------------
232 2d/clip.h:
233
234  * Revision 1.3  1993/10/15  16:22:28  john
235  * *** empty log message ***
236  *
237  * Revision 1.2  1993/09/29  16:14:31  john
238  * made work with fix point
239  *
240  * Revision 1.1  1993/09/08  11:40:53  john
241  * Initial revision
242  *
243  *
244
245 ------------------------------------------------------------------------
246 2d/ibitblt.c:
247
248  * Revision 1.3  1995/09/13  11:43:22  allender
249  * start on optimizing cockpit copy code
250  *
251  * Revision 1.2  1995/09/07  10:16:57  allender
252  * fixed up cockpit and rearview hole blitting
253  *
254  * Revision 1.1  1995/08/18  15:50:48  allender
255  * Initial revision
256  *
257  * Revision 1.6  1994/11/28  17:07:29  john
258  * Took out some unused functions in linear.asm, moved
259  * gr_linear_movsd from linear.asm to bitblt.c, made sure that
260  * the code in ibiblt.c sets the direction flags before rep movsing.
261  *
262  * Revision 1.5  1994/11/18  22:50:22  john
263  * Changed shorts to ints in parameters.
264  *
265  * Revision 1.4  1994/11/09  16:35:16  john
266  * First version with working RLE bitmaps.
267  *
268  * Revision 1.3  1994/10/03  17:18:05  john
269  * Fixed bug with edi not getting intialized to zero
270  * in create_mask.
271  *
272  * Revision 1.2  1994/05/31  11:10:55  john
273  * *** empty log message ***
274  *
275  * Revision 1.1  1994/05/30  16:08:27  john
276  * Initial revision
277  *
278
279 ------------------------------------------------------------------------
280 2d/palette.c:
281
282 ; Revision 1.20  1994/11/28  17:08:30  john
283 ; Took out some unused functions in linear.asm, moved
284 ; gr_linear_movsd from linear.asm to bitblt.c, made sure that
285 ; the code in ibiblt.c sets the direction flags before rep movsing.
286
287 ; Revision 1.19  1994/11/27  22:57:56  john
288 ; Took out some code that was never called.
289
290 ; Revision 1.18  1994/09/12  14:40:16  john
291 ; Neatend.
292
293 ; Revision 1.17  1994/07/27  18:30:30  john
294 ; Took away the blending table.
295
296 ; Revision 1.16  1994/04/08  16:59:28  john
297 ; Add fading poly's; Made palette fade 32 instead of 16.
298
299 ; Revision 1.15  1993/12/21  20:10:03  john
300 ; *** empty log message ***
301
302 ; Revision 1.14  1993/12/21  19:58:31  john
303 ; added selector stuff
304
305 ; Revision 1.13  1993/12/21  11:40:51  john
306 ; *** empty log message ***
307
308 ; Revision 1.12  1993/12/09  15:01:52  john
309 ; Changed palette stuff majorly
310
311 ; Revision 1.11  1993/12/08  16:41:02  john
312 ; *** empty log message ***
313
314 ; Revision 1.10  1993/12/08  11:50:17  john
315 ; Fixed bug with gr_init
316
317 ; Revision 1.9  1993/12/07  12:32:12  john
318 ; moved bmd_palette to gr_palette
319
320 ; Revision 1.8  1993/12/03  12:11:25  john
321 ; *** empty log message ***
322
323 ; Revision 1.7  1993/11/16  11:29:08  john
324 ; *** empty log message ***
325
326 ; Revision 1.6  1993/10/15  16:22:13  john
327 ; *** empty log message ***
328
329 ; Revision 1.5  1993/09/29  16:15:28  john
330 ; added assembler linear_line
331
332 ; Revision 1.4  1993/09/26  18:59:27  john
333 ; fade stuff
334
335 ; Revision 1.3  1993/09/21  14:00:59  john
336 ; added code to save 43/50 line text modes.
337
338 ; Revision 1.2  1993/09/16  17:28:06  john
339 ; added code to save/restore video mode
340
341 ; Revision 1.1  1993/09/08  11:41:30  john
342 ; Initial revision
343
344 ------------------------------------------------------------------------
345 2d/palette.c:
346
347  * Revision 1.41  1995/02/02  14:26:31  john
348  * Made palette fades work better with gamma thingy..
349  *
350  * Revision 1.40  1994/12/08  19:03:46  john
351  * Made functions use cfile.
352  *
353  * Revision 1.39  1994/12/01  11:23:27  john
354  * Limited Gamma from 0-8.
355  *
356  * Revision 1.38  1994/11/28  01:31:08  mike
357  * optimize color lookup function, caching recently used colors.
358  *
359  * Revision 1.37  1994/11/18  22:50:18  john
360  * Changed shorts to ints in parameters.
361  *
362  * Revision 1.36  1994/11/15  17:54:59  john
363  * Made text palette fade in when game over.
364  *
365  * Revision 1.35  1994/11/10  19:53:14  matt
366  * Fixed error handling is gr_use_palette_table()
367  *
368  * Revision 1.34  1994/11/07  13:53:48  john
369  * Added better gamma stufff.
370  *
371  * Revision 1.33  1994/11/07  13:37:56  john
372  * Added gamma correction stuff.
373  *
374  * Revision 1.32  1994/11/05  13:20:14  john
375  * Fixed bug with find_closest_color_current not working.
376  *
377  * Revision 1.31  1994/11/05  13:08:09  john
378  * MAde it return 0 when palette already faded out.
379  *
380  * Revision 1.30  1994/11/05  13:05:34  john
381  * Added back in code to allow keys during fade.
382  *
383  * Revision 1.29  1994/11/05  12:49:50  john
384  * Fixed bug with previous comment..
385  *
386  * Revision 1.28  1994/11/05  12:48:46  john
387  * Made palette only fade in / out when its supposed to.
388  *
389  * Revision 1.27  1994/11/05  12:46:43  john
390  * Changed palette stuff a bit.
391  *
392  * Revision 1.26  1994/11/01  12:59:35  john
393  * Reduced palette.256 size.
394  *
395  * Revision 1.25  1994/10/26  23:55:35  john
396  * Took out roller; Took out inverse table.
397  *
398  * Revision 1.24  1994/10/04  22:03:05  matt
399  * Fixed bug: palette wasn't fading all the way out or in
400  *
401  * Revision 1.23  1994/09/22  16:08:40  john
402  * Fixed some palette stuff.
403  *
404  * Revision 1.22  1994/09/19  11:44:31  john
405  * Changed call to allocate selector to the dpmi module.
406  *
407  * Revision 1.21  1994/09/12  19:28:09  john
408  * Fixed bug with unclipped fonts clipping.
409  *
410  * Revision 1.20  1994/09/12  18:18:39  john
411  * Set 254 and 255 to fade to themselves in fadetable
412  *
413  * Revision 1.19  1994/09/12  14:40:10  john
414  * Neatend.
415  *
416  * Revision 1.18  1994/09/09  09:31:55  john
417  * Made find_closest_color not look at superx spot of 254
418  *
419  * Revision 1.17  1994/08/09  11:27:08  john
420  * Add cthru stuff.
421  *
422  * Revision 1.16  1994/08/01  11:03:51  john
423  * MAde it read in old/new palette.256
424  *
425  * Revision 1.15  1994/07/27  18:30:27  john
426  * Took away the blending table.
427  *
428  * Revision 1.14  1994/06/09  10:39:52  john
429  * In fade out.in functions, returned 1 if key was pressed...
430  *
431  * Revision 1.13  1994/05/31  19:04:16  john
432  * Added key to stop fade if desired.
433  *
434  * Revision 1.12  1994/05/06  12:50:20  john
435  * Added supertransparency; neatend things up; took out warnings.
436  *
437  * Revision 1.11  1994/05/03  19:39:02  john
438  * *** empty log message ***
439  *
440  * Revision 1.10  1994/04/22  11:16:07  john
441  * *** empty log message ***
442  *
443  * Revision 1.9  1994/04/08  16:59:40  john
444  * Add fading poly's; Made palette fade 32 instead of 16.
445  *
446  * Revision 1.8  1994/03/16  17:21:17  john
447  * Added slow palette searching options.
448  *
449  * Revision 1.7  1994/01/07  11:47:33  john
450  * made use cflib
451  *
452  * Revision 1.6  1993/12/21  11:41:04  john
453  * *** empty log message ***
454  *
455  * Revision 1.5  1993/12/09  15:02:47  john
456  * Changed palette stuff majorly
457  *
458  * Revision 1.4  1993/12/07  12:31:41  john
459  * moved bmd_palette to gr_palette
460  *
461  * Revision 1.3  1993/10/15  16:22:23  john
462  * *** empty log message ***
463  *
464  * Revision 1.2  1993/09/26  18:59:46  john
465  * fade stuff
466  *
467  * Revision 1.1  1993/09/08  11:44:03  john
468  * Initial revision
469  *
470
471 ------------------------------------------------------------------------
472 2d/pcx.c:
473
474  * Revision 1.6  1995/03/01  15:38:12  john
475  * Better ModeX support.
476  *
477  * Revision 1.5  1995/01/21  17:54:17  john
478  * Added pcx reader for modes other than modex.
479  *
480  * Revision 1.4  1994/12/08  19:03:56  john
481  * Made functions use cfile.
482  *
483  * Revision 1.3  1994/11/29  02:53:24  john
484  * Added error messages; made call be more similiar to iff.
485  *
486  * Revision 1.2  1994/11/28  20:03:50  john
487  * Added PCX functions.
488  *
489  * Revision 1.1  1994/11/28  19:57:56  john
490  * Initial revision
491  *
492
493 ------------------------------------------------------------------------
494 2d/rle.c:
495
496  * Changed shorts to ints in parameters.
497  *
498  *
499  * Old Log:
500  * Revision 1.10  1995/08/14  14:26:34  allender
501  * changed transparency color to 0
502  *
503  * Revision 1.9  1995/07/05  16:07:49  allender
504  * transparency/kitchen chagnes
505  *
506  * Revision 1.8  1995/05/12  11:54:03  allender
507  * changed memory stuff again
508  *
509  * Revision 1.7  1995/05/11  12:49:19  allender
510  * change transparency color
511  *
512  * Revision 1.6  1995/05/04  20:00:30  allender
513  * use NewPtr instead of malloc.  Fix gr_rle_scanline (which caused me
514  * *many* hours of frustration!!!!)
515  *
516  * Revision 1.5  1995/05/01  08:40:32  allender
517  * trying to find memory bug....this stuff works -- it's johns code
518  *
519  * Revision 1.4  1995/04/27  07:38:24  allender
520  * new rle code ala John
521  *
522  * Revision 1.3  1995/04/19  14:36:06  allender
523  * *** empty log message ***
524  *
525  * Revision 1.2  1995/04/18  12:08:30  allender
526  * *** empty log message ***
527  *
528  * Revision 1.1  1995/03/09  09:23:04  allender
529  * Initial revision
530  *
531  *
532  * --- PC RCS information ---
533  * Revision 1.19  1995/01/14  19:18:31  john
534  * Added assert to check for paged out bitmap.
535  *
536  * Revision 1.18  1995/01/14  11:32:07  john
537  * Added rle_cache_flush function.
538  *
539  * Revision 1.17  1994/12/13  10:58:27  john
540  * Fixed bug with 2 consecutive calls to get_expanded_Texture
541  * with 2 different bitmaps, returning the same rle texture,
542  * causing doors to disapper.
543  *
544  * Revision 1.16  1994/11/30  00:55:03  mike
545  * optimization
546  *
547  * Revision 1.15  1994/11/24  13:24:44  john
548  * Made sure that some rep movs had the cld set first.
549  * Took some unused functions out.
550  *
551  * Revision 1.14  1994/11/23  16:03:46  john
552  * Fixed generic rle'ing to use new bit method.
553  *
554  * Revision 1.13  1994/11/23  15:45:51  john
555  * Changed to a 3 bit rle scheme.
556  *
557  * Revision 1.12  1994/11/18  22:50:24  john
558  * Changed shorts to ints in parameters.
559  *
560  * Revision 1.11  1994/11/14  17:06:13  john
561  * Took out Key_f12.
562  *
563  * Revision 1.10  1994/11/14  15:54:09  john
564  * Put code in for maybe checking bogus rle data.
565  *
566  * Revision 1.9  1994/11/14  15:51:58  john
567  * Added rle_disable_caching variable to prove the stability of my rle
568  * caching code to any non-believers.
569  *
570  * Revision 1.8  1994/11/10  10:31:20  john
571  * Reduce cache buffers to 16.
572  *
573  * Revision 1.7  1994/11/09  19:53:43  john
574  * Added texture rle caching.
575  *
576  * Revision 1.6  1994/11/09  17:41:44  john
577  * Made a slow version of rle bitblt to svga, modex.
578  *
579  * Revision 1.5  1994/11/09  17:07:50  john
580  * Fixed bug with bitmap that gets bigger with rle.
581  *
582  * Revision 1.4  1994/11/09  16:35:17  john
583  * First version with working RLE bitmaps.
584  *
585  * Revision 1.3  1994/10/26  12:54:47  john
586  * Fixed bug with decode that used rep movsd instead of
587  * rep stosd.
588  *
589  * Revision 1.2  1994/10/06  17:05:25  john
590  * First version of rle stuff.
591  *
592  * Revision 1.1  1994/10/06  16:53:34  john
593  * Initial revision
594
595 ------------------------------------------------------------------------
596 2d/scale.c:
597
598  * Revision 1.12  1995/03/14  15:14:11  john
599  * Increased max scanline length to 640.
600  * ..
601  * 
602  * Revision 1.11  1994/11/27  12:56:39  matt
603  * Took out unneeded include of 3d.h
604  * 
605  * Revision 1.10  1994/11/18  22:50:25  john
606  * Changed shorts to ints in parameters.
607  * 
608  * Revision 1.9  1994/11/09  16:35:02  john
609  * First version with working RLE bitmaps.
610  * 
611  * Revision 1.8  1994/06/09  13:15:17  john
612  * *** empty log message ***
613  * 
614  * Revision 1.7  1994/06/07  11:47:02  john
615  * Added back in the fast code for scaling up bitmaps.
616  * 
617  * Revision 1.6  1994/02/18  15:32:36  john
618  * *** empty log message ***
619  * 
620  * Revision 1.5  1994/01/22  14:35:01  john
621  * Added transparency as color index 255.
622  * 
623  * Revision 1.4  1994/01/17  16:59:12  john
624  * once again...
625  * 
626  * Revision 1.3  1994/01/17  16:51:17  john
627  * Added check so we don't draw outsibe
628  * the source bitmap's v coordinate... kind
629  * of a hack, but works.
630  * 
631  * Revision 1.2  1994/01/12  18:03:26  john
632  * The first iteration of fast scaler..
633  * 
634  * Revision 1.1  1994/01/11  14:48:42  john
635  * Initial revision
636
637 ------------------------------------------------------------------------
638 2d/scalea.asm:
639
640 ; Revision 1.2  1994/01/12  18:02:52  john
641 ; Asm code for the scaler... first iteration here
642 ; has compiled code that works!!
643
644 ; Revision 1.1  1994/01/12  12:20:11  john
645 ; Initial revision
646
647 ------------------------------------------------------------------------
648 3d/clipper.h:
649
650  * Revision 1.1  1995/05/05  08:50:13  allender
651  * Initial revision
652  *
653  * Revision 1.1  1995/04/17  19:56:58  matt
654  * Initial revision
655  * 
656  * 
657
658 ------------------------------------------------------------------------
659 3d/globvars.c:
660
661  * Revision 1.2  1995/09/13  11:30:47  allender
662  * added fCanv_w2 and vCanv_h2 for PPC implementation
663  *
664  * Revision 1.1  1995/05/05  08:50:48  allender
665  * Initial revision
666  *
667  * Revision 1.1  1995/04/17  04:24:57  matt
668  * Initial revision
669
670 ------------------------------------------------------------------------
671 3d/globvars.h:
672
673  * Revision 1.2  1995/09/13  11:31:19  allender
674  * added fCanv_w2 and vCanv_h2 for PPC implementation
675  *
676  * Revision 1.1  1995/05/05  08:51:02  allender
677  * Initial revision
678  *
679  * Revision 1.1  1995/04/17  04:07:58  matt
680  * Initial revision
681
682 ------------------------------------------------------------------------
683 3d/instance.c:
684
685  * Revision 1.2  1995/06/12  12:36:57  allender
686  * fixed bug where g3_start_instance_angles recursively called itself
687  *
688  * Revision 1.1  1995/05/05  08:51:27  allender
689  * Initial revision
690  *
691  * Revision 1.1  1995/04/17  06:43:29  matt
692  * Initial revision
693
694 ------------------------------------------------------------------------
695 3d/interp.c:
696
697  * Revision 1.4  1995/10/10  22:20:09  allender
698  * new morphing code from Matt
699  *
700  * Revision 1.3  1995/08/31  15:40:24  allender
701  * swap color data correctly
702  *
703  * Revision 1.2  1995/05/11  13:06:38  allender
704  * fix int --> short problem
705  *
706  * Revision 1.1  1995/05/05  08:51:41  allender
707  * Initial revision
708  *
709  * Revision 1.1  1995/04/17  06:44:33  matt
710  * Initial revision
711
712 ------------------------------------------------------------------------
713 3d/matrix.c:
714
715  * Revision 1.1  1995/05/05  08:52:11  allender
716  * Initial revision
717  *
718  * Revision 1.1  1995/04/17  04:14:34  matt
719  * Initial revision
720
721 ------------------------------------------------------------------------
722 3d/points.c:
723
724  * Revision 1.3  1995/09/21  17:29:40  allender
725  * changed project_point to overflow if z <= 0
726  *
727  * Revision 1.2  1995/09/13  11:31:28  allender
728  * removed checkmuldiv from g3_project_point
729  *
730  * Revision 1.1  1995/05/05  08:52:35  allender
731  * Initial revision
732  *
733  * Revision 1.1  1995/04/17  04:32:25  matt
734  * Initial revision
735
736 ------------------------------------------------------------------------
737 3d/rod.c:
738
739  * Revision 1.2  1995/09/13  11:31:46  allender
740  * removed checkmuldiv in PPC implemenation
741  *
742  * Revision 1.1  1995/05/05  08:52:45  allender
743  * Initial revision
744  *
745  * Revision 1.1  1995/04/17  06:42:08  matt
746  * Initial revision
747
748 ------------------------------------------------------------------------
749 3d/setup.c:
750
751  * Revision 1.4  1995/10/11  00:27:04  allender
752  * bash free_num_points to 0
753  *
754  * Revision 1.3  1995/09/13  11:31:58  allender
755  * calc for fCanv_w2 and fCanv_h2
756  *
757  * Revision 1.2  1995/06/25  21:57:57  allender
758  * *** empty log message ***
759  *
760  * Revision 1.1  1995/05/05  08:52:54  allender
761  * Initial revision
762  *
763  * Revision 1.1  1995/04/17  03:59:01  matt
764  * Initial revision
765
766 ------------------------------------------------------------------------
767 arch/dos/bak/ipx.c:
768
769  * Revision 2.10  1995/03/29  17:27:55  john
770  * Added code to not duplicate broadcasts.
771  *
772  * Revision 2.9  1995/03/29  15:32:07  john
773  * NEatened.
774  *
775  * Revision 2.8  1995/03/29  15:07:31  john
776  * Added network support.
777  *
778  * Revision 2.7  1995/03/29  11:22:27  john
779  * Added broadcasting over a net.
780  *
781  * Revision 2.6  1995/03/28  20:05:03  john
782  * Took away alternate server stuff.
783  *
784  * Revision 2.5  1995/03/23  19:14:29  john
785  * Added better MAX_USERS message.
786  *
787  * Revision 2.4  1995/03/23  19:00:02  john
788  * Added user list capabitly.
789  *
790  * Revision 2.3  1995/03/23  12:27:05  john
791  * Move IPX into bios lib.
792  *
793  * Revision 2.2  1995/03/22  19:08:15  john
794  * Added code to fix sending packets over router... now
795  * we just need to make broadcasts go over router!!
796  *
797  * Revision 2.1  1995/03/21  08:40:16  john
798  * Ifdef'd out the NETWORK code.
799  *
800  * Revision 2.0  1995/02/27  11:30:45  john
801  * New version 2.0, which has no anonymous unions, builds with
802  * Watcom 10.0, and doesn't require parsing BITMAPS.TBL.
803  *
804  * Revision 1.31  1995/02/16  17:35:03  john
805  * Added code to allow dynamic socket changing.
806  *
807  * Revision 1.30  1995/02/01  21:03:45  john
808  * Lintified.
809  *
810  * Revision 1.29  1995/01/22  14:31:05  john
811  * Added key.h
812  *
813  * Revision 1.28  1995/01/22  14:29:26  john
814  * Added code to bypass broadcast messages.
815  *
816  * Revision 1.27  1995/01/03  13:46:16  john
817  * Added code that should make ipx work over different servers,
818  * but ifdef'd it out with SHAREWARE in ipx.c.  I haven't tested
819  * this, and I hope it doesn't introduce net bugs.
820  *
821  * Revision 1.26  1994/12/14  11:54:37  rob
822  * Reduce # of ipx packets.
823  *
824  * Revision 1.25  1994/12/11  00:43:28  john
825  * Locked down DOS ipx buffers... probably not necessary, tho.
826  *
827  * Revision 1.24  1994/12/08  15:49:58  rob
828  * Bumped up the # of ipx packets.
829  *
830  * Revision 1.23  1994/12/04  15:23:54  rob
831  * Reduced packet # constants.
832  *
833  * Revision 1.22  1994/11/27  23:12:39  matt
834  * Made changes for new mprintf calling convention
835  *
836  * Revision 1.21  1994/11/19  15:15:19  mike
837  * remove unused code and data
838  *
839  * Revision 1.20  1994/11/10  11:06:07  rob
840  * Raised number of ipx packets to 64 and buffers to 128 (for 8-way games)
841  * Removed (commented out) all the spx support stuff.
842  *
843  * Revision 1.19  1994/11/07  17:50:12  rob
844  * Bumped up max_packets and ipx_num_packets to double their previous
845  * values.
846  *
847  * Revision 1.18  1994/11/07  15:39:01  rob
848  * Removed temporary hacked ipx_send_object function.
849  * Replaced with a more general thing.
850  *
851  * Revision 1.17  1994/11/05  16:08:40  rob
852  * Made a change necessary for object syncing on rejoin.
853  *
854  * Revision 1.16  1994/11/01  15:57:12  rob
855  * Added support for SPX sockets for critical messages.
856  *
857  * Revision 1.15  1994/10/31  19:21:01  rob
858  * Added a routine for sending objects via ipx.  Its a hack and shoukld
859  * be replaced by something more general time permitting.
860  *
861  * Revision 1.14  1994/10/20  14:57:42  john
862  * Some test stuff.
863  *
864  * Revision 1.13  1994/10/20  11:22:45  john
865  * Tweaked the number of waiting packets. Added code to print
866  * total packets missed, and to limit the packet send rate to
867  * 10 packets per second unless firing.
868  *
869  * Revision 1.12  1994/10/03  20:50:11  john
870  * Started adding sound pause functions.
871  *
872  * Revision 1.11  1994/09/15  08:54:24  mike
873  * comment out a mprintf.
874  *
875  * Revision 1.10  1994/09/12  19:38:20  john
876  * Made some stuff that prints to the DOS screen go to the
877  * mono instead, since it really is debugging info.
878  *
879  * Revision 1.9  1994/09/07  13:32:03  john
880  * Made ipx_close explicitly close the socket we were using,
881  * because it seems that VLM's don't automatically close them
882  * like the older NETX stuff did (Going from Novell 3.11 driver
883  * to 3.12 anyway).
884  *
885  * Revision 1.8  1994/09/06  19:29:20  john
886  * Added trial version of rejoin function.
887  *
888  * Revision 1.7  1994/08/09  19:31:50  john
889  * Networking changes.
890  *
891  * Revision 1.6  1994/08/05  16:11:41  john
892  * Psuedo working version of networking.
893  *
894  * Revision 1.5  1994/08/04  19:17:21  john
895  * Inbetween version of network stuff.
896  *
897  * Revision 1.4  1994/07/29  16:08:57  john
898  * *** empty log message ***
899  *
900  * Revision 1.3  1994/07/25  12:33:31  john
901  * Network "pinging" in.
902  *
903  * Revision 1.2  1994/07/20  15:58:28  john
904  * First installment of ipx stuff.
905  *
906  * Revision 1.1  1994/07/19  15:42:00  john
907  * Initial revision
908
909 ------------------------------------------------------------------------
910 arch/dos/ipx.c:
911
912  * Revision 2.10  1995/03/29  17:27:55  john
913  * Added code to not duplicate broadcasts.
914  *
915  * Revision 2.9  1995/03/29  15:32:07  john
916  * NEatened.
917  *
918  * Revision 2.8  1995/03/29  15:07:31  john
919  * Added network support.
920  *
921  * Revision 2.7  1995/03/29  11:22:27  john
922  * Added broadcasting over a net.
923  *
924  * Revision 2.6  1995/03/28  20:05:03  john
925  * Took away alternate server stuff.
926  *
927  * Revision 2.5  1995/03/23  19:14:29  john
928  * Added better MAX_USERS message.
929  *
930  * Revision 2.4  1995/03/23  19:00:02  john
931  * Added user list capabitly.
932  *
933  * Revision 2.3  1995/03/23  12:27:05  john
934  * Move IPX into bios lib.
935  *
936  * Revision 2.2  1995/03/22  19:08:15  john
937  * Added code to fix sending packets over router... now
938  * we just need to make broadcasts go over router!!
939  *
940  * Revision 2.1  1995/03/21  08:40:16  john
941  * Ifdef'd out the NETWORK code.
942  *
943  * Revision 2.0  1995/02/27  11:30:45  john
944  * New version 2.0, which has no anonymous unions, builds with
945  * Watcom 10.0, and doesn't require parsing BITMAPS.TBL.
946  *
947  * Revision 1.31  1995/02/16  17:35:03  john
948  * Added code to allow dynamic socket changing.
949  *
950  * Revision 1.30  1995/02/01  21:03:45  john
951  * Lintified.
952  *
953  * Revision 1.29  1995/01/22  14:31:05  john
954  * Added key.h
955  *
956  * Revision 1.28  1995/01/22  14:29:26  john
957  * Added code to bypass broadcast messages.
958  *
959  * Revision 1.27  1995/01/03  13:46:16  john
960  * Added code that should make ipx work over different servers,
961  * but ifdef'd it out with SHAREWARE in ipx.c.  I haven't tested
962  * this, and I hope it doesn't introduce net bugs.
963  *
964  * Revision 1.26  1994/12/14  11:54:37  rob
965  * Reduce # of ipx packets.
966  *
967  * Revision 1.25  1994/12/11  00:43:28  john
968  * Locked down DOS ipx buffers... probably not necessary, tho.
969  *
970  * Revision 1.24  1994/12/08  15:49:58  rob
971  * Bumped up the # of ipx packets.
972  *
973  * Revision 1.23  1994/12/04  15:23:54  rob
974  * Reduced packet # constants.
975  *
976  * Revision 1.22  1994/11/27  23:12:39  matt
977  * Made changes for new mprintf calling convention
978  *
979  * Revision 1.21  1994/11/19  15:15:19  mike
980  * remove unused code and data
981  *
982  * Revision 1.20  1994/11/10  11:06:07  rob
983  * Raised number of ipx packets to 64 and buffers to 128 (for 8-way games)
984  * Removed (commented out) all the spx support stuff.
985  *
986  * Revision 1.19  1994/11/07  17:50:12  rob
987  * Bumped up max_packets and ipx_num_packets to double their previous
988  * values.
989  *
990  * Revision 1.18  1994/11/07  15:39:01  rob
991  * Removed temporary hacked ipx_send_object function.
992  * Replaced with a more general thing.
993  *
994  * Revision 1.17  1994/11/05  16:08:40  rob
995  * Made a change necessary for object syncing on rejoin.
996  *
997  * Revision 1.16  1994/11/01  15:57:12  rob
998  * Added support for SPX sockets for critical messages.
999  *
1000  * Revision 1.15  1994/10/31  19:21:01  rob
1001  * Added a routine for sending objects via ipx.  Its a hack and shoukld
1002  * be replaced by something more general time permitting.
1003  *
1004  * Revision 1.14  1994/10/20  14:57:42  john
1005  * Some test stuff.
1006  *
1007  * Revision 1.13  1994/10/20  11:22:45  john
1008  * Tweaked the number of waiting packets. Added code to print
1009  * total packets missed, and to limit the packet send rate to
1010  * 10 packets per second unless firing.
1011  *
1012  * Revision 1.12  1994/10/03  20:50:11  john
1013  * Started adding sound pause functions.
1014  *
1015  * Revision 1.11  1994/09/15  08:54:24  mike
1016  * comment out a mprintf.
1017  *
1018  * Revision 1.10  1994/09/12  19:38:20  john
1019  * Made some stuff that prints to the DOS screen go to the
1020  * mono instead, since it really is debugging info.
1021  *
1022  * Revision 1.9  1994/09/07  13:32:03  john
1023  * Made ipx_close explicitly close the socket we were using,
1024  * because it seems that VLM's don't automatically close them
1025  * like the older NETX stuff did (Going from Novell 3.11 driver
1026  * to 3.12 anyway).
1027  *
1028  * Revision 1.8  1994/09/06  19:29:20  john
1029  * Added trial version of rejoin function.
1030  *
1031  * Revision 1.7  1994/08/09  19:31:50  john
1032  * Networking changes.
1033  *
1034  * Revision 1.6  1994/08/05  16:11:41  john
1035  * Psuedo working version of networking.
1036  *
1037  * Revision 1.5  1994/08/04  19:17:21  john
1038  * Inbetween version of network stuff.
1039  *
1040  * Revision 1.4  1994/07/29  16:08:57  john
1041  * *** empty log message ***
1042  *
1043  * Revision 1.3  1994/07/25  12:33:31  john
1044  * Network "pinging" in.
1045  *
1046  * Revision 1.2  1994/07/20  15:58:28  john
1047  * First installment of ipx stuff.
1048  *
1049  * Revision 1.1  1994/07/19  15:42:00  john
1050  * Initial revision
1051
1052 ------------------------------------------------------------------------
1053 arch/dos/ipx.h:
1054
1055  * $Log: not supported by cvs2svn $
1056  * Revision 1.1  2004/08/28 23:17:45  schaffner
1057  * move old per-file change logs into new file ChangeLog-old
1058  *
1059  * Revision 1.1.1.1  2001/01/19 03:30:15  bradleyb
1060  * Import of d2x-0.0.8
1061  *
1062  * Revision 1.1.1.1  1999/06/14 21:58:39  donut
1063  * Import of d1x 1.37 source.
1064  *
1065  * Revision 2.6  1995/03/29  11:19:32  john
1066  * Added broadcasting over a net.
1067  * 
1068  * Revision 2.5  1995/03/28  20:04:43  john
1069  * Took away alternate server stuff.
1070  * 
1071  * Revision 2.4  1995/03/23  19:00:10  john
1072  * Added user list capabitly.
1073  * 
1074  * Revision 2.3  1995/03/23  12:26:57  john
1075  * Move IPX into bios lib.
1076  * 
1077  * Revision 2.2  1995/03/22  19:08:14  john
1078  * Added code to fix sending packets over router... now
1079  * we just need to make broadcasts go over router!!
1080  * 
1081  * Revision 2.1  1995/03/21  08:39:56  john
1082  * Ifdef'd out the NETWORK code.
1083  * 
1084  * Revision 2.0  1995/02/27  11:30:16  john
1085  * New version 2.0, which has no anonymous unions, builds with
1086  * Watcom 10.0, and doesn't require parsing BITMAPS.TBL.
1087  * 
1088  * Revision 1.16  1995/02/16  17:34:52  john
1089  * Added code to allow dynamic socket changing.
1090  * 
1091  * Revision 1.15  1995/01/04  21:43:27  rob
1092  * Remove SPX size definition.
1093  * 
1094  * Revision 1.14  1995/01/03  13:46:18  john
1095  * Added code that should make ipx work over different servers,
1096  * but ifdef'd it out with SHAREWARE in ipx.c.  I haven't tested
1097  * this, and I hope it doesn't introduce net bugs.
1098  * 
1099  * Revision 1.13  1994/11/02  11:37:16  rob
1100  * Changed default socket number to a higher regions.
1101  * 
1102  * Revision 1.12  1994/11/01  15:56:51  rob
1103  * Added defines for SPX socketsx.
1104  * 
1105  * Revision 1.11  1994/10/31  19:23:31  rob
1106  * Added a prototype for the new object send function.
1107  * 
1108  * Revision 1.10  1994/09/07  13:37:25  john
1109  * Changed default socket to 0x4000, because 
1110  * the ipx/spx book says that we can only use
1111  * sockets 0x4000 - 0x7fff.
1112  * 
1113  * Revision 1.9  1994/08/25  18:14:45  matt
1114  * Changed socket because of packet change
1115  * 
1116  * Revision 1.8  1994/08/12  22:42:24  john
1117  * Took away Player_stats; added Players array.
1118  * 
1119  * Revision 1.7  1994/08/09  19:31:47  john
1120  * Networking changes.
1121  * 
1122  * Revision 1.6  1994/08/05  16:11:46  john
1123  * Psuedo working version of networking.
1124  * 
1125  * Revision 1.5  1994/08/04  19:17:20  john
1126  * Inbetween version of network stuff.
1127  * 
1128  * Revision 1.4  1994/07/29  16:08:59  john
1129  * *** empty log message ***
1130  * 
1131  * Revision 1.3  1994/07/25  12:33:22  john
1132  * Network "pinging" in.
1133  * 
1134  * Revision 1.2  1994/07/20  15:58:29  john
1135  * First installment of ipx stuff.
1136  * 
1137  * Revision 1.1  1994/07/19  15:43:05  john
1138  * Initial revision
1139
1140 ------------------------------------------------------------------------
1141 arch/dos/joy.c:
1142
1143  * $Log: not supported by cvs2svn $
1144  * Revision 1.1  2004/08/28 23:17:45  schaffner
1145  * move old per-file change logs into new file ChangeLog-old
1146  *
1147  * Revision 1.5  2004/05/22 01:40:12  btb
1148  * use JOY_NUM_AXES instead of 4 in joy_(get|set)_cal_vals (d1x r1.3, r1.4)
1149  *
1150  * Revision 1.4  2001/10/24 09:25:05  bradleyb
1151  * Moved input stuff to arch subdirs, as in d1x.
1152  *
1153  * Revision 1.3  2001/01/29 14:03:56  bradleyb
1154  * Fixed build, minor fixes
1155  *
1156  * Revision 1.2  2001/01/24 04:29:45  bradleyb
1157  * changed args_find to FindArg
1158  *
1159  * Revision 1.1.1.2  2001/01/19 03:33:52  bradleyb
1160  * Import of d2x-0.0.9-pre1
1161  *
1162  * Revision 1.1.1.1  1999/06/14 21:58:26  donut
1163  * Import of d1x 1.37 source.
1164  *
1165  * Revision 1.37  1995/10/07  13:22:31  john
1166  * Added new method of reading joystick that allows higher-priority
1167  * interrupts to go off.
1168  * 
1169  * Revision 1.36  1995/03/30  11:03:40  john
1170  * Made -JoyBios read buttons using BIOS.
1171  * 
1172  * Revision 1.35  1995/02/14  11:39:25  john
1173  * Added polled/bios joystick readers..
1174  * 
1175  * Revision 1.34  1995/02/10  17:06:12  john
1176  * Fixed bug with plugging in a joystick not getting detected.
1177  * 
1178  * Revision 1.33  1995/01/27  16:39:42  john
1179  * Made so that if no joystick detected, it wont't
1180  * read buttons.
1181  * 
1182  * Revision 1.32  1995/01/12  13:16:40  john
1183  * Made it so that joystick can't lose an axis
1184  * by 1 weird reading. Reading has to occurr during
1185  * calibration for this to happen.
1186  * 
1187  * Revision 1.31  1994/12/28  15:56:03  john
1188  * Fixed bug that refused to read joysticks whose 
1189  * min,cen,max were less than 100 apart.
1190  * 
1191  * Revision 1.30  1994/12/28  15:31:53  john
1192  * Added code to read joystick axis not all at one time.
1193  * 
1194  * Revision 1.29  1994/12/27  15:44:36  john
1195  * Made the joystick timeout be at 1/100th of a second, 
1196  * regardless of CPU speed.
1197  * 
1198  * Revision 1.28  1994/12/04  11:54:54  john
1199  * Made stick read at whatever rate the clock is at, not
1200  * at 18.2 times/second.
1201  * 
1202  * Revision 1.27  1994/11/29  02:25:40  john
1203  * Made it so that the scaled reading returns 0 
1204  * if the calibration factors look funny..
1205  * 
1206  * Revision 1.26  1994/11/22  11:08:07  john
1207  * Commented out the ARCADE joystick.
1208  * 
1209  * Revision 1.25  1994/11/14  19:40:26  john
1210  * Fixed bug with no joystick being detected.
1211  * 
1212  * Revision 1.24  1994/11/14  19:36:40  john
1213  * Took out initial cheapy calibration.
1214  * 
1215  * Revision 1.23  1994/11/14  19:13:27  john
1216  * Took out the calibration in joy_init
1217  * 
1218  * Revision 1.22  1994/10/17  10:09:57  john
1219  * Made the state look at last_State, so that a joy_flush
1220  * doesn't cause a new down state to be added next reading.
1221  * 
1222  * Revision 1.21  1994/10/13  11:36:23  john
1223  * Made joy_down_time be kept track of in fixed seconds,
1224  * not ticks.
1225  * 
1226  * Revision 1.20  1994/10/12  16:58:50  john
1227  * Fixed bug w/ previous comment.
1228  * 
1229  * Revision 1.19  1994/10/12  16:57:44  john
1230  * Added function to set a joystick button's state.
1231  * 
1232  * Revision 1.18  1994/10/11  10:20:13  john
1233  * Fixed Flightstick Pro/
1234  * ..
1235  * 
1236  * Revision 1.17  1994/09/29  18:29:20  john
1237  * *** empty log message ***
1238  * 
1239  * Revision 1.16  1994/09/27  19:17:23  john
1240  * Added code so that is joy_init is never called, joystick is not
1241  * used at all.
1242  * 
1243  * Revision 1.15  1994/09/22  16:09:23  john
1244  * Fixed some virtual memory lockdown problems with timer and
1245  * joystick.
1246  * 
1247  * Revision 1.14  1994/09/16  11:44:42  john
1248  * Fixed bug with slow joystick.
1249  * 
1250  * Revision 1.13  1994/09/16  11:36:15  john
1251  * Fixed bug with reading non-present channels.
1252  * 
1253  * Revision 1.12  1994/09/15  20:52:48  john
1254  * rme john
1255  * Added support for the Arcade style joystick.
1256  * 
1257  * Revision 1.11  1994/09/13  20:04:49  john
1258  * Fixed bug with joystick button down_time.
1259  * 
1260  * Revision 1.10  1994/09/10  13:48:07  john
1261  * Made all 20 buttons read.
1262  * 
1263  * Revision 1.9  1994/08/31  09:55:02  john
1264  * *** empty log message ***
1265  * 
1266  * Revision 1.8  1994/08/29  21:02:14  john
1267  * Added joy_set_cal_values...
1268  * 
1269  * Revision 1.7  1994/08/29  20:52:17  john
1270  * Added better cyberman support; also, joystick calibration
1271  * value return funcctiionn,
1272  * 
1273  * Revision 1.6  1994/08/24  18:53:12  john
1274  * Made Cyberman read like normal mouse; added dpmi module; moved
1275  * mouse from assembly to c. Made mouse buttons return time_down.
1276  * 
1277  * Revision 1.5  1994/07/14  22:12:23  john
1278  * Used intrinsic forms of outp to fix vmm error.
1279  * 
1280  * Revision 1.4  1994/07/07  19:52:59  matt
1281  * Made joy_init() return success/fail flag
1282  * Made joy_init() properly detect a stick if one is plugged in after joy_init()
1283  * was called the first time.
1284  * 
1285  * Revision 1.3  1994/07/01  10:55:55  john
1286  * Fixed some bugs... added support for 4 axis.
1287  * 
1288  * Revision 1.2  1994/06/30  20:36:55  john
1289  * Revamped joystick code.
1290  * 
1291  * Revision 1.1  1994/06/30  15:42:15  john
1292  * Initial revision
1293
1294 ------------------------------------------------------------------------
1295 arch/dos/joydefs.c:
1296
1297  * $Log: not supported by cvs2svn $
1298  * Revision 1.1  2004/08/28 23:17:45  schaffner
1299  * move old per-file change logs into new file ChangeLog-old
1300  *
1301  * Revision 1.3  2001/10/24 09:25:05  bradleyb
1302  * Moved input stuff to arch subdirs, as in d1x.
1303  *
1304  * Revision 1.2  2001/01/29 14:03:57  bradleyb
1305  * Fixed build, minor fixes
1306  *
1307  * Revision 1.1.1.2  2001/01/19 03:33:52  bradleyb
1308  * Import of d2x-0.0.9-pre1
1309  *
1310  * Revision 1.1.1.1  1999/06/14 21:58:29  donut
1311  * Import of d1x 1.37 source.
1312  *
1313  * Revision 2.2  1995/06/30  12:30:22  john
1314  * Added -Xname command line.
1315  * 
1316  * Revision 2.1  1995/04/06  12:13:20  john
1317  * Made so you can calibrate Gravis Gamepad.
1318  * 
1319  * Revision 2.0  1995/02/27  11:30:27  john
1320  * New version 2.0, which has no anonymous unions, builds with
1321  * Watcom 10.0, and doesn't require parsing BITMAPS.TBL.
1322  * 
1323  * Revision 1.71  1995/02/12  02:06:10  john
1324  * Fixed bug with joystick incorrectly asking for
1325  * calibration.
1326  * 
1327  * Revision 1.70  1995/01/28  15:58:07  john
1328  * Made joystick calibration be only when wrong detected in
1329  * menu or joystick axis changed.
1330  * 
1331  * Revision 1.69  1995/01/25  14:37:55  john
1332  * Made joystick only prompt for calibration once...
1333  * 
1334  * Revision 1.68  1995/01/24  16:34:29  john
1335  * Made so that if you reconfigure joystick and
1336  * add or subtract an axis, it asks for a recalibration
1337  * upon leaving.
1338  * 
1339  * Revision 1.67  1994/12/29  11:08:51  john
1340  * Fixed Thrustmaster and Logitech Wingman extreme
1341  * Hat by reading the y2 axis during the center stage
1342  * of the calibration, and using 75, 50, 27, and 3 %
1343  * as values for the 4 positions.
1344  * 
1345  * Revision 1.66  1994/12/15  18:17:39  john
1346  * Fixed warning with previous.
1347  * 
1348  * Revision 1.65  1994/12/15  18:15:48  john
1349  * Made the joy cal only write the .cfg file, not
1350  * the player file.
1351  * 
1352  * Revision 1.64  1994/12/13  14:43:35  john
1353  * Took out the code in kconfig to build direction array.
1354  * Called kc_set_controls after selecting a new control type.
1355  * 
1356  * Revision 1.63  1994/12/10  12:08:47  john
1357  * Changed some delays to use TICKER instead of timer_get_fixed_seconds.
1358  * 
1359  * Revision 1.62  1994/12/09  11:01:07  mike
1360  * force calibration of joystick on joystick selection from Controls... menu.
1361  * 
1362  * Revision 1.61  1994/12/07  21:50:27  john
1363  * Put stop/start time around joystick delay.
1364  * 
1365  * Revision 1.60  1994/12/07  19:34:39  john
1366  * Added delay.
1367  * 
1368  * Revision 1.59  1994/12/07  18:12:14  john
1369  * NEatened up joy cal.,
1370  * 
1371  * Revision 1.58  1994/12/07  17:07:51  john
1372  * Fixed up joy cal.
1373  * 
1374  * Revision 1.57  1994/12/07  16:48:53  yuan
1375  * localization
1376  * 
1377  * Revision 1.56  1994/12/07  16:05:55  john
1378  * Changed the way joystick calibration works.
1379  * 
1380  * Revision 1.55  1994/12/06  20:15:22  john
1381  * Took out code that unpauses songs that were never paused.
1382  * 
1383  * Revision 1.54  1994/12/06  15:14:09  yuan
1384  * Localization
1385  * 
1386  * Revision 1.53  1994/12/05  16:29:16  john
1387  * Took out music pause around the cheat menu.
1388  * 
1389  * Revision 1.52  1994/12/04  12:39:10  john
1390  * MAde so that FCS calibration doesn't ask for axis #2.
1391  * 
1392  * Revision 1.51  1994/12/03  15:14:59  john
1393  * Took out the delay mentioned previosuly cause it would
1394  * cause bigger problems than it helps, especially with netgames.
1395  * 
1396  * Revision 1.50  1994/12/03  14:16:14  john
1397  * Put a delay between screens in joy cal to keep Yuan from
1398  * double hitting.
1399  * 
1400  * Revision 1.49  1994/12/03  11:04:06  john
1401  * Changed newmenu code a bit to fix bug with bogus
1402  * backgrounds occcasionally.
1403  * 
1404  * Revision 1.48  1994/12/02  11:03:44  yuan
1405  * Localization.
1406  * 
1407  * Revision 1.47  1994/12/02  10:50:33  yuan
1408  * Localization
1409  * 
1410  * Revision 1.46  1994/12/01  12:21:59  john
1411  * Added code to calibrate 2 joysticks separately.
1412  * 
1413  * Revision 1.45  1994/12/01  11:52:31  john
1414  * Added message when you select FCS to say that if
1415  * you have WCS, see manuel.
1416  * 
1417  * Revision 1.44  1994/11/29  02:26:28  john
1418  * Made the prompts for upper-left, lower right for joy
1419  * calibration more obvious.
1420  * 
1421  * Revision 1.43  1994/11/26  13:13:59  matt
1422  * Changed "none" option to "keyboard only"
1423  * 
1424  * Revision 1.42  1994/11/21  19:35:13  john
1425  * Replaced calls to joy_init with if (joy_present)
1426  * 
1427  * Revision 1.41  1994/11/21  19:28:34  john
1428  * Changed warning for no joystick to use nm_messagebox..
1429  * 
1430  * Revision 1.40  1994/11/21  19:06:25  john
1431  * Made it so that it only stops sound when your in game mode. 
1432  * 
1433  * Revision 1.39  1994/11/21  11:47:18  john
1434  * Made sound pause during joystick calibration.
1435  * 
1436  * Revision 1.38  1994/11/10  20:34:18  rob
1437  * Removed menu-specific network mode support in favor in new stuff
1438  * in newmenu.c
1439  * 
1440  * Revision 1.37  1994/11/08  21:21:38  john
1441  * Made Esc exit joystick calibration.
1442  * 
1443  * Revision 1.36  1994/11/08  15:14:42  john
1444  * Added more calls so net doesn't die in net game.
1445  * 
1446  * Revision 1.35  1994/11/08  14:59:12  john
1447  * Added code to respond to network while in menus.
1448  * 
1449  * Revision 1.34  1994/10/24  19:56:32  john
1450  * Made the new user setup prompt for config options.
1451  * 
1452  * Revision 1.33  1994/10/22  14:11:52  mike
1453  * Suppress compiler warning message.
1454  * 
1455  * Revision 1.32  1994/10/19  12:44:24  john
1456  * Added hours field to player structure.
1457  * 
1458  * Revision 1.31  1994/10/17  13:07:13  john
1459  * Moved the descent.cfg info into the player config file.
1460  * 
1461  * Revision 1.30  1994/10/13  21:41:12  john
1462  * MAde Esc exit out of joystick calibration.
1463  * 
1464  * Revision 1.29  1994/10/13  19:22:27  john
1465  * Added separate config saves for different devices.
1466  * Made all the devices work together better, such as mice won't
1467  * get read when you're playing with the joystick.
1468  * 
1469  * Revision 1.28  1994/10/13  11:40:18  john
1470  * Took out warnings.
1471  * 
1472  * Revision 1.27  1994/10/13  11:35:23  john
1473  * Made Thrustmaster FCS Hat work.  Put a background behind the
1474  * keyboard configure.  Took out turn_sensitivity.  Changed sound/config
1475  * menu to new menu. Made F6 be calibrate joystick.
1476  * 
1477  * Revision 1.26  1994/10/11  21:29:03  matt
1478  * Made a bunch of menus have good initial selected values
1479  * 
1480  * Revision 1.25  1994/10/11  17:08:39  john
1481  * Added sliders for volume controls.
1482  * 
1483  * Revision 1.24  1994/10/10  17:59:21  john
1484  * Neatend previous.
1485  * 
1486  * Revision 1.23  1994/10/10  17:57:59  john
1487  * Neatend previous.
1488  * 
1489  * Revision 1.22  1994/10/10  17:56:11  john
1490  * Added messagebox that tells that config has been saved.
1491  * 
1492  * Revision 1.21  1994/09/30  12:37:26  john
1493  * Added midi,digi volume to configuration.
1494  * 
1495  * Revision 1.20  1994/09/22  16:14:14  john
1496  * Redid intro sequecing.
1497  * 
1498  * Revision 1.19  1994/09/19  18:50:15  john
1499  * Added switch to disable joystick.
1500  * 
1501  * Revision 1.18  1994/09/12  11:47:36  john
1502  * Made stupid cruise work better.  Make kconfig values get
1503  * read/written to disk.
1504  * 
1505  * Revision 1.17  1994/09/10  15:46:47  john
1506  * First version of new keyboard configuration.
1507  * 
1508  * Revision 1.16  1994/09/06  19:35:44  john
1509  * Fixed bug that didn';t load new size .cal file.
1510  * 
1511  * Revision 1.15  1994/09/06  14:51:58  john
1512  * Added sensitivity adjustment, fixed bug with joystick button not
1513  * staying down.
1514  * 
1515  * Revision 1.14  1994/09/02  16:13:47  john
1516  * Made keys fill in position.
1517  * 
1518  * Revision 1.13  1994/08/31  17:58:50  john
1519  * Made a bit simpler.
1520  * 
1521  * Revision 1.12  1994/08/31  14:17:54  john
1522  * *** empty log message ***
1523  * 
1524  * Revision 1.11  1994/08/31  14:10:56  john
1525  * Made keys not work when KEY_DELETE pressed.
1526  * 
1527  * Revision 1.10  1994/08/31  13:40:47  mike
1528  * Change constant
1529  * 
1530  * Revision 1.9  1994/08/31  12:56:27  john
1531  * *** empty log message ***
1532  * 
1533  * Revision 1.8  1994/08/30  20:38:29  john
1534  * Add more config stuff..
1535  * 
1536  * Revision 1.7  1994/08/30  16:37:25  john
1537  * Added menu options to set controls.
1538  * 
1539  * Revision 1.6  1994/08/30  09:27:18  john
1540  * *** empty log message ***
1541  * 
1542  * Revision 1.5  1994/08/30  09:12:01  john
1543  * *** empty log message ***
1544  * 
1545  * Revision 1.4  1994/08/29  21:18:32  john
1546  * First version of new keyboard/oystick remapping stuff.
1547  * 
1548  * Revision 1.3  1994/08/24  19:00:29  john
1549  * Changed key_down_time to return fixed seconds instead of
1550  * milliseconds.
1551  * 
1552  * Revision 1.2  1994/08/17  16:50:37  john
1553  * Added damaging fireballs, missiles.
1554  * 
1555  * Revision 1.1  1994/08/17  10:07:12  john
1556  * Initial revision
1557
1558 ------------------------------------------------------------------------
1559 arch/dos/key.c:
1560
1561  * $Log: not supported by cvs2svn $
1562  * Revision 1.1  2004/08/28 23:17:45  schaffner
1563  * move old per-file change logs into new file ChangeLog-old
1564  *
1565  * Revision 1.3  2001/10/24 09:25:05  bradleyb
1566  * Moved input stuff to arch subdirs, as in d1x.
1567  *
1568  * Revision 1.3  2001/01/31 14:04:44  bradleyb
1569  * Fix compiler warnings
1570  *
1571  * Revision 1.2  2001/01/29 14:03:57  bradleyb
1572  * Fixed build, minor fixes
1573  *
1574  * Revision 1.1.1.2  2001/01/19 03:33:52  bradleyb
1575  * Import of d2x-0.0.9-pre1
1576  *
1577  * Revision 1.1.1.1  1999/06/14 21:58:32  donut
1578  * Import of d1x 1.37 source.
1579  *
1580  * Revision 1.35  1995/01/25  20:13:30  john
1581  * Took out not passing keys to debugger if w10.
1582  * 
1583  * Revision 1.34  1995/01/14  19:19:31  john
1584  * Made so when you press Shift+Baskspace, it release keys autmatically.
1585  * 
1586  * Revision 1.33  1994/12/13  09:21:48  john
1587  * Took out keyd_editor_mode, and KEY_DEBUGGED stuff for NDEBUG versions.
1588  * 
1589  * Revision 1.32  1994/11/12  13:52:01  john
1590  * Fixed bug with code that cleared bios buffer.
1591  * 
1592  * Revision 1.31  1994/10/24  15:16:16  john
1593  * Added code to detect KEY_PAUSE.
1594  * 
1595  * Revision 1.30  1994/10/24  13:57:53  john
1596  * Hacked in support for pause key onto code 0x61.
1597  * 
1598  * Revision 1.29  1994/10/21  15:18:13  john
1599  * *** empty log message ***
1600  * 
1601  * Revision 1.28  1994/10/21  15:17:24  john
1602  * Made LSHIFT+BACKSPACE do what PrtScr used to.
1603  * 
1604  * Revision 1.27  1994/09/22  16:09:18  john
1605  * Fixed some virtual memory lockdown problems with timer and
1606  * joystick.
1607  * 
1608  * Revision 1.26  1994/09/15  21:32:47  john
1609  * Added bounds checking for down_count scancode
1610  * parameter.
1611  * 
1612  * Revision 1.25  1994/08/31  12:22:20  john
1613  * Added KEY_DEBUGGED
1614  * 
1615  * Revision 1.24  1994/08/24  18:53:48  john
1616  * Made Cyberman read like normal mouse; added dpmi module; moved
1617  * mouse from assembly to c. Made mouse buttons return time_down.
1618  * 
1619  * Revision 1.23  1994/08/18  15:17:51  john
1620  * *** empty log message ***
1621  * 
1622  * Revision 1.22  1994/08/18  15:16:38  john
1623  * fixed some bugs with clear_key_times and then
1624  * removed it because i fixed key_flush to do the
1625  * same.
1626  * 
1627  * Revision 1.21  1994/08/17  19:01:25  john
1628  * Attempted to fix a bug with a key being held down
1629  * key_flush called, then the key released having too 
1630  * long of a time.
1631  * 
1632  * Revision 1.20  1994/08/08  10:43:48  john
1633  * Recorded when a key was pressed for key_inkey_time.
1634  * 
1635  * Revision 1.19  1994/06/22  15:00:03  john
1636  * Made keyboard close automatically on exit.
1637  * 
1638  * Revision 1.18  1994/06/21  09:16:29  john
1639  * *** empty log message ***
1640  * 
1641  * Revision 1.17  1994/06/21  09:08:23  john
1642  * *** empty log message ***
1643  * 
1644  * Revision 1.16  1994/06/21  09:05:01  john
1645  * *** empty log message ***
1646  * 
1647  * Revision 1.15  1994/06/21  09:04:24  john
1648  * Made PrtScreen do an int5
1649  * 
1650  * Revision 1.14  1994/06/17  17:17:06  john
1651  * Added keyd_time_last_key_was_pressed or something like that.
1652  * 
1653  * Revision 1.13  1994/05/14  13:55:16  matt
1654  * Added #define to control key passing to bios
1655  * 
1656  * Revision 1.12  1994/05/05  18:09:39  john
1657  * Took out BIOS to prevent stuck keys.
1658  * 
1659  * Revision 1.11  1994/05/03  17:39:12  john
1660  * *** empty log message ***
1661  * 
1662  * Revision 1.10  1994/04/29  12:14:20  john
1663  * Locked all memory used during interrupts so that program
1664  * won't hang when using virtual memory.
1665  * 
1666  * Revision 1.9  1994/04/28  23:49:41  john
1667  * Made key_flush flush more keys and also did something else but i forget what.
1668  * 
1669  * Revision 1.8  1994/04/22  12:52:12  john
1670  * *** empty log message ***
1671  * 
1672  * Revision 1.7  1994/04/01  10:44:59  mike
1673  * Change key_getch() to call getch() if our interrupt hasn't been installed.
1674  * 
1675  * Revision 1.6  1994/03/09  10:45:48  john
1676  * Neatend code a bit.
1677  * 
1678  * Revision 1.5  1994/02/17  17:24:16  john
1679  * Neatened up a bit.
1680  * 
1681  * Revision 1.4  1994/02/17  16:30:29  john
1682  * Put in code to pass keys when in debugger.
1683  * 
1684  * Revision 1.3  1994/02/17  15:57:59  john
1685  * Made handler not chain to BIOS handler.
1686  * 
1687  * Revision 1.2  1994/02/17  15:56:06  john
1688  * Initial version.
1689  * 
1690  * Revision 1.1  1994/02/17  15:54:07  john
1691  * Initial revision
1692
1693 ------------------------------------------------------------------------
1694 arch/dos/mono.c:
1695
1696  * $Log: not supported by cvs2svn $
1697  * Revision 1.1  2004/08/28 23:17:45  schaffner
1698  * move old per-file change logs into new file ChangeLog-old
1699  *
1700  * Revision 1.1.1.1  2001/01/19 03:30:15  bradleyb
1701  * Import of d2x-0.0.8
1702  *
1703  * Revision 1.1.1.1  1999/06/14 21:58:35  donut
1704  * Import of d1x 1.37 source.
1705  *
1706  * Revision 1.12  1995/02/23  11:59:57  john
1707  * Made the windows smaller so they don't overwrite the debug file menus.
1708  * 
1709  * Revision 1.11  1994/11/27  23:07:50  matt
1710  * Made changes needed to be able to compile out monochrome debugging code
1711  * 
1712  * Revision 1.10  1994/10/26  22:23:43  john
1713  * Limited windows to 2.  Took away saving what was under
1714  * a window.
1715  * 
1716  * Revision 1.9  1994/07/14  23:25:44  matt
1717  * Allow window 0 to be opened; don't allow mono to be initialized twice
1718  * 
1719  * Revision 1.8  1994/03/09  10:45:38  john
1720  * Sped up scroll.
1721  * 
1722  * Revision 1.7  1994/01/26  08:56:55  mike
1723  * Comment out int3 in mputc.
1724  * 
1725  * Revision 1.6  1994/01/12  15:56:34  john
1726  * made backspace do an int3 during mono stuff.
1727  * .,
1728  * 
1729  * Revision 1.5  1993/12/07  12:33:23  john
1730  * *** empty log message ***
1731  * 
1732  * Revision 1.4  1993/10/15  10:10:25  john
1733  * *** empty log message ***
1734  * 
1735  * Revision 1.3  1993/09/14  20:55:13  matt
1736  * Made minit() and mopen() check for presence of mono card in machine.
1737  * 
1738  * Revision 1.2  1993/07/22  13:10:21  john
1739  * *** empty log message ***
1740  * 
1741  * Revision 1.1  1993/07/10  13:10:38  matt
1742  * Initial revision
1743
1744 ------------------------------------------------------------------------
1745 arch/dos/mono.h:
1746
1747  * Revision 1.6  1994/12/03  17:07:37  matt
1748  * Made mono code turn off with either NDEBUG or NMONO
1749  * 
1750  * Revision 1.5  1994/11/27  23:07:28  matt
1751  * Made changes needed to be able to compile out monochrome debugging code
1752  * 
1753  * Revision 1.4  1993/12/07  12:33:28  john
1754  * *** empty log message ***
1755  * 
1756  * Revision 1.3  1993/09/14  20:54:50  matt
1757  * Made minit() check for mono card, return -1 if present, 0 if not
1758  * 
1759  * Revision 1.2  1993/07/22  13:05:40  john
1760  * added macros to print variables
1761  * 
1762  * Revision 1.1  1993/07/10  13:10:40  matt
1763  * Initial revision
1764
1765 ------------------------------------------------------------------------
1766 arch/dos/mouse.c:
1767
1768  * Revision 1.11  1995/02/10  18:52:17  john
1769  * Fixed bug with mouse not getting closed.
1770  *
1771  * Revision 1.10  1995/02/02  11:10:33  john
1772  * Changed a bunch of mouse stuff around to maybe get
1773  * around PS/2 mouse hang.
1774  *
1775  * Revision 1.9  1995/01/14  19:19:52  john
1776  * Fixed signed short error cmp with -1 that caused mouse
1777  * to break under Watcom 10.0
1778  *
1779  * Revision 1.8  1994/12/27  12:38:23  john
1780  * Made mouse use temporary dos buffer instead of
1781  *
1782  * allocating its own.
1783  *
1784  *
1785  * Revision 1.7  1994/12/05  23:54:53  john
1786  * Fixed bug with mouse_get_delta only returning positive numbers..
1787  *
1788  * Revision 1.6  1994/11/18  23:18:18  john
1789  * Changed some shorts to ints.
1790  *
1791  * Revision 1.5  1994/09/13  12:34:02  john
1792  * Added functions to get down count and state.
1793  *
1794  * Revision 1.4  1994/08/29  20:52:19  john
1795  * Added better cyberman support; also, joystick calibration
1796  * value return funcctiionn,
1797  *
1798  * Revision 1.3  1994/08/24  18:54:32  john
1799  * *** empty log message ***
1800  *
1801  * Revision 1.2  1994/08/24  18:53:46  john
1802  * Made Cyberman read like normal mouse; added dpmi module; moved
1803  * mouse from assembly to c. Made mouse buttons return time_down.
1804  *
1805  * Revision 1.1  1994/08/24  13:56:37  john
1806  * Initial revision
1807
1808 ------------------------------------------------------------------------
1809 arch/include/joy.h:
1810
1811  * Revision 1.17  1995/10/07  13:22:30  john
1812  * Added new method of reading joystick that allows higher-priority
1813  * interrupts to go off.
1814  *
1815  * Revision 1.16  1995/02/14  11:17:13  john
1816  * Added BIOS readings for stick.
1817  *
1818  * Revision 1.15  1995/02/14  10:09:58  john
1819  * Added OS2 switch.
1820  *
1821  * Revision 1.14  1994/12/28  13:49:20  john
1822  * Added function to set joystick for slow reading
1823  *
1824  * Revision 1.13  1994/10/13  11:36:06  john
1825  * Made joy_down_time be kept track of in fixed seconds,
1826  * not ticks.
1827  *
1828  * Revision 1.12  1994/10/12  17:03:16  john
1829  * Added prototype for joy_get_scaled_reading.
1830  *
1831  * Revision 1.11  1994/10/12  16:57:55  john
1832  * Added function to set a joystick button's state.
1833  *
1834  * Revision 1.10  1994/09/22  16:09:00  john
1835  * Fixed some virtual memory lockdown problems with timer and
1836  * joystick.
1837  *
1838  * Revision 1.9  1994/08/31  09:54:57  john
1839  * *** empty log message ***
1840  *
1841  * Revision 1.8  1994/08/29  21:02:24  john
1842  * Added joy_set_cal_values...
1843  *
1844  * Revision 1.7  1994/08/29  20:51:52  john
1845  * Added better cyberman support; also, joystick calibration
1846  * value return funcctiionn,
1847  *
1848  * Revision 1.6  1994/07/01  10:55:44  john
1849  * Fixed some bugs... added support for 4 axis.
1850  *
1851  * Revision 1.5  1994/06/30  20:36:51  john
1852  * Revamped joystick code.
1853  *
1854  * Revision 1.4  1994/04/22  12:52:10  john
1855  * *** empty log message ***
1856  *
1857  * Revision 1.3  1994/01/18  13:53:39  john
1858  * Made all joystick functions return int's instead of
1859  * shorts.  Also made the stick reading be CPU speed
1860  * independant by using the timer_get_Stamp_64
1861  * function.
1862  *
1863  * Revision 1.2  1994/01/18  10:58:42  john
1864  * *** empty log message ***
1865  *
1866  * Revision 1.1  1993/07/10  13:10:39  matt
1867  * Initial revision
1868
1869 ------------------------------------------------------------------------
1870 arch/win32/include/key.h:
1871
1872  * Revision 1.19  1994/10/24  13:58:12  john
1873  * Hacked in support for pause key onto code 0x61.
1874  * 
1875  * Revision 1.18  1994/10/21  15:17:10  john
1876  * Added KEY_PRINT_SCREEN
1877  * 
1878  * Revision 1.17  1994/08/31  12:22:13  john
1879  * Added KEY_DEBUGGED
1880  * 
1881  * Revision 1.16  1994/08/24  18:53:50  john
1882  * Made Cyberman read like normal mouse; added dpmi module; moved
1883  * mouse from assembly to c. Made mouse buttons return time_down.
1884  * 
1885  * Revision 1.15  1994/08/18  14:56:16  john
1886  * *** empty log message ***
1887  * 
1888  * Revision 1.14  1994/08/08  10:43:24  john
1889  * Recorded when a key was pressed for key_inkey_time.
1890  * 
1891  * Revision 1.13  1994/06/17  17:17:28  john
1892  * Added keyd_time_last_key_was_pressed or something like that.
1893  * 
1894  * Revision 1.12  1994/04/29  12:14:19  john
1895  * Locked all memory used during interrupts so that program
1896  * won't hang when using virtual memory.
1897  * 
1898  * Revision 1.11  1994/02/17  15:57:14  john
1899  * Changed key libary to C.
1900  * 
1901  * Revision 1.10  1994/01/31  08:34:09  john
1902  * Fixed reversed lshift/rshift keys.
1903  * 
1904  * Revision 1.9  1994/01/18  10:58:17  john
1905  * *** empty log message ***
1906  * 
1907  * Revision 1.8  1993/10/16  19:24:43  matt
1908  * Added new function key_clear_times() & key_clear_counts()
1909  * 
1910  * Revision 1.7  1993/10/15  10:17:09  john
1911  * added keyd_last_key_pressed and released for use with recorder.
1912  * 
1913  * Revision 1.6  1993/10/06  16:20:37  john
1914  * fixed down arrow bug
1915  * 
1916  * Revision 1.5  1993/10/04  13:26:42  john
1917  * changed the #defines for scan codes.
1918  * 
1919  * Revision 1.4  1993/09/28  11:35:20  john
1920  * added key_peekkey
1921  * 
1922  * Revision 1.3  1993/09/20  18:36:43  john
1923  * *** empty log message ***
1924  * 
1925  * Revision 1.1  1993/07/10  13:10:39  matt
1926  * Initial revision
1927
1928 ------------------------------------------------------------------------
1929 arch/win32/include/mouse.h:
1930
1931  * Revision 1.10  1995/02/02  10:22:29  john
1932  * Added cyberman init parameter.
1933  * 
1934  * Revision 1.9  1994/11/18  23:18:09  john
1935  * Changed some shorts to ints.
1936  * 
1937  * Revision 1.8  1994/09/13  12:33:49  john
1938  * Added functions to get down count and state.
1939  * 
1940  * Revision 1.7  1994/08/29  20:52:20  john
1941  * Added better cyberman support; also, joystick calibration
1942  * value return funcctiionn,
1943  * 
1944  * Revision 1.6  1994/08/24  17:54:35  john
1945  * *** empty log message ***
1946  * 
1947  * Revision 1.5  1994/08/24  17:51:43  john
1948  * Added transparent cyberman support
1949  * 
1950  * Revision 1.4  1993/07/27  09:32:22  john
1951  * *** empty log message ***
1952  * 
1953  * Revision 1.3  1993/07/26  10:46:44  john
1954  * added definition for mouse_set_pos
1955  * 
1956  * Revision 1.2  1993/07/22  13:07:59  john
1957  * added header for mousesetlimts
1958  * 
1959  * Revision 1.1  1993/07/10  13:10:40  matt
1960  * Initial revision
1961
1962 ------------------------------------------------------------------------
1963 arch/win32/mouse.c:
1964
1965  * Revision 1.8  1996/02/21  13:57:36  allender
1966  * cursor device manager stuff added here so as not to
1967  * rely on InterfaceLib anymore
1968  *
1969  * Revision 1.7  1995/10/17  15:42:21  allender
1970  * new mouse function to determine single button press
1971  *
1972  * Revision 1.6  1995/10/03  11:27:31  allender
1973  * fixed up hotspot problems with the mouse on multiple monitors
1974  *
1975  * Revision 1.5  1995/07/13  11:27:08  allender
1976  * trap button checks at MAX_MOUSE_BUTTONS
1977  *
1978  * Revision 1.4  1995/06/25  21:56:53  allender
1979  * added events include
1980  *
1981  * Revision 1.3  1995/05/11  17:06:38  allender
1982  * fixed up mouse routines
1983  *
1984  * Revision 1.2  1995/05/11  13:05:53  allender
1985  * of mouse handler code
1986  *
1987  * Revision 1.1  1995/05/05  09:54:45  allender
1988  * Initial revision
1989  *
1990  * Revision 1.9  1995/01/14  19:19:52  john
1991  * Fixed signed short error cmp with -1 that caused mouse
1992  * to break under Watcom 10.0
1993  *
1994  * Revision 1.8  1994/12/27  12:38:23  john
1995  * Made mouse use temporary dos buffer instead of
1996  *
1997  * allocating its own.
1998  *
1999  * Revision 1.7  1994/12/05  23:54:53  john
2000  * Fixed bug with mouse_get_delta only returning positive numbers..
2001  *
2002  * Revision 1.6  1994/11/18  23:18:18  john
2003  * Changed some shorts to ints.
2004  *
2005  * Revision 1.5  1994/09/13  12:34:02  john
2006  * Added functions to get down count and state.
2007  *
2008  * Revision 1.4  1994/08/29  20:52:19  john
2009  * Added better cyberman support; also, joystick calibration
2010  * value return funcctiionn,
2011  *
2012  * Revision 1.3  1994/08/24  18:54:32  john
2013  * *** empty log message ***
2014  *
2015  * Revision 1.2  1994/08/24  18:53:46  john
2016  * Made Cyberman read like normal mouse; added dpmi module; moved
2017  * mouse from assembly to c. Made mouse buttons return time_down.
2018  *
2019  * Revision 1.1  1994/08/24  13:56:37  john
2020  * Initial revision
2021
2022 ------------------------------------------------------------------------
2023 cfile/cfile.c:
2024
2025  * Revision 1.7  1995/10/27  15:18:20  allender
2026  * get back to descent directory before trying to read a hog file
2027  *
2028  * Revision 1.6  1995/10/21  23:48:24  allender
2029  * hogfile(s) are now in :Data: folder
2030  *
2031  * Revision 1.5  1995/08/14  09:27:31  allender
2032  * added byteswap header
2033  *
2034  * Revision 1.4  1995/05/12  11:54:33  allender
2035  * changed memory stuff again
2036  *
2037  * Revision 1.3  1995/05/04  20:03:38  allender
2038  * added code that was missing...use NewPtr instead of malloc
2039  *
2040  * Revision 1.2  1995/04/03  09:59:49  allender
2041  * *** empty log message ***
2042  *
2043  * Revision 1.1  1995/03/30  10:25:02  allender
2044  * Initial revision
2045  *
2046  *
2047  * --- PC RCS Information ---
2048  * Revision 1.24  1995/03/15  14:20:27  john
2049  * Added critical error checker.
2050  *
2051  * Revision 1.23  1995/03/13  15:16:53  john
2052  * Added alternate directory stuff.
2053  *
2054  * Revision 1.22  1995/02/09  23:08:47  matt
2055  * Increased the max number of files in hogfile to 250
2056  *
2057  * Revision 1.21  1995/02/01  20:56:47  john
2058  * Added cfexist function
2059  *
2060  * Revision 1.20  1995/01/21  17:53:48  john
2061  * Added alternate pig file thing.
2062  *
2063  * Revision 1.19  1994/12/29  15:10:02  john
2064  * Increased hogfile max files to 200.
2065  *
2066  * Revision 1.18  1994/12/12  13:20:57  john
2067  * Made cfile work with fiellentth.
2068  *
2069  * Revision 1.17  1994/12/12  13:14:25  john
2070  * Made cfiles prefer non-hog files.
2071  *
2072  * Revision 1.16  1994/12/09  18:53:26  john
2073  * *** empty log message ***
2074  *
2075  * Revision 1.15  1994/12/09  18:52:56  john
2076  * Took out mem, error checking.
2077  *
2078  * Revision 1.14  1994/12/09  18:10:31  john
2079  * Speed up cfgets, which was slowing down the reading of
2080  * bitmaps.tbl, which was making POF loading look slow.
2081  *
2082  * Revision 1.13  1994/12/09  17:53:51  john
2083  * Added error checking to number of hogfiles..
2084  *
2085  * Revision 1.12  1994/12/08  19:02:55  john
2086  * Added cfgets.
2087  *
2088  * Revision 1.11  1994/12/07  21:57:48  john
2089  * Took out data dir.
2090  *
2091  * Revision 1.10  1994/12/07  21:38:02  john
2092  * Made cfile not return error..
2093  *
2094  * Revision 1.9  1994/12/07  21:35:34  john
2095  * Made it read from data directory.
2096  *
2097  * Revision 1.8  1994/12/07  21:33:55  john
2098  * Stripped out compression stuff...
2099  *
2100  * Revision 1.7  1994/04/13  23:44:59  matt
2101  * When file cannot be opened, free up the buffer for that file.
2102  *
2103  * Revision 1.6  1994/02/18  12:38:20  john
2104  * Optimized a bit
2105  *
2106  * Revision 1.5  1994/02/15  18:13:20  john
2107  * Fixed more bugs.
2108  *
2109  * Revision 1.4  1994/02/15  13:27:58  john
2110  * Works ok...
2111  *
2112  * Revision 1.3  1994/02/15  12:51:57  john
2113  * Crappy inbetween version
2114  *
2115  * Revision 1.2  1994/02/14  20:12:29  john
2116  * First version working with new cfile stuff.
2117  *
2118  * Revision 1.1  1994/02/14  15:51:33  john
2119  * Initial revision
2120  *
2121  * Revision 1.1  1994/02/10  15:45:12  john
2122  * Initial revision
2123
2124 ------------------------------------------------------------------------
2125 iff/iff.c:
2126
2127  * Revision 1.2  1995/05/12  11:54:43  allender
2128  * changed memory stuff again
2129  *
2130  * Revision 1.1  1995/05/05  08:59:41  allender
2131  * Initial revision
2132  *
2133  * Revision 1.43  1994/12/08  19:03:17  john
2134  * Added code to use cfile.
2135  *
2136  * Revision 1.42  1994/12/08  17:45:32  john
2137  * Put back in cfile stuff.
2138  *
2139  * Revision 1.41  1994/11/19  16:41:06  matt
2140  * Took out unused code
2141  *
2142  * Revision 1.40  1994/11/07  21:26:39  matt
2143  * Added new function iff_read_into_bitmap()
2144  *
2145  * Revision 1.39  1994/10/27  00:12:03  john
2146  * Used nocfile
2147  *
2148  * Revision 1.38  1994/08/10  19:49:58  matt
2149  * Fixed bitmaps in ILBM format with masking (stencil) on.
2150  *
2151  * Revision 1.37  1994/06/02  18:53:17  matt
2152  * Clear flags & selector in new bitmap structure
2153  *
2154  * Revision 1.36  1994/05/17  14:00:33  matt
2155  * Fixed bug with odd-width deltas & odd-length body chunks
2156  *
2157  * Revision 1.35  1994/05/16  20:38:55  matt
2158  * Made anim brushes work when odd width
2159  *
2160  * Revision 1.34  1994/05/06  19:37:26  matt
2161  * Improved error handling and checking
2162  *
2163  * Revision 1.33  1994/04/27  20:57:07  matt
2164  * Fixed problem with RLE decompression and odd-width bitmap
2165  * Added more error checking
2166  *
2167  * Revision 1.32  1994/04/16  21:44:19  matt
2168  * Fixed bug introduced last version
2169  *
2170  * Revision 1.31  1994/04/16  20:12:40  matt
2171  * Made masked (stenciled) bitmaps work
2172  *
2173  * Revision 1.30  1994/04/13  23:46:16  matt
2174  * Added function, iff_errormsg(), which returns ptr to error message.
2175  *
2176  * Revision 1.29  1994/04/13  23:27:25  matt
2177  * Put in support for anim brushes (.abm files)
2178  *
2179  * Revision 1.28  1994/04/13  16:33:31  matt
2180  * Cleaned up file read code, adding fake_file structure (FFILE), which
2181  * cleanly implements reading the entire file into a buffer and then reading
2182  * out of that buffer.
2183  *
2184  * Revision 1.27  1994/04/06  23:07:43  matt
2185  * Cleaned up code; added prototype (but no new code) for anim brush read
2186  *
2187  * Revision 1.26  1994/03/19  02:51:52  matt
2188  * Really did what I said I did last revision.
2189  *
2190  * Revision 1.25  1994/03/19  02:16:07  matt
2191  * Made work ILBMs which didn't have 8 planes
2192  *
2193  * Revision 1.24  1994/03/15  14:45:26  matt
2194  * When error, only free memory if has been allocated
2195  *
2196  * Revision 1.23  1994/02/18  12:39:05  john
2197  * Made code read from buffer.
2198  *
2199  * Revision 1.22  1994/02/15  18:15:26  john
2200  * Took out cfile attempt (too slow)
2201  *
2202  * Revision 1.21  1994/02/15  13:17:48  john
2203  * added assert to cfseek.
2204  *
2205  * Revision 1.20  1994/02/15  13:13:11  john
2206  * Made iff code work normally.
2207  *
2208  * Revision 1.19  1994/02/15  12:51:07  john
2209  * crappy inbetween version.
2210  *
2211  * Revision 1.18  1994/02/10  18:31:32  matt
2212  * Changed 'if DEBUG_ON' to 'ifndef NDEBUG'
2213  *
2214  * Revision 1.17  1994/01/24  11:51:26  john
2215  * Made write routine write transparency info.
2216  *
2217  * Revision 1.16  1994/01/22  14:41:11  john
2218  * Fixed bug with declareations.
2219  *
2220  * Revision 1.15  1994/01/22  14:23:00  john
2221  * Added global vars to check transparency
2222  *
2223  * Revision 1.14  1993/12/08  19:00:42  matt
2224  * Changed while loop to memset
2225  *
2226  * Revision 1.13  1993/12/08  17:23:51  mike
2227  * Speedup by converting while...getc to fread.
2228  *
2229  * Revision 1.12  1993/12/08  12:37:35  mike
2230  * Optimize parse_body.
2231  *
2232  * Revision 1.11  1993/12/05  17:30:14  matt
2233  * Made bitmaps with width <= 64 not compress
2234  *
2235  * Revision 1.10  1993/12/03  12:24:51  matt
2236  * Fixed TINY chunk when bitmap was part of a larger bitmap
2237  *
2238  * Revision 1.9  1993/11/22  17:26:43  matt
2239  * iff write now writes out a tiny chunk
2240  *
2241  * Revision 1.8  1993/11/21  22:04:13  matt
2242  * Fixed error with non-compressed bitmaps
2243  * Added Yuan's code to free raw data if we get an error parsing the body
2244  *
2245  * Revision 1.7  1993/11/11  12:12:12  yuan
2246  * Changed mallocs to MALLOCs.
2247  *
2248  * Revision 1.6  1993/11/01  19:02:23  matt
2249  * Fixed a couple bugs in rle compression
2250  *
2251  * Revision 1.5  1993/10/27  12:47:39  john
2252  * *** empty log message ***
2253  *
2254  * Revision 1.4  1993/10/27  12:37:31  yuan
2255  * Added mem.h
2256  *
2257  * Revision 1.3  1993/09/22  19:16:57  matt
2258  * Added new error type, IFF_CORRUPT, for internally bad IFF files.
2259  *
2260  * Revision 1.2  1993/09/08  19:24:16  matt
2261  * Fixed bug in RLE compression
2262  * Changed a bunch of unimportant values like aspect and page size when writing
2263  * Added new error condition, IFF_BAD_BM_TYPE
2264  * Make sub-bitmaps work correctly
2265  * Added compile flag to turn compression off (COMPRESS)
2266  *
2267  * Revision 1.1  1993/09/08  14:24:15  matt
2268  * Initial revision
2269
2270 ------------------------------------------------------------------------
2271 include/3d.h:
2272
2273  * Revision 1.2  1995/09/14  14:08:58  allender
2274  * return value for g3_draw_sphere
2275  *
2276  * Revision 1.1  1995/05/05  08:48:41  allender
2277  * Initial revision
2278  *
2279  * Revision 1.34  1994/11/11  19:22:14  matt
2280  * Added new function, g3_calc_point_depth()
2281  *
2282  * Revision 1.33  1994/09/09  14:23:58  matt
2283  * Added support for glowing textures, to add engine glow to Descent.
2284  *
2285  * Revision 1.32  1994/09/01  10:42:27  matt
2286  * Blob routine, renamed g3_draw_bitmap(), now takes seperate 3d width & height.
2287  *
2288  * Revision 1.31  1994/07/29  18:16:14  matt
2289  * Added instance by angles, and corrected parms for g3_init()
2290  *
2291  * Revision 1.30  1994/07/25  00:00:00  matt
2292  * Made 3d no longer deal with point numbers, but only with pointers.
2293  *
2294  * Revision 1.29  1994/07/22  17:57:27  matt
2295  * Changed the name of the rod functions, and took out some debugging code
2296  *
2297  * Revision 1.28  1994/06/07  16:49:12  matt
2298  * Made interpreter take lighting value as parm, rather than in global var
2299  *
2300  * Revision 1.27  1994/05/31  18:35:28  matt
2301  * Added light value to g3_draw_facing_bitmap()
2302  *
2303  * Revision 1.26  1994/05/30  22:48:04  matt
2304  * Added support for morph effect
2305  *
2306  * Revision 1.25  1994/05/30  11:34:57  matt
2307  * Added g3_set_special_render() to allow a user to specify functions to
2308  * call for 2d draws.
2309  *
2310  * Revision 1.24  1994/05/19  21:46:31  matt
2311  * Moved texture lighting out of 3d and into the game
2312  *
2313  * Revision 1.23  1994/05/14  15:26:48  matt
2314  * Added extern for polyobj outline flag
2315  *
2316  * Revision 1.22  1994/04/19  18:26:33  matt
2317  * Added g3_draw_sphere() function.
2318  *
2319  * Revision 1.21  1994/03/25  18:22:28  matt
2320  * g3_draw_polygon_model() now takes ptr to list of angles
2321  *
2322  * Revision 1.20  1994/03/15  21:23:23  matt
2323  * Added interpreter functions
2324  *
2325  * Revision 1.19  1994/02/15  17:37:34  matt
2326  * New function, g3_draw_blob()
2327  *
2328  * Revision 1.18  1994/02/09  11:47:47  matt
2329  * Added rod & delta point functions
2330  *
2331  * Revision 1.17  1994/01/26  12:38:11  matt
2332  * Added function g3_compute_lighting_value()
2333  *
2334  * Revision 1.16  1994/01/25  18:00:02  yuan
2335  * Fixed variable beam_brightness...
2336  *
2337  * Revision 1.15  1994/01/24  14:08:34  matt
2338  * Added instancing functions
2339  *
2340  * Revision 1.14  1994/01/22  18:21:48  matt
2341  * New lighting stuff now done in 3d; g3_draw_tmap() takes lighting parm
2342  *
2343  * Revision 1.13  1994/01/20  17:21:24  matt
2344  * New function g3_compute_sky_polygon()
2345  *
2346  * Revision 1.12  1994/01/14  17:20:25  matt
2347  * Added prototype for new function g3_draw_horizon()
2348  *
2349  * Revision 1.10  1993/12/20  20:21:52  matt
2350  * Added g3_point_2_vec()
2351  *
2352  * Revision 1.9  1993/12/07  23:05:47  matt
2353  * Fixed mistyped function name.
2354  *
2355  * Revision 1.8  1993/12/05  23:47:03  matt
2356  * Added function g3_draw_line_ptrs()
2357  *
2358  * Revision 1.7  1993/12/05  23:13:22  matt
2359  * Added prototypes for g3_rotate_point() and g3_project_point()
2360  *
2361  * Revision 1.6  1993/12/05  23:03:28  matt
2362  * Changed uvl structs to g3s_uvl
2363  *
2364  * Revision 1.5  1993/11/22  10:51:09  matt
2365  * Moved uvl structure here from segment.h, made texture map functions use it
2366  *
2367  * Revision 1.4  1993/11/21  20:08:31  matt
2368  * Added function g3_draw_object()
2369  *
2370  * Revision 1.3  1993/11/04  18:49:19  matt
2371  * Added system to only rotate points once per frame
2372  *
2373  * Revision 1.2  1993/11/04  08:16:06  mike
2374  * Add light field (p3_l) to g3s_point.
2375  *
2376  * Revision 1.1  1993/10/29  22:20:56  matt
2377  * Initial revision
2378
2379 ------------------------------------------------------------------------
2380 include/args.h:
2381
2382  * Revision 1.1  1995/05/16  15:54:24  allender
2383  * Initial revision
2384  *
2385  * Revision 2.0  1995/02/27  11:33:09  john
2386  * New version 2.0, which has no anonymous unions, builds with
2387  * Watcom 10.0, and doesn't require parsing BITMAPS.TBL.
2388  *
2389  * Revision 1.4  1994/07/11  16:27:28  matt
2390  * Took out prototypes for netipx funcs
2391  *
2392  * Revision 1.3  1994/05/11  19:45:34  john
2393  * *** empty log message ***
2394  *
2395  * Revision 1.2  1994/05/09  17:02:55  john
2396  * Split command line parameters into arg.c and arg.h.
2397  * Also added /dma, /port, /irq to digi.c
2398  *
2399  * Revision 1.1  1994/05/09  16:47:49  john
2400  * Initial revision
2401
2402 ------------------------------------------------------------------------
2403 include/byteswap.h:
2404
2405  * Revision 1.4  1995/08/23  21:28:15  allender
2406  * fix mcc compiler warning
2407  *
2408  * Revision 1.3  1995/08/18  15:51:42  allender
2409  * put back in old byteswapping code
2410  *
2411  * Revision 1.2  1995/05/04  20:10:18  allender
2412  * proper prototypes
2413  *
2414  * Revision 1.1  1995/03/30  15:02:11  allender
2415  * Initial revision
2416
2417 ------------------------------------------------------------------------
2418 include/cfile.h:
2419
2420  * Revision 1.1  1995/03/30  10:25:08  allender
2421  * Initial revision
2422  *
2423  *
2424  * -- PC RCS Information ---
2425  * Revision 1.10  1995/03/13  15:16:47  john
2426  * Added alternate directory stuff.
2427  *
2428  * Revision 1.9  1995/02/01  20:56:40  john
2429  * Added cfexist function
2430  *
2431  * Revision 1.8  1995/01/21  17:53:41  john
2432  * Added alternate pig file thing.
2433  *
2434  * Revision 1.7  1994/12/12  13:19:47  john
2435  * Made cfile work with fiellentth.
2436  *
2437  * Revision 1.6  1994/12/08  19:02:52  john
2438  * Added cfgets.
2439  *
2440  * Revision 1.5  1994/12/07  21:34:07  john
2441  * Stripped out compression stuff...
2442  *
2443  * Revision 1.4  1994/07/13  00:16:53  matt
2444  * Added include
2445  *
2446  * Revision 1.3  1994/02/17  17:36:19  john
2447  * Added CF_READ_MODE and CF_WRITE_MODE constants.
2448  *
2449  * Revision 1.2  1994/02/15  12:52:08  john
2450  * Crappy inbetween version
2451  *
2452  * Revision 1.1  1994/02/15  10:54:23  john
2453  * Initial revision
2454  *
2455  * Revision 1.1  1994/02/10  15:50:54  john
2456  * Initial revision
2457
2458 ------------------------------------------------------------------------
2459 include/error.h:
2460
2461  * Revision 1.12  1994/06/17  15:22:46  matt
2462  * Added pragma for Error() for when NDEBUG
2463  *
2464  * Revision 1.11  1994/03/07  13:22:14  matt
2465  * Since the Error() function has 'aborts' set in pragma, we do a jmp
2466  * to the function rather than call.
2467  *
2468  * Revision 1.10  1994/02/17  12:37:15  matt
2469  * Combined two pragma's for Error(), since second superseded the first
2470  *
2471  * Revision 1.9  1994/02/10  18:02:53  matt
2472  * Changed 'if DEBUG_ON' to 'ifndef NDEBUG'
2473  *
2474  * Revision 1.8  1994/02/09  15:18:29  matt
2475  * Added pragma saying that Error() never returns
2476  *
2477  * Revision 1.7  1993/10/19  12:57:53  matt
2478  * If DEBUG_ON not defined, define it to be 1
2479  *
2480  * Revision 1.6  1993/10/15  21:40:39  matt
2481  * Made error functions generate int3's if debugging on
2482  *
2483  * Revision 1.5  1993/10/14  15:29:22  matt
2484  * Added new function clear_warn_func()
2485  *
2486  * Revision 1.4  1993/10/08  16:16:47  matt
2487  * Made Assert() call function _Assert(), rather to do 'if...' inline.
2488  *
2489  * Revision 1.3  1993/09/29  11:39:07  matt
2490  * Added Assert() macro, like the system one, but calls Error()
2491  *
2492  * Revision 1.2  1993/09/27  11:47:03  matt
2493  * Added function set_warn_func()
2494  *
2495  * Revision 1.1  1993/09/23  20:17:46  matt
2496  * Initial revision
2497
2498 ------------------------------------------------------------------------
2499 include/gr.h:
2500
2501  * Revision 1.7  1995/09/13  08:39:44  allender
2502  * added prototype for gr_bitblt_cockpit
2503  *
2504  * Revision 1.6  1995/08/23  18:47:01  allender
2505  * fixed compiler warnings on mcc
2506  *
2507  * Revision 1.5  1995/08/14  15:51:01  allender
2508  * added #define for transparency color
2509  *
2510  * Revision 1.4  1995/06/13  13:03:55  allender
2511  * added graphics mode
2512  *
2513  * Revision 1.3  1995/04/18  09:50:16  allender
2514  * *** empty log message ***
2515  *
2516  * Revision 1.2  1995/04/07  07:32:33  allender
2517  * *** empty log message ***
2518  *
2519  * Revision 1.1  1995/03/09  09:04:16  allender
2520  * Initial revision
2521  *
2522  *
2523  * --- PC RCS information ---
2524  * Revision 1.45  1994/11/18  22:50:21  john
2525  * Changed shorts to ints in parameters.
2526  *
2527  * Revision 1.44  1994/11/13  13:04:07  john
2528  * Added paged out bit in bitmap structure.  Commented out the
2529  * poly code that is never used.
2530  *
2531  * Revision 1.43  1994/11/09  23:04:56  mike
2532  * Add avg_color field.
2533  *
2534  * Revision 1.42  1994/10/27  00:53:35  john
2535  * Added RLE Flag to bitmap structere.
2536  *
2537  * Revision 1.41  1994/10/26  23:55:52  john
2538  * Took out roller; Took out inverse table.
2539  *
2540  * Revision 1.40  1994/08/11  17:59:12  mike
2541  * Assembler merge functions written for 3 rotations of bitmaps.
2542  *
2543  * Revision 1.39  1994/08/10  12:24:56  matt
2544  * Added support for colors fonts & kerned fonts
2545  * Made our own font file format
2546  *
2547  * Revision 1.38  1994/07/27  18:30:18  john
2548  * Took away the blending table.
2549  *
2550  * Revision 1.37  1994/06/16  15:25:06  mike
2551  * Add flag BM_FLAG_NO_LIGHTING.
2552  *
2553  * Revision 1.36  1994/05/31  10:01:22  john
2554  * *** empty log message ***
2555  *
2556  * Revision 1.35  1994/05/31  07:53:34  john
2557  * *** empty log message ***
2558  *
2559  * Revision 1.34  1994/05/14  17:19:41  matt
2560  * Added externs
2561  *
2562  * Revision 1.33  1994/05/12  17:33:09  john
2563  * Added circle code.
2564  *
2565  * Revision 1.32  1994/05/06  12:50:16  john
2566  * Added supertransparency; neatend things up; took out warnings.
2567  *
2568  * Revision 1.31  1994/05/04  10:06:06  john
2569  * Added flag for bitmap super-transparency.
2570  *
2571  * Revision 1.30  1994/05/03  19:38:56  john
2572  * *** empty log message ***
2573  *
2574  * Revision 1.29  1994/04/22  11:16:05  john
2575  * *** empty log message ***
2576  *
2577  * Revision 1.28  1994/04/08  16:59:32  john
2578  * Add fading poly's; Made palette fade 32 instead of 16.
2579  *
2580  * Revision 1.27  1994/03/16  17:29:52  john
2581  * *** empty log message ***
2582  *
2583  * Revision 1.26  1994/03/16  17:20:51  john
2584  * Added slow palette searching options.
2585  *
2586  * Revision 1.25  1994/03/14  17:59:20  john
2587  * Added function to check bitmap's transparency.
2588  *
2589  * Revision 1.24  1994/03/14  16:56:26  john
2590  * Changed grs_bitmap structure to include bm_flags.
2591  *
2592  * Revision 1.23  1994/02/18  15:32:30  john
2593  * *** empty log message ***
2594  *
2595  * Revision 1.22  1994/01/25  11:40:48  john
2596  * Added gr_check_mode function.
2597  *
2598  * Revision 1.21  1994/01/12  13:45:24  john
2599  * Added scaler.
2600  *
2601  * Revision 1.20  1993/12/21  19:58:24  john
2602  * added selector stuff
2603  *
2604  * Revision 1.19  1993/12/21  11:40:40  john
2605  * *** empty log message ***
2606  *
2607  * Revision 1.18  1993/12/09  15:02:08  john
2608  * Changed palette stuff majorly
2609  *
2610  * Revision 1.17  1993/12/07  12:32:05  john
2611  * moved bmd_palette to gr_palette
2612  *
2613  * Revision 1.16  1993/11/28  12:08:06  mike
2614  * Change prototype for rotate_bitmap.
2615  *
2616  * Revision 1.15  1993/11/18  14:22:51  mike
2617  * Add prototype for rotate_bitmap.
2618  *
2619  * Revision 1.14  1993/11/17  19:00:59  mike
2620  * Add prototype for test_rotate_bitmap
2621  *
2622  * Revision 1.13  1993/11/16  11:28:58  john
2623  * *** empty log message ***
2624  *
2625  * Revision 1.12  1993/10/26  13:17:43  john
2626  * *** empty log message ***
2627  *
2628  * Revision 1.11  1993/10/15  16:23:37  john
2629  * y
2630  *
2631  * Revision 1.10  1993/09/28  15:32:33  john
2632  * added def for save/restore vidmode
2633  *
2634  * Revision 1.9  1993/09/28  12:51:46  matt
2635  * Added aspect ratio to grs_screen structure
2636  *
2637  * Revision 1.8  1993/09/26  22:45:12  matt
2638  * Changed prototypes for line functions to take fixes, not ints.
2639  *
2640  * Revision 1.7  1993/09/26  18:58:16  john
2641  * fadein/out stuff
2642  *
2643  * Revision 1.6  1993/09/14  16:26:44  matt
2644  * Changed gr_change_mode() to be gr_set_mode()
2645  *
2646  * Revision 1.4  1993/09/14  13:08:45  john
2647  * added gr_change_mode
2648  *
2649  * Revision 1.3  1993/09/08  13:56:03  matt
2650  * Put 'if' block around body of file; added bitmap type BM_RGB15
2651  *
2652  * Revision 1.2  1993/09/08  13:02:14  john
2653  * Changed structure definitions a bit.
2654  *
2655  * Revision 1.1  1993/09/08  11:25:15  john
2656  * Initial revision
2657
2658 ------------------------------------------------------------------------
2659 include/grdef.h:
2660
2661  * Revision 1.5  1995/09/14  15:36:33  allender
2662  * added stuff for 68k version
2663  *
2664  * Revision 1.4  1995/07/05  16:10:57  allender
2665  * gr_linear_movsd prototype changes
2666  *
2667  * Revision 1.3  1995/04/19  14:39:28  allender
2668  * changed function prototype
2669  *
2670  * Revision 1.2  1995/04/18  09:49:53  allender
2671  * *** empty log message ***
2672  *
2673  * Revision 1.1  1995/03/09  09:04:56  allender
2674  * Initial revision
2675  *
2676  *
2677  * --- PC RCS information ---
2678  * Revision 1.8  1994/05/06  12:50:09  john
2679  * Added supertransparency; neatend things up; took out warnings.
2680  *
2681  * Revision 1.7  1994/01/25  11:40:29  john
2682  * Added gr_check_mode function.
2683  *
2684  * Revision 1.6  1993/10/15  16:22:53  john
2685  * y
2686  *
2687  * Revision 1.5  1993/09/29  17:31:00  john
2688  * added gr_vesa_pixel
2689  *
2690  * Revision 1.4  1993/09/29  16:14:43  john
2691  * added global canvas descriptors.
2692  *
2693  * Revision 1.3  1993/09/08  17:38:02  john
2694  * Looking for errors
2695  *
2696  * Revision 1.2  1993/09/08  15:54:29  john
2697  * *** empty log message ***
2698  *
2699  * Revision 1.1  1993/09/08  11:37:57  john
2700  * Initial revision
2701
2702 ------------------------------------------------------------------------
2703 include/ibitblt.h:
2704
2705  * Revision 1.1  1995/08/18  15:50:57  allender
2706  * Initial revision
2707  *
2708  * Revision 1.2  1994/05/31  11:10:56  john
2709  * *** empty log message ***
2710  *
2711  * Revision 1.1  1994/05/30  16:08:46  john
2712  * Initial revision
2713
2714 ------------------------------------------------------------------------
2715 include/iff.h:
2716
2717  * Revision 1.2  1995/05/05  16:33:22  allender
2718  * changed types.h to dtypes.h
2719  *
2720  * Revision 1.1  1995/05/05  08:59:45  allender
2721  * Initial revision
2722  *
2723  * Revision 1.12  1994/11/07  21:26:53  matt
2724  * Added new function iff_read_into_bitmap()
2725  *
2726  * Revision 1.11  1994/05/06  19:37:38  matt
2727  * Improved error handling and checking
2728  *
2729  * Revision 1.10  1994/04/16  20:12:54  matt
2730  * Made masked (stenciled) bitmaps work
2731  *
2732  * Revision 1.9  1994/04/13  23:46:00  matt
2733  * Added function, iff_errormsg(), which returns ptr to error message.
2734  *
2735  * Revision 1.8  1994/04/13  23:27:10  matt
2736  * Put in support for anim brushes (.abm files)
2737  *
2738  * Revision 1.7  1994/04/06  23:08:02  matt
2739  * Cleaned up code; added prototype (but no new code) for anim brush read
2740  *
2741  * Revision 1.6  1994/01/22  14:40:59  john
2742  * Fixed bug with declareations.
2743  *
2744  * Revision 1.5  1994/01/22  14:23:13  john
2745  * Added global vars to check transparency
2746  *
2747  * Revision 1.4  1993/10/27  12:47:42  john
2748  * Extended the comments
2749  *
2750  * Revision 1.3  1993/09/22  19:17:20  matt
2751  * Fixed handling of pad byte in ILBM/PPB body - was writing pad byte to
2752  * destination buffer.
2753  *
2754  * Revision 1.2  1993/09/08  19:23:25  matt
2755  * Added additional return code, IFF_BAD_BM_TYPE
2756  *
2757  * Revision 1.1  1993/09/08  14:24:21  matt
2758  * Initial revision
2759
2760 ------------------------------------------------------------------------
2761 include/ipx.h:
2762
2763  * Revision 2.6  1995/03/29  11:19:32  john
2764  * Added broadcasting over a net.
2765  *
2766  * Revision 2.5  1995/03/28  20:04:43  john
2767  * Took away alternate server stuff.
2768  *
2769  * Revision 2.4  1995/03/23  19:00:10  john
2770  * Added user list capabitly.
2771  *
2772  * Revision 2.3  1995/03/23  12:26:57  john
2773  * Move IPX into bios lib.
2774  *
2775  * Revision 2.2  1995/03/22  19:08:14  john
2776  * Added code to fix sending packets over router... now
2777  * we just need to make broadcasts go over router!!
2778  *
2779  * Revision 2.1  1995/03/21  08:39:56  john
2780  * Ifdef'd out the NETWORK code.
2781  *
2782  * Revision 2.0  1995/02/27  11:30:16  john
2783  * New version 2.0, which has no anonymous unions, builds with
2784  * Watcom 10.0, and doesn't require parsing BITMAPS.TBL.
2785  *
2786  * Revision 1.16  1995/02/16  17:34:52  john
2787  * Added code to allow dynamic socket changing.
2788  *
2789  * Revision 1.15  1995/01/04  21:43:27  rob
2790  * Remove SPX size definition.
2791  *
2792  * Revision 1.14  1995/01/03  13:46:18  john
2793  * Added code that should make ipx work over different servers,
2794  * but ifdef'd it out with SHAREWARE in ipx.c.  I haven't tested
2795  * this, and I hope it doesn't introduce net bugs.
2796  *
2797  * Revision 1.13  1994/11/02  11:37:16  rob
2798  * Changed default socket number to a higher regions.
2799  *
2800  * Revision 1.12  1994/11/01  15:56:51  rob
2801  * Added defines for SPX socketsx.
2802  *
2803  * Revision 1.11  1994/10/31  19:23:31  rob
2804  * Added a prototype for the new object send function.
2805  *
2806  * Revision 1.10  1994/09/07  13:37:25  john
2807  * Changed default socket to 0x4000, because
2808  * the ipx/spx book says that we can only use
2809  * sockets 0x4000 - 0x7fff.
2810  *
2811  * Revision 1.9  1994/08/25  18:14:45  matt
2812  * Changed socket because of packet change
2813  *
2814  * Revision 1.8  1994/08/12  22:42:24  john
2815  * Took away Player_stats; added Players array.
2816  *
2817  * Revision 1.7  1994/08/09  19:31:47  john
2818  * Networking changes.
2819  *
2820  * Revision 1.6  1994/08/05  16:11:46  john
2821  * Psuedo working version of networking.
2822  *
2823  * Revision 1.5  1994/08/04  19:17:20  john
2824  * Inbetween version of network stuff.
2825  *
2826  * Revision 1.4  1994/07/29  16:08:59  john
2827  * *** empty log message ***
2828  *
2829  * Revision 1.3  1994/07/25  12:33:22  john
2830  * Network "pinging" in.
2831  *
2832  * Revision 1.2  1994/07/20  15:58:29  john
2833  * First installment of ipx stuff.
2834  *
2835  * Revision 1.1  1994/07/19  15:43:05  john
2836  * Initial revision
2837
2838 ------------------------------------------------------------------------
2839 include/palette.h:
2840
2841  * Revision 1.11  1994/11/15  17:55:10  john
2842  * Made text palette fade in when game over.
2843  *
2844  * Revision 1.10  1994/11/07  13:53:42  john
2845  * Added better gamma stufff.
2846  *
2847  * Revision 1.9  1994/11/07  13:38:03  john
2848  * Added gamma correction stuff.
2849  *
2850  * Revision 1.8  1994/11/05  13:05:59  john
2851  * Added back in code to allow keys during fade.
2852  *
2853  * Revision 1.7  1994/11/05  12:46:37  john
2854  * Changed palette stuff a bit.
2855  *
2856  * Revision 1.6  1994/09/22  16:08:37  john
2857  * Fixed some palette stuff.
2858  *
2859  * Revision 1.5  1994/08/09  11:27:04  john
2860  * Add cthru stuff.
2861  *
2862  * Revision 1.4  1994/06/09  10:39:33  john
2863  * In fade out.in functions, returned 1 if key was pressed...
2864  *
2865  * Revision 1.3  1994/05/31  19:04:24  john
2866  * Added key to stop fade if desired.
2867  *
2868  * Revision 1.2  1994/05/06  12:50:42  john
2869  * Added supertransparency; neatend things up; took out warnings.
2870  *
2871  * Revision 1.1  1994/05/04  14:59:57  john
2872  * Initial revision
2873
2874 ------------------------------------------------------------------------
2875 include/pcx.h:
2876
2877  * Revision 1.4  1995/01/21  17:07:34  john
2878  * Added out of memory error.
2879  *
2880  * Revision 1.3  1994/11/29  02:53:10  john
2881  * Added error messages; made call be more similiar to iff.
2882  *
2883  * Revision 1.2  1994/11/28  20:03:48  john
2884  * Added PCX functions.
2885  *
2886  * Revision 1.1  1994/11/28  19:57:45  john
2887  * Initial revision
2888
2889 ------------------------------------------------------------------------
2890 include/pstypes.h:
2891
2892  * Revision 1.2  1993/09/14  12:12:30  matt
2893  * Added #define for NULL
2894  *
2895  * Revision 1.1  1993/08/24  12:50:40  matt
2896  * Initial revision
2897
2898 ------------------------------------------------------------------------
2899 include/rle.h:
2900
2901  * Revision 1.5  1995/01/14  11:32:20  john
2902  * Added rle_cache_flush function.
2903  *
2904  * Revision 1.4  1994/11/10  13:16:01  matt
2905  * Added includes
2906  *
2907  * Revision 1.3  1994/11/09  19:53:51  john
2908  * Added texture rle caching.
2909  *
2910  * Revision 1.2  1994/11/09  16:35:18  john
2911  * First version with working RLE bitmaps.
2912  *
2913  * Revision 1.1  1994/11/09  12:40:17  john
2914  * Initial revision
2915
2916 ------------------------------------------------------------------------
2917 include/texmap.h:
2918
2919  * $Log: not supported by cvs2svn $
2920  * Revision 1.1  2004/08/28 23:17:45  schaffner
2921  * move old per-file change logs into new file ChangeLog-old
2922  *
2923  * Revision 1.2  2003/03/19 19:21:34  btb
2924  * header/extern declaration housekeeping
2925  *
2926  * Revision 1.1.1.1  2001/01/19 03:30:16  bradleyb
2927  * Import of d2x-0.0.8
2928  *
2929  * Revision 1.2  1999/07/07 21:21:56  donut
2930  * increased recip table size to better accommodate 640 res
2931  *
2932  * Revision 1.1.1.1  1999/06/14 22:02:20  donut
2933  * Import of d1x 1.37 source.
2934  *
2935  * Revision 1.2  1995/09/04  14:22:10  allender
2936  * #defines for fixed point limits on render buffer
2937  *
2938  * Revision 1.1  1995/05/04  20:14:50  allender
2939  * Initial revision
2940  *
2941  * Revision 1.17  1994/11/10  11:09:16  mike
2942  * detail level stuff.
2943  * 
2944  * Revision 1.16  1994/11/09  22:55:32  matt
2945  * Added variable Current_seg_depth for detail level optimization
2946  * 
2947  * Revision 1.15  1994/06/09  16:10:04  mike
2948  * Add prototype for SC2000
2949  * 
2950  * Revision 1.14  1994/05/25  18:46:16  matt
2951  * Added gr_upoly_tmap_ylr(), which generates ylr's for a polygon
2952  * 
2953  * Revision 1.13  1994/05/25  09:47:12  mike
2954  * Added interface support for linear texture mapper (Mike change, Matt commnet)
2955  * 
2956  * Revision 1.12  1994/05/24  17:30:43  mike
2957  * Prototype a bunch of linear, vertical scanning functions.
2958  * 
2959  * Revision 1.11  1994/05/19  23:26:14  mike
2960  * Add constants NUM_LIGHTING_VALUES, MAX_LIGHTING_VALUE, MIN_LIGHTING_VALUE,
2961  * all part of new lighting_values_in_0_to_1 system.
2962  * 
2963  * Revision 1.10  1994/05/14  17:19:21  matt
2964  * Added externs
2965  * 
2966  * Revision 1.9  1994/04/13  23:55:44  matt
2967  * Increased max_tmap_verts from 16 to 25
2968  * 
2969  * Revision 1.8  1994/03/31  08:35:43  mike
2970  * Prototype for gr_upoly_tmap.
2971  * 
2972  * Revision 1.7  1994/02/08  15:17:54  mike
2973  * define label for MAX_TMAP_VERTS
2974  * 
2975  * Revision 1.6  1994/01/31  15:41:51  mike
2976  * Add texture_map_lin_lin_sky_v
2977  * 
2978  * Revision 1.5  1994/01/18  10:49:40  mike
2979  * prototype for texture_map_lin_lin_sky
2980  * 
2981  * Revision 1.4  1993/11/30  17:09:46  mike
2982  * prototype for compute_lighting_value.
2983  * 
2984  * Revision 1.3  1993/11/22  10:50:38  matt
2985  * Add ifndef around body of file
2986  * 
2987  * Revision 1.2  1993/10/06  12:41:25  mike
2988  * Change prototype for draw_tmap.
2989  * 
2990  * Revision 1.1  1993/09/08  17:29:11  mike
2991  * Initial revision
2992
2993 ------------------------------------------------------------------------
2994 include/timer.h:
2995
2996  * Revision 1.8  1994/12/10  12:27:23  john
2997  * Added timer_get_approx_seconds.
2998  *
2999  * Revision 1.7  1994/12/10  12:10:25  john
3000  * Added types.h.
3001  *
3002  * Revision 1.6  1994/12/10  12:07:06  john
3003  * Added tick counter variable.
3004  *
3005  * Revision 1.5  1994/11/15  12:04:15  john
3006  * Cleaned up timer code a bit... took out unused functions
3007  * like timer_get_milliseconds, etc.
3008  *
3009  * Revision 1.4  1994/04/28  23:50:08  john
3010  * Changed calling for init_timer.  Made the function that the
3011  * timer calls be a far function. All of this was done to make
3012  * our timer system compatible with the HMI sound stuff.
3013  *
3014  * Revision 1.3  1994/02/17  15:57:12  john
3015  * Changed key libary to C.
3016  *
3017  * Revision 1.2  1994/01/18  10:58:34  john
3018  * Added timer_get_fixed_seconds
3019  *
3020  * Revision 1.1  1993/07/10  13:10:41  matt
3021  * Initial revision
3022
3023 ------------------------------------------------------------------------
3024 include/u_dpmi.h:
3025
3026  * Revision 1.9  1995/01/14  19:20:14  john
3027  * Added function to set a selector's base address.
3028  *
3029  * Revision 1.8  1994/11/28  20:22:03  john
3030  * Added some variables that return the amount of available
3031  * memory.
3032  *
3033  * Revision 1.7  1994/11/15  18:26:38  john
3034  * Added verbose flag.
3035  *
3036  * Revision 1.6  1994/11/07  11:35:05  john
3037  * Added prototype for real_free
3038  *
3039  * Revision 1.5  1994/10/27  19:54:48  john
3040  * Added unlock region function,.
3041  *
3042  * Revision 1.4  1994/09/27  18:27:56  john
3043  * Added pragma to make inp,outp,enable,disable intrinsic
3044  *
3045  * Revision 1.3  1994/09/27  11:54:45  john
3046  * Added DPMI init function.
3047  *
3048  * Revision 1.2  1994/08/24  18:53:51  john
3049  * Made Cyberman read like normal mouse; added dpmi module; moved
3050  * mouse from assembly to c. Made mouse buttons return time_down.
3051  *
3052  * Revision 1.1  1994/08/24  10:22:48  john
3053  * Initial revision
3054
3055 ------------------------------------------------------------------------
3056 include/vecmat.h:
3057
3058  * Revision 1.1  1995/04/17  16:18:05  allender
3059  * Initial revision
3060  *
3061  *
3062  * --- PC RCS Information ---
3063  * Revision 1.37  1995/02/22  13:23:22  john
3064  * Added the vms_vector_array structure, to access a vms_vector
3065  * with an array.
3066  *
3067  * Revision 1.36  1995/02/22  12:34:33  john
3068  * Took out anonymous unions.
3069  *
3070  * Revision 1.35  1994/12/13  14:44:20  matt
3071  * Added vm_vector_2_matrix_norm()
3072  *
3073  * Revision 1.34  1994/09/11  19:22:55  matt
3074  * Added vm_vec_normalized_dir_quick()
3075  *
3076  * Revision 1.33  1994/08/04  19:45:38  matt
3077  * Added option to make a bunch of functions (add, sub, dotprod) inline
3078  *
3079  * Revision 1.32  1994/07/19  18:52:36  matt
3080  * Added vm_vec_normalize_quick() and vm_vec_copy_normalize_quick()
3081  *
3082  * Revision 1.31  1994/06/16  18:24:30  matt
3083  * Added vm_vec_mag_quick()
3084  *
3085  * Revision 1.30  1994/06/10  23:19:00  matt
3086  * New register usage for vm_vec_ang_2_matrix()
3087  *
3088  * Revision 1.29  1994/06/01  17:32:06  matt
3089  * Fixed modify list for vm_vec_normalized_dir()
3090  *
3091  * Revision 1.28  1994/05/19  12:07:20  matt
3092  * Fixed globals and macros and added a constant
3093  *
3094  * Revision 1.27  1994/05/19  09:19:15  matt
3095  * Made vm_vec_normalized_dir() return mag of vector
3096  *
3097  * Revision 1.26  1994/05/18  22:28:57  matt
3098  * Added function vm_vec_normalized_dir()
3099  * Added C macros IS_ZERO_VEC(), vm_vec_zero(), and vm_set_identity()
3100  * Added C global static vars vmd_zero_vector & vmd_identity_matrix
3101  *
3102  * Revision 1.25  1994/05/18  21:45:06  matt
3103  * Added functions:
3104  *   vm_extract_angles_vector()
3105  *   vm_extract_angles_vector_normalized()
3106  *   vm_vec_copy_normalize()
3107  *
3108  * Revision 1.24  1994/05/13  12:42:16  matt
3109  * Added new function, vm_vec_dist_quick(), which does an approximation.
3110  *
3111  * Revision 1.23  1994/03/30  13:37:34  matt
3112  * Added prototype for vm_vec_scale_add(), and fixed typos
3113  *
3114  * Revision 1.22  1994/03/30  13:29:42  matt
3115  * Header for vm_vec_scale_add2()
3116  *
3117  * Revision 1.21  1994/01/31  19:45:13  matt
3118  * Added function vm_extract_angles_matrix()
3119  *
3120  * Revision 1.20  1993/12/21  19:46:14  matt
3121  * Added function vm_dist_to_plane()
3122  *
3123  * Revision 1.19  1993/12/13  17:26:41  matt
3124  * Added vm_vec_dist()
3125  *
3126  * Revision 1.18  1993/12/02  12:45:11  matt
3127  * New functions: vm_vec_copy_scale(), vm_vec_scale2()
3128  * Aliases: vm_transpose(), vm_vec_dot(), vm_vec_cross(), vm_copy_transpose()
3129  *
3130  * Revision 1.17  1993/10/29  22:38:36  matt
3131  * Changed matrix order, making direction vectors the rows
3132  *
3133  * Revision 1.16  1993/10/25  11:49:57  matt
3134  * Made vm_vec_delta_ang() take optional forward vector to return signed delta
3135  *
3136  * Revision 1.15  1993/10/20  01:10:05  matt
3137  * Added vm_vec_delta_ang(), vm_vec_delta_ang_norm(), and vm_vec_ang_2_matrix()
3138  *
3139  * Revision 1.14  1993/10/17  17:02:52  matt
3140  * vm_vector_2_matrix() now takes optional right vector
3141  *
3142  * Revision 1.13  1993/10/12  19:31:39  matt
3143  * Added IDENTITY_MATRIX constant
3144  *
3145  * Revision 1.12  1993/10/08  18:10:16  matt
3146  * Changed vm_vec_make() and vm_angvec_make() to be inline assembly
3147  * functions, to get rid of compiler warnings.  Did not change vm_mat_make(),
3148  * which could still get warnings if the return value is unused.
3149  *
3150  * Revision 1.11  1993/09/29  12:10:07  matt
3151  * Changed modified regs in pragmas to include return register
3152  *
3153  * Revision 1.10  1993/09/28  12:15:41  matt
3154  * Added func vm_vector_2_matrix()
3155  *
3156  * Revision 1.9  1993/09/24  21:18:38  matt
3157  * Added vm_vec_avg(), vm_vec_avg4(), and vm_angvec_make().
3158  * Documented which functions could have dest==source
3159  *
3160  * Revision 1.8  1993/09/20  14:56:11  matt
3161  * Added new function, vm_vec_perp()
3162  *
3163  * Revision 1.7  1993/09/20  14:27:42  mike
3164  * unfix last fix which introduced a bug
3165  *
3166  * Revision 1.6  1993/09/20  10:11:53  mike
3167  * no changes
3168  *
3169  * Revision 1.5  1993/09/20  09:58:58  mike
3170  * Re-fix vm_vec_make
3171  *
3172  * Revision 1.4  1993/09/20  09:41:21  mike
3173  * Correct vm_vec_make and vm_mat_make macros to return the destination
3174  * as the value of the macro.
3175  *
3176  * Revision 1.3  1993/09/17  11:23:47  matt
3177  * Added row access (via xrow,yrow,zrow) to vms_matrix
3178  * Added macro vm_mat_make(), like vm_vec_make()
3179  *
3180  * Revision 1.2  1993/09/17  11:10:32  matt
3181  * Added vm_vec_add2() and vm_vec_sub2(), which take 2 args (dest==src0)
3182  *
3183  * Revision 1.1  1993/09/16  20:10:01  matt
3184  * Initial revision
3185
3186 ------------------------------------------------------------------------
3187 main/ai.c:
3188
3189  * Revision 1.1  1995/12/05  14:15:37  allender
3190  * Initial revision
3191  *
3192  * Revision 1.10  1995/11/09  09:36:12  allender
3193  * cheats not active during demo playback
3194  *
3195  * Revision 1.9  1995/11/03  12:51:55  allender
3196  * shareware changes
3197  *
3198  * Revision 1.8  1995/10/31  10:25:07  allender
3199  * shareware stuff
3200  *
3201  * Revision 1.7  1995/10/26  14:01:38  allender
3202  * optimization for doing robot stuff only if anim angles done last frame
3203  *
3204  * Revision 1.6  1995/10/25  09:35:43  allender
3205  * prototype some functions causing mcc problems
3206  *
3207  * Revision 1.5  1995/10/17  13:11:40  allender
3208  * fix in ai code that makes bots only look for you every so often
3209  *
3210  * Revision 1.4  1995/10/10  11:48:10  allender
3211  * PC ai code
3212  *
3213  * Revision 2.11  1995/07/09  11:15:48  john
3214  * Put in Mike's code to fix bug where bosses don't gate in bots after
3215  * 32767 seconds of playing.
3216  *
3217  * Revision 2.10  1995/06/15  12:31:08  john
3218  * Fixed bug with cheats getting enabled when you type
3219  * the whole alphabet.
3220  *
3221  * Revision 2.9  1995/05/26  16:16:18  john
3222  * Split SATURN into define's for requiring cd, using cd, etc.
3223  * Also started adding all the Rockwell stuff.
3224  *
3225  * Revision 2.8  1995/04/06  15:12:27  john
3226  * Fixed bug with insane not working.
3227  *
3228  * Revision 2.7  1995/03/30  16:36:44  mike
3229  * text localization.
3230  *
3231  * Revision 2.6  1995/03/28  11:22:24  john
3232  * Added cheats to save file. Changed lunacy text.
3233  *
3234  * Revision 2.5  1995/03/27  16:45:07  john
3235  * Fixed some cheat bugs.  Added astral cheat.
3236  *
3237  * Revision 2.4  1995/03/24  15:29:17  mike
3238  * add new cheats.
3239  *
3240  * Revision 2.3  1995/03/21  14:39:45  john
3241  * Ifdef'd out the NETWORK code.
3242  *
3243  * Revision 2.2  1995/03/14  18:24:39  john
3244  * Force Destination Saturn to use CD-ROM drive.
3245  *
3246  * Revision 2.1  1995/03/06  16:47:14  mike
3247  * destination saturn
3248  *
3249  * Revision 2.0  1995/02/27  11:30:01  john
3250  * New version 2.0, which has no anonymous unions, builds with
3251  * Watcom 10.0, and doesn't require parsing BITMAPS.TBL.
3252  *
3253  * Revision 1.295  1995/02/22  13:23:04  allender
3254  * remove anonymous unions from object structure
3255  *
3256  * Revision 1.294  1995/02/13  11:00:43  rob
3257  * Make brain guys high enough to get an open slot.
3258  *
3259  * Revision 1.293  1995/02/13  10:31:55  mike
3260  * Make brains understand they can't open locked doors.
3261  *
3262  * Revision 1.292  1995/02/13  10:18:01  rob
3263  * Reduced brain guy's level of awareness to keep him from hogging slots.
3264  *
3265  * Revision 1.291  1995/02/11  12:27:12  mike
3266  * fix path-to-exit cheat.
3267  *
3268  * Revision 1.290  1995/02/11  01:56:30  mike
3269  * robots don't fire cheat.
3270  *
3271  * Revision 1.289  1995/02/10  17:15:09  rob
3272  * Fixed some stuff with 64 awareness stuff.
3273  *
3274  * Revision 1.288  1995/02/10  16:31:32  mike
3275  * oops.
3276  *
3277  * Revision 1.287  1995/02/10  16:24:45  mike
3278  * fix the network follow path fix.
3279  *
3280  * Revision 1.286  1995/02/10  16:11:40  mike
3281  * in serial or modem games, follow path guys don't move if far away and
3282  * can't see player.
3283  *
3284  * Revision 1.285  1995/02/09  13:11:35  mike
3285  * comment out a bunch of mprintfs.
3286  * add toaster (drops prox bombs, runs away) to boss gate list.
3287  *
3288  * Revision 1.284  1995/02/08  22:44:53  rob
3289  * Lowerd anger level for follow path of any sort.
3290  *
3291  * Revision 1.283  1995/02/08  22:30:43  mike
3292  * lower awareness on station guys if they are returning home (multiplayer).
3293  *
3294  * Revision 1.282  1995/02/08  17:01:06  rob
3295  * Fixed problem with toasters dropping of proximity bombs.
3296  *
3297  * Revision 1.281  1995/02/08  11:49:35  rob
3298  * Reduce Green-guy attack awareness level so we don't let him attack us too.
3299  *
3300  * Revision 1.280  1995/02/08  11:37:52  mike
3301  * Check for failures in call to obj_create.
3302  *
3303  * Revision 1.279  1995/02/07  20:38:46  mike
3304  * fix toasters in multiplayer
3305  *
3306  *
3307  * Revision 1.278  1995/02/07  16:51:07  mike
3308  * fix sound time play bug.
3309  *
3310  * Revision 1.277  1995/02/06  22:33:04  mike
3311  * make robots follow path better in cooperative/roboarchy.
3312  *
3313  * Revision 1.276  1995/02/06  18:15:42  rob
3314  * Added forced sends for evasion movemnet.
3315  *
3316  * Revision 1.275  1995/02/06  16:41:22  rob
3317  * Change some positioning calls.
3318  *
3319  * Revision 1.274  1995/02/06  11:40:33  mike
3320  * replace some lint-related hacks with clean, proper code.
3321  *
3322  * Revision 1.273  1995/02/04  17:28:19  mike
3323  * make station guys return better.
3324  *
3325  * Revision 1.272  1995/02/03  17:40:55  mike
3326  * fix problem with robots falling asleep if you sit in game overnight, not in pause...bah.
3327  *
3328  * Revision 1.271  1995/02/02  21:11:25  rob
3329  * Tweaking stuff for multiplayer ai.
3330  *
3331  * Revision 1.270  1995/02/02  17:32:06  john
3332  * Added Hack for Assert that Mike put in after using Lint to find
3333  * uninitialized variables.
3334  *
3335  * Revision 1.269  1995/02/02  16:46:31  mike
3336  * fix boss gating.
3337  *
3338  * Revision 1.268  1995/02/02  16:27:29  mike
3339  * make boss not put out infinite robots.
3340  *
3341  * Revision 1.267  1995/02/01  21:10:02  mike
3342  * lint found bug! player_visibility not initialized!
3343  *
3344  * Revision 1.266  1995/02/01  20:51:27  john
3345  * Lintized
3346  *
3347  * Revision 1.265  1995/02/01  17:14:05  mike
3348  * fix robot sounds.
3349  *
3350  * Revision 1.264  1995/01/31  16:16:40  mike
3351  * Comment out "Darn you, John" Int3().
3352  *
3353  * Revision 1.263  1995/01/30  20:55:04  mike
3354  * fix nonsense in robot firing when a player is cloaked.
3355  *
3356  * Revision 1.262  1995/01/30  17:15:10  rob
3357  * Fixed problems with bigboss eclip messages.
3358  * Tweaked robot position sending for modem purposes.
3359  *
3360  * Revision 1.261  1995/01/30  15:30:31  rob
3361  * Prevent non-master players from gating in robots.
3362  *
3363  * Revision 1.260  1995/01/30  13:30:55  mike
3364  * new cases for firing at other players were bogus, could send position
3365  * without permission.
3366  *
3367  * Revision 1.259  1995/01/30  13:01:17  mike
3368  * Make robots fire at player other than one they are controlled by sometimes.
3369  *
3370  * Revision 1.258  1995/01/29  16:09:17  rob
3371  * Trying to get robots to shoot at non-controlling players.
3372  *
3373  * Revision 1.257  1995/01/29  13:47:05  mike
3374  * Make boss have more fireballs on death, have until end (though silent at end).
3375  * Fix bug which was preventing him from teleporting until hit, so he'd always
3376  * be in the same place when the player enters the room.
3377  *
3378  * Revision 1.256  1995/01/28  17:40:18  mike
3379  * make boss teleport & gate before you see him.
3380  *
3381  * Revision 1.255  1995/01/27  17:02:08  mike
3382  * move code around, was sending one frame (or worse!) old robot information.
3383  *
3384  * Revision 1.254  1995/01/26  17:02:43  mike
3385  * make fusion cannon have more chrome, make fusion, mega rock you!
3386  *
3387  * Revision 1.253  1995/01/26  15:11:17  rob
3388  * Shutup!  I fixed it!
3389  *
3390  * Revision 1.252  1995/01/26  15:08:55  rob
3391  * Changed robot gating to accomodate multiplayer.
3392  *
3393  * Revision 1.251  1995/01/26  14:49:04  rob
3394  * Increase awareness level for firing to 94.
3395  *
3396  * Revision 1.250  1995/01/26  12:41:20  mike
3397  * fix bogus multiplayer code, would send permission without getting permission.
3398  *
3399  * Revision 1.249  1995/01/26  12:23:23  rob
3400  * Removed defines that were moved to ai.h
3401  *
3402  * Revision 1.248  1995/01/25  23:38:48  mike
3403  * modify list of robots gated in by super boss.
3404  *
3405  * Revision 1.247  1995/01/25  21:21:13  rob
3406  * Trying to let robots fire at a player even if they're not in control.
3407  *
3408  * Revision 1.246  1995/01/25  13:50:37  mike
3409  * Robots make angry sounds.
3410  *
3411  * Revision 1.245  1995/01/25  10:53:47  mike
3412  * better handling of robots which poke out of mine and try to recover.
3413  *
3414  * Revision 1.244  1995/01/24  22:03:02  mike
3415  * Tricky code to move a robot to a legal position if he is poking out of
3416  * the mine, even if it means moving him to another segment.
3417  *
3418  * Revision 1.243  1995/01/24  20:12:06  rob
3419  * Changed robot fire awareness level from 74 to 94.
3420  *
3421  * Revision 1.242  1995/01/24  13:22:32  mike
3422  * make robots accelerate faster, and Difficulty_level dependent.
3423  *
3424  * Revision 1.241  1995/01/24  12:09:39  mike
3425  * make robots animate in multiplayer.
3426  *
3427  * Revision 1.240  1995/01/21  21:21:10  mike
3428  * Make boss only gate robots into specified segments.
3429  *
3430  * Revision 1.239  1995/01/20  20:21:26  mike
3431  * prevent unnecessary boss cloaking.
3432
3433 ------------------------------------------------------------------------
3434 main/ai.h:
3435
3436  * Revision 1.3  1995/10/15  16:28:07  allender
3437  * added flag to player_is_visible function
3438  *
3439  * Revision 1.2  1995/10/10  11:48:32  allender
3440  * PC ai header
3441  *
3442  * Revision 1.1  1995/05/16  15:54:00  allender
3443  * Initial revision
3444  *
3445  * Revision 2.0  1995/02/27  11:33:07  john
3446  * New version 2.0, which has no anonymous unions, builds with
3447  * Watcom 10.0, and doesn't require parsing BITMAPS.TBL.
3448  *
3449  * Revision 1.57  1995/02/04  17:28:31  mike
3450  * make station guys return better.
3451  *
3452  * Revision 1.56  1995/02/04  10:03:23  mike
3453  * Fly to exit cheat.
3454  *
3455  * Revision 1.55  1995/02/01  19:23:52  rob
3456  * Externed a boss var.
3457  *
3458  * Revision 1.54  1995/01/30  13:00:58  mike
3459  * Make robots fire at player other than one they are controlled by sometimes.
3460  *
3461  * Revision 1.53  1995/01/26  15:09:16  rob
3462  * Changed robot gating to accomodate multiplayer.
3463  *
3464  * Revision 1.52  1995/01/26  12:23:12  rob
3465  * Added new externs needed for multiplayer.
3466  *
3467  * Revision 1.51  1995/01/21  21:22:14  mike
3468  * Kill prototype of init_boss_segments, which didn't need to be public
3469  * and had changed.
3470  *
3471  * Revision 1.50  1995/01/16  19:24:29  mike
3472  * Publicize BOSS_GATE_MATCEN_NUM and Boss_been_hit.
3473  *
3474  * Revision 1.49  1995/01/02  16:17:35  mike
3475  * prototype some super boss function for gameseq.
3476  *
3477  * Revision 1.48  1994/12/19  17:08:06  mike
3478  * deal with new ai_multiplayer_awareness which returns a value saying whether this object can be moved by this player.
3479  *
3480  * Revision 1.47  1994/12/12  17:18:04  mike
3481  * make boss cloak/teleport when get hit, make quad laser 3/4 as powerful.
3482  *
3483  * Revision 1.46  1994/12/08  15:46:16  mike
3484  * better robot behavior.
3485  *
3486  * Revision 1.45  1994/11/27  23:16:08  matt
3487  * Made debug code go away when debugging turned off
3488  *
3489  * Revision 1.44  1994/11/16  23:38:41  mike
3490  * new improved boss teleportation behavior.
3491  *
3492  * Revision 1.43  1994/11/10  17:45:11  mike
3493  * debugging.
3494  *
3495  * Revision 1.42  1994/11/07  10:37:42  mike
3496  * hooks for rob's network code.
3497  *
3498  * Revision 1.41  1994/11/06  15:10:50  mike
3499  * prototype a debug function for dumping ai info.
3500  *
3501  * Revision 1.40  1994/11/02  17:57:30  rob
3502  * Added extern of Believe_player_pos needed to get control centers
3503  * locating people.
3504  *
3505  * Revision 1.39  1994/10/28  19:43:39  mike
3506  * Prototype Boss_cloak_start_time, Boss_cloak_end_time.
3507  *
3508  * Revision 1.38  1994/10/22  14:14:42  mike
3509  * Prototype ai_reset_all_paths.
3510  *
3511  * Revision 1.37  1994/10/21  20:42:01  mike
3512  * Define MAX_PATH_LENGTH: maximum allowed length of a path.
3513  *
3514  * Revision 1.36  1994/10/20  09:49:18  mike
3515  * Prototype something.
3516  *
3517  *
3518  * Revision 1.35  1994/10/18  15:37:52  mike
3519  * Define ROBOT_BOSS1.
3520  *
3521  * Revision 1.34  1994/10/13  11:12:25  mike
3522  * Prototype some door functions.
3523  *
3524  * Revision 1.33  1994/10/12  21:28:51  mike
3525  * Prototype create_n_segment_path_to_door
3526  * Prototype ai_open_doors_in_segment
3527  * Prototype ai_door_is_openable.
3528  *
3529  * Revision 1.32  1994/10/11  15:59:41  mike
3530  * Prototype Robot_firing_enabled.
3531  *
3532  * Revision 1.31  1994/10/09  22:02:48  mike
3533  * Adapt create_path_points and create_n_segment_path prototypes to use avoid_seg for player evasion.
3534  *
3535  * Revision 1.30  1994/09/18  18:07:44  mike
3536  * Update prototypes for create_path_points and create_path_to_player.
3537  *
3538  * Revision 1.29  1994/09/15  16:34:08  mike
3539  * Prototype do_ai_robot_hit_attack.
3540  *
3541  * Revision 1.28  1994/09/12  19:12:35  mike
3542  * Prototype attempt_to_resume_path.
3543  *
3544  * Revision 1.27  1994/08/25  21:55:32  mike
3545  * Add some prototypes.
3546  *
3547  * Revision 1.26  1994/08/10  19:53:24  mike
3548  * Prototype create_path_to_player and init_robots_for_level.
3549  *
3550  * Revision 1.25  1994/08/04  16:32:58  mike
3551  * prototype create_path_to_player.
3552  *
3553  * Revision 1.24  1994/08/03  15:17:20  mike
3554  * Prototype make_random_vector.
3555  *
3556  * Revision 1.23  1994/07/31  18:10:34  mike
3557  * Update prototype for create_path_points.
3558  *
3559  * Revision 1.22  1994/07/28  12:36:14  matt
3560  * Cleaned up object bumping code
3561
3562 ------------------------------------------------------------------------
3563 main/ai2.c:
3564
3565  * Revision 1.1  1995/05/25  12:00:31  mike
3566  * Initial revision
3567
3568 ------------------------------------------------------------------------
3569 main/aipath.c:
3570
3571  * Revision 1.5  1995/10/26  14:12:03  allender
3572  * prototype functions for mcc compiler
3573  *
3574  * Revision 1.4  1995/10/25  09:38:22  allender
3575  * prototype some functions causing mcc grief
3576  *
3577  * Revision 1.3  1995/10/10  11:48:43  allender
3578  * PC ai code
3579  *
3580  * Revision 2.0  1995/02/27  11:30:48  john
3581  * New version 2.0, which has no anonymous unions, builds with
3582  * Watcom 10.0, and doesn't require parsing BITMAPS.TBL.
3583  *
3584  * Revision 1.101  1995/02/22  13:42:44  allender
3585  * remove anonymous unions for object structure
3586  *
3587  * Revision 1.100  1995/02/10  16:20:04  mike
3588  * fix bogosity in create_path_points, assumed all objects were robots.
3589  *
3590  * Revision 1.99  1995/02/07  21:09:30  mike
3591  * make run_from guys have diff level based speed.
3592  *
3593  * Revision 1.98  1995/02/04  17:28:29  mike
3594  * make station guys return better.
3595  *
3596  * Revision 1.97  1995/02/04  10:28:39  mike
3597  * fix compile error!
3598  *
3599  * Revision 1.96  1995/02/04  10:03:37  mike
3600  * Fly to exit cheat.
3601  *
3602  * Revision 1.95  1995/02/01  21:10:36  mike
3603  * Array name was dereferenced.  Not a bug, but unclean.
3604  *
3605  * Revision 1.94  1995/02/01  17:14:12  mike
3606  * comment out some common mprintfs which didn't matter.
3607  *
3608  * Revision 1.93  1995/01/30  13:01:23  mike
3609  * Make robots fire at player other than one they are controlled by sometimes.
3610  *
3611  * Revision 1.92  1995/01/29  22:29:32  mike
3612  * add more debug info for guys that get lost.
3613  *
3614  * Revision 1.91  1995/01/20  16:56:05  mike
3615  * station stuff.
3616  *
3617  * Revision 1.90  1995/01/18  10:59:45  mike
3618  * comment out some mprintfs.
3619  *
3620  * Revision 1.89  1995/01/17  16:58:34  mike
3621  * make path following work for multiplayer.
3622  *
3623  * Revision 1.88  1995/01/17  14:21:44  mike
3624  * make run_from guys run better.
3625  *
3626  * Revision 1.87  1995/01/14  17:09:04  mike
3627  * playing with crazy josh, he's kinda slow and dumb now.
3628  *
3629  * Revision 1.86  1995/01/13  18:52:28  mike
3630  * comment out int3.
3631  *
3632  * Revision 1.85  1995/01/05  09:42:11  mike
3633  * compile out code based on SHAREWARE.
3634  *
3635  * Revision 1.84  1995/01/02  12:38:32  mike
3636  * make crazy josh turn faster, therefore evade player better.
3637  *
3638  * Revision 1.83  1994/12/27  15:59:40  mike
3639  * tweak ai_multiplayer_awareness constants.
3640  *
3641  * Revision 1.82  1994/12/19  17:07:10  mike
3642  * deal with new ai_multiplayer_awareness which returns a value saying whether this object can be moved by this player.
3643  *
3644  * Revision 1.81  1994/12/15  13:04:30  mike
3645  * Replace Players[Player_num].time_total references with GameTime.
3646  *
3647  * Revision 1.80  1994/12/09  16:13:23  mike
3648  * remove debug code.
3649  *
3650  * Revision 1.79  1994/12/07  00:36:54  mike
3651  * make robots get out of matcens better and be aware of player.
3652  *
3653  * Revision 1.78  1994/11/30  00:59:05  mike
3654  * optimizations.
3655  *
3656  * Revision 1.77  1994/11/27  23:13:39  matt
3657  * Made changes for new mprintf calling convention
3658  *
3659  * Revision 1.76  1994/11/23  21:59:34  mike
3660  * comment out some mprintfs.
3661  *
3662  * Revision 1.75  1994/11/21  16:07:14  mike
3663  * flip PARALLAX flag, prevent annoying debug information.
3664  *
3665  * Revision 1.74  1994/11/19  15:13:28  mike
3666  * remove unused code and data.
3667  *
3668  * Revision 1.73  1994/11/17  14:53:15  mike
3669  * segment validation functions moved from editor to main.
3670  *
3671  * Revision 1.72  1994/11/16  23:38:42  mike
3672  * new improved boss teleportation behavior.
3673  *
3674  * Revision 1.71  1994/11/13  17:18:30  mike
3675  * debug code, then comment it out.
3676  *
3677  * Revision 1.70  1994/11/11  16:41:43  mike
3678  * flip the PARALLAX flag.
3679  *
3680  * Revision 1.69  1994/11/11  16:33:45  mike
3681  * twiddle the PARALLAX flag.
3682  *
3683  *
3684  * Revision 1.68  1994/11/10  21:32:29  mike
3685  * debug code.
3686  *
3687  * Revision 1.67  1994/11/10  20:15:07  mike
3688  * fix stupid bug: uninitialized pointer.
3689  *
3690  * Revision 1.66  1994/11/10  17:45:15  mike
3691  * debugging.
3692  *
3693  * Revision 1.65  1994/11/10  17:28:10  mike
3694  * debugging.
3695
3696 ------------------------------------------------------------------------
3697 main/aistruct.h:
3698
3699  * Revision 1.2  1995/10/10  11:49:04  allender
3700  * PC ai code
3701  *
3702  * Revision 1.1  1995/05/16  15:54:08  allender
3703  * Initial revision
3704  *
3705  * Revision 2.0  1995/02/27  11:30:19  john
3706  * New version 2.0, which has no anonymous unions, builds with
3707  * Watcom 10.0, and doesn't require parsing BITMAPS.TBL.
3708  *
3709  * Revision 1.34  1995/01/25  13:50:46  mike
3710  * Robots make angry sounds.
3711  *
3712  * Revision 1.33  1994/12/29  12:44:56  rob
3713  * Added new coop robot flag.
3714  *
3715  * Revision 1.32  1994/12/20  20:41:54  rob
3716  * Added new ai flag for multiplayer robots.
3717  *
3718  * Revision 1.31  1994/12/19  16:37:39  rob
3719  * Added a new flag for remote controlled objects.
3720  *
3721  * Revision 1.30  1994/12/07  00:36:07  mike
3722  * fix phys_apply_rot for robots -- ai was bashing effect in next frame.
3723  *
3724  * Revision 1.29  1994/12/02  22:06:28  mike
3725  * add fields to allow robots to make awareness sounds every so often, not every damn blasted frame
3726  *
3727  * Revision 1.28  1994/11/04  17:18:35  yuan
3728  * Increased MAX_SEG_POINTS to 2500.
3729  *
3730  * Revision 1.27  1994/10/17  21:19:22  mike
3731  * robot cloaking.
3732  *
3733  * Revision 1.26  1994/10/12  21:28:38  mike
3734  * Add new ai mode: AIM_OPEN_DOOR.
3735  * Add GOALSIDE to aip.
3736  *
3737  * Revision 1.25  1994/09/25  23:41:08  matt
3738  * Changed the object load & save code to read/write the structure fields one
3739  * at a time (rather than the whole structure at once).  This mean that the
3740  * object structure can be changed without breaking the load/save functions.
3741  * As a result of this change, the local_object data can be and has been
3742  * incorporated into the object array.  Also, timeleft is now a property
3743  * of all objects, and the object structure has been otherwise cleaned up.
3744  *
3745  * Revision 1.24  1994/09/21  12:28:11  mike
3746  * Change AI behavior for when player cloaked
3747  *
3748  * Revision 1.23  1994/09/19  21:43:00  mike
3749  * Add follow_path_start_seg and follow_path_end_seg to aistruct.h.
3750  *
3751  * Revision 1.22  1994/09/18  18:06:14  mike
3752  * Add Last_uncloaked_time and Last_uncloaked_position variables.
3753  *
3754  * Revision 1.21  1994/09/15  16:31:38  mike
3755  * Define GREEN_GUY
3756  * Add previous_visibility to ai_local struct.
3757  *
3758  * Revision 1.20  1994/09/12  19:12:45  mike
3759  * Change some bytes to ints in ai_local so I could set watchpoints.
3760  *
3761  * Revision 1.19  1994/08/25  21:53:31  mike
3762  * Add behavior, taking place of what used to be mode.
3763  *
3764  * Revision 1.18  1994/08/23  16:38:09  mike
3765  * rapidfire_count in ai_local.
3766  *
3767  * Revision 1.17  1994/08/19  17:38:23  mike
3768  * *** empty log message ***
3769  *
3770  * Revision 1.16  1994/08/17  22:18:58  mike
3771  * add time_since_processed to ai_local.
3772  *
3773  * Revision 1.15  1994/08/10  19:52:25  mike
3774  * Add Overall_agitation.
3775  *
3776  * Revision 1.14  1994/08/04  16:32:32  mike
3777  * Add time_player_seen.
3778  *
3779  * Revision 1.13  1994/07/28  16:58:11  mike
3780  * Move constants from ai.c
3781  *
3782  * Revision 1.12  1994/07/19  15:26:24  mike
3783  * New ai_static and ai_local structures.
3784  *
3785  * Revision 1.11  1994/07/15  15:17:19  matt
3786  * Changes MAX_AI_FLAGS for better alignment
3787
3788 ------------------------------------------------------------------------
3789 main/automap.c:
3790
3791  * Revision 1.8  1995/10/31  10:24:54  allender
3792  * shareware stuff
3793  *
3794  * Revision 1.7  1995/10/21  16:18:20  allender
3795  * blit pcx background directly to Page canvas instead of creating
3796  * seperate bitmap for it -- hope to solve VM bug on some macs
3797  *
3798  * Revision 1.6  1995/10/20  00:49:16  allender
3799  * added redbook check during automap
3800  *
3801  * Revision 1.5  1995/09/13  08:44:07  allender
3802  * Dave Denhart's changes to speed up the automap
3803  *
3804  * Revision 1.4  1995/08/18  15:46:00  allender
3805  * put text all on upper bar -- and fixed background since
3806  * changing xparency color
3807  *
3808  * Revision 1.3  1995/08/03  15:15:18  allender
3809  * fixed edge hashing problem causing automap to crash
3810  *
3811  * Revision 1.2  1995/07/12  12:49:27  allender
3812  * works in 640x480 mode
3813  *
3814  * Revision 1.1  1995/05/16  15:22:59  allender
3815  * Initial revision
3816  *
3817  * Revision 2.2  1995/03/21  14:41:26  john
3818  * Ifdef'd out the NETWORK code.
3819  *
3820  * Revision 2.1  1995/03/20  18:16:06  john
3821  * Added code to not store the normals in the segment structure.
3822  *
3823  * Revision 2.0  1995/02/27  11:32:55  john
3824  * New version 2.0, which has no anonymous unions, builds with
3825  * Watcom 10.0, and doesn't require parsing BITMAPS.TBL.
3826  *
3827  * Revision 1.117  1995/02/22  14:11:31  allender
3828  * remove anonymous unions from object structure
3829  *
3830  * Revision 1.116  1995/02/22  13:24:39  john
3831  * Removed the vecmat anonymous unions.
3832  *
3833  * Revision 1.115  1995/02/09  14:57:02  john
3834  * Reduced mem usage. Made automap slide farther.
3835  *
3836  * Revision 1.114  1995/02/07  20:40:44  rob
3837  * Allow for anarchy automap of player pos by option.
3838  *
3839  * Revision 1.113  1995/02/07  15:45:33  john
3840  * Made automap memory be static.
3841  *
3842  * Revision 1.112  1995/02/02  12:24:00  adam
3843  * played with automap labels
3844  *
3845  * Revision 1.111  1995/02/02  01:52:52  john
3846  * Made the automap use small font.
3847  *
3848  * Revision 1.110  1995/02/02  01:34:34  john
3849  * Made Reset in automap not change segmentlimit.
3850  *
3851  * Revision 1.109  1995/02/02  01:23:11  john
3852  * Finalized the new automap partial viewer.
3853  *
3854  * Revision 1.108  1995/02/02  00:49:45  mike
3855  * new automap segment-depth functionality.
3856  *
3857  * Revision 1.107  1995/02/02  00:23:04  john
3858  * Half of the code for new connected distance stuff in automap.
3859  *
3860  * Revision 1.106  1995/02/01  22:54:00  john
3861  * Made colored doors not fade in automap. Made default
3862  * viewing area be maxxed.
3863  *
3864  * Revision 1.105  1995/02/01  13:16:13  john
3865  * Added great grates.
3866  *
3867  * Revision 1.104  1995/01/31  12:47:06  john
3868  * Made Alt+F only work with cheats enabled.
3869  *
3870  * Revision 1.103  1995/01/31  12:41:23  john
3871  * Working with new controls.
3872  *
3873  * Revision 1.102  1995/01/31  12:04:19  john
3874  * Version 2 of new key control.
3875  *
3876  * Revision 1.101  1995/01/31  11:32:00  john
3877  * First version of new automap system.
3878  *
3879  * Revision 1.100  1995/01/28  16:55:48  john
3880  * Made keys draw in automap in the segments that you have
3881  * visited.
3882  *
3883  * Revision 1.99  1995/01/28  14:44:51  john
3884  * Made hostage doors show up on automap.
3885  *
3886  * Revision 1.98  1995/01/22  17:03:49  rob
3887  * Fixed problem drawing playerships in automap coop/team mode
3888  *
3889  * Revision 1.97  1995/01/21  17:23:11  john
3890  * Limited S movement in map. Made map bitmap load from disk
3891  * and then freed it.
3892  *
3893  * Revision 1.96  1995/01/19  18:55:38  john
3894  * Don't draw players in automap if not obj_player.
3895  *
3896  * Revision 1.95  1995/01/19  18:48:13  john
3897  * Made player colors better in automap.
3898  *
3899  * Revision 1.94  1995/01/19  17:34:52  rob
3900  * Added team colorizations in automap.
3901  *
3902  * Revision 1.93  1995/01/19  17:15:36  rob
3903  * Trying to add player ships into map for coop and team mode.
3904  *
3905  * Revision 1.92  1995/01/19  17:11:09  john
3906  * Added code for Rob to draw Multiplayer ships in automap.
3907  *
3908  * Revision 1.91  1995/01/12  13:35:20  john
3909  * Fixed bug with Segment 0 not getting displayed
3910  * in automap if you have EDITOR compiled in.
3911  *
3912  * Revision 1.90  1995/01/08  16:17:14  john
3913  * Added code to draw player's up vector while in automap.
3914  *
3915  * Revision 1.89  1995/01/08  16:09:41  john
3916  * Fixed problems with grate.
3917  *
3918  * Revision 1.88  1994/12/14  22:54:17  john
3919  * Fixed bug that didn't show hostages in automap.
3920  *
3921  * Revision 1.87  1994/12/09  00:41:03  mike
3922  * fix hang in automap print screen
3923  *
3924  * Revision 1.86  1994/12/05  23:37:15  matt
3925  * Took out calls to warning() function
3926  *
3927  * Revision 1.85  1994/12/03  22:35:28  yuan
3928  * Localization 412
3929  *
3930  * Revision 1.84  1994/12/02  15:05:45  matt
3931  * Added new "official" cheats
3932  *
3933  * Revision 1.83  1994/11/30  12:10:49  adam
3934  * added support for PCX titles/brief screens
3935  *
3936  * Revision 1.82  1994/11/27  23:15:12  matt
3937  * Made changes for new mprintf calling convention
3938  *
3939  * Revision 1.81  1994/11/27  15:35:52  matt
3940  * Enable screen shots even when debugging is turned off
3941  *
3942  * Revision 1.80  1994/11/26  22:51:43  matt
3943  * Removed editor-only fields from segment structure when editor is compiled
3944  * out, and padded segment structure to even multiple of 4 bytes.
3945  *
3946  * Revision 1.79  1994/11/26  16:22:48  matt
3947  * Reduced leave_time
3948  *
3949  * Revision 1.78  1994/11/23  22:00:10  mike
3950  * show level number.
3951  *
3952  * Revision 1.77  1994/11/21  11:40:33  rob
3953  * Tweaked the game-loop for automap in multiplayer games.
3954  *
3955  * Revision 1.76  1994/11/18  16:42:06  adam
3956  * removed a font
3957  *
3958  * Revision 1.75  1994/11/17  13:06:48  adam
3959  * changed font
3960  *
3961  * Revision 1.74  1994/11/14  20:47:17  john
3962  * Attempted to strip out all the code in the game
3963  * directory that uses any ui code.
3964
3965 ------------------------------------------------------------------------
3966 main/automap.h:
3967
3968  * Revision 1.2  1995/07/12  12:48:33  allender
3969  * moved edge_list structure into here for mallocing in mglobal
3970  *
3971  * Revision 1.1  1995/05/16  15:54:31  allender
3972  * Initial revision
3973  *
3974  * Revision 2.0  1995/02/27  11:29:35  john
3975  * New version 2.0, which has no anonymous unions, builds with
3976  * Watcom 10.0, and doesn't require parsing BITMAPS.TBL.
3977  *
3978  * Revision 1.5  1994/12/09  00:41:21  mike
3979  * fix hang in automap print screen
3980  *
3981  * Revision 1.4  1994/07/14  11:25:29  john
3982  * Made control centers destroy better; made automap use Tab key.
3983  *
3984  * Revision 1.3  1994/07/12  15:45:51  john
3985  * Made paritial map.
3986  *
3987  * Revision 1.2  1994/07/07  18:35:05  john
3988  * First version of automap
3989  *
3990  * Revision 1.1  1994/07/07  15:12:13  john
3991  * Initial revision
3992
3993 ------------------------------------------------------------------------
3994 main/bm.c:
3995
3996  * Revision 1.1  1995/05/16  15:23:08  allender
3997  * Initial revision
3998  *
3999  * Revision 2.3  1995/03/14  16:22:04  john
4000  * Added cdrom alternate directory stuff.
4001  *
4002  * Revision 2.2  1995/03/07  16:51:48  john
4003  * Fixed robots not moving without edtiro bug.
4004  *
4005  * Revision 2.1  1995/03/06  15:23:06  john
4006  * New screen techniques.
4007  *
4008  * Revision 2.0  1995/02/27  11:27:05  john
4009  * New version 2.0, which has no anonymous unions, builds with
4010  * Watcom 10.0, and doesn't require parsing BITMAPS.TBL.
4011
4012 ------------------------------------------------------------------------
4013 main/bm.h:
4014
4015  * Revision 1.1  1995/05/16  15:54:39  allender
4016  * Initial revision
4017  *
4018  * Revision 2.0  1995/02/27  11:32:59  john
4019  * New version 2.0, which has no anonymous unions, builds with
4020  * Watcom 10.0, and doesn't require parsing BITMAPS.TBL.
4021  *
4022  * Revision 1.60  1994/12/06  13:24:58  matt
4023  * Made exit model come out of bitmaps.tbl
4024  *
4025  * Revision 1.59  1994/11/10  14:02:48  matt
4026  * Hacked in support for player ships with different textures
4027  *
4028  * Revision 1.58  1994/10/27  13:32:17  john
4029  * Made TmapList only be in if editor
4030  *
4031  * Revision 1.57  1994/10/11  12:25:20  matt
4032  * Added "hot rocks" that create badass explosion when hit by weapons
4033  *
4034  * Revision 1.56  1994/09/29  12:38:13  matt
4035  * Took out include of digi.h, saving hours of unneeded compiles
4036  *
4037  * Revision 1.55  1994/09/25  00:39:51  matt
4038  * Added the ability to make eclips (monitors, fans) which can be blown up
4039  *
4040  * Revision 1.54  1994/09/17  01:40:59  matt
4041  * Added status bar/sizable window mode, and in the process revamped the
4042  * whole cockpit mode system.
4043  *
4044  * Revision 1.53  1994/09/08  16:20:48  matt
4045  * Gave textures the ability to cause damage when scraped
4046  *
4047  * Revision 1.52  1994/08/30  22:23:43  matt
4048  * Added cabability for player ship to have alternate model to use to
4049  * create debris.
4050  *
4051  * Revision 1.51  1994/08/26  15:35:57  matt
4052  * Made eclips usable on more than one object at a time
4053  *
4054  * Revision 1.50  1994/08/23  16:59:51  john
4055  * Added 3 cockpuits
4056  *
4057  * Revision 1.49  1994/08/19  20:09:43  matt
4058  * Added end-of-level cut scene with external scene
4059  *
4060  * Revision 1.48  1994/08/12  22:20:45  matt
4061  * Generalized polygon objects (such as control center)
4062  *
4063  * Revision 1.47  1994/08/09  16:04:21  john
4064  * Added network players to editor.
4065  *
4066  * Revision 1.46  1994/08/09  09:01:31  john
4067  * Increase MAX_TEXTURES
4068  *
4069  * Revision 1.45  1994/07/13  00:14:57  matt
4070  * Moved all (or nearly all) of the values that affect player movement to
4071  * bitmaps.tbl
4072  *
4073  * Revision 1.44  1994/06/20  21:33:15  matt
4074  * Made bm.h not include sounds.h, to reduce dependencies
4075  *
4076  * Revision 1.43  1994/06/15  11:55:58  matt
4077  * Added 3d model for player
4078  *
4079  * Revision 1.42  1994/06/13  16:09:11  adam
4080  * increased max textures to 600
4081  *
4082  * Revision 1.41  1994/06/06  15:38:58  john
4083  * Made fullscreen view be just another cockpit, but the "hole"
4084  * in the cockpit is just bigger.
4085  *
4086  * Revision 1.40  1994/05/26  21:08:59  matt
4087  * Moved robot stuff out of polygon model and into robot_info struct
4088  * Made new file, robot.c, to deal with robots
4089  *
4090  * Revision 1.39  1994/05/18  11:00:05  mike
4091  * Add robot_info stuff.
4092  *
4093  * Revision 1.38  1994/05/17  14:44:56  mike
4094  * Get object type and id from ObjType and ObjId.
4095  *
4096  * Revision 1.37  1994/05/17  12:04:45  mike
4097  * Deal with little known fact that polygon object != robot.
4098  *
4099  * Revision 1.36  1994/05/16  16:17:35  john
4100  * Bunch of stuff on my Inferno Task list May16-23
4101  *
4102  * Revision 1.35  1994/04/27  11:43:42  john
4103  * First version of sound! Yay!
4104  *
4105  * Revision 1.34  1994/04/22  10:53:48  john
4106  * Increased MAX_TEXTURES to 500.
4107  *
4108  * Revision 1.33  1994/04/01  11:15:05  yuan
4109  * Added multiple bitmap functionality to all objects...
4110  * (hostages, powerups, lasers, etc.)
4111  * Hostages and powerups are implemented in the object system,
4112  * just need to finish function call to "affect" player.
4113  *
4114  * Revision 1.32  1994/03/25  17:30:37  yuan
4115  * Checking in hostage stuff.
4116  *
4117  * Revision 1.31  1994/03/17  18:07:28  yuan
4118  * Removed switch code... Now we just have Walls, Triggers, and Links...
4119  *
4120  * Revision 1.30  1994/03/15  17:03:51  yuan
4121  * Added Robot/object bitmap capability
4122  *
4123  * Revision 1.29  1994/03/15  16:32:58  yuan
4124  * Cleaned up bm-loading code.
4125  * (Fixed structures too)
4126  *
4127  * Revision 1.28  1994/03/04  17:09:13  yuan
4128  * New door stuff.
4129  *
4130  * Revision 1.27  1994/01/31  14:50:09  yuan
4131  * Added Robotex
4132  *
4133  * Revision 1.26  1994/01/31  12:27:14  yuan
4134  * Added demo stuff (menu, etc.)
4135  *
4136  * Revision 1.25  1994/01/25  17:11:43  john
4137  * New texmaped lasers.
4138  *
4139  * Revision 1.24  1994/01/24  11:48:06  yuan
4140  * Lighting stuff
4141  *
4142  * Revision 1.23  1994/01/22  13:40:15  yuan
4143  * Modified the bmd_bitmap structure a bit.
4144  * (Saves some memory, and added reflection)
4145  *
4146  * Revision 1.22  1994/01/11  10:58:38  yuan
4147  * Added effects system
4148  *
4149  * Revision 1.21  1994/01/06  17:13:12  john
4150  * Added Video clip functionality
4151  *
4152  * Revision 1.20  1993/12/21  20:00:15  john
4153  * moved selector stuff to grs_bitmap
4154  *
4155  * Revision 1.19  1993/12/21  19:33:58  john
4156  * Added selector to bmd_bitmap.
4157  *
4158  * Revision 1.18  1993/12/07  12:28:48  john
4159  * moved bmd_palette to gr_palette
4160  *
4161  * Revision 1.17  1993/12/06  18:40:37  matt
4162  * Changed object loading & handling
4163  *
4164  * Revision 1.16  1993/12/05  23:05:03  matt
4165  * Added include of gr.h
4166  *
4167  * Revision 1.15  1993/12/03  17:38:04  yuan
4168  * Ooops. meant to say:
4169  * Moved MAX variables to bm.c, Arrays left open.
4170  *
4171  * Revision 1.14  1993/12/03  17:37:26  yuan
4172  * Added Asserts.
4173  *
4174  * Revision 1.13  1993/12/02  17:22:54  yuan
4175  * New global var. Num_object_types
4176  *
4177  * Revision 1.12  1993/12/02  16:34:39  yuan
4178  * Added fireball hack stuff.
4179  *
4180  * Revision 1.11  1993/12/02  15:45:14  yuan
4181  * Added a buncha constants, variables, and function prototypes
4182  * for the new bitmaps.tbl format.
4183  *
4184  * Revision 1.10  1993/12/01  11:25:11  yuan
4185  * Changed MALLOC'd buffers for filename and type in
4186  * the bmd_bitmap structure into arrays... Saves time
4187  * at load up.
4188  *
4189  * Revision 1.9  1993/12/01  00:28:09  yuan
4190  * New bitmap system structure.
4191  *
4192  * Revision 1.8  1993/11/03  11:34:08  john
4193  * made it use bitmaps.tbl
4194  *
4195  * Revision 1.7  1993/10/26  18:11:03  john
4196  * made all palette data be statically allocated
4197  *
4198  * Revision 1.6  1993/10/19  12:17:51  john
4199  * *** empty log message ***
4200  *
4201  * Revision 1.5  1993/10/16  20:02:41  matt
4202  * Changed name of backdrop bitmap file
4203  *
4204  * Revision 1.4  1993/10/12  15:08:52  matt
4205  * Added a bunch of new textures
4206  *
4207  * Revision 1.3  1993/10/12  12:30:41  john
4208  * *** empty log message ***
4209  *
4210  * Revision 1.2  1993/10/12  11:27:58  john
4211  * added more bitmaps
4212  *
4213  * Revision 1.1  1993/09/23  13:09:10  john
4214  * Initial revision
4215
4216 ------------------------------------------------------------------------
4217 main/bmread.c:
4218
4219  * Revision 2.4  1995/03/28  18:05:29  john
4220  * Fixed it so you don't have to delete pig after changing bitmaps.tbl
4221  *
4222  * Revision 2.3  1995/03/07  16:52:03  john
4223  * Fixed robots not moving without edtiro bug.
4224  *
4225  * Revision 2.2  1995/03/06  16:10:20  mike
4226  * Fix compile errors if building without editor.
4227  *
4228  * Revision 2.1  1995/03/02  14:55:40  john
4229  * Fixed bug with EDITOR never defined.
4230  *
4231  * Revision 2.0  1995/02/27  11:33:10  john
4232  * New version 2.0, which has no anonymous unions, builds with
4233  * Watcom 10.0, and doesn't require parsing BITMAPS.TBL.
4234  *
4235  * Revision 1.1  1995/02/25  14:02:36  john
4236  * Initial revision
4237
4238 ------------------------------------------------------------------------
4239 main/ctrlcen.c:
4240
4241  * Revision 1.2  1995/10/17  13:12:13  allender
4242  * added param to ai call
4243  *
4244  * Revision 1.1  1995/05/16  15:23:27  allender
4245  * Initial revision
4246  *
4247  * Revision 2.1  1995/03/21  14:40:25  john
4248  * Ifdef'd out the NETWORK code.
4249  *
4250  * Revision 2.0  1995/02/27  11:31:25  john
4251  * New version 2.0, which has no anonymous unions, builds with
4252  * Watcom 10.0, and doesn't require parsing BITMAPS.TBL.
4253  *
4254  * Revision 1.22  1995/02/11  01:56:14  mike
4255  * robots don't fire cheat.
4256  *
4257  * Revision 1.21  1995/02/05  13:39:39  mike
4258  * fix stupid bug in control center firing timing.
4259  *
4260  * Revision 1.20  1995/02/03  17:41:21  mike
4261  * fix control cen next fire time in multiplayer.
4262  *
4263  * Revision 1.19  1995/01/29  13:46:41  mike
4264  * adapt to new create_small_fireball_on_object prototype.
4265  *
4266  * Revision 1.18  1995/01/18  16:12:13  mike
4267  * Make control center aware of a cloaked playerr when he fires.
4268  *
4269  * Revision 1.17  1995/01/12  12:53:44  rob
4270  * Trying to fix a bug with having cntrlcen in robotarchy games.
4271  *
4272  * Revision 1.16  1994/12/11  12:37:22  mike
4273  * make control center smarter about firing at cloaked player, don't fire through self, though
4274  * it still looks that way due to prioritization problems.
4275  *
4276  * Revision 1.15  1994/12/01  11:34:33  mike
4277  * fix control center shield strength in multiplayer team games.
4278  *
4279  * Revision 1.14  1994/11/30  15:44:29  mike
4280  * make cntrlcen harder at higher levels.
4281  *
4282  * Revision 1.13  1994/11/29  22:26:23  yuan
4283  * Fixed boss bug.
4284  *
4285  * Revision 1.12  1994/11/27  23:12:31  matt
4286  * Made changes for new mprintf calling convention
4287  *
4288  * Revision 1.11  1994/11/23  17:29:38  mike
4289  * deal with peculiarities going between net and regular game on boss level.
4290  *
4291  * Revision 1.10  1994/11/18  18:27:15  rob
4292  * Fixed some bugs with the last version.
4293  *
4294  * Revision 1.9  1994/11/18  17:13:59  mike
4295  * special case handling for level 8.
4296  *
4297  * Revision 1.8  1994/11/15  12:45:28  mike
4298  * don't let cntrlcen know where a cloaked player is.
4299  *
4300  * Revision 1.7  1994/11/08  12:18:37  mike
4301  * small explosions on control center.
4302  *
4303  * Revision 1.6  1994/11/02  17:59:18  rob
4304  * Changed control centers so they can find people in network games.
4305  * Side effect of this is that control centers can find cloaked players.
4306  * (see in-code comments for explanation).
4307  * Also added network hooks so control center shots 'sync up'.
4308  *
4309  * Revision 1.5  1994/10/22  14:13:21  mike
4310  * Make control center stop firing shortly after player dies.
4311  * Fix bug: If play from editor and die, tries to initialize non-control center object.
4312  *
4313  * Revision 1.4  1994/10/20  15:17:30  mike
4314  * Hack for control center inside boss robot.
4315  *
4316  * Revision 1.3  1994/10/20  09:47:46  mike
4317  * lots stuff.
4318  *
4319  * Revision 1.2  1994/10/17  21:35:09  matt
4320  * Added support for new Control Center/Main Reactor
4321  *
4322  * Revision 1.1  1994/10/17  20:24:01  matt
4323  * Initial revision
4324
4325 ------------------------------------------------------------------------
4326 main/ctrlcen.h:
4327
4328  * Revision 2.0  1995/02/27  11:30:40  john
4329  * New version 2.0, which has no anonymous unions, builds with
4330  * Watcom 10.0, and doesn't require parsing BITMAPS.TBL.
4331  *
4332  * Revision 1.7  1995/02/01  16:34:14  john
4333  * Linted.
4334  *
4335  * Revision 1.6  1995/01/03  20:19:14  john
4336  * Pretty good working version of game save.
4337  *
4338  * Revision 1.5  1994/11/08  12:18:28  mike
4339  * small explosions on control center.
4340  *
4341  * Revision 1.4  1994/11/02  18:00:12  rob
4342  * Added extern for Gun_pos array for network hooks.
4343  *
4344  * Revision 1.3  1994/10/20  09:47:37  mike
4345  * *** empty log message ***
4346  *
4347  * Revision 1.2  1994/10/17  21:35:10  matt
4348  * Added support for new Control Center/Main Reactor
4349  *
4350  * Revision 1.1  1994/10/17  20:24:28  matt
4351  * Initial revision
4352
4353 ------------------------------------------------------------------------
4354 main/collide.c:
4355
4356  * Revision 1.3  1995/11/08  17:15:21  allender
4357  * make collide_player_and_weapon play player_hit_sound if
4358  * shareware and not my playernum
4359  *
4360  * Revision 1.2  1995/10/31  10:24:37  allender
4361  * shareware stuff
4362  *
4363  * Revision 1.1  1995/05/16  15:23:34  allender
4364  * Initial revision
4365  *
4366  * Revision 2.5  1995/07/26  12:07:46  john
4367  * Made code that pages in weapon_info->robot_hit_vclip not
4368  * page in unless it is a badass weapon.  Took out old functionallity
4369  * of using this if no robot exp1_vclip, since all robots have these.
4370  *
4371  * Revision 2.4  1995/03/30  16:36:09  mike
4372  * text localization.
4373  *
4374  * Revision 2.3  1995/03/24  15:11:13  john
4375  * Added ugly robot cheat.
4376  *
4377  * Revision 2.2  1995/03/21  14:41:04  john
4378  * Ifdef'd out the NETWORK code.
4379  *
4380  * Revision 2.1  1995/03/20  18:16:02  john
4381  * Added code to not store the normals in the segment structure.
4382  *
4383  * Revision 2.0  1995/02/27  11:32:20  john
4384  * New version 2.0, which has no anonymous unions, builds with
4385  * Watcom 10.0, and doesn't require parsing BITMAPS.TBL.
4386  *
4387  * Revision 1.289  1995/02/22  13:56:06  allender
4388  * remove anonymous unions from object structure
4389  *
4390  * Revision 1.288  1995/02/11  15:52:45  rob
4391  * Included text.h.
4392  *
4393  * Revision 1.287  1995/02/11  15:04:11  rob
4394  * Localized a string.
4395  *
4396  * Revision 1.286  1995/02/11  14:25:41  rob
4397  * Added invul. controlcen option.
4398  *
4399  * Revision 1.285  1995/02/06  15:53:00  mike
4400  * create awareness event for player:wall collision.
4401  *
4402  * Revision 1.284  1995/02/05  23:18:17  matt
4403  * Deal with objects (such as fusion blobs) that get created already
4404  * poking through a wall
4405  *
4406  * Revision 1.283  1995/02/01  17:51:33  mike
4407  * fusion bolt can now toast multiple proximity bombs.
4408  *
4409  * Revision 1.282  1995/02/01  17:29:20  john
4410  * Lintized
4411  *
4412  * Revision 1.281  1995/02/01  15:04:00  rob
4413  * Changed sound of weapons hitting invulnerable players.
4414  *
4415  * Revision 1.280  1995/01/31  16:16:35  mike
4416  * Separate smart blobs for robot and player.
4417  *
4418  * Revision 1.279  1995/01/29  15:57:10  rob
4419  * Fixed another bug with robot_request_change calls.
4420  *
4421  * Revision 1.278  1995/01/28  18:15:06  rob
4422  * Fixed a bug in multi_request_robot_change.
4423  *
4424  * Revision 1.277  1995/01/27  15:15:44  rob
4425  * Fixing problems with controlcen damage.
4426  *
4427  * Revision 1.276  1995/01/27  15:13:10  mike
4428  * comment out mprintf.
4429  *
4430  * Revision 1.275  1995/01/26  22:11:51  mike
4431  * Purple chromo-blaster (ie, fusion cannon) spruce up (chromification)
4432  *
4433  * Revision 1.274  1995/01/26  18:57:55  rob
4434  * Changed two uses of digi_play_sample to digi_link_sound_to_pos which
4435  * made more sense.
4436  *
4437  * Revision 1.273  1995/01/25  23:37:58  mike
4438  * make persistent objects not hit player more than once.
4439  * Also, make them hit player before degrading them, else they often did 0 damage.
4440  *
4441  * Revision 1.272  1995/01/25  18:23:54  rob
4442  * Don't let players pick up powerups in exit tunnel.
4443  *
4444  * Revision 1.271  1995/01/25  13:43:18  rob
4445  * Added robot transfer for player collisions.
4446  * Removed mprintf from collide.c on Mike's request.
4447  *
4448  * Revision 1.270  1995/01/25  10:24:01  mike
4449  * Make sizzle and rock happen in lava even if you're invulnerable.
4450  *
4451  * Revision 1.269  1995/01/22  17:05:33  mike
4452  * Call multi_robot_request_change when a robot gets whacked by a player or
4453  * player weapon, if player_num != Player_num
4454  *
4455  * Revision 1.268  1995/01/21  21:20:28  matt
4456  * Fixed stupid bug
4457  *
4458  * Revision 1.267  1995/01/21  18:47:47  rob
4459  * Fixed a really dumb bug with player keys.
4460  *
4461  * Revision 1.266  1995/01/21  17:39:30  matt
4462  * Cleaned up laser/player hit wall confusions
4463  *
4464  * Revision 1.265  1995/01/19  17:44:42  mike
4465  * damage_force removed, that information coming from strength field.
4466  *
4467  * Revision 1.264  1995/01/18  17:12:56  rob
4468  * Fixed control stuff for multiplayer.
4469  *
4470  * Revision 1.263  1995/01/18  16:12:33  mike
4471  * Make control center aware of a cloaked playerr when he fires.
4472  *
4473  * Revision 1.262  1995/01/17  17:48:42  rob
4474  * Added key syncing for coop players.
4475  *
4476  * Revision 1.261  1995/01/16  19:30:28  rob
4477  * Fixed an assert error in fireball.c
4478  *
4479  * Revision 1.260  1995/01/16  19:23:51  mike
4480  * Say Boss_been_hit if he been hit so he gates appropriately.
4481  *
4482  * Revision 1.259  1995/01/16  11:55:16  mike
4483  * make enemies become aware of player if he damages control center.
4484  *
4485  * Revision 1.258  1995/01/15  16:42:00  rob
4486  * Fixed problem with robot bumping damage.
4487  *
4488  * Revision 1.257  1995/01/14  19:16:36  john
4489  * First version of new bitmap paging code.
4490  *
4491  * Revision 1.256  1995/01/03  17:58:37  rob
4492  * Fixed scoring problems.
4493  *
4494  * Revision 1.255  1994/12/29  12:41:11  rob
4495  * Tweaking robot exploding in coop.
4496  *
4497  * Revision 1.254  1994/12/28  10:37:59  rob
4498  * Fixed ifdef of multibot stuff.
4499  *
4500  * Revision 1.253  1994/12/21  19:03:14  rob
4501  * Fixing score accounting for multiplayer robots
4502  *
4503  * Revision 1.252  1994/12/21  17:36:31  rob
4504  * Fix hostage pickup problem in network.
4505  * tweaking robot powerup drops.
4506  *
4507  * Revision 1.251  1994/12/19  20:32:34  rob
4508  * Remove awareness events from player collisions and lasers that are not the console player.
4509  *
4510  * Revision 1.250  1994/12/19  20:01:22  rob
4511  * Added multibot.h include.
4512  *
4513  * Revision 1.249  1994/12/19  16:36:41  rob
4514  * Patches damaging of multiplayer robots.
4515  *
4516  * Revision 1.248  1994/12/14  21:15:18  rob
4517  * play lava hiss across network.
4518  *
4519  * Revision 1.247  1994/12/14  17:09:09  matt
4520  * Fixed problem with no sound when lasers hit closed walls, like grates.
4521  *
4522  * Revision 1.246  1994/12/14  09:51:49  mike
4523  * make any weapon cause proximity bomb detonation.
4524  *
4525  * Revision 1.245  1994/12/13  12:55:25  mike
4526  * change number of proximity bomb powerups which get dropped.
4527  *
4528  * Revision 1.244  1994/12/12  17:17:53  mike
4529  * make boss cloak/teleport when get hit, make quad laser 3/4 as powerful.
4530  *
4531  * Revision 1.243  1994/12/12  12:07:51  rob
4532  * Don't take damage if we're in endlevel sequence.
4533  *
4534  * Revision 1.242  1994/12/11  23:44:52  mike
4535  * less phys_apply_rot() at higher skill levels.
4536  *
4537  * Revision 1.241  1994/12/11  12:37:02  mike
4538  * remove stupid robot spinning code.  it was really stupid.  (actually, call here, code in ai.c).
4539  *
4540  * Revision 1.240  1994/12/10  16:44:51  matt
4541  * Added debugging code to track down door that turns into rock
4542  *
4543  * Revision 1.239  1994/12/09  14:59:19  matt
4544  * Added system to attach a fireball to another object for rendering purposes,
4545  * so the fireball always renders on top of (after) the object.
4546  *
4547  * Revision 1.238  1994/12/09  09:57:02  mike
4548  * Don't allow robots or their weapons to pass through control center.
4549  *
4550  * Revision 1.237  1994/12/08  15:46:03  mike
4551  * better robot behavior.
4552  *
4553  * Revision 1.236  1994/12/08  12:32:56  mike
4554  * make boss dying more interesting.
4555  *
4556  * Revision 1.235  1994/12/07  22:49:15  mike
4557  * tweak rotation due to collision.
4558  *
4559  * Revision 1.234  1994/12/07  16:44:50  mike
4560  * make bump sound if supposed to, even if not taking damage.
4561  *
4562  * Revision 1.233  1994/12/07  12:55:08  mike
4563  * tweak rotvel applied from collisions.
4564  *
4565  * Revision 1.232  1994/12/05  19:30:48  matt
4566  * Fixed horrible segment over-dereferencing
4567  *
4568  * Revision 1.231  1994/12/05  00:32:15  mike
4569  * do rotvel on badass and bump collisions.
4570  *
4571  * Revision 1.230  1994/12/03  12:49:22  mike
4572  * don't play bonk sound when you collide with a volatile wall (like lava).
4573  *
4574  * Revision 1.229  1994/12/02  16:51:09  mike
4575  * make lava sound only happen at 4 Hz.
4576  *
4577  * Revision 1.228  1994/11/30  23:55:27  rob
4578  * Fixed a bug where a laser hitting a wall was making 2 sounds.
4579  *
4580  * Revision 1.227  1994/11/30  20:11:00  rob
4581  * Fixed # of dropped laser powerups.
4582  *
4583  * Revision 1.226  1994/11/30  19:19:03  rob
4584  * Transmit collission sounds for net games.
4585  *
4586  * Revision 1.225  1994/11/30  16:33:01  mike
4587  * new boss behavior.
4588  *
4589  * Revision 1.224  1994/11/30  15:44:17  mike
4590  * /2 on boss smart children damage.
4591  *
4592  * Revision 1.223  1994/11/30  14:03:03  mike
4593  * hook for claw sounds
4594  *
4595  * Revision 1.222  1994/11/29  20:41:09  matt
4596  * Deleted a bunch of commented-out lines
4597  *
4598  * Revision 1.221  1994/11/27  23:15:08  matt
4599  * Made changes for new mprintf calling convention
4600  *
4601  * Revision 1.220  1994/11/19  16:11:28  rob
4602  * Collision damage with walls or lava is counted as suicides in net games
4603  *
4604  * Revision 1.219  1994/11/19  15:20:41  mike
4605  * rip out unused code and data
4606  *
4607  * Revision 1.218  1994/11/17  18:44:27  rob
4608  * Added OBJ_GHOST to list of valid player types to create eggs.
4609  *
4610  * Revision 1.217  1994/11/17  14:57:59  mike
4611  * moved segment validation functions from editor to main.
4612  *
4613  * Revision 1.216  1994/11/16  23:38:36  mike
4614  * new improved boss teleportation behavior.
4615  *
4616  * Revision 1.215  1994/11/16  12:16:29  mike
4617  * Enable collisions between robots.  A hack in fvi.c only does this for robots which lunge to attack (eg, green guy)
4618  *
4619  * Revision 1.214  1994/11/15  16:51:50  mike
4620  * bump player when he hits a volatile wall.
4621  *
4622  * Revision 1.213  1994/11/12  16:38:44  mike
4623  * allow flares to open doors.
4624  *
4625  * Revision 1.212  1994/11/10  13:09:19  matt
4626  * Added support for new run-length-encoded bitmaps
4627  *
4628  * Revision 1.211  1994/11/09  17:05:43  matt
4629  * Fixed problem with volatile walls
4630  *
4631  * Revision 1.210  1994/11/09  12:11:46  mike
4632  * only award points if ConsoleObject killed robot.
4633  *
4634  * Revision 1.209  1994/11/09  11:11:03  yuan
4635  * Made wall volatile if either tmap_num1 or tmap_num2 is a volatile wall.
4636  *
4637  * Revision 1.208  1994/11/08  12:20:15  mike
4638  * moved do_controlcen_destroyed_stuff from here to cntrlcen.c
4639  *
4640  * Revision 1.207  1994/11/02  23:22:08  mike
4641  * Make ` (backquote, KEY_LAPOSTRO) tell what wall was hit by laser.
4642  *
4643  * Revision 1.206  1994/11/02  18:03:00  rob
4644  * Fix control_center_been_hit logic so it only cares about the local player.
4645  * Other players take care of their own control center 'ai'.
4646  *
4647  * Revision 1.205  1994/11/01  19:37:33  rob
4648  * Changed the max # of consussion missiles to 4.
4649  * (cause they're lame and clutter things up)
4650  *
4651  * Revision 1.204  1994/11/01  18:06:35  john
4652  * Tweaked wall banging sound constant.
4653  *
4654  * Revision 1.203  1994/11/01  18:01:40  john
4655  * Made wall bang less obnoxious, but volume based.
4656  *
4657  * Revision 1.202  1994/11/01  17:11:05  rob
4658  * Changed some stuff in drop_player_eggs.
4659  *
4660  * Revision 1.201  1994/11/01  12:18:23  john
4661  * Added sound volume support. Made wall collisions be louder/softer.
4662  *
4663  * Revision 1.200  1994/10/31  13:48:44  rob
4664  * Fixed bug in opening doors over network/modem.  Added a new message
4665  * type to multi.c that communicates door openings across the net.
4666  * Changed includes in multi.c and wall.c to accomplish this.
4667  *
4668  * Revision 1.199  1994/10/28  14:42:52  john
4669  * Added sound volumes to all sound calls.
4670  *
4671  * Revision 1.198  1994/10/27  16:58:37  allender
4672  * added demo recording of monitors blowing up
4673  *
4674  * Revision 1.197  1994/10/26  23:20:52  matt
4675  * Tone down flash even more
4676  *
4677  * Revision 1.196  1994/10/26  23:01:50  matt
4678  * Toned down red flash when damaged
4679  *
4680  * Revision 1.195  1994/10/26  15:56:29  yuan
4681  * Tweaked some palette flashes.
4682  *
4683  * Revision 1.194  1994/10/25  11:32:26  matt
4684  * Fixed bugs with vulcan powerups in mutliplayer
4685  *
4686  * Revision 1.193  1994/10/25  10:51:18  matt
4687  * Vulcan cannon powerups now contain ammo count
4688  *
4689  * Revision 1.192  1994/10/24  14:14:05  matt
4690  * Fixed bug in bump_two_objects()
4691  *
4692  * Revision 1.191  1994/10/23  19:17:04  matt
4693  * Fixed bug with "no key" messages
4694  *
4695  * Revision 1.190  1994/10/22  00:08:46  matt
4696  * Fixed up problems with bonus & game sequencing
4697  * Player doesn't get credit for hostages unless he gets them out alive
4698  *
4699  * Revision 1.189  1994/10/21  20:42:34  mike
4700  * Clear number of hostages on board between levels.
4701  *
4702  * Revision 1.188  1994/10/20  15:17:43  mike
4703  * control center in boss handling.
4704  *
4705  * Revision 1.187  1994/10/20  10:09:47  mike
4706  * Only ever drop 1 shield powerup in multiplayer (as an egg).
4707  *
4708  * Revision 1.186  1994/10/20  09:47:11  mike
4709  * Fix bug in dropping vulcan ammo in multiplayer.
4710  * Also control center stuff.
4711  *
4712  * Revision 1.185  1994/10/19  15:14:32  john
4713  * Took % hits out of player structure, made %kills work properly.
4714  *
4715  * Revision 1.184  1994/10/19  11:33:16  john
4716  * Fixed hostage rescued percent.
4717  *
4718  * Revision 1.183  1994/10/19  11:16:49  mike
4719  * Don't allow crazy josh to open locked doors.
4720  * Don't allow weapons to harm parent.
4721  *
4722  * Revision 1.182  1994/10/18  18:37:01  mike
4723  * No more hostage killing.  Too much stuff to do to integrate into game.
4724  *
4725  * Revision 1.181  1994/10/18  16:37:35  mike
4726  * Debug function for Yuan: Show seg:side when hit by puny laser if Show_seg_and_side != 0.
4727  *
4728  * Revision 1.180  1994/10/18  10:53:17  mike
4729  * Support attack type as a property of a robot, not of being == GREEN_GUY.
4730  *
4731  * Revision 1.179  1994/10/17  21:18:36  mike
4732  * diminish damage player does to robot due to collision, only took 2-3 hits to kill a josh.
4733  *
4734  * Revision 1.178  1994/10/17  20:30:40  john
4735  * Made player_hostages_rescued or whatever count properly.
4736  *
4737  * Revision 1.177  1994/10/16  12:42:56  mike
4738  * Trap bogus amount of vulcan ammo dropping.
4739  *
4740  * Revision 1.176  1994/10/15  19:06:51  mike
4741  * Drop vulcan ammo if player has it, but no vulcan cannon (when he dies).
4742  *
4743  * Revision 1.175  1994/10/13  15:42:06  mike
4744  * Remove afterburner.
4745  *
4746  * Revision 1.174  1994/10/13  11:12:57  mike
4747  * Apply damage to robots.  I hosed it a couple weeks ago when I made the green guy special.
4748
4749 ------------------------------------------------------------------------
4750 main/collide.h:
4751
4752  * Revision 1.1  1995/05/16  15:55:09  allender
4753  * Initial revision
4754  *
4755  * Revision 2.0  1995/02/27  11:28:59  john
4756  * New version 2.0, which has no anonymous unions, builds with
4757  * Watcom 10.0, and doesn't require parsing BITMAPS.TBL.
4758  *
4759  * Revision 1.23  1995/01/26  22:11:47  mike
4760  * Purple chromo-blaster (ie, fusion cannon) spruce up (chromification)
4761  *
4762  * Revision 1.22  1994/12/21  19:03:24  rob
4763  * Fixing score accounting for multiplayer robots
4764  *
4765  * Revision 1.21  1994/12/21  11:34:56  mike
4766  * make control center take badass damage.
4767  *
4768  * Revision 1.20  1994/10/29  16:53:16  allender
4769  * added check_effect_blowup for demo recording to record monitor explosions
4770  *
4771  * Revision 1.19  1994/10/09  13:46:48  mike
4772  * Make public collide_player_and_powerup.
4773  *
4774  * Revision 1.18  1994/10/05  14:54:29  rob
4775  * Added serial game support in control center sequence..
4776  *
4777  * Revision 1.17  1994/09/15  16:32:12  mike
4778  * Prototype collide_player_and_nasty_robot.
4779  *
4780  * Revision 1.16  1994/09/11  15:49:04  mike
4781  * Prototype for maybe_detonate_weapon.
4782  *
4783  * Revision 1.15  1994/09/09  14:20:07  matt
4784  * Added prototype for scrape function
4785  *
4786  * Revision 1.14  1994/09/02  14:00:44  matt
4787  * Simplified explode_object() & mutliple-stage explosions
4788  *
4789  * Revision 1.13  1994/08/18  10:47:35  john
4790  * Cleaned up game sequencing and player death stuff
4791  * in preparation for making the player explode into
4792  * pieces when dead.
4793  *
4794  * Revision 1.12  1994/08/17  16:50:08  john
4795  * Added damaging fireballs, missiles.
4796  *
4797  * Revision 1.11  1994/08/03  16:45:31  mike
4798  * Prototype a function.
4799  *
4800  * Revision 1.10  1994/08/03  15:17:41  mike
4801  * make matcen whack on you if it's ready to make a robot.
4802  *
4803  * Revision 1.9  1994/07/22  12:08:03  mike
4804  * Make robot hit vclip and sound weapon-based until robot dies, then robot-based.
4805  *
4806  * Revision 1.8  1994/07/09  17:36:31  mike
4807  * Prototype apply_damage_to_robot.
4808  *
4809  * Revision 1.7  1994/07/09  13:20:36  mike
4810  * Prototype apply_damage_to_player.
4811  *
4812  * Revision 1.6  1994/06/20  23:35:52  john
4813  * Bunch of stuff.
4814  *
4815  * Revision 1.5  1994/06/17  18:04:03  yuan
4816  * Added Immaterialization...
4817  * Fixed Invulnerability to allow being hit.
4818  *
4819  * Revision 1.4  1994/05/13  20:28:02  john
4820  * Version II of John's new object code.
4821  *
4822  * Revision 1.3  1994/05/13  12:20:35  john
4823  * Fixed some potential problems with code using global variables
4824  * that are set in fvi.
4825  *
4826  * Revision 1.2  1994/05/12  23:20:32  john
4827  * Moved all object collision handling into collide.c.
4828  *
4829  * Revision 1.1  1994/05/12  20:39:09  john
4830  * Initial revision
4831
4832 ------------------------------------------------------------------------
4833 main/compbit.h:
4834
4835  * Revision 1.1  1995/05/16  15:55:16  allender
4836  * Initial revision
4837  *
4838  * Revision 2.0  1995/02/27  11:28:46  john
4839  * New version 2.0, which has no anonymous unions, builds with
4840  * Watcom 10.0, and doesn't require parsing BITMAPS.TBL.
4841  *
4842  * Revision 1.3  1994/12/05  15:10:28  allender
4843  * changed extern prototype definition
4844  *
4845  * Revision 1.2  1994/10/19  15:43:33  allender
4846  * header file which contains the xor value which is used when encrypting
4847  * bitmaps.tbl
4848  *
4849  * Revision 1.1  1994/10/19  13:22:19  allender
4850  * Initial revision
4851
4852 ------------------------------------------------------------------------
4853 main/config.c:
4854
4855  * Revision 1.8  1995/10/27  10:52:20  allender
4856  * call digi_set_master_volume when prefs are read in to
4857  * set the master volume of the mac
4858  *
4859  * Revision 1.7  1995/10/24  17:08:39  allender
4860  * Config_master_volume added for saving sound manager volume
4861  * across games
4862  *
4863  * Revision 1.6  1995/10/20  00:49:31  allender
4864  * use default values when no prefs file
4865  *
4866  * Revision 1.5  1995/09/21  10:06:58  allender
4867  * set digi and midi volume appropriately
4868  *
4869  * Revision 1.4  1995/09/13  08:49:38  allender
4870  * prefs file stuff
4871  *
4872  * Revision 1.3  1995/09/05  08:47:37  allender
4873  * prefs file working
4874  *
4875  * Revision 1.2  1995/05/26  06:54:14  allender
4876  * removed midi and digi references from config file
4877  *
4878  * Revision 1.1  1995/05/16  15:23:45  allender
4879  * Initial revision
4880  *
4881  * Revision 2.2  1995/03/27  09:42:59  john
4882  * Added VR Settings in config file.
4883  *
4884  * Revision 2.1  1995/03/16  11:20:40  john
4885  * Put in support for Crystal Lake soundcard.
4886  *
4887  * Revision 2.0  1995/02/27  11:30:13  john
4888  * New version 2.0, which has no anonymous unions, builds with
4889  * Watcom 10.0, and doesn't require parsing BITMAPS.TBL.
4890  *
4891  * Revision 1.14  1995/02/11  16:19:36  john
4892  * Added code to make the default mission be the one last played.
4893  *
4894  * Revision 1.13  1995/01/18  13:23:24  matt
4895  * Made curtom detail level vars initialize properly at load
4896  *
4897  * Revision 1.12  1995/01/04  22:15:36  matt
4898  * Fixed stupid bug using scanf() to read bytes
4899  *
4900  * Revision 1.11  1995/01/04  13:14:21  matt
4901  * Made custom detail level settings save in config file
4902  *
4903  * Revision 1.10  1994/12/12  21:35:09  john
4904  * *** empty log message ***
4905  *
4906  * Revision 1.9  1994/12/12  21:31:51  john
4907  * Made volume work better by making sure volumes are valid
4908  * and set correctly at program startup.
4909  *
4910  * Revision 1.8  1994/12/12  13:58:01  john
4911  * MAde -nomusic work.
4912  * Fixed GUS hang at exit by deinitializing digi before midi.
4913  *
4914  * Revision 1.7  1994/12/08  10:01:33  john
4915  * Changed the way the player callsign stuff works.
4916  *
4917  * Revision 1.6  1994/12/01  11:24:07  john
4918  * Made volume/gamma/joystick sliders all be the same length.  0-->8.
4919  *
4920  * Revision 1.5  1994/11/29  02:01:07  john
4921  * Added code to look at -volume command line arg.
4922  *
4923  * Revision 1.4  1994/11/14  20:14:11  john
4924  * Fixed some warnings.
4925  *
4926  * Revision 1.3  1994/11/14  19:51:01  john
4927  * Added joystick cal values to descent.cfg.
4928  *
4929  * Revision 1.2  1994/11/14  17:53:09  allender
4930  * read and write descent.cfg file
4931  *
4932  * Revision 1.1  1994/11/14  16:28:08  allender
4933  * Initial revision
4934
4935 ------------------------------------------------------------------------
4936 main/config.h:
4937
4938  * Revision 1.3  1995/09/08  17:12:26  allender
4939  * added modem tool stuff for prefs file
4940  *
4941  * Revision 1.2  1995/09/05  08:47:48  allender
4942  * prefs file working
4943  *
4944  * Revision 1.1  1995/05/16  15:55:23  allender
4945  * Initial revision
4946  *
4947  * Revision 2.0  1995/02/27  11:32:48  john
4948  * New version 2.0, which has no anonymous unions, builds with
4949  * Watcom 10.0, and doesn't require parsing BITMAPS.TBL.
4950  *
4951  * Revision 1.4  1995/02/11  16:20:06  john
4952  * Added code to make the default mission be the one last played.
4953  *
4954  * Revision 1.3  1994/12/08  10:01:41  john
4955  * Changed the way the player callsign stuff works.
4956  *
4957  * Revision 1.2  1994/11/14  17:53:17  allender
4958  * extern definitions for ReadConfigFile and WriteConfigFile
4959  *
4960  * Revision 1.1  1994/11/14  16:56:17  allender
4961  * Initial revision
4962
4963 ------------------------------------------------------------------------
4964 main/controls.c:
4965
4966  * Revision 1.3  1995/11/20  17:17:27  allender
4967  * call fix_fastsincos with tmp variable to prevent
4968  * writing to NULL
4969  *
4970  * Revision 1.2  1995/08/11  16:00:04  allender
4971  * fixed bug we think we never saw (overflow on max_rotthrust
4972  *
4973  * Revision 1.1  1995/05/16  15:23:53  allender
4974  * Initial revision
4975  *
4976  * Revision 2.0  1995/02/27  11:27:11  john
4977  * New version 2.0, which has no anonymous unions, builds with
4978  * Watcom 10.0, and doesn't require parsing BITMAPS.TBL.
4979  *
4980  * Revision 1.50  1995/02/22  14:11:19  allender
4981  * remove anonymous unions from object structure
4982  *
4983  * Revision 1.49  1994/12/15  13:04:10  mike
4984  * Replace Players[Player_num].time_total references with GameTime.
4985  *
4986  * Revision 1.48  1994/11/27  23:12:13  matt
4987  * Made changes for new mprintf calling convention
4988  *
4989  * Revision 1.47  1994/11/25  22:15:54  matt
4990  * Added asserts to try to trap frametime < 0 bug
4991  *
4992  * Revision 1.46  1994/11/16  11:25:40  matt
4993  * Took out int3's since I determined that the errors are caused by neg frametime
4994  *
4995  * Revision 1.45  1994/11/15  13:07:23  matt
4996  * Added int3's to try to trap bug
4997  *
4998  * Revision 1.44  1994/10/14  16:18:12  john
4999  * Made Assert that the object was player just nicely exit
5000  * the function.
5001  *
5002  * Revision 1.43  1994/10/13  11:35:25  john
5003  * Made Thrustmaster FCS Hat work.  Put a background behind the
5004  * keyboard configure.  Took out turn_sensitivity.  Changed sound/config
5005  * menu to new menu. Made F6 be calibrate joystick.
5006  *
5007  * Revision 1.42  1994/09/29  11:22:02  mike
5008  * Zero thrust when player dies.
5009  *
5010  * Revision 1.41  1994/09/16  13:10:30  mike
5011  * Hook in afterburner stuff.
5012  *
5013  * Revision 1.40  1994/09/14  22:21:54  matt
5014  * Avoid post-death assert
5015  *
5016  * Revision 1.39  1994/09/11  20:30:27  matt
5017  * Cleaned up thrust vars, changing a few names
5018  *
5019  * Revision 1.38  1994/09/10  15:46:31  john
5020  * First version of new keyboard configuration.
5021  *
5022  * Revision 1.37  1994/09/07  15:58:12  mike
5023  * Check for player dead in controls so you can't fire or move after dead, logical, huh?
5024  *
5025  * Revision 1.36  1994/09/06  14:51:56  john
5026  * Added sensitivity adjustment, fixed bug with joystick button not
5027  * staying down.
5028  *
5029  * Revision 1.35  1994/09/01  15:43:26  john
5030  * Put pitch bak like it was.
5031  *
5032  * Revision 1.34  1994/08/31  18:59:35  john
5033  * Made rotthrust back like it was.
5034  *
5035  * Revision 1.33  1994/08/31  18:49:17  john
5036  * Slowed Maxrothrust a bit,
5037  * ..
5038  *
5039  * Revision 1.32  1994/08/31  18:32:05  john
5040  * Lower max rotational thrust
5041  *
5042  * Revision 1.31  1994/08/29  21:18:27  john
5043  * First version of new keyboard/oystick remapping stuff.
5044  *
5045  * Revision 1.30  1994/08/29  16:18:30  mike
5046  * trap divide overflow.
5047  *
5048  * Revision 1.29  1994/08/26  14:40:45  john
5049  * *** empty log message ***
5050  *
5051  * Revision 1.28  1994/08/26  12:23:50  john
5052  * MAde joystick read up to 15 times per second max.
5053  *
5054  * Revision 1.27  1994/08/26  10:50:59  john
5055  * Took out Controls_always_stopped.
5056  *
5057  * Revision 1.26  1994/08/26  10:47:27  john
5058  * *** empty log message ***
5059  *
5060  * Revision 1.25  1994/08/26  10:46:50  john
5061  * New version of controls.
5062  *
5063  * Revision 1.24  1994/08/25  19:41:44  john
5064  * *** empty log message ***
5065  *
5066  * Revision 1.23  1994/08/25  18:44:55  john
5067  * *** empty log message ***
5068  *
5069  * Revision 1.22  1994/08/25  18:43:46  john
5070  * First revision of new control code.
5071  *
5072  * Revision 1.21  1994/08/24  20:02:46  john
5073  * Added cyberman support; made keys work key_down_time
5074  * returning seconds instead of milliseconds,.
5075  *
5076  *
5077  * Revision 1.20  1994/08/24  19:00:27  john
5078  * Changed key_down_time to return fixed seconds instead of
5079  * milliseconds.
5080  *
5081  * Revision 1.19  1994/08/19  15:22:12  mike
5082  * Fix divide overflow in sliding.
5083  *
5084  * Revision 1.18  1994/08/19  14:42:50  john
5085  * Added joystick sensitivity.
5086  *
5087  * Revision 1.17  1994/08/17  16:50:01  john
5088  * Added damaging fireballs, missiles.
5089  *
5090  * Revision 1.16  1994/08/12  22:41:54  john
5091  * Took away Player_stats; added Players array.
5092  *
5093  * Revision 1.15  1994/08/09  16:03:56  john
5094  * Added network players to editor.
5095  *
5096  * Revision 1.14  1994/07/28  12:33:31  matt
5097  * Made sliding use thrust, rather than changing velocity directly
5098  *
5099  * Revision 1.13  1994/07/27  20:53:21  matt
5100  * Added rotational drag & thrust, so turning now has momemtum like moving
5101  *
5102  * Revision 1.12  1994/07/25  10:24:06  john
5103  * Victor stuff.
5104  *
5105  * Revision 1.11  1994/07/22  17:53:16  john
5106  * Added better victormax support
5107  *
5108  * Revision 1.10  1994/07/21  21:31:29  john
5109  * First cheapo version of VictorMaxx tracking.
5110  *
5111  * Revision 1.9  1994/07/15  15:16:18  john
5112  * Fixed some joystick stuff.
5113  *
5114  * Revision 1.8  1994/07/15  09:32:09  john
5115  * Changes player movement.
5116  *
5117  * Revision 1.7  1994/07/13  00:14:58  matt
5118  * Moved all (or nearly all) of the values that affect player movement to
5119  * bitmaps.tbl
5120  *
5121  * Revision 1.6  1994/07/12  12:40:14  matt
5122  * Revamped physics system
5123  *
5124  * Revision 1.5  1994/07/02  13:50:39  matt
5125  * Cleaned up includes
5126  *
5127  * Revision 1.4  1994/07/01  10:55:25  john
5128  * Added analog joystick throttle
5129  *
5130  * Revision 1.3  1994/06/30  20:04:28  john
5131  * Added -joydef support.
5132  *
5133  * Revision 1.2  1994/06/30  19:01:58  matt
5134  * Moved flying controls code from physics.c to controls.c
5135  *
5136  * Revision 1.1  1994/06/30  18:41:25  matt
5137  * Initial revision
5138
5139 ------------------------------------------------------------------------
5140 main/controls.h:
5141
5142  * Revision 1.1  1995/05/16  15:55:31  allender
5143  * Initial revision
5144  *
5145  * Revision 2.0  1995/02/27  11:27:17  john
5146  * New version 2.0, which has no anonymous unions, builds with
5147  * Watcom 10.0, and doesn't require parsing BITMAPS.TBL.
5148  *
5149  * Revision 1.4  1994/07/21  18:15:33  matt
5150  * Ripped out a bunch of unused stuff
5151  *
5152  * Revision 1.3  1994/07/15  09:32:08  john
5153  * Changes player movement.
5154  *
5155  * Revision 1.2  1994/06/30  19:02:22  matt
5156  * Moved flying controls code from physics.c to controls.c
5157  *
5158  * Revision 1.1  1994/06/30  18:41:36  matt
5159  * Initial revision
5160
5161 ------------------------------------------------------------------------
5162 main/credits.c:
5163
5164  * Revision 1.8  1995/11/07  13:54:56  allender
5165  * loop shareware song since it is too short
5166  *
5167  * Revision 1.7  1995/10/31  10:24:25  allender
5168  * shareware stuff
5169  *
5170  * Revision 1.6  1995/10/27  15:17:57  allender
5171  * minor fix to get them to look right at top and bottom
5172  * of screens
5173  *
5174  * Revision 1.5  1995/10/21  22:50:49  allender
5175  * credits is way cool!!!!
5176  *
5177  * Revision 1.3  1995/08/08  13:45:26  allender
5178  * added macsys header file
5179  *
5180  * Revision 1.2  1995/07/17  08:49:48  allender
5181  * make work in 640x480 -- still needs major work!!
5182  *
5183  * Revision 1.1  1995/05/16  15:24:01  allender
5184  * Initial revision
5185  *
5186  * Revision 2.2  1995/06/14  17:26:08  john
5187  * Fixed bug with VFX palette not getting loaded for credits, titles.
5188  *
5189  * Revision 2.1  1995/03/06  15:23:30  john
5190  * New screen techniques.
5191  *
5192  * Revision 2.0  1995/02/27  11:29:25  john
5193  * New version 2.0, which has no anonymous unions, builds with
5194  * Watcom 10.0, and doesn't require parsing BITMAPS.TBL.
5195  *
5196  * Revision 1.33  1995/02/11  12:41:56  john
5197  * Added new song method, with FM bank switching..
5198  *
5199  * Revision 1.32  1995/02/03  14:18:06  john
5200  * Added columns.
5201  *
5202  * Revision 1.31  1994/12/28  10:43:00  john
5203  * More VFX tweaking.
5204  *
5205  * Revision 1.30  1994/12/20  18:22:31  john
5206  * Added code to support non-looping songs, and put
5207  * it in for endlevel and credits.
5208  *
5209  * Revision 1.29  1994/12/15  14:23:00  adam
5210  * fixed timing.
5211  *
5212  * Revision 1.28  1994/12/14  16:56:33  adam
5213  * *** empty log message ***
5214  *
5215  * Revision 1.27  1994/12/14  12:18:11  adam
5216  * messed w/timing
5217  *
5218  * Revision 1.26  1994/12/12  22:52:59  matt
5219  * Fixed little bug
5220  *
5221  * Revision 1.25  1994/12/12  22:49:35  adam
5222  * *** empty log message ***
5223  *
5224  * Revision 1.24  1994/12/09  23:16:50  john
5225  * Make credits.txb load.
5226  *
5227  * Revision 1.23  1994/12/09  00:41:54  mike
5228  * fix hang in automap print screen.
5229  *
5230  * Revision 1.22  1994/12/09  00:34:22  matt
5231  * Added support for half-height lines
5232  *
5233  * Revision 1.21  1994/12/08  18:36:03  yuan
5234  * More HOGfile support.
5235  *
5236  * Revision 1.20  1994/12/04  14:48:17  john
5237  * Made credits restore playing descent.hmp.
5238  *
5239  * Revision 1.19  1994/12/04  14:30:20  john
5240  * Added hooks for music..
5241  *
5242  * Revision 1.18  1994/12/04  12:06:46  matt
5243  * Put in support for large font
5244  *
5245  * Revision 1.17  1994/12/01  10:47:27  john
5246  * Took out code that allows keypresses to change scroll rate.
5247  *
5248  * Revision 1.16  1994/11/30  12:10:52  adam
5249  * added support for PCX titles/brief screens
5250  *
5251  * Revision 1.15  1994/11/27  23:12:17  matt
5252  * Made changes for new mprintf calling convention
5253  *
5254  * Revision 1.14  1994/11/27  19:51:46  matt
5255  * Made screen shots work in a few more places
5256  *
5257  * Revision 1.13  1994/11/18  16:41:51  adam
5258  * trimmed some more meat for shareware
5259  *
5260  * Revision 1.12  1994/11/10  20:38:29  john
5261  * Made credits not loop.
5262  *
5263  * Revision 1.11  1994/11/05  15:04:06  john
5264  * Added non-popup menu for the main menu, so that scores and credits don't have to save
5265  * the background.
5266  *
5267  * Revision 1.10  1994/11/05  14:05:52  john
5268  * Fixed fade transitions between all screens by making gr_palette_fade_in and out keep
5269  * track of whether the palette is faded in or not.  Then, wherever the code needs to fade out,
5270  * it just calls gr_palette_fade_out and it will fade out if it isn't already.  The same with fade_in.
5271  * This eliminates the need for all the flags like Menu_fade_out, game_fade_in palette, etc.
5272  *
5273  * Revision 1.9  1994/11/04  12:02:32  john
5274  * Fixed fading transitions a bit more.
5275  *
5276  * Revision 1.8  1994/11/04  11:30:44  john
5277  * Fixed fade transitions between game/menu/credits.
5278  *
5279  * Revision 1.7  1994/11/04  11:06:32  john
5280  * Added code to support credit fade table.
5281  *
5282  * Revision 1.6  1994/11/04  10:16:13  john
5283  * Made the credits fade in/out smoothly on top of a bitmap background.
5284  *
5285  * Revision 1.5  1994/11/03  21:24:12  john
5286  * Made credits exit the instant a key is pressed.
5287  * Made it scroll a bit slower.
5288  *
5289  * Revision 1.4  1994/11/03  21:20:28  john
5290  * Working.
5291  *
5292  * Revision 1.3  1994/11/03  21:01:24  john
5293  * First version of credits that works.
5294  *
5295  * Revision 1.2  1994/11/03  20:17:39  john
5296  * Added initial code for showing credits.
5297  *
5298  * Revision 1.1  1994/11/03  20:09:05  john
5299  * Initial revision
5300
5301 ------------------------------------------------------------------------
5302 main/credits.h:
5303
5304  * Revision 1.1  1995/05/16  15:55:39  allender
5305  * Initial revision
5306  *
5307  * Revision 2.0  1995/02/27  11:32:30  john
5308  * New version 2.0, which has no anonymous unions, builds with
5309  * Watcom 10.0, and doesn't require parsing BITMAPS.TBL.
5310  *
5311  * Revision 1.2  1994/11/03  20:17:40  john
5312  * Added initial code for showing credits.
5313  *
5314  * Revision 1.1  1994/11/03  20:09:19  john
5315  * Initial revision
5316
5317 ------------------------------------------------------------------------
5318 main/desc_id.h:
5319
5320  * Revision 1.1  1995/05/16  15:55:53  allender
5321  * Initial revision
5322  *
5323  * Revision 2.0  1995/02/27  11:29:38  john
5324  * New version 2.0, which has no anonymous unions, builds with
5325  * Watcom 10.0, and doesn't require parsing BITMAPS.TBL.
5326  *
5327  * Revision 1.3  1994/10/19  09:52:57  allender
5328  * Added variable for bogus error number return when game exits
5329  *
5330  * Revision 1.2  1994/10/18  16:43:52  allender
5331  * Added constants for id and time stamping
5332  *
5333  * Revision 1.1  1994/10/17  09:56:47  allender
5334  * Initial revision
5335  * Header for checksum stuff - No idea what for.
5336
5337 ------------------------------------------------------------------------
5338 main/digi.h:
5339
5340  * Revision 2.0  1995/02/27  11:28:40  john
5341  * New version 2.0, which has no anonymous unions, builds with
5342  * Watcom 10.0, and doesn't require parsing BITMAPS.TBL.
5343  *
5344  * Revision 1.29  1995/02/11  12:42:00  john
5345  * Added new song method, with FM bank switching..
5346  *
5347  * Revision 1.28  1995/02/03  17:08:26  john
5348  * Changed sound stuff to allow low memory usage.
5349  * Also, changed so that Sounds isn't an array of digi_sounds, it
5350  * is a ubyte pointing into GameSounds, this way the digi.c code that
5351  * locks sounds won't accidentally unlock a sound that is already playing, but
5352  * since it's Sounds[soundno] is different, it would erroneously be unlocked.
5353  *
5354  * Revision 1.27  1995/02/01  22:20:31  john
5355  * Added digi_is_sound_playing.
5356  *
5357  * Revision 1.26  1994/12/20  18:03:51  john
5358  * Added loop midi flag.
5359  *
5360  * Revision 1.25  1994/12/13  00:46:14  john
5361  * Split digi and midi volume into 2 seperate functions.
5362  *
5363  * Revision 1.24  1994/12/10  20:34:53  john
5364  * Added digi_kill_sound_linked_to_object.
5365  *
5366  * Revision 1.23  1994/12/10  15:59:39  mike
5367  * Fixed bug.
5368  *
5369  * Revision 1.22  1994/12/10  15:44:35  john
5370  * Added max_distance passing for sound objects.
5371  *
5372  * Revision 1.21  1994/12/05  12:17:40  john
5373  * Added code that locks/unlocks digital sounds on demand.
5374  *
5375  * Revision 1.20  1994/11/28  18:34:57  john
5376  * Made the digi_max_channels cut of an old sound instead of
5377  * not playing a new sound.
5378  *
5379  * Revision 1.19  1994/11/14  17:53:56  allender
5380  * made some digi variables extern
5381  *
5382  * Revision 1.18  1994/10/28  14:42:58  john
5383  * Added sound volumes to all sound calls.
5384  *
5385  * Revision 1.17  1994/10/11  15:25:37  john
5386  * Added new function to play a sound once...
5387  *
5388  * Revision 1.16  1994/10/03  20:51:44  john
5389  * Started added pause sound function; for the network I changed to
5390  * packet structure a bit; never tested, though.
5391  *
5392  *
5393  * Revision 1.15  1994/10/03  13:09:43  john
5394  * Added Pause function, but never tested it yet.
5395  *
5396  * Revision 1.14  1994/09/30  10:09:24  john
5397  * Changed sound stuff... made it so the reseting card doesn't hang,
5398  * made volume change only if sound is installed.
5399  *
5400  * Revision 1.13  1994/09/29  21:13:43  john
5401  * Added Master volumes for digi and midi. Also took out panning,
5402  * because it doesn't work with MasterVolume stuff.
5403  *
5404  * Revision 1.12  1994/09/29  12:42:34  john
5405  * Added sidenum to keep track of sound pos. Made sound functions
5406  * not do anything if nosound. Made sounds_init delete currently
5407  * playing sounds.
5408  *
5409  * Revision 1.11  1994/09/29  12:23:42  john
5410  * Added digi_kill_sound_linked_to_segment function.
5411  *
5412  * Revision 1.10  1994/09/29  11:59:04  john
5413  * Added digi_kill_sound
5414  *
5415  * Revision 1.9  1994/09/29  10:37:38  john
5416  * Added sound objects that dynamicaly change volume,pan.
5417  *
5418  * Revision 1.8  1994/09/28  16:18:37  john
5419  * Added capability to play midi song.
5420  *
5421  * Revision 1.7  1994/06/17  18:01:41  john
5422  * A bunch of new stuff by John
5423  *
5424  * Revision 1.6  1994/06/15  19:00:58  john
5425  * Added the capability to make 3d sounds play just once for the
5426  * laser hit wall effects.
5427  *
5428  * Revision 1.5  1994/06/07  10:54:30  john
5429  * Made key S reinit the sound system.
5430  *
5431  * Revision 1.4  1994/05/09  21:11:39  john
5432  * Sound changes; pass index instead of pointer to digi routines.
5433  * Made laser sound cut off the last laser sound.
5434  *
5435  * Revision 1.3  1994/04/27  11:44:25  john
5436  * First version of sound! Yay!
5437  *
5438  * Revision 1.2  1994/04/20  21:58:50  john
5439  * First version of sound stuff... hopefully everything
5440  * is commented out because it hangs..
5441  *
5442  * Revision 1.1  1994/04/15  14:25:02  john
5443  * Initial revision
5444
5445 ------------------------------------------------------------------------
5446 main/dumpmine.c:
5447
5448  * Revision 1.1  1995/05/16  15:24:16  allender
5449  * Initial revision
5450  *
5451  * Revision 2.1  1995/04/06  12:21:50  mike
5452  * Add texture map information to txm files.
5453  *
5454  * Revision 2.0  1995/02/27  11:26:41  john
5455  * New version 2.0, which has no anonymous unions, builds with
5456  * Watcom 10.0, and doesn't require parsing BITMAPS.TBL.
5457  *
5458  * Revision 1.24  1995/01/23  15:34:43  mike
5459  * New diagnostic code, levels.all stuff.
5460  *
5461  * Revision 1.23  1994/12/20  17:56:36  yuan
5462  * Multiplayer object capability.
5463  *
5464  * Revision 1.22  1994/11/27  23:12:19  matt
5465  * Made changes for new mprintf calling convention
5466  *
5467  * Revision 1.21  1994/11/23  12:19:04  mike
5468  * move out level names, stick in gamesave.
5469  *
5470  * Revision 1.20  1994/11/21  16:54:36  mike
5471  * oops.
5472  *
5473  *
5474  * Revision 1.19  1994/11/20  22:12:55  mike
5475  * Lotsa new stuff in this fine debug file.
5476  *
5477  * Revision 1.18  1994/11/17  14:58:09  mike
5478  * moved segment validation functions from editor to main.
5479  *
5480  * Revision 1.17  1994/11/15  21:43:02  mike
5481  * texture usage system.
5482  *
5483  * Revision 1.16  1994/11/15  12:45:59  mike
5484  * debug code for dumping texture info.
5485  *
5486  * Revision 1.15  1994/11/14  20:47:50  john
5487  * Attempted to strip out all the code in the game
5488  * directory that uses any ui code.
5489  *
5490  * Revision 1.14  1994/10/14  17:33:38  mike
5491  * Fix error reporting for number of multiplayer objects in mine.
5492  *
5493  * Revision 1.13  1994/10/14  13:37:46  mike
5494  * Forgot parameter in fprintf, was getting bogus number of excess keys.
5495  *
5496  * Revision 1.12  1994/10/12  08:05:33  mike
5497  * Detect keys contained in objects for error checking (txm file).
5498  *
5499  * Revision 1.11  1994/10/10  17:02:08  mike
5500  * fix fix.
5501  *
5502  * Revision 1.10  1994/10/10  17:00:37  mike
5503  * Add checking for proper number of players.
5504  *
5505  * Revision 1.9  1994/10/03  23:37:19  mike
5506  * Adapt to clear and rational understanding of matcens as related to fuelcens as related to something that might work.
5507  *
5508  * Revision 1.8  1994/09/30  17:15:29  mike
5509  * Fix error message, was telling bogus filename.
5510  *
5511  * Revision 1.7  1994/09/30  11:50:55  mike
5512  * More diagnostics.
5513  *
5514  * Revision 1.6  1994/09/28  17:31:19  mike
5515  * More error checking.
5516  *
5517  * Revision 1.5  1994/09/28  11:14:05  mike
5518  * Better checking on bogus walls.
5519  *
5520  * Revision 1.4  1994/09/28  09:23:50  mike
5521  * Change some Error messages to Warnings.
5522  *
5523  * Revision 1.3  1994/09/27  17:08:31  mike
5524  * More mine validation stuff.
5525  *
5526  * Revision 1.2  1994/09/27  15:43:22  mike
5527  * The amazing code to tell you everything and more about our mines!
5528  *
5529  * Revision 1.1  1994/09/27  10:51:15  mike
5530  * Initial revision
5531
5532 ------------------------------------------------------------------------
5533 main/editor/medwall.h:
5534
5535  * Revision 2.0  1995/02/27  11:35:10  john
5536  * Version 2.0! No anonymous unions, Watcom 10.0, with no need
5537  * for bitmaps.tbl.
5538  * 
5539  * Revision 1.9  1994/09/28  17:31:51  mike
5540  * Prototype copy_group_walls().
5541  * 
5542  * Revision 1.8  1994/08/05  21:18:16  matt
5543  * Allow two doors to be linked together
5544  * 
5545  * Revision 1.7  1994/06/20  22:30:10  yuan
5546  * Fixed crazy runaway trigger bug that Adam found
5547  * 
5548  * Revision 1.6  1994/05/30  20:22:58  yuan
5549  * New triggers.
5550  * 
5551  * Revision 1.5  1994/05/25  18:08:37  yuan
5552  * Revamping walls and triggers interface.
5553  * Wall interface complete, but triggers are still in progress.
5554  * 
5555  * Revision 1.4  1994/05/18  18:22:04  yuan
5556  * Fixed delete segment and walls bug.
5557  * 
5558  * Revision 1.3  1994/03/17  18:08:41  yuan
5559  * New wall stuff... Cut out switches....
5560  * 
5561  * Revision 1.2  1994/03/15  16:34:10  yuan
5562  * Fixed bm loader (might have some changes in walls and switches)
5563  * 
5564  * Revision 1.1  1994/02/10  17:52:01  matt
5565  * Initial revision
5566
5567 ------------------------------------------------------------------------
5568 main/editor/seguvs.h:
5569
5570  * Revision 2.0  1995/02/27  11:34:58  john
5571  * Version 2.0! No anonymous unions, Watcom 10.0, with no need
5572  * for bitmaps.tbl.
5573  * 
5574  * Revision 1.3  1994/08/03  10:32:28  mike
5575  * Add stretch_uvs_from_curedge.
5576  * 
5577  * Revision 1.2  1994/05/14  18:00:58  matt
5578  * Got rid of externs in source (non-header) files
5579  * 
5580  * Revision 1.1  1994/05/14  17:27:26  matt
5581  * Initial revision
5582
5583 ------------------------------------------------------------------------
5584 main/effects.c:
5585
5586  * Revision 1.1  1995/05/16  15:24:25  allender
5587  * Initial revision
5588  *
5589  * Revision 2.0  1995/02/27  11:32:49  john
5590  * New version 2.0, which has no anonymous unions, builds with
5591  * Watcom 10.0, and doesn't require parsing BITMAPS.TBL.
5592  *
5593  * Revision 1.21  1995/02/13  20:35:06  john
5594  * Lintized
5595  *
5596  * Revision 1.20  1994/12/10  16:44:50  matt
5597  * Added debugging code to track down door that turns into rock
5598  *
5599  * Revision 1.19  1994/12/06  16:27:14  matt
5600  * Fixed horrible bug that was referencing segment -1
5601  *
5602  * Revision 1.18  1994/12/02  23:20:51  matt
5603  * Reset bitmaps possibly changed by crit clips
5604  *
5605  * Revision 1.17  1994/11/14  14:00:19  matt
5606  * Fixed stupid bug
5607  *
5608  * Revision 1.16  1994/11/14  12:42:43  matt
5609  * Allow holes in effects list
5610  *
5611  * Revision 1.15  1994/11/08  21:11:52  matt
5612  * Added functions to stop & start effects
5613  *
5614  * Revision 1.14  1994/10/04  18:59:08  matt
5615  * Exploding eclips now play eclip while exploding, then switch to static bm
5616  *
5617  * Revision 1.13  1994/10/04  15:17:42  matt
5618  * Took out references to unused constant
5619  *
5620  * Revision 1.12  1994/09/29  11:00:01  matt
5621  * Made eclips (wall animations) not frame-rate dependent (for now)
5622  *
5623  * Revision 1.11  1994/09/25  00:40:24  matt
5624  * Added the ability to make eclips (monitors, fans) which can be blown up
5625  *
5626  * Revision 1.10  1994/08/14  23:15:14  matt
5627  * Added animating bitmap hostages, and cleaned up vclips a bit
5628  *
5629  * Revision 1.9  1994/08/05  15:56:04  matt
5630  * Cleaned up effects system, and added alternate effects for after mine
5631  * destruction.
5632  *
5633  * Revision 1.8  1994/08/01  23:17:21  matt
5634  * Add support for animating textures on robots
5635  *
5636  * Revision 1.7  1994/05/23  15:10:46  yuan
5637  * Make Eclips read directly...
5638  * No more need for $EFFECTS list.
5639  *
5640  * Revision 1.6  1994/04/06  14:42:44  yuan
5641  * Adding new powerups.
5642  *
5643  * Revision 1.5  1994/03/15  16:31:54  yuan
5644  * Cleaned up bm-loading code.
5645  * (And structures)
5646  *
5647  * Revision 1.4  1994/03/04  17:09:09  yuan
5648  * New door stuff.
5649  *
5650  * Revision 1.3  1994/01/11  11:18:50  yuan
5651  * Fixed frame_count
5652  *
5653  * Revision 1.2  1994/01/11  10:38:55  yuan
5654  * Special effects new implementation
5655  *
5656  * Revision 1.1  1994/01/10  09:45:29  yuan
5657  * Initial revision
5658
5659 ------------------------------------------------------------------------
5660 main/effects.h:
5661
5662  * Revision 1.1  1995/05/16  15:56:08  allender
5663  * Initial revision
5664  *
5665  * Revision 2.0  1995/02/27  11:27:34  john
5666  * New version 2.0, which has no anonymous unions, builds with
5667  * Watcom 10.0, and doesn't require parsing BITMAPS.TBL.
5668  *
5669  * Revision 1.15  1994/11/08  21:12:07  matt
5670  * Added functions to stop & start effects
5671  *
5672  * Revision 1.14  1994/10/13  17:14:11  adam
5673  * MAX_EFFECTS to 60 (ugh)
5674  *
5675  * Revision 1.13  1994/10/05  10:14:34  adam
5676  * MAX_EFFECTS to 50
5677  *
5678  * Revision 1.12  1994/10/04  18:59:09  matt
5679  * Exploding eclips now play eclip while exploding, then switch to static bm
5680  *
5681  * Revision 1.11  1994/10/04  15:17:52  matt
5682  * Took out references to unused constant
5683  *
5684  * Revision 1.10  1994/09/29  14:15:00  matt
5685  * Added sounds for eclips (wall effects)
5686  *
5687  * Revision 1.9  1994/09/25  00:40:24  matt
5688  * Added the ability to make eclips (monitors, fans) which can be blown up
5689  *
5690  * Revision 1.8  1994/08/05  15:55:25  matt
5691  * Cleaned up effects system, and added alternate effects for after mine
5692  * destruction.
5693  *
5694  * Revision 1.7  1994/08/01  23:17:20  matt
5695  * Add support for animating textures on robots
5696  *
5697  * Revision 1.6  1994/05/19  18:13:18  yuan
5698  * MAX_EFFECTS increased to 30
5699  *
5700  * Revision 1.5  1994/03/15  16:32:37  yuan
5701  * Cleaned up bm-loading code.
5702  * (Fixed structures too)
5703  *
5704  * Revision 1.4  1994/03/04  17:09:07  yuan
5705  * New door stuff.
5706  *
5707  * Revision 1.3  1994/01/19  18:22:45  yuan
5708  * Changed number of effects from 10-20
5709  *
5710  * Revision 1.2  1994/01/11  10:39:07  yuan
5711  * Special effects new implementation
5712  *
5713  * Revision 1.1  1994/01/10  10:36:14  yuan
5714  * Initial revision
5715
5716 ------------------------------------------------------------------------
5717 main/endlevel.c:
5718
5719  * Revision 1.5  1995/10/31  10:24:09  allender
5720  * shareware stuff
5721  *
5722  * Revision 1.4  1995/09/14  16:33:54  allender
5723  * fixed function return values for those that didn't
5724  * have them...thanks matt!
5725  *
5726  * Revision 1.3  1995/07/28  15:36:26  allender
5727  * reverse inverse sqrt change
5728  *
5729  * Revision 1.2  1995/07/28  15:17:40  allender
5730  * inverse magnitude fixup
5731  *
5732  * Revision 1.1  1995/05/16  15:24:32  allender
5733  * Initial revision
5734  *
5735  * Revision 2.2  1995/03/21  14:40:14  john
5736  * Ifdef'd out the NETWORK code.
5737  *
5738  * Revision 2.1  1995/03/20  18:15:50  john
5739  * Added code to not store the normals in the segment structure.
5740  *
5741  * Revision 2.0  1995/02/27  11:30:42  john
5742  * New version 2.0, which has no anonymous unions, builds with
5743  * Watcom 10.0, and doesn't require parsing BITMAPS.TBL.
5744  *
5745  * Revision 1.80  1995/02/22  13:24:45  john
5746  * Removed the vecmat anonymous unions.
5747  *
5748  * Revision 1.79  1995/02/11  12:41:54  john
5749  * Added new song method, with FM bank switching..
5750  *
5751  * Revision 1.78  1995/02/08  11:37:41  mike
5752  * Check for failures in call to obj_create.
5753  *
5754  * Revision 1.77  1995/02/05  22:09:49  matt
5755  * Switch out of rear view when starting endlevel sequence
5756  *
5757  * Revision 1.76  1995/01/30  18:08:28  rob
5758  * Add palette fade out before ending level on special missions.
5759  *
5760  * Revision 1.75  1995/01/29  16:19:19  rob
5761  * Fixed endlevel for custom missions.
5762  *
5763  * Revision 1.74  1995/01/26  12:18:10  rob
5764  * Changed calling convention of network_do_frame.
5765  *
5766  * Revision 1.73  1995/01/21  16:50:03  matt
5767  * Made endlevel work with new mission stuff
5768  *
5769  * Revision 1.72  1994/12/20  18:22:51  john
5770  * Added code to support non-looping songs, and put
5771  * it in for endlevel and credits.
5772  *
5773  * Revision 1.71  1994/12/15  12:23:58  matt
5774  * Added check for failure to create camera object
5775  *
5776  * Revision 1.70  1994/12/15  03:05:28  matt
5777  * Added error checking for NULL return from object_create_explosion()
5778  *
5779  * Revision 1.69  1994/12/12  21:41:38  matt
5780  * Don't start endlevel if OF_SHOULD_BE_DEAD is set for player
5781  *
5782  * Revision 1.68  1994/12/12  15:44:54  rob
5783  * Rolled back a change to endlevel_start that caused more bugs than
5784  * it fixed.
5785  *
5786  * Revision 1.67  1994/12/12  12:08:33  rob
5787  * IF a player is dead upon entering the tunnel, make them not dead.  Not perfect solution
5788  * but avoids some last-minute weirdness we want to fix.  This should be revisited in new
5789  * versions if possible!
5790  *
5791  * Revision 1.66  1994/12/11  22:02:13  allender
5792  * made endlevel data loading work with .txb encoded format (made with
5793  * compbit -i level0?.end -o level0?.txb)
5794  *
5795  * Revision 1.65  1994/12/11  20:32:47  matt
5796  * Made camera transition happen 1/3 of the way through exit tunnel
5797  *
5798  * Revision 1.64  1994/12/08  20:56:27  john
5799  * More cfile stuff.
5800  *
5801  * Revision 1.63  1994/12/07  17:00:52  rob
5802  * Trying to fix homing tone warning when in exit tunnel.
5803  *
5804  * Revision 1.62  1994/12/06  13:24:47  matt
5805  * Made exit model come out of bitmaps.tbl
5806  *
5807  * Revision 1.61  1994/12/06  12:06:22  matt
5808  * Fixed/cleaned up satellite (planet/sun) code
5809  *
5810  * Revision 1.60  1994/12/05  13:37:12  adam
5811  * removed slew-mode
5812  *
5813  * Revision 1.59  1994/12/05  12:49:37  matt
5814  * Made satellite a rod (instead of a plane old non-rotating bitmap), and
5815  * made the size settable in the .end file
5816  *
5817  * Revision 1.58  1994/12/04  21:40:00  matt
5818  * Added explosion sounds
5819  *
5820  * Revision 1.57  1994/12/04  18:31:41  matt
5821  * Wasn't coding planet position, causing it to disappear sometimes
5822  *
5823  * Revision 1.56  1994/12/04  14:30:26  john
5824  * Added hooks for music..
5825  *
5826  * Revision 1.55  1994/12/04  13:53:52  matt
5827  * Added code to make camera off-centered during lookback
5828  *
5829  * Revision 1.54  1994/12/04  12:30:18  matt
5830  * Fixed slew for short sequence
5831  *
5832  * Revision 1.53  1994/12/03  19:28:10  matt
5833  * Added alternate model for exit model after mine destruction
5834  *
5835  * Revision 1.52  1994/12/03  00:17:23  matt
5836  * Made endlevel sequence cut off early
5837  * Made exit model and bit explosion always plot last (after all terrain)
5838  *
5839  * Revision 1.51  1994/12/01  20:15:43  yuan
5840  * Localization.
5841  *
5842  * Revision 1.50  1994/11/30  23:27:35  adam
5843  * mucked around carelessly
5844  *
5845  * Revision 1.49  1994/11/28  21:50:37  mike
5846  * optimizations.
5847  *
5848  * Revision 1.48  1994/11/28  00:12:05  allender
5849  * took out demo code that was in at one time to record endlevel sequence.
5850  * We are _not_ recording endlevel sequence
5851  *
5852  * Revision 1.47  1994/11/27  23:35:54  allender
5853  * pause demo recording when starting endlevel sequence.  on demo playback,
5854  * don't do endlevel at all.
5855  *
5856  * Revision 1.46  1994/11/27  23:13:59  matt
5857  * Made changes for new mprintf calling convention
5858  *
5859  * Revision 1.45  1994/11/26  23:17:29  matt
5860  * When camera leaves mine, bank it so it's level with the ground
5861  *
5862  * Revision 1.44  1994/11/23  16:52:13  rob
5863  * Ended netgame endlevel sequence a bit earlier.
5864  *
5865  * Revision 1.43  1994/11/22  19:20:46  rob
5866  * Modem support for secret levels.
5867  *
5868  * Revision 1.42  1994/11/22  12:11:03  rob
5869  * Fixed bug - file handle left open in load_endlevel_data.
5870  *
5871  * Revision 1.41  1994/11/21  17:29:22  matt
5872  * Cleaned up sequencing & game saving for secret levels
5873  *
5874  * Revision 1.40  1994/11/19  15:14:54  mike
5875  * remove unused code and data
5876  *
5877  * Revision 1.39  1994/11/19  12:41:32  matt
5878  * Added system to read endlevel data from file, and to make it work
5879  * with any exit tunnel.
5880  *
5881  * Revision 1.38  1994/11/17  15:02:24  mike
5882  * support new segment validation functions.
5883  *
5884  * Revision 1.37  1994/11/17  13:04:45  allender
5885  * backout out newdemo changes
5886  *
5887  * Revision 1.35  1994/11/16  14:52:33  rob
5888  * Commented out SLEW_ON on Matt's direction.
5889  * Changed something to fix demo recording.
5890  *
5891  * Revision 1.34  1994/11/16  11:49:29  matt
5892  * Added code to rotate terrain to match mine
5893  *
5894  * Revision 1.33  1994/11/14  17:54:54  allender
5895  * on exit sequence during demo recording, force player exited from mine
5896  * packet to all other network players
5897  *
5898  * Revision 1.32  1994/11/10  21:27:42  matt
5899  * Took out printf's
5900  *
5901  * Revision 1.31  1994/11/10  14:02:24  matt
5902  * Hacked in support for player ships with different textures
5903  *
5904  * Revision 1.30  1994/11/09  10:31:33  matt
5905  * Don't create explosions if can't find seg to create them in
5906  *
5907  * Revision 1.29  1994/11/05  17:22:37  john
5908  * Fixed lots of sequencing problems with newdemo stuff.
5909  *
5910  * Revision 1.28  1994/11/03  11:10:39  matt
5911  * Fixed chase angles code
5912  * Maybe other things, too.
5913  *
5914  * Revision 1.27  1994/10/30  20:09:21  matt
5915  * For endlevel: added big explosion at tunnel exit; made lights in tunnel
5916  * go out; made more explosions on walls.
5917  *
5918  * Revision 1.26  1994/10/28  16:37:50  allender
5919  * stop demo recording when endlevel sequence activated
5920  *
5921  * Revision 1.25  1994/10/27  21:15:21  matt
5922  * Added explosions in mine chasing player
5923  *
5924  * Revision 1.24  1994/10/27  01:03:57  matt
5925  * Fixed several small bugs in flythrough
5926  *
5927  * Revision 1.23  1994/10/22  01:32:30  matt
5928  * Don't start endlevel sequence if player dead
5929  *
5930  * Revision 1.22  1994/10/22  00:08:06  matt
5931  * Fixed up problems with bonus & game sequencing
5932  * Player doesn't get credit for hostages unless he gets them out alive
5933
5934 ------------------------------------------------------------------------
5935 main/endlevel.h:
5936
5937  * Revision 1.2  1995/09/14  16:36:34  allender
5938  * fixed function prototype for those functions that didn't
5939  * have them...thanks matt
5940  *
5941  * Revision 1.1  1995/05/16  15:56:16  allender
5942  * Initial revision
5943  *
5944  * Revision 2.0  1995/02/27  11:31:37  john
5945  * New version 2.0, which has no anonymous unions, builds with
5946  * Watcom 10.0, and doesn't require parsing BITMAPS.TBL.
5947  *
5948  * Revision 1.5  1994/12/06  13:24:55  matt
5949  * Made exit model come out of bitmaps.tbl
5950  *
5951  * Revision 1.4  1994/11/19  12:41:35  matt
5952  * Added system to read endlevel data from file, and to make it work
5953  * with any exit tunnel.
5954  *
5955  * Revision 1.3  1994/10/30  20:09:20  matt
5956  * For endlevel: added big explosion at tunnel exit; made lights in tunnel
5957  * go out; made more explosions on walls.
5958  *
5959  * Revision 1.2  1994/08/19  20:09:38  matt
5960  * Added end-of-level cut scene with external scene
5961  *
5962  * Revision 1.1  1994/08/15  19:18:47  matt
5963  * Initial revision
5964
5965 ------------------------------------------------------------------------
5966 main/escort.c:
5967
5968  * Revision 1.1  1995/05/06  23:32:19  mike
5969  * Initial revision
5970
5971 ------------------------------------------------------------------------
5972 main/fireball.c:
5973
5974  * Revision 1.2  1995/10/31  10:23:56  allender
5975  * shareware stuff
5976  *
5977  * Revision 1.1  1995/05/16  15:24:41  allender
5978  * Initial revision
5979  *
5980  * Revision 2.2  1995/03/21  14:39:57  john
5981  * Ifdef'd out the NETWORK code.
5982  *
5983  * Revision 2.1  1995/03/20  18:15:47  john
5984  * Added code to not store the normals in the segment structure.
5985  *
5986  * Revision 2.0  1995/02/27  11:30:34  john
5987  * New version 2.0, which has no anonymous unions, builds with
5988  * Watcom 10.0, and doesn't require parsing BITMAPS.TBL.
5989  *
5990  * Revision 1.200  1995/02/22  13:18:41  allender
5991  * remove anonymous unions from object structure
5992  *
5993  * Revision 1.199  1995/02/14  19:58:32  mike
5994  * comment out "something bad has happened" int3.
5995  *
5996  * Revision 1.198  1995/02/09  13:11:01  mike
5997  * remove an annoying mprintf and Int3().
5998  *
5999  * Revision 1.197  1995/02/08  17:10:14  mike
6000  * don't drop cloaks if one nearby.
6001  *
6002  * Revision 1.196  1995/02/08  13:27:14  rob
6003  * Give keys dropped by robots 0 velocity in coop game.
6004  *
6005  * Revision 1.195  1995/02/08  11:57:40  mike
6006  * determine whether debris object failed to create because buffer was
6007  * exhausted or because limit was hit.
6008  *
6009  * Revision 1.194  1995/02/08  11:37:58  mike
6010  * Check for failures in call to obj_create.
6011  *
6012  * Revision 1.193  1995/02/07  21:09:41  mike
6013  * only replace weapon with energy 1/2 time.
6014  *
6015  * Revision 1.192  1995/01/30  18:21:52  rob
6016  * Replace extra life powerups in multiplayer to invul when
6017  * dropped by robots.
6018  *
6019  * Revision 1.191  1995/01/28  17:40:59  mike
6020  * fix stupidity in converting quad lasers to energy.
6021  *
6022  * Revision 1.190  1995/01/27  15:05:59  rob
6023  * Trying to fix a bug with damaging robots with player badass explosions.
6024  *
6025  * Revision 1.189  1995/01/26  18:59:04  rob
6026  * Powerups were flying too far in robot-cooperative games.
6027  *
6028  * Revision 1.188  1995/01/25  10:53:35  mike
6029  * make badass damage go through grates.
6030  *
6031  * Revision 1.187  1995/01/25  09:37:23  mike
6032  * fix objects containing robots, worked for powerups, bad {} placement.
6033  *
6034  * Revision 1.186  1995/01/23  22:51:20  mike
6035  * drop energy instead of primary weapon if you already have primary weapon.
6036  *
6037  * Revision 1.185  1995/01/20  16:56:37  mike
6038  * Cut damage done by badass weapons.
6039  *
6040  * Revision 1.184  1995/01/19  17:44:57  mike
6041  * damage_force removed, that information coming from strength field.
6042  *
6043  * Revision 1.183  1995/01/16  21:06:54  mike
6044  * Move function pick_random_point_in_segment from fireball.c to gameseg.c.
6045  *
6046  * Revision 1.182  1995/01/16  19:24:04  mike
6047  * If a gated-in robot and going to drop energy powerup, don't!
6048  *
6049  * Revision 1.181  1995/01/15  20:48:03  mike
6050  * drop energy in place of quad lasers if player already has quad lasers.
6051  *
6052  * Revision 1.180  1995/01/14  19:32:19  rob
6053  * Fixed an error.
6054  *
6055  * Revision 1.179  1995/01/14  18:50:55  rob
6056  * Make robot egg creation suitable for mutliplayer situations.
6057  *
6058  * Revision 1.178  1995/01/14  14:55:07  rob
6059  * Make weapons/keys/etc never disappear in network mode.
6060
6061 ------------------------------------------------------------------------
6062 main/fireball.h:
6063
6064  * Revision 1.1  1995/05/16  15:56:23  allender
6065  * Initial revision
6066  *
6067  * Revision 2.0  1995/02/27  11:27:03  john
6068  * New version 2.0, which has no anonymous unions, builds with
6069  * Watcom 10.0, and doesn't require parsing BITMAPS.TBL.
6070  *
6071  * Revision 1.13  1995/01/17  12:14:38  john
6072  * Made walls, object explosion vclips load at level start.
6073  *
6074  * Revision 1.12  1995/01/13  15:41:52  rob
6075  * Added prototype for maybe_replace_powerup_with_energy
6076  *
6077  * Revision 1.11  1994/11/17  16:28:36  rob
6078  * Changed maybe_drop_cloak_powerup to maybe_drop_net_powerup (more
6079  * generic and useful)
6080  *
6081  * Revision 1.10  1994/10/12  08:03:42  mike
6082  * Prototype maybe_drop_cloak_powerup.
6083  *
6084  * Revision 1.9  1994/10/11  12:24:39  matt
6085  * Cleaned up/change badass explosion calls
6086  *
6087  * Revision 1.8  1994/09/07  16:00:34  mike
6088  * Add object pointer to parameter list of object_create_badass_explosion.
6089  *
6090  * Revision 1.7  1994/09/02  14:00:39  matt
6091  * Simplified explode_object() & mutliple-stage explosions
6092  *
6093  * Revision 1.6  1994/08/17  16:49:58  john
6094  * Added damaging fireballs, missiles.
6095  *
6096  * Revision 1.5  1994/07/14  22:39:19  matt
6097  * Added exploding doors
6098  *
6099  * Revision 1.4  1994/06/08  10:56:36  matt
6100  * Improved debris: now get submodel size from new POF files; debris now has
6101  * limited life; debris can now be blown up.
6102  *
6103  * Revision 1.3  1994/04/01  13:35:44  matt
6104  * Added multiple-stage explosions
6105  *
6106  * Revision 1.2  1994/02/17  11:33:32  matt
6107  * Changes in object system
6108  *
6109  * Revision 1.1  1994/02/16  22:41:15  matt
6110  * Initial revision
6111
6112 ------------------------------------------------------------------------
6113 main/fuelcen.c:
6114
6115  * Revision 1.2  1995/10/31  10:23:40  allender
6116  * shareware stuff
6117  *
6118  * Revision 1.1  1995/05/16  15:24:50  allender
6119  * Initial revision
6120  *
6121  * Revision 2.3  1995/03/21  14:38:40  john
6122  * Ifdef'd out the NETWORK code.
6123  *
6124  * Revision 2.2  1995/03/06  15:23:09  john
6125  * New screen techniques.
6126  *
6127  * Revision 2.1  1995/02/27  13:13:26  john
6128  * Removed floating point.
6129  *
6130  * Revision 2.0  1995/02/27  11:27:20  john
6131  * New version 2.0, which has no anonymous unions, builds with
6132  * Watcom 10.0, and doesn't require parsing BITMAPS.TBL.
6133  *
6134  * Revision 1.159  1995/02/22  13:48:10  allender
6135  * remove anonymous unions in object structure
6136  *
6137  * Revision 1.158  1995/02/08  11:37:48  mike
6138  * Check for failures in call to obj_create.
6139  *
6140  * Revision 1.157  1995/02/07  20:39:39  mike
6141  * fix toasters in multiplayer
6142  *
6143  *
6144  * Revision 1.156  1995/02/02  18:40:10  john
6145  * Fixed bug with full screen cockpit flashing non-white.
6146  *
6147  * Revision 1.155  1995/01/28  15:27:22  yuan
6148  * Make sure fuelcen nums are valid.
6149  *
6150  * Revision 1.154  1995/01/03  14:26:23  rob
6151  * Better ifdef for robot centers.
6152  *
6153  * Revision 1.153  1995/01/03  11:27:49  rob
6154  * Added include of fuelcen.c
6155  *
6156  * Revision 1.152  1995/01/03  09:47:22  john
6157  * Some ifdef SHAREWARE lines.
6158  *
6159  * Revision 1.151  1995/01/02  21:02:07  rob
6160  * added matcen support for coop/multirobot.
6161  *
6162  * Revision 1.150  1994/12/15  18:31:22  mike
6163  * fix confusing precedence problems.
6164  *
6165  * Revision 1.149  1994/12/15  13:04:22  mike
6166  * Replace Players[Player_num].time_total references with GameTime.
6167  *
6168  * Revision 1.148  1994/12/15  03:05:18  matt
6169  * Added error checking for NULL return from object_create_explosion()
6170  *
6171  * Revision 1.147  1994/12/13  19:49:12  rob
6172  * Made the fuelcen noise quieter.
6173  *
6174  * Revision 1.146  1994/12/13  12:03:18  john
6175  * Made the warning sirens not start until after "desccruction
6176  * secquence activated voice".
6177  *
6178  * Revision 1.145  1994/12/12  17:18:30  mike
6179  * make warning siren louder.
6180  *
6181  * Revision 1.144  1994/12/11  23:18:04  john
6182  * Added -nomusic.
6183  * Added RealFrameTime.
6184  * Put in a pause when sound initialization error.
6185  * Made controlcen countdown and framerate use RealFrameTime.
6186  *
6187  * Revision 1.143  1994/12/11  14:10:16  mike
6188  * louder sounds.
6189  *
6190  * Revision 1.142  1994/12/06  11:33:19  yuan
6191  * Fixed bug with fueling when above 100.
6192  *
6193  * Revision 1.141  1994/12/05  23:37:14  matt
6194  * Took out calls to warning() function
6195  *
6196  * Revision 1.140  1994/12/05  23:19:18  yuan
6197  * Fixed fuel center refuelers..
6198  *
6199  * Revision 1.139  1994/12/03  12:48:12  mike
6200  * diminish rocking due to control center destruction.
6201  *
6202  * Revision 1.138  1994/12/02  23:30:32  mike
6203  * fix bumpiness after toasting control center.
6204  *
6205  * Revision 1.137  1994/12/02  22:48:14  mike
6206  * rock the ship after toasting the control center!
6207  *
6208  * Revision 1.136  1994/12/02  17:12:11  rob
6209  * Fixed countdown sounds.
6210  *
6211  * Revision 1.135  1994/11/29  20:59:43  rob
6212  * Don't run out of fuel in net games (don't want to sync it between machines)
6213  *
6214  * Revision 1.134  1994/11/29  19:10:57  john
6215  * Took out debugging mprintf.
6216  *
6217  * Revision 1.133  1994/11/29  13:19:40  john
6218  * Made voice for "destruction actived in t-"
6219  * be at 12.75 secs.
6220  *
6221  * Revision 1.132  1994/11/29  12:19:46  john
6222  * MAde the "Mine desctruction will commence"
6223  * voice play at 12.5 secs.
6224  *
6225  * Revision 1.131  1994/11/29  12:12:54  adam
6226  * *** empty log message ***
6227  *
6228  * Revision 1.130  1994/11/28  21:04:26  rob
6229  * Added code to cast noise when player refuels.
6230  *
6231  * Revision 1.129  1994/11/27  23:15:04  matt
6232  * Made changes for new mprintf calling convention
6233  *
6234  * Revision 1.128  1994/11/21  16:27:51  mike
6235  * debug code for morphing.
6236  *
6237  * Revision 1.127  1994/11/21  12:33:50  matt
6238  * For control center explosions, use small fireball, not pseudo-random vclip
6239  *
6240  * Revision 1.126  1994/11/20  22:12:15  mike
6241  * Fix bug in initializing materialization centers.
6242  *
6243  * Revision 1.125  1994/11/19  15:18:22  mike
6244  * rip out unused code and data.
6245  *
6246  * Revision 1.124  1994/11/08  12:18:59  mike
6247  * Initialize Fuelcen_seconds_left.
6248  *
6249  * Revision 1.123  1994/10/30  14:12:33  mike
6250  * rip out repair center stuff
6251  *
6252  * Revision 1.122  1994/10/28  14:42:45  john
6253  * Added sound volumes to all sound calls.
6254  *
6255  * Revision 1.121  1994/10/16  12:44:02  mike
6256  * Make time to exit mine after control center destruction diff level dependent.
6257  *
6258  * Revision 1.120  1994/10/09  22:03:26  mike
6259  * Adapt to new create_n_segment_path parameters.
6260  *
6261  * Revision 1.119  1994/10/06  14:52:42  mike
6262  * Remove last of ability to damage fuel centers.
6263  *
6264  * Revision 1.118  1994/10/06  14:08:45  matt
6265  * Made morph flash effect get orientation from segment
6266  *
6267  * Revision 1.117  1994/10/05  16:09:03  mike
6268  * Put debugging code into matcen/fuelcen synchronization problem.
6269  *
6270  * Revision 1.116  1994/10/04  15:32:41  john
6271  * Took out the old PLAY_SOUND??? code and replaced it
6272  * with direct calls into digi_link_??? so that all sounds
6273  * can be made 3d.
6274  *
6275  * Revision 1.115  1994/10/03  23:37:57  mike
6276  * Clean up this mess of confusion to the point where maybe matcens actually work.
6277  *
6278  * Revision 1.114  1994/10/03  13:34:40  matt
6279  * Added new (and hopefully better) game sequencing functions
6280  *
6281  * Revision 1.113  1994/09/30  14:41:57  matt
6282  * Fixed bug as per Mike's instructions
6283  *
6284  * Revision 1.112  1994/09/30  00:37:33  mike
6285  * Balance materialization centers.
6286  *
6287  * Revision 1.111  1994/09/28  23:12:52  matt
6288  * Macroized palette flash system
6289  *
6290  * Revision 1.110  1994/09/27  15:42:31  mike
6291  * Add names of Specials.
6292  *
6293  * Revision 1.109  1994/09/27  00:02:23  mike
6294  * Yet more materialization center stuff.
6295  *
6296  * Revision 1.108  1994/09/26  11:26:23  mike
6297  * Balance materialization centers.
6298  *
6299  * Revision 1.107  1994/09/25  23:40:47  matt
6300  * Changed the object load & save code to read/write the structure fields one
6301  * at a time (rather than the whole structure at once).  This mean that the
6302  * object structure can be changed without breaking the load/save functions.
6303  * As a result of this change, the local_object data can be and has been
6304  * incorporated into the object array.  Also, timeleft is now a property
6305  * of all objects, and the object structure has been otherwise cleaned up.
6306  *
6307  * Revision 1.106  1994/09/25  15:55:58  mike
6308  * Balance materialization centers, make them emit light, make them re-triggerable after awhile.
6309  *
6310  * Revision 1.105  1994/09/24  17:42:33  mike
6311  * Making materialization centers be activated by triggers and balancing them.
6312  *
6313  * Revision 1.104  1994/09/24  14:16:06  mike
6314  * Support new network constants.
6315  *
6316  * Revision 1.103  1994/09/20  19:14:40  john
6317  * Massaged the sound system; used a better formula for determining
6318  * which l/r balance, also, put in Mike's stuff that searches for a connection
6319  * between the 2 sounds' segments, stopping for closed doors, etc.
6320  *
6321  * Revision 1.102  1994/09/17  01:40:51  matt
6322  * Added status bar/sizable window mode, and in the process revamped the
6323  * whole cockpit mode system.
6324  *
6325  * Revision 1.101  1994/08/31  20:57:25  matt
6326  * Cleaned up endlevel/death code
6327  *
6328  * Revision 1.100  1994/08/30  17:54:20  mike
6329  * Slow down rate of creation of objects by materialization centers.
6330  *
6331  * Revision 1.99  1994/08/29  11:47:01  john
6332  * Added warning if no control centers in mine.
6333
6334 ------------------------------------------------------------------------
6335 main/fuelcen.h:
6336
6337  * Revision 1.1  1995/05/16  15:56:31  allender
6338  * Initial revision
6339  *
6340  * Revision 2.0  1995/02/27  11:28:43  john
6341  * New version 2.0, which has no anonymous unions, builds with
6342  * Watcom 10.0, and doesn't require parsing BITMAPS.TBL.
6343  *
6344  * Revision 1.26  1995/01/26  12:19:16  rob
6345  * Added externs of things needed for multiplayer.
6346  *
6347  * Revision 1.25  1994/10/30  14:11:10  mike
6348  * rip out repair center stuff.
6349  *
6350  * Revision 1.24  1994/10/03  23:36:36  mike
6351  * Add segnum and fuelcen_num (renaming dest_seg and *path) in matcen_info struct.
6352  *
6353  * Revision 1.23  1994/09/30  00:37:44  mike
6354  * Change FuelCenter struct.
6355  *
6356  * Revision 1.22  1994/09/27  15:42:49  mike
6357  * Kill some obsolete matcen constants, Prototype Special_names.
6358  *
6359  * Revision 1.21  1994/09/27  00:04:30  mike
6360  * Moved FuelCenter struct here from fuelcen.c
6361  *
6362  * Revision 1.20  1994/09/25  15:55:37  mike
6363  * Prototype function disable_matcens.
6364  *
6365  * Revision 1.19  1994/09/24  17:41:34  mike
6366  * Prototype trigger_matcen.
6367  *
6368  * Revision 1.18  1994/08/03  17:52:19  matt
6369  * Tidied up repair centers a bit
6370  *
6371  * Revision 1.17  1994/08/02  12:16:01  mike
6372  * *** empty log message ***
6373  *
6374  * Revision 1.16  1994/08/01  11:04:03  yuan
6375  * New materialization centers.
6376  *
6377  * Revision 1.15  1994/07/21  19:02:15  mike
6378  * break repair centers.
6379  *
6380  * Revision 1.14  1994/07/14  11:25:22  john
6381  * Made control centers destroy better; made automap use Tab key.
6382  *
6383  * Revision 1.13  1994/07/13  10:45:33  john
6384  * Made control center object switch when dead.
6385  *
6386  * Revision 1.12  1994/07/09  17:36:44  mike
6387  * Add extern for find_connected_repair_seg.
6388  *
6389  * Revision 1.11  1994/06/15  19:00:32  john
6390  * Show timer in on top of 3d with mine destroyed...
6391  *
6392  * Revision 1.10  1994/05/31  16:49:46  john
6393  * Begin to add robot materialization centers.
6394  *
6395  * Revision 1.9  1994/05/30  20:22:03  yuan
6396  * New triggers.
6397  *
6398  * Revision 1.8  1994/05/05  16:41:14  matt
6399  * Cleaned up repair center code, and moved some from object.c to fuelcen.c
6400  *
6401  * Revision 1.7  1994/04/21  20:41:21  yuan
6402  * Added extern.
6403  *
6404  * Revision 1.6  1994/04/21  20:28:32  john
6405  * Added flag for Yuan to tell when a fuel center is destroyed.
6406  *
6407  * Revision 1.5  1994/04/14  17:00:59  john
6408  * Made repair cen's work properly; added reset_all_fuelcens.
6409  *
6410  * Revision 1.4  1994/04/12  20:28:04  john
6411  * Added control center.
6412  *
6413  * Revision 1.3  1994/04/08  15:37:10  john
6414  * Added repair centers.
6415  *
6416  * Revision 1.2  1994/04/06  19:10:38  john
6417  * NEw version.
6418  *
6419  *
6420  * Revision 1.1  1994/04/06  12:39:02  john
6421  * Initial revision
6422
6423 ------------------------------------------------------------------------
6424 main/fvi.c:
6425
6426  * Revision 1.7  1995/10/21  23:52:18  allender
6427  * #ifdef'ed out stack debug stuff
6428  *
6429  * Revision 1.6  1995/10/10  12:07:42  allender
6430  * add forgotten ;
6431  *
6432  * Revision 1.5  1995/10/10  11:47:27  allender
6433  * put in stack space check
6434  *
6435  * Revision 1.4  1995/08/23  21:34:08  allender
6436  * fix mcc compiler warning
6437  *
6438  * Revision 1.3  1995/08/14  14:35:18  allender
6439  * changed transparency to 0
6440  *
6441  * Revision 1.2  1995/07/05  16:50:51  allender
6442  * transparency/kitchen change
6443  *
6444  * Revision 1.1  1995/05/16  15:24:59  allender
6445  * Initial revision
6446  *
6447  * Revision 2.3  1995/03/24  14:49:04  john
6448  * Added cheat for player to go thru walls.
6449  *
6450  * Revision 2.2  1995/03/21  17:58:32  john
6451  * Fixed bug with normals..
6452  *
6453  *
6454  * Revision 2.1  1995/03/20  18:15:37  john
6455  * Added code to not store the normals in the segment structure.
6456  *
6457  * Revision 2.0  1995/02/27  11:27:41  john
6458  * New version 2.0, which has no anonymous unions, builds with
6459  * Watcom 10.0, and doesn't require parsing BITMAPS.TBL.
6460  *
6461  * Revision 1.49  1995/02/22  14:45:47  allender
6462  * remove anonymous unions from object structure
6463  *
6464  * Revision 1.48  1995/02/22  13:24:50  john
6465  * Removed the vecmat anonymous unions.
6466  *
6467  * Revision 1.47  1995/02/07  16:17:26  matt
6468  * Disabled all robot-robot collisions except those involving two green
6469  * guys.  Used to do collisions if either robot was green guy.
6470  *
6471  * Revision 1.46  1995/02/02  14:07:53  matt
6472  * Fixed confusion about which segment you are touching when you're
6473  * touching a wall.  This manifested itself in spurious lava burns.
6474  *
6475  * Revision 1.45  1995/02/02  13:45:53  matt
6476  * Made a bunch of lint-inspired changes
6477  *
6478  * Revision 1.44  1995/01/24  12:10:17  matt
6479  * Fudged collisions for player/player, and player weapon/other player in
6480  * coop games.
6481  *
6482  * Revision 1.43  1995/01/14  19:16:45  john
6483  * First version of new bitmap paging code.
6484  *
6485  * Revision 1.42  1994/12/15  12:22:40  matt
6486  * Small change which may or may not help
6487  *
6488  * Revision 1.41  1994/12/14  11:45:51  matt
6489  * Fixed (hopefully) little bug with invalid segnum
6490  *
6491  * Revision 1.40  1994/12/13  17:12:01  matt
6492  * Increased edge tolerance a bunch more
6493  *
6494  * Revision 1.39  1994/12/13  14:37:59  matt
6495  * Fixed another stupid little bug
6496  *
6497  * Revision 1.38  1994/12/13  13:25:44  matt
6498  * Increased tolerance massively to avoid catching on corners
6499  *
6500  * Revision 1.37  1994/12/13  12:02:20  matt
6501  * Fixed small bug
6502  *
6503  * Revision 1.36  1994/12/13  11:17:35  matt
6504  * Lots of changes to hopefully fix objects leaving the mine.  Note that
6505  * this code should be considered somewhat experimental - one problem I
6506  * know about is that you can get stuck on edges more easily than before.
6507  * There may be other problems I don't know about yet.
6508  *
6509  * Revision 1.35  1994/12/12  01:20:57  matt
6510  * Added hack in object-object collisions that treats claw guys as
6511  * if they have 3/4 of their actual radius.
6512  *
6513  * Revision 1.34  1994/12/04  22:48:39  matt
6514  * Physics & FVI now only build seglist for player objects, and they
6515  * responsilby deal with buffer full conditions
6516  *
6517  * Revision 1.33  1994/12/04  22:07:05  matt
6518  * Added better handing of buffer full condition
6519  *
6520  * Revision 1.32  1994/12/01  21:06:33  matt
6521  * Several important changes:
6522  *  (1) Checking against triangulated sides has been standardized a bit
6523  *  (2) Code has been added to de-triangulate some sides
6524  *  (3) BIG ONE: the tolerance for checking a point against a plane has
6525  *      been drastically relaxed
6526  *
6527  *
6528  * Revision 1.31  1994/11/27  23:15:03  matt
6529  * Made changes for new mprintf calling convention
6530  *
6531  * Revision 1.30  1994/11/19  15:20:30  mike
6532  * rip out unused code and data
6533  *
6534  * Revision 1.29  1994/11/16  12:18:17  mike
6535  * hack for green_guy:green_guy collision detection.
6536  *
6537  * Revision 1.28  1994/11/10  13:08:54  matt
6538  * Added support for new run-length-encoded bitmaps
6539  *
6540  * Revision 1.27  1994/10/31  12:27:51  matt
6541  * Added new function object_intersects_wall()
6542  *
6543  * Revision 1.26  1994/10/20  13:59:27  matt
6544  * Added assert
6545  *
6546  * Revision 1.25  1994/10/09  23:51:09  matt
6547  * Made find_hitpoint_uv() work with triangulated sides
6548  *
6549  * Revision 1.24  1994/09/25  00:39:29  matt
6550  * Took out mprintf's
6551  *
6552  * Revision 1.23  1994/09/25  00:37:53  matt
6553  * Made the 'find the point in the bitmap where something hit' system
6554  * publicly accessible.
6555  *
6556  * Revision 1.22  1994/09/21  16:58:22  matt
6557  * Fixed bug in trans wall check that was checking against verically
6558  * flipped bitmap (i.e., the y coord was negative when checking).
6559  *
6560  * Revision 1.21  1994/09/02  11:31:40  matt
6561  * Fixed object/object collisions, so you can't fly through robots anymore.
6562  * Cleaned up object damage system.
6563  *
6564  * Revision 1.20  1994/08/26  09:42:03  matt
6565  * Increased the size of a buffer
6566  *
6567  * Revision 1.19  1994/08/11  18:57:53  mike
6568  * Convert shorts to ints for optimization.
6569  *
6570  * Revision 1.18  1994/08/08  21:38:24  matt
6571  * Put in small optimization
6572  *
6573  * Revision 1.17  1994/08/08  12:21:52  yuan
6574  * Fixed assert
6575  *
6576  * Revision 1.16  1994/08/08  11:47:04  matt
6577  * Cleaned up fvi and physics a little
6578  *
6579  * Revision 1.15  1994/08/04  00:21:04  matt
6580  * Cleaned up fvi & physics error handling; put in code to make sure objects
6581  * are in correct segment; simplified segment finding for objects and points
6582  *
6583  * Revision 1.14  1994/08/02  19:04:26  matt
6584  * Cleaned up vertex list functions
6585  *
6586  * Revision 1.13  1994/08/02  09:56:28  matt
6587  * Put in check for bad value find_plane_line_intersection()
6588  *
6589  * Revision 1.12  1994/08/01  17:27:26  matt
6590  * Added support for triangulated walls in trans point check
6591  *
6592  * Revision 1.11  1994/08/01  13:30:40  matt
6593  * Made fvi() check holes in transparent walls, and changed fvi() calling
6594  * parms to take all input data in query structure.
6595  *
6596  * Revision 1.10  1994/07/13  21:47:17  matt
6597  * FVI() and physics now keep lists of segments passed through which the
6598  * trigger code uses.
6599  *
6600  * Revision 1.9  1994/07/09  21:21:40  matt
6601  * Fixed, hopefull, bugs in sphere-to-vector intersection code
6602  *
6603  * Revision 1.8  1994/07/08  14:26:42  matt
6604  * Non-needed powerups don't get picked up now; this required changing FVI to
6605  * take a list of ingore objects rather than just one ignore object.
6606  *
6607  * Revision 1.7  1994/07/06  20:02:37  matt
6608  * Made change to match gameseg that uses lowest point number as reference
6609  * point when checking against a plane
6610  *
6611  * Revision 1.6  1994/06/29  15:43:58  matt
6612  * When computing intersection of vector and sphere, use the radii of both
6613  * objects.
6614  *
6615  * Revision 1.5  1994/06/14  15:57:58  matt
6616  * Took out asserts, and added other hacks, pending real bug fixes
6617  *
6618  * Revision 1.4  1994/06/13  23:10:08  matt
6619  * Fixed problems with triangulated sides
6620  *
6621  * Revision 1.3  1994/06/09  12:11:14  matt
6622  * Fixed confusing use of two variables, hit_objnum & fvi_hit_object, to
6623  * keep the same information in different ways.
6624  *
6625  * Revision 1.2  1994/06/09  09:58:38  matt
6626  * Moved find_vector_intersection() from physics.c to new file fvi.c
6627  *
6628  * Revision 1.1  1994/06/09  09:25:57  matt
6629  * Initial revision
6630
6631 ------------------------------------------------------------------------
6632 main/fvi.h:
6633
6634  * Revision 1.2  1995/08/23  21:34:29  allender
6635  * fix mcc compiler warning
6636  *
6637  * Revision 1.1  1995/05/16  15:56:38  allender
6638  * Initial revision
6639  *
6640  * Revision 2.1  1995/03/20  18:15:58  john
6641  * Added code to not store the normals in the segment structure.
6642  *
6643  * Revision 2.0  1995/02/27  11:32:02  john
6644  * New version 2.0, which has no anonymous unions, builds with
6645  * Watcom 10.0, and doesn't require parsing BITMAPS.TBL.
6646  *
6647  * Revision 1.10  1995/02/02  14:07:58  matt
6648  * Fixed confusion about which segment you are touching when you're
6649  * touching a wall.  This manifested itself in spurious lava burns.
6650  *
6651  * Revision 1.9  1994/12/04  22:48:04  matt
6652  * Physics & FVI now only build seglist for player objects, and they
6653  * responsilby deal with buffer full conditions
6654  *
6655  * Revision 1.8  1994/10/31  12:28:01  matt
6656  * Added new function object_intersects_wall()
6657  *
6658  * Revision 1.7  1994/10/10  13:10:00  matt
6659  * Increased max_fvi_segs
6660  *
6661  * Revision 1.6  1994/09/25  00:38:29  matt
6662  * Made the 'find the point in the bitmap where something hit' system
6663  * publicly accessible.
6664  *
6665  * Revision 1.5  1994/08/01  13:30:35  matt
6666  * Made fvi() check holes in transparent walls, and changed fvi() calling
6667  * parms to take all input data in query structure.
6668  *
6669  * Revision 1.4  1994/07/13  21:47:59  matt
6670  * FVI() and physics now keep lists of segments passed through which the
6671  * trigger code uses.
6672  *
6673  * Revision 1.3  1994/07/08  14:27:26  matt
6674  * Non-needed powerups don't get picked up now; this required changing FVI to
6675  * take a list of ingore objects rather than just one ignore object.
6676  *
6677  * Revision 1.2  1994/06/09  09:58:39  matt
6678  * Moved find_vector_intersection() from physics.c to new file fvi.c
6679  *
6680  * Revision 1.1  1994/06/09  09:26:14  matt
6681  * Initial revision
6682
6683 ------------------------------------------------------------------------
6684 main/game.c:
6685
6686  * Revision 1.1  1995/12/05  16:01:09  allender
6687  * Initial revision
6688  *
6689  * Revision 1.38  1995/11/13  13:02:35  allender
6690  * put up HUD message when player starts tournament
6691  *
6692  * Revision 1.37  1995/11/13  09:21:05  allender
6693  * ved and shorted tournament mode messages
6694  *
6695  * Revision 1.36  1995/11/09  17:27:00  allender
6696  * took out cheats during demo playback
6697  *
6698  * Revision 1.35  1995/11/07  17:05:41  allender
6699  * move registered cheats
6700  *
6701  * Revision 1.34  1995/11/03  12:55:45  allender
6702  * shareware changes
6703  *
6704  * Revision 1.33  1995/10/29  20:15:00  allender
6705  * took out frame rate cheat.  Pause for at least a second because
6706  * of cmd-P problem
6707  *
6708  * Revision 1.32  1995/10/26  14:11:26  allender
6709  * fix up message box stuff to align correctly
6710  *
6711  * Revision 1.31  1995/10/24  18:09:41  allender
6712  * ixed cockpit weirdness -- don't update cockpit when do_appl_quit
6713  * is called -- screen saved in mevent.c
6714  *
6715  * Revision 1.30  1995/10/21  23:39:10  allender
6716  * ruise marking indicator
6717  *
6718  * Revision 1.29  1995/10/21  22:52:27  allender
6719  * bald guy cheat -- print screen stuff
6720  *
6721  * Revision 1.28  1995/10/20  00:54:28  allender
6722  * new help menus and redbook checking in outer game loop
6723  *
6724  * Revision 1.27  1995/10/17  15:34:19  allender
6725  * pixel double is now default mode
6726  *
6727  * Revision 1.26  1995/10/12  17:34:44  allender
6728  * bigger message box -- command key equivs for function keys
6729  *
6730  * Revision 1.25  1995/10/11  12:17:14  allender
6731  * removed event loop processing
6732  *
6733  * Revision 1.24  1995/10/11  00:58:47  allender
6734  * removed debugging code
6735  *
6736  * Revision 1.23  1995/10/10  11:50:32  allender
6737  * fixed boxed message to align on 8 byte boundry,
6738  * and some debug code
6739  *
6740  * Revision 1.22  1995/09/24  10:51:26  allender
6741  * cannot go to finder in network..added cmd-q for quit
6742  *
6743  * Revision 1.21  1995/09/22  15:05:18  allender
6744  * *more* hud and font type stuff (messages)
6745  *
6746  * Revision 1.20  1995/09/22  14:39:57  allender
6747  * ved framerate counter up
6748  *
6749  * Revision 1.19  1995/09/18  17:01:28  allender
6750  * start of compatibility stuff
6751  *
6752  * Revision 1.18  1995/09/15  15:53:13  allender
6753  * better handling of PICT screen shots
6754  *
6755  * Revision 1.17  1995/09/14  15:27:41  allender
6756  * fixed function type on message_box routiens
6757  *
6758  * Revision 1.16  1995/09/13  11:37:47  allender
6759  * put in call to dump PICT file instead of PCX
6760  *
6761  * Revision 1.15  1995/09/08  17:13:28  allender
6762  * put back in ibitblt.h and start of PICT picture dump
6763  *
6764  * Revision 1.14  1995/09/07  10:20:58  allender
6765  * make cockpit mode default
6766  *
6767  * Revision 1.13  1995/09/07  10:17:34  allender
6768  * added command key equivalents for function keys
6769  *
6770  * Revision 1.12  1995/09/04  11:36:47  allender
6771  * fixed pixel double mode to have correct number of rendered
6772  * lines
6773  *
6774  * Revision 1.11  1995/09/01  15:47:07  allender
6775  * cap frame rate at 60 fps
6776  *
6777  * Revision 1.10  1995/08/26  16:25:59  allender
6778  * whole buncha' stuff!!!!
6779  *
6780  * Revision 1.9  1995/08/01  16:04:47  allender
6781  * put in ctrl_esc sequence to go to menubar
6782  *
6783  * Revision 1.8  1995/07/28  14:15:11  allender
6784  * added FRAME cheat to display frame rate
6785  *
6786  * Revision 1.7  1995/07/17  08:54:19  allender
6787  * *** empty log message ***
6788  *
6789  * Revision 1.6  1995/07/12  12:54:06  allender
6790  * removed some debug keys
6791  *
6792  * Revision 1.5  1995/07/05  16:44:35  allender
6793  * changed some debug keys
6794  *
6795  * Revision 1.4  1995/06/23  10:24:57  allender
6796  * added scanline doubling routine
6797  *
6798  * Revision 1.3  1995/06/13  13:08:26  allender
6799  * added special debug key to move window into upper left corner.
6800  * also added debug key to put game in 640x480 mode
6801  *
6802  * Revision 1.2  1995/06/12  11:10:31  allender
6803  * added DEL_SHIFT_M to move window to corner of screen
6804  *
6805  * Revision 1.1  1995/05/16  15:25:08  allender
6806  * Initial revision
6807  *
6808  * Revision 2.36  1996/01/05  16:52:05  john
6809  * Improved 3d stuff.
6810  *
6811  * Revision 2.35  1995/10/09  22:17:10  john
6812  * Took out the page flipping in set_screen_mode, which shouldn't
6813  * be there.  This was hosing the modex stuff.
6814  *
6815  * Revision 2.34  1995/10/09  19:46:34  john
6816  * Fixed bug with modex paging with lcdbios.
6817  *
6818  * Revision 2.33  1995/10/08  11:46:09  john
6819  * Fixed bug with 2d offset in interlaced mode in low res.
6820  * Made LCDBIOS with pageflipping using VESA set start
6821  * Address function.  X=CRTC offset, Y=0.
6822  *
6823  * Revision 2.32  1995/10/07  13:20:51  john
6824  * Added new modes for LCDBIOS, also added support for -JoyNice,
6825  * and added Shift+F1-F4 to controls various stereoscopic params.
6826  *
6827  * Revision 2.31  1995/05/31  14:34:43  unknown
6828  * fixed warnings.
6829  *
6830  * Revision 2.30  1995/05/08  11:23:45  john
6831  * Made 3dmax work like Kasan wants it to.
6832  *
6833  * Revision 2.29  1995/04/06  13:47:39  yuan
6834  * Restored rear view to original.
6835  *
6836  * Revision 2.28  1995/04/06  12:13:07  john
6837  * Fixed some bugs with 3dmax.
6838  *
6839  * Revision 2.27  1995/04/05  13:18:18  mike
6840  * decrease energy usage on fusion cannon
6841  *
6842  * Revision 2.26  1995/03/30  16:36:32  mike
6843  * text localization.
6844  *
6845  * Revision 2.25  1995/03/27  16:45:26  john
6846  * Fixed some cheat bugs.  Added astral cheat.
6847  *
6848  * Revision 2.24  1995/03/27  15:37:11  mike
6849  * boost fusion cannon for non-multiplayer modes.
6850  *
6851  * Revision 2.23  1995/03/24  17:48:04  john
6852  * Fixed bug with menus and 320x100.
6853  *
6854  * Revision 2.22  1995/03/24  15:34:02  mike
6855  * cheats.
6856  *
6857  * Revision 2.21  1995/03/24  13:11:39  john
6858  * Added save game during briefing screens.
6859  *
6860  * Revision 2.20  1995/03/21  14:40:50  john
6861  * Ifdef'd out the NETWORK code.
6862  *
6863  * Revision 2.19  1995/03/16  22:07:16  john
6864  * Made so only for screen can be used for anything other
6865  * than mode 13.
6866  *
6867  * Revision 2.18  1995/03/16  21:45:35  john
6868  * Made all paged modes have incompatible menus!
6869  *
6870  * Revision 2.17  1995/03/16  18:30:35  john
6871  * Made wider than 320 screens not have
6872  * a status bar mode.
6873  *
6874  * Revision 2.16  1995/03/16  10:53:34  john
6875  * Move VFX center to Shift+Z instead of Enter because
6876  * it conflicted with toggling HUD on/off.
6877  *
6878  * Revision 2.15  1995/03/16  10:18:33  john
6879  * Fixed bug with VFX mode not working. also made warning
6880  * when it can't set VESA mode.
6881  *
6882  * Revision 2.14  1995/03/14  16:22:39  john
6883  * Added cdrom alternate directory stuff.
6884  *
6885  * Revision 2.13  1995/03/14  12:14:17  john
6886  * Made VR helmets have 4 resolutions to choose from.
6887  *
6888  * Revision 2.12  1995/03/10  13:47:33  john
6889  * Added head tracking sensitivity.
6890  *
6891  * Revision 2.11  1995/03/10  13:13:47  john
6892  * Added code to show T-xx on iglasses.
6893  *
6894  * Revision 2.10  1995/03/09  18:07:29  john
6895  * Fixed bug with iglasses tracking not "centering" right.
6896  * Made VFX have bright headlight lighting.
6897  *
6898  * Revision 2.9  1995/03/09  11:48:02  john
6899  * Added HUD for VR helmets.
6900  *
6901  * Revision 2.8  1995/03/07  15:12:53  john
6902  * Fixed VFX,3dmax support.
6903  *
6904  * Revision 2.7  1995/03/07  11:35:03  john
6905  * Fixed bug with cockpit in rear view.
6906  *
6907  * Revision 2.6  1995/03/06  18:40:17  john
6908  * Added some ifdef EDITOR stuff.
6909  *
6910  * Revision 2.5  1995/03/06  18:31:21  john
6911  * Fixed bug with nmenu popping up on editor screen.
6912  *
6913  * Revision 2.4  1995/03/06  17:28:33  john
6914  * Fixed but with cockpit toggling wrong.
6915  *
6916  * Revision 2.3  1995/03/06  16:08:10  mike
6917  * Fix compile errors if building without editor.
6918  *
6919  * Revision 2.2  1995/03/06  15:24:10  john
6920  * New screen techniques.
6921  *
6922  * Revision 2.1  1995/02/27  13:41:03  john
6923  * Removed floating point from frame rate calculations.
6924  *
6925  * Revision 2.0  1995/02/27  11:31:54  john
6926  * New version 2.0, which has no anonymous unions, builds with
6927  * Watcom 10.0, and doesn't require parsing BITMAPS.TBL.
6928  *
6929  * Revision 1.770  1995/02/22  12:45:15  allender
6930  * remove anonymous unions from object structure
6931  *
6932  * Revision 1.769  1995/02/15  10:06:25  allender
6933  * make pause pause game during demo playback
6934  *
6935  * Revision 1.768  1995/02/13  20:35:11  john
6936  * Lintized
6937  *
6938  * Revision 1.767  1995/02/13  19:40:29  allender
6939  * added place to demo record restoration from rear view in place that
6940  * I forgot before
6941  *
6942  * Revision 1.766  1995/02/13  10:29:27  john
6943  * Fixed bug with cheats not restoreing across save games.
6944  *
6945  * Revision 1.765  1995/02/11  22:54:33  john
6946  * Made loading for pig not show up for demos.
6947  *
6948  * Revision 1.764  1995/02/11  17:30:08  allender
6949  * ifndef NDEBUG around strip frame stuff
6950  *
6951  * Revision 1.763  1995/02/11  17:13:01  rob
6952  * Took out modem.c code fille stuff.
6953  *
6954  * Revision 1.762  1995/02/11  16:36:47  allender
6955  * debug key to strip frames from end of demo
6956  *
6957  * Revision 1.761  1995/02/11  14:29:16  john
6958  * Turned off cheats when going into game.
6959  *
6960  * Revision 1.760  1995/02/11  13:46:54  mike
6961  * fix cheats.
6962  *
6963  * Revision 1.759  1995/02/11  12:36:09  matt
6964  * Cleaned up cheats
6965  *
6966  * Revision 1.758  1995/02/11  12:27:04  mike
6967  * fix path-to-exit cheat.
6968  *
6969  * Revision 1.757  1995/02/11  01:56:24  mike
6970  * robots don't fire cheat.
6971  *
6972  * Revision 1.756  1995/02/10  16:38:40  mike
6973  * illuminate path to exit cheat.
6974  *
6975  * Revision 1.755  1995/02/10  16:19:40  mike
6976  * new show-path-to-exit system, still buggy, compiled out.
6977  *
6978  * Revision 1.754  1995/02/10  15:54:46  matt
6979  * Added new cheats
6980  *
6981  * Revision 1.753  1995/02/09  12:25:42  matt
6982  * Made mem_fill() test routines not be called if RELEASE
6983  *
6984  * Revision 1.752  1995/02/09  08:49:32  mike
6985  * change fill opcode value to 0xcc, int 3 value.
6986  *
6987  *
6988  * Revision 1.751  1995/02/09  02:59:26  mike
6989  * check code for 00066xxx bugs.
6990  *
6991  * Revision 1.750  1995/02/08  17:10:02  mike
6992  * add, but don't call, debug code.
6993  *
6994  * Revision 1.749  1995/02/07  11:07:27  john
6995  * Added hooks for confirm on game state restore.
6996  *
6997  * Revision 1.748  1995/02/06  15:52:45  mike
6998  * add mini megawow powerup for giving reasonable weapons.
6999  *
7000  * Revision 1.747  1995/02/06  12:53:35  allender
7001  * force endlevel_sequence to 0 to fix weird bug
7002  *
7003  * Revision 1.746  1995/02/04  10:03:30  mike
7004  * Fly to exit cheat.
7005  *
7006  * Revision 1.745  1995/02/02  15:57:52  john
7007  * Added turbo mode cheat.
7008  *
7009  * Revision 1.744  1995/02/02  14:43:39  john
7010  * Uppped frametime limit to 150 Hz.
7011  *
7012  * Revision 1.743  1995/02/02  13:37:16  mike
7013  * move T-?? message down in certain modes.
7014  *
7015  * Revision 1.742  1995/02/02  01:26:59  john
7016  * Took out no key repeating.
7017  *
7018  * Revision 1.741  1995/01/29  21:36:44  mike
7019  * make fusion cannon not make pitching slow.
7020  *
7021  * Revision 1.740  1995/01/28  15:57:57  john
7022  * Made joystick calibration be only when wrong detected in
7023  * menu or joystick axis changed.
7024  *
7025  * Revision 1.739  1995/01/28  15:21:03  yuan
7026  * Added X-tra life cheat.
7027  *
7028  * Revision 1.738  1995/01/27  14:08:31  rob
7029  * Fixed a bug.
7030  *
7031  * Revision 1.737  1995/01/27  14:04:59  rob
7032  * Its not my fault, Mark told me to do it!
7033  *
7034  * Revision 1.736  1995/01/27  13:12:18  rob
7035  * Added charging noises to play across net.
7036  *
7037  * Revision 1.735  1995/01/27  11:48:28  allender
7038  * check for newdemo_state to be paused and stop recording.  We might be
7039  * in between levels
7040  *
7041  * Revision 1.734  1995/01/26  22:11:41  mike
7042  * Purple chromo-blaster (ie, fusion cannon) spruce up (chromification)
7043  *
7044  * Revision 1.733  1995/01/26  17:03:04  mike
7045  * make fusion cannon have more chrome, make fusion, mega rock you!
7046  *
7047  * Revision 1.732  1995/01/25  14:37:25  john
7048  * Made joystick only prompt for calibration once...
7049  *
7050  * Revision 1.731  1995/01/24  15:49:14  john
7051  * Made typeing in long net messages wrap on
7052  * small screen sizes.
7053  *
7054  * Revision 1.730  1995/01/24  15:23:42  mike
7055  * network message tweaking.
7056  *
7057  * Revision 1.729  1995/01/24  12:00:47  john
7058  * Fixed bug with defing macro passing keys to controls.
7059  *
7060  * Revision 1.728  1995/01/24  11:53:35  john
7061  * Added better macro defining code.
7062  *
7063  * Revision 1.727  1995/01/23  22:17:15  john
7064  * Fixed bug with not clearing key buffer when leaving f8.
7065  *
7066  * Revision 1.726  1995/01/23  22:07:09  john
7067  * Added flush to game inputs during F8.
7068
7069 ------------------------------------------------------------------------
7070 main/game.h:
7071
7072  * Revision 1.3  1995/09/14  13:44:34  allender
7073  * fixed function prototypes to have void return value to satify
7074  * moto compiler
7075  *
7076  * Revision 1.2  1995/08/17  09:25:05  allender
7077  * externed Scanline_double variable
7078  *
7079  * Revision 1.1  1995/05/16  15:56:46  allender
7080  * Initial revision
7081  *
7082  * Revision 2.1  1995/03/06  15:23:22  john
7083  * New screen techniques.
7084  *
7085  * Revision 2.0  1995/02/27  11:28:21  john
7086  * New version 2.0, which has no anonymous unions, builds with
7087  * Watcom 10.0, and doesn't require parsing BITMAPS.TBL.
7088  *
7089  * Revision 1.79  1995/02/13  10:37:17  john
7090  * Saved Buggin' cheat mode to save file.
7091  *
7092  * Revision 1.78  1995/02/01  16:34:12  john
7093  * Linted.
7094  *
7095  * Revision 1.77  1995/01/29  21:37:14  mike
7096  * initialize variables on game load so you don't drain your energy when you fire.
7097  *
7098  * Revision 1.76  1995/01/26  22:11:36  mike
7099  * Purple chromo-blaster (ie, fusion cannon) spruce up (chromification)
7100  *
7101  * Revision 1.75  1995/01/26  16:45:31  mike
7102  * Add autofire fusion cannon stuff.
7103  *
7104  * Revision 1.74  1994/12/11  23:18:06  john
7105  * Added -nomusic.
7106  * Added RealFrameTime.
7107  * Put in a pause when sound initialization error.
7108  * Made controlcen countdown and framerate use RealFrameTime.
7109  *
7110  * Revision 1.73  1994/12/09  00:41:24  mike
7111  * fix hang in automap print screen
7112  *
7113  * Revision 1.72  1994/12/04  13:47:00  mike
7114  * enhance custom detail level support.
7115  *
7116  * Revision 1.71  1994/12/02  15:05:44  matt
7117  * Added new "official" cheats
7118  *
7119  * Revision 1.70  1994/11/28  18:14:09  rob
7120  * Added game_mode flag for team games.
7121  *
7122  * Revision 1.69  1994/11/15  16:51:13  matt
7123  * Made rear view only switch to rear cockpit if cockpit on in front view
7124  *
7125  * Revision 1.68  1994/11/04  16:26:10  john
7126  * Fixed bug with letterbox mode game after you finish a game.
7127  *
7128  * Revision 1.67  1994/11/02  11:59:48  john
7129  * Moved menu out of game into inferno main loop.
7130  *
7131  * Revision 1.66  1994/10/26  23:02:19  matt
7132  * Made palette flash saturate negative values
7133  *
7134  * Revision 1.65  1994/10/26  15:21:05  mike
7135  * Detail level stuff.  Make Render_depth public.
7136  *
7137  * Revision 1.64  1994/10/19  00:13:01  matt
7138  * Added prototypes
7139  *
7140  * Revision 1.63  1994/10/09  14:54:39  matt
7141  * Made player cockpit state & window size save/restore with saved games & automap
7142  *
7143  * Revision 1.62  1994/10/08  19:56:32  matt
7144  * Added prototype
7145  *
7146  * Revision 1.61  1994/10/07  22:19:32  mike
7147  * Increase number of difficulty levels from 4 to 5.
7148  *
7149  * Revision 1.60  1994/10/06  14:14:11  matt
7150  * Added new function to reset time (to prevent big FrameTime) at start of level
7151  *
7152  * Revision 1.59  1994/10/05  17:08:43  matt
7153  * Changed order of cockpit bitmaps, since there's no longer a full-screen cockpit
7154  *
7155  * Revision 1.58  1994/10/03  23:44:13  matt
7156  * Save & restore palette effect around menus & pause message
7157  *
7158  * Revision 1.57  1994/09/29  17:42:12  matt
7159  * Cleaned up game_mode a little
7160  *
7161  * Revision 1.56  1994/09/28  23:12:01  matt
7162  * Macroized palette flash system
7163  *
7164  * Revision 1.55  1994/09/24  16:56:13  rob
7165  * Added new fields for the Game_mode bitvector for modem play.
7166  *
7167  * Revision 1.54  1994/09/24  14:16:20  mike
7168  * Added new game mode constants.
7169  *
7170  * Revision 1.53  1994/09/22  19:00:57  mike
7171  * Move NDL from robot.h to here.
7172  *
7173  * Revision 1.52  1994/09/22  10:46:51  mike
7174  * Add difficulty levels.
7175  *
7176  * Revision 1.51  1994/09/17  01:39:52  matt
7177  * Added status bar/sizable window mode, and in the process revamped the
7178  * whole cockpit mode system.
7179  *
7180  * Revision 1.50  1994/09/15  21:23:10  matt
7181  * Changed system to keep track of whether & what cockpit is up
7182  *
7183  * Revision 1.49  1994/09/15  16:11:33  john
7184  * Added support for VFX1 head tracking. Fixed bug with memory over-
7185  * write when using stereo mode.
7186  *
7187  * Revision 1.48  1994/09/13  16:40:10  mike
7188  * Prototype Global_missile_firing_count.
7189  *
7190  * Revision 1.47  1994/09/13  11:19:05  mike
7191  * Add Next_missile_fire_time.
7192  *
7193  * Revision 1.46  1994/09/12  09:52:50  john
7194  * Made global flush function that flushes keyboard,mouse, and joystick.
7195  *
7196  * Revision 1.45  1994/09/03  15:24:14  mike
7197  * Make global Global_laser_firing_count.
7198  *
7199  * Revision 1.44  1994/08/31  19:26:57  mike
7200  * Prototypes for Next_laser_fire_time, Laser_delay_time.
7201  *
7202  * Revision 1.43  1994/08/18  10:47:22  john
7203  * Cleaned up game sequencing and player death stuff
7204  * in preparation for making the player explode into
7205  * pieces when dead.
7206  *
7207  * Revision 1.42  1994/08/11  18:03:53  matt
7208  * Added prototype
7209  *
7210  * Revision 1.41  1994/06/29  20:41:38  matt
7211  * Added new pause mode; cleaned up countdown & game startup code
7212  *
7213  * Revision 1.40  1994/06/24  17:03:49  john
7214  * Added VFX support. Also took all game sequencing stuff like
7215  * EndGame out and put it into gameseq.c
7216  *
7217  * Revision 1.39  1994/06/20  15:01:08  yuan
7218  * Added death when mine blows up...
7219  * Continues onto next level.
7220  *
7221  * Revision 1.38  1994/06/17  18:07:20  matt
7222  * Moved some vars out of ifdef
7223  *
7224  * Revision 1.37  1994/06/15  11:09:22  yuan
7225  * Moved gauge_message to mono screen for now.
7226  *
7227  * Revision 1.36  1994/05/30  20:22:11  yuan
7228  * New triggers.
7229  *
7230  * Revision 1.35  1994/05/27  10:32:48  yuan
7231  * New dialog boxes (Walls and Triggers) added.
7232  *
7233  *
7234  * Revision 1.34  1994/05/20  11:56:45  matt
7235  * Cleaned up find_vector_intersection() interface
7236  * Killed check_point_in_seg(), check_player_seg(), check_object_seg()
7237  *
7238  * Revision 1.33  1994/05/19  21:45:21  matt
7239  * Removed unused prototypes
7240  *
7241  * Revision 1.32  1994/05/19  18:53:17  yuan
7242  * Changing player structure...
7243  *
7244  * Revision 1.31  1994/05/16  16:38:35  yuan
7245  * Fixed palette add so it doesn't show up in the menu.
7246  *
7247  * Revision 1.30  1994/05/16  09:28:17  matt
7248  * Renamed init_player() to be init_player_stats(), added new funtion
7249  * init_player_object()
7250  *
7251  * Revision 1.29  1994/05/14  17:14:57  matt
7252  * Got rid of externs in source (non-header) files
7253
7254 ------------------------------------------------------------------------
7255 main/gamefont.c:
7256
7257  * Revision 1.2  1995/08/18  10:23:25  allender
7258  * remove refernce to big font -- add PC small font for pixel
7259  * doubling display
7260  *
7261  * Revision 1.1  1995/05/16  15:25:22  allender
7262  * Initial revision
7263  *
7264  * Revision 2.0  1995/02/27  11:30:14  john
7265  * New version 2.0, which has no anonymous unions, builds with
7266  * Watcom 10.0, and doesn't require parsing BITMAPS.TBL.
7267  *
7268  * Revision 1.8  1994/11/18  16:41:39  adam
7269  * trimmed some meat
7270  *
7271  * Revision 1.7  1994/11/17  13:07:11  adam
7272  * removed unused font
7273  *
7274  * Revision 1.6  1994/11/03  21:36:12  john
7275  * Added code for credit fonts.
7276  *
7277  * Revision 1.5  1994/08/17  20:20:02  matt
7278  * Took out alternate-color versions of font3, since this is a mono font
7279  *
7280  * Revision 1.4  1994/08/12  12:03:44  adam
7281  * tweaked fonts.
7282  *
7283  * Revision 1.3  1994/08/11  12:43:40  adam
7284  * changed font filenames
7285  *
7286  * Revision 1.2  1994/08/10  19:57:15  john
7287  * Changed font stuff; Took out old menu; messed up lots of
7288  * other stuff like game sequencing messages, etc.
7289  *
7290  * Revision 1.1  1994/08/10  17:20:09  john
7291  * Initial revision
7292
7293 ------------------------------------------------------------------------
7294 main/gamefont.h:
7295
7296  * Revision 1.2  1995/08/18  10:23:54  allender
7297  * removed large font -- added PC small font
7298  *
7299  * Revision 1.1  1995/05/16  15:56:55  allender
7300  * Initial revision
7301  *
7302  * Revision 2.0  1995/02/27  11:31:09  john
7303  * New version 2.0, which has no anonymous unions, builds with
7304  * Watcom 10.0, and doesn't require parsing BITMAPS.TBL.
7305  *
7306  * Revision 1.7  1994/11/18  16:41:28  adam
7307  * trimmed meat
7308  *
7309  * Revision 1.6  1994/11/17  13:07:00  adam
7310  * removed unused font
7311  *
7312  * Revision 1.5  1994/11/03  21:36:02  john
7313  * Added code for credit fonts.
7314  *
7315  * Revision 1.4  1994/08/17  20:20:25  matt
7316  * Took out alternate-color versions of font3, since this is a mono font
7317  *
7318  * Revision 1.3  1994/08/11  12:44:32  adam
7319  * killed a #define
7320  *
7321  * Revision 1.2  1994/08/10  19:57:16  john
7322  * Changed font stuff; Took out old menu; messed up lots of
7323  * other stuff like game sequencing messages, etc.
7324  *
7325  * Revision 1.1  1994/08/10  17:20:22  john
7326  * Initial revision
7327
7328 ------------------------------------------------------------------------
7329 main/gamemine.c:
7330
7331  * Revision 1.2  1995/10/31  10:15:58  allender
7332  * code for shareware levels
7333  *
7334  * Revision 1.1  1995/05/16  15:25:29  allender
7335  * Initial revision
7336  *
7337  * Revision 2.2  1995/03/06  15:23:14  john
7338  * New screen techniques.
7339  *
7340  * Revision 2.1  1995/02/27  13:13:37  john
7341  * Removed floating point.
7342  *
7343  * Revision 2.0  1995/02/27  11:27:45  john
7344  * New version 2.0, which has no anonymous unions, builds with
7345  * Watcom 10.0, and doesn't require parsing BITMAPS.TBL.
7346  *
7347  * Revision 1.70  1995/02/13  20:35:09  john
7348  * Lintized
7349  *
7350  * Revision 1.69  1995/02/07  17:12:03  rob
7351  * Added ifdef's for Editor.
7352  *
7353  * Revision 1.68  1995/02/07  16:51:48  mike
7354  * fix gray rock josh problem.
7355  *
7356  * Revision 1.67  1995/02/01  15:46:26  yuan
7357  * Fixed matcen_nums.
7358  *
7359  * Revision 1.66  1995/01/19  15:19:28  mike
7360  * new super-compressed registered file format.
7361  *
7362  * Revision 1.65  1994/12/10  16:44:59  matt
7363  * Added debugging code to track down door that turns into rock
7364  *
7365  * Revision 1.64  1994/12/10  14:58:24  yuan
7366  * *** empty log message ***
7367  *
7368  * Revision 1.63  1994/12/08  17:19:10  yuan
7369  * Cfiling stuff.
7370  *
7371  * Revision 1.62  1994/12/07  14:05:33  yuan
7372  * Fixed wall assert problem... Bashed highest_segment
7373  * _index before WALL_IS_DOORWAY check.
7374  *
7375  * Revision 1.61  1994/11/27  23:14:52  matt
7376  * Made changes for new mprintf calling convention
7377  *
7378  * Revision 1.60  1994/11/27  18:05:20  matt
7379  * Compile out LVL reader when editor compiled out
7380  *
7381  * Revision 1.59  1994/11/26  22:51:45  matt
7382  * Removed editor-only fields from segment structure when editor is compiled
7383  * out, and padded segment structure to even multiple of 4 bytes.
7384  *
7385  * Revision 1.58  1994/11/26  21:48:02  matt
7386  * Fixed saturation in short light value
7387  *
7388  * Revision 1.57  1994/11/20  22:11:49  mike
7389  * comment out an apparently unnecessary call to fuelcen_reset().
7390  *
7391  * Revision 1.56  1994/11/18  21:56:42  john
7392  * Added a better, leaner pig format.
7393  *
7394  * Revision 1.55  1994/11/17  20:09:18  john
7395  * Added new compiled level format.
7396  *
7397  * Revision 1.54  1994/11/17  15:40:17  mike
7398  * Comment out mprintf which was causing important information to scroll away.
7399  *
7400  * Revision 1.53  1994/11/17  14:56:37  mike
7401  * moved segment validation functions from editor to main.
7402  *
7403  * Revision 1.52  1994/11/17  11:39:35  matt
7404  * Ripped out code to load old mines
7405  *
7406  * Revision 1.51  1994/11/14  20:47:53  john
7407  * Attempted to strip out all the code in the game
7408  * directory that uses any ui code.
7409  *
7410  * Revision 1.50  1994/11/14  16:05:38  matt
7411  * Fixed, maybe, again, errors when can't find texture during remap
7412  *
7413  * Revision 1.49  1994/11/14  14:34:03  matt
7414  * Fixed up handling when textures can't be found during remap
7415  *
7416  * Revision 1.48  1994/11/14  13:01:55  matt
7417  * Added Int3() when can't find texture
7418  *
7419  * Revision 1.47  1994/10/30  14:12:21  mike
7420  * rip out local segments stuff.
7421  *
7422  * Revision 1.46  1994/10/27  19:43:07  john
7423  * Disable the piglet option.
7424  *
7425  * Revision 1.45  1994/10/27  18:51:42  john
7426  * Added -piglet option that only loads needed textures for a
7427  * mine.  Only saved ~1MB, and code still doesn't free textures
7428  * before you load a new mine.
7429  *
7430  * Revision 1.44  1994/10/20  12:47:22  matt
7431  * Replace old save files (MIN/SAV/HOT) with new LVL files
7432  *
7433  * Revision 1.43  1994/10/19  16:46:40  matt
7434  * Made tmap overrides for robots remap texture numbers
7435  *
7436  * Revision 1.42  1994/10/03  23:37:01  mike
7437  * Adapt to changed fuelcen_activate parameters.
7438  *
7439  * Revision 1.41  1994/09/23  22:14:49  matt
7440  * Took out obsolete structure fields
7441  *
7442  * Revision 1.40  1994/08/01  11:04:11  yuan
7443  * New materialization centers.
7444  *
7445  * Revision 1.39  1994/07/21  19:01:47  mike
7446  * Call Lsegment stuff.
7447
7448 ------------------------------------------------------------------------
7449 main/gamemine.h:
7450
7451  * Revision 1.1  1995/05/16  15:57:02  allender
7452  * Initial revision
7453  *
7454  * Revision 2.0  1995/02/27  11:28:50  john
7455  * New version 2.0, which has no anonymous unions, builds with
7456  * Watcom 10.0, and doesn't require parsing BITMAPS.TBL.
7457  *
7458  * Revision 1.15  1994/11/17  11:39:34  matt
7459  * Ripped out code to load old mines
7460  *
7461  * Revision 1.14  1994/10/19  16:46:40  matt
7462  * Made tmap overrides for robots remap texture numbers
7463  *
7464  * Revision 1.13  1994/09/23  22:14:37  matt
7465  * Took out obsolete structure fields
7466  *
7467  * Revision 1.12  1994/07/22  12:36:32  matt
7468  * Cleaned up editor/game interactions some more.
7469  *
7470  * Revision 1.11  1994/06/01  11:21:37  yuan
7471  * Added controlcentertriggers to the gamesave.
7472  *
7473  * Revision 1.10  1994/05/10  12:14:26  yuan
7474  * Game save/load... Demo levels 1-5 added...
7475  * High scores fixed...
7476  *
7477  * Revision 1.9  1994/05/04  18:25:05  yuan
7478  * Working on gamesave.
7479  *
7480  * Revision 1.8  1994/05/03  15:53:27  yuan
7481  * Readded structure field groups for backward compatibility...
7482  *
7483  * Revision 1.7  1994/05/03  11:36:26  yuan
7484  * Stabilizing gamesave stuff.
7485  *
7486  * Revision 1.6  1994/04/28  11:01:32  yuan
7487  * Added objects in structure.
7488  *
7489  * Revision 1.5  1994/04/06  18:30:03  john
7490  * Added Refueling segments.
7491  *
7492  * Revision 1.4  1994/03/17  18:06:53  yuan
7493  * Removed switch code... Now we just have Walls, Triggers, and Links...
7494  *
7495  * Revision 1.3  1994/03/01  18:12:24  yuan
7496  * Wallswitches, triggers, and more!
7497  *
7498  * Revision 1.2  1994/02/10  15:36:01  matt
7499  * Various changes to make editor compile out.
7500  *
7501  * Revision 1.1  1994/02/09  17:11:45  matt
7502  * Initial revision
7503
7504 ------------------------------------------------------------------------
7505 main/gamesave.c:
7506
7507  * Revision 1.3  1996/02/21  13:59:17  allender
7508  * check Data folder when can't open a level file from a hog
7509  *
7510  * Revision 1.2  1995/10/31  10:23:23  allender
7511  * shareware stuff
7512  *
7513  * Revision 1.1  1995/05/16  15:25:37  allender
7514  * Initial revision
7515  *
7516  * Revision 2.2  1995/04/23  14:53:12  john
7517  * Made some mine structures read in with no structure packing problems.
7518  *
7519  * Revision 2.1  1995/03/20  18:15:43  john
7520  * Added code to not store the normals in the segment structure.
7521  *
7522  * Revision 2.0  1995/02/27  11:29:50  john
7523  * New version 2.0, which has no anonymous unions, builds with
7524  * Watcom 10.0, and doesn't require parsing BITMAPS.TBL.
7525  *
7526  * Revision 1.207  1995/02/23  10:17:36  allender
7527  * fixed parameter mismatch with compute_segment_center
7528  *
7529  * Revision 1.206  1995/02/22  14:51:17  allender
7530  * fixed some things that I missed
7531  *
7532  * Revision 1.205  1995/02/22  13:31:38  allender
7533  * remove anonymous unions from object structure
7534  *
7535  * Revision 1.204  1995/02/01  20:58:08  john
7536  * Made editor check hog.
7537  *
7538  * Revision 1.203  1995/01/28  17:40:34  mike
7539  * correct level names (use rdl, sdl) for dumpmine stuff.
7540  *
7541  * Revision 1.202  1995/01/25  20:03:46  matt
7542  * Moved matrix check to avoid orthogonalizing an uninitialize matrix
7543  *
7544  * Revision 1.201  1995/01/20  16:56:53  mike
7545  * remove some mprintfs.
7546  *
7547  * Revision 1.200  1995/01/15  19:42:13  matt
7548  * Ripped out hostage faces for registered version
7549  *
7550  * Revision 1.199  1995/01/05  16:59:09  yuan
7551  * Make it so if editor is loaded, don't get error from typo
7552  * in filename.
7553  *
7554  * Revision 1.198  1994/12/19  12:49:46  mike
7555  * Change fgets to cfgets.  fgets was getting a pointer mismatch warning.
7556  *
7557  * Revision 1.197  1994/12/12  01:20:03  matt
7558  * Took out object size hack for green claw guys
7559  *
7560  * Revision 1.196  1994/12/11  13:19:37  matt
7561  * Restored calls to fix_object_segs() when debugging is turned off, since
7562  * it's not a big routine, and could fix some possibly bad problems.
7563  *
7564  * Revision 1.195  1994/12/10  16:17:24  mike
7565  * fix editor bug that was converting transparent walls into rock.
7566  *
7567  * Revision 1.194  1994/12/09  14:59:27  matt
7568  * Added system to attach a fireball to another object for rendering purposes,
7569  * so the fireball always renders on top of (after) the object.
7570  *
7571  * Revision 1.193  1994/12/08  17:19:02  yuan
7572  * Cfiling stuff.
7573  *
7574  * Revision 1.192  1994/12/02  20:01:05  matt
7575  * Always give vulcan cannon powerup same amount of ammo, regardless of
7576  * how much it was saved with
7577  *
7578  * Revision 1.191  1994/11/30  17:45:57  yuan
7579  * Saving files now creates RDL/SDLs instead of CDLs.
7580  *
7581  * Revision 1.190  1994/11/30  17:22:14  matt
7582  * Ripped out hostage faces in shareware version
7583  *
7584  * Revision 1.189  1994/11/28  00:09:30  allender
7585  * commented out call to newdemo_record_start_demo in load_level...what is
7586  * this doing here anyway?????
7587  *
7588  * Revision 1.188  1994/11/27  23:13:48  matt
7589  * Made changes for new mprintf calling convention
7590  *
7591  * Revision 1.187  1994/11/27  18:06:20  matt
7592  * Cleaned up LVL/CDL file loading
7593  *
7594  * Revision 1.186  1994/11/25  22:46:29  matt
7595  * Allow ESC out of compiled/normal menu (esc=compiled).
7596  *
7597  * Revision 1.185  1994/11/23  12:18:35  mike
7598  * move level names here...a more logical place than dumpmine.
7599  *
7600  * Revision 1.184  1994/11/21  20:29:19  matt
7601  * If hostage info is bad, fix it.
7602  *
7603  * Revision 1.183  1994/11/21  20:26:07  matt
7604  * Fixed bug, I hope
7605  *
7606  * Revision 1.182  1994/11/21  20:20:37  matt
7607  * Fixed stupid mistake
7608  *
7609  * Revision 1.181  1994/11/21  20:18:40  matt
7610  * Fixed (hopefully) totally bogus writing of hostage data
7611  *
7612  * Revision 1.180  1994/11/20  14:11:56  matt
7613  * Gracefully handle two hostages having same id
7614  *
7615  * Revision 1.179  1994/11/19  23:55:05  mike
7616  * remove Assert, put in comment for Matt.
7617  *
7618  * Revision 1.178  1994/11/19  19:53:24  matt
7619  * Added code to full support different hostage head clip & message for
7620  * each hostage.
7621  *
7622  * Revision 1.177  1994/11/19  15:15:21  mike
7623  * remove unused code and data
7624  *
7625  * Revision 1.176  1994/11/19  10:28:28  matt
7626  * Took out write routines when editor compiled out
7627  *
7628  * Revision 1.175  1994/11/17  20:38:25  john
7629  * Took out warning.
7630  *
7631  * Revision 1.174  1994/11/17  20:36:34  john
7632  * Made it so that saving a mine will write the .cdl even
7633  * if .lvl gets error.
7634  *
7635  * Revision 1.173  1994/11/17  20:26:19  john
7636  * Made the game load whichever of .cdl or .lvl exists,
7637  * and if they both exist, prompt the user for which one.
7638  *
7639  * Revision 1.172  1994/11/17  20:11:20  john
7640  * Fixed warning.
7641  *
7642  * Revision 1.171  1994/11/17  20:09:26  john
7643  * Added new compiled level format.
7644  *
7645  * Revision 1.170  1994/11/17  14:57:21  mike
7646  * moved segment validation functions from editor to main.
7647  *
7648  * Revision 1.169  1994/11/17  11:39:21  matt
7649  * Ripped out code to load old mines
7650  *
7651  * Revision 1.168  1994/11/16  11:24:53  matt
7652  * Made attack-type robots have smaller radius, so they get closer to player
7653  *
7654  * Revision 1.167  1994/11/15  21:42:47  mike
7655  * better error messages.
7656  *
7657  * Revision 1.166  1994/11/15  15:30:41  matt
7658  * Save ptr to name of level being loaded
7659  *
7660  * Revision 1.165  1994/11/14  20:47:46  john
7661  * Attempted to strip out all the code in the game
7662  * directory that uses any ui code.
7663  *
7664  * Revision 1.164  1994/11/14  14:34:23  matt
7665  * Fixed up handling when textures can't be found during remap
7666  *
7667  * Revision 1.163  1994/11/10  14:02:49  matt
7668  * Hacked in support for player ships with different textures
7669  *
7670  * Revision 1.162  1994/11/06  14:38:17  mike
7671  * Remove an apparently unnecessary mprintf.
7672  *
7673  * Revision 1.161  1994/10/30  14:11:28  mike
7674  * ripout local segments stuff.
7675  *
7676  * Revision 1.160  1994/10/28  12:10:41  matt
7677  * Check that was supposed to happen only when editor was in was happening
7678  * only when editor was out.
7679  *
7680  * Revision 1.159  1994/10/27  11:25:32  matt
7681  * Only do connectivity error check when editor in
7682  *
7683  * Revision 1.158  1994/10/27  10:54:00  matt
7684  * Made connectivity error checking put up warning if errors found
7685  *
7686  * Revision 1.157  1994/10/25  10:50:54  matt
7687  * Vulcan cannon powerups now contain ammo count
7688  *
7689  * Revision 1.156  1994/10/23  02:10:43  matt
7690  * Got rid of obsolete hostage_info stuff
7691  *
7692  * Revision 1.155  1994/10/22  18:57:26  matt
7693  * Added call to check_segment_connections()
7694  *
7695  * Revision 1.154  1994/10/21  12:19:23  matt
7696  * Clear transient objects when saving (& loading) games
7697  *
7698  * Revision 1.153  1994/10/21  11:25:10  mike
7699  * Use new constant IMMORTAL_TIME.
7700  *
7701  * Revision 1.152  1994/10/20  12:46:59  matt
7702  * Replace old save files (MIN/SAV/HOT) with new LVL files
7703  *
7704  * Revision 1.151  1994/10/19  19:26:32  matt
7705  * Fixed stupid bug
7706  *
7707  * Revision 1.150  1994/10/19  16:46:21  matt
7708  * Made tmap overrides for robots remap texture numbers
7709  *
7710  * Revision 1.149  1994/10/18  08:50:27  yuan
7711  * Fixed correct variable this time.
7712  *
7713  * Revision 1.148  1994/10/18  08:45:02  yuan
7714  * Oops. forgot load function.
7715  *
7716  * Revision 1.147  1994/10/18  08:42:10  yuan
7717  * Avoid the int3.
7718  *
7719  * Revision 1.146  1994/10/17  21:34:57  matt
7720  * Added support for new Control Center/Main Reactor
7721  *
7722  * Revision 1.145  1994/10/15  19:06:34  mike
7723  * Fix bug, maybe, having to do with something or other, ...
7724  *
7725  * Revision 1.144  1994/10/12  21:07:33  matt
7726  * Killed unused field in object structure
7727  *
7728  * Revision 1.143  1994/10/06  14:52:55  mike
7729  * Put check in to detect possibly bogus walls in last segment which leaked through an earlier check
7730  * due to misuse of Highest_segment_index.
7731  *
7732  * Revision 1.142  1994/10/05  22:12:44  mike
7733  * Put in cleanup for matcen/fuelcen links.
7734  *
7735  * Revision 1.141  1994/10/03  11:30:05  matt
7736  * Make sure player in a valid segment before saving
7737  *
7738  * Revision 1.140  1994/09/28  11:14:41  mike
7739  * Better error messaging on bogus mines: Only bring up dialog box if a "real" (level??.*) level.
7740  *
7741  * Revision 1.139  1994/09/28  09:22:58  mike
7742  * Comment out a mprintf.
7743  *
7744  * Revision 1.138  1994/09/27  17:08:36  mike
7745  * Message boxes when you load bogus mines.
7746  *
7747  * Revision 1.137  1994/09/27  15:43:45  mike
7748  * Move the dump stuff to dumpmine.
7749  *
7750  * Revision 1.136  1994/09/27  00:02:31  mike
7751  * Dump text files (".txm") when loading a mine, showing all kinds of useful mine info.
7752  *
7753  * Revision 1.135  1994/09/26  11:30:41  matt
7754  * Took out code which loaded bogus player structure
7755  *
7756  * Revision 1.134  1994/09/26  11:18:44  john
7757  * Fixed some conflicts with newseg.
7758  *
7759  * Revision 1.133  1994/09/26  10:56:58  matt
7760  * Fixed inconsistancies in lifeleft for immortal objects
7761  *
7762  * Revision 1.132  1994/09/25  23:41:10  matt
7763  * Changed the object load & save code to read/write the structure fields one
7764  * at a time (rather than the whole structure at once).  This mean that the
7765  * object structure can be changed without breaking the load/save functions.
7766  * As a result of this change, the local_object data can be and has been
7767  * incorporated into the object array.  Also, timeleft is now a property
7768  * of all objects, and the object structure has been otherwise cleaned up.
7769
7770 ------------------------------------------------------------------------
7771 main/gamesave.h:
7772
7773  * Revision 1.1  1995/05/16  15:57:10  allender
7774  * Initial revision
7775  *
7776  * Revision 2.0  1995/02/27  11:30:25  john
7777  * New version 2.0, which has no anonymous unions, builds with
7778  * Watcom 10.0, and doesn't require parsing BITMAPS.TBL.
7779  *
7780  * Revision 1.11  1994/11/23  12:19:32  mike
7781  * detail level menu.
7782  *
7783  * Revision 1.10  1994/10/20  12:47:30  matt
7784  * Replace old save files (MIN/SAV/HOT) with new LVL files
7785  *
7786  * Revision 1.9  1994/09/27  17:08:47  mike
7787  * Message boxes when you load bogus mines.
7788  *
7789  * Revision 1.8  1994/09/27  15:43:05  mike
7790  * Prototype write_game_text.
7791  *
7792  * Revision 1.7  1994/09/14  15:46:39  matt
7793  * Added function load_mine_only()
7794  *
7795  * Revision 1.6  1994/07/22  12:36:28  matt
7796  * Cleaned up editor/game interactions some more.
7797  *
7798  * Revision 1.5  1994/07/20  13:38:14  matt
7799  * Added get_level_name() prototype
7800  *
7801  * Revision 1.4  1994/06/20  22:19:41  john
7802  * Added Gamesave_num_org_robots.
7803  *
7804  * Revision 1.3  1994/06/14  11:32:49  john
7805  * Made Newdemo record & restore the current mine.
7806  *
7807  * Revision 1.2  1994/05/14  17:16:25  matt
7808  * Got rid of externs in source (non-header) files
7809  *
7810  * Revision 1.1  1994/05/14  16:01:26  matt
7811  * Initial revision
7812
7813 ------------------------------------------------------------------------
7814 main/gameseg.c:
7815
7816  * Revision 1.9  1995/11/08  16:26:04  allender
7817  * minor bug fix in find_connected_distance
7818  *
7819  * Revision 1.8  1995/10/12  17:36:55  allender
7820  * made trace_segs only recurse 100 times max
7821  *
7822  * Revision 1.7  1995/10/11  18:29:01  allender
7823  * removed Int3 from trace_segs
7824  *
7825  * Revision 1.6  1995/10/11  14:13:54  allender
7826  * put in stack check code into trace-segs
7827  *
7828  * Revision 1.5  1995/09/23  09:40:25  allender
7829  * put in casts in extract_shortpos to try and solve shortpos problem
7830  * with appletalk
7831  *
7832  * Revision 1.4  1995/09/20  14:26:50  allender
7833  * added flag to swap bytes on extract shortpot
7834  *
7835  * Revision 1.3  1995/08/12  12:01:27  allender
7836  * added flag to create_shortpos to swap bytes
7837  *
7838  * Revision 1.2  1995/06/06  10:42:07  allender
7839  * made shortpos routines swap bytes when extracting and making shortpos structures
7840  *
7841  * Revision 1.1  1995/05/16  15:25:46  allender
7842  * Initial revision
7843  *
7844  * Revision 2.2  1995/03/20  18:15:39  john
7845  * Added code to not store the normals in the segment structure.
7846  *
7847  * Revision 2.1  1995/03/08  12:11:39  allender
7848  * fix shortpos reading/writing
7849  *
7850  * Revision 2.0  1995/02/27  11:29:21  john
7851  * New version 2.0, which has no anonymous unions, builds with
7852  * Watcom 10.0, and doesn't require parsing BITMAPS.TBL.
7853  *
7854  * Revision 1.78  1995/02/22  13:52:22  allender
7855  * remove anonymous unions from object structure
7856  *
7857  * Revision 1.77  1995/02/22  13:24:47  john
7858  * Removed the vecmat anonymous unions.
7859  *
7860  * Revision 1.76  1995/02/13  20:35:01  john
7861  * Lintized
7862  *
7863  * Revision 1.75  1995/02/09  13:10:51  mike
7864  * remove an annoying mprintf.
7865  *
7866  * Revision 1.74  1995/02/05  17:49:28  rob
7867  * Added assert to gameseg.c.
7868  *
7869  * Revision 1.73  1995/02/02  00:49:26  mike
7870  * new automap segment-depth functionality.
7871  *
7872  * Revision 1.72  1995/01/16  21:06:51  mike
7873  * Move function pick_random_point_in_segment from fireball.c to gameseg.c.
7874  *
7875  * Revision 1.71  1994/12/21  19:54:32  matt
7876  * Added error checking
7877  *
7878  * Revision 1.70  1994/12/11  21:34:09  matt
7879  * Changed assert() to int3()
7880  *
7881  * Revision 1.69  1994/12/01  21:04:37  matt
7882  * Several important changes:
7883  *  (1) Checking against triangulated sides has been standardized a bit
7884  *  (2) Code has been added to de-triangulate some sides
7885  *  (3) BIG ONE: the tolerance for checking a point against a plane has
7886  *      been drastically relaxed
7887  *
7888  *
7889  * Revision 1.67  1994/11/27  23:12:21  matt
7890  * Made changes for new mprintf calling convention
7891  *
7892  * Revision 1.66  1994/11/26  22:51:40  matt
7893  * Removed editor-only fields from segment structure when editor is compiled
7894  * out, and padded segment structure to even multiple of 4 bytes.
7895  *
7896  * Revision 1.65  1994/11/22  16:55:38  mike
7897  * use memset in place of loop to clear array.
7898  *
7899  * Revision 1.64  1994/11/19  15:20:37  mike
7900  * rip out unused code and data
7901  *
7902  * Revision 1.63  1994/11/18  18:31:48  matt
7903  * Fixed code again (and maybe for real)
7904  *
7905  * Revision 1.62  1994/11/18  16:54:24  matt
7906  * Fixed extract_orient_from_segment()
7907  *
7908  * Revision 1.61  1994/11/17  14:56:50  mike
7909  * moved segment validation functions from editor to main.
7910  *
7911  * Revision 1.60  1994/11/16  23:38:53  mike
7912  * new improved boss teleportation behavior.
7913  *
7914  * Revision 1.59  1994/10/30  14:12:46  mike
7915  * rip out local segments stuff.
7916  *
7917  * Revision 1.58  1994/10/27  10:53:39  matt
7918  * Made connectivity error checking put up warning if errors found
7919  *
7920  * Revision 1.57  1994/10/25  21:19:26  mike
7921  * debugging code.
7922  *
7923  * Revision 1.56  1994/10/25  11:26:09  mike
7924  * *** empty log message ***
7925  *
7926  * Revision 1.55  1994/10/22  22:36:08  matt
7927  * Improved error finding routine
7928  *
7929  * Revision 1.54  1994/10/22  18:56:51  matt
7930  * Fixed obscure bug in segment trace code
7931  * Added error find routine, check_segment_connections()
7932  *
7933  * Revision 1.53  1994/10/17  14:05:19  matt
7934  * Don't give recursion assert if doing lighting
7935  *
7936  * Revision 1.52  1994/10/15  19:03:48  mike
7937  * Don't do exhaustive search in smooth lighting.
7938  *
7939  * Revision 1.51  1994/10/12  09:46:44  mike
7940  * Add debug code for trapping exhaustive searches.
7941  *
7942  * Revision 1.50  1994/10/11  20:50:41  matt
7943  * Made find_point_seg() take -1 as segnum, meaning to search all segments
7944  *
7945  * Revision 1.49  1994/10/11  17:40:31  matt
7946  * Fixed bug that caused segment trace to only go through sides you can fly through
7947  *
7948  * Revision 1.48  1994/10/10  14:48:16  matt
7949  * Fixed mistake that caused odd pauses and occasional int3's
7950  *
7951  * Revision 1.47  1994/10/09  23:50:41  matt
7952  * Made find_hitpoint_uv() work with triangulated sides
7953  *
7954  * Revision 1.46  1994/10/08  23:06:52  matt
7955  * trace_segs() didn't know about external walls
7956  *
7957  * Revision 1.45  1994/10/07  22:18:57  mike
7958  * Put in asserts to trap bad segnums.
7959  *
7960  * Revision 1.44  1994/10/06  14:08:07  matt
7961  * Added new function, extract_orient_from_segment()
7962  *
7963  * Revision 1.43  1994/10/04  16:24:11  mike
7964  * Set global Connected_segment_distance for debug reasons for aipath.c.
7965  *
7966  * Revision 1.42  1994/10/04  09:18:42  mike
7967  * Comment out a variable definition, preventing a warning message.
7968  *
7969  * Revision 1.41  1994/10/03  23:43:42  mike
7970  * Put in a warning for overrunning point_segs buffer.
7971  *
7972  * Revision 1.40  1994/10/03  20:55:43  rob
7973  * Added velocity to shortpos.
7974  *
7975  * Revision 1.39  1994/09/27  11:46:06  rob
7976  * re-fixed that same bug (ugh).
7977  *
7978  * Revision 1.38  1994/09/27  10:10:51  rob
7979  * Fixed bug in extract_shortpos (obj_relink added).
7980  *
7981  * Revision 1.37  1994/09/25  23:41:02  matt
7982  * Changed the object load & save code to read/write the structure fields one
7983  * at a time (rather than the whole structure at once).  This mean that the
7984  * object structure can be changed without breaking the load/save functions.
7985  * As a result of this change, the local_object data can be and has been
7986  * incorporated into the object array.  Also, timeleft is now a property
7987  * of all objects, and the object structure has been otherwise cleaned up.
7988  *
7989  * Revision 1.36  1994/09/22  19:03:05  mike
7990  * Add shortpos manipulation functions create_shortpos and extract_shortpos.
7991  *
7992  * Revision 1.35  1994/09/19  21:21:16  mike
7993  * Minor optimization to find_connected_distance.
7994  *
7995  * Revision 1.34  1994/09/19  21:05:25  mike
7996  * Write function find_connected_distance,
7997  * returns distance between two points as travellable through the mine.
7998  *
7999  * Revision 1.33  1994/08/30  15:07:15  matt
8000  * Changed find_point_seg() to deal with some infinite recursion problems.
8001  *
8002  * Revision 1.32  1994/08/11  18:58:32  mike
8003  * Use ints in place of shorts for optimization.
8004  *
8005  * Revision 1.31  1994/08/04  00:20:09  matt
8006  * Cleaned up fvi & physics error handling; put in code to make sure objects
8007  * are in correct segment; simplified segment finding for objects and points
8008  *
8009  * Revision 1.30  1994/08/03  16:46:12  mike
8010  * not much...
8011  *
8012  * Revision 1.29  1994/08/02  20:41:31  matt
8013  * Fixed bug in get_side_verts()
8014  *
8015  * Revision 1.28  1994/08/02  19:04:25  matt
8016  * Cleaned up vertex list functions
8017  *
8018  * Revision 1.27  1994/08/01  10:39:44  matt
8019  * find_new_seg() now will look through any kind of wall but a totally solid one
8020  *
8021  * Revision 1.26  1994/07/28  19:15:59  matt
8022  * Fixed yet another bug in get_seg_masks()
8023
8024 ------------------------------------------------------------------------
8025 main/gameseg.h:
8026
8027  * Revision 1.1  1995/05/16  15:57:18  allender
8028  * Initial revision
8029  *
8030  * Revision 2.0  1995/02/27  11:31:20  john
8031  * New version 2.0, which has no anonymous unions, builds with
8032  * Watcom 10.0, and doesn't require parsing BITMAPS.TBL.
8033  *
8034  * Revision 1.24  1995/02/01  16:34:03  john
8035  * Linted.
8036  *
8037  * Revision 1.23  1995/01/16  21:06:36  mike
8038  * Move function pick_random_point_in_segment from fireball.c to gameseg.c.
8039  *
8040  * Revision 1.22  1994/11/23  12:18:59  mike
8041  * prototype for level names.
8042  *
8043  * Revision 1.21  1994/11/17  14:56:59  mike
8044  * moved segment validation functions from editor to main.
8045  *
8046  * Revision 1.20  1994/11/16  23:38:46  mike
8047  * new improved boss teleportation behavior.
8048  *
8049  * Revision 1.19  1994/10/30  14:12:14  mike
8050  * rip out local segments stuff.
8051  *
8052  * Revision 1.18  1994/10/09  23:51:07  matt
8053  * Made find_hitpoint_uv() work with triangulated sides
8054  *
8055  * Revision 1.17  1994/10/06  14:08:22  matt
8056  * Added new function, extract_orient_from_segment()
8057  *
8058  * Revision 1.16  1994/09/19  21:05:52  mike
8059  * Prototype for find_connected_distance.
8060  *
8061  * Revision 1.15  1994/08/11  18:58:45  mike
8062  * Change shorts to ints.
8063  *
8064  * Revision 1.14  1994/08/04  00:21:09  matt
8065  * Cleaned up fvi & physics error handling; put in code to make sure objects
8066  * are in correct segment; simplified segment finding for objects and points
8067  *
8068  * Revision 1.13  1994/08/02  19:04:25  matt
8069  * Cleaned up vertex list functions
8070  *
8071  * Revision 1.12  1994/07/21  19:01:53  mike
8072  * lsegment stuff.
8073  *
8074  * Revision 1.11  1994/07/07  09:31:13  matt
8075  * Added comments
8076  *
8077  * Revision 1.10  1994/06/14  12:21:20  matt
8078  * Added new function, find_point_seg()
8079  *
8080  * Revision 1.9  1994/05/29  23:17:38  matt
8081  * Move find_object_seg() from physics.c to gameseg.c
8082  * Killed unused find_point_seg()
8083  *
8084  * Revision 1.8  1994/05/20  11:56:57  matt
8085  * Cleaned up find_vector_intersection() interface
8086  * Killed check_point_in_seg(), check_player_seg(), check_object_seg()
8087  *
8088  * Revision 1.7  1994/03/17  18:07:38  yuan
8089  * Removed switch code... Now we just have Walls, Triggers, and Links...
8090  *
8091  * Revision 1.6  1994/02/22  18:14:44  yuan
8092  * Added new wall system
8093  *
8094  * Revision 1.5  1994/02/17  11:33:22  matt
8095  * Changes in object system
8096  *
8097  * Revision 1.4  1994/02/16  13:48:33  mike
8098  * enable editor to compile out.
8099  *
8100  * Revision 1.3  1994/02/14  12:05:07  mike
8101  * change segment data structure.
8102  *
8103  * Revision 1.2  1994/02/10  16:07:20  mike
8104  * separate editor from game based on EDITOR flag.
8105  *
8106  * Revision 1.1  1994/02/09  15:45:38  mike
8107  * Initial revision
8108
8109 ------------------------------------------------------------------------
8110 main/gameseq.c:
8111
8112  * Revision 1.1  1995/12/05  16:02:05  allender
8113  * Initial revision
8114  *
8115  * Revision 1.14  1995/11/03  12:55:30  allender
8116  * shareware changes
8117  *
8118  * Revision 1.13  1995/10/31  10:23:07  allender
8119  * shareware stuff
8120  *
8121  * Revision 1.12  1995/10/18  18:25:02  allender
8122  * call auto_select_weapon after initing ammo since that may
8123  * change the secondary weapon status
8124  *
8125  * Revision 1.11  1995/10/17  13:17:11  allender
8126  * added closebox when entering pilot name
8127  *
8128  * Revision 1.10  1995/09/24  10:56:59  allender
8129  * new players must be looked for in Players directory
8130  *
8131  * Revision 1.9  1995/09/18  08:08:08  allender
8132  * remove netgame binding if at endgame
8133  *
8134  * Revision 1.8  1995/09/14  14:13:01  allender
8135  * initplayerobject have void return
8136  *
8137  * Revision 1.7  1995/08/31  12:54:42  allender
8138  * try and fix bug
8139  *
8140  * Revision 1.6  1995/08/26  16:25:40  allender
8141  * put return values on needed functions
8142  *
8143  * Revision 1.5  1995/08/14  09:26:28  allender
8144  * added byteswap header files
8145  *
8146  * Revision 1.4  1995/08/01  13:57:42  allender
8147  * macified player file stuff -- players stored in seperate folder
8148  *
8149  * Revision 1.3  1995/06/08  12:54:37  allender
8150  * new function for calculating a segment based checksum since the old way
8151  * is byte order dependent
8152  *
8153  * Revision 1.2  1995/06/02  07:42:10  allender
8154  * removed duplicate extern for network_endlevel_poll2
8155  *
8156  * Revision 1.1  1995/05/16  15:25:56  allender
8157  * Initial revision
8158  *
8159  * Revision 2.10  1995/12/19  15:48:25  john
8160  * Made screen reset when loading new level.
8161  *
8162  * Revision 2.9  1995/07/07  16:47:52  john
8163  * Fixed bug with reactor time..
8164  *
8165  * Revision 2.8  1995/06/15  12:14:18  john
8166  * Made end game, win game and title sequences all go
8167  * on after 5 minutes automatically.
8168  *
8169  * Revision 2.7  1995/05/26  16:16:25  john
8170  * Split SATURN into define's for requiring cd, using cd, etc.
8171  * Also started adding all the Rockwell stuff.
8172  *
8173  * Revision 2.6  1995/03/24  13:11:20  john
8174  * Added save game during briefing screens.
8175  *
8176  * Revision 2.5  1995/03/23  17:56:20  allender
8177  * added code to record old laser level and weapons when player gets
8178  * new ship
8179  *
8180  * Revision 2.4  1995/03/21  08:39:14  john
8181  * Ifdef'd out the NETWORK code.
8182  *
8183  * Revision 2.3  1995/03/15  14:33:33  john
8184  * Added code to force the Descent CD-rom in the drive.
8185  *
8186  * Revision 2.2  1995/03/06  16:47:26  mike
8187  * destination saturn
8188  *
8189  * Revision 2.1  1995/03/06  15:23:23  john
8190  * New screen techniques.
8191  *
8192  * Revision 2.0  1995/02/27  11:28:53  john
8193  * New version 2.0, which has no anonymous unions, builds with
8194  * Watcom 10.0, and doesn't require parsing BITMAPS.TBL.
8195  *
8196  * Revision 1.310  1995/02/14  10:48:09  mike
8197  * zero bonus if you are a cheater.
8198  *
8199  * Revision 1.309  1995/02/11  19:17:08  rob
8200  * Fixed bug in laser fire rate after demo playback.
8201  *
8202  * Revision 1.308  1995/02/11  14:34:08  rob
8203  * Added include of netmisc.c
8204  *
8205  * Revision 1.307  1995/02/11  14:29:04  rob
8206  * Fixes for invul. controlcen.
8207  *
8208  * Revision 1.306  1995/02/11  13:47:00  mike
8209  * fix cheats.
8210  *
8211  * Revision 1.305  1995/02/11  13:10:52  rob
8212  * Fixed end of anarchy mission problems.
8213  *
8214  * Revision 1.304  1995/02/11  12:46:12  mike
8215  * initialize Robot_firing_enabled, part of AHIMSA cheat.
8216  *
8217  * Revision 1.303  1995/02/11  12:42:03  john
8218  * Added new song method, with FM bank switching..
8219  *
8220  * Revision 1.302  1995/02/10  17:39:29  matt
8221  * Changed secret exit message to be centered
8222  *
8223  * Revision 1.301  1995/02/10  16:17:33  mike
8224  * init Last_level_path_shown.
8225  *
8226  * Revision 1.300  1995/02/09  22:18:22  john
8227  * Took out between level saves.
8228  *
8229  * Revision 1.299  1995/02/09  12:11:42  rob
8230  * Get rid of high scores thing for multiplayer games.
8231  *
8232  * Revision 1.298  1995/02/08  20:34:24  rob
8233  * Took briefing screens back OUT of coop games (per Interplay request)
8234  *
8235  * Revision 1.297  1995/02/08  19:20:09  rob
8236  * Moved checksum calc.
8237  *
8238  * Revision 1.296  1995/02/05  14:39:24  rob
8239  * Changed object mapping to be more efficient.
8240  *
8241  * Revision 1.295  1995/02/02  19:05:38  john
8242  * Made end level menu for 27 not overwrite descent title..
8243  *
8244  * Revision 1.294  1995/02/02  16:36:42  adam
8245  * *** empty log message ***
8246  *
8247  * Revision 1.293  1995/02/02  15:58:02  john
8248  * Added turbo mode cheat.
8249  *
8250  * Revision 1.292  1995/02/02  15:29:34  matt
8251  * Changed & localized secret level text
8252  *
8253  * Revision 1.291  1995/02/02  10:50:03  adam
8254  * messed with secret level message
8255  *
8256  * Revision 1.290  1995/02/02  01:20:28  adam
8257  * changed endgame song temporarily.
8258  *
8259  * Revision 1.289  1995/02/01  23:19:43  rob
8260  * Fixed up endlevel stuff for multiplayer.
8261  * Put in palette fades around areas that didn't have them before.
8262  *
8263  * Revision 1.288  1995/02/01  17:12:34  mike
8264  * Make score come after endgame screens.
8265  *
8266  * Revision 1.287  1995/01/30  18:34:30  rob
8267  * Put briefing screens back into coop games.
8268  *
8269  * Revision 1.286  1995/01/27  13:07:59  rob
8270  * Removed erroneous warning message.
8271  *
8272  * Revision 1.285  1995/01/27  11:47:43  rob
8273  * Removed new secret level menu from multiplayer games.
8274  *
8275  * Revision 1.284  1995/01/26  22:11:11  mike
8276  * Purple chromo-blaster (ie, fusion cannon) spruce up (chromification)
8277  *
8278  * Revision 1.283  1995/01/26  16:55:13  rob
8279  * Removed ship bonus from cooperative endgame.
8280  *
8281  * Revision 1.282  1995/01/26  16:45:24  mike
8282  * Add autofire fusion cannon stuff.
8283  *
8284  * Revision 1.281  1995/01/26  14:44:44  rob
8285  * Removed unnecessary #ifdefs around mprintfs.
8286  * Changed NumNetPlayerPositions to be independant of MaxNumNetPlayers to
8287  * accomodate 4-player robo-archy games with 8 start positions.
8288  *
8289  * Revision 1.280  1995/01/26  12:19:01  rob
8290  * Changed network_do_frame call.
8291  *
8292  * Revision 1.279  1995/01/26  00:35:03  matt
8293  * Changed numbering convention for HMP files for levels
8294  *
8295  * Revision 1.278  1995/01/25  16:07:59  matt
8296  * Added message (prototype) when going to secret level
8297  *
8298  * Revision 1.277  1995/01/22  18:57:23  matt
8299  * Made player highest level work with missions
8300  *
8301  * Revision 1.276  1995/01/21  23:13:08  matt
8302  * Made high scores with (not work, really) with loaded missions
8303  * Don't give player high score when quit game
8304  *
8305  * Revision 1.275  1995/01/21  17:17:39  john
8306  * *** empty log message ***
8307  *
8308  * Revision 1.274  1995/01/21  17:15:38  john
8309  * Added include for state.h
8310  *
8311  * Revision 1.273  1995/01/21  16:21:14  matt
8312  * Fixed bugs in secret level sequencing
8313  *
8314  * Revision 1.272  1995/01/20  22:47:29  matt
8315  * Mission system implemented, though imcompletely
8316  *
8317  * Revision 1.271  1995/01/19  17:00:48  john
8318  * Made save game work between levels.
8319  *
8320  * Revision 1.270  1995/01/17  17:49:10  rob
8321  * Added key syncing for coop.
8322  *
8323  * Revision 1.269  1995/01/17  14:27:37  john
8324  * y
8325  *
8326  * Revision 1.268  1995/01/17  13:36:33  john
8327  * Moved pig loading into StartNewLevelSub.
8328  *
8329  * Revision 1.267  1995/01/16  16:53:55  john
8330  * Added code to save cheat state during save game.
8331  *
8332  * Revision 1.266  1995/01/15  19:42:10  matt
8333  * Ripped out hostage faces for registered version
8334  *
8335  * Revision 1.265  1995/01/15  16:55:06  john
8336  * Improved mine texture parsing.
8337  *
8338  * Revision 1.264  1995/01/15  11:56:24  john
8339  * Working version of paging.
8340  *
8341  * Revision 1.263  1995/01/14  19:16:40  john
8342  * First version of new bitmap paging code.
8343  *
8344  * Revision 1.262  1995/01/13  17:38:58  yuan
8345  * Removed Int3() for number players check.
8346  *
8347  * Revision 1.261  1995/01/12  12:09:52  yuan
8348  * Added coop object capability.
8349  *
8350  * Revision 1.260  1995/01/05  17:16:08  yuan
8351  * Removed Int3s.
8352  *
8353  * Revision 1.259  1995/01/05  11:34:29  john
8354  * Took out endlevel save stuff for registered.
8355  *
8356  * Revision 1.258  1995/01/04  19:00:16  rob
8357  * Added some debugging for two bugs.
8358  *
8359  * Revision 1.257  1995/01/04  13:18:18  john
8360  * Added cool 6 game save.
8361  *
8362  * Revision 1.256  1995/01/04  08:46:18  rob
8363  * JOHN CHECKED IN FOR ROB !!!
8364  *
8365  * Revision 1.255  1995/01/02  20:07:35  rob
8366  * Added score syncing.
8367  * Get rid of endlevel score for coop games (put it back in elsewhere)
8368  *
8369  * Revision 1.254  1995/01/02  16:17:43  mike
8370  * init super boss.
8371  *
8372  * Revision 1.253  1994/12/21  21:08:47  rob
8373  * fixed a bug in coop player ship positions.
8374  *
8375  * Revision 1.252  1994/12/21  12:57:08  rob
8376  * Handle additional player ships in mines.
8377
8378 ------------------------------------------------------------------------
8379 main/gameseq.h:
8380
8381  * Revision 1.4  1995/10/31  10:22:55  allender
8382  * shareware stuff
8383  *
8384  * Revision 1.3  1995/09/14  14:13:14  allender
8385  * initplayerobject have void return
8386  *
8387  * Revision 1.2  1995/08/24  15:36:17  allender
8388  * fixed prototypes warnings
8389  *
8390  * Revision 1.1  1995/05/16  15:57:26  allender
8391  * Initial revision
8392  *
8393  * Revision 2.0  1995/02/27  11:32:03  john
8394  * New version 2.0, which has no anonymous unions, builds with
8395  * Watcom 10.0, and doesn't require parsing BITMAPS.TBL.
8396  *
8397  * Revision 1.41  1995/02/07  10:51:54  rob
8398  * fix typo.
8399  *
8400  * Revision 1.40  1995/02/06  20:10:16  rob
8401  * Extern'ed DoEndLevelScoreGlitz.
8402  *
8403  * Revision 1.39  1995/02/01  16:34:13  john
8404  * Linted.
8405  *
8406  * Revision 1.38  1995/01/27  11:15:03  rob
8407  * Added extern for player position vars.
8408  *
8409  * Revision 1.37  1995/01/20  22:47:38  matt
8410  * Mission system implemented, though imcompletely
8411  *
8412  * Revision 1.36  1995/01/17  13:36:08  john
8413  * Moved pig loading into StartNewLevelSub.
8414  *
8415  * Revision 1.35  1995/01/04  12:21:28  john
8416  * *** empty log message ***
8417  *
8418  * Revision 1.34  1995/01/04  12:20:47  john
8419  * Declearations to work better with game state save.
8420  *
8421  *
8422  * Revision 1.33  1994/12/08  09:46:35  matt
8423  * Made level name len a multiple of 4 for alignment
8424  *
8425  * Revision 1.32  1994/11/29  16:33:29  rob
8426  * Added new defines for last_secret_level based on shareware or not shareware.
8427  *
8428  * Revision 1.31  1994/11/26  15:30:20  matt
8429  * Allow escape out of change pilot menu
8430  *
8431  * Revision 1.30  1994/11/21  17:29:38  matt
8432  * Cleaned up sequencing & game saving for secret levels
8433  *
8434  * Revision 1.29  1994/11/21  15:55:03  matt
8435  * Corrected LAST_LEVEL
8436  *
8437  * Revision 1.28  1994/11/20  22:12:43  mike
8438  * set LAST_LEVEL based on SHAREWARE.
8439  *
8440  * Revision 1.27  1994/11/09  10:55:51  matt
8441  * Cleaned up initialization for editor -> game transitions
8442  *
8443  * Revision 1.26  1994/11/08  17:50:48  rob
8444  * ADded prototype for StartNewLEvel.
8445  *
8446  *
8447  * Revision 1.25  1994/11/07  17:50:57  rob
8448  * Added extern prototype for init_player_stats_level called for
8449  * network games.
8450  *
8451  * Revision 1.24  1994/10/25  15:40:03  yuan
8452  * *** empty log message ***
8453  *
8454  * Revision 1.23  1994/10/22  00:08:52  matt
8455  * Fixed up problems with bonus & game sequencing
8456  * Player doesn't get credit for hostages unless he gets them out alive
8457  *
8458  * Revision 1.22  1994/10/18  18:57:08  matt
8459  * Added main menu option to enter new player name
8460  *
8461  * Revision 1.21  1994/10/07  23:37:32  matt
8462  * Added prototype
8463  *
8464  * Revision 1.20  1994/10/07  16:02:53  matt
8465  * Loading saved game no longer clears players weapons & other stats
8466  *
8467  * Revision 1.19  1994/10/06  14:12:46  matt
8468  * Added flash effect when player appears
8469  *
8470  * Revision 1.18  1994/10/03  13:34:44  matt
8471  * Added new (and hopefully better) game sequencing functions
8472  *
8473  * Revision 1.17  1994/09/30  15:19:53  matt
8474  * Added new game sequencing functions, but left them disabled for now.
8475  *
8476  * Revision 1.16  1994/09/28  17:24:34  matt
8477  * Added first draft of game save/load system
8478  *
8479  * Revision 1.15  1994/09/27  12:29:42  matt
8480  * Changed level naming
8481  *
8482  * Revision 1.14  1994/09/02  11:53:55  mike
8483  * Rename init_player_stats to init_player_stats_game.
8484  *
8485  * Revision 1.13  1994/08/31  20:57:34  matt
8486  * Cleaned up endlevel/death code
8487  *
8488  * Revision 1.12  1994/08/23  18:45:06  yuan
8489  * Added level 10 capability.. (LEDGES)
8490  *
8491  * Revision 1.11  1994/08/18  10:47:38  john
8492  * Cleaned up game sequencing and player death stuff
8493  * in preparation for making the player explode into
8494  * pieces when dead.
8495  *
8496  * Revision 1.10  1994/08/15  15:24:45  john
8497  * Made players know who killed them; Disabled cheat menu
8498  * during net player; fixed bug with not being able to turn
8499  * of invulnerability; Made going into edit/starting new leve
8500  * l drop you out of a net game; made death dialog box.
8501  *
8502  * Revision 1.9  1994/08/13  12:20:56  john
8503  * Made the networking uise the Players array.
8504  *
8505  * Revision 1.8  1994/07/22  12:36:24  matt
8506  * Cleaned up editor/game interactions some more.
8507  *
8508  * Revision 1.7  1994/07/19  20:15:33  matt
8509  * Name for each level now saved in the .SAV file & stored in Current_level_name
8510  *
8511  * Revision 1.6  1994/07/02  13:49:33  matt
8512  * Cleaned up includes
8513  *
8514  * Revision 1.5  1994/07/02  13:09:52  matt
8515  * Moved player stats struct from gameseq.h to player.h
8516  *
8517  * Revision 1.4  1994/07/01  16:35:35  yuan
8518  * Added key system
8519  *
8520  * Revision 1.3  1994/06/26  14:07:35  matt
8521  * Added prototypes
8522  *
8523  * Revision 1.2  1994/06/24  17:03:56  john
8524  * Added VFX support. Also took all game sequencing stuff like
8525  * EndGame out and put it into gameseq.c
8526  *
8527  * Revision 1.1  1994/06/24  14:13:53  john
8528  * Initial revision
8529
8530 ------------------------------------------------------------------------
8531 main/gauges.c:
8532
8533  * Revision 1.15  1995/10/31  10:22:37  allender
8534  * shareware stuff
8535  *
8536  * Revision 1.14  1995/10/26  14:11:05  allender
8537  * do copy of weapon boxes in cockpit correctly
8538  *
8539  * Revision 1.13  1995/10/21  22:54:56  allender
8540  * fixed up player names on hud
8541  *
8542  * Revision 1.12  1995/10/12  17:39:27  allender
8543  * fixed status bar lives display
8544  *
8545  * Revision 1.11  1995/09/22  15:21:46  allender
8546  * fixed hud problems (reticle and kill lists) for
8547  * non pixel doubled mode
8548  *
8549  * Revision 1.10  1995/09/13  11:38:47  allender
8550  * show KB left in heap instead of piggy cache
8551  *
8552  * Revision 1.9  1995/09/04  15:52:28  allender
8553  * fix vulcan ammo count to update without overwritting itself
8554  *
8555  * Revision 1.8  1995/08/31  14:11:20  allender
8556  * worked on hud kill list for non pixel doubled mode
8557  *
8558  * Revision 1.7  1995/08/24  16:05:05  allender
8559  * more gauge placement -- still not done!
8560  *
8561  * Revision 1.6  1995/08/18  15:44:56  allender
8562  * put in PC gauges for keys, lives, and reticle when pixel doubling
8563  *
8564  * Revision 1.5  1995/08/18  10:24:47  allender
8565  * added proper support for cockpit mode -- still needs
8566  *
8567  * Revision 1.4  1995/07/26  16:56:34  allender
8568  * more gauge stuff for status bar.  still problem
8569  * with ship
8570  *
8571  * Revision 1.3  1995/07/17  08:55:57  allender
8572  * fix up for large status bar.  Still needs some work though
8573  *
8574  * Revision 1.2  1995/06/20  09:54:29  allender
8575  * stopgap measure to get status bar "working" until real mac
8576  * status bar gets added
8577  *
8578  * Revision 1.1  1995/05/16  15:26:05  allender
8579  * Initial revision
8580  *
8581  * Revision 2.7  1995/12/19  16:18:33  john
8582  * Made weapon info align with canvas width, not 315.
8583  *
8584  * Revision 2.6  1995/03/21  14:39:25  john
8585  * Ifdef'd out the NETWORK code.
8586  *
8587  * Revision 2.5  1995/03/14  12:31:25  john
8588  * Prevent negative shields from printing.
8589  *
8590  * Revision 2.4  1995/03/10  12:57:58  allender
8591  * move rear view text up four pixels up when playing back demo
8592  *
8593  * Revision 2.3  1995/03/09  11:47:51  john
8594  * Added HUD for VR helmets.
8595  *
8596  * Revision 2.2  1995/03/06  15:23:26  john
8597  * New screen techniques.
8598  *
8599  * Revision 2.1  1995/02/27  13:13:45  john
8600  * Removed floating point.
8601  *
8602  * Revision 2.0  1995/02/27  11:29:06  john
8603  * New version 2.0, which has no anonymous unions, builds with
8604  * Watcom 10.0, and doesn't require parsing BITMAPS.TBL.
8605  *
8606  * Revision 1.203  1995/02/11  01:56:45  mike
8607  * move up weapons text on fullscreen hud, missiles was offscreen.
8608  *
8609  * Revision 1.202  1995/02/09  13:23:34  rob
8610  * Added reticle names in demo playback.
8611  *
8612  * Revision 1.201  1995/02/08  19:20:46  rob
8613  * Show cloaked teammates on H
8614  * UD.  Get rid of show ID's in anarchy option.
8615  *
8616  * Revision 1.200  1995/02/07  21:09:00  mike
8617  * add flashing to invulnerability and cloak on fullscreen.
8618  *
8619  * Revision 1.199  1995/02/02  21:55:57  matt
8620  * Added new colored key icons for fullscreen
8621  *
8622  * Revision 1.198  1995/01/30  17:17:07  rob
8623  * Fixed teammate names on hud.
8624  *
8625  * Revision 1.197  1995/01/28  17:40:49  mike
8626  * fix gauge fontcolor.
8627  *
8628  * Revision 1.196  1995/01/27  17:03:14  mike
8629  * fix placement of weapon info in multiplayer fullscreen, as per AP request.
8630  *
8631  * Revision 1.195  1995/01/27  11:51:23  rob
8632  * Put deaths tally into cooperative mode
8633  *
8634  * Revision 1.194  1995/01/27  11:43:24  adam
8635  * fiddled with key display
8636  *
8637  * Revision 1.193  1995/01/25  23:38:35  mike
8638  * fix keys on fullscreen.
8639  *
8640  * Revision 1.192  1995/01/24  22:03:28  mike
8641  * Lotsa hud stuff, put a lot of messages up.
8642  *
8643  * Revision 1.191  1995/01/23  16:47:21  rob
8644  * Fixed problem with playing extra life noise in coop.
8645  *
8646  * Revision 1.190  1995/01/22  16:00:46  mike
8647  * remove unneeded string.
8648  *
8649  * Revision 1.189  1995/01/22  15:58:22  mike
8650  * localization
8651  *
8652  * Revision 1.188  1995/01/20  17:19:45  rob
8653  * Fixing colors of hud kill list players.
8654  *
8655  * Revision 1.187  1995/01/20  09:19:18  allender
8656  * record player flags when in CM_FULL_SCREEN
8657  *
8658  * Revision 1.186  1995/01/19  16:29:09  allender
8659  * made demo recording of weapon change be in this file for shareware only
8660  *
8661  * Revision 1.185  1995/01/19  15:00:33  allender
8662  * code to record shield, energy, and ammo in fullscreen
8663  *
8664  * Revision 1.184  1995/01/19  13:43:13  matt
8665  * Fixed "cheater" message on HUD
8666  *
8667  * Revision 1.183  1995/01/18  16:11:58  mike
8668  * Don't show added scores of 0.
8669  *
8670  * Revision 1.182  1995/01/17  17:42:39  allender
8671  * do ammo counts in demo recording
8672  *
8673  * Revision 1.181  1995/01/16  17:26:25  rob
8674  * Fixed problem with coloration of team kill list.
8675  *
8676  * Revision 1.180  1995/01/16  17:22:39  john
8677  * Made so that KB and framerate don't collide.
8678  *
8679  * Revision 1.179  1995/01/16  14:58:31  matt
8680  * Changed score_added display to print "Cheater!" when cheats enabled
8681  *
8682  * Revision 1.178  1995/01/15  19:42:07  matt
8683  * Ripped out hostage faces for registered version
8684  *
8685  * Revision 1.177  1995/01/15  19:25:07  mike
8686  * show vulcan ammo and secondary ammo in fullscreen view.
8687  *
8688  * Revision 1.176  1995/01/15  13:16:12  john
8689  * Made so that paging always happens, lowmem just loads less.
8690  * Also, make KB load print to hud.
8691  *
8692  * Revision 1.175  1995/01/14  19:17:32  john
8693  * First version of piggy paging.
8694  *
8695  * Revision 1.174  1995/01/05  21:25:23  rob
8696  * Re-did some changes lost due to RCS weirdness.
8697  *
8698  * Revision 1.173  1995/01/05  12:22:34  rob
8699  * Don't show player names for cloaked players.
8700  *
8701  * Revision 1.172  1995/01/04  17:14:50  allender
8702  * make init_gauges work properly on demo playback
8703  *
8704  * Revision 1.171  1995/01/04  15:04:42  allender
8705  * new demo calls for registered version
8706  *
8707  * Revision 1.167  1995/01/03  13:03:57  allender
8708  * pass score points instead of total points.   Added ifdef for
8709  * multi_send_score
8710  *
8711  * Revision 1.166  1995/01/03  11:45:02  allender
8712  * add hook to record player score
8713  *
8714  * Revision 1.165  1995/01/03  11:25:19  allender
8715  * remove newdemo stuff around score display
8716  *
8717  * Revision 1.163  1995/01/02  21:03:53  rob
8718  * Fixing up the hud-score-list for coop games.
8719  *
8720  * Revision 1.162  1994/12/31  20:54:40  rob
8721  * Added coop mode HUD score list.
8722  * Added more generic system for player names on HUD.
8723  *
8724  * Revision 1.161  1994/12/30  20:13:01  rob
8725  * Ifdef reticle names on shareware.
8726  * Added robot reticle naming.
8727  *
8728  * Revision 1.160  1994/12/29  17:53:51  mike
8729  * move up energy/shield in fullscreen to get out of way of kill list.
8730  *
8731  * Revision 1.159  1994/12/29  16:44:05  mike
8732  * add energy and shield showing.
8733  *
8734  * Revision 1.158  1994/12/28  16:34:29  mike
8735  * make warning beep go away on Player_is_dead.
8736  *
8737  * Revision 1.157  1994/12/28  10:00:43  allender
8738  * change in init_gauges to for multiplayer demo playbacks
8739  *
8740  * Revision 1.156  1994/12/27  11:06:46  allender
8741  * removed some previous code to for demo playback stuff
8742  *
8743  * Revision 1.155  1994/12/23  14:23:06  john
8744  * Added floating reticle for VR helments.
8745  *
8746  * Revision 1.154  1994/12/21  12:56:41  allender
8747  * on multiplayer demo playback, show kills and deaths
8748  *
8749  * Revision 1.153  1994/12/19  20:28:42  rob
8750  * Get rid of kill list in coop games.
8751  *
8752  * Revision 1.152  1994/12/14  18:06:44  matt
8753  * Removed compile warnings
8754  *
8755  * Revision 1.151  1994/12/14  15:21:28  rob
8756  * Made gauges align in status_bar net game.
8757  *
8758  * Revision 1.150  1994/12/12  17:20:33  matt
8759  * Don't get bonus points when cheating
8760  *
8761  * Revision 1.149  1994/12/12  16:47:00  matt
8762  * When cheating, get no score.  Change level cheat to prompt for and
8763  * jump to new level.
8764  *
8765  * Revision 1.148  1994/12/12  12:05:45  rob
8766  * Grey out players who are disconnected.
8767  *
8768  * Revision 1.147  1994/12/09  16:19:48  yuan
8769  * kill matrix stuff.
8770  *
8771  * Revision 1.146  1994/12/09  16:12:34  rob
8772  * Fixed up the status bar kills gauges for net play.
8773  *
8774  * Revision 1.145  1994/12/09  01:55:34  rob
8775  * Added kills list to HUD/status bar.
8776  * Added something for Mark.
8777  *
8778  * Revision 1.144  1994/12/08  21:03:30  allender
8779  * pass old player flags to record_player_flags
8780  *
8781  * Revision 1.143  1994/12/07  22:49:33  mike
8782  * no homing missile warning during endlevel sequence.
8783  *
8784  * Revision 1.142  1994/12/06  13:55:31  matt
8785  * Use new rounding func, f2ir()
8786  *
8787  * Revision 1.141  1994/12/03  19:03:37  matt
8788  * Fixed vulcan ammo HUD message
8789  *
8790  * Revision 1.140  1994/12/03  18:43:18  matt
8791  * Fixed (hopefully) claok gauge
8792  *
8793  * Revision 1.139  1994/12/03  14:26:21  yuan
8794  * Fixed dumb bug
8795  *
8796  * Revision 1.138  1994/12/03  14:17:30  yuan
8797  * Localization 320
8798
8799 ------------------------------------------------------------------------
8800 main/gauges.h:
8801
8802  * Revision 1.3  1995/08/23  21:37:13  allender
8803  * fix mcc compiler warmings
8804  *
8805  * Revision 1.2  1995/08/18  15:45:24  allender
8806  * upped max gauges
8807  *
8808  * Revision 1.1  1995/05/16  15:57:34  allender
8809  * Initial revision
8810  *
8811  * Revision 2.0  1995/02/27  11:28:45  john
8812  * New version 2.0, which has no anonymous unions, builds with
8813  * Watcom 10.0, and doesn't require parsing BITMAPS.TBL.
8814  *
8815  * Revision 1.27  1994/12/14  18:06:39  matt
8816  * Added prototype
8817  *
8818  * Revision 1.26  1994/12/09  16:19:52  yuan
8819  * kill matrix stuff.
8820  *
8821  * Revision 1.25  1994/10/25  11:07:34  mike
8822  * Prototype play_homing_warning.
8823  *
8824  * Revision 1.24  1994/10/24  16:34:39  mike
8825  * Increase MAX_GAUGE_BMS from 56 to 80...
8826  *
8827  * Revision 1.23  1994/10/21  20:43:47  mike
8828  * Prototype add_bonus_points_to_score.
8829  *
8830  * Revision 1.22  1994/10/14  15:56:33  mike
8831  * Prototype update_laser_weapon_info.
8832  *
8833  * Revision 1.21  1994/10/13  15:17:26  mike
8834  * Remove afterburner references.
8835  *
8836  * Revision 1.20  1994/10/05  17:09:46  matt
8837  * Added functional reticle
8838  *
8839  * Revision 1.19  1994/10/04  21:41:29  matt
8840  * Added cloaked player gauge effect, and different ship bitmap for each player
8841  *
8842  * Revision 1.18  1994/09/26  13:29:40  matt
8843  * Added extra life each 100,000 points, and show icons on HUD for num lives
8844  *
8845  * Revision 1.17  1994/09/20  11:56:08  matt
8846  * Added prototype
8847  *
8848  * Revision 1.16  1994/09/20  00:11:03  matt
8849  * Finished gauges for Status Bar, including hostage video display.
8850  *
8851  * Revision 1.15  1994/09/17  23:57:18  matt
8852  * Got some, but not all, off the status bar gauges working
8853  *
8854  * Revision 1.14  1994/09/16  13:08:46  mike
8855  * Prototype say_afterburner_status.
8856  *
8857  * Revision 1.13  1994/09/14  16:27:03  mike
8858  * Prototype player_dead_message();
8859  *
8860  *
8861  * Revision 1.12  1994/07/20  17:34:43  yuan
8862  * Some minor bug fixes and new key gauges...
8863  *
8864  * Revision 1.11  1994/07/14  14:46:02  yuan
8865  * Added score effect.
8866  *
8867  * Revision 1.10  1994/07/12  16:22:00  yuan
8868  * Increased number of maximum gauges.
8869  *
8870  * Revision 1.9  1994/07/11  20:10:36  yuan
8871  * Numerical gauges.
8872  *
8873  * Revision 1.8  1994/07/10  18:01:28  yuan
8874  * Added new gauges.
8875  *
8876  * Revision 1.7  1994/06/21  15:08:22  john
8877  * Made demo record HUD message and cleaned up the HUD code.
8878  *
8879  * Revision 1.6  1994/06/21  12:40:46  yuan
8880  * Fixing HUD message.
8881  *
8882  * Revision 1.5  1994/06/21  12:11:56  yuan
8883  * Fixed up menus and added HUDisplay messages.
8884  *
8885  * Revision 1.4  1994/04/28  21:34:24  mike
8886  * prototype check_erase_gauge
8887  *
8888  * Revision 1.3  1994/04/06  14:42:46  yuan
8889  * Adding new powerups.
8890  *
8891  * Revision 1.2  1993/12/05  22:48:58  matt
8892  * Reworked include files in an attempt to cut down on build times
8893  *
8894  * Revision 1.1  1993/12/05  21:07:55  matt
8895  * Initial revision
8896
8897 ------------------------------------------------------------------------
8898 main/hostage.c:
8899
8900  * Revision 1.1  1995/05/16  15:26:24  allender
8901  * Initial revision
8902  *
8903  * Revision 2.0  1995/02/27  11:28:36  john
8904  * New version 2.0, which has no anonymous unions, builds with
8905  * Watcom 10.0, and doesn't require parsing BITMAPS.TBL.
8906  *
8907  * Revision 1.65  1995/02/22  13:45:54  allender
8908  * remove anonymous unions from object structure
8909  *
8910  * Revision 1.64  1995/02/13  20:34:57  john
8911  * Lintized
8912  *
8913  * Revision 1.63  1995/01/15  19:41:48  matt
8914  * Ripped out hostage faces for registered version
8915  *
8916  * Revision 1.62  1995/01/14  19:16:53  john
8917  * First version of new bitmap paging code.
8918  *
8919  * Revision 1.61  1994/12/19  16:35:09  john
8920  * Made hoastage playback end when ship dies.
8921  *
8922  * Revision 1.60  1994/12/06  16:30:41  yuan
8923  * Localization
8924  *
8925  * Revision 1.59  1994/11/30  17:32:46  matt
8926  * Put hostage_face_clip array back in so editor would work
8927  *
8928  * Revision 1.58  1994/11/30  17:22:13  matt
8929  * Ripped out hostage faces in shareware version
8930  *
8931  * Revision 1.57  1994/11/30  16:11:25  matt
8932  * Use correct constant for hostage voice
8933  *
8934  * Revision 1.56  1994/11/27  23:15:19  matt
8935  * Made changes for new mprintf calling convention
8936  *
8937  * Revision 1.55  1994/11/19  19:53:44  matt
8938  * Added code to full support different hostage head clip & message for
8939  * each hostage.
8940  *
8941  * Revision 1.54  1994/11/19  16:35:15  matt
8942  * Got rid of unused code, & made an array smaller
8943  *
8944  * Revision 1.53  1994/11/14  12:42:03  matt
8945  * Increased palette flash when hostage rescued
8946  *
8947  * Revision 1.52  1994/10/28  14:43:09  john
8948  * Added sound volumes to all sound calls.
8949  *
8950  * Revision 1.51  1994/10/23  02:10:57  matt
8951  * Got rid of obsolete hostage_info stuff
8952  *
8953  * Revision 1.50  1994/10/22  00:08:44  matt
8954  * Fixed up problems with bonus & game sequencing
8955  * Player doesn't get credit for hostages unless he gets them out alive
8956  *
8957  * Revision 1.49  1994/10/20  22:52:49  matt
8958  * Fixed compiler warnings
8959  *
8960  * Revision 1.48  1994/10/20  21:25:44  matt
8961  * Took out silly scale down/scale up code for hostage anim
8962  *
8963  * Revision 1.47  1994/10/20  12:47:28  matt
8964  * Replace old save files (MIN/SAV/HOT) with new LVL files
8965  *
8966  * Revision 1.46  1994/10/04  15:33:33  john
8967  * Took out the old PLAY_SOUND??? code and replaced it
8968  * with direct calls into digi_link_??? so that all sounds
8969  * can be made 3d.
8970  *
8971  * Revision 1.45  1994/09/28  23:10:46  matt
8972  * Made hostage rescue do palette flash
8973  *
8974  * Revision 1.44  1994/09/20  00:11:00  matt
8975  * Finished gauges for Status Bar, including hostage video display.
8976  *
8977  * Revision 1.43  1994/09/15  21:24:19  matt
8978  * Changed system to keep track of whether & what cockpit is up
8979  * Made hostage clip not queue when no cockpit
8980  *
8981  *
8982  * Revision 1.42  1994/08/25  13:45:19  matt
8983  * Made hostage vclips queue
8984  *
8985  * Revision 1.41  1994/08/14  23:15:06  matt
8986  * Added animating bitmap hostages, and cleaned up vclips a bit
8987  *
8988  * Revision 1.40  1994/08/12  22:41:11  john
8989  * Took away Player_stats; add Players array.
8990  *
8991  * Revision 1.39  1994/07/14  22:06:35  john
8992  * Fix radar/hostage vclip conflict.
8993  *
8994  * Revision 1.38  1994/07/12  18:40:21  yuan
8995  * Tweaked location of radar and hostage screen...
8996  * Still needs work.
8997  *
8998  *
8999  * Revision 1.37  1994/07/07  09:52:17  john
9000  * Moved hostage screen.
9001  *
9002  * Revision 1.36  1994/07/06  15:23:52  john
9003  * Revamped hostage sound.
9004  *
9005  * Revision 1.35  1994/07/06  15:14:54  john
9006  * Added hostage sound effect picking.
9007  *
9008  * Revision 1.34  1994/07/06  13:25:33  john
9009  * Added compress hostages functions.
9010  *
9011  * Revision 1.33  1994/07/06  12:52:59  john
9012  * Fixed compiler warnings.
9013  *
9014  * Revision 1.32  1994/07/06  12:43:50  john
9015  * Made generic messages for hostages.
9016  *
9017  * Revision 1.31  1994/07/06  10:55:07  john
9018  * New structures for hostages.
9019  *
9020  * Revision 1.30  1994/07/05  12:49:09  john
9021  * Put functionality of New Hostage spec into code.
9022  *
9023  * Revision 1.29  1994/07/02  13:08:47  matt
9024  * Increment stats when hostage rescued
9025  *
9026  * Revision 1.28  1994/07/01  18:07:46  john
9027  * y
9028  *
9029  * Revision 1.27  1994/07/01  18:07:03  john
9030  * *** empty log message ***
9031  *
9032  * Revision 1.26  1994/07/01  17:55:26  john
9033  * First version of not-working hostage system.
9034  *
9035  * Revision 1.25  1994/06/27  15:53:21  john
9036  * #define'd out the newdemo stuff
9037  *
9038  *
9039  * Revision 1.24  1994/06/20  16:08:52  john
9040  * Added volume control; made doors 3d sounds.
9041  *
9042  * Revision 1.23  1994/06/16  10:15:32  yuan
9043  * Fixed location of face.
9044  *
9045  * Revision 1.22  1994/06/15  15:05:33  john
9046  * *** empty log message ***
9047  *
9048  * Revision 1.21  1994/06/14  21:15:20  matt
9049  * Made rod objects draw lighted or not depending on a parameter, so the
9050  * materialization effect no longer darkens.
9051  *
9052  * Revision 1.20  1994/06/08  18:16:26  john
9053  * Bunch of new stuff that basically takes constants out of the code
9054  * and puts them into bitmaps.tbl.
9055  *
9056  * Revision 1.19  1994/06/02  19:30:08  matt
9057  * Moved texture-mapped rod drawing stuff (used for hostage & now for the
9058  * materialization center) to object.c
9059
9060 ------------------------------------------------------------------------
9061 main/hostage.h:
9062
9063  * Revision 1.1  1995/05/16  15:57:57  allender
9064  * Initial revision
9065  *
9066  * Revision 2.0  1995/02/27  11:27:50  john
9067  * New version 2.0, which has no anonymous unions, builds with
9068  * Watcom 10.0, and doesn't require parsing BITMAPS.TBL.
9069  *
9070  * Revision 1.23  1995/01/15  19:42:06  matt
9071  * Ripped out hostage faces for registered version
9072  *
9073  * Revision 1.22  1994/12/19  16:35:07  john
9074  * Made hoastage playback end when ship dies.
9075  *
9076  * Revision 1.21  1994/11/30  17:22:12  matt
9077  * Ripped out hostage faces in shareware version
9078  *
9079  * Revision 1.20  1994/11/19  19:53:43  matt
9080  * Added code to full support different hostage head clip & message for
9081  * each hostage.
9082  *
9083  * Revision 1.19  1994/11/19  16:35:28  matt
9084  * Got rid of unused code, & made an array smaller
9085  *
9086  * Revision 1.18  1994/10/23  02:10:57  matt
9087  * Got rid of obsolete hostage_info stuff
9088  *
9089  * Revision 1.17  1994/09/20  00:10:37  matt
9090  * Finished gauges for Status Bar, including hostage video display.
9091  *
9092  * Revision 1.16  1994/09/01  10:41:24  matt
9093  * Sizes for powerups now specified in bitmaps.tbl; blob bitmaps now plot
9094  * correctly if width & height of bitmap are different.
9095  *
9096  * Revision 1.15  1994/08/14  23:15:14  matt
9097  * Added animating bitmap hostages, and cleaned up vclips a bit
9098  *
9099  * Revision 1.14  1994/07/14  22:06:51  john
9100  * Fix radar/hostage vclip conflict.
9101  *
9102  * Revision 1.13  1994/07/14  22:05:41  john
9103  * Made radar display not conflict with hostage
9104  * vclip talking.
9105  *
9106  * Revision 1.12  1994/07/06  13:41:46  matt
9107  * Added support for bitmap hostages
9108  *
9109  * Revision 1.11  1994/07/06  12:43:36  john
9110  * Made generic messages for hostages.
9111  *
9112  * Revision 1.10  1994/07/06  10:55:09  john
9113  * New structures for hostages.
9114  *
9115  * Revision 1.9  1994/07/05  12:48:47  john
9116  * Put functionality of New Hostage spec into code.
9117  *
9118  * Revision 1.8  1994/07/01  17:55:14  john
9119  * First version of not-working hostage system.
9120  *
9121  * Revision 1.7  1994/06/15  14:57:10  john
9122  * Added triggers to demo recording.
9123  *
9124  * Revision 1.6  1994/06/08  18:15:49  john
9125  * Bunch of new stuff that basically takes constants out of the code
9126  * and puts them into bitmaps.tbl.
9127  *
9128  * Revision 1.5  1994/05/02  12:43:06  yuan
9129  * Fixed warnings.
9130  *
9131  * Revision 1.4  1994/04/06  14:42:46  yuan
9132  * Adding new powerups.
9133  *
9134  * Revision 1.3  1994/04/01  11:15:14  yuan
9135  * Added multiple bitmap functionality to all objects...
9136  * (hostages, powerups, lasers, etc.)
9137  * Hostages and powerups are implemented in the object system,
9138  * just need to finish function call to "affect" player.
9139  *
9140  * Revision 1.2  1994/03/31  12:04:35  matt
9141  * Added prototypes for 2 funcs
9142  *
9143  * Revision 1.1  1994/03/31  11:39:24  matt
9144  * Initial revision
9145
9146 ------------------------------------------------------------------------
9147 main/hud.c:
9148
9149  * Revision 1.4  1995/08/24  16:03:09  allender
9150  * fix up message placement
9151  *
9152  * Revision 1.3  1995/08/18  10:25:21  allender
9153  * added support for pixel doubling using PC game font
9154  *
9155  * Revision 1.2  1995/08/12  11:33:22  allender
9156  * removed #ifdef NEWDEMO -- always in
9157  *
9158  * Revision 1.1  1995/05/16  15:26:32  allender
9159  * Initial revision
9160  *
9161  * Revision 2.2  1995/03/30  16:36:40  mike
9162  * text localization.
9163  *
9164  * Revision 2.1  1995/03/06  15:23:50  john
9165  * New screen techniques.
9166  *
9167  * Revision 2.0  1995/02/27  11:30:41  john
9168  * New version 2.0, which has no anonymous unions, builds with
9169  * Watcom 10.0, and doesn't require parsing BITMAPS.TBL.
9170  *
9171  * Revision 1.27  1995/01/23  16:51:30  mike
9172  * Show hud messages on 3d if window in three largest sizes.
9173  *
9174  * Revision 1.26  1995/01/17  17:42:45  rob
9175  * Made message timeout for HUD messages longer.
9176  *
9177  * Revision 1.25  1995/01/04  11:39:03  rob
9178  * Made HUD text get out of the way of large HUD messages.
9179  *
9180  * Revision 1.24  1995/01/01  14:20:32  rob
9181  * longer timer for hud messages.
9182  *
9183  *
9184  * Revision 1.23  1994/12/15  13:04:34  mike
9185  * Replace Players[Player_num].time_total references with GameTime.
9186  *
9187  * Revision 1.22  1994/12/13  12:55:12  mike
9188  * move press any key to continue message when you are dead to bottom of window.
9189  *
9190  * Revision 1.21  1994/12/07  17:08:01  rob
9191  * removed unnecessary debug info.
9192  *
9193  * Revision 1.20  1994/12/07  16:24:16  john
9194  * Took out code that kept track of messages differently for different
9195  * screen modes... I made it so they just draw differently depending on screen mode.
9196  *
9197  * Revision 1.19  1994/12/07  15:42:57  rob
9198  * Added a bunch of debug stuff to look for HUD message problems in net games...
9199  *
9200  * Revision 1.18  1994/12/06  16:30:35  yuan
9201  * Localization
9202  *
9203  * Revision 1.17  1994/12/05  00:32:36  mike
9204  * fix randomness of color on status bar hud messages.
9205  *
9206  * Revision 1.16  1994/11/19  17:05:53  rob
9207  * Moved dead_player_message down to avoid overwriting HUD messages.
9208  *
9209  * Revision 1.15  1994/11/18  23:37:56  john
9210  * Changed some shorts to ints.
9211  *
9212  * Revision 1.14  1994/11/12  16:38:25  mike
9213  * clear some annoying debug messages.
9214  *
9215  * Revision 1.13  1994/11/11  15:36:39  mike
9216  * write hud messages on background if 3d window small enough
9217  *
9218  * Revision 1.12  1994/10/20  09:49:31  mike
9219  * Reduce number of messages.
9220  *
9221  * Revision 1.11  1994/10/17  10:49:15  john
9222  * Took out some warnings.
9223  *
9224  * Revision 1.10  1994/10/17  10:45:13  john
9225  * Made the player able to abort death by pressing any button or key.
9226  *
9227  * Revision 1.9  1994/10/13  15:17:33  mike
9228  * Remove afterburner references.
9229  *
9230  * Revision 1.8  1994/10/11  12:06:32  mike
9231  * Only show message advertising death sequence abort after player exploded.
9232  *
9233  * Revision 1.7  1994/10/10  17:21:53  john
9234  * Made so instead of saying too many messages, it scrolls off the
9235  * oldest message.
9236  *
9237  * Revision 1.6  1994/10/07  23:05:39  john
9238  * Fixed bug with HUD not drawing stuff sometimes...
9239  * ( I had a circular buffer that I was stepping thru
9240  * to draw text that went: for (i=first;i<last;i++)...
9241  * duh!! last could be less than first.)
9242  * /
9243  *
9244  * Revision 1.5  1994/09/16  13:08:20  mike
9245  * Arcade stuff, afterburner stuff.
9246  *
9247  * Revision 1.4  1994/09/14  16:26:57  mike
9248  * player_dead_message.
9249  *
9250  * Revision 1.3  1994/08/18  16:35:45  john
9251  * Made gauges messages stay up a bit longer.
9252  *
9253  * Revision 1.2  1994/08/18  12:10:21  john
9254  * Made HUD messages scroll.
9255  *
9256  * Revision 1.1  1994/08/18  11:22:09  john
9257  * Initial revision
9258
9259 ------------------------------------------------------------------------
9260 main/inferno.c:
9261
9262  * Revision 1.1  1995/12/05  15:57:49  allender
9263  * Initial revision
9264  *
9265  * Revision 1.19  1995/11/07  17:03:12  allender
9266  * added splash screen for descent contest
9267  *
9268  * Revision 1.18  1995/10/31  10:22:22  allender
9269  * shareware stuff
9270  *
9271  * Revision 1.17  1995/10/18  01:53:07  allender
9272  * mouse click to leave do not distribute screen
9273  *
9274  * Revision 1.16  1995/10/17  12:00:12  allender
9275  * mouse click gets past endgame screen
9276  *
9277  * Revision 1.15  1995/10/12  17:40:12  allender
9278  * read config file after digi initialized
9279  *
9280  * Revision 1.14  1995/10/05  10:38:22  allender
9281  * changed key_getch at exit to be key_inkey and moved
9282  * mouse init until after macintosh windowing init call
9283  *
9284  * Revision 1.13  1995/09/18  17:01:04  allender
9285  * put gr_init call before render buffer stuff
9286  *
9287  * Revision 1.12  1995/08/31  15:50:53  allender
9288  * call init for appletalk, and change name of intro screens
9289  *
9290  * Revision 1.11  1995/08/26  16:26:19  allender
9291  * whole bunch 'o stuff!!
9292  *
9293  * Revision 1.10  1995/07/12  21:48:18  allender
9294  * removed Int3 from beginning of program
9295  *
9296  * Revision 1.9  1995/07/05  16:45:48  allender
9297  * removed hide_cursor call
9298  *
9299  * Revision 1.8  1995/06/20  16:44:57  allender
9300  * game now renders in 640x480 at all times.  Changed code
9301  * to call game_init_render_buffers with right params
9302  *
9303  * Revision 1.7  1995/06/13  13:07:55  allender
9304  * change macintosh initialzation.  Mac windows now init'ed through gr_init.
9305  *
9306  * Revision 1.6  1995/06/08  16:36:53  allender
9307  * "ifdef" profile include
9308  *
9309  * Revision 1.5  1995/06/07  08:08:18  allender
9310  * dont' make memory info show at end of program
9311  *
9312  * Revision 1.4  1995/06/02  07:47:40  allender
9313  * removed network initialzation for now
9314  *
9315  * Revision 1.3  1995/05/26  06:54:52  allender
9316  * put digi_init after timer and key stuff since I was testing stuff
9317  * that needed the keyboard handler installed
9318  *
9319  * Revision 1.2  1995/05/19  11:28:09  allender
9320  * removed printf
9321  *
9322  * Revision 1.1  1995/05/16  15:26:39  allender
9323  * Initial revision
9324  *
9325  * Revision 2.36  1996/01/05  16:52:16  john
9326  * Improved 3d stuff.
9327  *
9328  * Revision 2.35  1995/10/07  13:20:06  john
9329  * Added new modes for LCDBIOS, also added support for -JoyNice,
9330  * and added Shift+F1-F4 to controls various stereoscopic params.
9331  *
9332  * Revision 2.34  1995/06/26  11:30:57  john
9333  * Made registration/copyright screen go away after 5 minutes.
9334  *
9335  * Revision 2.33  1995/05/31  14:26:55  unknown
9336  * Fixed ugly spacing.
9337  *
9338  * Revision 2.32  1995/05/26  16:15:28  john
9339  * Split SATURN into define's for requiring cd, using cd, etc.
9340  * Also started adding all the Rockwell stuff.
9341  *
9342  * Revision 2.31  1995/05/11  13:30:01  john
9343  * Changed 3dbios detection to work like Didde Kim wanted it to.
9344  *
9345  * Revision 2.30  1995/05/08  13:53:50  john
9346  * Added code to read vipport environemnt variable.
9347  *
9348  * Revision 2.29  1995/05/08  11:26:18  john
9349  * Reversed eyes in 3dmax mode.
9350  *
9351  * Revision 2.28  1995/05/08  11:24:06  john
9352  * Made 3dmax work like Kasan wants it to.
9353  *
9354  * Revision 2.27  1995/04/23  16:06:25  john
9355  * Moved rinvul into modem/null modem menu.
9356  *
9357  * Revision 2.26  1995/04/12  13:39:26  john
9358  * Fixed bug with -lowmem not working.
9359  *
9360  * Revision 2.25  1995/04/09  14:43:00  john
9361  * Made Dynamic sockets not print Msockets for help.
9362  *
9363  * Revision 2.24  1995/04/07  16:11:33  john
9364  * Fixed problem with VFX display when using setup.
9365  *
9366  * Revision 2.23  1995/04/06  15:40:51  john
9367  * Synced VFX with setup #'s.
9368  *
9369  * Revision 2.22  1995/04/06  12:12:53  john
9370  * Fixed some bugs with 3dmax.
9371  *
9372  * Revision 2.21  1995/03/30  16:36:51  mike
9373  * text localization.
9374  *
9375  * Revision 2.20  1995/03/29  15:33:52  john
9376  * Added code to parse descent.net file.
9377  *
9378  * Revision 2.19  1995/03/28  20:08:21  john
9379  * Took away alternate server thing.
9380  *
9381  * Revision 2.18  1995/03/27  09:43:08  john
9382  * Added VR Settings in config file.
9383  *
9384  * Revision 2.17  1995/03/23  19:02:21  john
9385  * Added descent.net file use.
9386  *
9387  * Revision 2.16  1995/03/23  12:25:11  john
9388  * Moved IPX stuff into BIOS lib.
9389  *
9390  * Revision 2.15  1995/03/21  16:52:34  john
9391  * Added 320x100.
9392  *
9393  * Revision 2.14  1995/03/21  14:40:33  john
9394  * Ifdef'd out the NETWORK code.
9395  *
9396  * Revision 2.13  1995/03/16  23:13:35  john
9397  * Fixed bug with piggy paging in bitmap not checking for disk
9398  * error, hence bogifying textures if you pull the CD out.
9399  *
9400  * Revision 2.12  1995/03/16  21:45:22  john
9401  * Made all paged modes have incompatible menus!
9402  *
9403  * Revision 2.11  1995/03/15  15:19:34  john
9404  * Took out code that changes to exe dir.
9405  *
9406  * Revision 2.10  1995/03/15  14:33:37  john
9407  * Added code to force the Descent CD-rom in the drive.
9408  *
9409  * Revision 2.9  1995/03/15  11:41:27  john
9410  * Better Saturn CD-ROM support.
9411  *
9412  * Revision 2.8  1995/03/14  18:24:46  john
9413  * Force Destination Saturn to use CD-ROM drive.
9414  *
9415  * Revision 2.7  1995/03/14  16:22:35  john
9416  * Added cdrom alternate directory stuff.
9417  *
9418  * Revision 2.6  1995/03/13  15:17:19  john
9419  * Added alternate hogfile directory.
9420  *
9421  * Revision 2.5  1995/03/10  13:05:35  john
9422  * Added code so that palette is correct for VFX1 helmets.
9423  *
9424  * Revision 2.4  1995/03/07  15:12:43  john
9425  * Fixed VFX,3dmax support.
9426  *
9427  * Revision 2.3  1995/03/07  14:19:35  mike
9428  * More destination saturn stuff.
9429  *
9430  * Revision 2.2  1995/03/06  16:47:34  mike
9431  * destination saturn
9432  *
9433  * Revision 2.1  1995/03/06  15:24:06  john
9434  * New screen techniques.
9435  *
9436  * Revision 2.0  1995/02/27  11:31:29  john
9437  * New version 2.0, which has no anonymous unions, builds with
9438  * Watcom 10.0, and doesn't require parsing BITMAPS.TBL.
9439  *
9440  * Revision 1.295  1995/02/23  12:02:14  john
9441  * Made mono  windows smaller.
9442  *
9443  * Revision 1.294  1995/02/16  17:35:00  john
9444  * Added code to allow dynamic socket changing.
9445  *
9446  * Revision 1.293  1995/02/14  19:29:29  john
9447  * Locked down critical error handler.
9448  *
9449  * Revision 1.292  1995/02/14  15:29:20  john
9450  * Added CR-LF to last line of menu help text.
9451  *
9452  * Revision 1.291  1995/02/14  11:39:01  john
9453  * Added polled/bios joystick readers.
9454  *
9455  * Revision 1.290  1995/02/13  20:35:03  john
9456  * Lintized
9457  *
9458  * Revision 1.289  1995/02/11  16:20:02  john
9459  * Added code to make the default mission be the one last played.
9460  *
9461  * Revision 1.288  1995/02/11  15:54:13  rob
9462  * changed cinvul to rinvul.
9463  *
9464  * Revision 1.287  1995/02/11  14:48:43  rob
9465  * Added max of 314 seconds to control invul. times
9466  *
9467  * Revision 1.286  1995/02/11  12:42:01  john
9468  * Added new song method, with FM bank switching..
9469  *
9470  * Revision 1.285  1995/02/11  11:36:11  rob
9471  * Added cinvul option.
9472  *
9473  * Revision 1.284  1995/02/10  16:07:45  matt
9474  * Took 'registered' out of printed info at startup
9475  *
9476  * Revision 1.283  1995/02/09  22:00:59  john
9477  * Added i-glasses tracking.
9478  *
9479  * Revision 1.282  1995/02/02  11:11:27  john
9480  * Added -nocyberman switch.
9481  *
9482  * Revision 1.281  1995/02/01  16:35:14  john
9483  * Linted.
9484  *
9485  * Revision 1.280  1995/01/31  02:04:25  matt
9486  * Fixed up cmdline help
9487  *
9488  * Revision 1.279  1995/01/30  16:25:55  john
9489  * Put back in graphical screen at program end.
9490  *
9491  * Revision 1.278  1995/01/28  17:05:50  matt
9492  * Changed imbedded copyright to use comma instead of hyphen
9493  *
9494  * Revision 1.277  1995/01/28  15:57:26  john
9495  * Made joystick calibration be only when wrong detected in
9496  * menu or joystick axis changed.
9497  *
9498  * Revision 1.276  1995/01/25  14:37:49  john
9499  * Made joystick only prompt for calibration once...
9500  *
9501  * Revision 1.275  1995/01/24  18:21:00  john
9502  * Added Adam's text warning.
9503  *
9504  * Revision 1.274  1995/01/22  15:57:20  john
9505  * Took out code that printed warning out as game exited.
9506  *
9507  * Revision 1.273  1995/01/22  13:31:35  matt
9508  * Added load of mission 0, so there's always a default mission
9509  *
9510  * Revision 1.272  1995/01/19  17:00:41  john
9511  * Made save game work between levels.
9512  *
9513  * Revision 1.271  1995/01/18  11:47:57  adam
9514  * changed copyright notice
9515  *
9516  * Revision 1.270  1995/01/15  13:42:42  john
9517  * Moved low_mem cutoff higher.
9518  *
9519  * Revision 1.269  1995/01/12  18:53:50  john
9520  * Put ifdef EDITOR around the code that checked for
9521  * a 800x600 mode, because this trashed some people's
9522  * computers (maybe) causing the mem allocation error in
9523  * mouse.c that many users reported.
9524  *
9525  * Revision 1.268  1995/01/12  11:41:42  john
9526  * Added external control reading.
9527  *
9528  * Revision 1.267  1995/01/06  10:26:55  john
9529  * Added -nodoscheck command line switch.
9530  *
9531  * Revision 1.266  1995/01/05  16:59:30  yuan
9532  * Don't show orderform in editor version.
9533  *
9534  * Revision 1.265  1994/12/28  15:33:51  john
9535  * Added -slowjoy option.
9536  *
9537  * Revision 1.264  1994/12/15  16:44:15  matt
9538  * Added trademark notice
9539  *
9540  * Revision 1.263  1994/12/14  20:13:59  john
9541  * Reduced physical mem requments to 2 MB.
9542  *
9543  * Revision 1.262  1994/12/14  19:06:17  john
9544  * Lowered physical memory requments to 2 MB.
9545  *
9546  * Revision 1.261  1994/12/14  09:41:29  allender
9547  * change to drive and directory (if needed) of command line invocation
9548  * so descent can be started from anywhere
9549  *
9550  * Revision 1.260  1994/12/13  19:08:59  john
9551  * Updated memory requirements.
9552  *
9553  * Revision 1.259  1994/12/13  17:30:33  john
9554  * Made the timer rate be changed right after initializing it.
9555  *
9556  * Revision 1.258  1994/12/13  02:46:25  matt
9557  * Added imbedded copyright
9558  *
9559  * Revision 1.257  1994/12/13  02:06:46  john
9560  * Added code to check stack used by descent... initial
9561  * check showed stack used 35k/50k, so we decided it wasn't
9562  * worth pursuing any more.
9563  *
9564  * Revision 1.256  1994/12/11  23:17:54  john
9565  * Added -nomusic.
9566  * Added RealFrameTime.
9567  * Put in a pause when sound initialization error.
9568  * Made controlcen countdown and framerate use RealFrameTime.
9569  *
9570  * Revision 1.255  1994/12/10  00:56:51  matt
9571  * Added -nomusic to command-line help
9572  *
9573  * Revision 1.254  1994/12/08  11:55:11  john
9574  * Took out low memory print.
9575  *
9576  * Revision 1.253  1994/12/08  11:51:00  john
9577  * Made strcpy only copy corect number of chars,.
9578  *
9579  * Revision 1.252  1994/12/08  00:38:29  matt
9580  * Cleaned up banner messages
9581  *
9582  * Revision 1.251  1994/12/07  19:14:52  matt
9583  * Cleaned up command-line options and command-line help message
9584  *
9585  * Revision 1.250  1994/12/06  19:33:28  john
9586  * Fixed text of message to make more sense.
9587  *
9588  * Revision 1.249  1994/12/06  16:30:55  john
9589  * Neatend mem message,..
9590  *
9591  * Revision 1.248  1994/12/06  16:17:35  john
9592  * Added better mem checking/printing.
9593  *
9594  * Revision 1.247  1994/12/06  14:14:37  john
9595  * Added code to set low mem based on memory.
9596  *
9597  * Revision 1.246  1994/12/05  12:29:09  allender
9598  * removed ifdefs around -norun option
9599  *
9600  * Revision 1.245  1994/12/05  00:03:30  matt
9601  * Added -norun option to exit after writing pig
9602  *
9603  * Revision 1.244  1994/12/04  14:47:01  john
9604  * MAde the intro and menu be the same song.
9605  *
9606  * Revision 1.243  1994/12/04  14:36:42  john
9607  * Added menu music.
9608  *
9609  * Revision 1.242  1994/12/02  13:50:17  yuan
9610  * Localization.
9611  *
9612  * Revision 1.241  1994/12/01  17:28:30  adam
9613  * added end-shareware stuff
9614  *
9615  * Revision 1.240  1994/11/30  12:10:57  adam
9616  * added support for PCX titles/brief screens
9617  *
9618  * Revision 1.239  1994/11/29  15:47:33  matt
9619  * Moved error_init to start of game, so error message prints last
9620  *
9621  * Revision 1.238  1994/11/29  14:19:22  jasen
9622  * reduced dos mem requirments.
9623  *
9624  * Revision 1.237  1994/11/29  03:46:35  john
9625  * Added joystick sensitivity; Added sound channels to detail menu.  Removed -maxchannels
9626  * command line arg.
9627  *
9628  * Revision 1.236  1994/11/29  02:50:18  john
9629  * Increased the amount a joystick has to be off before
9630  * asking if they want to recalibrate their joystick.
9631  *
9632  * Revision 1.235  1994/11/29  02:01:29  john
9633  * Corrected some of the Descent command line help items.
9634  *
9635  * Revision 1.234  1994/11/29  01:39:56  john
9636  * Fixed minor bug with vfx_light help not wrapping correctly.
9637  *
9638  * Revision 1.233  1994/11/28  21:34:17  john
9639  * Reduced dos mem rqment to 70k.
9640  *
9641  * Revision 1.232  1994/11/28  21:20:38  john
9642  * First version with memory checking.
9643  *
9644  * Revision 1.231  1994/11/28  20:06:21  rob
9645  * Removed old serial param command line options.
9646  * Added -noserial and -nonetwork to help listing.
9647  *
9648  * Revision 1.230  1994/11/27  23:15:24  matt
9649  * Made changes for new mprintf calling convention
9650  *
9651  * Revision 1.229  1994/11/27  20:50:51  matt
9652  * Don't set mem stuff if no debug
9653  *
9654  * Revision 1.228  1994/11/27  18:46:21  matt
9655  * Cleaned up command-line switches a little
9656  *
9657  * Revision 1.227  1994/11/21  17:48:00  matt
9658  * Added text to specifiy whether shareware or registered version
9659  *
9660  * Revision 1.226  1994/11/21  14:44:20  john
9661  * Fixed some bugs with setting volumes even when -nosound was used. Duh!
9662  *
9663  * Revision 1.225  1994/11/21  13:53:42  matt
9664  * Took out dos extender copyright
9665  *
9666  * Revision 1.224  1994/11/21  09:46:54  john
9667  * Added -showmeminfo parameter.
9668  *
9669  * Revision 1.223  1994/11/20  22:12:05  mike
9670  * Make some stuff dependent on SHAREWARE.
9671  *
9672  * Revision 1.222  1994/11/20  21:14:09  john
9673  * Changed -serial to -noserial.  MAde a 1 sec delay
9674  * before leaving title screen.  Clear keyboard buffer
9675  * before asking for player name.
9676  *
9677  * Revision 1.221  1994/11/19  15:20:20  mike
9678  * rip out unused code and data
9679  *
9680  * Revision 1.220  1994/11/17  19:14:29  adam
9681  * prevented order screen from coming up when -notitles is used
9682  *
9683  * Revision 1.219  1994/11/16  11:34:39  john
9684  * Added -nottitle switch.
9685  *
9686  * Revision 1.218  1994/11/16  10:05:53  john
9687  * Added verbose messages.
9688  *
9689  * Revision 1.217  1994/11/15  20:12:34  john
9690  * Added back in inferno and parallax screens.
9691  *
9692  * Revision 1.216  1994/11/15  18:35:30  john
9693  * Added verbose setting.
9694  *
9695  * Revision 1.215  1994/11/15  17:47:44  john
9696  * Added ordering info screen.
9697  *
9698  * Revision 1.214  1994/11/15  08:57:44  john
9699  * Added MS-DOS version checking and -nonetwork option.
9700  *
9701  * Revision 1.213  1994/11/15  08:34:32  john
9702  * Added better error messages for IPX init.
9703  *
9704  * Revision 1.212  1994/11/14  20:14:18  john
9705  * Fixed some warnings.
9706  *
9707  * Revision 1.211  1994/11/14  19:50:49  john
9708  * Added joystick cal values to descent.cfg.
9709  *
9710  * Revision 1.210  1994/11/14  17:56:44  allender
9711  * make call to ReadConfigFile at startup
9712  *
9713  * Revision 1.209  1994/11/14  11:41:55  john
9714  * Fixed bug with editor/game sequencing.
9715  *
9716  * Revision 1.208  1994/11/13  17:05:11  john
9717  * Made the callsign entry be a list box and gave the ability
9718  * to delete players.
9719  *
9720  * Revision 1.207  1994/11/13  15:39:22  john
9721  * Added critical error handler to game.  Took out -editor command line
9722  * option because it didn't work anymore and wasn't worth fixing.  Made scores
9723  * not use MINER enviroment variable on release version, and made scores
9724  * not print an error if there is no descent.hi.
9725  *
9726  * Revision 1.206  1994/11/10  20:53:29  john
9727  * Used new sound install parameters.
9728  *
9729  * Revision 1.205  1994/11/10  11:07:52  mike
9730  * Set default detail level.
9731  *
9732  * Revision 1.204  1994/11/09  13:45:43  matt
9733  * Made -? work again for help
9734  *
9735  * Revision 1.203  1994/11/09  10:55:58  matt
9736  * Cleaned up initialization for editor -> game transitions
9737  *
9738  * Revision 1.202  1994/11/07  21:35:47  matt
9739  * Use new function iff_read_into_bitmap()
9740  *
9741  * Revision 1.201  1994/11/05  17:22:16  john
9742  * Fixed lots of sequencing problems with newdemo stuff.
9743  *
9744  * Revision 1.200  1994/11/05  14:05:44  john
9745  * Fixed fade transitions between all screens by making
9746  * gr_palette_fade_in and out keep track of whether the palette is
9747  * faded in or not.  Then, wherever the code needs to fade out, it
9748  * just calls gr_palette_fade_out and it will fade out if it isn't
9749  * already.  The same with fade_in.
9750  * This eliminates the need for all the flags like Menu_fade_out,
9751  * game_fade_in palette, etc.
9752  *
9753  * Revision 1.199  1994/11/04  14:36:30  allender
9754  * change Auto_demo meaning to mean autostart from menu only.  Use
9755  * FindArgs when searching for AutoDemo from command line.  also,
9756  * set N_Players to 1 when starting in editor mode.
9757  *
9758  * Revision 1.198  1994/11/02  11:59:49  john
9759  * Moved menu out of game into inferno main loop.
9760  *
9761  * Revision 1.197  1994/11/01  17:57:39  mike
9762  * -noscreens option to bypass all screens.
9763  *
9764  * Revision 1.196  1994/10/28  15:42:34  allender
9765  * don't register player if Autodemo is on
9766  *
9767  * Revision 1.195  1994/10/28  10:58:01  matt
9768  * Added copyright notice for DOS4GW
9769  *
9770  * Revision 1.194  1994/10/20  21:26:48  matt
9771  * Took out old serial name/number code, and put up message if this
9772  * is a marked version.
9773  *
9774  * Revision 1.193  1994/10/19  09:52:14  allender
9775  * Print out who descent.exe belongs to if descent.exe is stamped.
9776  *
9777  * Revision 1.192  1994/10/18  16:43:05  allender
9778  * Added check for identifier stamp and time after which descent will
9779  * no longer run.
9780  *
9781  * Revision 1.191  1994/10/17  13:07:17  john
9782  * Moved the descent.cfg info into the player config file.
9783  *
9784  * Revision 1.190  1994/10/04  10:26:31  matt
9785  * Support new menu fade in
9786  *
9787  * Revision 1.189  1994/10/03  22:58:46  matt
9788  * Changed some values of game_mode
9789  *
9790  * Revision 1.188  1994/10/03  18:55:39  rob
9791  * Changed defaults for com port settings.
9792  *
9793  * Revision 1.187  1994/10/03  13:34:47  matt
9794  * Added new (and hopefully better) game sequencing functions
9795  *
9796  * Revision 1.186  1994/09/30  12:37:28  john
9797  * Added midi,digi volume to configuration.
9798  *
9799  * Revision 1.185  1994/09/30  10:08:48  john
9800  * Changed sound stuff... made it so the reseting card doesn't hang,
9801  * made volume change only if sound is installed.
9802  *
9803  * Revision 1.184  1994/09/28  17:25:00  matt
9804  * Added first draft of game save/load system
9805  *
9806  * Revision 1.183  1994/09/28  16:18:23  john
9807  * Added capability to play midi song.
9808  *
9809  * Revision 1.182  1994/09/28  11:31:18  john
9810  * Made text output unbuffered.
9811  *
9812  * Revision 1.181  1994/09/27  19:23:44  john
9813  * Added -nojoystick and -nomouse
9814  *
9815  * Revision 1.180  1994/09/24  16:55:29  rob
9816  * No longer open COM port immediately upon program start.
9817  * No longer set Network_active is serial_active is set.
9818  *
9819  * Revision 1.179  1994/09/24  14:16:30  mike
9820  * Support new game mode constants.
9821  *
9822  * Revision 1.178  1994/09/22  17:52:31  rob
9823  * Added Findargs hooks for -serial, -speed, and -com.
9824  *
9825  * Revision 1.177  1994/09/22  16:14:11  john
9826  * Redid intro sequecing.
9827  *
9828  * Revision 1.176  1994/09/21  16:32:58  john
9829  * Made mouse and keyboard init after bm_init. Why?
9830  * Because it seems to work better under virtual
9831  * memory.
9832  *
9833  * Revision 1.175  1994/09/21  16:27:52  john
9834  * Added mouse_init
9835  *
9836  * Revision 1.174  1994/09/20  15:14:10  matt
9837  * New message for new VFX switches
9838  *
9839  * Revision 1.173  1994/09/16  16:14:27  john
9840  * Added acrade sequencing.
9841  *
9842  * Revision 1.172  1994/09/16  11:49:52  john
9843  * Added first version of arcade joystick support;
9844  * Also fixed some bugs in kconfig.c, such as reading non-present
9845  * joysticks, which killed frame rate, and not reading key_down_time
9846  * when in slide mode or bank mode.
9847  *
9848  * Revision 1.171  1994/09/15  16:11:35  john
9849  * Added support for VFX1 head tracking. Fixed bug with memory over-
9850  * write when using stereo mode.
9851  *
9852  * Revision 1.170  1994/09/12  19:38:23  john
9853  * Made some stuff that prints to the DOS screen go to the
9854  * mono instead, since it really is debugging info.
9855  *
9856  * Revision 1.169  1994/08/29  21:18:28  john
9857  * First version of new keyboard/oystick remapping stuff.
9858  *
9859  * Revision 1.168  1994/08/26  13:02:00  john
9860  * Put high score system in.
9861  *
9862  * Revision 1.167  1994/08/24  19:00:23  john
9863  * Changed key_down_time to return fixed seconds instead of
9864  * milliseconds.
9865  *
9866  * Revision 1.166  1994/08/18  16:24:20  john
9867  * changed socket to channel in text.
9868  *
9869  * Revision 1.165  1994/08/18  16:16:51  john
9870  * Added support for different sockets.
9871  *
9872  * Revision 1.164  1994/08/18  10:47:53  john
9873  * *** empty log message ***
9874  *
9875  * Revision 1.163  1994/08/12  09:15:54  john
9876  * *** empty log message ***
9877  *
9878  * Revision 1.162  1994/08/12  03:11:19  john
9879  * Made network be default off; Moved network options into
9880  * main menu.  Made starting net game check that mines are the
9881  * same.
9882  *
9883  * Revision 1.161  1994/08/10  19:57:05  john
9884  * Changed font stuff; Took out old menu; messed up lots of
9885  * other stuff like game sequencing messages, etc.
9886  *
9887  * Revision 1.160  1994/08/05  16:30:23  john
9888  * Added capability to turn off network.
9889  *
9890  * Revision 1.159  1994/08/04  19:42:51  matt
9891  * Moved serial number & name (and version name) from inferno.c to inferno.ini
9892  *
9893  * Revision 1.158  1994/08/03  10:30:23  matt
9894  * Change cybermaxx switches, updated command-line help, and added serial number system
9895  *
9896  * Revision 1.157  1994/07/29  18:30:10  matt
9897  * New parms (lack of parms, actually) for g3_init()
9898  *
9899  * Revision 1.156  1994/07/24  00:39:25  matt
9900  * Added more text to TEX file; make NewGame() take a start level; made game
9901  * load/save menus use open/close window funcs.
9902  *
9903  * Revision 1.155  1994/07/21  21:31:27  john
9904  * First cheapo version of VictorMaxx tracking.
9905  *
9906  * Revision 1.154  1994/07/21  18:15:34  matt
9907  * Ripped out a bunch of unused stuff
9908  *
9909  * Revision 1.153  1994/07/21  17:59:10  matt
9910  * Cleaned up initial mode game/editor code
9911  *
9912  * Revision 1.152  1994/07/21  13:11:19  matt
9913  * Ripped out remants of old demo system, and added demo only system that
9914  * disables object movement and game options from menu.
9915  *
9916  * Revision 1.151  1994/07/20  15:58:27  john
9917  * First installment of ipx stuff.
9918  *
9919  * Revision 1.150  1994/07/15  16:04:24  matt
9920  * Changed comment for milestone 3 version
9921  *
9922  * Revision 1.149  1994/07/15  13:59:24  matt
9923  * Fixed stupid mistake I make in the last revision
9924  *
9925  * Revision 1.148  1994/07/15  13:20:15  matt
9926  * Updated comand-line help
9927  *
9928  * Revision 1.147  1994/07/14  23:29:43  matt
9929  * Open two mono debug messages, one for errors & one for spew
9930  *
9931  * Revision 1.146  1994/07/09  22:48:05  matt
9932  * Added localizable text
9933  *
9934  * Revision 1.145  1994/07/02  13:49:47  matt
9935  * Cleaned up includes
9936  *
9937  * Revision 1.144  1994/06/30  20:04:43  john
9938  * Added -joydef support.
9939  *
9940  * Revision 1.143  1994/06/24  17:01:44  john
9941  * Add VFX support; Took Game Sequencing, like EndGame and stuff and
9942  * took it out of game.c and into gameseq.c
9943
9944 ------------------------------------------------------------------------
9945 main/joydefs.c:
9946
9947  * Revision 1.10  1995/10/18  22:21:21  allender
9948  * fixed bug with gravis mousestick and call key_flush when
9949  * calibrating joystick since it used keystrokes for the trigger
9950  * (at least most of them do)
9951  *
9952  * Revision 1.9  1995/10/17  13:12:32  allender
9953  * fixed up controller support for mac world
9954  *
9955  * Revision 1.8  1995/10/15  19:27:04  allender
9956  * new Dave Denhart controller code
9957  *
9958  * Revision 1.7  1995/10/15  16:14:59  allender
9959  * fixed axis value for Thrustmaster rudders
9960  *
9961  * Revision 1.6  1995/09/13  11:39:39  allender
9962  * made joystick cal menu all text so buttons will work properly
9963  *
9964  * Revision 1.5  1995/09/01  13:13:13  allender
9965  * added close box on controls menu
9966  *
9967  * Revision 1.4  1995/08/18  10:22:47  allender
9968  * if thrustmaster choosen, set joystick at thrustmaster type
9969  * for proper reading in joyc.c
9970  *
9971  * Revision 1.3  1995/07/26  17:00:34  allender
9972  * put back in code to make joysticks work
9973  *
9974  * Revision 1.2  1995/07/17  08:52:21  allender
9975  * put back in code that was taken out previously
9976  *
9977  * Revision 1.1  1995/05/16  15:26:48  allender
9978  * Initial revision
9979  *
9980  * Revision 2.2  1995/06/30  12:30:22  john
9981  * Added -Xname command line.
9982  *
9983  * Revision 2.1  1995/04/06  12:13:20  john
9984  * Made so you can calibrate Gravis Gamepad.
9985  *
9986  * Revision 2.0  1995/02/27  11:30:27  john
9987  * New version 2.0, which has no anonymous unions, builds with
9988  * Watcom 10.0, and doesn't require parsing BITMAPS.TBL.
9989  *
9990  * Revision 1.71  1995/02/12  02:06:10  john
9991  * Fixed bug with joystick incorrectly asking for
9992  * calibration.
9993  *
9994  * Revision 1.70  1995/01/28  15:58:07  john
9995  * Made joystick calibration be only when wrong detected in
9996  * menu or joystick axis changed.
9997  *
9998  * Revision 1.69  1995/01/25  14:37:55  john
9999  * Made joystick only prompt for calibration once...
10000  *
10001  * Revision 1.68  1995/01/24  16:34:29  john
10002  * Made so that if you reconfigure joystick and
10003  * add or subtract an axis, it asks for a recalibration
10004  * upon leaving.
10005  *
10006  * Revision 1.67  1994/12/29  11:08:51  john
10007  * Fixed Thrustmaster and Logitech Wingman extreme
10008  * Hat by reading the y2 axis during the center stage
10009  * of the calibration, and using 75, 50, 27, and 3 %
10010  * as values for the 4 positions.
10011  *
10012  * Revision 1.66  1994/12/15  18:17:39  john
10013  * Fixed warning with previous.
10014  *
10015  * Revision 1.65  1994/12/15  18:15:48  john
10016  * Made the joy cal only write the .cfg file, not
10017  * the player file.
10018  *
10019  * Revision 1.64  1994/12/13  14:43:35  john
10020  * Took out the code in kconfig to build direction array.
10021  * Called kc_set_controls after selecting a new control type.
10022  *
10023  * Revision 1.63  1994/12/10  12:08:47  john
10024  * Changed some delays to use TICKER instead of timer_get_fixed_seconds.
10025  *
10026  * Revision 1.62  1994/12/09  11:01:07  mike
10027  * force calibration of joystick on joystick selection from Controls... menu.
10028  *
10029  * Revision 1.61  1994/12/07  21:50:27  john
10030  * Put stop/start time around joystick delay.
10031  *
10032  * Revision 1.60  1994/12/07  19:34:39  john
10033  * Added delay.
10034  *
10035  * Revision 1.59  1994/12/07  18:12:14  john
10036  * NEatened up joy cal.,
10037  *
10038  * Revision 1.58  1994/12/07  17:07:51  john
10039  * Fixed up joy cal.
10040  *
10041  * Revision 1.57  1994/12/07  16:48:53  yuan
10042  * localization
10043  *
10044  * Revision 1.56  1994/12/07  16:05:55  john
10045  * Changed the way joystick calibration works.
10046  *
10047  * Revision 1.55  1994/12/06  20:15:22  john
10048  * Took out code that unpauses songs that were never paused.
10049  *
10050  * Revision 1.54  1994/12/06  15:14:09  yuan
10051  * Localization
10052  *
10053  * Revision 1.53  1994/12/05  16:29:16  john
10054  * Took out music pause around the cheat menu.
10055  *
10056  * Revision 1.52  1994/12/04  12:39:10  john
10057  * MAde so that FCS calibration doesn't ask for axis #2.
10058  *
10059  * Revision 1.51  1994/12/03  15:14:59  john
10060  * Took out the delay mentioned previosuly cause it would
10061  * cause bigger problems than it helps, especially with netgames.
10062  *
10063  * Revision 1.50  1994/12/03  14:16:14  john
10064  * Put a delay between screens in joy cal to keep Yuan from
10065  * double hitting.
10066  *
10067  * Revision 1.49  1994/12/03  11:04:06  john
10068  * Changed newmenu code a bit to fix bug with bogus
10069  * backgrounds occcasionally.
10070  *
10071  * Revision 1.48  1994/12/02  11:03:44  yuan
10072  * Localization.
10073  *
10074  * Revision 1.47  1994/12/02  10:50:33  yuan
10075  * Localization
10076  *
10077  * Revision 1.46  1994/12/01  12:21:59  john
10078  * Added code to calibrate 2 joysticks separately.
10079  *
10080  * Revision 1.45  1994/12/01  11:52:31  john
10081  * Added message when you select FCS to say that if
10082  * you have WCS, see manuel.
10083  *
10084  * Revision 1.44  1994/11/29  02:26:28  john
10085  * Made the prompts for upper-left, lower right for joy
10086  * calibration more obvious.
10087  *
10088  * Revision 1.43  1994/11/26  13:13:59  matt
10089  * Changed "none" option to "keyboard only"
10090  *
10091  * Revision 1.42  1994/11/21  19:35:13  john
10092  * Replaced calls to joy_init with if (joy_present)
10093  *
10094  * Revision 1.41  1994/11/21  19:28:34  john
10095  * Changed warning for no joystick to use nm_messagebox..
10096  *
10097  * Revision 1.40  1994/11/21  19:06:25  john
10098  * Made it so that it only stops sound when your in game mode.
10099  *
10100  * Revision 1.39  1994/11/21  11:47:18  john
10101  * Made sound pause during joystick calibration.
10102  *
10103  * Revision 1.38  1994/11/10  20:34:18  rob
10104  * Removed menu-specific network mode support in favor in new stuff
10105  * in newmenu.c
10106  *
10107  * Revision 1.37  1994/11/08  21:21:38  john
10108  * Made Esc exit joystick calibration.
10109  *
10110  * Revision 1.36  1994/11/08  15:14:42  john
10111  * Added more calls so net doesn't die in net game.
10112  *
10113  * Revision 1.35  1994/11/08  14:59:12  john
10114  * Added code to respond to network while in menus.
10115  *
10116  * Revision 1.34  1994/10/24  19:56:32  john
10117  * Made the new user setup prompt for config options.
10118  *
10119  * Revision 1.33  1994/10/22  14:11:52  mike
10120  * Suppress compiler warning message.
10121  *
10122  * Revision 1.32  1994/10/19  12:44:24  john
10123  * Added hours field to player structure.
10124  *
10125  * Revision 1.31  1994/10/17  13:07:13  john
10126  * Moved the descent.cfg info into the player config file.
10127  *
10128  * Revision 1.30  1994/10/13  21:41:12  john
10129  * MAde Esc exit out of joystick calibration.
10130  *
10131  * Revision 1.29  1994/10/13  19:22:27  john
10132  * Added separate config saves for different devices.
10133  * Made all the devices work together better, such as mice won't
10134  * get read when you're playing with the joystick.
10135  *
10136  * Revision 1.28  1994/10/13  11:40:18  john
10137  * Took out warnings.
10138  *
10139  * Revision 1.27  1994/10/13  11:35:23  john
10140  * Made Thrustmaster FCS Hat work.  Put a background behind the
10141  * keyboard configure.  Took out turn_sensitivity.  Changed sound/config
10142  * menu to new menu. Made F6 be calibrate joystick.
10143  *
10144  * Revision 1.26  1994/10/11  21:29:03  matt
10145  * Made a bunch of menus have good initial selected values
10146  *
10147  * Revision 1.25  1994/10/11  17:08:39  john
10148  * Added sliders for volume controls.
10149  *
10150  * Revision 1.24  1994/10/10  17:59:21  john
10151  * Neatend previous.
10152  *
10153  * Revision 1.23  1994/10/10  17:57:59  john
10154  * Neatend previous.
10155  *
10156  * Revision 1.22  1994/10/10  17:56:11  john
10157  * Added messagebox that tells that config has been saved.
10158  *
10159  * Revision 1.21  1994/09/30  12:37:26  john
10160  * Added midi,digi volume to configuration.
10161  *
10162  * Revision 1.20  1994/09/22  16:14:14  john
10163  * Redid intro sequecing.
10164  *
10165  * Revision 1.19  1994/09/19  18:50:15  john
10166  * Added switch to disable joystick.
10167  *
10168  * Revision 1.18  1994/09/12  11:47:36  john
10169  * Made stupid cruise work better.  Make kconfig values get
10170  * read/written to disk.
10171  *
10172  * Revision 1.17  1994/09/10  15:46:47  john
10173  * First version of new keyboard configuration.
10174  *
10175  * Revision 1.16  1994/09/06  19:35:44  john
10176  * Fixed bug that didn';t load new size .cal file.
10177  *
10178  * Revision 1.15  1994/09/06  14:51:58  john
10179  * Added sensitivity adjustment, fixed bug with joystick button not
10180  * staying down.
10181  *
10182  * Revision 1.14  1994/09/02  16:13:47  john
10183  * Made keys fill in position.
10184  *
10185  * Revision 1.13  1994/08/31  17:58:50  john
10186  * Made a bit simpler.
10187  *
10188  * Revision 1.12  1994/08/31  14:17:54  john
10189  * *** empty log message ***
10190  *
10191  * Revision 1.11  1994/08/31  14:10:56  john
10192  * Made keys not work when KEY_DELETE pressed.
10193  *
10194  * Revision 1.10  1994/08/31  13:40:47  mike
10195  * Change constant
10196  *
10197  * Revision 1.9  1994/08/31  12:56:27  john
10198  * *** empty log message ***
10199  *
10200  * Revision 1.8  1994/08/30  20:38:29  john
10201  * Add more config stuff..
10202  *
10203  * Revision 1.7  1994/08/30  16:37:25  john
10204  * Added menu options to set controls.
10205  *
10206  * Revision 1.6  1994/08/30  09:27:18  john
10207  * *** empty log message ***
10208  *
10209  * Revision 1.5  1994/08/30  09:12:01  john
10210  * *** empty log message ***
10211  *
10212  * Revision 1.4  1994/08/29  21:18:32  john
10213  * First version of new keyboard/oystick remapping stuff.
10214  *
10215  * Revision 1.3  1994/08/24  19:00:29  john
10216  * Changed key_down_time to return fixed seconds instead of
10217  * milliseconds.
10218  *
10219  * Revision 1.2  1994/08/17  16:50:37  john
10220  * Added damaging fireballs, missiles.
10221  *
10222  * Revision 1.1  1994/08/17  10:07:12  john
10223  * Initial revision
10224
10225 ------------------------------------------------------------------------
10226 main/joydefs.h:
10227
10228  * Revision 2.0  1995/02/27  11:32:12  john
10229  * New version 2.0, which has no anonymous unions, builds with
10230  * Watcom 10.0, and doesn't require parsing BITMAPS.TBL.
10231  *
10232  * Revision 1.12  1995/01/25  14:37:52  john
10233  * Made joystick only prompt for calibration once...
10234  *
10235  * Revision 1.11  1994/10/13  11:35:43  john
10236  * Made Thrustmaster FCS Hat work.  Put a background behind the
10237  * keyboard configure.  Took out turn_sensitivity.  Changed sound/config
10238  * menu to new menu. Made F6 be calibrate joystick.
10239  *
10240  * Revision 1.10  1994/09/10  15:46:49  john
10241  * First version of new keyboard configuration.
10242  *
10243  * Revision 1.9  1994/09/06  14:51:29  john
10244  * Added sensitivity adjustment, fixed bug with joystick button not
10245  * staying down.
10246  *
10247  * Revision 1.8  1994/08/31  12:56:29  john
10248  * *** empty log message ***
10249  *
10250  * Revision 1.7  1994/08/30  16:37:07  john
10251  * Added menu options to set controls.
10252  *
10253  * Revision 1.6  1994/08/29  21:18:33  john
10254  * First version of new keyboard/oystick remapping stuff.
10255  *
10256  * Revision 1.5  1994/08/24  19:00:30  john
10257  * Changed key_down_time to return fixed seconds instead of
10258  * milliseconds.
10259  *
10260  * Revision 1.4  1994/08/17  16:50:04  john
10261  * Added damaging fireballs, missiles.
10262  *
10263  * Revision 1.3  1994/07/01  10:55:18  john
10264  * Added analog joystick throttle
10265  *
10266  * Revision 1.2  1994/06/30  20:04:46  john
10267  * Added -joydef support.
10268  *
10269  * Revision 1.1  1994/06/30  18:08:12  john
10270  * Initial revision
10271
10272 ------------------------------------------------------------------------
10273 main/kconfig.c:
10274
10275  * Revision 1.18  1995/10/29  20:14:10  allender
10276  * don't read mouse 30x/sec.  Still causes problems -- left with
10277  * exposure at > 60 frame/s
10278  *
10279  * Revision 1.17  1995/10/27  14:16:35  allender
10280  * don't set lastreadtime when doing mouse stuff if we didn't
10281  * read mouse this frame
10282  *
10283  * Revision 1.16  1995/10/24  18:10:22  allender
10284  * get mouse stuff working right this time?
10285  *
10286  * Revision 1.15  1995/10/23  14:50:50  allender
10287  * corrected values for control type in kc_set_controls
10288  *
10289  * Revision 1.14  1995/10/21  16:36:54  allender
10290  * fix up mouse read time
10291  *
10292  * Revision 1.13  1995/10/20  00:46:53  allender
10293  * fix up mouse reading problem
10294  *
10295  * Revision 1.12  1995/10/19  13:36:38  allender
10296  * mouse support in kconfig screens
10297  *
10298  * Revision 1.11  1995/10/18  21:06:06  allender
10299  * removed Int3 in cruise stuff -- was in there for debugging and
10300  * now not needed
10301  *
10302  * Revision 1.10  1995/10/17  13:12:47  allender
10303  * fixed config menus so buttons don't get configured
10304  *
10305  * Revision 1.9  1995/10/15  23:07:55  allender
10306  * added return key as second button for primary fire
10307  *
10308  * Revision 1.8  1995/09/05  08:49:47  allender
10309  * change 'PADRTN' label to 'ENTER'
10310  *
10311  * Revision 1.7  1995/09/01  15:38:22  allender
10312  * took out cap of reading controls max 25 times/sec
10313  *
10314  * Revision 1.6  1995/09/01  13:33:59  allender
10315  * erase all old text
10316  *
10317  * Revision 1.5  1995/08/18  10:20:55  allender
10318  * keep controls reading to 25 times/s max so fast
10319  * frame rates don't mess up control reading
10320  *
10321  * Revision 1.4  1995/07/28  15:43:13  allender
10322  * make mousebutton control primary fire
10323  *
10324  * Revision 1.3  1995/07/26  17:04:32  allender
10325  * new defaults and make joystick main button work correctly
10326  *
10327  * Revision 1.2  1995/07/17  08:51:03  allender
10328  * fixed up configuration menus to look right
10329  *
10330  * Revision 1.1  1995/05/16  15:26:56  allender
10331  * Initial revision
10332  *
10333  * Revision 2.11  1995/08/23  16:08:04  john
10334  * Added version 2 of external controls that passes the ship
10335  * position and orientation the drivers.
10336  *
10337  * Revision 2.10  1995/07/07  16:48:01  john
10338  * Fixed bug with new interface.
10339  *
10340  * Revision 2.9  1995/07/03  15:02:32  john
10341  * Added new version of external controls for Cybermouse absolute position.
10342  *
10343  * Revision 2.8  1995/06/30  12:30:28  john
10344  * Added -Xname command line.
10345  *
10346  * Revision 2.7  1995/03/30  16:36:56  mike
10347  * text localization.
10348  *
10349  * Revision 2.6  1995/03/21  14:39:31  john
10350  * Ifdef'd out the NETWORK code.
10351  *
10352  * Revision 2.5  1995/03/16  10:53:07  john
10353  * Move VFX center to Shift+Z instead of Enter because
10354  * it conflicted with toggling HUD on/off.
10355  *
10356  * Revision 2.4  1995/03/10  13:47:24  john
10357  * Added head tracking sensitivity.
10358  *
10359  * Revision 2.3  1995/03/09  18:07:06  john
10360  * Fixed bug with iglasses tracking not "centering" right.
10361  * Made VFX have bright headlight lighting.
10362  *
10363  * Revision 2.2  1995/03/08  15:32:39  john
10364  * Made VictorMaxx head tracking use Greenleaf code.
10365  *
10366  * Revision 2.1  1995/03/06  15:23:31  john
10367  * New screen techniques.
10368  *
10369  * Revision 2.0  1995/02/27  11:29:26  john
10370  * New version 2.0, which has no anonymous unions, builds with
10371  * Watcom 10.0, and doesn't require parsing BITMAPS.TBL.
10372  *
10373  * Revision 1.105  1995/02/22  14:11:58  allender
10374  * remove anonymous unions from object structure
10375  *
10376  * Revision 1.104  1995/02/13  12:01:56  john
10377  * Fixed bug with buggin not mmaking player faster.
10378  *
10379  * Revision 1.103  1995/02/09  22:00:46  john
10380  * Added i-glasses tracking.
10381  *
10382  * Revision 1.102  1995/01/24  21:25:47  john
10383  * Fixed bug with slide/bank on not working with
10384  * Cyberman heading.,
10385  *
10386  * Revision 1.101  1995/01/24  16:09:56  john
10387  * Fixed bug with Wingman extreme customize text overwriting title.
10388  *
10389  * Revision 1.100  1995/01/24  12:37:46  john
10390  * Made Esc exit key define menu.
10391  *
10392  * Revision 1.99  1995/01/23  23:54:43  matt
10393  * Made keypad enter work
10394  *
10395  * Revision 1.98  1995/01/23  16:42:00  john
10396  * Made the external controls always turn banking off, leveling off
10397  * and passed automap state thru to the tsr.
10398  *
10399  * Revision 1.97  1995/01/12  11:41:33  john
10400  * Added external control reading.
10401  *
10402  * Revision 1.96  1995/01/05  10:43:58  mike
10403  * Handle case when timer_get_fixed_seconds() goes negative.  Happens at 9.1
10404  * hours.  Previously, joystick would stop functioning.  Now will work.
10405  *
10406  * Revision 1.95  1994/12/29  11:17:38  john
10407  * Took out some warnings and mprintf.
10408  *
10409  * Revision 1.94  1994/12/29  11:07:41  john
10410  * Fixed Thrustmaster and Logitech Wingman extreme
10411  * Hat by reading the y2 axis during the center stage
10412  * of the calibration, and using 75, 50, 27, and 3 %
10413  * as values for the 4 positions.
10414  *
10415  * Revision 1.93  1994/12/27  12:16:20  john
10416  * Fixed bug with slide on not working with joystick or mouse buttons.
10417  *
10418  * Revision 1.92  1994/12/20  10:34:15  john
10419  * Made sensitivity work for mouse & joystick and made
10420  * it only affect, pitch, heading, and roll.
10421  *
10422  * Revision 1.91  1994/12/16  00:11:23  matt
10423  * Made delete key act normally when debug out
10424  *
10425  * Revision 1.90  1994/12/14  17:41:15  john
10426  * Added more buttons so that  Yoke would work.
10427  *
10428  * Revision 1.89  1994/12/13  17:25:35  allender
10429  * Added Assert for bogus time for joystick reading.
10430  *
10431  * Revision 1.88  1994/12/13  14:48:01  john
10432  * Took out some debugging mprintf's
10433  *
10434  *
10435  * Revision 1.87  1994/12/13  14:43:02  john
10436  * Took out the code in kconfig to build direction array.
10437  * Called kc_set_controls after selecting a new control type.
10438  *
10439  * Revision 1.86  1994/12/13  01:11:32  john
10440  * Fixed bug with message clearing overwriting
10441  * right border.
10442  *
10443  * Revision 1.85  1994/12/12  00:35:58  john
10444  * Added or thing for keys.
10445  *
10446  * Revision 1.84  1994/12/09  17:08:06  john
10447  * Made mouse a bit less sensitive.
10448  *
10449  * Revision 1.83  1994/12/09  16:04:00  john
10450  * Increased mouse sensitivity.
10451  *
10452  * Revision 1.82  1994/12/09  00:41:26  mike
10453  * fix hang in automap print screen
10454  *
10455  * Revision 1.81  1994/12/08  11:50:37  john
10456  * Made strcpy only copy corect number of chars,.
10457  *
10458  * Revision 1.80  1994/12/07  16:16:06  john
10459  * Added command to check to see if a joystick axes has been used.
10460  *
10461  * Revision 1.79  1994/12/07  14:52:28  yuan
10462  * Localization 492
10463  *
10464  * Revision 1.78  1994/12/07  13:37:40  john
10465  * Made the joystick thrust work in reverse.
10466  *
10467  * Revision 1.77  1994/12/07  11:28:24  matt
10468  * Did a little localization support
10469  *
10470  * Revision 1.76  1994/12/04  12:30:03  john
10471  * Made the Thrustmaster stick read every frame, not every 10 frames,
10472  * because it uses analog axis as buttons.
10473  *
10474  * Revision 1.75  1994/12/03  22:35:25  yuan
10475  * Localization 412
10476  *
10477  * Revision 1.74  1994/12/03  15:39:24  john
10478  * Made numeric keypad move in conifg.
10479  *
10480  * Revision 1.73  1994/12/01  16:23:39  john
10481  * Fixed include mistake.
10482  *
10483  * Revision 1.72  1994/12/01  16:07:57  john
10484  * Fixed bug that disabled joystick in automap because it used gametime, which is
10485  * paused during automap. Fixed be used timer_Get_fixed_seconds instead of GameTime.
10486  *
10487  * Revision 1.71  1994/12/01  12:30:49  john
10488  * Made Ctrl+D delete, not Ctrl+E
10489  *
10490  * Revision 1.70  1994/12/01  11:52:52  john
10491  * Added default values for GamePad.
10492  *
10493  * Revision 1.69  1994/11/30  00:59:12  mike
10494  * optimizations.
10495  *
10496  * Revision 1.68  1994/11/29  03:45:50  john
10497  * Added joystick sensitivity; Added sound channels to detail menu.  Removed -maxchannels
10498  * command line arg.
10499  *
10500  * Revision 1.67  1994/11/27  23:13:44  matt
10501  * Made changes for new mprintf calling convention
10502  *
10503  * Revision 1.66  1994/11/27  19:52:12  matt
10504  * Made screen shots work in a few more places
10505  *
10506  * Revision 1.65  1994/11/22  16:54:50  mike
10507  * autorepeat on missiles.
10508  *
10509  * Revision 1.64  1994/11/21  11:16:17  rob
10510  * Changed calls to GameLoop to calls to multi_menu_poll and changed
10511  * conditions under which they are called.
10512  *
10513  * Revision 1.63  1994/11/19  15:14:48  mike
10514  * remove unused code and data
10515  *
10516  * Revision 1.62  1994/11/18  23:37:56  john
10517  * Changed some shorts to ints.
10518  *
10519  * Revision 1.61  1994/11/17  13:36:35  rob
10520  * Added better network hook in kconfig menu.
10521  *
10522  * Revision 1.60  1994/11/14  20:09:13  john
10523  * Made Tab be default for automap.
10524  *
10525  * Revision 1.59  1994/11/13  16:34:07  matt
10526  * Fixed victormaxx angle conversions
10527  *
10528  * Revision 1.58  1994/11/12  14:47:05  john
10529  * Added support for victor head tracking.
10530  *
10531  * Revision 1.57  1994/11/08  15:14:55  john
10532  * Added more calls so net doesn't die in net game.
10533  *
10534  * Revision 1.56  1994/11/07  14:01:07  john
10535  * Changed the gamma correction sequencing.
10536  *
10537  * Revision 1.55  1994/11/01  16:40:08  john
10538  * Added Gamma correction.
10539  *
10540  * Revision 1.54  1994/10/25  23:09:26  john
10541  * Made the automap key configurable.
10542  *
10543  * Revision 1.53  1994/10/25  13:11:59  john
10544  * Made keys the way Adam speced 'em for final game.
10545  *
10546  * Revision 1.52  1994/10/24  17:44:22  john
10547  * Added stereo channel reversing.
10548  *
10549  * Revision 1.51  1994/10/22  13:23:18  john
10550  * Made default rear view key be R.
10551  *
10552  * Revision 1.50  1994/10/22  13:20:09  john
10553  * Took out toggle primary/secondary weapons.  Fixed black
10554  * background for 'axes' and 'buttons' text.
10555  *
10556  * Revision 1.49  1994/10/21  15:20:15  john
10557  * Made PrtScr do screen dump, not F2.
10558  *
10559  * Revision 1.48  1994/10/21  13:41:36  john
10560  * Allowed F2 to screen dump.
10561  *
10562  * Revision 1.47  1994/10/17  13:07:05  john
10563  * Moved the descent.cfg info into the player config file.
10564  *
10565  * Revision 1.46  1994/10/14  15:30:22  john
10566  * Added Cyberman default positions.
10567  *
10568  * Revision 1.45  1994/10/14  15:24:54  john
10569  * Made Cyberman work with config.
10570  *
10571  * Revision 1.44  1994/10/14  12:46:04  john
10572  * Added the ability to reset all to default.
10573  *
10574  * Revision 1.43  1994/10/14  12:18:31  john
10575  * Made mouse invert axis always be 0 or 1.
10576  *
10577  * Revision 1.42  1994/10/14  12:16:03  john
10578  * Changed code so that by doing DEL+F12 saves the current kconfig
10579  * values as default. Added support for drop_bomb key.  Took out
10580  * unused slots for keyboard.  Made keyboard use control_type of 0
10581  * save slots.
10582  *
10583  * Revision 1.41  1994/10/13  21:27:02  john
10584  * Made axis invert value always be 0 or 1.
10585  *
10586  * Revision 1.40  1994/10/13  20:18:15  john
10587  * Added some more system keys, such as F? and CAPSLOCK.
10588  *
10589  * Revision 1.39  1994/10/13  19:22:29  john
10590  * Added separate config saves for different devices.
10591  * Made all the devices work together better, such as mice won't
10592  * get read when you're playing with the joystick.
10593  *
10594  * Revision 1.38  1994/10/13  15:41:57  mike
10595  * Remove afterburner.
10596
10597 ------------------------------------------------------------------------
10598 main/kconfig.h:
10599
10600  * Revision 1.1  1995/05/16  15:58:27  allender
10601  * Initial revision
10602  *
10603  * Revision 2.0  1995/02/27  11:29:38  john
10604  * New version 2.0, which has no anonymous unions, builds with
10605  * Watcom 10.0, and doesn't require parsing BITMAPS.TBL.
10606  *
10607  * Revision 1.23  1995/01/12  11:41:44  john
10608  * Added external control reading.
10609  *
10610  * Revision 1.22  1994/12/07  16:15:30  john
10611  * Added command to check to see if a joystick axes has been used.
10612  *
10613  * Revision 1.21  1994/11/29  03:46:29  john
10614  * Added joystick sensitivity; Added sound channels to detail menu.  Removed -maxchannels
10615  * command line arg.
10616  *
10617  * Revision 1.20  1994/11/22  16:54:45  mike
10618  * autorepeat on missiles.
10619  *
10620  * Revision 1.19  1994/11/07  14:01:27  john
10621  * Changed the gamma correction sequencing.
10622  *
10623  * Revision 1.18  1994/11/01  16:40:02  john
10624  * Added Gamma correction.
10625  *
10626  * Revision 1.17  1994/10/25  23:09:24  john
10627  * Made the automap key configurable.
10628  *
10629  * Revision 1.16  1994/10/24  19:56:51  john
10630  * Made the new user setup prompt for config options.
10631  *
10632  * Revision 1.15  1994/10/24  17:44:18  john
10633  * Added stereo channel reversing.
10634  *
10635  * Revision 1.14  1994/10/22  13:19:33  john
10636  * Took out toggle primary/secondary weapons.  Fixed black
10637  * background for 'axes' and 'buttons' text.
10638  *
10639  * Revision 1.13  1994/10/17  13:06:51  john
10640  * Moved the descent.cfg info into the player config file.
10641  *
10642  * Revision 1.12  1994/10/14  12:14:47  john
10643  * Changed code so that by doing DEL+F12 saves the current kconfig
10644  * values as default. Added support for drop_bomb key.  Took out
10645  * unused slots for keyboard.  Made keyboard use control_type of 0
10646  * save slots.
10647  *
10648  * Revision 1.11  1994/10/13  19:21:33  john
10649  * Added separate config saves for different devices.
10650  * Made all the devices work together better, such as mice won't
10651  * get read when you're playing with the joystick.
10652  *
10653  * Revision 1.10  1994/10/13  15:18:41  john
10654  * Started ripping out old afterburner, show message, show automap
10655  * keys in the keyboard config stuff.
10656  *
10657  * Revision 1.9  1994/10/13  11:35:27  john
10658  * Made Thrustmaster FCS Hat work.  Put a background behind the
10659  * keyboard configure.  Took out turn_sensitivity.  Changed sound/config
10660  * menu to new menu. Made F6 be calibrate joystick.
10661  *
10662  * Revision 1.8  1994/10/06  14:10:50  matt
10663  * New function reset_cruise()
10664  *
10665  * Revision 1.7  1994/10/03  14:58:25  john
10666  * Added rear_view_down_state so that the rear view can
10667  * work like the automap.
10668  *
10669  * Revision 1.6  1994/09/30  12:37:25  john
10670  * Added midi,digi volume to configuration.
10671  *
10672  * Revision 1.5  1994/09/19  18:49:59  john
10673  * Added switch to disable joystick.
10674  *
10675  * Revision 1.4  1994/09/15  16:11:21  john
10676  * Added support for VFX1 head tracking. Fixed bug with memory over-
10677  * write when using stereo mode.
10678  *
10679  * Revision 1.3  1994/09/12  11:47:38  john
10680  * Made stupid cruise work better.  Make kconfig values get
10681  * read/written to disk.
10682  *
10683  * Revision 1.2  1994/09/10  15:46:55  john
10684  * First version of new keyboard configuration.
10685  *
10686  * Revision 1.1  1994/09/10  13:51:40  john
10687  * Initial revision
10688
10689 ------------------------------------------------------------------------
10690 main/kmatrix.c:
10691
10692  * Revision 1.6  1995/09/24  10:57:48  allender
10693  * made any key move off of kill matrix screen as text indicates it should
10694  *
10695  * Revision 1.5  1995/08/18  08:33:05  allender
10696  * fixed text problem with top level player names
10697  *
10698  * Revision 1.4  1995/07/26  17:03:05  allender
10699  * sort of fixed spacing for mac
10700  *
10701  * Revision 1.3  1995/06/06  15:36:14  allender
10702  * be sure to bitblt to screen inside of kmatrix loop
10703  *
10704  * Revision 1.2  1995/06/02  07:47:15  allender
10705  * removed bogus include files
10706  *
10707  * Revision 1.1  1995/05/16  15:27:07  allender
10708  * Initial revision
10709  *
10710  * Revision 2.3  1995/05/02  17:01:22  john
10711  * Fixed bug with kill list not showing up in VFX mode.
10712  *
10713  * Revision 2.2  1995/03/21  14:38:20  john
10714  * Ifdef'd out the NETWORK code.
10715  *
10716  * Revision 2.1  1995/03/06  15:22:54  john
10717  * New screen techniques.
10718  *
10719  * Revision 2.0  1995/02/27  11:25:56  john
10720  * New version 2.0, which has no anonymous unions, builds with
10721  * Watcom 10.0, and doesn't require parsing BITMAPS.TBL.
10722  *
10723  * Revision 1.19  1995/02/15  14:47:23  john
10724  * Added code to keep track of kills during endlevel.
10725  *
10726  * Revision 1.18  1995/02/08  11:00:06  rob
10727  * Moved string to localized file
10728  *
10729  * Revision 1.17  1995/02/01  23:45:55  rob
10730  * Fixed string.
10731  *
10732  * Revision 1.16  1995/01/30  21:47:11  rob
10733  * Added a line of instructions.
10734  *
10735  * Revision 1.15  1995/01/20  16:58:43  rob
10736  * careless careless careless...
10737  *
10738  *
10739  * Revision 1.14  1995/01/20  13:43:48  rob
10740  * Longer time to view.
10741  *
10742  * Revision 1.13  1995/01/20  13:42:34  rob
10743  * Fixed sorting bug.
10744  *
10745  * Revision 1.12  1995/01/19  17:35:21  rob
10746  * Fixed coloration of player names in team mode.
10747  *
10748  * Revision 1.11  1995/01/16  21:26:15  rob
10749  * Fixed it!!
10750  *
10751  * Revision 1.10  1995/01/16  18:55:41  rob
10752  * Added include of network.h
10753  *
10754  * Revision 1.9  1995/01/16  18:22:35  rob
10755  * Fixed problem with signs.
10756  *
10757  * Revision 1.8  1995/01/12  16:07:51  rob
10758  * ADded sorting before display.
10759  *
10760  * Revision 1.7  1995/01/04  08:46:53  rob
10761  * JOHN CHECKED IN FOR ROB !!!
10762  *
10763  * Revision 1.6  1994/12/09  20:17:20  yuan
10764  * Touched up
10765  *
10766  * Revision 1.5  1994/12/09  19:46:35  yuan
10767  * Localized the sucker.
10768  *
10769  * Revision 1.4  1994/12/09  19:24:58  rob
10770  * Yuan's fix to the centering.
10771  *
10772  * Revision 1.3  1994/12/09  19:02:37  yuan
10773  * Cleaned up a bit.
10774  *
10775  * Revision 1.2  1994/12/09  16:19:46  yuan
10776  * kill matrix stuff.
10777  *
10778  * Revision 1.1  1994/12/09  15:08:58  yuan
10779  * Initial revision
10780
10781 ------------------------------------------------------------------------
10782 main/kmatrix.h:
10783
10784  * Revision 1.1  1995/05/16  15:58:35  allender
10785  * Initial revision
10786  *
10787  * Revision 2.0  1995/02/27  11:28:51  john
10788  * New version 2.0, which has no anonymous unions, builds with
10789  * Watcom 10.0, and doesn't require parsing BITMAPS.TBL.
10790  *
10791  * Revision 1.3  1995/02/15  14:47:39  john
10792  * Added code to keep track of kills during endlevel.
10793  *
10794  * Revision 1.2  1994/12/09  16:19:46  yuan
10795  * kill matrix stuff.
10796  *
10797  * Revision 1.1  1994/12/09  15:58:33  yuan
10798  * Initial revision
10799
10800 ------------------------------------------------------------------------
10801 main/laser.c:
10802
10803  * Revision 1.1  1993/11/29  17:19:02  john
10804  * Initial revision
10805
10806 ------------------------------------------------------------------------
10807 main/laser.h:
10808
10809  * Revision 1.1  1995/05/16  15:58:43  allender
10810  * Initial revision
10811  *
10812  * Revision 2.0  1995/02/27  11:32:27  john
10813  * New version 2.0, which has no anonymous unions, builds with
10814  * Watcom 10.0, and doesn't require parsing BITMAPS.TBL.
10815  *
10816  * Revision 1.50  1995/02/01  21:03:44  john
10817  * Lintified.
10818  *
10819  * Revision 1.49  1995/02/01  16:34:11  john
10820  * Linted.
10821  *
10822  * Revision 1.48  1995/01/31  16:16:16  mike
10823  * Separate smart blobs for robot and player.
10824  *
10825  * Revision 1.47  1995/01/27  17:02:55  mike
10826  * Add LASER_ID -- why wasn't this added in June?
10827  *
10828  * Revision 1.46  1995/01/25  10:53:27  mike
10829  * make badass damage go through grates.
10830  *
10831  * Revision 1.45  1994/12/12  17:17:32  mike
10832  * make boss cloak/teleport when get hit, make quad laser 3/4 as powerful.
10833  *
10834  * Revision 1.44  1994/12/04  16:17:23  mike
10835  * spruce up homing missile behavior.
10836  *
10837  * Revision 1.43  1994/12/03  12:48:30  mike
10838  * make homing missile tracking not frame rate dependent (more-or-less)
10839  *
10840  * Revision 1.42  1994/10/12  08:04:54  mike
10841  * Clean up proximity/homing mess.
10842  *
10843  * Revision 1.41  1994/10/09  20:07:04  rob
10844  * Change prototype for do_laser_firing
10845  *
10846  * Revision 1.40  1994/10/09  00:15:48  mike
10847  * Add constants for super mech missile, regular mech missile, silent spreadfire.
10848  *
10849  * Revision 1.39  1994/10/08  19:52:09  rob
10850  * Added new weapon fire flags.
10851  *
10852  * Revision 1.38  1994/10/07  15:31:12  mike
10853  * Prototypes for new laser functions which don't necessarily make sound.
10854  *
10855  * Revision 1.37  1994/10/05  17:08:29  matt
10856  * Fixed a couple of small bugs, and made homing missiles alternate sides
10857  *
10858  * Revision 1.36  1994/09/28  14:28:55  rob
10859  * Added firing of missiles on networks/serial.
10860  *
10861  * Revision 1.35  1994/09/24  14:17:02  mike
10862  * Prototype do_laser_firing.
10863  *
10864  * Revision 1.34  1994/09/23  11:36:49  mike
10865  * Prototype Laser_create_new_easy.
10866  *
10867  * Revision 1.33  1994/09/20  11:55:01  mike
10868  * Fix bug.
10869  *
10870  * Revision 1.32  1994/09/20  11:48:34  mike
10871  * Change spreadfire laser to use new bitmap. (Define SPREADFIRE_ID)
10872  *
10873  * Revision 1.31  1994/09/15  16:31:28  mike
10874  * Prototype object_to_object_visibility.
10875  *
10876  * Revision 1.30  1994/09/10  17:31:40  mike
10877  * Add thrust to weapons.
10878  *
10879  * Revision 1.29  1994/09/08  14:49:44  mike
10880  * Bunch of IDs for new weapon types.
10881  *
10882  * Revision 1.28  1994/09/07  19:16:40  mike
10883  * Homing missile.
10884  *
10885  * Revision 1.27  1994/09/07  15:59:47  mike
10886  * Kill FLARE_MAX_TIME (now defined in bitmaps.tbl), add PROXIMITY_ID (shame!), prototype do_laser_firing, do_missile_firing.
10887  *
10888  * Revision 1.26  1994/09/03  15:22:41  mike
10889  * Kill Projectile_player_fire prototype.
10890  *
10891  * Revision 1.25  1994/09/02  16:39:00  mike
10892  * IDs for primary weapons.
10893  *
10894  * Revision 1.24  1994/09/02  11:55:54  mike
10895  * Define some illegal constants.
10896  *
10897  * Revision 1.23  1994/08/25  18:12:06  matt
10898  * Made player's weapons and flares fire from the positions on the 3d model.
10899  * Also added support for quad lasers.
10900  *
10901  * Revision 1.22  1994/08/19  15:22:28  mike
10902  * Define constant for MAX_LASER_LEVEL.
10903  *
10904  * Revision 1.21  1994/08/13  12:20:47  john
10905  * Made the networking uise the Players array.
10906  *
10907  * Revision 1.20  1994/08/10  10:44:05  john
10908  * Made net players fire..
10909  *
10910  * Revision 1.19  1994/06/27  18:30:57  mike
10911  * Add flares.
10912  *
10913  * Revision 1.18  1994/06/09  15:32:37  mike
10914  * Muzzle flash
10915  *
10916  * Revision 1.17  1994/05/19  09:09:00  mike
10917  * Move a bunch of laser variables to bm.h, I think.
10918  * Also, added Robot_laser_speed, instead of hard-coding Laser_speed/4.
10919  *
10920  * Revision 1.16  1994/05/14  17:16:20  matt
10921  * Got rid of externs in source (non-header) files
10922  *
10923  * Revision 1.15  1994/05/13  20:27:39  john
10924  * Version II of John's new object code.
10925  *
10926  * Revision 1.14  1994/04/20  15:06:47  john
10927  * Neatend laser code and fixed some laser bugs.
10928  *
10929  * Revision 1.13  1994/04/01  13:35:15  matt
10930  * Cleaned up laser code a bit; moved some code here object.c to laser.c
10931  *
10932  * Revision 1.12  1994/04/01  11:14:24  yuan
10933  * Added multiple bitmap functionality to all objects...
10934  * (hostages, powerups, lasers, etc.)
10935  * Hostages and powerups are implemented in the object system,
10936  * just need to finish function call to "affect" player.
10937  *
10938  * Revision 1.11  1994/03/31  09:10:09  matt
10939  * Added #define to turn crosshair off
10940  *
10941  * Revision 1.10  1994/02/17  11:33:15  matt
10942  * Changes in object system
10943  *
10944  * Revision 1.9  1994/01/06  11:56:01  john
10945  * Made lasers be lines, not purple blobs
10946  *
10947  * Revision 1.8  1994/01/05  10:53:35  john
10948  * New object code by John.
10949  *
10950  * Revision 1.7  1993/12/08  14:21:36  john
10951  * Added ExplodeObject
10952  *
10953  * Revision 1.6  1993/12/08  11:28:54  john
10954  * Made lasers look like bolts.
10955  *
10956  * Revision 1.5  1993/12/01  13:12:40  john
10957  * made lasers frame-rate independant
10958  *
10959  * Revision 1.4  1993/11/30  19:00:42  john
10960  * lasers working kinda
10961  *
10962  * Revision 1.3  1993/11/29  19:44:53  john
10963  * *** empty log message ***
10964  *
10965  * Revision 1.2  1993/11/29  17:44:55  john
10966  * *** empty log message ***
10967  *
10968  * Revision 1.1  1993/11/29  17:19:19  john
10969  * Initial revision
10970
10971 ------------------------------------------------------------------------
10972 main/lighting.c:
10973
10974  * Revision 1.4  1995/09/20  14:26:12  allender
10975  * more optimizations(?) ala MK
10976  *
10977  * Revision 1.2  1995/07/05  21:27:31  allender
10978  * new and improved lighting code by MK!
10979  *
10980  * Revision 2.1  1995/07/24  13:21:56  john
10981  * Added new lighting calculation code to speed things up.
10982  *
10983  * Revision 2.0  1995/02/27  11:27:33  john
10984  * New version 2.0, which has no anonymous unions, builds with
10985  * Watcom 10.0, and doesn't require parsing BITMAPS.TBL.
10986  *
10987  * Revision 1.43  1995/02/22  13:57:10  allender
10988  * remove anonymous union from object structure
10989  *
10990  * Revision 1.42  1995/02/13  20:35:07  john
10991  * Lintized
10992  *
10993  * Revision 1.41  1995/02/04  21:43:40  matt
10994  * Changed an assert() to an int3() and deal with the bad case
10995  *
10996  * Revision 1.40  1995/01/15  20:48:27  mike
10997  * support light field for powerups.
10998  *
10999  * Revision 1.39  1994/12/15  13:04:19  mike
11000  * Replace Players[Player_num].time_total references with GameTime.
11001  *
11002  * Revision 1.38  1994/11/28  21:50:41  mike
11003  * optimizations.
11004  *
11005  * Revision 1.37  1994/11/28  01:32:33  mike
11006  * lighting optimization.
11007  *
11008  * Revision 1.36  1994/11/15  12:01:00  john
11009  * Changed a bunch of code that uses timer_get_milliseconds to
11010  * timer_get_fixed_Seconds.
11011  *
11012  * Revision 1.35  1994/10/31  21:56:07  matt
11013  * Fixed bug & added error checking
11014  *
11015  * Revision 1.34  1994/10/21  11:24:57  mike
11016  * Trap divide overflows in lighting.
11017  *
11018  * Revision 1.33  1994/10/08  14:49:11  matt
11019  * If viewer changed, don't do smooth lighting hack
11020  *
11021  * Revision 1.32  1994/09/25  23:41:07  matt
11022  * Changed the object load & save code to read/write the structure fields one
11023  * at a time (rather than the whole structure at once).  This mean that the
11024  * object structure can be changed without breaking the load/save functions.
11025  * As a result of this change, the local_object data can be and has been
11026  * incorporated into the object array.  Also, timeleft is now a property
11027  * of all objects, and the object structure has been otherwise cleaned up.
11028  *
11029  * Revision 1.31  1994/09/25  15:45:15  matt
11030  * Added OBJ_LIGHT, a type of object that casts light
11031  * Added generalized lifeleft, and moved it to local_object
11032  *
11033  * Revision 1.30  1994/09/11  15:48:27  mike
11034  * Use vm_vec_mag_quick in place of vm_vec_mag in point_dist computation.
11035  *
11036  * Revision 1.29  1994/09/08  21:44:49  matt
11037  * Made lighting ramp 4x as fast; made only static (ambient) light ramp
11038  * up, but not headlight & dynamic light
11039  *
11040  * Revision 1.28  1994/09/02  14:00:07  matt
11041  * Simplified explode_object() & mutliple-stage explosions
11042  *
11043  * Revision 1.27  1994/08/29  19:06:44  mike
11044  * Make lighting proportional to square of distance, not linear.
11045  *
11046  * Revision 1.26  1994/08/25  18:08:38  matt
11047  * Made muzzle flash cast 3x as much light
11048  *
11049  * Revision 1.25  1994/08/23  16:38:31  mike
11050  * Key weapon light off bitmaps.tbl.
11051  *
11052  * Revision 1.24  1994/08/13  12:20:44  john
11053  * Made the networking uise the Players array.
11054  *
11055  * Revision 1.23  1994/08/12  22:42:18  john
11056  * Took away Player_stats; added Players array.
11057  *
11058  * Revision 1.22  1994/07/06  10:19:22  matt
11059  * Changed include
11060  *
11061  * Revision 1.21  1994/06/28  13:20:22  mike
11062  * Oops, fixed a dumb typo.
11063  *
11064  * Revision 1.20  1994/06/28  12:53:25  mike
11065  * Change lighting function for flares, make brighter and asynchronously flicker.
11066  *
11067  * Revision 1.19  1994/06/27  18:31:15  mike
11068  * Add flares.
11069  *
11070  * Revision 1.18  1994/06/20  13:41:17  matt
11071  * Added time-based gradual lighting hack for objects
11072  * Took out strobing robots
11073  *
11074  * Revision 1.17  1994/06/19  16:25:54  mike
11075  * Optimize lighting.
11076  *
11077  * Revision 1.16  1994/06/17  18:08:08  mike
11078  * Make robots cast more and variable light.
11079  *
11080  * Revision 1.15  1994/06/13  15:15:55  mike
11081  * Fix phantom light, every 64K milliseconds, muzzle flash would flash again.
11082
11083 ------------------------------------------------------------------------
11084 main/lighting.h:
11085
11086  * Revision 1.1  1995/05/16  15:58:51  allender
11087  * Initial revision
11088  *
11089  * Revision 2.0  1995/02/27  11:27:52  john
11090  * New version 2.0, which has no anonymous unions, builds with
11091  * Watcom 10.0, and doesn't require parsing BITMAPS.TBL.
11092  *
11093  * Revision 1.6  1994/11/28  21:50:56  mike
11094  * optimizations.
11095  *
11096  * Revision 1.5  1994/06/07  16:51:58  matt
11097  * Made object lighting work correctly; changed name of Ambient_light to
11098  * Dynamic_light; cleaned up polygobj object rendering a little.
11099  *
11100  * Revision 1.4  1994/05/31  18:41:35  matt
11101  * Added comments
11102  *
11103  * Revision 1.3  1994/05/23  15:00:08  mike
11104  * Change MIN_LIGHT_DIST.
11105  *
11106  * Revision 1.2  1994/05/22  15:30:09  mike
11107  * First version.
11108  *
11109  * Revision 1.1  1994/05/22  15:16:44  mike
11110  * Initial revision
11111
11112 ------------------------------------------------------------------------
11113 main/menu.h:
11114
11115  * Revision 1.1  1995/05/16  15:59:14  allender
11116  * Initial revision
11117  *
11118  * Revision 2.1  1995/03/06  16:47:41  mike
11119  * destination saturn
11120  *
11121  * Revision 2.0  1995/02/27  11:29:47  john
11122  * New version 2.0, which has no anonymous unions, builds with
11123  * Watcom 10.0, and doesn't require parsing BITMAPS.TBL.
11124  *
11125  * Revision 1.34  1994/12/12  00:16:16  john
11126  * Added auto-leveling flag.
11127  *
11128  * Revision 1.33  1994/12/07  20:04:26  mike
11129  * set Max_debris_objects.
11130  *
11131  * Revision 1.32  1994/11/14  17:23:19  rob
11132  * ADded extern for default difficulty settings.
11133  *
11134  * Revision 1.31  1994/11/10  11:08:29  mike
11135  * detail level stuff.
11136  *
11137  * Revision 1.30  1994/11/05  14:05:53  john
11138  * Fixed fade transitions between all screens by making gr_palette_fade_in and out keep
11139  * track of whether the palette is faded in or not.  Then, wherever the code needs to fade out,
11140  * it just calls gr_palette_fade_out and it will fade out if it isn't already.  The same with fade_in.
11141  * This eliminates the need for all the flags like Menu_fade_out, game_fade_in palette, etc.
11142  *
11143  * Revision 1.29  1994/11/02  11:59:44  john
11144  * Moved menu out of game into inferno main loop.
11145  *
11146  * Revision 1.28  1994/10/17  20:30:59  john
11147  * Made the text for the difficulty labels global so that
11148  * the high score screen can print "rookie" or whatever.
11149  *
11150  * Revision 1.27  1994/10/04  10:47:09  matt
11151  * Made main menu remember selected item
11152  *
11153  * Revision 1.26  1994/08/10  19:55:19  john
11154  * Changed font stuff; Took out old menu; messed up lots of
11155  * other stuff like game sequencing messages, etc.
11156  *
11157  * Revision 1.25  1994/06/23  18:54:09  matt
11158  * Cleaned up game start/menu interaction, and improved main menu a little
11159  *
11160  * Revision 1.24  1994/06/21  12:11:50  yuan
11161  * Fixed up menus and added HUDisplay messages.
11162  *
11163  * Revision 1.23  1994/06/20  23:15:16  yuan
11164  * Color switching capability for the menus.
11165  *
11166  * Revision 1.22  1994/06/20  22:02:25  yuan
11167  * Made menu GREEN by POPULAR DEMAND!!
11168  *
11169  * Revision 1.21  1994/06/20  21:05:48  yuan
11170  * Fixed up menus.
11171  *
11172  * Revision 1.20  1994/06/20  19:19:29  yuan
11173  * Tidied up the menu and the "message blocks" between levels, etc.
11174  *
11175  * Revision 1.19  1994/06/17  18:01:10  john
11176  * A bunch of new stuff by John
11177  *
11178  * Revision 1.18  1994/05/16  09:37:22  matt
11179  * Got rid of global continue_flag
11180  *
11181  * Revision 1.17  1994/05/14  17:14:51  matt
11182  * Got rid of externs in source (non-header) files
11183  *
11184  * Revision 1.16  1994/05/10  12:14:26  yuan
11185  * Game save/load... Demo levels 1-5 added...
11186  * High scores fixed...
11187  *
11188  * Revision 1.15  1994/05/05  09:21:21  yuan
11189  * *** empty log message ***
11190  *
11191  * Revision 1.14  1994/04/29  14:55:40  mike
11192  * Change some menu colors.
11193  *
11194  * Revision 1.13  1994/04/28  18:04:36  yuan
11195  * Gamesave added.
11196  * Trigger problem fixed (seg pointer is replaced by index now.)
11197  *
11198  * Revision 1.12  1994/02/18  11:55:01  yuan
11199  * Fixed menu to be called from game.
11200  *
11201  * Revision 1.11  1994/02/10  17:45:39  yuan
11202  * Integrated some hacks which still need to be fixed.
11203  *
11204  * Revision 1.10  1994/02/01  22:50:23  yuan
11205  * Final menu version for demo
11206  *
11207  * Revision 1.9  1994/02/01  11:50:17  yuan
11208  * Moved quit message down just a tiny bit
11209  *
11210  * Revision 1.8  1994/01/31  17:30:16  yuan
11211  * Fixed quit not disappearing problem
11212  *
11213  * Revision 1.7  1994/01/31  12:25:20  yuan
11214  * New menu stuff
11215  *
11216  * Revision 1.6  1994/01/26  13:14:04  john
11217  * *** empty log message ***
11218  *
11219  * Revision 1.5  1993/12/29  16:44:44  yuan
11220  * Added some function definitions
11221  *
11222  * Revision 1.4  1993/12/13  18:53:12  yuan
11223  * Fixed dependency problem
11224  *
11225  * Revision 1.3  1993/12/12  13:53:51  yuan
11226  * Added menu and -g flag
11227  *
11228  * Revision 1.2  1993/12/10  16:07:17  yuan
11229  * Working on menu system.  Updated the title screen.
11230  *
11231  * Revision 1.1  1993/12/10  12:45:27  yuan
11232  * Initial revision
11233
11234 ------------------------------------------------------------------------
11235 main/mglobal.c:
11236
11237  * Revision 1.1  1995/12/05  16:03:10  allender
11238  * Initial revision
11239  *
11240  * Revision 1.3  1995/10/10  11:49:41  allender
11241  * removed malloc of static data now in ai module
11242  *
11243  * Revision 1.2  1995/07/12  12:48:52  allender
11244  * malloc out edge_list global here, not static in automap.c
11245  *
11246  * Revision 1.1  1995/05/16  15:27:40  allender
11247  * Initial revision
11248  *
11249  * Revision 2.2  1995/03/14  18:24:37  john
11250  * Force Destination Saturn to use CD-ROM drive.
11251  *
11252  * Revision 2.1  1995/03/06  16:47:23  mike
11253  * destination saturn
11254  *
11255  * Revision 2.0  1995/02/27  11:30:00  john
11256  * New version 2.0, which has no anonymous unions, builds with
11257  * Watcom 10.0, and doesn't require parsing BITMAPS.TBL.
11258  *
11259  * Revision 1.43  1995/01/19  17:00:53  john
11260  * Made save game work between levels.
11261  *
11262  * Revision 1.42  1994/12/05  14:23:53  adam
11263  * changed default detail to max, not custom
11264  *
11265  * Revision 1.41  1994/11/19  15:15:07  mike
11266  * remove unused code and data
11267  *
11268  * Revision 1.40  1994/11/03  10:13:19  yuan
11269  * Added #include "game.h"
11270  *
11271  * Revision 1.39  1994/11/03  10:09:59  matt
11272  * Properly initialize detail & difficulty levels
11273  *
11274  * Revision 1.38  1994/10/30  14:11:21  mike
11275  * rip out local segments stuff.
11276  *
11277  * Revision 1.37  1994/10/26  15:21:30  mike
11278  * detail level.
11279  *
11280  * Revision 1.36  1994/09/22  10:46:12  mike
11281  * Add difficulty levels.
11282  *
11283  * Revision 1.35  1994/09/13  11:19:11  mike
11284  * Add Next_missile_fire_time.
11285  *
11286  * Revision 1.34  1994/08/31  19:25:34  mike
11287  * GameTime and laser-firing limiting stuff added.
11288  *
11289  * Revision 1.33  1994/08/11  18:58:53  mike
11290  * Add Side_to_verts_int.
11291  *
11292  * Revision 1.32  1994/07/21  19:01:38  mike
11293  * Add Lsegment.
11294  *
11295  * Revision 1.31  1994/07/21  13:11:24  matt
11296  * Ripped out remants of old demo system, and added demo only system that
11297  * disables object movement and game options from menu.
11298  *
11299  * Revision 1.30  1994/06/17  18:06:48  matt
11300  * Made password be treated as lowercase, since cmdline parsing converts
11301  * everything to lowercase.
11302  *
11303  * Revision 1.29  1994/03/15  16:33:04  yuan
11304  * Cleaned up bm-loading code.
11305  * (Fixed structures too)
11306  *
11307  * Revision 1.28  1994/02/17  11:32:45  matt
11308  * Changes in object system
11309  *
11310  * Revision 1.27  1994/02/16  17:08:43  matt
11311  * Added needed include of 3d.h
11312  *
11313  * Revision 1.26  1994/02/16  13:47:58  mike
11314  * fix bugs so editor can compile out.
11315  *
11316  * Revision 1.25  1994/02/11  21:52:13  matt
11317  * Made password protection selectable by #define (and thus INFERNO.INI)
11318  *
11319  * Revision 1.24  1994/02/10  15:35:56  matt
11320  * Various changes to make editor compile out.
11321  *
11322  * Revision 1.23  1994/02/02  12:34:29  mike
11323  * take out BATS encryption.
11324  *
11325  * Revision 1.22  1994/01/21  16:08:11  matt
11326  * Added FrameCount variable
11327  *
11328  * Revision 1.21  1994/01/06  17:13:10  john
11329  * Added Video clip functionality
11330  *
11331  * Revision 1.20  1993/12/08  17:45:08  matt
11332  * Changed password again
11333  *
11334  * Revision 1.19  1993/12/08  17:41:05  matt
11335  * Changed password
11336  *
11337  * Revision 1.18  1993/12/08  10:55:10  mike
11338  * Add free_obj_list
11339  *
11340  * Revision 1.17  1993/12/07  13:46:38  john
11341  * Added Explosion bitmap array
11342  *
11343  * Revision 1.16  1993/12/06  18:40:35  matt
11344  * Changed object loading & handling
11345  *
11346  * Revision 1.15  1993/12/05  22:47:48  matt
11347  * Reworked include files in an attempt to cut down on build times
11348  *
11349  * Revision 1.14  1993/12/01  11:44:11  matt
11350  * Chagned Frfract to FrameTime
11351  *
11352  * Revision 1.13  1993/12/01  00:27:11  yuan
11353  * Implemented new bitmap structure system...
11354  * overall bitmap scheme still needs some work.
11355  *
11356  * Revision 1.12  1993/11/19  17:21:59  matt
11357  * Changed the bitmap number of object class UNICLASS
11358  * Removed static initialization for objects
11359  *
11360  * Revision 1.11  1993/11/18  13:51:47  mike
11361  * Add Classes, Class_views, Objects
11362  *
11363  * Revision 1.10  1993/11/04  18:52:36  matt
11364  * Made Vertices[] and Segment_points[] use same constant for size, since
11365  * they must be the same size anyway
11366  *
11367  * Revision 1.9  1993/11/04  14:01:06  matt
11368  * Mucked with include files
11369  *
11370  * Revision 1.8  1993/10/26  13:58:42  mike
11371  * Add password protection.
11372  *
11373  * Revision 1.7  1993/10/14  18:05:50  mike
11374  * Change Side_to_verts to use MAX_SIDES_PER_SEGMENT in place of CONNECTIVITY
11375  *
11376  * Revision 1.6  1993/10/12  13:57:19  john
11377  * added texture[]
11378  *
11379  * Revision 1.5  1993/10/12  09:58:15  mike
11380  * Move Side_to_verts here from eglobal.c, since it is needed in the game.
11381  *
11382  * Revision 1.4  1993/10/09  15:52:30  mike
11383  * Move test_pos, test_orient here from render.c.
11384  *
11385  * Revision 1.3  1993/10/02  18:15:45  mike
11386  * Killed include of segment.h, which gets included by inferno.h.
11387  *
11388  * Revision 1.2  1993/09/23  17:54:24  mike
11389  * Add Segment_points
11390  *
11391  * Revision 1.1  1993/09/23  15:01:50  mike
11392  * Initial revision
11393
11394 ------------------------------------------------------------------------
11395 main/mission.c:
11396
11397  * Revision 1.4  1995/10/31  10:21:40  allender
11398  * no mission support in shareware
11399  *
11400  * Revision 1.3  1995/10/21  22:53:04  allender
11401  * moved missions to data folder
11402  *
11403  * Revision 1.2  1995/09/13  08:47:29  allender
11404  * made to work with Chris' direct stuff
11405  *
11406  * Revision 1.1  1995/05/16  15:27:48  allender
11407  * Initial revision
11408  *
11409  * Revision 2.9  1995/05/26  16:16:32  john
11410  * Split SATURN into define's for requiring cd, using cd, etc.
11411  * Also started adding all the Rockwell stuff.
11412  *
11413  * Revision 2.8  1995/03/20  15:49:31  mike
11414  * Remove eof char from comment which confused make depend, causing
11415  * no mission.obj: line in makefile.  Pretty stupid tool, huh?
11416  *
11417  * Revision 2.7  1995/03/20  12:12:11  john
11418  * Added ifdef SATURN.
11419  *
11420  * Revision 2.6  1995/03/15  14:32:49  john
11421  * Added code to force the Descent CD-rom in the drive.
11422  *
11423  * Revision 2.5  1995/03/15  11:41:15  john
11424  * Better Saturn CD-ROM support.
11425  *
11426  * Revision 2.4  1995/03/14  18:24:14  john
11427  * Force Destination Saturn to use CD-ROM drive.
11428  *
11429  * Revision 2.3  1995/03/07  14:19:41  mike
11430  * More destination saturn stuff.
11431  *
11432  * Revision 2.2  1995/03/06  23:09:03  mike
11433  * more saturn stuff: make briefings work for saturn mission.
11434  *
11435  * Revision 2.1  1995/03/06  16:47:48  mike
11436  * destination saturn
11437  *
11438  * Revision 2.0  1995/02/27  11:27:49  john
11439  * New version 2.0, which has no anonymous unions, builds with
11440  * Watcom 10.0, and doesn't require parsing BITMAPS.TBL.
11441  *
11442  * Revision 1.14  1995/02/15  11:30:37  john
11443  * Fixed bug with potential mem overwrite on line 160.
11444  *
11445  * Revision 1.13  1995/02/10  17:53:20  matt
11446  * Changed mission name again
11447  *
11448  * Revision 1.12  1995/02/10  17:35:38  matt
11449  * Changed name of built-in mission
11450  *
11451  * Revision 1.11  1995/02/07  17:13:51  allender
11452  * removed return statement in load_mission so that built in mission will
11453  * actually set the Current_mission_name and _filename
11454  *
11455  * Revision 1.10  1995/01/31  01:19:45  matt
11456  * Made build_mission_list() sort missions by name
11457  *
11458  * Revision 1.9  1995/01/30  13:49:58  allender
11459  * changed build_mission_list in load_mission_by_name to include
11460  * anarchy levels.
11461  *
11462  * Revision 1.8  1995/01/30  13:03:51  matt
11463  * Fixed dumb mistake
11464  *
11465  * Revision 1.7  1995/01/30  12:55:22  matt
11466  * Added vars to point to mission names
11467  *
11468  * Revision 1.6  1995/01/22  18:57:28  matt
11469  * Made player highest level work with missions
11470  *
11471  * Revision 1.5  1995/01/22  14:13:08  matt
11472  * Added flag in mission list for anarchy-only missions
11473  *
11474  * Revision 1.4  1995/01/21  23:13:12  matt
11475  * Made high scores with (not work, really) with loaded missions
11476  * Don't give player high score when quit game
11477  *
11478  * Revision 1.3  1995/01/21  16:27:12  matt
11479  * Made endlevel briefing work with missions
11480  *
11481  * Revision 1.2  1995/01/20  22:47:50  matt
11482  * Mission system implemented, though imcompletely
11483  *
11484  * Revision 1.1  1995/01/20  13:42:19  matt
11485  * Initial revision
11486
11487 ------------------------------------------------------------------------
11488 main/mission.h:
11489
11490  * Revision 1.1  1995/05/16  15:59:22  allender
11491  * Initial revision
11492  *
11493  * Revision 2.0  1995/02/27  11:31:35  john
11494  * New version 2.0, which has no anonymous unions, builds with
11495  * Watcom 10.0, and doesn't require parsing BITMAPS.TBL.
11496  *
11497  * Revision 1.6  1995/01/30  12:55:41  matt
11498  * Added vars to point to mission names
11499  *
11500  * Revision 1.5  1995/01/22  18:57:21  matt
11501  * Made player highest level work with missions
11502  *
11503  * Revision 1.4  1995/01/22  14:13:21  matt
11504  * Added flag in mission list for anarchy-only missions
11505  *
11506  * Revision 1.3  1995/01/21  23:13:12  matt
11507  * Made high scores with (not work, really) with loaded missions
11508  * Don't give player high score when quit game
11509  *
11510  * Revision 1.2  1995/01/20  22:47:53  matt
11511  * Mission system implemented, though imcompletely
11512  *
11513  * Revision 1.1  1995/01/20  13:42:26  matt
11514  * Initial revision
11515
11516 ------------------------------------------------------------------------
11517 main/modem.h:
11518
11519  * Revision 1.2  1995/09/05  14:06:40  allender
11520  * checkpoint again
11521  *
11522  * Revision 1.1  1995/05/16  15:59:29  allender
11523  * Initial revision
11524  *
11525  * Revision 2.1  1995/03/21  14:40:38  john
11526  * Ifdef'd out the NETWORK code.
11527  *
11528  * Revision 2.0  1995/02/27  11:31:34  john
11529  * New version 2.0, which has no anonymous unions, builds with
11530  * Watcom 10.0, and doesn't require parsing BITMAPS.TBL.
11531  *
11532  * Revision 1.18  1994/11/22  17:12:05  rob
11533  * Starting working on secret level fix for modem games.
11534  *
11535  * Revision 1.17  1994/11/17  16:43:17  rob
11536  * Added prototype for com_level_sync function.
11537  *
11538  * Revision 1.16  1994/11/15  21:30:32  rob
11539  * Added prototype for new menu hook.
11540  *
11541  * Revision 1.15  1994/10/07  16:15:33  rob
11542  * Changed calls to multi_send_position.
11543  *
11544  * Revision 1.14  1994/10/07  12:52:24  rob
11545  * Fixed some problems.
11546  *
11547  * Revision 1.13  1994/10/07  11:25:47  rob
11548  * Tried to fix modem to work with new multi stuff.  Still a bit jacked up, tho.
11549  *
11550  * Revision 1.12  1994/10/05  19:14:50  rob
11551  * Exported macros and arrays to support network object mapping.
11552  *
11553  * Revision 1.11  1994/10/05  17:48:59  rob
11554  * Several changes, most to end_of_level sequencing.
11555  *
11556  * Revision 1.10  1994/10/05  14:22:54  rob
11557  * Added com_end_level.
11558  *
11559  * Revision 1.9  1994/09/30  18:37:22  rob
11560  * Another day's worth of work.  Mostly menus, error checking.  Added
11561  * level checksums during sync, carrier detect during all com calls,
11562  * generic com_abort() procedure for bailing out, and nm_messagebox
11563  * handling of QUIT instead of HUD message (which never gets seen).
11564  *
11565  * Revision 1.8  1994/09/29  20:55:16  rob
11566  * Lots of changes.
11567  *
11568  * Revision 1.7  1994/09/29  16:09:20  rob
11569  * Added explode stuff.
11570  *
11571  * Revision 1.6  1994/09/28  14:31:08  rob
11572  * Added serial setup menu.
11573  *
11574  * Revision 1.5  1994/09/27  15:02:49  rob
11575  * Null modem basic routines working.  Sending DEAD messages and
11576  * missiles still need to be done.
11577  *
11578  * Revision 1.4  1994/09/24  16:52:33  rob
11579  * Added stubbed funcs for startup and stop of serial games.
11580  *
11581  * Revision 1.3  1994/09/24  14:47:31  rob
11582  * New function protos.
11583  *
11584  * Revision 1.2  1994/09/22  17:53:29  rob
11585  * First revision, not yet functional.
11586  *
11587  * Revision 1.1  1994/09/22  12:39:25  rob
11588  * Initial revision
11589
11590 ------------------------------------------------------------------------
11591 main/morph.c:
11592
11593  * Revision 1.5  1995/08/23  21:36:10  allender
11594  * mcc compiler warnings fixed
11595  *
11596  * Revision 1.4  1995/08/12  11:34:19  allender
11597  * removed #ifdef NEWDEMO -- always in
11598  *
11599  * Revision 1.3  1995/07/28  15:39:51  allender
11600  * removed fixdiv thing
11601  *
11602  * Revision 1.2  1995/07/28  15:21:23  allender
11603  * inverse magnitude fixup thing
11604  *
11605  * Revision 1.1  1995/05/16  15:28:05  allender
11606  * Initial revision
11607  *
11608  * Revision 2.1  1995/02/27  18:26:33  john
11609  * Fixed bug that was caused by externing Polygon_models, and I had
11610  * changed the type of it in polyobj.c, thus causing page faults.
11611  *
11612  * Revision 2.0  1995/02/27  11:27:44  john
11613  * New version 2.0, which has no anonymous unions, builds with
11614  * Watcom 10.0, and doesn't require parsing BITMAPS.TBL.
11615  *
11616  * Revision 1.35  1995/02/22  14:45:37  allender
11617  * remove anonymous unions from object structure
11618  *
11619  * Revision 1.34  1995/01/14  19:16:52  john
11620  * First version of new bitmap paging code.
11621  *
11622  * Revision 1.33  1995/01/03  20:38:36  john
11623  * Externed MAX_MORPH_OBJECTS
11624  *
11625  * Revision 1.32  1994/11/17  15:34:04  matt
11626  * Attempt #4 to fix morph bug
11627  *
11628  * Revision 1.31  1994/11/15  10:57:14  matt
11629  * Tried again to fix morph
11630  *
11631  * Revision 1.30  1994/11/14  14:06:45  matt
11632  * Fixed stupid bug
11633  *
11634  * Revision 1.29  1994/11/14  11:55:13  matt
11635  * Added divide overflow check
11636  *
11637  * Revision 1.28  1994/09/26  17:28:14  matt
11638  * Made new multiple-object morph code work with the demo system
11639  *
11640  * Revision 1.27  1994/09/26  15:39:56  matt
11641  * Allow multiple simultaneous morphing objects
11642  *
11643  * Revision 1.26  1994/09/11  22:44:59  mike
11644  * quick on vecmat function.
11645  *
11646  * Revision 1.25  1994/08/26  15:36:00  matt
11647  * Made eclips usable on more than one object at a time
11648  *
11649  * Revision 1.24  1994/07/25  00:02:46  matt
11650  * Various changes to accomodate new 3d, which no longer takes point numbers
11651  * as parms, and now only takes pointers to points.
11652  *
11653  * Revision 1.23  1994/07/12  12:39:58  matt
11654  * Revamped physics system
11655  *
11656  * Revision 1.22  1994/06/28  11:54:51  john
11657  * Made newdemo system record/play directly to/from disk, so
11658  * we don't need the 4 MB buffer anymore.
11659  *
11660  * Revision 1.21  1994/06/27  15:53:01  john
11661  * #define'd out the newdemo stuff
11662  *
11663  *
11664  * Revision 1.20  1994/06/16  14:30:19  matt
11665  * Moved morph record data call to reder routine
11666  *
11667  * Revision 1.19  1994/06/16  13:57:23  matt
11668  * Added support for morphing objects in demos
11669  *
11670  * Revision 1.18  1994/06/16  12:24:23  matt
11671  * Made robot lighting not mess with Lighting_on so robots now night
11672  * according to this variable.
11673  *
11674  * Revision 1.17  1994/06/14  16:55:01  matt
11675  * Got rid of physics_object speed field
11676  *
11677  * Revision 1.16  1994/06/08  21:16:29  matt
11678  * Made objects spin while morphing
11679  *
11680  * Revision 1.15  1994/06/08  18:21:53  matt
11681  * Made morphing objects light correctly
11682  *
11683  * Revision 1.14  1994/06/07  16:50:49  matt
11684  * Made object lighting work correctly; changed name of Ambient_light to
11685  * Dynamic_light; cleaned up polygobj object rendering a little.
11686  *
11687  * Revision 1.13  1994/06/01  16:33:59  yuan
11688  * Fixed bug.
11689  *
11690  *
11691  * Revision 1.12  1994/06/01  16:29:08  matt
11692  * If morph_frame called on object this isn't the morph object, kill it.
11693  *
11694  * Revision 1.11  1994/06/01  12:46:34  matt
11695  * Added needed include
11696  *
11697  * Revision 1.10  1994/05/31  22:12:41  matt
11698  * Set lighting for morph objects
11699  * Don't let another object start morph while one is morphing, unless
11700  * that one dies.
11701  *
11702  * Revision 1.9  1994/05/31  18:49:53  john
11703  * Took out debugging printf's that Matt left in.
11704  *
11705  * Revision 1.8  1994/05/30  22:50:22  matt
11706  * Added morph effect for robots
11707
11708 ------------------------------------------------------------------------
11709 main/morph.h:
11710
11711  * Revision 1.2  1995/08/23  21:35:58  allender
11712  * fix mcc compiler warnings
11713  *
11714  * Revision 1.1  1995/05/16  15:59:37  allender
11715  * Initial revision
11716  *
11717  * Revision 2.0  1995/02/27  11:32:19  john
11718  * New version 2.0, which has no anonymous unions, builds with
11719  * Watcom 10.0, and doesn't require parsing BITMAPS.TBL.
11720  *
11721  * Revision 1.9  1995/01/04  12:20:46  john
11722  * Declearations to work better with game state save.
11723  *
11724  *
11725  * Revision 1.8  1995/01/03  20:38:44  john
11726  * Externed MAX_MORPH_OBJECTS
11727  *
11728  * Revision 1.7  1994/09/26  17:28:33  matt
11729  * Made new multiple-object morph code work with the demo system
11730  *
11731  * Revision 1.6  1994/09/26  15:40:17  matt
11732  * Allow multiple simultaneous morphing objects
11733  *
11734  * Revision 1.5  1994/06/28  11:55:19  john
11735  * Made newdemo system record/play directly to/from disk, so
11736  * we don't need the 4 MB buffer anymore.
11737  *
11738  * Revision 1.4  1994/06/16  13:57:40  matt
11739  * Added support for morphing objects in demos
11740  *
11741  * Revision 1.3  1994/06/08  18:22:03  matt
11742  * Made morphing objects light correctly
11743  *
11744  * Revision 1.2  1994/05/30  22:50:25  matt
11745  * Added morph effect for robots
11746  *
11747  * Revision 1.1  1994/05/30  12:04:19  matt
11748  * Initial revision
11749
11750 ------------------------------------------------------------------------
11751 main/multi.h:
11752
11753  * Revision 2.3  1995/04/03  08:49:50  john
11754  * Added code to get someone's player struct.
11755  *
11756  * Revision 2.2  1995/03/27  12:59:17  john
11757  * Initial version of multiplayer save games.
11758  *
11759  * Revision 2.1  1995/03/21  14:39:06  john
11760  * Ifdef'd out the NETWORK code.
11761  *
11762  * Revision 2.0  1995/02/27  11:28:34  john
11763  * New version 2.0, which has no anonymous unions, builds with
11764  * Watcom 10.0, and doesn't require parsing BITMAPS.TBL.
11765  *
11766  * Revision 1.74  1995/02/11  11:36:42  rob
11767  * Added new var.
11768  *
11769  * Revision 1.73  1995/02/08  18:17:41  rob
11770  * Added prototype for reset function.
11771  *
11772  * Revision 1.72  1995/02/05  14:37:42  rob
11773  * Made object mapping more efficient.
11774  *
11775  * Revision 1.71  1995/02/01  18:07:36  rob
11776  * Change object mapping to int functions.
11777  *
11778  * Revision 1.70  1995/02/01  12:55:00  rob
11779  * Changed message type.
11780  *
11781  * Revision 1.69  1995/01/31  12:46:12  rob
11782  * Fixed a bug with object overflow handling.
11783  *
11784  * Revision 1.68  1995/01/27  11:15:13  rob
11785  * removed extern of variable no longer in multi.c
11786  *
11787  * Revision 1.67  1995/01/24  11:53:13  john
11788  * Added better macro defining code.
11789  *
11790  * Revision 1.66  1995/01/24  11:32:03  john
11791  * Added new defining macro method.
11792  *
11793  * Revision 1.65  1995/01/23  17:17:06  john
11794  * Added multi_sending_message.
11795  *
11796  * Revision 1.64  1995/01/23  16:02:42  rob
11797  * Added prototype for mission select function.
11798  *
11799  * Revision 1.63  1995/01/18  19:01:21  rob
11800  * Added new message for hostage door sync.
11801  *
11802  * Revision 1.62  1995/01/14  18:39:57  rob
11803  * Added new message type for dropping robot powerups.
11804  *
11805  * Revision 1.61  1995/01/12  21:41:13  rob
11806  * Fixed incompat. with 1.0 and 1.1.
11807  *
11808  * Revision 1.60  1995/01/04  21:40:55  rob
11809  * Added new type for boss actions in coop.
11810  *
11811  * Revision 1.59  1995/01/04  11:38:09  rob
11812  * Fixed problem with lost character in messages.
11813  *
11814  * Revision 1.58  1995/01/03  20:12:44  rob
11815  * Made max message length in shareware = 40.
11816  *
11817  * Revision 1.57  1995/01/03  14:27:25  rob
11818  * ADded trigger messages.
11819  *
11820  * Revision 1.56  1995/01/02  20:08:21  rob
11821  * Added robot creation.
11822  *
11823  * Revision 1.55  1995/01/02  14:41:30  rob
11824  * Added score syncing.
11825  *
11826  * Revision 1.54  1994/12/21  21:02:01  rob
11827  * Added new message type for ROBOT_FIRE
11828  *
11829  * Revision 1.53  1994/12/21  17:27:25  rob
11830  * Changed the format for send_create_powerup messages.
11831  *
11832  *
11833  * Revision 1.52  1994/12/20  20:41:39  rob
11834  * ADded robot release message type.
11835  *
11836  * Revision 1.51  1994/12/19  19:00:12  rob
11837  * Changed buf to multibuf so it can be safely externed.
11838  *
11839  * Revision 1.50  1994/12/19  16:41:14  rob
11840  * Added new message types for robot support.
11841  * Added prototype for external use of multi_send_data (from multibot.c)
11842  *
11843  * Revision 1.49  1994/12/11  13:30:13  rob
11844  * Added new variables to get players out of nested menus.
11845  *
11846  * Revision 1.48  1994/12/11  01:58:57  rob
11847  * Added variable to track menu deth..
11848  *
11849  * Revision 1.47  1994/12/08  12:41:17  rob
11850  * Added audio taunts.
11851  *
11852  * Revision 1.46  1994/12/07  21:53:12  rob
11853  * Fixing sequencing bugginess in modem/serial.
11854  *
11855  * Revision 1.45  1994/12/07  16:46:58  rob
11856  * Added prototype.
11857  *
11858  * Revision 1.44  1994/12/01  12:22:31  rob
11859  * Added de-cloak message for demo.
11860  *
11861  * Revision 1.43  1994/12/01  00:54:14  rob
11862  * Added variable for tracking homing missiles.
11863  *
11864  * Revision 1.42  1994/11/30  16:04:39  rob
11865  * Added show reticle name variable for team games.
11866  *
11867  * Revision 1.41  1994/11/29  19:33:38  rob
11868  * Team support.
11869  *
11870  * Revision 1.40  1994/11/29  12:49:37  rob
11871  * Added more team support stuff.
11872  *
11873  * Revision 1.39  1994/11/28  21:20:49  rob
11874  * Cleaned up the .h file, removed an unused function.
11875  *
11876  * Revision 1.38  1994/11/28  21:04:50  rob
11877  * Added support for network sound-casting.
11878  *
11879  * Revision 1.37  1994/11/28  14:02:08  rob
11880  * Added protocol versioning for registered versus shareware.
11881  *
11882  * Revision 1.36  1994/11/28  13:30:04  rob
11883  * Added a define for protocol version.
11884  *
11885  * Revision 1.35  1994/11/22  19:19:48  rob
11886  * remove unused function.
11887  *
11888  * Revision 1.34  1994/11/22  18:47:34  rob
11889  * Added hooks for modem support for secret levels.
11890  *
11891  * Revision 1.33  1994/11/22  17:10:50  rob
11892  * Fix for secret levels in network play mode.
11893  *
11894  * Revision 1.32  1994/11/21  16:00:28  rob
11895  * Added secret-level hooks.
11896  *
11897  * Revision 1.31  1994/11/18  18:28:50  rob
11898  * Added new function for multiplayer score screen.
11899  *
11900  * Revision 1.30  1994/11/18  16:31:05  rob
11901  * Added kill list timer variable.
11902  *
11903  * Revision 1.29  1994/11/17  16:38:15  rob
11904  * Added creation of net powerups.
11905  *
11906  * Revision 1.28  1994/11/17  13:37:33  rob
11907  * Added prototype for multi_new_game.
11908  *
11909  * Revision 1.27  1994/11/17  12:58:45  rob
11910  * Added kill matrix.
11911  *
11912  * Revision 1.26  1994/11/16  20:35:24  rob
11913  * Changed explosion hook.
11914  *
11915  * Revision 1.25  1994/11/15  21:31:13  rob
11916  * Bumped max message size, was giving modem.c fits.
11917  *
11918  * Revision 1.24  1994/11/15  19:28:37  matt
11919  * Added prototypes
11920  *
11921  * Revision 1.23  1994/11/14  17:22:19  rob
11922  * Added extern for message macros.
11923  *
11924  * Revision 1.22  1994/11/11  18:16:44  rob
11925  * Made multi_menu_poll return a value to exit menus.
11926  *
11927  * Revision 1.21  1994/11/11  11:06:19  rob
11928  * Added prototype for multi_menu_poll.
11929  *
11930  * Revision 1.20  1994/11/10  21:48:41  rob
11931  * Changed multi_endlevel to return an int.
11932  *
11933  * Revision 1.19  1994/11/08  17:48:14  rob
11934  * Fixing endlevel stuff.
11935  *
11936  * Revision 1.18  1994/11/07  17:49:07  rob
11937  * Changed prototype for object mapping funcs.
11938  *
11939  * Revision 1.17  1994/11/07  15:46:32  rob
11940  * Changed the way remote object number mapping works, and it was a real
11941  * pain in the ass..  I think it will work more reliably now.
11942  *
11943  * Revision 1.16  1994/11/04  19:53:01  rob
11944  * Added a new message type for Player_leave 'explosions'.
11945  * Added a prototype for function moved over from network.c
11946  *
11947  * Revision 1.15  1994/11/02  18:02:33  rob
11948  * Added message type for control center firing.
11949  *
11950  * Revision 1.14  1994/11/02  11:38:00  rob
11951  * Added player-in-process-of-dying explosions to network game.
11952  *
11953  * Revision 1.13  1994/11/01  19:31:44  rob
11954  * Bumped max_net_create_objects to 20 to accomodate a fully equipped
11955  * character blowing up.
11956  *
11957  * Revision 1.12  1994/10/31  13:48:02  rob
11958  * Fixed bug in opening doors over network/modem.  Added a new message
11959  * type to multi.c that communicates door openings across the net.
11960  * Changed includes in multi.c and wall.c to accomplish this.
11961  *
11962  * Revision 1.11  1994/10/09  20:08:20  rob
11963  * Added some exported func prototypes.
11964  * Changed max net message length to 25 (from 30).
11965  * Removed some message types no longer used.
11966  *
11967  * Revision 1.10  1994/10/08  20:06:10  rob
11968  * fixed a typo.
11969  *
11970  * Revision 1.9  1994/10/08  19:59:43  rob
11971  * Moved MAX_MESSAGE_LEN to here.
11972  *
11973  * Revision 1.8  1994/10/07  23:09:54  rob
11974  * Fixed some prototypes.
11975  *
11976  * Revision 1.7  1994/10/07  18:11:19  rob
11977  * Added multi_do_death to multi.c.
11978  *
11979  * Revision 1.6  1994/10/07  16:14:32  rob
11980  * Added new message type for player reappear
11981  *
11982  * Revision 1.5  1994/10/07  12:58:17  rob
11983  * Added multi_leave_game.
11984  *
11985  * Revision 1.4  1994/10/07  12:17:17  rob
11986  * Fixed some stuff in multi_do_frame and exported the message_length
11987  * array.
11988  *
11989  * Revision 1.3  1994/10/07  11:10:17  john
11990  * Added function to parse multiple messages into individual
11991  * messages.
11992  *
11993  * Revision 1.2  1994/10/07  10:28:06  rob
11994  * Headers and stuff for multi.c (obviously)
11995  *
11996  * Revision 1.1  1994/10/06  16:07:39  rob
11997  * Initial revision
11998
11999 ------------------------------------------------------------------------
12000 main/multibot.h:
12001
12002  * Revision 1.2  1995/08/24  16:04:38  allender
12003  * fix function prototype for compiler warning
12004  *
12005  * Revision 1.1  1995/05/16  15:59:53  allender
12006  * Initial revision
12007  *
12008  * Revision 2.1  1995/03/21  14:40:18  john
12009  * Ifdef'd out the NETWORK code.
12010  *
12011  * Revision 2.0  1995/02/27  11:30:57  john
12012  * New version 2.0, which has no anonymous unions, builds with
12013  * Watcom 10.0, and doesn't require parsing BITMAPS.TBL.
12014  *
12015  * Revision 1.20  1995/02/06  18:18:05  rob
12016  * Tweaking cooperative stuff.
12017  *
12018  * Revision 1.19  1995/02/04  16:49:50  rob
12019  * Changed multi_send_robot_frame to return the number of robot positions that were sent.
12020  *
12021  * Revision 1.18  1995/02/04  12:29:32  rob
12022  * Added buffered fire sends.
12023  *
12024  * Revision 1.17  1995/01/30  17:22:02  rob
12025  * Added prototype for modem robot send function.
12026  *
12027  * Revision 1.16  1995/01/26  18:24:56  rob
12028  * Reduced # of controlled bots.
12029  *
12030  * Revision 1.15  1995/01/25  19:26:35  rob
12031  * Added define for robot laser agitation.
12032  *
12033  * Revision 1.14  1995/01/25  13:45:26  rob
12034  * Added prototype of robot transfer fucm.
12035  *
12036  * Revision 1.13  1995/01/14  19:01:08  rob
12037  * Added prototypes for new functionality.
12038  *
12039  * Revision 1.12  1995/01/12  16:41:53  rob
12040  * Added new prototypes.
12041  *
12042  * Revision 1.11  1995/01/12  15:42:55  rob
12043  * Fixing score awards for coop.
12044  *
12045  * Revision 1.10  1995/01/02  21:00:40  rob
12046  * added robot matcen support.
12047  *
12048  * Revision 1.9  1994/12/31  21:03:53  rob
12049  * More tweaking for robot behavior.
12050  *
12051  * Revision 1.8  1994/12/29  13:54:25  rob
12052  * Ooops.. fixed a bug..
12053  *
12054  * Revision 1.7  1994/12/29  12:51:38  rob
12055  * ADded proto for multi_robot_explode_sub
12056  *
12057  * Revision 1.6  1994/12/21  21:08:32  rob
12058  * Added new functions for robot firing.
12059  *
12060  * Revision 1.5  1994/12/21  19:04:02  rob
12061  * Fixing score accounting for multi robot games.
12062  *
12063  * Revision 1.4  1994/12/21  17:36:09  rob
12064  * Added a new func.
12065  *
12066  * Revision 1.3  1994/12/21  11:12:02  rob
12067  * Added new function and new vars.
12068  *
12069  * Revision 1.2  1994/12/19  16:41:42  rob
12070  * first revision.
12071  *
12072  * Revision 1.1  1994/12/16  15:48:20  rob
12073  * Initial revision
12074
12075 ------------------------------------------------------------------------
12076 main/netmisc.c:
12077
12078  * Revision 1.1  1995/05/16  15:28:41  allender
12079  * Initial revision
12080  *
12081  * Revision 2.0  1995/02/27  11:27:24  john
12082  * New version 2.0, which has no anonymous unions, builds with
12083  * Watcom 10.0, and doesn't require parsing BITMAPS.TBL.
12084  *
12085  * Revision 1.3  1994/11/19  15:19:34  mike
12086  * rip out unused code and data.
12087  *
12088  * Revision 1.2  1994/08/09  19:31:53  john
12089  * Networking changes.
12090  *
12091  * Revision 1.1  1994/08/08  11:06:07  john
12092  * Initial revision
12093
12094 ------------------------------------------------------------------------
12095 main/netmisc.h:
12096
12097  * Revision 1.1  1995/05/16  16:00:08  allender
12098  * Initial revision
12099  *
12100  * Revision 2.0  1995/02/27  11:30:18  john
12101  * New version 2.0, which has no anonymous unions, builds with
12102  * Watcom 10.0, and doesn't require parsing BITMAPS.TBL.
12103  *
12104  * Revision 1.2  1994/08/09  19:31:54  john
12105  * Networking changes.
12106  *
12107  * Revision 1.1  1994/08/08  11:18:40  john
12108  * Initial revision
12109
12110 ------------------------------------------------------------------------
12111 main/network.h:
12112
12113  * Revision 1.7  1995/10/31  10:20:04  allender
12114  * shareware stuff
12115  *
12116  * Revision 1.6  1995/09/21  14:31:18  allender
12117  * new appltalk type packet which contains shortpos
12118  *
12119  * Revision 1.5  1995/09/18  08:07:08  allender
12120  * added function prototype to remove netgame NBP
12121  *
12122  * Revision 1.4  1995/08/31  15:51:55  allender
12123  * new prototypes for join and start games
12124  *
12125  * Revision 1.3  1995/07/26  17:02:29  allender
12126  * implemented and working on mac
12127  *
12128  * Revision 1.2  1995/06/02  07:42:34  allender
12129  * fixed prototype for network_endlevel_poll2
12130  *
12131  * Revision 1.1  1995/05/16  16:00:15  allender
12132  * Initial revision
12133  *
12134  * Revision 2.2  1995/03/21  14:58:09  john
12135  * *** empty log message ***
12136  *
12137  * Revision 2.1  1995/03/21  14:39:43  john
12138  * Ifdef'd out the NETWORK code.
12139  *
12140  * Revision 2.0  1995/02/27  11:29:48  john
12141  * New version 2.0, which has no anonymous unions, builds with
12142  * Watcom 10.0, and doesn't require parsing BITMAPS.TBL.
12143  *
12144  * Revision 1.72  1995/02/11  14:24:39  rob
12145  * Added suppor for invul. cntrlcen.
12146  *
12147  * Revision 1.71  1995/02/08  19:18:43  rob
12148  * Added extern for segments checksum.
12149  *
12150  * Revision 1.70  1995/02/08  11:01:16  rob
12151  * Fixed a bug.
12152  *
12153  * Revision 1.69  1995/02/07  21:16:49  rob
12154  * Added flag for automap.
12155  *
12156  * Revision 1.68  1995/02/06  18:18:33  rob
12157  * Extern'ed Packet Urgent.
12158  *
12159  * Revision 1.67  1995/02/05  14:36:29  rob
12160  * Moved defines to network.h.
12161  *
12162  * Revision 1.66  1995/02/01  16:34:09  john
12163  * Linted.
12164  *
12165  * Revision 1.65  1995/01/30  21:14:35  rob
12166  * Fixed a bug in join menu.
12167  * Simplified mission load support.
12168  *
12169  * Revision 1.64  1995/01/30  18:19:40  rob
12170  * Added mission title to gameinfo packet.
12171  *
12172  * Revision 1.63  1995/01/28  17:02:39  rob
12173  * Fixed monitor syncing bug (minor 19).
12174  *
12175  * Revision 1.62  1995/01/27  11:15:25  rob
12176  * removed extern of variable no longer in network.c
12177  *
12178  * Revision 1.61  1995/01/26  12:17:34  rob
12179  * Added new param to network_do_frame.
12180  *
12181  * Revision 1.60  1995/01/22  17:32:11  rob
12182  * Added mission support for network games.
12183  *
12184  * Revision 1.59  1995/01/17  17:10:33  rob
12185  * Added some flags to netgame struct.
12186  *
12187  * Revision 1.58  1995/01/12  18:57:15  rob
12188  * Added score resync stuff.
12189  *
12190  * Revision 1.57  1995/01/12  16:42:18  rob
12191  * Added new prototypes.
12192  *
12193  * Revision 1.56  1995/01/05  12:12:10  rob
12194  * Fixed a problem with packet size.
12195  *
12196  * Revision 1.55  1995/01/05  11:12:36  rob
12197  * Reduced packet size by 1 byte just to be safe.
12198  *
12199  * Revision 1.54  1995/01/04  21:39:32  rob
12200  * New framedata packet for registered.
12201  *
12202  * Revision 1.53  1995/01/04  08:47:04  rob
12203  * JOHN CHECKED IN FOR ROB !!!
12204  *
12205  * Revision 1.52  1994/12/30  20:09:07  rob
12206  * ADded a toggle for showing player names on HUD.
12207  *
12208  * Revision 1.51  1994/12/29  15:59:52  rob
12209  * Centralized network disconnects.
12210  *
12211  * Revision 1.50  1994/12/09  21:21:57  rob
12212  * rolled back changes.
12213  *
12214  * Revision 1.48  1994/12/05  22:59:27  rob
12215  * added prototype for send_endlevel_packet.
12216  *
12217  * Revision 1.47  1994/12/05  21:47:34  rob
12218  * Added a new field to netgame struct.
12219  *
12220  * Revision 1.46  1994/12/05  14:39:16  rob
12221  * Added new variable to indicate new net game starting.
12222  *
12223  * Revision 1.45  1994/12/04  15:37:18  rob
12224  * Fixed a typo.
12225  *
12226  * Revision 1.44  1994/12/04  15:30:42  rob
12227  * Added new fields to netgame struct.
12228  *
12229  * Revision 1.43  1994/12/03  18:03:19  rob
12230  * ADded team kill syncing.
12231  *
12232  * Revision 1.42  1994/12/01  21:21:27  rob
12233  * Added new system for object sync on rejoin.
12234  *
12235  * Revision 1.41  1994/11/29  13:07:33  rob
12236  * Changed structure defs to .h files.
12237  *
12238  * Revision 1.40  1994/11/22  17:10:48  rob
12239  * Fix for secret levels in network play mode.
12240  *
12241  * Revision 1.39  1994/11/18  16:36:31  rob
12242  * Added variable network_rejoined to enable random placement
12243  * of rejoining palyers.
12244  *
12245  * Revision 1.38  1994/11/12  19:51:13  rob
12246  * Changed prototype for network_send_data to pass
12247  * urgent flag.
12248  *
12249  * Revision 1.37  1994/11/10  21:48:26  rob
12250  * Changed net_endlevel to return an int.
12251  *
12252  * Revision 1.36  1994/11/10  20:32:49  rob
12253  * Added extern for LastPacketTime.
12254  *
12255  * Revision 1.35  1994/11/09  11:36:34  rob
12256  * ADded return value to network_level_sync for success/fail.
12257  *
12258  * Revision 1.34  1994/11/08  21:22:31  rob
12259  * Added proto for network_endlevel_snyc
12260  *
12261  * Revision 1.33  1994/11/08  15:20:00  rob
12262  * added proto for change_playernum_to
12263  *
12264  * Revision 1.32  1994/11/07  17:45:40  rob
12265  * Added prototype for network_endlevel (called from multi.c)
12266  *
12267  * Revision 1.31  1994/11/04  19:52:37  rob
12268  * Removed a function from network.h (network_show_player_list)
12269  *
12270  * Revision 1.30  1994/11/01  19:39:26  rob
12271  * Removed a couple of variables that should be externed from multi.c
12272  * (remnants of the changover)
12273  *
12274  * Revision 1.29  1994/10/31  19:18:24  rob
12275  * Changed prototype for network_do_frame to add a parameter if you wish
12276  * to force the frame to be sent.  Important if this is a leave_game frame.
12277  *
12278  * Revision 1.28  1994/10/08  19:59:20  rob
12279  * Removed network message variables.
12280  *
12281  * Revision 1.27  1994/10/08  11:08:38  john
12282  * Moved network_delete_unused objects into multi.c,
12283  * took out network callsign stuff and used Matt's net
12284  * players[.].callsign stuff.
12285  *
12286  * Revision 1.26  1994/10/07  11:26:20  rob
12287  * Changed network_start_frame to network_do_frame,.
12288  *
12289  *
12290  * Revision 1.25  1994/10/05  13:58:10  rob
12291  * Added a new function net_endlevel that is called after each level is
12292  * completed.  Currently it only does anything if SERIAL game is in effect.
12293  *
12294  * Revision 1.24  1994/10/04  19:34:57  rob
12295  * export network_find_max_net_players.
12296  *
12297  * Revision 1.23  1994/10/04  17:31:10  rob
12298  * Exported MaxNumNetPlayers.
12299  *
12300  * Revision 1.22  1994/10/03  22:57:30  matt
12301  * Took out redundant definition of callsign_len
12302  *
12303  * Revision 1.21  1994/10/03  15:12:48  rob
12304  * Boosted MAX_CREATE_OBJECTS to 15.
12305  *
12306  * Revision 1.20  1994/09/30  18:19:51  rob
12307  * Added two new variables for tracking object creation.
12308  *
12309  * Revision 1.19  1994/09/27  15:03:18  rob
12310  * Added prototype for network_delete_extra_objects used by modem.c
12311  *
12312  * Revision 1.18  1994/09/27  14:36:45  rob
12313  * Added two new varaibles for network/serial weapon firing.
12314  *
12315  * Revision 1.17  1994/09/07  17:10:57  john
12316  * Started adding code to sync powerups.
12317  *
12318  * Revision 1.16  1994/09/06  19:29:05  john
12319  * Added trial version of rejoin function.
12320  *
12321  * Revision 1.15  1994/08/26  13:01:54  john
12322  * Put high score system in.
12323  *
12324  * Revision 1.14  1994/08/25  18:12:04  matt
12325  * Made player's weapons and flares fire from the positions on the 3d model.
12326  * Also added support for quad lasers.
12327  *
12328  * Revision 1.13  1994/08/17  16:50:00  john
12329  * Added damaging fireballs, missiles.
12330  *
12331  * Revision 1.12  1994/08/16  12:25:22  john
12332  * Added hooks for sending messages.
12333  *
12334  * Revision 1.11  1994/08/13  12:20:18  john
12335  * Made the networking uise the Players array.
12336  *
12337  * Revision 1.10  1994/08/12  22:41:27  john
12338  * Took away Player_stats; add Players array.
12339  *
12340  * Revision 1.9  1994/08/12  03:10:22  john
12341  * Made network be default off; Moved network options into
12342  * main menu.  Made starting net game check that mines are the
12343  * same.
12344  *
12345  * Revision 1.8  1994/08/11  21:57:08  john
12346  * Moved network options to main menu.
12347  *
12348  * Revision 1.7  1994/08/10  11:29:20  john
12349  * *** empty log message ***
12350  *
12351  * Revision 1.6  1994/08/10  10:44:12  john
12352  * Made net players fire..
12353  *
12354  * Revision 1.5  1994/08/09  19:31:46  john
12355  * Networking changes.
12356  *
12357  * Revision 1.4  1994/08/05  16:30:26  john
12358  * Added capability to turn off network.
12359  *
12360  * Revision 1.3  1994/08/05  16:11:43  john
12361  * Psuedo working version of networking.
12362  *
12363  * Revision 1.2  1994/07/25  12:33:34  john
12364  * Network "pinging" in.
12365  *
12366  * Revision 1.1  1994/07/20  16:09:05  john
12367  * Initial revision
12368
12369 ------------------------------------------------------------------------
12370 main/newdemo.c:
12371
12372  * Revision 1.12  1995/10/31  10:19:43  allender
12373  * shareware stuff
12374  *
12375  * Revision 1.11  1995/10/17  13:19:16  allender
12376  * close boxes for demo save
12377  *
12378  * Revision 1.10  1995/10/05  10:36:07  allender
12379  * fixed calls to digi_play_sample to account for differing volume and angle calculations
12380  *
12381  * Revision 1.9  1995/09/12  15:49:13  allender
12382  * define __useAppleExts__ if not already defined
12383  *
12384  * Revision 1.8  1995/09/05  14:28:32  allender
12385  * fixed previous N_players bug in newdemo_goto_end
12386  *
12387  * Revision 1.7  1995/09/05  14:16:51  allender
12388  * added space to allowable demo filename characters
12389  * and fixed bug with netgame demos N_players got getting
12390  * set correctly
12391  *
12392  * Revision 1.6  1995/09/01  16:10:47  allender
12393  * fixed bug with reading in N_players variable on
12394  * netgame demo playback
12395  *
12396  * Revision 1.5  1995/08/24  16:04:11  allender
12397  * fix signed byte problem
12398  *
12399  * Revision 1.4  1995/08/12  12:21:59  allender
12400  * made call to create_shortpos not swap the shortpos
12401  * elements
12402  *
12403  * Revision 1.3  1995/08/01  16:04:19  allender
12404  * made random picking of demo work
12405  *
12406  * Revision 1.2  1995/08/01  13:56:56  allender
12407  * demo system working on the mac
12408  *
12409  * Revision 1.1  1995/05/16  15:28:59  allender
12410  * Initial revision
12411  *
12412  * Revision 2.7  1995/05/26  16:16:06  john
12413  * Split SATURN into define's for requiring cd, using cd, etc.
12414  * Also started adding all the Rockwell stuff.
12415  *
12416  * Revision 2.6  1995/03/21  14:39:38  john
12417  * Ifdef'd out the NETWORK code.
12418  *
12419  * Revision 2.5  1995/03/14  18:24:31  john
12420  * Force Destination Saturn to use CD-ROM drive.
12421  *
12422  * Revision 2.4  1995/03/14  16:22:29  john
12423  * Added cdrom alternate directory stuff.
12424  *
12425  * Revision 2.3  1995/03/10  12:58:33  allender
12426  * only display rear view cockpit when cockpit mode was CM_FULL_COCKPIT.
12427  *
12428  * Revision 2.2  1995/03/08  16:12:15  allender
12429  * changes for Destination Saturn
12430  *
12431  * Revision 2.1  1995/03/08  12:11:26  allender
12432  * fix shortpos reading
12433  *
12434  * Revision 2.0  1995/02/27  11:29:40  john
12435  * New version 2.0, which has no anonymous unions, builds with
12436  * Watcom 10.0, and doesn't require parsing BITMAPS.TBL.
12437  *
12438  * Revision 1.189  1995/02/22  14:53:42  allender
12439  * missed some anonymous stuff
12440  *
12441  * Revision 1.188  1995/02/22  13:24:53  john
12442  * Removed the vecmat anonymous unions.
12443  *
12444  * Revision 1.187  1995/02/22  13:13:54  allender
12445  * remove anonymous unions from object structure
12446  *
12447  * Revision 1.186  1995/02/14  15:36:41  allender
12448  * fix fix for morph effect
12449  *
12450  * Revision 1.185  1995/02/14  11:25:48  allender
12451  * save cockpit mode and restore after playback.  get orientation for morph
12452  * effect when object is morph vclip
12453  *
12454  * Revision 1.184  1995/02/13  12:18:14  allender
12455  * change to decide about interpolating or not
12456  *
12457  * Revision 1.183  1995/02/12  00:46:23  adam
12458  * don't decide to skip frames until after at least 10 frames have
12459  * passed -- allender
12460  *
12461  * Revision 1.182  1995/02/11  22:34:01  john
12462  * Made textures page in for newdemos before playback time.
12463  *
12464  * Revision 1.181  1995/02/11  17:28:32  allender
12465  * strip frames from end of demo
12466  *
12467  * Revision 1.180  1995/02/11  16:40:35  allender
12468  * start of frame stripping debug code
12469  *
12470  * Revision 1.179  1995/02/10  17:40:06  allender
12471  * put back in wall_hit_process code to fix door problem
12472  *
12473  * Revision 1.178  1995/02/10  17:17:24  adam
12474  * allender } fix
12475  *
12476  * Revision 1.177  1995/02/10  17:16:24  allender
12477  * fix possible tmap problems
12478  *
12479  * Revision 1.176  1995/02/10  15:54:37  allender
12480  * changes for out of space on device.
12481  *
12482  * Revision 1.175  1995/02/09  19:55:00  allender
12483  * fix bug with morph recording -- force rendertype to RT_POLYOBJ when
12484  * playing back since it won't render until fully morphed otherwise
12485  *
12486  * Revision 1.174  1995/02/07  17:15:35  allender
12487  * DOH!!!!!
12488  *
12489  * Revision 1.173  1995/02/07  17:14:21  allender
12490  * immediately return when loading bogus level stuff when reading a frame
12491  *
12492  * Revision 1.172  1995/02/02  11:15:03  allender
12493  * after loading new level, read next frame (forward or back) always because
12494  * of co-op ships showing up when level is loaded
12495  *
12496  * Revision 1.171  1995/02/02  10:24:16  allender
12497  * removed cfile stuff.  Use standard FILE functions for demo playback
12498  *
12499  * Revision 1.170  1995/01/30  13:54:32  allender
12500  * support for missions
12501  *
12502  * Revision 1.169  1995/01/27  16:27:35  allender
12503  * put game mode to demo_game_mode when sorting multiplayer kill (and score)
12504  * list
12505  *
12506  * Revision 1.168  1995/01/27  09:52:25  allender
12507  * minor changes because of object/segment linking problems
12508  *
12509  * Revision 1.167  1995/01/27  09:22:28  allender
12510  * changed way multi-player score is recorded.  Record difference, not
12511  * actual
12512  *
12513  * Revision 1.166  1995/01/25  14:32:44  allender
12514  * changed with recorded player flags.  More checks for paused state
12515  * during interpolation reading of objects
12516  *
12517  * Revision 1.165  1995/01/25  11:23:32  allender
12518  * found bug with out of disk space problem
12519  *
12520  * Revision 1.164  1995/01/25  11:11:33  allender
12521  * coupla' things.  Fix problem with objects apparently being linked in
12522  * the wrong segment.  Put an Int3 in to check why demos will write to
12523  * end of space on drive. close demo file if demo doens't start playing
12524  * back.  Put obj->type == OBJ_ROBOT around checking for boss cloaking
12525  *
12526  * Revision 1.163  1995/01/24  19:44:30  allender
12527  * fix obscure problem with rewinding and having the wrong object linked
12528  * to the wrong segments.  will investigate further.
12529  *
12530  * Revision 1.162  1995/01/23  09:31:28  allender
12531  * add team score in team mode playback
12532  *
12533  * Revision 1.161  1995/01/20  22:47:39  matt
12534  * Mission system implemented, though imcompletely
12535  *
12536  * Revision 1.160  1995/01/20  09:30:37  allender
12537  * don't call LoadLevel with bogus data
12538  *
12539  * Revision 1.159  1995/01/20  09:13:23  allender
12540  * *&^%&*%$ typo
12541  *
12542  * Revision 1.158  1995/01/20  09:12:04  allender
12543  * record team names during demo recoring in GM_TEAM
12544  *
12545  * Revision 1.157  1995/01/19  16:31:09  allender
12546  * forgot to bump demo version for new weapon change stuff
12547  *
12548  * Revision 1.156  1995/01/19  16:29:33  allender
12549  * added new byte for weapon change (old weapon) so rewinding works
12550  * correctly for weapon changes in registered
12551  *
12552  * Revision 1.155  1995/01/19  15:00:05  allender
12553  * remove code to take away blastable walls in multiplayer demo playbacks
12554  *
12555  * Revision 1.154  1995/01/19  11:07:05  allender
12556  * put in psuedo cloaking for boss robots.  Problem is that cloaking is
12557  * time based, and that don't get done in demos, so bosses just disappear.
12558  * oh well
12559  *
12560  * Revision 1.153  1995/01/19  09:42:29  allender
12561  * record laser levels in demos
12562  *
12563  * Revision 1.152  1995/01/18  20:43:12  allender
12564  * fix laser level stuff on goto-beginning and goto-end
12565  *
12566  * Revision 1.151  1995/01/18  20:28:18  allender
12567  * cloak robots now cloak (except maybe for boss........)  Put in function
12568  * to deal with control center triggers
12569  *
12570  * Revision 1.150  1995/01/18  18:55:07  allender
12571  * bug fix
12572  *
12573  * Revision 1.149  1995/01/18  18:49:03  allender
12574  * lots 'o stuff....record laser level.  Record beginning of door opening
12575  * sequence.  Fix some problems with control center stuff.  Control center
12576  * triggers now work in reverse
12577  *
12578  * Revision 1.148  1995/01/18  08:51:40  allender
12579  * forgot to record ammo counts at beginning of demo
12580  *
12581  * Revision 1.147  1995/01/17  17:42:07  allender
12582  * added primary and secondary ammo counts.  Changed goto_end routine
12583  * to be more efficient
12584  *
12585  * Revision 1.146  1995/01/17  13:46:35  allender
12586  * fix problem with destroyed control center and rewinding a demo.
12587  * Save callsign and restore after demo playback
12588  *
12589  * Revision 1.145  1995/01/12  10:21:53  allender
12590  * fixes for 1.0 to 1.1 demo incompatibility
12591  *
12592  * Revision 1.144  1995/01/05  13:51:43  allender
12593  * fixed type of player num variable
12594  *
12595  * Revision 1.143  1995/01/04  16:58:28  allender
12596  * bumped up demo version number
12597  *
12598  * Revision 1.142  1995/01/04  14:59:02  allender
12599  * added more information to end of demo for registered.  Forced game mode
12600  * to be GM_NORMAL on demo playback
12601  *
12602  * Revision 1.141  1995/01/03  17:30:47  allender
12603  * fixed logic problem with cloak stuf
12604  *
12605  * Revision 1.140  1995/01/03  17:12:23  allender
12606  * fix for getting cloak stuff at end of demo for shareware
12607  *
12608  * Revision 1.139  1995/01/03  15:20:24  allender
12609  * fix goto_end for shareware -- changes to goto_end for registered
12610  *
12611  * Revision 1.138  1995/01/03  13:13:26  allender
12612  * add } I forgot
12613  *
12614  * Revision 1.137  1995/01/03  13:10:29  allender
12615  * make score work forwards and backwards
12616  *
12617  * Revision 1.136  1995/01/03  11:45:20  allender
12618  * added code to record players scores
12619  *
12620  * Revision 1.135  1994/12/30  10:03:57  allender
12621  * put cloak stuff at end of demo for fast forward to the end
12622  *
12623  * Revision 1.134  1994/12/29  17:02:55  allender
12624  * spelling fix on SHAREWARE
12625  *
12626  * Revision 1.133  1994/12/29  16:43:41  allender
12627  * lots of new multiplayer stuff.  wrapped much code with SHAREWARE defines
12628  *
12629  * Revision 1.132  1994/12/28  14:15:01  allender
12630  * added routines to deal with connecting and reconnecting players when
12631  * recording multiplayer demos
12632  *
12633  * Revision 1.131  1994/12/21  12:57:59  allender
12634  * bug fix
12635  *
12636  * Revision 1.130  1994/12/21  12:46:53  allender
12637  * record multi player deaths and kills
12638  *
12639  * Revision 1.129  1994/12/19  16:37:27  allender
12640  * pick good filename when trying to save in network play and player
12641  * gets bumped out of menu by multi-player code
12642  *
12643  * Revision 1.128  1994/12/14  10:49:01  allender
12644  * reset bad_read variable when starting demo playback
12645  *
12646  * Revision 1.127  1994/12/14  08:53:06  allender
12647  * lowered watermark for out of space
12648  *
12649  * Revision 1.126  1994/12/14  08:49:52  allender
12650  * put up warning when starting demo recording if not enough space and
12651  * not let them record
12652  *
12653  * Revision 1.125  1994/12/13  00:01:37  allender
12654  * CLOAK FIX -- (I'm tempted to take cloak out of game because I can't
12655  * seem to get it right in demo playback)
12656  *
12657  * Revision 1.124  1994/12/12  14:51:21  allender
12658  * more fixed to multiplayer cloak stuff
12659  *
12660  * Revision 1.123  1994/12/12  11:33:11  allender
12661  * fixed rearview mode to work again
12662  *
12663  * Revision 1.122  1994/12/12  11:00:16  matt
12664  * Added code to handle confusion with attached objects
12665  *
12666  * Revision 1.121  1994/12/12  00:31:29  allender
12667  * give better warning when out of space when recording.  Don't record
12668  * until no space left.  We have 500K watermark when we now stop recording
12669  *
12670  * Revision 1.120  1994/12/10  16:44:54  matt
12671  * Added debugging code to track down door that turns into rock
12672  *
12673  * Revision 1.119  1994/12/09  18:46:15  matt
12674  * Added code to handle odd error condition
12675  *
12676  * Revision 1.118  1994/12/09  17:27:37  allender
12677  * force playernum to 0 when demo is done playing
12678  *
12679  * Revision 1.117  1994/12/09  16:40:39  allender
12680  * yet more cloak stuff.  Assign cloak/invuln time when starting demo
12681  * if flags are set.  Check cloak and invuln time when demo
12682  * even when paused
12683  *
12684  * Revision 1.116  1994/12/09  14:59:22  matt
12685  * Added system to attach a fireball to another object for rendering purposes,
12686  * so the fireball always renders on top of (after) the object.
12687  *
12688  * Revision 1.115  1994/12/09  12:21:45  allender
12689  * only allow valid chars when typing in demo filename
12690  *
12691  * Revision 1.114  1994/12/08  23:19:02  allender
12692  * final(?) fix for getting cloak gauge to work on demo playback
12693  * with forward and reverse
12694  *
12695  * Revision 1.113  1994/12/08  21:34:38  allender
12696  * record old and new player flags to accuratedly record cloaking and
12697  * decloaking
12698  * ./
12699  *
12700  * Revision 1.112  1994/12/08  18:04:47  allender
12701  * bashed playernum right after reading it in demo header so shields
12702  * and energy are put in right place
12703  *
12704  * Revision 1.111  1994/12/08  17:10:07  allender
12705  * encode playernum in demo header.  Bash viewer segment to 0 if in
12706  * bogus segnum.  Don't link render objs for same reason
12707  *
12708  * Revision 1.110  1994/12/08  15:36:12  allender
12709  * cloak stuff works forwards and backwards
12710  *
12711  * Revision 1.109  1994/12/08  13:46:03  allender
12712  * don't record rearview anymore, but leave in case statement for playback
12713  * purposes.  change the way letterbox <--> cockpit transitions happen
12714  *
12715  * Revision 1.108  1994/12/08  12:36:06  matt
12716  * Added new object allocation & deallocation functions so other code
12717  * could stop messing around with internal object data structures.
12718  *
12719  * Revision 1.107  1994/12/08  11:19:04  allender
12720  * handle out of space (more) gracefully then before
12721  *
12722  * Revision 1.106  1994/12/08  00:29:49  allender
12723  * fixed bug that didn't load level on goto_beginning
12724  *
12725  * Revision 1.105  1994/12/08  00:11:51  mike
12726  * change matrix interpolation.
12727  *
12728  * Revision 1.104  1994/12/07  23:46:37  allender
12729  * changed invulnerability and cloak to work (almost) correctly both
12730  * in single and multi player
12731  *
12732  * Revision 1.103  1994/12/07  11:48:49  adam
12733  * BY ALLENDER -- added dampening of interpolation factor to 1 if greater
12734  * than 1 (although I have not seen this happen).  this is attempt to
12735  * get wobbling problem solved
12736  *
12737  * Revision 1.102  1994/12/07  11:23:56  allender
12738  * attempt at getting rid of wobbling on demo playback
12739  *
12740  * Revision 1.101  1994/12/06  19:31:17  allender
12741  * moved blastable wall stuff code to where we load level during demo
12742  * playback
12743  *
12744  * Revision 1.100  1994/12/06  19:21:51  allender
12745  * multi games, destroy blastable walls.  Do wall toggle when control center
12746  * destroyed
12747  *
12748  * Revision 1.99  1994/12/06  16:54:48  allender
12749  * fixed code so if demo automatically started from menu, don't bring up
12750  * message if demo is too old
12751  *
12752  * Revision 1.98  1994/12/06  13:55:15  matt
12753  * Use new rounding func, f2ir()
12754  *
12755  * Revision 1.97  1994/12/06  13:44:45  allender
12756  * suppressed compiler warnings
12757  *
12758  * Revision 1.96  1994/12/06  13:38:03  allender
12759  * removed recording of wall hit process.  I think that all bases are covered
12760  * elsewhere
12761  *
12762  * Revision 1.95  1994/12/06  12:57:35  allender
12763  * added recording of multi_decloaking.  Fixed some other cloaking code so
12764  * that cloak should last as long as player was cloaked.  We will lose the
12765  * guage effect, but the time is probably more important on playback
12766  *
12767  * Revision 1.94  1994/12/05  23:37:17  matt
12768  * Took out calls to warning() function
12769  *
12770  * Revision 1.93  1994/12/03  17:52:04  yuan
12771  * Localization 380ish
12772  *
12773  * Revision 1.92  1994/12/02  12:53:39  allender
12774  * fixed goto_beginning and goto_end on demo playback
12775  *
12776  * Revision 1.91  1994/12/01  12:01:49  allender
12777  * added multi player cloak stuff
12778  *
12779  * Revision 1.90  1994/11/30  09:33:58  allender
12780  * added field in header to tell what version (shareware or registered)
12781  * demo was recorded with.  Don't allow demo recorded on one to playback
12782  * on the other
12783  *
12784  * Revision 1.89  1994/11/29  00:31:01  allender
12785  * major changes -- added level recording feature which records level
12786  * advancement.  Changes to internal code to handle this.
12787  *
12788  * Revision 1.88  1994/11/27  23:13:54  matt
12789  * Made changes for new mprintf calling convention
12790  *
12791  * Revision 1.87  1994/11/27  23:07:35  allender
12792  * starting on code to get all level transitions recorded. not done yet
12793  *
12794  * Revision 1.86  1994/11/27  17:39:47  matt
12795  * Don't xlate tmap numbers when editor compiled out
12796  *
12797  * Revision 1.85  1994/11/23  09:27:21  allender
12798  * put up info box with message if demo version is too old or level
12799  * cannot be loaded
12800  *
12801  * Revision 1.84  1994/11/22  19:37:39  allender
12802  * fix array mistake
12803  *
12804  * Revision 1.83  1994/11/22  19:35:09  allender
12805  * record player ship colors in multiplayer demo recordings
12806  *
12807  * Revision 1.82  1994/11/19  15:36:42  mike
12808  * fix fix.
12809  *
12810  * Revision 1.81  1994/11/19  15:23:21  mike
12811  * rip out unused code
12812  *
12813  * Revision 1.80  1994/11/16  14:51:49  rob
12814  * Fixed network/demo incompatibility.
12815  *
12816  * Revision 1.79  1994/11/15  10:55:48  allender
12817  * made start of demo playback read initial demo information so
12818  * level will get loaded.  Made demo record to single file which
12819  * will get renamed.  Added numerics after old filename so
12820  * sequential filenames would be defaulted to
12821  *
12822  * Revision 1.78  1994/11/15  09:46:06  allender
12823  * added versioning.  Fixed problems with trying to interpolating a completely
12824  * 0 orientation matrix
12825  *
12826  * Revision 1.77  1994/11/14  14:34:31  matt
12827  * Fixed up handling when textures can't be found during remap
12828  *
12829  * Revision 1.76  1994/11/14  09:15:29  allender
12830  * make ESC from file save menu exit w/o saving.  Fix letterbox, rear view,
12831  * to normal cockpit mode transition to work correctly when skipping and
12832  * interpolating frames
12833  *
12834  * Revision 1.75  1994/11/11  16:22:07  allender
12835  * made morphing objects record only the object being morphed.
12836  *
12837  * Revision 1.74  1994/11/08  14:59:19  john
12838  * Added code to respond to network while in menus.
12839  *
12840  * Revision 1.73  1994/11/08  14:52:20  adam
12841  * *** empty log message ***
12842  *
12843  * Revision 1.72  1994/11/07  15:47:04  allender
12844  * prompt for filename when done recording demo
12845  *
12846  * Revision 1.71  1994/11/07  11:47:19  allender
12847  * when interpolating frames, delete weapon, fireball, and debris objects
12848  * from an inpolated frame if they don't appear in the next recorded
12849  * frame
12850  *
12851  * Revision 1.70  1994/11/07  11:02:41  allender
12852  * more with interpolation. I believe that I have it right now
12853  *
12854  * Revision 1.69  1994/11/07  08:47:40  john
12855  * Made wall state record.
12856  *
12857  * Revision 1.68  1994/11/05  17:22:51  john
12858  * Fixed lots of sequencing problems with newdemo stuff.
12859  *
12860  * Revision 1.67  1994/11/04  20:11:52  john
12861  * Neatening up palette stuff with demos.
12862  *
12863  * Revision 1.66  1994/11/04  16:49:44  allender
12864  * changed newdemo_do_interpolate to default to on
12865  *
12866  * Revision 1.65  1994/11/04  16:44:51  allender
12867  * added filename support for demo recording.  more auto demo stuff
12868  *
12869  * Revision 1.64  1994/11/04  13:05:31  allender
12870  * fixing the lifeleft variable again.  (I think I got it right this time)
12871  *
12872  * Revision 1.63  1994/11/04  11:37:37  allender
12873  * commented out fprintfs and fixed compiler warning
12874  *
12875  * Revision 1.62  1994/11/04  11:33:50  allender
12876  * added OBJ_FLARE and OBJ_LIGHT to obj->lifeleft recording
12877  *
12878  * Revision 1.61  1994/11/04  11:29:21  allender
12879  * more interpolation stuff -- not done yet.  Fixed so hostage vclips
12880  * render correctly.  Changed lifeleft to full precision, but only
12881  * write it when object is fireball or weapon type of object
12882  *
12883  * Revision 1.60  1994/11/03  10:00:11  allender
12884  * fixed divide by zero in calculating render time.  more interpolation
12885  * stuff which isn't quite done
12886  *
12887  * Revision 1.59  1994/11/02  17:10:59  allender
12888  * never play recorded frames when interpolation is occuring
12889  *
12890  * Revision 1.58  1994/11/02  14:28:58  allender
12891  * profile total playback time and average frame render time
12892  *
12893  * Revision 1.57  1994/11/02  14:09:03  allender
12894  * record rear view.  start of playback interpolation code -- this
12895  * is not yet done
12896  *
12897  * Revision 1.56  1994/11/01  13:25:30  allender
12898  * drop frames if playing back demo on slower machine
12899  *
12900  * Revision 1.55  1994/10/31  16:10:40  allender
12901  * record letterbox mode on death seq, and then restore
12902  *
12903  * Revision 1.54  1994/10/29  16:01:38  allender
12904  * added ND_STATE_NODEMOS to indicate that there are no demos currently
12905  * available for playback
12906  *
12907  * Revision 1.53  1994/10/29  15:38:42  allender
12908  * in newdemo_start_playback, make Newdemo_at_eof = 0
12909  *
12910  * Revision 1.52  1994/10/28  14:45:28  john
12911  * fixed typo from last checkin.
12912  *
12913  * Revision 1.51  1994/10/28  14:42:55  john
12914  * Added sound volumes to all sound calls.
12915  *
12916  * Revision 1.50  1994/10/28  14:31:57  allender
12917  * homing missle and autodemo stuff
12918  *
12919  * Revision 1.49  1994/10/28  12:42:14  allender
12920  * record homing distance
12921  *
12922  * Revision 1.48  1994/10/27  16:57:54  allender
12923  * changed demo vcr to be able to play any number of frames by storing
12924  * frame length (in bytes) in the demo file.  Added blowing up monitors
12925  *
12926  * Revision 1.47  1994/10/26  16:50:50  allender
12927  * put two functions inside of VCR_MODE ifdef
12928  *
12929  * Revision 1.46  1994/10/26  15:20:32  allender
12930  * added CT_REMOTE as valid control type for recording
12931  *
12932  * Revision 1.45  1994/10/26  14:45:35  allender
12933  * completed hacked in vcr demo playback stuff
12934  *
12935  * Revision 1.44  1994/10/26  13:40:52  allender
12936  * vcr playback of demo stuff
12937  *
12938  * Revision 1.43  1994/10/26  08:51:57  allender
12939  * record player weapon change
12940  *
12941  * Revision 1.42  1994/10/25  15:48:01  allender
12942  * add shields, energy, and player flags to demo recording.
12943  * ,
12944  *
12945  * Revision 1.41  1994/10/24  08:19:35  allender
12946  * fixed compilation errors
12947  *
12948  * Revision 1.40  1994/10/23  19:17:08  matt
12949  * Fixed bug with "no key" messages
12950  *
12951  * Revision 1.39  1994/10/22  14:15:08  mike
12952  * Suppress compiler warnings.
12953  *
12954  * Revision 1.38  1994/10/21  15:24:55  allender
12955  * compressed writing of object structures with specialized code
12956  * to write out only pertinent object structures.
12957  *
12958  * Revision 1.37  1994/10/20  13:03:17  matt
12959  * Replaced old save files (MIN/SAV/HOT) with new LVL files
12960  *
12961  * Revision 1.36  1994/09/28  23:13:10  matt
12962  * Macroized palette flash system
12963  *
12964  * Revision 1.35  1994/09/26  17:28:32  matt
12965  * Made new multiple-object morph code work with the demo system
12966  *
12967  * Revision 1.34  1994/09/10  13:31:54  matt
12968  * Made exploding walls a type of blastable walls.
12969  * Cleaned up blastable walls, making them tmap2 bitmaps.
12970  *
12971  * Revision 1.33  1994/08/15  18:05:28  john
12972  * *** empty log message ***
12973  *
12974  * Revision 1.32  1994/08/15  17:56:38  john
12975  * ,
12976  *
12977  * Revision 1.31  1994/08/10  09:44:54  john
12978  * *** empty log message ***
12979  *
12980  * Revision 1.30  1994/07/22  12:35:48  matt
12981  * Cleaned up editor/game interactions some more.
12982  *
12983  * Revision 1.29  1994/07/21  13:06:45  matt
12984  * Ripped out remants of old demo system, and added demo only system that
12985  * disables object movement and game options from menu.
12986  *
12987  * Revision 1.28  1994/07/18  16:22:44  john
12988  * Made all file read/writes call the same routine.
12989  *
12990  * Revision 1.27  1994/07/14  22:38:27  matt
12991  * Added exploding doors
12992  *
12993  * Revision 1.26  1994/07/05  12:49:04  john
12994  * Put functionality of New Hostage spec into code.
12995  *
12996  * Revision 1.25  1994/06/29  11:05:38  john
12997  * Made demos read in compressed.
12998  *
12999  * Revision 1.24  1994/06/29  09:14:06  john
13000  * Made files write out uncompressed and read in compressed.
13001  *
13002  * Revision 1.23  1994/06/28  11:55:28  john
13003  * Made newdemo system record/play directly to/from disk, so
13004  * we don't need the 4 MB buffer anymore.
13005  *
13006  * Revision 1.22  1994/06/27  15:52:38  john
13007  * #define'd out the newdemo stuff
13008  *
13009  *
13010  * Revision 1.21  1994/06/22  00:29:04  john
13011  * Fixed bug with playing demo then playing game without
13012  * loading new mine.
13013  *
13014  * Revision 1.20  1994/06/22  00:14:23  john
13015  * Attempted to fix sign.
13016  *
13017  * Revision 1.19  1994/06/21  23:57:54  john
13018  * Hopefully fixed bug with negative countdowns.
13019  *
13020  * Revision 1.18  1994/06/21  23:47:44  john
13021  * MAde Malloc always 4*1024*1024.
13022  *
13023  * Revision 1.17  1994/06/21  22:58:47  john
13024  * Added error if out of memory.
13025  *
13026  * Revision 1.16  1994/06/21  22:15:48  john
13027  * Added  % done to demo recording.
13028  *
13029  *
13030  * Revision 1.15  1994/06/21  19:45:55  john
13031  * Added palette effects to demo recording.
13032  *
13033  * Revision 1.14  1994/06/21  15:08:54  john
13034  * Made demo record HUD message and cleaned up the HUD code.
13035  *
13036  * Revision 1.13  1994/06/21  14:20:08  john
13037  * Put in hooks to record HUD messages.
13038  *
13039  * Revision 1.12  1994/06/20  11:50:15  john
13040  * Made demo record flash effect, and control center triggers.
13041  *
13042  * Revision 1.11  1994/06/17  18:01:33  john
13043  * A bunch of new stuff by John
13044  *
13045  * Revision 1.10  1994/06/17  12:13:31  john
13046  * More newdemo stuff; made editor->game transition start in slew mode.
13047  *
13048  * Revision 1.9  1994/06/16  13:14:36  matt
13049  * Fixed typo
13050  *
13051  * Revision 1.8  1994/06/16  13:02:07  john
13052  * Added morph hooks.
13053  *
13054  * Revision 1.7  1994/06/15  19:01:33  john
13055  * Added the capability to make 3d sounds play just once for the
13056  * laser hit wall effects.
13057  *
13058  * Revision 1.6  1994/06/15  14:56:59  john
13059  * Added triggers to demo recording.
13060  *
13061  * Revision 1.5  1994/06/14  20:42:15  john
13062  * Made robot matztn cntr not work until no robots or player are
13063  * in the segment.
13064  *
13065  * Revision 1.4  1994/06/14  14:43:27  john
13066  * Made doors work with newdemo system.
13067  *
13068  * Revision 1.3  1994/06/14  11:32:29  john
13069  * Made Newdemo record & restore the current mine.
13070  *
13071  * Revision 1.2  1994/06/13  21:02:43  john
13072  * Initial version of new demo recording system.
13073  *
13074  * Revision 1.1  1994/06/13  11:09:00  john
13075  * Initial revision
13076
13077 ------------------------------------------------------------------------
13078 main/newdemo.h:
13079
13080  * Revision 1.1  1995/05/16  16:00:24  allender
13081  * Initial revision
13082  *
13083  * Revision 2.0  1995/02/27  11:27:18  john
13084  * New version 2.0, which has no anonymous unions, builds with
13085  * Watcom 10.0, and doesn't require parsing BITMAPS.TBL.
13086  *
13087  * Revision 1.43  1995/01/19  09:41:43  allender
13088  * prototype for laser level recording
13089  *
13090  * Revision 1.42  1995/01/18  18:48:49  allender
13091  * added function prototype for door_open
13092  *
13093  * Revision 1.41  1995/01/17  17:42:31  allender
13094  * new prototypes for ammo counts
13095  *
13096  * Revision 1.40  1995/01/04  15:04:27  allender
13097  * added some different prototypes for registered
13098  *
13099  * Revision 1.39  1995/01/03  11:45:11  allender
13100  * extern function definition
13101  *
13102  * Revision 1.38  1994/12/29  16:43:31  allender
13103  * new function prototype
13104  *
13105  * Revision 1.37  1994/12/28  14:15:27  allender
13106  * new function prototypes
13107  *
13108  * Revision 1.36  1994/12/21  12:46:41  allender
13109  * new functions for multiplayer deaths and kills
13110  *
13111  * Revision 1.35  1994/12/12  11:32:55  allender
13112  * added new record function to restore after in rearview mode
13113  *
13114  * Revision 1.34  1994/12/08  21:03:15  allender
13115  * added new param to record_player_flags
13116  *
13117  * Revision 1.33  1994/12/08  13:47:01  allender
13118  * removed function call to record_rearview
13119  *
13120  * Revision 1.32  1994/12/06  12:57:10  allender
13121  * added new prototype for multi decloaking
13122  *
13123  * Revision 1.31  1994/12/01  11:46:34  allender
13124  * added recording prototype for multi player cloak
13125  *
13126  * Revision 1.30  1994/11/27  23:04:22  allender
13127  * function prototype for recording new levels
13128  *
13129  * Revision 1.29  1994/11/07  08:47:43  john
13130  * Made wall state record.
13131  *
13132  * Revision 1.28  1994/11/05  17:22:53  john
13133  * Fixed lots of sequencing problems with newdemo stuff.
13134  *
13135  * Revision 1.27  1994/11/04  16:48:49  allender
13136  * extern Newdemo_do_interpolate variable
13137  *
13138  * Revision 1.26  1994/11/02  14:08:53  allender
13139  * record rearview
13140  *
13141  * Revision 1.25  1994/10/31  13:35:04  allender
13142  * added two record functions to save and restore cockpit state on
13143  * death sequence
13144  *
13145  * Revision 1.24  1994/10/29  16:01:11  allender
13146  * added ND_STATE_NODEMOS to indicate that there are no demos currently
13147  * available for playback
13148  *
13149  * Revision 1.23  1994/10/28  12:41:58  allender
13150  * add homing distance recording event
13151  *
13152  * Revision 1.22  1994/10/27  16:57:32  allender
13153  * removed VCR_MODE stuff, and added monitor blowup effects
13154  *
13155  * Revision 1.21  1994/10/26  14:44:48  allender
13156  * completed hacked in vcr type demo playback states
13157  *
13158  * Revision 1.20  1994/10/26  13:40:38  allender
13159  * more vcr demo playback defines
13160  *
13161  * Revision 1.19  1994/10/26  08:51:26  allender
13162  * record player weapon change
13163  *
13164  * Revision 1.18  1994/10/25  16:25:31  allender
13165  * prototypes for shield, energy and flags
13166  *
13167  * Revision 1.17  1994/08/15  18:05:30  john
13168  * *** empty log message ***
13169  *
13170  * Revision 1.16  1994/07/21  13:11:26  matt
13171  * Ripped out remants of old demo system, and added demo only system that
13172  * disables object movement and game options from menu.
13173  *
13174  * Revision 1.15  1994/07/05  12:49:02  john
13175  * Put functionality of New Hostage spec into code.
13176  *
13177  * Revision 1.14  1994/06/27  15:53:12  john
13178  * #define'd out the newdemo stuff
13179  *
13180  *
13181  * Revision 1.13  1994/06/24  17:01:25  john
13182  * Add VFX support; Took Game Sequencing, like EndGame and stuff and
13183  * took it out of game.c and into gameseq.c
13184  *
13185  * Revision 1.12  1994/06/21  19:46:05  john
13186  * Added palette effects to demo recording.
13187  *
13188  * Revision 1.11  1994/06/21  14:19:58  john
13189  * Put in hooks to record HUD messages.
13190  *
13191  * Revision 1.10  1994/06/20  11:50:42  john
13192  * Made demo record flash effect, and control center triggers.
13193  *
13194  * Revision 1.9  1994/06/17  18:01:29  john
13195  * A bunch of new stuff by John
13196  *
13197  * Revision 1.8  1994/06/17  12:13:34  john
13198  * More newdemo stuff; made editor->game transition start in slew mode.
13199  *
13200  * Revision 1.7  1994/06/16  13:02:02  john
13201  * Added morph hooks.
13202  *
13203  * Revision 1.6  1994/06/15  19:01:42  john
13204  * Added the capability to make 3d sounds play just once for the
13205  * laser hit wall effects.
13206  *
13207  * Revision 1.5  1994/06/15  14:57:11  john
13208  * Added triggers to demo recording.
13209  *
13210  * Revision 1.4  1994/06/14  20:42:19  john
13211  * Made robot matztn cntr not work until no robots or player are
13212  * in the segment.
13213  *
13214  * Revision 1.3  1994/06/14  14:43:52  john
13215  * Made doors work with newdemo system.
13216  *
13217  * Revision 1.2  1994/06/13  21:02:44  john
13218  * Initial version of new demo recording system.
13219  *
13220  * Revision 1.1  1994/06/13  15:51:09  john
13221  * Initial revision
13222
13223 ------------------------------------------------------------------------
13224 main/newmenu.c:
13225
13226  * Revision 1.26  1996/04/14  21:07:35  allender
13227  * some change for update
13228  *
13229  * Revision 1.25  1995/10/31  10:19:25  allender
13230  * shareware stuff
13231  *
13232  * Revision 1.24  1995/10/27  11:09:04  allender
13233  * always cd to descent dir before any menu processing --
13234  * sanity check because of way mac does volume mounting and
13235  * other file stuff
13236  *
13237  * Revision 1.23  1995/10/24  18:11:19  allender
13238  * do_appl_quit saves and restores background -- don't
13239  * do any special processing.  fixed newmenu_do3 to pass width
13240  * and height to ...do_4
13241  *
13242  * Revision 1.22  1995/10/21  23:26:25  allender
13243  * can't do cmd-q in multiplayer games
13244  *
13245  * Revision 1.21  1995/10/21  22:53:25  allender
13246  * menus need to be 8 byte multiple wide -- printscreen stuff
13247  *
13248  * Revision 1.20  1995/10/20  00:50:15  allender
13249  * redbook stuff and make esc leave menu always
13250  *
13251  * Revision 1.19  1995/10/17  13:14:52  allender
13252  * mouse support for other menus now operational -- dragging
13253  * mouse will also move sliders
13254  *
13255  * Revision 1.18  1995/10/12  17:35:19  allender
13256  * mouse support for pilot and demos
13257  *
13258  * Revision 1.17  1995/10/11  12:17:47  allender
13259  * removed event loop processing
13260  *
13261  * Revision 1.16  1995/10/10  11:51:29  allender
13262  * align menus to 8 byte boundry
13263  *
13264  * Revision 1.15  1995/10/05  14:09:36  allender
13265  * lowered starting x location on menus to fixup network
13266  * status screen chopping off characters
13267  *
13268  * Revision 1.14  1995/09/24  10:52:27  allender
13269  * made close boxes work
13270  * maybe some other minor stuff?
13271  *
13272  * Revision 1.13  1995/09/15  09:02:04  allender
13273  * started putting mouse support in listboxes
13274  *
13275  * Revision 1.12  1995/09/13  08:50:14  allender
13276  * close box in this rev?  Worked on getting list box better
13277  * looking
13278  *
13279  * Revision 1.11  1995/09/01  10:52:37  allender
13280  * fixed up list boxes
13281  *
13282  * Revision 1.10  1995/08/24  16:23:08  allender
13283  * mouse support for most menus
13284  *
13285  * Revision 1.9  1995/08/08  13:46:56  allender
13286  * added macsys header file
13287  *
13288  * Revision 1.8  1995/08/01  16:03:54  allender
13289  * added file list with Desalvo's directory stuff
13290  *
13291  * Revision 1.7  1995/07/26  17:03:37  allender
13292  * show then hide cursor during newmenu operations -- not quite
13293  * right yet
13294  *
13295  * Revision 1.6  1995/07/17  08:56:26  allender
13296  * fixed up menus to look better with new high res fonts
13297  *
13298  * Revision 1.5  1995/07/12  10:35:52  allender
13299  * removed old debug thing
13300  *
13301  * Revision 1.4  1995/06/23  10:23:21  allender
13302  * menus should work in any resolution now
13303  *
13304  * Revision 1.3  1995/06/20  09:11:19  allender
13305  * changed menu system to support 640x480 instead of 320x200
13306  *
13307  * Revision 1.2  1995/06/13  13:07:30  allender
13308  * added special key to move 320x200 window to upper left corner of screen
13309  *
13310  * Revision 1.1  1995/05/16  15:29:13  allender
13311  * Initial revision
13312  *
13313  * Revision 2.8  1995/05/26  16:16:28  john
13314  * Split SATURN into define's for requiring cd, using cd, etc.
13315  * Also started adding all the Rockwell stuff.
13316  *
13317  * Revision 2.7  1995/04/23  14:54:17  john
13318  * Fixed bug with background breaking in first menu.
13319  *
13320  * Revision 2.6  1995/03/21  14:38:46  john
13321  * Ifdef'd out the NETWORK code.
13322  *
13323  * Revision 2.5  1995/03/15  14:33:29  john
13324  * Added code to force the Descent CD-rom in the drive.
13325  *
13326  * Revision 2.4  1995/03/14  18:24:28  john
13327  * Force Destination Saturn to use CD-ROM drive.
13328  *
13329  * Revision 2.3  1995/03/14  16:22:23  john
13330  * Added cdrom alternate directory stuff.
13331  *
13332  * Revision 2.2  1995/03/06  18:30:51  john
13333  * Fixed bug with newmenu trashing editor font.
13334  *
13335  * Revision 2.1  1995/03/06  15:23:17  john
13336  * New screen techniques.
13337  *
13338  * Revision 2.0  1995/02/27  11:27:55  john
13339  * New version 2.0, which has no anonymous unions, builds with
13340  * Watcom 10.0, and doesn't require parsing BITMAPS.TBL.
13341  *
13342  * Revision 1.129  1995/02/11  16:19:56  john
13343  * Added code to make the default mission be the one last played.
13344  *
13345  * Revision 1.128  1995/02/02  19:41:33  john
13346  * Added 10 save game slots.
13347  *
13348  * Revision 1.127  1995/02/01  18:13:52  john
13349  * Fixed some constants.
13350  *
13351  * Revision 1.126  1995/02/01  18:04:01  yuan
13352  * Added 50 characters to list.
13353  *
13354  * Revision 1.125  1995/02/01  13:39:35  john
13355  * Made menu text that changes not overwrite.
13356  *
13357  * Revision 1.124  1995/01/31  10:47:57  john
13358  * Added menu that you can specify the width of the menu.
13359  *
13360  * Revision 1.123  1995/01/28  17:18:12  john
13361  * Added file list box.
13362  *
13363  * Revision 1.122  1995/01/27  17:15:55  john
13364  * Made prev comment actually work.
13365  *
13366  * Revision 1.121  1995/01/27  16:49:03  john
13367  * *** empty log message ***
13368  *
13369  * Revision 1.120  1995/01/27  16:46:40  john
13370  * Made so that input_menu only clears text if -empty-.
13371  *
13372  * Revision 1.119  1995/01/27  15:25:04  john
13373  * Delete saved game when deleteing a pilot file.
13374  *
13375  * Revision 1.118  1995/01/25  16:36:09  john
13376  * Made so that when you hit enter during
13377  * game save, -empty- goes away.
13378  *
13379  * Revision 1.117  1995/01/24  16:59:30  john
13380  * took out mono debugging text.
13381  *
13382  * Revision 1.116  1995/01/24  16:23:16  john
13383  * Fixed some bugs with listboxes.
13384  *
13385  * Revision 1.115  1995/01/23  23:47:36  matt
13386  * Made keypad enter work in menus
13387  *
13388  * Revision 1.114  1995/01/23  19:29:59  john
13389  * Added scrolling listbox menus.
13390  *
13391  * Revision 1.113  1995/01/19  12:33:34  john
13392  * Made keys jump to sliders, etc in menus.
13393  *
13394  * Revision 1.112  1995/01/15  14:33:08  rob
13395  * Fixed problem with nested nm_messageboxes.
13396  *
13397  * Revision 1.111  1995/01/03  17:33:40  john
13398  * Made scrolling textbox. Used it for scores cool saying.
13399  *
13400  * Revision 1.110  1994/12/28  10:42:58  john
13401  * More VFX tweaking.
13402  *
13403  * Revision 1.109  1994/12/28  10:26:39  john
13404  * Fixed some VFX problems.
13405  *
13406  * Revision 1.108  1994/12/15  23:18:10  john
13407  * Added fix so that VFX mode doesn't hang.
13408  *
13409  * Revision 1.107  1994/12/15  12:19:55  john
13410  * Made menu use clipped bitblt functions.
13411  *
13412  * Revision 1.106  1994/12/09  00:41:30  mike
13413  * fix hang in automap print screen
13414  *
13415  * Revision 1.105  1994/12/08  10:01:34  john
13416  * Changed the way the player callsign stuff works.
13417  *
13418  * Revision 1.104  1994/12/04  15:34:30  john
13419  * Fixed bug with newmenu not restoring font properly.
13420  *
13421  * Revision 1.103  1994/12/03  17:47:09  john
13422  * Fixed bug that didn't free filename mem when not .plr files found.
13423  *
13424  * Revision 1.102  1994/12/03  15:06:15  john
13425  * If no pilot exists, bring up box asking for name.
13426  *
13427  * Revision 1.101  1994/12/03  11:04:02  john
13428  * Changed newmenu code a bit to fix bug with bogus
13429  * backgrounds occcasionally.
13430  *
13431  * Revision 1.100  1994/12/01  20:15:48  yuan
13432  * Localization.
13433  *
13434  * Revision 1.99  1994/12/01  10:33:28  john
13435  * Fixed bug with large menu backgrounds not drawing correctly.
13436  *
13437  * Revision 1.98  1994/12/01  02:41:56  john
13438  * Fixed warnining.
13439  *
13440  * Revision 1.97  1994/11/30  22:52:43  john
13441  * Fixed bug in code that made the backgrounds behind menus.
13442  *
13443  * Revision 1.96  1994/11/30  19:47:42  john
13444  * Added a check for out o' memory when mallocing background.
13445  *
13446  * Revision 1.95  1994/11/30  19:39:10  john
13447  * ..
13448  *
13449  * Revision 1.94  1994/11/30  19:38:27  john
13450  * fixed bug with previous.
13451  *
13452  * Revision 1.93  1994/11/30  19:36:47  john
13453  * Made Gravis Ultrasound work again.  Made the scores blink
13454  * at a constant rate.  Revamped the newmenu background storage,
13455  * which hopefully fixed some bugs.  Made menus in ame not pause
13456  * sound, except for the pause key.               ^== Game!
13457  *
13458  * Revision 1.92  1994/11/30  18:06:05  matt
13459  * When player types space in callsign, comes up as underscore
13460  *
13461  * Revision 1.91  1994/11/30  12:28:22  adam
13462  * added PCX support
13463  *
13464  * Revision 1.90  1994/11/30  12:10:59  adam
13465  * added support for PCX titles/brief screens
13466  *
13467  * Revision 1.89  1994/11/29  00:59:12  allender
13468  * change newmenu_get_filename so demo files can be deleted too
13469  *
13470  * Revision 1.88  1994/11/27  21:16:18  allender
13471  * made some return values in newmenu_get_filename 0 instead of -1
13472  *
13473  * Revision 1.87  1994/11/27  16:58:17  matt
13474  * Made printscreen work all the time (not just when no ndebug) and made it
13475  * work when getting a filename.
13476  *
13477  * Revision 1.86  1994/11/27  16:47:51  john
13478  * Made the call to fade in palette only happen if it needs to be, just
13479  * because I thought it might reduce code paging with vm in menus.
13480  *
13481  * Revision 1.85  1994/11/26  15:30:16  matt
13482  * Allow escape out of change pilot menu
13483  *
13484  * Revision 1.84  1994/11/26  14:17:26  matt
13485  * Player can now only enter valid chars for his name
13486  *
13487  * Revision 1.83  1994/11/23  14:13:17  allender
13488  * if no demo files, displays less "techy" message
13489  *
13490  * Revision 1.82  1994/11/21  11:55:52  john
13491  * Fixed some sound pausing in menus bugs.
13492  *
13493  * Revision 1.81  1994/11/19  15:14:58  mike
13494  * remove unused code and data
13495  *
13496  * Revision 1.80  1994/11/18  23:37:54  john
13497  * Changed some shorts to ints.
13498  *
13499  * Revision 1.79  1994/11/15  09:29:21  john
13500  * Made it so that pressing a letter when selecting players moves to
13501  * a matching choice.
13502  *
13503  * Revision 1.78  1994/11/14  17:12:28  adam
13504  * *** empty log message ***
13505  *
13506  * Revision 1.77  1994/11/14  16:58:31  rob
13507  * Tried to fix a problem with save demo dialog.
13508  *
13509  * Revision 1.76  1994/11/14  16:13:46  matt
13510  * Fixed handling of players with DOS device names
13511  *
13512  * Revision 1.75  1994/11/13  18:12:53  matt
13513  * Fixed handling of filenames that are the same as DOS devices
13514  *
13515  * Revision 1.74  1994/11/13  17:20:44  john
13516  * Fixed text a bit.
13517  *
13518  * Revision 1.73  1994/11/13  17:18:22  john
13519  * Changed wording of new pilot.
13520  *
13521  * Revision 1.72  1994/11/13  17:14:21  john
13522  * Fixed bug with player list box.
13523  *
13524  * Revision 1.71  1994/11/13  17:12:48  john
13525  * Fixed broken demo file list.
13526  *
13527  * Revision 1.70  1994/11/13  17:04:49  john
13528  * Made the callsign entry be a list box and gave the ability
13529  * to delete players.
13530  *
13531  * Revision 1.69  1994/11/13  15:38:03  john
13532  * Added critical error handler to game.  Took out -editor command line
13533  * option because it didn't work anymore and wasn't worth fixing.  Made scores
13534  * not use MINER enviroment variable on release version, and made scores
13535  * not print an error if there is no descent.hi.
13536  *
13537  * Revision 1.68  1994/11/11  18:17:03  rob
13538  * Made multi_menu_poll return a value to exit menus.
13539  *
13540  * Revision 1.67  1994/11/11  11:07:06  rob
13541  * Added include of multi.h
13542  *
13543  * Revision 1.66  1994/11/10  20:25:16  rob
13544  * John's stuff to make network menus work.
13545  *
13546  * Revision 1.65  1994/11/08  14:51:39  john
13547  * Added nm_messagebox1, (like the original, only you can pass a function).
13548  *
13549  * Revision 1.64  1994/11/08  08:30:39  john
13550  * Fixed bug with centering titles.
13551  *
13552  * Revision 1.63  1994/11/08  08:27:00  john
13553  * Made titles and subtitles center.
13554  *
13555  * Revision 1.62  1994/11/07  09:40:48  john
13556  * Neatend file list box some.
13557  *
13558  * Revision 1.61  1994/11/05  17:22:41  john
13559  * Fixed lots of sequencing problems with newdemo stuff.
13560  *
13561  * Revision 1.60  1994/11/05  15:04:08  john
13562  * Added non-popup menu for the main menu, so that scores and credits don't have to save
13563  * the background.
13564  *
13565  * Revision 1.59  1994/11/05  14:03:52  john
13566  * Fixed fade transitions between all screens by making gr_palette_fade_in and out keep
13567  * track of whether the palette is faded in or not.  Then, wherever the code needs to fade out,
13568  * it just calls gr_palette_fade_out and it will fade out if it isn't already.  The same with fade_in.
13569  * This eliminates the need for all the flags like Menu_fade_out, game_fade_in palette, etc.
13570  *
13571  * Revision 1.58  1994/11/04  20:11:50  john
13572  * Neatening up palette stuff with demos.
13573  *
13574  * Revision 1.57  1994/11/04  13:49:24  allender
13575  * fixed newmenu_get_filename to work with less than 10 files
13576  *
13577  * Revision 1.56  1994/11/03  19:37:44  john
13578  * Added scrolling file list box
13579  *
13580  * Revision 1.55  1994/10/31  18:16:42  john
13581  * Made Pad arrows work with menus.
13582  *
13583  * Revision 1.54  1994/10/28  14:54:25  john
13584  * Added forward dec. for newmenu_close.
13585  * .\
13586  *
13587  * Revision 1.53  1994/10/28  14:53:00  john
13588  * Fixed hideous bug that would bomb if you called newmenu_draw_background
13589  * before any menus were ever displayed.
13590  *
13591  * Revision 1.52  1994/10/24  19:56:53  john
13592  * Made the new user setup prompt for config options.
13593  *
13594  * Revision 1.51  1994/10/24  15:15:49  john
13595  * Made Esc exit nm_messagebox's,
13596  * ,
13597  *
13598  * Revision 1.50  1994/10/21  15:20:20  john
13599  * Made PrtScr do screen dump, not F2.
13600  *
13601  * Revision 1.49  1994/10/18  12:33:38  john
13602  * Only used copy the item text into the saved_text field
13603  * if it is an inputbox or inputbox_menu.
13604  *
13605  * Revision 1.48  1994/10/17  11:04:01  john
13606  * Made backtab work also.
13607  *
13608  * Revision 1.47  1994/10/17  10:47:49  john
13609  * MAde Tab work like down arrow.
13610  *
13611  * Revision 1.46  1994/10/17  10:45:10  john
13612  * Made the player able to abort death by pressing any button or key.
13613  *
13614  * Revision 1.45  1994/10/13  21:52:02  john
13615  * Made it so that if a messagebox has 1 choice, then
13616  * Esc will return -1.
13617  *
13618  * Revision 1.44  1994/10/13  11:35:38  john
13619  * Made Thrustmaster FCS Hat work.  Put a background behind the
13620  * keyboard configure.  Took out turn_sensitivity.  Changed sound/config
13621  * menu to new menu. Made F6 be calibrate joystick.
13622  *
13623  * Revision 1.43  1994/10/11  17:18:52  john
13624  * Fixed bug with sliders always starting at -1.
13625  *
13626  * Revision 1.42  1994/10/11  17:08:29  john
13627  * Added sliders for volume controls.
13628  *
13629  * Revision 1.41  1994/10/06  16:04:40  john
13630  * Made text items color differently than others. Adam
13631  * is gonna make a diff colored font for these.
13632  *
13633  * Revision 1.40  1994/10/06  15:08:23  rob
13634  * Allowed any negative key value to abort the menu and return.
13635  *
13636  * Revision 1.39  1994/10/04  10:26:06  matt
13637  * Changed fade in to happen every time a global var is set
13638  *
13639  * Revision 1.38  1994/10/04  09:16:08  john
13640  * If you pass -1 as choice in newmenu_do1, then
13641  * no item is highlighted until you press up or
13642  * down arrows.
13643  *
13644  * Revision 1.37  1994/10/03  23:44:37  matt
13645  * Save & restore palette effect around menus & pause message
13646  *
13647  * Revision 1.36  1994/10/03  22:59:40  matt
13648  * Re-enabled backspace to generate Int3()
13649  *
13650  * Revision 1.35  1994/10/03  19:11:21  matt
13651  * Changed string input cursor to blinking underscore
13652  *
13653  * Revision 1.34  1994/10/03  14:44:15  john
13654  * Added newmenu_do1, which allows you to pass the starting
13655  * item to the menu system
13656  *
13657  * Revision 1.33  1994/09/30  11:51:21  john
13658  * Added Matt's NM_TYPE_INPUT_MENU
13659  *
13660  * Revision 1.32  1994/09/28  17:22:56  matt
13661  * Added extra space between subtitle and menu items
13662  * Made shortcut key check ignore leading spaces in text
13663  *
13664  * Revision 1.31  1994/09/15  16:11:22  john
13665  * Added support for VFX1 head tracking. Fixed bug with memory over-
13666  * write when using stereo mode.
13667  *
13668  * Revision 1.30  1994/09/12  09:52:59  john
13669  * Made global flush function that flushes keyboard,mouse, and joystick.
13670  *
13671  * Revision 1.29  1994/09/10  19:10:54  matt
13672  * Fixed a few things (like arrow key handling) for menus with all
13673  * text items, such as the key help message.
13674  *
13675  * Revision 1.28  1994/09/01  18:55:38  john
13676  * freed scores.lbm
13677  *
13678  * Revision 1.27  1994/09/01  18:03:50  john
13679  * Neatened up scores a bit.
13680  *
13681  * Revision 1.26  1994/08/30  20:38:13  john
13682  * Passed citem in newmenu sub.
13683  *
13684  * Revision 1.25  1994/08/30  11:13:01  john
13685  * Added beveled edges to menus.
13686  *
13687  * Revision 1.24  1994/08/26  13:01:58  john
13688  * Put high score system in.
13689  *
13690  * Revision 1.23  1994/08/16  00:18:44  john
13691  * Made pressing the first letter of a menu
13692  * item move to it.
13693  *
13694  * Revision 1.22  1994/08/15  23:17:43  john
13695  * *** empty log message ***
13696  *
13697  * Revision 1.21  1994/08/15  23:15:28  john
13698  * Made 1 menu/checkbox return with any keypress.
13699  *
13700  * Revision 1.20  1994/08/12  10:18:23  john
13701  * *** empty log message ***
13702  *
13703  * Revision 1.19  1994/08/12  10:09:11  john
13704  * Made borders better.
13705  *
13706  * Revision 1.18  1994/08/12  03:11:16  john
13707  * Made network be default off; Moved network options into
13708  * main menu.  Made starting net game check that mines are the
13709  * same.
13710  *
13711  * Revision 1.17  1994/08/11  22:14:43  john
13712  * Free'd up some memory that I forgot to free.
13713  *
13714  * Revision 1.16  1994/08/11  19:27:35  john
13715  * Made the Backspace drop into the debugger only
13716  * if you're not in an inputbox.
13717  *
13718  * Revision 1.15  1994/08/11  18:01:49  matt
13719  * Added F2 and BACKSPACE keys to new menu system
13720  *
13721  * Revision 1.14  1994/08/11  14:25:58  john
13722  * *** empty log message ***
13723  *
13724  * Revision 1.13  1994/08/11  14:25:40  john
13725  * *** empty log message ***
13726  *
13727  * Revision 1.12  1994/08/11  13:47:02  john
13728  * Made newmenu have subtitles, passed key through to
13729  * the newmenu subfunctions.
13730  *
13731  * Revision 1.11  1994/08/11  12:45:08  john
13732  * *** empty log message ***
13733  *
13734  * Revision 1.10  1994/08/11  12:25:45  john
13735  * Made right_offset spacing different
13736  *
13737  * Revision 1.9  1994/08/11  12:09:49  john
13738  * Made work with bitmapped fonts.
13739  *
13740  * Revision 1.8  1994/08/10  19:56:16  john
13741  * Changed font stuff; Took out old menu; messed up lots of
13742  * other stuff like game sequencing messages, etc.
13743  *
13744  * Revision 1.7  1994/07/27  16:12:23  john
13745  * Changed newmenu system to have a callback function.
13746  * /.
13747  *
13748  * Revision 1.6  1994/07/25  15:10:23  john
13749  * *** empty log message ***
13750  *
13751  * Revision 1.5  1994/07/25  12:33:35  john
13752  * Network "pinging" in.
13753  *
13754  * Revision 1.4  1994/07/24  18:21:27  john
13755  * Took out first time stuff.
13756  *
13757  * Revision 1.3  1994/07/24  17:32:47  john
13758  * Added percent item.  Also neatend up a bit.
13759  *
13760  * Revision 1.2  1994/07/22  17:48:13  john
13761  * Added new menuing system.
13762  *
13763  * Revision 1.1  1994/07/22  13:55:38  john
13764  * Initial revision
13765
13766 ------------------------------------------------------------------------
13767 main/newmenu.h:
13768
13769  * Revision 1.3  1995/10/17  13:15:19  allender
13770  * new call to nm_listbox for close_box
13771  *
13772  * Revision 1.2  1995/09/13  08:48:50  allender
13773  * new prototype for newmenu -- have close box
13774  *
13775  * Revision 1.1  1995/05/16  16:00:32  allender
13776  * Initial revision
13777  *
13778  * Revision 2.0  1995/02/27  11:32:28  john
13779  * New version 2.0, which has no anonymous unions, builds with
13780  * Watcom 10.0, and doesn't require parsing BITMAPS.TBL.
13781  *
13782  * Revision 1.24  1995/02/11  16:20:05  john
13783  * Added code to make the default mission be the one last played.
13784  *
13785  * Revision 1.23  1995/01/31  10:21:41  john
13786  * Added code to specify width, height.
13787  *
13788  * Revision 1.22  1995/01/28  17:09:21  john
13789  * *** empty log message ***
13790  *
13791  * Revision 1.21  1995/01/23  18:38:43  john
13792  * Added listbox function.
13793  *
13794  * Revision 1.20  1994/11/26  15:29:55  matt
13795  * Allow escape out of change pilot menu
13796  *
13797  * Revision 1.19  1994/11/26  14:17:05  matt
13798  * Player can now only enter valid chars for his name
13799  *
13800  * Revision 1.18  1994/11/18  16:17:13  mike
13801  * prototype Max_linear_depth_objects.
13802  *
13803  * Revision 1.17  1994/11/08  14:51:17  john
13804  * Added nm_messagebox1, (like the original, only you can pass a function).
13805  *
13806  * Revision 1.16  1994/11/05  14:31:45  john
13807  * Added a new menu function for the background.
13808  *
13809  * Revision 1.15  1994/11/05  14:05:46  john
13810  * Fixed fade transitions between all screens by making gr_palette_fade_in and out keep
13811  * track of whether the palette is faded in or not.  Then, wherever the code needs to fade out,
13812  * it just calls gr_palette_fade_out and it will fade out if it isn't already.  The same with fade_in.
13813  * This eliminates the need for all the flags like Menu_fade_out, game_fade_in palette, etc.
13814  *
13815  * Revision 1.14  1994/11/03  19:37:35  john
13816  * Added scrolling file list box
13817  *
13818  * Revision 1.13  1994/10/13  11:34:03  john
13819  * Made Thrustmaster FCS Hat work.  Put a background behind the
13820  * keyboard configure.  Took out turn_sensitivity.  Changed sound/config
13821  * menu to new menu. Made F6 be calibrate joystick.
13822  *
13823  * Revision 1.12  1994/10/11  17:08:32  john
13824  * Added sliders for volume controls.
13825  *
13826  * Revision 1.11  1994/10/04  10:26:23  matt
13827  * Changed fade in to happen every time a global var is set
13828  *
13829  * Revision 1.10  1994/10/03  14:43:56  john
13830  * Added newmenu_do1, which allows you to pass the starting
13831  * item to the menu system
13832  *
13833  * Revision 1.9  1994/09/30  11:51:33  john
13834  * Added Matt's NM_TYPE_INPUT_MENU
13835  *
13836  * Revision 1.8  1994/08/30  20:38:28  john
13837  * Passed citem in newmenu sub.
13838  *
13839  * Revision 1.7  1994/08/12  03:11:00  john
13840  * Made network be default off; Moved network options into
13841  * main menu.  Made starting net game check that mines are the
13842  * same.
13843  *
13844  * Revision 1.6  1994/08/11  13:47:05  john
13845  * Made newmenu have subtitles, passed key through to
13846  * the newmenu subfunctions.
13847  *
13848  * Revision 1.5  1994/07/27  16:12:24  john
13849  * Changed newmenu system to have a callback function.
13850  * /.
13851  *
13852  * Revision 1.4  1994/07/24  17:41:38  john
13853  * *** empty log message ***
13854  *
13855  * Revision 1.3  1994/07/24  17:33:01  john
13856  * Added percent item.  Also neatend up a bit.
13857  *
13858  * Revision 1.2  1994/07/22  17:48:12  john
13859  * Added new menuing system.
13860  *
13861  * Revision 1.1  1994/07/22  13:55:51  john
13862  * Initial revision
13863
13864 ------------------------------------------------------------------------
13865 main/object.c:
13866
13867  * Revision 1.5  1995/10/26  14:08:03  allender
13868  * optimization to do physics on objects that didn't render last
13869  * frame only every so often
13870  *
13871  * Revision 1.4  1995/10/20  00:50:57  allender
13872  * make alt texture for player ship work correctly when cloaked
13873  *
13874  * Revision 1.3  1995/09/14  14:11:32  allender
13875  * fix_object_segs returns void
13876  *
13877  * Revision 1.2  1995/08/12  11:31:01  allender
13878  * removed #ifdef NEWDEMO -- always in
13879  *
13880  * Revision 1.1  1995/05/16  15:29:23  allender
13881  * Initial revision
13882  *
13883  * Revision 2.3  1995/06/15  12:30:51  john
13884  * Fixed bug with multiplayer ships cloaking out wrongly.
13885  *
13886  * Revision 2.2  1995/05/15  11:34:53  john
13887  * Fixed bug as Matt directed that fixed problems with the exit
13888  * triggers being missed on slow frame rate computer.
13889  *
13890  * Revision 2.1  1995/03/21  14:38:51  john
13891  * Ifdef'd out the NETWORK code.
13892  *
13893  * Revision 2.0  1995/02/27  11:28:14  john
13894  * New version 2.0, which has no anonymous unions, builds with
13895  * Watcom 10.0, and doesn't require parsing BITMAPS.TBL.
13896  *
13897  * Revision 1.335  1995/02/22  12:57:30  allender
13898  * remove anonymous unions from object structure
13899  *
13900  * Revision 1.334  1995/02/09  22:04:40  mike
13901  * fix lifeleft on badass weapons.
13902  *
13903  * Revision 1.333  1995/02/08  12:54:00  matt
13904  * Fixed object freeing code which was deleting some explosions it shouldn't
13905  *
13906  * Revision 1.332  1995/02/08  11:37:26  mike
13907  * Check for failures in call to obj_create.
13908  *
13909  * Revision 1.331  1995/02/05  17:48:52  rob
13910  * Changed assert in obj_relink, more robust.
13911  *
13912  * Revision 1.330  1995/02/05  13:39:48  mike
13913  * remove invulnerability effect code (actually, comment out).
13914  *
13915  * Revision 1.329  1995/02/04  12:29:52  rob
13916  * Get rid of potential assert error for explosion detachment.
13917  *
13918  * Revision 1.328  1995/02/01  18:15:57  rob
13919  * Removed debugging output from engine glow change.
13920  *
13921  * Revision 1.327  1995/02/01  16:20:12  matt
13922  * Made engine glow vary over a wider range, and made the glow be based
13923  * on thrust/speed, without regard to direction.
13924  *
13925  * Revision 1.326  1995/01/29  14:46:24  rob
13926  * Fixed invul. vclip to only appear on player who is invul.
13927  *
13928  * Revision 1.325  1995/01/29  13:48:16  mike
13929  * Add invulnerability graphical effect viewable by other players.
13930  *
13931  * Revision 1.324  1995/01/29  11:39:25  mike
13932  * Add invulnerability effect.
13933  *
13934  * Revision 1.323  1995/01/27  17:02:41  mike
13935  * add more information to an Error call.
13936  *
13937  * Revision 1.322  1995/01/26  22:11:30  mike
13938  * Purple chromo-blaster (ie, fusion cannon) spruce up (chromification)
13939  *
13940  * Revision 1.321  1995/01/25  20:04:10  matt
13941  * Moved matrix check to avoid orthogonalizing an uninitialize matrix
13942  *
13943  * Revision 1.320  1995/01/25  12:11:35  matt
13944  * Make sure orient matrix is orthogonal when resetting player object
13945  *
13946  * Revision 1.319  1995/01/21  21:46:22  mike
13947  * Optimize code in Assert (and prevent warning message).
13948  *
13949  * Revision 1.318  1995/01/21  21:22:16  rob
13950  * Removed HUD clear messages.
13951  * Added more Asserts to try and find illegal control type bug.
13952  *
13953  * Revision 1.317  1995/01/15  15:34:30  matt
13954  * When freeing object slots, don't free fireballs that will be deleting
13955  * other objects.
13956  *
13957  * Revision 1.316  1995/01/14  19:16:48  john
13958  * First version of new bitmap paging code.
13959  *
13960  * Revision 1.315  1995/01/12  18:53:37  john
13961  * Fixed parameter passing error.
13962  *
13963  * Revision 1.314  1995/01/12  12:09:47  yuan
13964  * Added coop object capability.
13965  *
13966  * Revision 1.313  1994/12/15  16:45:44  matt
13967  * Took out slew stuff for release version
13968  *
13969  * Revision 1.312  1994/12/15  13:04:25  mike
13970  * Replace Players[Player_num].time_total references with GameTime.
13971  *
13972  * Revision 1.311  1994/12/15  11:01:04  mike
13973  * add Object_minus_one for debugging.
13974  *
13975  * Revision 1.310  1994/12/15  03:03:33  matt
13976  * Added error checking for NULL return from object_create_explosion()
13977  *
13978  * Revision 1.309  1994/12/14  17:25:31  matt
13979  * Made next viewer func based on release not ndebug
13980  *
13981  * Revision 1.308  1994/12/13  12:55:42  mike
13982  * hostages on board messages for when you die.
13983  *
13984  * Revision 1.307  1994/12/12  17:18:11  mike
13985  * make boss cloak/teleport when get hit, make quad laser 3/4 as powerful.
13986  *
13987  * Revision 1.306  1994/12/12  00:27:11  matt
13988  * Added support for no-levelling option
13989  *
13990  * Revision 1.305  1994/12/11  22:41:14  matt
13991  * Added command-line option, -nolevel, which turns off player ship levelling
13992  *
13993  * Revision 1.304  1994/12/11  22:03:23  mike
13994  * free up object slots as necessary.
13995  *
13996  * Revision 1.303  1994/12/11  14:09:31  mike
13997  * make boss explosion sounds softer.
13998  *
13999  * Revision 1.302  1994/12/11  13:25:11  matt
14000  * Restored calls to fix_object_segs() when debugging is turned off, since
14001  * it's not a big routine, and could fix some possibly bad problems.
14002  *
14003  * Revision 1.301  1994/12/11  12:38:25  mike
14004  * make boss explosion sounds louder in create_small_fireball.
14005  *
14006  * Revision 1.300  1994/12/10  15:28:37  matt
14007  * Added asserts for debugging
14008  *
14009  * Revision 1.299  1994/12/09  16:18:51  matt
14010  * Fixed init_player_object, for editor
14011  *
14012  * Revision 1.298  1994/12/09  15:03:10  matt
14013  * Two changes for Mike:
14014  *   1.  Do better placement of camera during death sequence (prevents hang)
14015  *   2.  Only record dodging information if the player fired in a frame
14016  *
14017  * Revision 1.297  1994/12/09  14:59:12  matt
14018  * Added system to attach a fireball to another object for rendering purposes,
14019  * so the fireball always renders on top of (after) the object.
14020  *
14021  * Revision 1.296  1994/12/08  20:05:07  matt
14022  * Removed unneeded debug message
14023  *
14024  * Revision 1.295  1994/12/08  12:36:02  matt
14025  * Added new object allocation & deallocation functions so other code
14026  * could stop messing around with internal object data structures.
14027  *
14028  * Revision 1.294  1994/12/07  20:13:37  matt
14029  * Added debris object limiter
14030  *
14031  * Revision 1.293  1994/12/06  16:58:38  matt
14032  * Killed warnings
14033  *
14034  * Revision 1.292  1994/12/05  22:34:35  matt
14035  * Make tmap_override objects use override texture as alt texture.  This
14036  * should have the effect of making simpler models use the override texture.
14037  *
14038  * Revision 1.291  1994/12/05  12:23:53  mike
14039  * make camera start closer, but move away from player in death sequence.
14040  *
14041  * Revision 1.290  1994/12/02  11:11:18  mike
14042  * hook sound effect to player small explosions (ctrlcen, too).
14043  *
14044  * Revision 1.289  1994/11/28  21:50:52  mike
14045  * optimizations.
14046  *
14047  * Revision 1.288  1994/11/27  23:12:28  matt
14048  * Made changes for new mprintf calling convention
14049  *
14050  * Revision 1.287  1994/11/27  20:35:50  matt
14051  * Fixed dumb mistake
14052  *
14053  * Revision 1.286  1994/11/27  20:30:52  matt
14054  * Got rid of warning
14055  *
14056  * Revision 1.285  1994/11/21  11:43:21  mike
14057  * ndebug stuff.
14058  *
14059  * Revision 1.284  1994/11/19  15:19:37  mike
14060  * rip out unused code and data.
14061  *
14062  * Revision 1.283  1994/11/18  23:41:59  john
14063  * Changed some shorts to ints.
14064  *
14065  * Revision 1.282  1994/11/18  16:16:17  mike
14066  * Separate depth on objects vs. walls.
14067  *
14068  * Revision 1.281  1994/11/18  12:05:35  rob
14069  * Removed unnecessary invulnerability flag set in player death.
14070  * (I hope its unnecessary.. its commented out if it proves crucial)
14071  * fixes powerup dropping bug for net play.
14072  *
14073  * Revision 1.280  1994/11/16  20:36:34  rob
14074  * Changed player explosion (small) code.
14075  *
14076  * Revision 1.279  1994/11/16  18:26:04  matt
14077  * Clear tmap override on player, to fix "rock ship" bug
14078  *
14079  * Revision 1.278  1994/11/16  14:54:12  rob
14080  * Moved hook for network explosions.
14081  *
14082  * Revision 1.277  1994/11/14  11:40:42  mike
14083  * plot inner polygon on laser based on detail level.
14084  *
14085  * Revision 1.276  1994/11/10  14:02:59  matt
14086  * Hacked in support for player ships with different textures
14087  *
14088  * Revision 1.275  1994/11/08  12:19:08  mike
14089  * Make a generally useful function for putting small explosions on any object.
14090  *
14091  * Revision 1.274  1994/11/04  19:55:54  rob
14092  * Changed calls to player_explode to accomodate new parameter.
14093  *
14094  * Revision 1.273  1994/11/02  21:54:27  matt
14095  * Delete the camera when the death sequence is done
14096  *
14097  * Revision 1.272  1994/11/02  11:36:35  rob
14098  * Added player-in-process-of-dying explosions to network play.
14099  *
14100  * Revision 1.271  1994/10/31  17:25:33  matt
14101  * Fixed cloaked bug
14102  *
14103  * Revision 1.270  1994/10/31  16:11:19  allender
14104  * on demo recording, store letterbox mode in demo.
14105  *
14106  * Revision 1.269  1994/10/31  10:36:18  mike
14107  * Make cloak effect fadein/fadeout different for robots versus player.
14108  *
14109  * Revision 1.268  1994/10/30  14:11:44  mike
14110  * rip out repair center stuff.
14111  *
14112  * Revision 1.267  1994/10/28  19:43:52  mike
14113  * Boss cloaking effect.
14114  *
14115  * Revision 1.266  1994/10/27  11:33:42  mike
14116  * Add Highest_ever_object_index -- high water mark in object creation.
14117  *
14118  * Revision 1.265  1994/10/25  10:51:12  matt
14119  * Vulcan cannon powerups now contain ammo count
14120  *
14121  * Revision 1.264  1994/10/24  20:49:24  matt
14122  * Made cloaked objects pulse
14123  *
14124  * Revision 1.263  1994/10/21  12:19:45  matt
14125  * Clear transient objects when saving (& loading) games
14126  *
14127  * Revision 1.262  1994/10/21  11:25:23  mike
14128  * Use new constant IMMORTAL_TIME.
14129  *
14130  * Revision 1.261  1994/10/19  16:50:35  matt
14131  * If out of segment, put player in center of segment when checking objects
14132  *
14133  *
14134  * Revision 1.260  1994/10/17  23:21:55  mike
14135  * Clean up robot cloaking, move more to ai.c
14136  *
14137  * Revision 1.259  1994/10/17  21:34:49  matt
14138  * Added support for new Control Center/Main Reactor
14139  *
14140  * Revision 1.258  1994/10/17  21:18:04  mike
14141  * robot cloaking.
14142  *
14143  * Revision 1.257  1994/10/17  14:12:23  matt
14144  * Cleaned up problems with player dying from mine explosion
14145  *
14146  * Revision 1.256  1994/10/15  19:04:31  mike
14147  * Don't remove proximity bombs after you die.
14148  *
14149  * Revision 1.255  1994/10/14  15:57:00  mike
14150  * Don't show ids in network mode.
14151  * Fix, I hope, but in death sequence.
14152  *
14153  * Revision 1.254  1994/10/12  08:04:29  mike
14154  * Don't decloak player on death.
14155  *
14156  * Revision 1.253  1994/10/11  20:36:16  matt
14157  * Clear "transient" objects (weapons,explosions,etc.) when starting a level
14158  *
14159  * Revision 1.252  1994/10/11  12:24:09  matt
14160  * Cleaned up/change badass explosion calls
14161  *
14162  * Revision 1.251  1994/10/08  19:30:20  matt
14163  * Fixed (I hope) a bug in cloaking of multiplayer objects
14164  *
14165  * Revision 1.250  1994/10/08  14:03:15  rob
14166  * Changed cloaking routine.
14167  *
14168  * Revision 1.249  1994/10/07  22:17:27  mike
14169  * Asserts on valid segnum.
14170  *
14171  * Revision 1.248  1994/10/07  19:11:14  matt
14172  * Added cool cloak transition effect
14173
14174 ------------------------------------------------------------------------
14175 main/object.h:
14176
14177  * Revision 1.6  1995/09/20  14:24:45  allender
14178  * swap bytes on extractshortpos
14179  *
14180  * Revision 1.5  1995/09/14  14:11:42  allender
14181  * fix_object_segs returns void
14182  *
14183  * Revision 1.4  1995/08/12  12:02:44  allender
14184  * added flag to create_shortpos
14185  *
14186  * Revision 1.3  1995/07/12  12:55:08  allender
14187  * move structures back to original form as found on PC because
14188  * of network play
14189  *
14190  * Revision 1.2  1995/06/19  07:55:06  allender
14191  * rearranged structure members for possible better alignment
14192  *
14193  * Revision 1.1  1995/05/16  16:00:40  allender
14194  * Initial revision
14195  *
14196  * Revision 2.1  1995/03/31  12:24:10  john
14197  * I had changed alt_textures from a pointer to a byte. This hosed old
14198  * saved games, so I restored it to an int.
14199  *
14200  * Revision 2.0  1995/02/27  11:26:47  john
14201  * New version 2.0, which has no anonymous unions, builds with
14202  * Watcom 10.0, and doesn't require parsing BITMAPS.TBL.
14203  *
14204  * Revision 1.122  1995/02/22  12:35:53  allender
14205  * remove anonymous unions
14206  *
14207  * Revision 1.121  1995/02/06  20:43:25  rob
14208  * Extern'ed Dead_player_camera so it can be reset by multi.c
14209  *
14210  * Revision 1.120  1995/02/01  16:34:07  john
14211  * Linted.
14212  *
14213  * Revision 1.119  1995/01/29  13:46:42  mike
14214  * adapt to new create_small_fireball_on_object prototype.
14215  *
14216  * Revision 1.118  1995/01/26  22:11:27  mike
14217  * Purple chromo-blaster (ie, fusion cannon) spruce up (chromification)
14218  *
14219  * Revision 1.117  1995/01/24  12:09:29  mike
14220  * Boost MAX_OBJECTS from 250 to 350.
14221  *
14222  * Revision 1.116  1995/01/13  19:39:51  rob
14223  * Removed outdated remote_info structure.  (looking for cause of bugs
14224  *
14225  * Revision 1.115  1995/01/12  12:09:38  yuan
14226  * Added coop object capability.
14227  *
14228  * Revision 1.114  1994/12/15  13:04:20  mike
14229  * Replace Players[Player_num].time_total references with GameTime.
14230  *
14231  * Revision 1.113  1994/12/12  17:18:09  mike
14232  * make boss cloak/teleport when get hit, make quad laser 3/4 as powerful.
14233  *
14234  * Revision 1.112  1994/12/09  14:58:42  matt
14235  * Added system to attach a fireball to another object for rendering purposes,
14236  * so the fireball always renders on top of (after) the object.
14237  *
14238  * Revision 1.111  1994/12/08  12:35:35  matt
14239  * Added new object allocation & deallocation functions so other code
14240  * could stop messing around with internal object data structures.
14241  *
14242  * Revision 1.110  1994/11/21  17:30:21  matt
14243  * Increased max number of objects
14244  *
14245  * Revision 1.109  1994/11/18  23:41:52  john
14246  * Changed some shorts to ints.
14247  *
14248  * Revision 1.108  1994/11/10  14:02:45  matt
14249  * Hacked in support for player ships with different textures
14250  *
14251  * Revision 1.107  1994/11/08  12:19:27  mike
14252  * Small explosions on objects.
14253  *
14254  * Revision 1.106  1994/10/25  10:51:17  matt
14255  * Vulcan cannon powerups now contain ammo count
14256  *
14257  * Revision 1.105  1994/10/21  12:19:41  matt
14258  * Clear transient objects when saving (& loading) games
14259  *
14260  * Revision 1.104  1994/10/21  11:25:04  mike
14261  * Add IMMORTAL_TIME.
14262  *
14263  * Revision 1.103  1994/10/17  21:34:54  matt
14264  * Added support for new Control Center/Main Reactor
14265  *
14266  * Revision 1.102  1994/10/14  18:12:28  mike
14267  * Make egg dropping return object number.
14268  *
14269  * Revision 1.101  1994/10/12  21:07:19  matt
14270  * Killed unused field in object structure
14271  *
14272  * Revision 1.100  1994/10/12  10:38:24  mike
14273  * Add field OF_SILENT to obj->flags.
14274  *
14275  * Revision 1.99  1994/10/11  20:35:48  matt
14276  * Clear "transient" objects (weapons,explosions,etc.) when starting a level
14277  *
14278  * Revision 1.98  1994/10/03  20:56:13  rob
14279  * Added velocity to shortpos strucutre.
14280  *
14281  * Revision 1.97  1994/09/30  18:24:00  rob
14282  * Added new control type CT_REMOTE for remote controlled objects.
14283  * Also added a union struct 'remote_info' for this type.
14284  *
14285  * Revision 1.96  1994/09/28  09:23:05  mike
14286  * Prototype Object_type_names.
14287  *
14288  * Revision 1.95  1994/09/25  23:32:37  matt
14289  * Changed the object load & save code to read/write the structure fields one
14290  * at a time (rather than the whole structure at once).  This mean that the
14291  * object structure can be changed without breaking the load/save functions.
14292  * As a result of this change, the local_object data can be and has been
14293  * incorporated into the object array.  Also, timeleft is now a property
14294  * of all objects, and the object structure has been otherwise cleaned up.
14295  *
14296  * Revision 1.94  1994/09/25  15:45:28  matt
14297  * Added OBJ_LIGHT, a type of object that casts light
14298  * Added generalized lifeleft, and moved it to local_object
14299  *
14300  * Revision 1.93  1994/09/24  17:41:19  mike
14301  * Add stuff to Local_object structure for materialization centers.
14302  *
14303  * Revision 1.92  1994/09/24  13:16:50  matt
14304  * Added (hacked in, really) support for overriding the bitmaps used on to
14305  * texture map a polygon object, and using a new bitmap for all the faces.
14306  *
14307  * Revision 1.91  1994/09/22  19:02:14  mike
14308  * Prototype functions extract_shortpos and create_shortpos which reside in
14309  * gameseg.c, but are prototyped here to prevent circular dependencies.
14310  *
14311  * Revision 1.90  1994/09/15  21:47:14  mike
14312  * Prototype dead_player_end().
14313  *
14314  * Revision 1.89  1994/09/15  16:34:47  mike
14315  * Add danger_laser_num and danger_laser_signature to object_local to
14316  * enable robots to efficiently (too efficiently!) avoid player fire.
14317  *
14318  * Revision 1.88  1994/09/11  22:46:19  mike
14319  * Death_sequence_aborted prototyped.
14320  *
14321  * Revision 1.87  1994/09/09  20:04:30  mike
14322  * Add vclips for weapons.
14323  *
14324  * Revision 1.86  1994/09/09  14:20:54  matt
14325  * Added flag that says object uses thrust
14326  *
14327  * Revision 1.85  1994/09/08  14:51:32  mike
14328  * Make a crucial name change to a field of local_object struct.
14329  *
14330  * Revision 1.84  1994/09/07  19:16:45  mike
14331  * Homing missile.
14332  *
14333  * Revision 1.83  1994/09/06  17:05:43  matt
14334  * Added new type for dead player
14335  *
14336  * Revision 1.82  1994/09/02  11:56:09  mike
14337  * Add persistency (PF_PERSISTENT) to physics_info.
14338  *
14339  * Revision 1.81  1994/08/28  19:10:28  mike
14340  * Add Player_is_dead.
14341  *
14342  * Revision 1.80  1994/08/18  15:11:44  mike
14343  * powerup stuff.
14344  *
14345  * Revision 1.79  1994/08/15  15:24:54  john
14346  * Made players know who killed them; Disabled cheat menu
14347  * during net player; fixed bug with not being able to turn
14348  * of invulnerability; Made going into edit/starting new leve
14349  * l drop you out of a net game; made death dialog box.
14350  *
14351  * Revision 1.78  1994/08/14  23:15:12  matt
14352  * Added animating bitmap hostages, and cleaned up vclips a bit
14353  *
14354  * Revision 1.77  1994/08/13  14:58:27  matt
14355  * Finished adding support for miscellaneous objects
14356  *
14357  * Revision 1.76  1994/08/09  16:04:13  john
14358  * Added network players to editor.
14359  *
14360  * Revision 1.75  1994/08/03  21:06:19  matt
14361  * Added prototype for fix_object_segs(), and renamed now-unused spawn_pos
14362  *
14363  * Revision 1.74  1994/08/02  12:30:27  matt
14364  * Added support for spinning objects
14365  *
14366  * Revision 1.73  1994/07/27  20:53:25  matt
14367  * Added rotational drag & thrust, so turning now has momemtum like moving
14368  *
14369  * Revision 1.72  1994/07/27  19:44:21  mike
14370  * Objects containing objects.
14371  *
14372  * Revision 1.71  1994/07/22  20:43:29  matt
14373  * Fixed flares, by adding a physics flag that makes them stick to walls.
14374  *
14375  * Revision 1.70  1994/07/21  12:42:10  mike
14376  * Prototype new find_object_seg and update_object_seg.
14377  *
14378  * Revision 1.69  1994/07/19  15:26:39  mike
14379  * New ai_static structure.
14380  *
14381  * Revision 1.68  1994/07/13  00:15:06  matt
14382  * Moved all (or nearly all) of the values that affect player movement to
14383  * bitmaps.tbl
14384  *
14385  * Revision 1.67  1994/07/12  12:40:12  matt
14386  * Revamped physics system
14387  *
14388  * Revision 1.66  1994/07/06  15:26:23  yuan
14389  * Added chase mode.
14390
14391 ------------------------------------------------------------------------
14392 main/paging.c:
14393
14394  * Revision 1.5  1995/10/30  11:06:58  allender
14395  * added change to paging code ala John -- check tmap_override
14396  * when paging in robots
14397  *
14398  * Revision 1.4  1995/09/13  08:48:28  allender
14399  * John's new paging code
14400  *
14401  * Revision 1.3  1995/08/18  10:20:31  allender
14402  * changed hard coded black pixel value to use BM_XRGB
14403  *
14404  * Revision 1.2  1995/07/26  17:02:10  allender
14405  * small fix to page in effect bitmaps correctly
14406  *
14407  * Revision 1.1  1995/05/16  15:29:35  allender
14408  * Initial revision
14409  *
14410  * Revision 2.5  1995/10/07  13:18:21  john
14411  * Added PSX debugging stuff that builds .PAG files.
14412  *
14413  * Revision 2.4  1995/08/24  13:40:03  john
14414  * Added code to page in vclip for powerup disapperance and to
14415  * fix bug that made robot makers not page in the correct bot
14416  * textures.
14417  *
14418  * Revision 2.3  1995/07/26  12:09:19  john
14419  * Made code that pages in weapon_info->robot_hit_vclip not
14420  * page in unless it is a badass weapon.  Took out old functionallity
14421  * of using this if no robot exp1_vclip, since all robots have these.
14422  *
14423  * Revision 2.2  1995/07/24  13:22:11  john
14424  * Made sure everything gets paged in at the
14425  * level start.  Fixed bug with robot effects not
14426  * getting paged in correctly.
14427  *
14428  * Revision 2.1  1995/05/12  15:50:16  allender
14429  * fix to check effects dest_bm_num > -1 before paging in
14430  *
14431  * Revision 2.0  1995/02/27  11:27:39  john
14432  * New version 2.0, which has no anonymous unions, builds with
14433  * Watcom 10.0, and doesn't require parsing BITMAPS.TBL.
14434  *
14435  * Revision 1.18  1995/02/22  14:12:28  allender
14436  * remove anonyous union from object structure
14437  *
14438  * Revision 1.17  1995/02/11  22:54:15  john
14439  * Made loading for pig not show up for demos.
14440  *
14441  * Revision 1.16  1995/02/11  22:37:04  john
14442  * Made cockpit redraw.
14443  *
14444  * Revision 1.15  1995/01/28  16:29:35  john
14445  * *** empty log message ***
14446  *
14447  * Revision 1.14  1995/01/27  17:16:18  john
14448  * Added code to page in all the weapons.
14449  *
14450  * Revision 1.13  1995/01/24  21:51:22  matt
14451  * Clear the boxed message to fix a mem leakage
14452  *
14453  * Revision 1.12  1995/01/23  13:00:46  john
14454  * Added hostage vclip paging.
14455  *
14456  * Revision 1.11  1995/01/23  12:29:52  john
14457  * Added code to page in eclip on robots, dead control center,
14458  * gauges bitmaps, and weapon pictures.
14459  *
14460  * Revision 1.10  1995/01/21  12:54:15  adam
14461  * *** empty log message ***
14462  *
14463  * Revision 1.9  1995/01/21  12:41:29  adam
14464  * changed orb to loading box
14465  *
14466  * Revision 1.8  1995/01/18  15:09:02  john
14467  * Added start/stop time around paging.
14468  * Made paging clear screen around globe.
14469  *
14470  * Revision 1.7  1995/01/18  10:37:00  john
14471  * Added code to page in exploding monitors.
14472  *
14473  * Revision 1.6  1995/01/17  19:03:35  john
14474  * Added cool spinning orb during loading.
14475  *
14476  * Revision 1.5  1995/01/17  14:49:26  john
14477  * Paged in weapons.
14478  *
14479  * Revision 1.4  1995/01/17  12:14:07  john
14480  * Made walls, object explosion vclips load at level start.
14481  *
14482  * Revision 1.3  1995/01/15  13:23:24  john
14483  * First working version
14484  *
14485  * Revision 1.2  1995/01/15  11:56:45  john
14486  * Working version of paging.
14487  *
14488  * Revision 1.1  1995/01/15  11:33:37  john
14489  * Initial revision
14490
14491 ------------------------------------------------------------------------
14492 main/paging.h:
14493
14494  * Revision 1.1  1995/05/16  16:00:48  allender
14495  * Initial revision
14496  *
14497  * Revision 2.0  1995/02/27  11:30:12  john
14498  * New version 2.0, which has no anonymous unions, builds with
14499  * Watcom 10.0, and doesn't require parsing BITMAPS.TBL.
14500  *
14501  * Revision 1.2  1995/01/15  11:56:39  john
14502  * Working version of paging.
14503  *
14504  * Revision 1.1  1995/01/15  11:33:52  john
14505  * Initial revision
14506
14507 ------------------------------------------------------------------------
14508 main/physics.c:
14509
14510  * Revision 1.5  1995/10/12  17:28:08  allender
14511  * put in code to move and object to center of segment in
14512  * do_physics sim when fvi fails with bad point
14513  *
14514  * Revision 1.4  1995/08/23  21:32:44  allender
14515  * fix mcc compiler warnings
14516  *
14517  * Revision 1.3  1995/07/28  15:38:56  allender
14518  * removed isqrt thing -- not required here
14519  *
14520  * Revision 1.2  1995/07/28  15:13:29  allender
14521  * fixed vector magnitude thing
14522  *
14523  * Revision 1.1  1995/05/16  15:29:42  allender
14524  * Initial revision
14525  *
14526  * Revision 2.2  1995/03/24  14:48:54  john
14527  * Added cheat for player to go thru walls.
14528  *
14529  * Revision 2.1  1995/03/20  18:15:59  john
14530  * Added code to not store the normals in the segment structure.
14531  *
14532  * Revision 2.0  1995/02/27  11:32:06  john
14533  * New version 2.0, which has no anonymous unions, builds with
14534  * Watcom 10.0, and doesn't require parsing BITMAPS.TBL.
14535  *
14536  * Revision 1.213  1995/02/22  13:40:48  allender
14537  * remove anonymous unions from object structure
14538  *
14539  * Revision 1.212  1995/02/22  13:24:42  john
14540  * Removed the vecmat anonymous unions.
14541  *
14542  * Revision 1.211  1995/02/06  19:46:59  matt
14543  * New function (untested), set_thrust_from_velocity()
14544  *
14545  * Revision 1.210  1995/02/02  16:26:12  matt
14546  * Changed assert that was causing a problem
14547  *
14548  * Revision 1.209  1995/02/02  14:07:00  matt
14549  * Fixed confusion about which segment you are touching when you're
14550  * touching a wall.  This manifested itself in spurious lava burns.
14551  *
14552  * Revision 1.208  1995/02/01  21:03:24  john
14553  * Lintified.
14554  *
14555  * Revision 1.207  1995/01/25  13:53:35  rob
14556  * Removed an Int3 from multiplayer games.
14557  *
14558  * Revision 1.206  1995/01/23  17:30:47  rob
14559  * Removed Int3 on bogus sim time.
14560  *
14561  * Revision 1.205  1995/01/17  11:08:56  matt
14562  * Disable new-ish FVI edge checking for all objects except the player,
14563  * since it was causing problems with the fusion cannon.
14564  *
14565  * Revision 1.204  1995/01/05  09:43:49  matt
14566  * Took out int3s from new code
14567  *
14568  * Revision 1.203  1995/01/04  22:19:23  matt
14569  * Added hack to keep player from squeezing through closed walls/doors
14570  *
14571  * Revision 1.202  1995/01/02  12:38:48  mike
14572  * physics hack to crazy josh not get hung up on proximity bombs.  Matt notified via email.
14573  *
14574  * Revision 1.201  1994/12/13  15:39:22  mike
14575  * #ifndef NDEBUG some code.
14576  *
14577  * Revision 1.200  1994/12/13  13:28:34  yuan
14578  * Fixed type.
14579  *
14580  * Revision 1.199  1994/12/13  13:25:00  matt
14581  * Made bump hack compile out if so desired
14582  *
14583  * Revision 1.198  1994/12/13  12:02:39  matt
14584  * Added hack to bump player a little if stuck
14585  *
14586  * Revision 1.197  1994/12/12  00:32:23  matt
14587  * When objects other than player go out of mine, jerk to center of segment
14588  *
14589  * Revision 1.196  1994/12/10  22:52:42  mike
14590  * make physics left-the-mine checking always be in.
14591  *
14592  * Revision 1.195  1994/12/08  00:53:01  mike
14593  * oops...phys rot bug.
14594  *
14595  * Revision 1.194  1994/12/07  12:54:54  mike
14596  * tweak rotvel applied from collisions.
14597  *
14598  * Revision 1.193  1994/12/07  00:36:08  mike
14599  * fix phys_apply_rot for robots -- ai was bashing effect in next frame.
14600  *
14601  * Revision 1.192  1994/12/05  17:23:10  matt
14602  * Made a bunch of debug code compile out
14603  *
14604  * Revision 1.191  1994/12/05  16:30:10  matt
14605  * Was illegally changing an object's segment...shoot me.
14606  *
14607  * Revision 1.190  1994/12/05  11:58:51  mike
14608  * fix stupid apply_force_rot() bug.
14609  *
14610  * Revision 1.189  1994/12/05  09:42:17  mike
14611  * fix 0 mag problem when object applies force to itself.
14612  *
14613  * Revision 1.188  1994/12/04  22:48:40  matt
14614  * Physics & FVI now only build seglist for player objects, and they
14615  * responsilby deal with buffer full conditions
14616  *
14617  * Revision 1.187  1994/12/04  22:14:07  mike
14618  * apply instantaneous rotation to an object due to a force blow.
14619  *
14620  * Revision 1.186  1994/12/04  18:51:30  matt
14621  * When weapons get stuck, delete them!
14622  *
14623  * Revision 1.185  1994/12/04  18:38:56  matt
14624  * Added better handling of point-not-in-seg problem
14625  *
14626  * Revision 1.184  1994/11/27  23:13:42  matt
14627  * Made changes for new mprintf calling convention
14628  *
14629  * Revision 1.183  1994/11/25  23:46:18  matt
14630  * Fixed drag problems with framerates over 60Hz
14631  *
14632  * Revision 1.182  1994/11/25  22:15:52  matt
14633  * Added asserts to try to trap frametime < 0 bug
14634  *
14635  * Revision 1.181  1994/11/21  11:42:44  mike
14636  * ndebug stuff.
14637  *
14638  * Revision 1.180  1994/11/19  15:15:04  mike
14639  * remove unused code and data
14640  *
14641  * Revision 1.179  1994/11/16  11:25:22  matt
14642  * Abort physics if negative frametime
14643  *
14644  * Revision 1.178  1994/10/05  19:50:41  rob
14645  * Removed a non-critical Int3 where an object's segnum is checked.
14646  * Left mprintf message.
14647  *
14648  * Revision 1.177  1994/10/03  22:57:50  matt
14649  * Fixed problem with matrix corruption of non-moving (but rotating) objects
14650  *
14651  * Revision 1.176  1994/09/28  09:23:28  mike
14652  * Add useful information to mprintf(1,... error messages.
14653  *
14654  * Revision 1.175  1994/09/21  17:16:54  mike
14655  * Make objects stuck in doors go away when door opens.
14656  *
14657  * Revision 1.174  1994/09/12  14:19:06  matt
14658  * Drag & thrust now handled differently
14659  *
14660  * Revision 1.173  1994/09/09  14:21:12  matt
14661  * Use new thrust flag
14662  *
14663  * Revision 1.172  1994/09/08  16:21:57  matt
14664  * Cleaned up player-hit-wall code, and added object scrape handling
14665  * Also added weapon-on-weapon hit sound
14666  *
14667  * Revision 1.171  1994/09/02  12:30:37  matt
14668  * Fixed weapons which go through objects
14669  *
14670  * Revision 1.170  1994/09/02  11:55:14  mike
14671  * Kill redefinition of a constant which is properly defined in object.h
14672  *
14673  * Revision 1.169  1994/09/02  11:35:01  matt
14674  * Fixed typo
14675  *
14676  * Revision 1.168  1994/09/02  11:32:48  matt
14677  * Fixed object/object collisions, so you can't fly through robots anymore.
14678  * Cleaned up object damage system.
14679  *
14680  * Revision 1.167  1994/08/30  21:58:15  matt
14681  * Made phys_apply_force() do nothing to an object if it's not a phys object
14682  *
14683  * Revision 1.166  1994/08/26  10:47:01  john
14684  * New version of controls.
14685  *
14686  * Revision 1.165  1994/08/25  21:53:57  mike
14687  * Prevent counts of -1 which eventually add up to a positive number in do_ai_frame, causing
14688  * the too-many-retries behavior.
14689  *
14690  * Revision 1.164  1994/08/25  18:43:33  john
14691  * First revision of new control code.
14692  *
14693  * Revision 1.163  1994/08/17  22:18:05  mike
14694  * Make robots which have rotvel or rotthrust, but not movement, move.
14695  *
14696  * Revision 1.162  1994/08/13  17:31:18  mike
14697  * retry count stuff.
14698  *
14699  * Revision 1.161  1994/08/11  18:59:16  mike
14700  * *** empty log message ***
14701  *
14702  * Revision 1.160  1994/08/10  19:53:47  mike
14703  * Debug code (which is still in...)
14704  * and adapt to changed interface to create_path_to_player.
14705  *
14706  * Revision 1.159  1994/08/08  21:38:43  matt
14707  * Cleaned up a code a little and optimized a little
14708  *
14709  * Revision 1.158  1994/08/08  15:21:50  mike
14710  * Trap retry count >= 4, but don't do AI hack unless >= 6.
14711  *
14712  * Revision 1.157  1994/08/08  11:47:15  matt
14713  * Cleaned up fvi and physics a little
14714  *
14715  * Revision 1.156  1994/08/05  10:10:10  yuan
14716  * Commented out debug stuff that was killing framerate.
14717  *
14718  * Revision 1.155  1994/08/04  19:12:36  matt
14719  * Changed a bunch of vecmat calls to use multiple-function routines, and to
14720  * allow the use of C macros for some functions
14721  *
14722  * Revision 1.154  1994/08/04  16:33:57  mike
14723  * Kill a pile of RCS stuff.
14724  * Call create_path_to_player for a stuck object.
14725  *
14726  * Revision 1.153  1994/08/04  00:21:02  matt
14727  * Cleaned up fvi & physics error handling; put in code to make sure objects
14728  * are in correct segment; simplified segment finding for objects and points
14729  *
14730  * Revision 1.152  1994/08/01  16:25:34  matt
14731  * Check for moved_time == 0 when computing hit speed
14732  *
14733  * Revision 1.151  1994/08/01  13:30:32  matt
14734  * Made fvi() check holes in transparent walls, and changed fvi() calling
14735  * parms to take all input data in query structure.
14736  *
14737  * Revision 1.150  1994/07/29  23:41:46  matt
14738  * Fixed turn banking, which changed when I added rotational velocity
14739  *
14740  * Revision 1.149  1994/07/27  20:53:23  matt
14741  * Added rotational drag & thrust, so turning now has momemtum like moving
14742
14743 ------------------------------------------------------------------------
14744 main/physics.h:
14745
14746  * Revision 1.2  1995/08/23  21:33:04  allender
14747  * fix mcc compiler warnings
14748  *
14749  * Revision 1.1  1995/05/16  16:00:56  allender
14750  * Initial revision
14751  *
14752  * Revision 2.0  1995/02/27  11:33:06  john
14753  * New version 2.0, which has no anonymous unions, builds with
14754  * Watcom 10.0, and doesn't require parsing BITMAPS.TBL.
14755  *
14756  * Revision 1.29  1995/02/06  19:47:18  matt
14757  * New function (untested), set_thrust_from_velocity()
14758  *
14759  * Revision 1.28  1994/12/04  22:14:20  mike
14760  * apply instantaneous rotation to an object due to a force blow.
14761  *
14762  * Revision 1.27  1994/08/01  13:29:42  matt
14763  * Made fvi() check holes in transparent walls, and changed fvi() calling
14764  * parms to take all input data in query structure.
14765  *
14766  * Revision 1.26  1994/07/28  12:35:22  matt
14767  * Added prototype
14768  *
14769  * Revision 1.25  1994/07/13  21:48:05  matt
14770  * FVI() and physics now keep lists of segments passed through which the
14771  * trigger code uses.
14772  *
14773  * Revision 1.24  1994/06/30  19:01:55  matt
14774  * Moved flying controls code from physics.c to controls.c
14775  *
14776  * Revision 1.23  1994/06/16  14:14:20  mike
14777  * Change physics_lookahead to return hit_info.
14778  *
14779  * Revision 1.22  1994/06/09  09:58:43  matt
14780  * Moved find_vector_intersection() from physics.c to new file fvi.c
14781  *
14782  * Revision 1.21  1994/05/20  16:11:07  matt
14783  * Added new parm, ignore_obj, to find_vector_intersection()
14784  *
14785  * Revision 1.20  1994/05/20  15:16:58  matt
14786  * Added new fvi return type; took out some troublesome (and troubling) asserts
14787
14788 ------------------------------------------------------------------------
14789 main/piggy.c:
14790
14791  * Revision 1.16  1995/11/09  17:27:47  allender
14792  * put in missing quote on new gauge name
14793  *
14794  * Revision 1.15  1995/11/08  17:28:03  allender
14795  * add PC gauges to gauge list of non-substitutatble bitmaps
14796  *
14797  * Revision 1.14  1995/11/08  15:14:49  allender
14798  * fixed horrible bug where the piggy cache size was incorrect
14799  * for mac shareware
14800  *
14801  * Revision 1.13  1995/11/03  12:53:37  allender
14802  * shareware changes
14803  *
14804  * Revision 1.12  1995/10/21  22:25:14  allender
14805  * added bald guy cheat
14806  *
14807  * Revision 1.11  1995/10/20  22:42:15  allender
14808  * changed load path of descent.pig to :data:descent.pig
14809  *
14810  * Revision 1.10  1995/10/20  00:08:01  allender
14811  * put in event loop calls when loading data (hides it nicely
14812  * from user) so TM can get it's strokes stuff
14813  *
14814  * Revision 1.9  1995/09/13  08:48:01  allender
14815  * added lower memory requirement to load alternate bitmaps
14816  *
14817  * Revision 1.8  1995/08/16  09:39:13  allender
14818  * moved "loading" text up a little
14819  *
14820  * Revision 1.7  1995/08/08  13:54:26  allender
14821  * added macsys header file
14822  *
14823  * Revision 1.6  1995/07/12  12:49:56  allender
14824  * total hack for bitmaps > 512 bytes wide -- check these by name
14825  *
14826  * Revision 1.5  1995/07/05  16:47:05  allender
14827  * kitchen stuff
14828  *
14829  * Revision 1.4  1995/06/23  08:55:28  allender
14830  * make "loading data" text y loc based off of curcanv
14831  *
14832  * Revision 1.3  1995/06/08  14:08:52  allender
14833  * PPC aligned data sets
14834  *
14835  * Revision 1.2  1995/05/26  06:54:27  allender
14836  * removed refences to sound data at end of pig file (since they will
14837  * now be Macintosh snd resources for effects
14838  *
14839  * Revision 1.1  1995/05/16  15:29:51  allender
14840  * Initial revision
14841  *
14842  * Revision 2.10  1995/10/07  13:17:26  john
14843  * Made all bitmaps paged out by default.
14844  *
14845  * Revision 2.9  1995/04/14  14:05:24  john
14846  * *** empty log message ***
14847  *
14848  * Revision 2.8  1995/04/12  13:39:37  john
14849  * Fixed bug with -lowmem not working.
14850  *
14851  * Revision 2.7  1995/03/29  23:23:17  john
14852  * Fixed major bug with sounds not building into pig right.
14853  *
14854  * Revision 2.6  1995/03/28  18:05:00  john
14855  * Fixed it so you don't have to delete pig after changing bitmaps.tbl
14856  *
14857  * Revision 2.5  1995/03/16  23:13:06  john
14858  * Fixed bug with piggy paging in bitmap not checking for disk
14859  * error, hence bogifying textures if you pull the CD out.
14860  *
14861  * Revision 2.4  1995/03/14  16:22:27  john
14862  * Added cdrom alternate directory stuff.
14863  *
14864  * Revision 2.3  1995/03/06  15:23:20  john
14865  * New screen techniques.
14866  *
14867  * Revision 2.2  1995/02/27  13:13:40  john
14868  * Removed floating point.
14869  *
14870  * Revision 2.1  1995/02/27  12:31:25  john
14871  * Made work without editor.
14872  *
14873  * Revision 2.0  1995/02/27  11:28:02  john
14874  * New version 2.0, which has no anonymous unions, builds with
14875  * Watcom 10.0, and doesn't require parsing BITMAPS.TBL.
14876  *
14877  * Revision 1.85  1995/02/09  12:54:24  john
14878  * Made paged out bitmaps have bm_data be a valid pointer
14879  * instead of NULL, in case anyone accesses it.
14880  *
14881  * Revision 1.84  1995/02/09  12:50:59  john
14882  * Bullet-proofed the piggy loading code.
14883  *
14884  * Revision 1.83  1995/02/07  17:08:51  john
14885  * Added some error handling stuff instead of asserts.
14886  *
14887  * Revision 1.82  1995/02/03  17:06:48  john
14888  * Changed sound stuff to allow low memory usage.
14889  * Also, changed so that Sounds isn't an array of digi_sounds, it
14890  * is a ubyte pointing into GameSounds, this way the digi.c code that
14891  * locks sounds won't accidentally unlock a sound that is already playing, but
14892  * since it's Sounds[soundno] is different, it would erroneously be unlocked.
14893  *
14894  * Revision 1.81  1995/02/02  21:56:39  matt
14895  * Added data for new gauge bitmaps
14896  *
14897  * Revision 1.80  1995/02/01  23:31:57  john
14898  * Took out loading bar.
14899  *
14900  * Revision 1.79  1995/01/28  15:13:18  allender
14901  * bumped up Piggy_bitmap_cache_size
14902  *
14903  * Revision 1.78  1995/01/26  12:30:43  john
14904  * Took out prev.
14905  *
14906  * Revision 1.77  1995/01/26  12:12:17  john
14907  * Made buffer be big for bitmaps.
14908  *
14909  * Revision 1.76  1995/01/25  20:15:38  john
14910  * Made editor allocate all mem.
14911  *
14912  * Revision 1.75  1995/01/25  14:52:56  john
14913  * Made bitmap buffer be 1.5 MB.
14914  *
14915  * Revision 1.74  1995/01/22  16:03:19  mike
14916  * localization.
14917  *
14918  * Revision 1.73  1995/01/22  15:58:36  mike
14919  * localization
14920  *
14921  * Revision 1.72  1995/01/18  20:51:20  john
14922  * Took out warnings.
14923  *
14924  * Revision 1.71  1995/01/18  20:47:21  john
14925  * Added code to allocate sounds & bitmaps into diff
14926  * buffers, also made sounds not be compressed for registered.
14927  *
14928  * Revision 1.70  1995/01/18  15:08:41  john
14929  * Added start/stop time around paging.
14930  * Made paging clear screen around globe.
14931  *
14932  * Revision 1.69  1995/01/18  10:07:51  john
14933  *
14934  * Took out debugging mprintfs.
14935  *
14936  * Revision 1.68  1995/01/17  14:27:42  john
14937  * y
14938  *
14939  * Revision 1.67  1995/01/17  12:14:39  john
14940  * Made walls, object explosion vclips load at level start.
14941  *
14942  * Revision 1.66  1995/01/15  13:15:44  john
14943  * Made so that paging always happens, lowmem just loads less.
14944  * Also, make KB load print to hud.
14945  *
14946  * Revision 1.65  1995/01/15  11:56:28  john
14947  * Working version of paging.
14948  *
14949  * Revision 1.64  1995/01/14  19:17:07  john
14950  * First version of new bitmap paging code.
14951  *
14952  * Revision 1.63  1994/12/15  12:26:44  john
14953  * Added -nolowmem function.
14954  *
14955  * Revision 1.62  1994/12/14  21:12:26  john
14956  * Fixed bug with page fault when exiting and using
14957  * -nosound.
14958  *
14959  * Revision 1.61  1994/12/14  11:35:31  john
14960  * Evened out thermometer for pig read.
14961  *
14962  * Revision 1.60  1994/12/14  10:51:00  john
14963  * Sped up sound loading.
14964  *
14965  * Revision 1.59  1994/12/14  10:12:08  john
14966  * Sped up pig loading.
14967  *
14968  * Revision 1.58  1994/12/13  09:14:47  john
14969  * *** empty log message ***
14970  *
14971  * Revision 1.57  1994/12/13  09:12:57  john
14972  * Made the bar always fill up.
14973  *
14974  * Revision 1.56  1994/12/13  03:49:08  john
14975  * Made -lowmem not load the unnecessary bitmaps.
14976  *
14977  * Revision 1.55  1994/12/06  16:06:35  john
14978  * Took out piggy sorting.
14979  *
14980  * Revision 1.54  1994/12/06  15:11:14  john
14981  * Fixed bug with reading pigs.
14982  *
14983  * Revision 1.53  1994/12/06  14:14:47  john
14984  * Added code to set low mem based on memory.
14985  *
14986  * Revision 1.52  1994/12/06  14:01:10  john
14987  * Fixed bug that was causing -lowmem all the time..
14988  *
14989  * Revision 1.51  1994/12/06  13:33:48  john
14990  * Added lowmem option.
14991  *
14992  * Revision 1.50  1994/12/05  19:40:10  john
14993  * If -nosound or no sound card selected, don't load sounds from pig.
14994  *
14995  * Revision 1.49  1994/12/05  12:17:44  john
14996  * Added code that locks/unlocks digital sounds on demand.
14997  *
14998  * Revision 1.48  1994/12/05  11:39:03  matt
14999  * Fixed little mistake
15000  *
15001  * Revision 1.47  1994/12/05  09:29:22  john
15002  * Added clength to the sound field.
15003  *
15004  * Revision 1.46  1994/12/04  15:27:15  john
15005  * Fixed my stupid bug that looked at -nosound instead of digi_driver_card
15006  * to see whether or not to lock down sound memory.
15007  *
15008  * Revision 1.45  1994/12/03  14:17:00  john
15009  * Took out my debug mprintf.
15010  *
15011  * Revision 1.44  1994/12/03  13:32:37  john
15012  * Fixed bug with offscreen bitmap.
15013  *
15014  * Revision 1.43  1994/12/03  13:07:13  john
15015  * Made the pig read/write compressed sounds.
15016  *
15017  * Revision 1.42  1994/12/03  11:48:51  matt
15018  * Added option to not dump sounds to pigfile
15019  *
15020  * Revision 1.41  1994/12/02  20:02:20  matt
15021  * Made sound files constant match constant for table
15022  *
15023  * Revision 1.40  1994/11/29  11:03:09  adam
15024  * upped # of sounds
15025  *
15026  * Revision 1.39  1994/11/27  23:13:51  matt
15027  * Made changes for new mprintf calling convention
15028  *
15029  * Revision 1.38  1994/11/20  18:40:34  john
15030  * MAde the piggy.lst and piggy.all not dump for release.
15031  *
15032  * Revision 1.37  1994/11/19  23:54:45  mike
15033  * up number of bitmaps for shareware version.
15034  *
15035  * Revision 1.36  1994/11/19  19:53:05  mike
15036  * change MAX_BITMAP_FILES
15037  *
15038  * Revision 1.35  1994/11/19  10:42:56  matt
15039  * Increased number of bitmaps for non-shareware version
15040  *
15041  * Revision 1.34  1994/11/19  09:11:52  john
15042  * Added avg_color to bitmaps saved in pig.
15043  *
15044  * Revision 1.33  1994/11/19  00:07:05  john
15045  * Fixed bug with 8 char sound filenames not getting read from pig.
15046  *
15047  * Revision 1.32  1994/11/18  22:24:54  john
15048  * Added -bigpig command line that doesn't rle your pig.
15049  *
15050  * Revision 1.31  1994/11/18  21:56:53  john
15051  * Added a better, leaner pig format.
15052  *
15053  * Revision 1.30  1994/11/16  12:06:16  john
15054  * Fixed bug with calling .bbms abms.
15055  *
15056  * Revision 1.29  1994/11/16  12:00:56  john
15057  * Added piggy.all dump.
15058  *
15059  * Revision 1.28  1994/11/10  21:16:02  adam
15060  * nothing important
15061  *
15062  * Revision 1.27  1994/11/10  13:42:00  john
15063  * Made sounds not lock down if using -nosound.
15064  *
15065  * Revision 1.26  1994/11/09  19:55:40  john
15066  * Added full rle support with texture rle caching.
15067  *
15068  * Revision 1.25  1994/11/09  16:36:42  john
15069  * First version with RLE bitmaps in Pig.
15070  *
15071  * Revision 1.24  1994/10/27  19:42:59  john
15072  * Disable the piglet option.
15073  *
15074  * Revision 1.23  1994/10/27  18:51:40  john
15075  * Added -piglet option that only loads needed textures for a
15076  * mine.  Only saved ~1MB, and code still doesn't free textures
15077  * before you load a new mine.
15078  *
15079  * Revision 1.22  1994/10/25  13:11:42  john
15080  * Made the sounds sort. Dumped piggy.lst.
15081  *
15082  * Revision 1.21  1994/10/06  17:06:23  john
15083  * Took out rle stuff.
15084  *
15085  * Revision 1.20  1994/10/06  15:45:36  adam
15086  * bumped MAX_BITMAP_FILES again!
15087  *
15088  * Revision 1.19  1994/10/06  11:01:17  yuan
15089  * Upped MAX_BITMAP_FILES
15090  *
15091  * Revision 1.18  1994/10/06  10:44:45  john
15092  * Added diagnostic message and psuedo run-length-encoder
15093  * to see how much memory we would save by storing bitmaps
15094  * in a RLE method.  Also, I commented out the code that
15095  * stores 4K bitmaps on a 4K boundry to reduce pig size
15096  * a bit.
15097  *
15098  * Revision 1.17  1994/10/04  20:03:13  matt
15099  * Upped maximum number of bitmaps
15100  *
15101  * Revision 1.16  1994/10/03  18:04:20  john
15102  * Fixed bug with data_offset not set right for bitmaps
15103  * that are 64x64 and not aligned on a 4k boundry.
15104  *
15105  * Revision 1.15  1994/09/28  11:30:55  john
15106  * changed inferno.pig to descent.pig, changed the way it
15107  * is read.
15108  *
15109  * Revision 1.14  1994/09/22  16:14:17  john
15110  * Redid intro sequecing.
15111  *
15112  * Revision 1.13  1994/09/19  14:42:47  john
15113  * Locked down sounds with Virtual memory.
15114  *
15115  * Revision 1.12  1994/09/10  17:31:52  mike
15116  * Increase number of loadable bitmaps.
15117  *
15118  * Revision 1.11  1994/09/01  19:32:49  mike
15119  * Boost texture map allocation.
15120  *
15121  * Revision 1.10  1994/08/16  11:51:02  john
15122  * Added grwased pigs.
15123  *
15124  * Revision 1.9  1994/07/06  09:18:03  adam
15125  * upped bitmap #s
15126  *
15127  * Revision 1.8  1994/06/20  22:02:15  matt
15128  * Fixed bug from last change
15129  *
15130  * Revision 1.7  1994/06/20  21:33:18  matt
15131  * Made bm.h not include sounds.h, to reduce dependencies
15132  *
15133  * Revision 1.6  1994/06/20  16:52:19  john
15134  * cleaned up init output a bit.
15135  *
15136  * Revision 1.5  1994/06/08  14:20:57  john
15137  * Made piggy dump before going into game.
15138  *
15139  * Revision 1.4  1994/06/02  18:59:22  matt
15140  * Clear selector field of bitmap loaded from pig file
15141  *
15142  * Revision 1.3  1994/05/06  15:31:41  john
15143  * Made name field a bit longer.
15144  *
15145  * Revision 1.2  1994/05/06  13:02:44  john
15146  * Added piggy stuff; worked on supertransparency
15147  *
15148  * Revision 1.1  1994/05/06  11:47:26  john
15149  * Initial revision
15150
15151 ------------------------------------------------------------------------
15152 main/piggy.h:
15153
15154  * Revision 1.1  1995/05/16  16:01:04  allender
15155  * Initial revision
15156  *
15157  * Revision 2.0  1995/02/27  11:31:21  john
15158  * New version 2.0, which has no anonymous unions, builds with
15159  * Watcom 10.0, and doesn't require parsing BITMAPS.TBL.
15160  *
15161  * Revision 1.10  1995/02/03  17:08:29  john
15162  * Changed sound stuff to allow low memory usage.
15163  * Also, changed so that Sounds isn't an array of digi_sounds, it
15164  * is a ubyte pointing into GameSounds, this way the digi.c code that
15165  * locks sounds won't accidentally unlock a sound that is already playing, but
15166  * since it's Sounds[soundno] is different, it would erroneously be unlocked.
15167  *
15168  * Revision 1.9  1995/01/24  14:33:49  john
15169  * *** empty log message ***
15170  *
15171  * Revision 1.8  1995/01/24  14:32:35  john
15172  * Took out paging in code.
15173  *
15174  * Revision 1.7  1995/01/23  12:30:17  john
15175  * Made debug code that mprintf what bitmap gets paged in.
15176  *
15177  * Revision 1.6  1995/01/17  14:11:37  john
15178  * Added function that is called after level loaded.
15179  *
15180  * Revision 1.5  1995/01/14  19:16:58  john
15181  * First version of new bitmap paging code.
15182  *
15183  * Revision 1.4  1994/10/27  18:51:57  john
15184  * Added -piglet option that only loads needed textures for a
15185  * mine.  Only saved ~1MB, and code still doesn't free textures
15186  * before you load a new mine.
15187  *
15188  * Revision 1.3  1994/06/08  14:20:47  john
15189  * Made piggy dump before going into game.
15190  *
15191  * Revision 1.2  1994/05/06  13:02:40  john
15192  * Added piggy stuff; worked on supertransparency
15193  *
15194  * Revision 1.1  1994/05/06  11:47:46  john
15195  * Initial revision
15196
15197 ------------------------------------------------------------------------
15198 main/player.h:
15199
15200  * Revision 1.1  1995/05/16  16:01:11  allender
15201  * Initial revision
15202  *
15203  * Revision 2.0  1995/02/27  11:30:25  john
15204  * New version 2.0, which has no anonymous unions, builds with
15205  * Watcom 10.0, and doesn't require parsing BITMAPS.TBL.
15206  *
15207  * Revision 1.41  1994/12/20  17:56:43  yuan
15208  * Multiplayer object capability.
15209  *
15210  * Revision 1.40  1994/12/02  15:04:42  matt
15211  * Fixed bogus weapon constants and arrays
15212  *
15213  * Revision 1.39  1994/11/25  22:47:08  matt
15214  * Made saved game descriptions longer
15215  *
15216  * Revision 1.38  1994/11/21  17:29:38  matt
15217  * Cleaned up sequencing & game saving for secret levels
15218  *
15219  * Revision 1.37  1994/11/17  12:57:13  rob
15220  * Changed net_kills_level to net_killed_total.
15221  *
15222  * Revision 1.36  1994/11/14  17:20:33  rob
15223  * Bumped player file version.
15224  *
15225  * Revision 1.35  1994/11/04  19:55:06  rob
15226  * Changed a previously unused pad character to represent whether or not
15227  * the player is connected to a net game (used to be objnum=-1 but we
15228  * want to keep the objnum info in case of re-joins)
15229  *
15230  * Revision 1.34  1994/10/22  14:13:54  mike
15231  * Add homing_object_dist field to player struct.
15232  *
15233  * Revision 1.33  1994/10/22  00:08:45  matt
15234  * Fixed up problems with bonus & game sequencing
15235  * Player doesn't get credit for hostages unless he gets them out alive
15236  *
15237  * Revision 1.32  1994/10/21  20:43:03  mike
15238  * Add hostages_on_board to player struct.
15239  *
15240  * Revision 1.31  1994/10/19  20:00:00  john
15241  * Added bonus points at the end of level based on skill level.
15242  *
15243  * Revision 1.30  1994/10/19  15:14:24  john
15244  * Took % hits out of player structure, made %kills work properly.
15245  *
15246  * Revision 1.29  1994/10/19  12:12:27  john
15247  * Added hour variable.
15248  *
15249  * Revision 1.28  1994/10/17  17:24:48  john
15250  * Added starting_level to player struct.
15251  *
15252  * Revision 1.27  1994/10/13  15:42:02  mike
15253  * Remove afterburner.
15254  *
15255  * Revision 1.26  1994/10/10  17:00:23  mike
15256  * Lower number of players from 10 to 8.
15257  *
15258  * Revision 1.25  1994/10/09  14:53:26  matt
15259  * Made player cockpit state & window size save/restore with saved games & automap
15260  *
15261  * Revision 1.24  1994/10/08  20:24:10  matt
15262  * Added difficulty level to player structure for game load/save
15263  *
15264  * Revision 1.23  1994/10/05  17:39:53  rob
15265  * Changed killer_objnum to a short (was char)
15266  *
15267  * Revision 1.22  1994/10/03  22:59:07  matt
15268  * Limit callsign to 8 chars long, so we can use it as filename
15269  *
15270  * Revision 1.21  1994/09/23  10:14:30  mike
15271  * Rename PLAYER_FLAGS_INVINCIBLE to PLAYER_FLAGS_INVULNERABLE.
15272  * Add INVULNERABLE_TIME_MAX = 30 seconds.
15273  *
15274  * Revision 1.20  1994/09/21  20:44:22  matt
15275  * Player explosion fireball now specified in bitmaps.tbl
15276  *
15277  * Revision 1.19  1994/09/21  12:27:37  mike
15278  * Move CLOAK_TIME_MAX here from game.c
15279  *
15280  * Revision 1.18  1994/09/16  13:10:16  mike
15281  * Add afterburner and cloak stuff.
15282  *
15283  * Revision 1.17  1994/09/11  20:30:26  matt
15284  * Cleaned up thrust vars, changing a few names
15285  *
15286  * Revision 1.16  1994/09/09  14:22:45  matt
15287  * Added extra gun for player
15288  *
15289  * Revision 1.15  1994/09/07  13:30:11  john
15290  * Added code to tell how many packets were lost.
15291  *
15292  * Revision 1.14  1994/09/02  11:56:33  mike
15293  * Alignment on the player struct.
15294  *
15295  * Revision 1.13  1994/08/25  18:12:05  matt
15296  * Made player's weapons and flares fire from the positions on the 3d model.
15297  * Also added support for quad lasers.
15298  *
15299  * Revision 1.12  1994/08/22  15:49:40  mike
15300  * change spelling on num_missles -> num_missiles.
15301  *
15302  * Revision 1.11  1994/08/18  10:47:32  john
15303  * Cleaned up game sequencing and player death stuff
15304  * in preparation for making the player explode into
15305  * pieces when dead.
15306  *
15307  * Revision 1.10  1994/08/17  16:50:05  john
15308  * Added damaging fireballs, missiles.
15309  *
15310  * Revision 1.9  1994/08/15  00:24:10  john
15311  * First version of netgame with players killing
15312  * each other. still buggy...
15313  *
15314  * Revision 1.8  1994/08/12  22:41:26  john
15315  * Took away Player_stats; add Players array.
15316  *
15317  * Revision 1.7  1994/08/09  17:53:25  adam
15318  * *** empty log message ***
15319  *
15320  * Revision 1.6  1994/07/13  00:15:05  matt
15321  * Moved all (or nearly all) of the values that affect player movement to
15322  * bitmaps.tbl
15323  *
15324  * Revision 1.5  1994/07/08  21:44:17  matt
15325  * Made laser powerups saturate correctly
15326  *
15327  * Revision 1.4  1994/07/07  14:59:02  john
15328  * Made radar powerups.
15329  *
15330  *
15331  * Revision 1.3  1994/07/02  13:49:39  matt
15332  * Cleaned up includes
15333  *
15334  * Revision 1.2  1994/07/02  13:10:03  matt
15335  * Moved player stats struct from gameseq.h to player.h
15336  *
15337  * Revision 1.1  1994/07/02  11:00:43  matt
15338  * Initial revision
15339
15340 ------------------------------------------------------------------------
15341 main/playsave.c:
15342
15343  * Revision 1.1  1995/12/05  16:05:47  allender
15344  * Initial revision
15345  *
15346  * Revision 1.10  1995/11/03  12:53:24  allender
15347  * shareware changes
15348  *
15349  * Revision 1.9  1995/10/31  10:19:12  allender
15350  * shareware stuff
15351  *
15352  * Revision 1.8  1995/10/23  14:50:11  allender
15353  * set control type for new player *before* calling kc_set_controls
15354  *
15355  * Revision 1.7  1995/10/21  22:25:31  allender
15356  * *** empty log message ***
15357  *
15358  * Revision 1.6  1995/10/17  15:57:42  allender
15359  * removed line setting wrong COnfig_control_type
15360  *
15361  * Revision 1.5  1995/10/17  13:16:44  allender
15362  * new controller support
15363  *
15364  * Revision 1.4  1995/08/24  16:03:38  allender
15365  * call joystick code when player file uses joystick
15366  *
15367  * Revision 1.3  1995/08/03  15:15:39  allender
15368  * got player save file working (more to go for shareware)
15369  *
15370  * Revision 1.2  1995/08/01  13:57:20  allender
15371  * macified the player file stuff -- in a seperate folder
15372  *
15373  * Revision 1.1  1995/05/16  15:30:00  allender
15374  * Initial revision
15375  *
15376  * Revision 2.3  1995/05/26  16:16:23  john
15377  * Split SATURN into define's for requiring cd, using cd, etc.
15378  * Also started adding all the Rockwell stuff.
15379  *
15380  * Revision 2.2  1995/03/24  17:48:21  john
15381  * Made player files from saturn excrement the highest level for
15382  * normal descent levels.
15383  *
15384  * Revision 2.1  1995/03/21  14:38:49  john
15385  * Ifdef'd out the NETWORK code.
15386  *
15387  * Revision 2.0  1995/02/27  11:27:59  john
15388  * New version 2.0, which has no anonymous unions, builds with
15389  * Watcom 10.0, and doesn't require parsing BITMAPS.TBL.
15390  *
15391  * Revision 1.57  1995/02/13  20:34:55  john
15392  * Lintized
15393  *
15394  * Revision 1.56  1995/02/13  13:23:24  john
15395  * Fixed bug with new player joystick selection.
15396  *
15397  * Revision 1.55  1995/02/13  12:01:19  john
15398  * Fixed bug with joystick throttle still asking for
15399  * calibration with new pilots.
15400  *
15401  * Revision 1.54  1995/02/13  10:29:12  john
15402  * Fixed bug with creating new player not resetting everything to default.
15403  *
15404  * Revision 1.53  1995/02/03  10:58:46  john
15405  * Added code to save shareware style saved games into new format...
15406  * Also, made new player file format not have the saved game array in it.
15407  *
15408  * Revision 1.52  1995/02/02  21:09:28  matt
15409  * Let player start of level 8 if he made it to level 7 in the shareware
15410  *
15411  * Revision 1.51  1995/02/02  18:50:14  john
15412  * Added warning for FCS when new pilot chooses.
15413  *
15414  * Revision 1.50  1995/02/02  11:21:34  john
15415  * Made joystick calibrate when new user selects.
15416  *
15417  * Revision 1.49  1995/02/01  18:06:38  rob
15418  * Put defaults macros into descent.tex
15419  *
15420  * Revision 1.48  1995/01/25  14:37:53  john
15421  * Made joystick only prompt for calibration once...
15422  *
15423  * Revision 1.47  1995/01/24  19:37:12  matt
15424  * Took out incorrect mprintf
15425  *
15426  * Revision 1.46  1995/01/22  18:57:22  matt
15427  * Made player highest level work with missions
15428  *
15429  * Revision 1.45  1995/01/21  16:36:05  matt
15430  * Made starting level system work for now, pending integration with
15431  * mission code.
15432  *
15433  * Revision 1.44  1995/01/20  22:47:32  matt
15434  * Mission system implemented, though imcompletely
15435  *
15436  * Revision 1.43  1995/01/04  14:58:39  rob
15437  * Fixed for shareware build.
15438  *
15439  * Revision 1.42  1995/01/04  11:36:43  rob
15440  * Added compatibility with older shareware pilot files.
15441  *
15442  * Revision 1.41  1995/01/03  11:01:58  rob
15443  * fixed a default macro.
15444  *
15445  * Revision 1.40  1995/01/03  10:44:06  rob
15446  * Added default taunt macros.
15447  *
15448  * Revision 1.39  1994/12/13  10:01:16  allender
15449  * pop up message box when unable to correctly save player file
15450  *
15451  * Revision 1.38  1994/12/12  11:37:14  matt
15452  * Fixed auto leveling defaults & saving
15453  *
15454  * Revision 1.37  1994/12/12  00:26:59  matt
15455  * Added support for no-levelling option
15456  *
15457  * Revision 1.36  1994/12/10  19:09:54  matt
15458  * Added assert for valid player number when loading game
15459  *
15460  * Revision 1.35  1994/12/08  10:53:07  rob
15461  * Fixed a bug in highest_level tracking.
15462  *
15463  * Revision 1.34  1994/12/08  10:01:36  john
15464  * Changed the way the player callsign stuff works.
15465  *
15466  * Revision 1.33  1994/12/07  18:30:38  rob
15467  * Load highest level along with player (used to be only if higher)
15468  * Capped at LAST_LEVEL in case a person loads a registered player in shareware.
15469  *
15470  * Revision 1.32  1994/12/03  16:01:12  matt
15471  * When player file has bad version, force player to choose another
15472  *
15473  * Revision 1.31  1994/12/02  19:54:00  yuan
15474  * Localization.
15475  *
15476  * Revision 1.30  1994/12/02  11:01:36  yuan
15477  * Localization.
15478  *
15479  * Revision 1.29  1994/11/29  03:46:28  john
15480  * Added joystick sensitivity; Added sound channels to detail menu.  Removed -maxchannels
15481  * command line arg.
15482  *
15483  * Revision 1.28  1994/11/29  01:10:23  john
15484  * Took out code that allowed new players to
15485  * configure keyboard.
15486  *
15487  * Revision 1.27  1994/11/25  22:47:10  matt
15488  * Made saved game descriptions longer
15489  *
15490  * Revision 1.26  1994/11/22  12:10:42  rob
15491  * Fixed file handle left open if player file versions don't
15492  * match.
15493  *
15494  * Revision 1.25  1994/11/21  19:35:30  john
15495  * Replaced calls to joy_init with if (joy_present)
15496  *
15497  * Revision 1.24  1994/11/21  17:29:34  matt
15498  * Cleaned up sequencing & game saving for secret levels
15499  *
15500  * Revision 1.23  1994/11/21  11:10:01  john
15501  * Fixed bug with read-only .plr file making the config file
15502  * not update.
15503  *
15504  * Revision 1.22  1994/11/20  19:03:08  john
15505  * Fixed bug with if not having a joystick, default
15506  * player input device is cyberman.
15507  *
15508  * Revision 1.21  1994/11/17  12:24:07  matt
15509  * Made an array the right size, to fix error loading games
15510  *
15511  * Revision 1.20  1994/11/14  17:52:54  allender
15512  * add call to WriteConfigFile when player files gets written
15513  *
15514  * Revision 1.19  1994/11/14  17:19:23  rob
15515  * Removed gamma, joystick calibration, and sound settings from player file.
15516  * Added default difficulty and multi macros.
15517  *
15518  * Revision 1.18  1994/11/07  14:01:23  john
15519  * Changed the gamma correction sequencing.
15520  *
15521  * Revision 1.17  1994/11/05  17:22:49  john
15522  * Fixed lots of sequencing problems with newdemo stuff.
15523  *
15524  * Revision 1.16  1994/11/01  16:40:11  john
15525  * Added Gamma correction.
15526  *
15527  * Revision 1.15  1994/10/24  19:56:50  john
15528  * Made the new user setup prompt for config options.
15529  *
15530  * Revision 1.14  1994/10/24  17:44:21  john
15531  * Added stereo channel reversing.
15532  *
15533  * Revision 1.13  1994/10/24  16:05:12  matt
15534  * Improved handling of player names that are the names of DOS devices
15535  *
15536  * Revision 1.12  1994/10/22  00:08:51  matt
15537  * Fixed up problems with bonus & game sequencing
15538  * Player doesn't get credit for hostages unless he gets them out alive
15539  *
15540  * Revision 1.11  1994/10/19  19:59:57  john
15541  * Added bonus points at the end of level based on skill level.
15542  *
15543  * Revision 1.10  1994/10/19  15:14:34  john
15544  * Took % hits out of player structure, made %kills work properly.
15545  *
15546  * Revision 1.9  1994/10/19  12:44:26  john
15547  * Added hours field to player structure.
15548  *
15549  * Revision 1.8  1994/10/17  17:24:34  john
15550  * Added starting_level to player struct.
15551  *
15552  * Revision 1.7  1994/10/17  13:07:15  john
15553  * Moved the descent.cfg info into the player config file.
15554  *
15555  * Revision 1.6  1994/10/09  14:54:31  matt
15556  * Made player cockpit state & window size save/restore with saved games & automap
15557  *
15558  * Revision 1.5  1994/10/08  23:08:09  matt
15559  * Added error check & handling for game load/save disk io
15560  *
15561  * Revision 1.4  1994/10/05  17:40:54  rob
15562  * Bumped save_file_version to 5 due to change in player.h
15563  *
15564  * Revision 1.3  1994/10/03  23:00:54  matt
15565  * New file version for shorter callsigns
15566  *
15567  * Revision 1.2  1994/09/28  17:25:05  matt
15568  * Added first draft of game save/load system
15569  *
15570  * Revision 1.1  1994/09/27  14:39:12  matt
15571  * Initial revision
15572
15573 ------------------------------------------------------------------------
15574 main/playsave.h:
15575
15576  * Revision 1.1  1995/05/16  16:01:19  allender
15577  * Initial revision
15578  *
15579  * Revision 2.0  1995/02/27  11:31:24  john
15580  * New version 2.0, which has no anonymous unions, builds with
15581  * Watcom 10.0, and doesn't require parsing BITMAPS.TBL.
15582  *
15583  * Revision 1.10  1995/01/22  18:57:04  matt
15584  * Made player highest level work with missions
15585  *
15586  * Revision 1.9  1994/12/12  11:37:15  matt
15587  * Fixed auto leveling defaults & saving
15588  *
15589  * Revision 1.8  1994/12/08  10:01:37  john
15590  * Changed the way the player callsign stuff works.
15591  *
15592  * Revision 1.7  1994/11/25  22:46:56  matt
15593  * Made saved game descriptions longer
15594  *
15595  * Revision 1.6  1994/10/24  20:00:02  john
15596  * Added prototype for read_player_file.
15597  *
15598  * Revision 1.5  1994/10/17  13:07:12  john
15599  * Moved the descent.cfg info into the player config file.
15600  *
15601  * Revision 1.4  1994/10/09  14:54:32  matt
15602  * Made player cockpit state & window size save/restore with saved games & automap
15603  *
15604  * Revision 1.3  1994/10/08  23:08:09  matt
15605  * Added error check & handling for game load/save disk io
15606  *
15607  * Revision 1.2  1994/09/28  17:25:06  matt
15608  * Added first draft of game save/load system
15609  *
15610  * Revision 1.1  1994/09/27  15:47:23  matt
15611  * Initial revision
15612
15613 ------------------------------------------------------------------------
15614 main/polyobj.c:
15615
15616  * Revision 1.3  1995/10/25  14:07:07  allender
15617  * removed load_poly_model function
15618  *
15619  * Revision 1.2  1995/09/14  14:10:20  allender
15620  * two funtions should be void
15621  *
15622  * Revision 1.1  1995/05/16  15:30:08  allender
15623  * Initial revision
15624  *
15625  * Revision 2.1  1995/05/26  16:10:37  john
15626  * Support for new 4-byte align v8 pof files.
15627  *
15628  * Revision 2.0  1995/02/27  11:32:44  john
15629  * New version 2.0, which has no anonymous unions, builds with
15630  * Watcom 10.0, and doesn't require parsing BITMAPS.TBL.
15631  *
15632  * Revision 1.64  1995/01/14  19:16:43  john
15633  * First version of new bitmap paging code.
15634  *
15635  * Revision 1.63  1994/12/14  18:06:54  matt
15636  * Removed compile warnings
15637  *
15638  * Revision 1.62  1994/12/09  17:54:31  john
15639  * Made the CFILE's close right after reading in data.
15640  *
15641  * Revision 1.61  1994/12/09  16:13:28  mike
15642  * speedup pof file reading, but still horribly slow using hog file...problem somewhere else.
15643  *
15644  * Revision 1.60  1994/12/08  17:41:20  yuan
15645  * Cfiling stuff.
15646  *
15647  * Revision 1.59  1994/11/21  11:02:19  matt
15648  * Added error checking
15649  *
15650  * Revision 1.58  1994/11/14  11:32:49  matt
15651  * Allow switching to simpler models even when alt_textures specified
15652  *
15653  * Revision 1.57  1994/11/13  21:15:24  matt
15654  * Added basic support for more than one level of detail simplification
15655  *
15656  * Revision 1.56  1994/11/11  19:29:25  matt
15657  * Added code to show low detail polygon models
15658  *
15659  * Revision 1.55  1994/11/10  14:02:57  matt
15660  * Hacked in support for player ships with different textures
15661  *
15662  * Revision 1.54  1994/11/03  11:01:59  matt
15663  * Made robot pics lighted
15664  *
15665  * Revision 1.53  1994/11/02  16:18:34  matt
15666  * Moved draw_model_picture() out of editor
15667  *
15668  * Revision 1.52  1994/10/18  14:38:11  matt
15669  * Restored assert now that bug is fixed
15670  *
15671  * Revision 1.51  1994/10/17  21:35:03  matt
15672  * Added support for new Control Center/Main Reactor
15673  *
15674  * Revision 1.50  1994/10/14  17:46:23  yuan
15675  * Made the soft Int3 only work in net mode.
15676  *
15677  * Revision 1.49  1994/10/14  17:43:47  yuan
15678  * Added soft int3's instead of Asserts  for some common network bugs.
15679  *
15680  * Revision 1.48  1994/10/14  17:09:04  yuan
15681  * Made Assert on line 610 be if in an attempt
15682  * to bypass.
15683  *
15684  * Revision 1.47  1994/09/09  14:23:42  matt
15685  * Added glow code to polygon models for engine glow
15686  *
15687  * Revision 1.46  1994/08/26  18:03:30  matt
15688  * Added code to remap polygon model numbers by matching filenames
15689  *
15690  * Revision 1.45  1994/08/26  15:35:58  matt
15691  * Made eclips usable on more than one object at a time
15692  *
15693  * Revision 1.44  1994/08/25  18:11:58  matt
15694  * Made player's weapons and flares fire from the positions on the 3d model.
15695  * Also added support for quad lasers.
15696  *
15697  * Revision 1.43  1994/07/25  00:14:18  matt
15698  * Made a couple of minor changes for the drivethrough
15699  *
15700  * Revision 1.42  1994/07/25  00:02:41  matt
15701  * Various changes to accomodate new 3d, which no longer takes point numbers
15702  * as parms, and now only takes pointers to points.
15703
15704 ------------------------------------------------------------------------
15705 main/polyobj.h:
15706
15707  * Revision 1.2  1995/09/14  14:10:30  allender
15708  * two functions should be void
15709  *
15710  * Revision 1.1  1995/05/16  16:01:27  allender
15711  * Initial revision
15712  *
15713  * Revision 2.1  1995/02/27  18:21:54  john
15714  * Added extern for robot_points.
15715  *
15716  * Revision 2.0  1995/02/27  11:29:58  john
15717  * New version 2.0, which has no anonymous unions, builds with
15718  * Watcom 10.0, and doesn't require parsing BITMAPS.TBL.
15719  *
15720  * Revision 1.28  1995/01/12  12:10:16  adam
15721  * *** empty log message ***
15722  *
15723  * Revision 1.27  1994/11/11  19:28:58  matt
15724  * Added code to show low detail polygon models
15725  *
15726  * Revision 1.26  1994/11/10  14:03:05  matt
15727  * Hacked in support for player ships with different textures
15728  *
15729  * Revision 1.25  1994/11/02  16:18:24  matt
15730  * Moved draw_model_picture() out of editor
15731  *
15732  * Revision 1.24  1994/10/18  10:55:57  adam
15733  * bumped MAX_POLYGON_OBJECTS up
15734  *
15735  * Revision 1.23  1994/10/17  21:35:01  matt
15736  * Added support for new Control Center/Main Reactor
15737  *
15738  * Revision 1.22  1994/09/09  14:23:42  matt
15739  * Added glow code to polygon models for engine glow
15740  *
15741  * Revision 1.21  1994/08/26  18:03:43  matt
15742  * Added code to remap polygon model numbers by matching filenames
15743  *
15744  * Revision 1.20  1994/08/26  15:36:00  matt
15745  * Made eclips usable on more than one object at a time
15746  *
15747  * Revision 1.19  1994/07/22  20:44:23  matt
15748  * Killed unused fields in polygon model structure
15749  *
15750  * Revision 1.18  1994/06/16  17:52:11  matt
15751  * Made submodels rotate around their centers, not their pivot points
15752  *
15753  * Revision 1.17  1994/06/14  12:22:05  matt
15754  * Integrated with drive code, using #defines to switch versions
15755  *
15756  * Revision 1.16  1994/06/09  16:25:01  matt
15757  * Fixed confusion with two constants, MAX_SUBOBJS & MAX_SUBMODELS, which
15758  * were used for the same things, but had different values.
15759  *
15760  * Revision 1.15  1994/06/08  10:56:38  matt
15761  * Improved debris: now get submodel size from new POF files; debris now has
15762  * limited life; debris can now be blown up.
15763  *
15764  * Revision 1.14  1994/06/07  16:51:57  matt
15765  * Made object lighting work correctly; changed name of Ambient_light to
15766  * Dynamic_light; cleaned up polygobj object rendering a little.
15767  *
15768  * Revision 1.13  1994/05/26  21:08:59  matt
15769  * Moved robot stuff out of polygon model and into robot_info struct
15770  * Made new file, robot.c, to deal with robots
15771  *
15772  * Revision 1.12  1994/05/18  19:35:05  matt
15773  * Added fields for the rest of the subobj data
15774  *
15775  * Revision 1.11  1994/05/16  16:17:13  john
15776  * Bunch of stuff on my Inferno Task list May16-23
15777  *
15778  * Revision 1.10  1994/05/13  11:08:31  matt
15779  * Added support for multiple gun positions on polygon models
15780  *
15781  * Revision 1.9  1994/04/29  09:18:04  matt
15782  * Added support for multiple-piece explosions
15783  *
15784  * Revision 1.8  1994/04/28  18:44:18  matt
15785  * Took out code for old-style (non-interpreted) objects.
15786  *
15787  * Revision 1.7  1994/03/25  16:54:38  matt
15788  * draw_polygon_object() now takes pointer to animation data
15789  *
15790  * Revision 1.6  1994/03/15  17:44:33  matt
15791  * Changed a bunch of names
15792  *
15793  * Revision 1.5  1994/03/07  20:02:29  matt
15794  * Added pointer to normals in polyobj struct
15795  * Added prototype for draw_polygon_object()
15796  *
15797  * Revision 1.4  1994/03/01  17:16:19  matt
15798  * Lots of changes to support loadable binary ".pof" robot files
15799  *
15800  * Revision 1.3  1994/01/31  15:51:20  matt
15801  * Added ptr for rgb table for robot colors
15802  *
15803  * Revision 1.2  1994/01/28  13:52:01  matt
15804  * Added flesh to this previously skeletal file.
15805  *
15806  * Revision 1.1  1994/01/28  13:47:42  matt
15807  * Initial revision
15808
15809 ------------------------------------------------------------------------
15810 main/powerup.c:
15811
15812  * Revision 1.2  1995/10/31  10:18:55  allender
15813  * shareware stuff
15814  *
15815  * Revision 1.1  1995/05/16  15:30:16  allender
15816  * Initial revision
15817  *
15818  * Revision 2.2  1995/03/24  13:50:36  john
15819  * Added mega-wowie zowie to release.
15820  *
15821  * Revision 2.1  1995/03/21  14:38:39  john
15822  * Ifdef'd out the NETWORK code.
15823  *
15824  * Revision 2.0  1995/02/27  11:27:15  john
15825  * New version 2.0, which has no anonymous unions, builds with
15826  * Watcom 10.0, and doesn't require parsing BITMAPS.TBL.
15827  *
15828  * Revision 1.94  1995/02/22  13:46:03  allender
15829  * remove anonymous unions from object structure
15830  *
15831  * Revision 1.93  1995/02/06  15:52:51  mike
15832  * add mini megawow powerup for giving reasonable weapons.
15833  *
15834  * Revision 1.92  1995/01/23  22:49:59  mike
15835  * drop energy instead of primary weapon if you have primary weapon
15836  * (drop nothing if want to drop vulcan ammo and you are maxed out)
15837  * if you have primary weapon and primary weapon there, get energy instead.
15838  *
15839  * Revision 1.91  1995/01/19  09:42:22  allender
15840  * record laser levels for demos
15841  *
15842  * Revision 1.90  1994/12/31  12:28:01  rob
15843  * Added sound for coop key grabs.
15844  *
15845  * Revision 1.89  1994/12/19  19:55:17  rob
15846  * Fixing key semantics for coop game.
15847  *
15848  * Revision 1.88  1994/12/07  12:55:21  mike
15849  * tweak vulcan amounts.
15850  *
15851  * Revision 1.87  1994/12/06  13:55:36  matt
15852  * Made shield & energy powerup messages round to match HUD message
15853  *
15854  * Revision 1.86  1994/12/03  19:03:57  matt
15855  * Fixed vulcan ammo HUD message
15856  *
15857  * Revision 1.85  1994/11/29  11:35:41  rob
15858  * Added sound casting for grabbing powerups.
15859  *
15860  * Revision 1.84  1994/11/28  11:26:38  matt
15861  * Cleaned up hud message printing for picking up weapons
15862  *
15863  * Revision 1.83  1994/11/27  23:14:01  matt
15864  * Made changes for new mprintf calling convention
15865  *
15866  * Revision 1.82  1994/11/21  16:02:51  mike
15867  * comment out unused powerups.
15868  *
15869  * Revision 1.81  1994/11/20  18:25:47  john
15870  * Fixed some #ifndef RELEASE inconsistancies.
15871  *
15872  * Revision 1.80  1994/11/19  23:54:13  mike
15873  * limit megawowiezowie to shareware powerups if in shareware version.
15874  *
15875  * Revision 1.79  1994/11/14  16:06:16  yuan
15876  * Made cloak and invulnerability only picked up once.
15877  *
15878  * Revision 1.78  1994/11/07  17:41:06  mike
15879  * messages for when you're fully stocked with missiles.
15880  *
15881  * Revision 1.77  1994/10/28  14:42:50  john
15882  * Added sound volumes to all sound calls.
15883  *
15884  * Revision 1.76  1994/10/26  15:55:23  yuan
15885  * Made vulcan cannon give 100 ammo if it has less than that.
15886  *
15887  * Revision 1.75  1994/10/26  15:54:57  yuan
15888  * *** empty log message ***
15889  *
15890  * Revision 1.74  1994/10/25  14:31:25  allender
15891  * Fixed bug where getting cloak powerup while cloaked resulted in
15892  * player being cloaked forever.
15893  *
15894  * Revision 1.73  1994/10/25  10:51:21  matt
15895  * Vulcan cannon powerups now contain ammo count
15896  *
15897  * Revision 1.72  1994/10/21  20:41:32  mike
15898  * Fix silly backwards (- instead of +) bug in invulnerability powerup.
15899  *
15900  * Revision 1.71  1994/10/20  09:49:23  mike
15901  * Fix up powerups in some way.
15902  *
15903  * Revision 1.70  1994/10/19  11:16:25  mike
15904  * Limit amount of each type of ammo player can hold.
15905  *
15906  * Revision 1.69  1994/10/17  14:12:11  matt
15907  * Added sound for powerup disappearance effect
15908  *
15909  * Revision 1.68  1994/10/17  14:07:04  mike
15910  * Make shields and energy max out at 200.
15911  *
15912  * Revision 1.67  1994/10/16  12:43:37  mike
15913  * Don't allow you to pick up a primary weapon, or invulnerability, you already have.
15914  * Make cloak time additive.
15915  *
15916  * Revision 1.66  1994/10/15  19:05:30  mike
15917  * Define constants for vulcan ammo amounts.
15918  *
15919  * Revision 1.65  1994/10/14  15:57:28  mike
15920  * When you pick up a laser boost or quad_laser powerup, update weapon display.
15921  *
15922  * Revision 1.64  1994/10/13  10:57:51  adam
15923  * fiddled with powerup disappearance
15924  *
15925  * Revision 1.63  1994/10/12  13:07:33  mike
15926  * Make powerup play vclip when it goes away.
15927  *
15928  * Revision 1.62  1994/10/12  08:04:42  mike
15929  * Make proximity powerup worth 4 bombs.
15930  *
15931  * Revision 1.61  1994/10/08  23:37:33  matt
15932  * Don't pick up weapons you already have; also fixed auto_select bug
15933  * for seconary weapons
15934  *
15935  * Revision 1.60  1994/10/08  15:41:00  mike
15936  * Diminish palette effect due to powerups.
15937  *
15938  * Revision 1.59  1994/10/07  23:37:45  matt
15939  * Made weapons select when pick up better one
15940  *
15941  * Revision 1.58  1994/10/07  22:09:20  rob
15942  * Added network hook for grabbing the cloaking device.
15943
15944 ------------------------------------------------------------------------
15945 main/powerup.h:
15946
15947  * Revision 1.1  1995/05/16  16:01:35  allender
15948  * Initial revision
15949  *
15950  * Revision 2.0  1995/02/27  11:27:35  john
15951  * New version 2.0, which has no anonymous unions, builds with
15952  * Watcom 10.0, and doesn't require parsing BITMAPS.TBL.
15953  *
15954  * Revision 1.34  1995/02/06  15:52:37  mike
15955  * add mini megawow powerup for giving reasonable weapons.
15956  *
15957  * Revision 1.33  1995/01/30  17:14:11  mike
15958  * halve rate of vulcan ammo consumption.
15959  *
15960  * Revision 1.32  1995/01/15  20:47:56  mike
15961  * add lighting field to powerups.
15962  *
15963  * Revision 1.31  1994/12/12  21:39:58  matt
15964  * Changed vulcan ammo: 10K max, 5K w/weapon, 1250 per powerup
15965  *
15966  * Revision 1.30  1994/12/07  12:55:26  mike
15967  * tweak vulcan amounts.
15968  *
15969  * Revision 1.29  1994/12/02  20:06:46  matt
15970  * Made vulcan ammo print at approx 25 times actual
15971  *
15972  * Revision 1.28  1994/10/26  15:56:27  yuan
15973  * Made vulcan cannon give 100 ammo if it has less than that.
15974  *
15975  * Revision 1.27  1994/10/15  19:07:10  mike
15976  * Define constants for amount of vulcan ammo per powerup.
15977  *
15978  * Revision 1.26  1994/09/26  13:29:38  matt
15979  * Added extra life each 100,000 points, and show icons on HUD for num lives
15980  *
15981  * Revision 1.25  1994/09/22  19:00:25  mike
15982  * Kill constants ENERGY_BOOST and SHIELD_BOOST: it's now difficulty level dependent.
15983  *
15984  * Revision 1.24  1994/09/20  19:46:11  mike
15985  * Fix powerup number assignments.
15986  *
15987  * Revision 1.23  1994/09/02  11:53:34  mike
15988  * Add the megawow powerup.  If you don't know about it, that's because it's a secret.
15989  *
15990  * Revision 1.22  1994/09/01  10:41:35  matt
15991  * Sizes for powerups now specified in bitmaps.tbl; blob bitmaps now plot
15992  * correctly if width & height of bitmap are different.
15993  *
15994  * Revision 1.21  1994/08/31  19:26:14  mike
15995  * Start adding new pile of powerups.
15996  *
15997  * Revision 1.20  1994/08/25  17:56:08  matt
15998  * Added quad laser powerup
15999  *
16000  * Revision 1.19  1994/08/18  15:11:50  mike
16001  * missile powerups.
16002  *
16003  * Revision 1.18  1994/08/09  17:54:33  adam
16004  * upped no. of powerup types
16005  *
16006  * Revision 1.17  1994/08/09  17:53:39  adam
16007  * *** empty log message ***
16008  *
16009  * Revision 1.16  1994/07/27  19:44:16  mike
16010  * Objects containing objects.
16011  *
16012  * Revision 1.15  1994/07/26  18:31:32  mike
16013  * Move some constants here from eobject.c.
16014  *
16015  * Revision 1.14  1994/07/20  17:35:03  yuan
16016  * Some minor bug fixes and new key gauges...
16017  *
16018  * Revision 1.13  1994/07/12  15:53:23  john
16019  * *** empty log message ***
16020  *
16021  * Revision 1.12  1994/07/12  15:30:47  mike
16022  * Prototype diminish_towards_max.
16023  *
16024  * Revision 1.11  1994/07/07  14:59:04  john
16025  * Made radar powerups.
16026  *
16027  *
16028  * Revision 1.10  1994/07/01  16:35:40  yuan
16029  * Added key system
16030  *
16031  * Revision 1.9  1994/06/29  19:43:33  matt
16032  * Made powerup animation not happen in render routine
16033  *
16034  * Revision 1.8  1994/06/21  18:54:03  matt
16035  * Added support for powerups that don't get picked up if not needed, but this
16036  * feature is commented out at the end of do_powerup(), since the physics gave
16037  * me all sorts of problems, with the player getting stuck on a powerup.
16038  *
16039  * Revision 1.7  1994/06/08  18:16:32  john
16040  * Bunch of new stuff that basically takes constants out of the code
16041  * and puts them into bitmaps.tbl.
16042  *
16043  * Revision 1.6  1994/05/18  13:26:30  yuan
16044  * *** empty log message ***
16045  *
16046  * Revision 1.5  1994/05/17  17:01:48  yuan
16047  * Added constant for boosts.
16048  *
16049  * Revision 1.4  1994/04/06  14:42:50  yuan
16050  * Adding new powerups.
16051  *
16052  * Revision 1.3  1994/04/01  14:36:59  yuan
16053  * John's head is an extra life...
16054  *
16055  * Revision 1.2  1994/04/01  11:15:22  yuan
16056  * Added multiple bitmap functionality to all objects...
16057  * (hostages, powerups, lasers, etc.)
16058  * Hostages and powerups are implemented in the object system,
16059  * just need to finish function call to "affect" player.
16060  *
16061  * Revision 1.1  1994/03/31  17:01:43  yuan
16062  * Initial revision
16063
16064 ------------------------------------------------------------------------
16065 main/render.c:
16066
16067  * Revision 1.9  1995/11/20  17:17:48  allender
16068  * *** empty log message ***
16069  *
16070  * Revision 1.8  1995/10/26  14:08:35  allender
16071  * added assigment for physics optimization
16072  *
16073  * Revision 1.7  1995/09/22  14:28:46  allender
16074  * changed render_zoom to make game match PC aspect
16075  *
16076  * Revision 1.6  1995/08/14  14:35:54  allender
16077  * change transparency to 0
16078  *
16079  * Revision 1.5  1995/08/12  11:32:02  allender
16080  * removed #ifdef NEWDEMO -- always in
16081  *
16082  * Revision 1.4  1995/07/05  16:48:31  allender
16083  * kitchen stuff
16084  *
16085  * Revision 1.3  1995/06/23  10:22:54  allender
16086  * fix outline mode
16087  *
16088  * Revision 1.2  1995/06/16  16:11:18  allender
16089  * changed sort func to accept const parameters
16090  *
16091  * Revision 1.1  1995/05/16  15:30:24  allender
16092  * Initial revision
16093  *
16094  * Revision 2.5  1995/12/19  15:31:36  john
16095  * Made stereo mode only record 1 eye in demo.
16096  *
16097  * Revision 2.4  1995/03/20  18:15:53  john
16098  * Added code to not store the normals in the segment structure.
16099  *
16100  * Revision 2.3  1995/03/13  16:11:05  john
16101  * Maybe fixed bug that lighting didn't work with vr helmets.
16102  *
16103  * Revision 2.2  1995/03/09  15:33:49  john
16104  * Fixed bug with iglasses timeout too long, and objects
16105  * disappearing from left eye.
16106  *
16107  * Revision 2.1  1995/03/06  15:23:59  john
16108  * New screen techniques.
16109  *
16110  * Revision 2.0  1995/02/27  11:31:01  john
16111  * New version 2.0, which has no anonymous unions, builds with
16112  * Watcom 10.0, and doesn't require parsing BITMAPS.TBL.
16113  *
16114  * Revision 1.252  1995/02/22  13:49:38  allender
16115  * remove anonymous unions from object structure
16116  *
16117  * Revision 1.251  1995/02/11  15:07:26  matt
16118  * Took out code which was mostly intended as part of a larger renderer
16119  * change which never happened.  This new code was causing problems with
16120  * the level 4 control center.
16121  *
16122  * Revision 1.250  1995/02/07  16:28:53  matt
16123  * Fixed problem with new code
16124  *
16125  * Revision 1.249  1995/02/06  14:38:58  matt
16126  * Took out some code that didn't compile when editor in
16127  *
16128  * Revision 1.248  1995/02/06  13:45:25  matt
16129  * Structural changes, plus small sorting improvements
16130  *
16131  * Revision 1.247  1995/02/02  15:59:26  matt
16132  * Changed assert to int3.
16133  *
16134  * Revision 1.246  1995/02/01  21:02:27  matt
16135  * Added partial fix for rendering bugs
16136  * Ripped out laser hack system
16137  *
16138  * Revision 1.245  1995/01/20  15:14:30  matt
16139  * Added parens to fix precedence bug
16140  *
16141  * Revision 1.244  1995/01/14  19:16:59  john
16142  * First version of new bitmap paging code.
16143  *
16144  * Revision 1.243  1995/01/03  20:19:25  john
16145  * Pretty good working version of game save.
16146  *
16147  * Revision 1.242  1994/12/29  13:51:05  john
16148  * Made the floating reticle draw in the spot
16149  * regardless of the eye offset.
16150  *
16151  * Revision 1.241  1994/12/23  15:02:55  john
16152  * Tweaked floating reticle.
16153  *
16154  * Revision 1.240  1994/12/23  14:27:45  john
16155  * Changed offset of floating reticle to line up with
16156  * lasers a bit better.
16157  *
16158  * Revision 1.239  1994/12/23  14:22:50  john
16159  * Added floating reticle for VR helments.
16160  *
16161  * Revision 1.238  1994/12/13  14:07:50  matt
16162  * Fixed tmap_num2 bug in search mode
16163  *
16164  * Revision 1.237  1994/12/11  00:45:53  matt
16165  * Fixed problem when object sort buffer got full
16166  *
16167  * Revision 1.236  1994/12/09  18:46:06  matt
16168  * Added a little debugging
16169  *
16170  * Revision 1.235  1994/12/09  14:59:16  matt
16171  * Added system to attach a fireball to another object for rendering purposes,
16172  * so the fireball always renders on top of (after) the object.
16173  *
16174  * Revision 1.234  1994/12/08  15:46:54  matt
16175  * Fixed buffer overflow that caused seg depth screwup
16176  *
16177  * Revision 1.233  1994/12/08  11:51:53  matt
16178  * Took out some unused stuff
16179  *
16180  * Revision 1.232  1994/12/06  16:31:48  mike
16181  * fix detriangulation problems.
16182  *
16183  * Revision 1.231  1994/12/05  15:32:51  matt
16184  * Changed an assert to an int3 & return
16185  *
16186  * Revision 1.230  1994/12/04  17:28:04  matt
16187  * Got rid of unused no_render_flag array, and took out box clear when searching
16188  *
16189  * Revision 1.229  1994/12/04  15:51:14  matt
16190  * Fixed linear tmap transition for objects
16191  *
16192  * Revision 1.228  1994/12/03  20:16:50  matt
16193  * Turn off window clip for objects
16194  *
16195  * Revision 1.227  1994/12/03  14:48:00  matt
16196  * Restored some default settings
16197  *
16198  * Revision 1.226  1994/12/03  14:44:32  matt
16199  * Fixed another difficult bug in the window clip system
16200  *
16201  * Revision 1.225  1994/12/02  13:19:56  matt
16202  * Fixed rect clears at terminus of rendering
16203  * Made a bunch of debug code compile out
16204  *
16205  * Revision 1.224  1994/12/02  11:58:21  matt
16206  * Fixed window clip bug
16207  *
16208  * Revision 1.223  1994/11/28  21:50:42  mike
16209  * optimizations.
16210  *
16211  * Revision 1.222  1994/11/28  01:32:15  mike
16212  * turn off window clearing.
16213  *
16214  * Revision 1.221  1994/11/27  23:11:52  matt
16215  * Made changes for new mprintf calling convention
16216  *
16217  * Revision 1.220  1994/11/20  15:58:55  matt
16218  * Don't migrate the control center, since it doesn't move out of its segment
16219  *
16220  * Revision 1.219  1994/11/19  23:54:36  mike
16221  * change window colors.
16222  *
16223  * Revision 1.218  1994/11/19  15:20:25  mike
16224  * rip out unused code and data
16225  *
16226  * Revision 1.217  1994/11/18  13:21:24  mike
16227  * Clear only view portals into rest of world based on value of Clear_window.
16228  *
16229  * Revision 1.216  1994/11/15  17:02:10  matt
16230  * Re-added accidentally deleted variable
16231  *
16232  * Revision 1.215  1994/11/15  16:51:50  matt
16233  * Made rear view only switch to rear cockpit if cockpit on in front view
16234  *
16235  * Revision 1.214  1994/11/14  20:47:57  john
16236  * Attempted to strip out all the code in the game
16237  * directory that uses any ui code.
16238  *
16239  * Revision 1.213  1994/11/11  15:37:07  mike
16240  * write orange for background to show render bugs.
16241  *
16242  * Revision 1.212  1994/11/09  22:57:18  matt
16243  * Keep tract of depth of segments rendered, for detail level optimization
16244  *
16245  * Revision 1.211  1994/11/01  23:40:14  matt
16246  * Elegantly handler buffer getting full
16247  *
16248  * Revision 1.210  1994/10/31  22:28:13  mike
16249  * Fix detriangulation bug.
16250  *
16251  * Revision 1.209  1994/10/31  11:48:56  mike
16252  * Optimize detriangulation, speedup of about 4% in many cases, 0% in many.
16253  *
16254  * Revision 1.208  1994/10/30  20:08:34  matt
16255  * For endlevel: added big explosion at tunnel exit; made lights in tunnel
16256  * go out; made more explosions on walls.
16257  *
16258  * Revision 1.207  1994/10/27  14:14:35  matt
16259  * Don't do light flash during endlevel sequence
16260  *
16261  * Revision 1.206  1994/10/11  12:05:42  mike
16262  * Improve detriangulation.
16263  *
16264  * Revision 1.205  1994/10/07  15:27:00  john
16265  * Commented out the code that moves your eye
16266  * forward.
16267  *
16268  * Revision 1.204  1994/10/05  16:07:38  mike
16269  * Don't detriangulate sides if in player's segment.  Prevents player going behind a wall,
16270  * though there are cases in which it would be ok to detriangulate these.
16271  *
16272  * Revision 1.203  1994/10/03  12:44:05  matt
16273  * Took out unreferenced code
16274  *
16275  * Revision 1.202  1994/09/28  14:08:45  john
16276  * Added Zoom stuff back in, but ifdef'd it out.
16277  *
16278  * Revision 1.201  1994/09/25  23:41:49  matt
16279  * Changed the object load & save code to read/write the structure fields one
16280  * at a time (rather than the whole structure at once).  This mean that the
16281  * object structure can be changed without breaking the load/save functions.
16282  * As a result of this change, the local_object data can be and has been
16283  * incorporated into the object array.  Also, timeleft is now a property
16284  * of all objects, and the object structure has been otherwise cleaned up.
16285  *
16286  * Revision 1.200  1994/09/25  15:50:10  mike
16287  * Integrate my debug changes which shows how many textures were rendered
16288  * this frame.
16289  *
16290  * Revision 1.199  1994/09/25  15:45:22  matt
16291  * Added OBJ_LIGHT, a type of object that casts light
16292  * Added generalized lifeleft, and moved it to local_object
16293  *
16294  * Revision 1.198  1994/09/15  21:23:32  matt
16295  * Changed system to keep track of whether & what cockpit is up
16296  *
16297  * Revision 1.197  1994/09/15  16:30:12  mike
16298  * Comment out call to object_render_targets, which did nothing.
16299  *
16300  * Revision 1.196  1994/09/07  22:25:51  matt
16301  * Don't migrate through semi-transparent walls
16302  *
16303  * Revision 1.195  1994/09/07  19:16:21  mike
16304  * Homing missile.
16305  *
16306  * Revision 1.194  1994/08/31  20:54:17  matt
16307  * Don't do flash effect while whiting out
16308  *
16309  * Revision 1.193  1994/08/23  17:20:12  john
16310  * Added rear-view cockpit.
16311  *
16312  * Revision 1.192  1994/08/22  14:36:35  john
16313  * Made R key make a "reverse" view render.
16314  *
16315  * Revision 1.191  1994/08/19  20:09:26  matt
16316  * Added end-of-level cut scene with external scene
16317  *
16318  * Revision 1.190  1994/08/10  19:56:17  john
16319  * Changed font stuff; Took out old menu; messed up lots of
16320  * other stuff like game sequencing messages, etc.
16321  *
16322  * Revision 1.189  1994/08/10  14:45:05  john
16323  * *** empty log message ***
16324  *
16325  * Revision 1.188  1994/08/09  16:04:06  john
16326  * Added network players to editor.
16327  *
16328  * Revision 1.187  1994/08/05  17:07:05  john
16329  * Made lasers be two objects, one drawing after the other
16330  * all the time.
16331  *
16332  * Revision 1.186  1994/08/05  10:07:57  matt
16333  * Disable window check checking (i.e., always use window check)
16334  *
16335  * Revision 1.185  1994/08/04  19:11:30  matt
16336  * Changed a bunch of vecmat calls to use multiple-function routines, and to
16337  * allow the use of C macros for some functions
16338  *
16339  * Revision 1.184  1994/08/04  00:21:14  matt
16340  * Cleaned up fvi & physics error handling; put in code to make sure objects
16341  * are in correct segment; simplified segment finding for objects and points
16342  *
16343  * Revision 1.183  1994/08/02  19:04:28  matt
16344  * Cleaned up vertex list functions
16345  *
16346  * Revision 1.182  1994/07/29  15:13:33  matt
16347  * When window check turned off, cut render depth in half
16348  *
16349  * Revision 1.181  1994/07/29  11:03:50  matt
16350  * Use highest_segment_index instead of num_segments so render works from
16351  * the editor
16352  *
16353  * Revision 1.180  1994/07/29  10:04:34  mike
16354  * Update Cursegp when an object is selected.
16355  *
16356  * Revision 1.179  1994/07/25  00:02:50  matt
16357  * Various changes to accomodate new 3d, which no longer takes point numbers
16358  * as parms, and now only takes pointers to points.
16359  *
16360  * Revision 1.178  1994/07/24  14:37:49  matt
16361  * Added angles for player head
16362  *
16363  * Revision 1.177  1994/07/20  19:08:07  matt
16364  * If in editor, don't move eye from center of viewer object
16365
16366 ------------------------------------------------------------------------
16367 main/render.h:
16368
16369  * Revision 1.1  1995/05/16  16:01:51  allender
16370  * Initial revision
16371  *
16372  * Revision 2.0  1995/02/27  11:33:00  john
16373  * New version 2.0, which has no anonymous unions, builds with
16374  * Watcom 10.0, and doesn't require parsing BITMAPS.TBL.
16375  *
16376  * Revision 1.17  1994/11/30  12:33:33  mike
16377  * prototype Clear_window.
16378  *
16379  * Revision 1.16  1994/11/02  16:19:52  matt
16380  * Increased size of extra object buffer
16381  *
16382  * Revision 1.15  1994/07/25  00:02:49  matt
16383  * Various changes to accomodate new 3d, which no longer takes point numbers
16384  * as parms, and now only takes pointers to points.
16385  *
16386  * Revision 1.14  1994/07/24  14:37:42  matt
16387  * Added angles for player head
16388  *
16389  * Revision 1.13  1994/06/24  17:01:34  john
16390  * Add VFX support; Took Game Sequencing, like EndGame and stuff and
16391  * took it out of game.c and into gameseq.c
16392  *
16393  * Revision 1.12  1994/06/16  10:55:57  matt
16394  * Made a bunch of test code dependent on #defines
16395  *
16396  * Revision 1.11  1994/06/01  00:01:36  matt
16397  * Added mine destruction flashing effect
16398  *
16399  * Revision 1.10  1994/05/22  18:47:36  mike
16400  * make Render_list a globally accessible variable.
16401  *
16402  * Revision 1.9  1994/05/22  15:29:32  mike
16403  * Separation of lighting from render.c to lighting.c.
16404  *
16405  * Revision 1.8  1994/05/14  17:59:39  matt
16406  * Added extern.
16407  *
16408  * Revision 1.7  1994/05/14  17:15:17  matt
16409  * Got rid of externs in source (non-header) files
16410  *
16411  * Revision 1.6  1994/02/17  11:32:41  matt
16412  * Changes in object system
16413  *
16414  * Revision 1.5  1994/01/21  17:31:48  matt
16415  * Moved code from render_frame() to caller, making code cleaner
16416  *
16417  * Revision 1.4  1994/01/06  09:46:12  john
16418  * Added removable walls... all code that checked for
16419  * children to see if a wall was a doorway, i changed
16420  * to yuan's wall_is_doorway function that is in wall.c...
16421  * doesn't work yet.
16422  *
16423  * Revision 1.3  1994/01/05  11:25:47  john
16424  * Changed Player_zoom to Render_zoom
16425  *
16426  * Revision 1.2  1994/01/05  10:53:43  john
16427  * New object code by John.
16428  *
16429  * Revision 1.1  1993/11/04  14:01:43  matt
16430  * Initial revision
16431
16432 ------------------------------------------------------------------------
16433 main/robot.c:
16434
16435  * Revision 1.1  1995/05/16  15:30:34  allender
16436  * Initial revision
16437  *
16438  * Revision 2.1  1995/03/07  16:52:02  john
16439  * Fixed robots not moving without edtiro bug.
16440  *
16441  * Revision 2.0  1995/02/27  11:31:11  john
16442  * New version 2.0, which has no anonymous unions, builds with
16443  * Watcom 10.0, and doesn't require parsing BITMAPS.TBL.
16444  *
16445  * Revision 1.19  1995/02/22  13:58:09  allender
16446  * remove anonymous unions from object structure
16447  *
16448  * Revision 1.18  1995/01/27  11:17:06  rob
16449  * Avoid problems with illegal gun num.
16450  *
16451  * Revision 1.17  1994/11/19  15:15:02  mike
16452  * remove unused code and data
16453  *
16454  * Revision 1.16  1994/11/05  16:41:31  adam
16455  * upped MAX_ROBOT_JOINTS
16456  *
16457  * Revision 1.15  1994/09/26  15:29:29  matt
16458  * Allow morphing objects to fire
16459  *
16460  * Revision 1.14  1994/06/20  14:31:02  matt
16461  * Don't include joint zero in animation data
16462  *
16463  * Revision 1.13  1994/06/10  14:39:58  matt
16464  * Increased limit of robot joints
16465  *
16466  * Revision 1.12  1994/06/10  10:59:18  matt
16467  * Do error checking on list of angles
16468  *
16469  * Revision 1.11  1994/06/09  16:21:32  matt
16470  * Took out special-case and test code.
16471  *
16472  * Revision 1.10  1994/06/07  13:21:14  matt
16473  * Added support for new chunk-based POF files, with robot animation data.
16474  *
16475  * Revision 1.9  1994/06/01  17:58:24  mike
16476  * Greater flinch effect.
16477  *
16478  * Revision 1.8  1994/06/01  14:59:25  matt
16479  * Fixed calc_gun_position(), which was rotating the wrong way for the
16480  * object orientation.
16481  *
16482  * Revision 1.7  1994/06/01  12:44:04  matt
16483  * Added flinch state for test robot
16484  *
16485  * Revision 1.6  1994/05/31  19:17:24  matt
16486  * Fixed test robot angles
16487  *
16488  * Revision 1.5  1994/05/30  19:43:50  mike
16489  * Call set_test_robot.
16490  *
16491  *
16492  * Revision 1.4  1994/05/30  00:02:44  matt
16493  * Got rid of robot render type, and generally cleaned up polygon model
16494  * render objects.
16495  *
16496  * Revision 1.3  1994/05/29  18:46:15  matt
16497  * Added stuff for getting robot animation info for different states
16498  *
16499  * Revision 1.2  1994/05/26  21:09:15  matt
16500  * Moved robot stuff out of polygon model and into robot_info struct
16501  * Made new file, robot.c, to deal with robots
16502  *
16503  * Revision 1.1  1994/05/26  18:02:04  matt
16504  * Initial revision
16505
16506 ------------------------------------------------------------------------
16507 main/robot.h:
16508
16509  * Revision 1.1  1995/05/16  16:01:59  allender
16510  * Initial revision
16511  *
16512  * Revision 2.1  1995/03/07  16:52:00  john
16513  * Fixed robots not moving without edtiro bug.
16514  *
16515  * Revision 2.0  1995/02/27  11:30:59  john
16516  * New version 2.0, which has no anonymous unions, builds with
16517  * Watcom 10.0, and doesn't require parsing BITMAPS.TBL.
16518  *
16519  * Revision 1.25  1994/11/30  14:02:44  mike
16520  * fields for see/attack/claw sounds.
16521  *
16522  * Revision 1.24  1994/10/27  15:55:41  adam
16523  * *** empty log message ***
16524  *
16525  * Revision 1.23  1994/10/20  15:17:03  mike
16526  * Add boss flag.
16527  *
16528  * Revision 1.22  1994/10/20  09:51:00  adam
16529  * *** empty log message ***
16530  *
16531  * Revision 1.21  1994/10/18  10:52:54  mike
16532  * Support robots lunging as an attack_type.
16533  *
16534  * Revision 1.20  1994/10/17  21:19:02  mike
16535  * robot cloaking.
16536  *
16537  * Revision 1.19  1994/09/27  00:03:39  mike
16538  * Add score_value to robot_info struct.
16539  *
16540  * Revision 1.18  1994/09/22  19:01:12  mike
16541  * Move NDL from here to game.h
16542  *
16543  * Revision 1.17  1994/09/22  15:46:55  mike
16544  * Add default contained objects for robots.
16545  *
16546  * Revision 1.16  1994/09/22  10:46:57  mike
16547  * Add difficulty levels.
16548  *
16549  * Revision 1.15  1994/09/15  16:34:16  mike
16550  * Change rapidfire_count to a byte, add evade_speed, dum1, dum2.
16551  *
16552  * Revision 1.14  1994/09/09  14:21:58  matt
16553  * Increased maximum number of games
16554  *
16555  * Revision 1.13  1994/08/25  18:12:13  matt
16556  * Made player's weapons and flares fire from the positions on the 3d model.
16557  * Also added support for quad lasers.
16558  *
16559  * Revision 1.12  1994/08/23  16:37:24  mike
16560  * Add rapidfire_count to robot_info.
16561  *
16562  * Revision 1.11  1994/07/27  19:45:01  mike
16563  * Objects containing objects.
16564  *
16565  * Revision 1.10  1994/07/12  12:40:01  matt
16566  * Revamped physics system
16567  *
16568  * Revision 1.9  1994/06/21  12:17:12  mike
16569  * Add circle_distance to robot_info.
16570  *
16571  * Revision 1.8  1994/06/09  16:22:28  matt
16572  * Moved header for calc_gun_point() here, where it belongs
16573  *
16574  * Revision 1.7  1994/06/08  18:16:23  john
16575  * Bunch of new stuff that basically takes constants out of the code
16576  * and puts them into bitmaps.tbl.
16577  *
16578  * Revision 1.6  1994/06/03  11:38:09  john
16579  * Made robots get their strength for RobotInfo->strength, which
16580  * is read in from bitmaps.tbl
16581  *
16582  * Revision 1.5  1994/05/30  19:43:31  mike
16583  * Add voluminous comment for robot_get_anim_state.
16584  *
16585  * Revision 1.4  1994/05/30  00:03:18  matt
16586  * Got rid of robot render type, and generally cleaned up polygon model
16587  * render objects.
16588  *
16589  * Revision 1.3  1994/05/29  18:46:37  matt
16590  * Added stuff for getting robot animation info for different states
16591  *
16592  * Revision 1.2  1994/05/26  21:09:18  matt
16593  * Moved robot stuff out of polygon model and into robot_info struct
16594  * Made new file, robot.c, to deal with robots
16595  *
16596  * Revision 1.1  1994/05/26  18:02:12  matt
16597  * Initial revision
16598
16599 ------------------------------------------------------------------------
16600 main/scores.c:
16601
16602  * Revision 1.1  1995/12/05  16:06:29  allender
16603  * Initial revision
16604  *
16605  * Revision 1.3  1995/08/14  09:25:16  allender
16606  * add byteswap header
16607  *
16608  * Revision 1.2  1995/07/14  13:45:17  allender
16609  * fixed up high score code to work and look pretty good
16610  * needs some work tho'
16611  *
16612  * Revision 1.1  1995/05/16  15:30:42  allender
16613  * Initial revision
16614  *
16615  * Revision 2.2  1995/06/15  12:13:54  john
16616  * Made end game, win game and title sequences all go
16617  * on after 5 minutes automatically.
16618  *
16619  * Revision 2.1  1995/03/06  15:23:57  john
16620  * New screen techniques.
16621  *
16622  * Revision 2.0  1995/02/27  11:30:53  john
16623  * New version 2.0, which has no anonymous unions, builds with
16624  * Watcom 10.0, and doesn't require parsing BITMAPS.TBL.
16625  *
16626  * Revision 1.109  1995/02/09  12:23:19  rob
16627  * Added assert for length of filename.
16628  *
16629  * Revision 1.108  1995/01/03  17:33:24  john
16630  * Made scrolling textbox. Used it for scores cool saying.
16631  *
16632  * Revision 1.107  1994/12/28  10:42:51  john
16633  * More VFX tweaking.
16634  *
16635  * Revision 1.106  1994/12/28  10:26:19  john
16636  * Fixed some VFX problems.
16637  *
16638  * Revision 1.105  1994/12/15  16:42:12  adam
16639  * some fix
16640  *
16641  * Revision 1.104  1994/12/14  11:59:19  john
16642  * Changed the default high scores.
16643  *
16644  * Revision 1.103  1994/12/09  00:41:12  mike
16645  * fix hang in automap print screen
16646  *
16647  * Revision 1.102  1994/12/07  00:36:26  mike
16648  * scores sequencing stuff.
16649  *
16650  * Revision 1.101  1994/12/06  15:14:21  yuan
16651  * Localization
16652  *
16653  * Revision 1.100  1994/12/03  17:07:52  yuan
16654  * Localization 368
16655  *
16656  * Revision 1.99  1994/12/03  14:49:27  mark
16657  * Fixed john's bug with previous.
16658  *
16659  * Revision 1.98  1994/12/03  14:43:54  john
16660  * Added enter, space  to exit scores.
16661  *
16662  * Revision 1.97  1994/12/03  14:32:34  john
16663  * Added integrated-super-deluxe-ctrl-r to reset high scores.
16664  *
16665  * Revision 1.96  1994/12/01  20:15:20  yuan
16666  * Localization
16667  *
16668  * Revision 1.95  1994/11/30  19:36:36  john
16669  * Made Gravis Ultrasound work again.  Made the scores blink
16670  * at a constant rate.  Revamped the newmenu background storage,
16671  * which hopefully fixed some bugs.  Made menus in ame not pause
16672  * sound, except for the pause key.               ^== Game!
16673  *
16674  * Revision 1.94  1994/11/30  12:32:08  john
16675  * Made secret levels print correctly.
16676  *
16677  * Revision 1.93  1994/11/30  12:06:47  mike
16678  * fix bug: looper not initialized.
16679  *
16680  * Revision 1.92  1994/11/29  13:20:04  john
16681  * changed the "Wow! You placed .." to something better.
16682  *
16683  * Revision 1.91  1994/11/29  01:35:38  john
16684  * Made it so that even if you don't get a high score, you still show
16685  * up on the chart..
16686  *
16687  * Revision 1.90  1994/11/23  17:29:29  mike
16688  * fix xx-xx level bug in high scores.
16689  *
16690  * Revision 1.89  1994/11/22  16:55:27  mike
16691  * allow high scores even in pudly trainee level.
16692  *
16693  * Revision 1.88  1994/11/21  17:28:33  john
16694  * Changed default score values.
16695  *
16696  * Revision 1.87  1994/11/18  23:37:53  john
16697  * Changed some shorts to ints.
16698  *
16699  * Revision 1.86  1994/11/13  15:39:24  john
16700  * Added critical error handler to game.  Took out -editor command line
16701  * option because it didn't work anymore and wasn't worth fixing.  Made scores
16702  * not use MINER enviroment variable on release version, and made scores
16703  * not print an error if there is no descent.hi.
16704  *
16705  * Revision 1.85  1994/11/06  10:15:58  john
16706  * Took out kill % and hostage %
16707  *
16708  * Revision 1.84  1994/11/05  15:03:39  john
16709  * Added non-popup menu for the main menu, so that scores and credits don't have to save
16710  * the background.
16711  *
16712  * Revision 1.83  1994/11/05  14:05:57  john
16713  * Fixed fade transitions between all screens by making gr_palette_fade_in and out keep
16714  * track of whether the palette is faded in or not.  Then, wherever the code needs to fade out,
16715  * it just calls gr_palette_fade_out and it will fade out if it isn't already.  The same with fade_in.
16716  * This eliminates the need for all the flags like Menu_fade_out, game_fade_in palette, etc.
16717  *
16718  * Revision 1.82  1994/11/04  20:11:41  john
16719  * Neatening up palette stuff with demos.
16720  *
16721  * Revision 1.81  1994/11/04  12:02:34  john
16722  * Fixed fading transitions a bit more.
16723  *
16724  * Revision 1.80  1994/10/27  12:10:39  john
16725  * Moved kill % a little to the right.
16726  *
16727  * Revision 1.79  1994/10/24  20:25:03  john
16728  * Fixed bug with space at end of 1 line message.
16729  * Made Enter go between the two input lines.
16730  *
16731  * Revision 1.78  1994/10/24  18:20:18  john
16732  * Made the current high score flash.
16733  *
16734  * Revision 1.77  1994/10/24  13:37:22  mike
16735  * Fix grammar error.  --anal Mike.
16736  *
16737  * Revision 1.76  1994/10/22  13:19:19  john
16738  * Made joy/mouse buttons leave score screen.
16739  *
16740  * Revision 1.75  1994/10/21  15:26:57  john
16741  * Used PrtScr instead of F2.
16742  *
16743  * Revision 1.74  1994/10/21  13:54:21  matt
16744  * Replace '1' with special wide '1' to make numbers line up
16745  *
16746  * Revision 1.73  1994/10/19  20:48:01  john
16747  * Made so that people playing on wimp level
16748  * can't get high scores.
16749  *
16750  * Revision 1.72  1994/10/19  15:14:05  john
16751  * Took % hits out of player structure, made %kills work properly.
16752  *
16753  * Revision 1.71  1994/10/19  14:39:27  john
16754  * Finished up; added keys to prtscr, int3.
16755  *
16756  * Revision 1.70  1994/10/19  12:44:09  john
16757  * Added hours field to player structure.
16758  *
16759  * Revision 1.69  1994/10/19  11:25:21  john
16760  * Looking good.
16761  *
16762  * Revision 1.68  1994/10/19  10:54:12  john
16763  * Test version.
16764  *
16765  * Revision 1.67  1994/10/19  10:00:27  john
16766  * *** empty log message ***
16767  *
16768  * Revision 1.66  1994/10/19  09:59:03  john
16769  * Made cool saying have the potential to be up to 50 chars
16770  *
16771  * Revision 1.65  1994/10/19  09:53:30  john
16772  * Working version of scores.
16773  *
16774  * Revision 1.64  1994/10/18  21:07:46  john
16775  * Fixed bug that didn't print name correctly.
16776  *
16777  * Revision 1.63  1994/10/18  18:21:46  john
16778  * NEw score system.
16779  *
16780  * Revision 1.62  1994/10/17  20:31:42  john
16781  * Made the text for the difficulty labels global so that
16782  * the high score screen can print "rookie" or whatever.
16783  *
16784  * Revision 1.61  1994/10/17  17:27:44  john
16785  * Added starting_level to high score system.
16786  *
16787  * Revision 1.60  1994/10/17  16:56:35  john
16788  * Added starting level to stats menu.
16789  *
16790  * Revision 1.59  1994/10/17  16:55:25  john
16791  * Added starting level, but didn't hook it to anything.
16792  *
16793  * Revision 1.58  1994/10/17  16:47:17  john
16794  * Added diff. level.
16795  *
16796  * Revision 1.57  1994/10/17  15:49:53  john
16797  * Added stats screen.
16798  *
16799  * Revision 1.56  1994/10/03  23:02:29  matt
16800  * After player added or not to scores, scores are now displayed
16801  *
16802  * Revision 1.55  1994/09/01  18:09:38  john
16803  * Made commas in scores work correctly .
16804  *
16805  *
16806  * Revision 1.54  1994/09/01  18:03:57  john
16807  * Neatened up scores a bit.
16808  *
16809  * Revision 1.53  1994/08/26  14:27:37  john
16810  * Made it prompt for name
16811  *
16812  * Revision 1.52  1994/08/26  13:03:17  john
16813  * *** empty log message ***
16814  *
16815  * Revision 1.51  1994/08/26  13:01:52  john
16816  * Put high score system in.
16817  *
16818  * Revision 1.50  1994/08/10  19:57:01  john
16819  * Changed font stuff; Took out old menu; messed up lots of
16820  * other stuff like game sequencing messages, etc.
16821  *
16822  * Revision 1.49  1994/07/25  15:40:27  matt
16823  * Took out debugging code accidentally left in.
16824
16825 ------------------------------------------------------------------------
16826 main/scores.h:
16827
16828  * Revision 1.1  1995/05/16  16:02:07  allender
16829  * Initial revision
16830  *
16831  * Revision 2.0  1995/02/27  11:31:53  john
16832  * New version 2.0, which has no anonymous unions, builds with
16833  * Watcom 10.0, and doesn't require parsing BITMAPS.TBL.
16834  *
16835  * Revision 1.13  1994/12/07  00:36:36  mike
16836  * scores sequencing stuff.
16837  *
16838  * Revision 1.12  1994/11/28  11:26:09  matt
16839  * Took out scores for weapons, which are no longer used
16840  *
16841  * Revision 1.11  1994/10/24  18:20:03  john
16842  * Made the current high score flash.
16843  *
16844  * Revision 1.10  1994/10/18  18:21:36  john
16845  * NEw score system.
16846  *
16847  * Revision 1.9  1994/10/03  23:01:58  matt
16848  * New parms for scores_view()
16849  *
16850  *
16851  * Revision 1.8  1994/09/27  16:10:37  adam
16852  * changed scores of course
16853  *
16854  * Revision 1.7  1994/08/31  19:25:46  mike
16855  * Add score values for new powerups.
16856  *
16857  * Revision 1.6  1994/08/26  16:00:18  mike
16858  * enhanced (?) scoring.
16859  *
16860  * Revision 1.5  1994/08/26  13:01:45  john
16861  * Put high score system in.
16862  *
16863  * Revision 1.4  1994/05/30  16:33:21  yuan
16864  * Revamping high scores.
16865  *
16866  * Revision 1.3  1994/05/14  17:15:07  matt
16867  * Got rid of externs in source (non-header) files
16868  *
16869  * Revision 1.2  1994/05/13  13:13:57  yuan
16870  * Added player death...
16871  *
16872  * When you die, if just pops up a a message.
16873  * When game is over, a message is popped up, and if you have a high score,
16874  * you get to enter it.
16875  *
16876  * Revision 1.1  1994/05/13  10:22:16  yuan
16877  * Initial revision
16878
16879 ------------------------------------------------------------------------
16880 main/screens.h:
16881
16882  * Revision 1.1  1995/05/16  16:02:15  allender
16883  * Initial revision
16884  *
16885  * Revision 2.2  1995/03/14  12:14:00  john
16886  * Made VR helmets have 4 resolutions to choose from.
16887  *
16888  * Revision 2.1  1995/03/06  15:24:09  john
16889  * New screen techniques.
16890  *
16891  * Revision 2.0  1995/02/27  11:31:40  john
16892  * New version 2.0, which has no anonymous unions, builds with
16893  * Watcom 10.0, and doesn't require parsing BITMAPS.TBL.
16894  *
16895  * Revision 1.15  1994/08/10  19:56:45  john
16896  * Changed font stuff; Took out old menu; messed up lots of
16897  * other stuff like game sequencing messages, etc.
16898  *
16899  * Revision 1.14  1994/07/20  21:04:26  john
16900  * Add VictorMax VR helment support.
16901  *
16902  * Revision 1.13  1994/06/24  17:01:28  john
16903  * Add VFX support; Took Game Sequencing, like EndGame and stuff and
16904  * took it out of game.c and into gameseq.c
16905  *
16906  * Revision 1.12  1994/04/20  20:30:03  john
16907  * *** empty log message ***
16908  *
16909  * Revision 1.11  1994/03/30  21:12:05  yuan
16910  * Use only 119 lines (saves 3 scanlines)
16911  *
16912  * Revision 1.10  1994/03/17  16:49:37  john
16913  * *** empty log message ***
16914  *
16915  * Revision 1.9  1994/02/11  15:07:44  matt
16916  * Added extern of Canv_game_offscrn
16917  *
16918  * Revision 1.8  1994/01/31  16:52:43  john
16919  * redid cockpit bounds.
16920  *
16921  * Revision 1.7  1994/01/26  18:13:53  john
16922  * Changed 3d constants..
16923  *
16924  * Revision 1.6  1994/01/25  17:11:46  john
16925  * *** empty log message ***
16926  *
16927  * Revision 1.5  1994/01/25  11:43:25  john
16928  * Changed game window size.
16929  *
16930  * Revision 1.4  1993/12/13  16:32:39  yuan
16931  * Fixed menu system memory errors, and other bugs.
16932  *
16933  * Revision 1.3  1993/12/10  16:07:23  yuan
16934  * Working on menu system.  Updated the title screen.
16935  *
16936  * Revision 1.2  1993/12/09  21:27:46  matt
16937  * Added 3d window sizing constants
16938  *
16939  * Revision 1.1  1993/12/06  09:50:33  matt
16940  * Initial revision
16941
16942 ------------------------------------------------------------------------
16943 main/segment.h:
16944
16945  * Revision 1.4  1995/11/03  12:53:11  allender
16946  * shareware changes
16947  *
16948  * Revision 1.3  1995/07/26  16:53:45  allender
16949  * put sides and segment structure back the PC way for checksumming reasons
16950  *
16951  * Revision 1.2  1995/06/19  07:55:22  allender
16952  * rearranged structure members for possible better alignment
16953  *
16954  * Revision 1.1  1995/05/16  16:02:22  allender
16955  * Initial revision
16956  *
16957  * Revision 2.1  1995/03/20  18:15:22  john
16958  * Added code to not store the normals in the segment structure.
16959  *
16960  * Revision 2.0  1995/02/27  11:26:49  john
16961  * New version 2.0, which has no anonymous unions, builds with
16962  * Watcom 10.0, and doesn't require parsing BITMAPS.TBL.
16963  *
16964  * Revision 1.89  1995/01/24  15:07:55  yuan
16965  * *** empty log message ***
16966  *
16967  * Revision 1.88  1994/12/12  01:04:06  yuan
16968  * Boosted MAX_GAME_VERTS.
16969  *
16970  * Revision 1.87  1994/12/11  16:18:14  mike
16971  * add constants so we can detect too-large mines for game while in editor.
16972  *
16973  * Revision 1.86  1994/12/08  15:07:29  yuan
16974  * *** empty log message ***
16975  *
16976  * Revision 1.85  1994/12/01  21:06:39  matt
16977  * Moved plane tolerance constant to gameseg.c, the only file that used it.
16978  *
16979  * Revision 1.84  1994/11/27  14:01:41  matt
16980  * Fixed segment structure so LVLs work
16981  *
16982  * Revision 1.83  1994/11/26  22:50:20  matt
16983  * Removed editor-only fields from segment structure when editor is compiled
16984  * out, and padded segment structure to even multiple of 4 bytes.
16985  *
16986  * Revision 1.82  1994/11/21  11:43:36  mike
16987  * smaller segment and vertex buffers.
16988  *
16989  * Revision 1.81  1994/11/17  11:39:35  matt
16990  * Ripped out code to load old mines
16991  *
16992  * Revision 1.80  1994/10/30  14:12:05  mike
16993  * rip out local segments stuff.
16994  *
16995  * Revision 1.79  1994/10/27  11:33:58  mike
16996  * lower number of segments by 100, saving 116K.
16997  *
16998  * Revision 1.78  1994/08/25  21:54:50  mike
16999  * Add macro IS_CHILD to make checking for the presence of a child centralized.
17000  *
17001  * Revision 1.77  1994/08/11  18:58:16  mike
17002  * Add prototype for Side_to_verts_int.
17003  *
17004  * Revision 1.76  1994/08/01  11:04:13  yuan
17005  * New materialization centers.
17006  *
17007  * Revision 1.75  1994/07/25  00:04:19  matt
17008  * Various changes to accomodate new 3d, which no longer takes point numbers
17009  * as parms, and now only takes pointers to points.
17010  *
17011  * Revision 1.74  1994/07/21  19:01:30  mike
17012  * new lsegment structure.
17013  *
17014  * Revision 1.73  1994/06/08  14:30:48  matt
17015  * Added static_light field to segment structure, and padded side struct
17016  * to be longword aligned.
17017  *
17018  * Revision 1.72  1994/05/19  23:25:17  mike
17019  * Change MINE_VERSION to 15, DEFAULT_LIGHTING to 0
17020  *
17021  * Revision 1.71  1994/05/12  14:45:54  mike
17022  * New segment data structure (!!), group, special, object, value = short.
17023  *
17024  * Revision 1.70  1994/05/03  11:06:46  mike
17025  * Remove constants VMAG and UMAG which are editor specific..
17026  *
17027  * Revision 1.69  1994/04/18  10:40:28  yuan
17028  * Increased segment limit to 1000
17029  * (From 500)
17030
17031 ------------------------------------------------------------------------
17032 main/segpoint.h:
17033
17034  * Revision 1.1  1995/05/16  16:02:38  allender
17035  * Initial revision
17036  *
17037  * Revision 2.0  1995/02/27  11:26:54  john
17038  * New version 2.0, which has no anonymous unions, builds with
17039  * Watcom 10.0, and doesn't require parsing BITMAPS.TBL.
17040  *
17041  * Revision 1.2  1994/02/16  17:14:40  matt
17042  * Added include of 3d.h
17043  *
17044  * Revision 1.1  1993/12/06  09:51:37  matt
17045  * Initial revision
17046
17047 ------------------------------------------------------------------------
17048 main/slew.c:
17049
17050  * Revision 1.1  1995/05/16  15:30:57  allender
17051  * Initial revision
17052  *
17053  * Revision 2.0  1995/02/27  11:29:32  john
17054  * New version 2.0, which has no anonymous unions, builds with
17055  * Watcom 10.0, and doesn't require parsing BITMAPS.TBL.
17056  *
17057  * Revision 1.34  1995/02/22  14:23:28  allender
17058  * remove anonymous unions from object structure
17059  *
17060  * Revision 1.33  1995/02/22  13:24:26  john
17061  * Removed the vecmat anonymous unions.
17062  *
17063  * Revision 1.32  1994/09/10  15:46:42  john
17064  * First version of new keyboard configuration.
17065  *
17066  * Revision 1.31  1994/08/31  18:29:58  matt
17067  * Made slew work with new key system
17068  *
17069  * Revision 1.30  1994/08/31  14:10:48  john
17070  * Made slew go faster.
17071  *
17072  * Revision 1.29  1994/08/29  19:16:38  matt
17073  * Made slew object not have physics movement type, so slew objects don't
17074  * get bumped.
17075  *
17076  * Revision 1.28  1994/08/24  18:59:59  john
17077  * Changed key_down_time to return fixed seconds instead of
17078  * milliseconds.
17079  *
17080  * Revision 1.27  1994/07/01  11:33:05  john
17081  * Fixed bug with looking for stick even if one not present.
17082  *
17083  * Revision 1.26  1994/05/20  11:56:33  matt
17084  * Cleaned up find_vector_intersection() interface
17085  * Killed check_point_in_seg(), check_player_seg(), check_object_seg()
17086  *
17087  * Revision 1.25  1994/05/19  12:08:41  matt
17088  * Use new vecmat macros and globals
17089  *
17090  * Revision 1.24  1994/05/14  17:16:18  matt
17091  * Got rid of externs in source (non-header) files
17092  *
17093  * Revision 1.23  1994/05/03  12:26:38  matt
17094  * Removed use of physics_info var rotvel, which wasn't used for rotational
17095  * velocity at all.
17096  *
17097  * Revision 1.22  1994/02/17  11:32:34  matt
17098  * Changes in object system
17099  *
17100  * Revision 1.21  1994/01/18  14:03:53  john
17101  * made joy_get_pos use the new ints instead of
17102  * shorts.
17103  *
17104  * Revision 1.20  1994/01/10  17:11:35  mike
17105  * Add prototype for check_object_seg
17106  *
17107  * Revision 1.19  1994/01/05  10:53:38  john
17108  * New object code by John.
17109  *
17110  * Revision 1.18  1993/12/22  15:32:50  john
17111  * took out previos code that attempted to make
17112  * modifiers cancel keydowntime.
17113  *
17114  * Revision 1.17  1993/12/22  11:41:56  john
17115  * Made so that keydowntime recognizes editor special case!
17116  *
17117  * Revision 1.16  1993/12/14  18:13:52  matt
17118  * Made slew work in editor even when game isn't in slew mode
17119  *
17120  * Revision 1.15  1993/12/07  23:53:39  matt
17121  * Made slew work in editor even when game isn't in slew mode
17122  *
17123  * Revision 1.14  1993/12/05  22:47:49  matt
17124  * Reworked include files in an attempt to cut down on build times
17125  *
17126  * Revision 1.13  1993/12/01  11:44:14  matt
17127  * Chagned Frfract to FrameTime
17128  *
17129  * Revision 1.12  1993/11/08  16:21:42  john
17130  * made stop_slew or whatever return an int
17131  *
17132  * Revision 1.11  1993/11/01  13:59:49  john
17133  * more slew experiments.
17134
17135 ------------------------------------------------------------------------
17136 main/slew.h:
17137
17138  * Revision 1.1  1995/05/16  16:03:09  allender
17139  * Initial revision
17140  *
17141  * Revision 2.0  1995/02/27  11:33:05  john
17142  * New version 2.0, which has no anonymous unions, builds with
17143  * Watcom 10.0, and doesn't require parsing BITMAPS.TBL.
17144  *
17145  * Revision 1.5  1994/12/15  16:43:58  matt
17146  * Made slew functions compile out for release versions
17147  *
17148  * Revision 1.4  1994/02/17  11:32:41  matt
17149  * Changes in object system
17150  *
17151  * Revision 1.3  1994/01/05  10:53:42  john
17152  * New object code by John.
17153  *
17154  * Revision 1.2  1993/12/05  22:48:57  matt
17155  * Reworked include files in an attempt to cut down on build times
17156  *
17157  * Revision 1.1  1993/12/05  20:20:16  matt
17158  * Initial revision
17159
17160 ------------------------------------------------------------------------
17161 main/songs.c:
17162
17163  * Revision 1.5  1995/11/03  12:52:59  allender
17164  * shareware changes
17165  *
17166  * Revision 1.4  1995/10/18  01:51:33  allender
17167  * fixed up stuff for redbook
17168  *
17169  * Revision 1.3  1995/10/17  13:13:44  allender
17170  * dont' add resource value to songs to play -- now done in digi
17171  * code
17172  *
17173  * Revision 1.2  1995/07/17  08:50:35  allender
17174  * make work with new music system
17175  *
17176  * Revision 1.1  1995/05/16  15:31:05  allender
17177  * Initial revision
17178  *
17179  * Revision 2.1  1995/05/02  16:15:21  john
17180  * Took out printf.
17181  *
17182  * Revision 2.0  1995/02/27  11:27:13  john
17183  * New version 2.0, which has no anonymous unions, builds with
17184  * Watcom 10.0, and doesn't require parsing BITMAPS.TBL.
17185  *
17186  * Revision 1.2  1995/02/11  12:42:12  john
17187  * Added new song method, with FM bank switching..
17188  *
17189  * Revision 1.1  1995/02/11  10:20:33  john
17190  * Initial revision
17191
17192 ------------------------------------------------------------------------
17193 main/songs.h:
17194
17195  * Revision 2.0  1995/02/27  11:30:52  john
17196  * New version 2.0, which has no anonymous unions, builds with
17197  * Watcom 10.0, and doesn't require parsing BITMAPS.TBL.
17198  *
17199  * Revision 1.6  1995/02/11  22:21:44  adam
17200  * *** empty log message ***
17201  *
17202  * Revision 1.5  1995/02/11  19:10:49  adam
17203  * *** empty log message ***
17204  *
17205  * Revision 1.4  1995/02/11  18:34:40  adam
17206  * *** empty log message ***
17207  *
17208  * Revision 1.3  1995/02/11  18:04:51  adam
17209  * upped songs
17210  *
17211  * Revision 1.2  1995/02/11  12:42:12  john
17212  * Added new song method, with FM bank switching..
17213  *
17214  * Revision 1.1  1995/02/11  10:20:18  john
17215  * Initial revision
17216
17217 ------------------------------------------------------------------------
17218 main/sounds.h:
17219
17220  * Revision 1.1  1995/05/16  16:03:32  allender
17221  * Initial revision
17222  *
17223  * Revision 2.0  1995/02/27  11:27:32  john
17224  * New version 2.0, which has no anonymous unions, builds with
17225  * Watcom 10.0, and doesn't require parsing BITMAPS.TBL.
17226  *
17227  * Revision 1.41  1995/02/03  17:08:28  john
17228  * Changed sound stuff to allow low memory usage.
17229  * Also, changed so that Sounds isn't an array of digi_sounds, it
17230  * is a ubyte pointing into GameSounds, this way the digi.c code that
17231  * locks sounds won't accidentally unlock a sound that is already playing, but
17232  * since it's Sounds[soundno] is different, it would erroneously be unlocked.
17233  *
17234  * Revision 1.40  1995/01/30  21:45:17  adam
17235  * added weapon change sounds
17236  *
17237  * Revision 1.39  1995/01/30  21:11:57  mike
17238  * Use new weapon selection sounds, different for primary and secondary.
17239  *
17240  * Revision 1.38  1995/01/26  17:02:58  mike
17241  * make fusion cannon have more chrome, make fusion, mega rock you!
17242  *
17243  * Revision 1.37  1995/01/18  19:46:15  matt
17244  * Added sound for invulnerability wearing off, and voice message for cheating
17245  *
17246  * Revision 1.36  1995/01/18  19:05:04  john
17247  * Increased MAX_SOUNDS.
17248  *
17249  * Revision 1.35  1994/12/14  16:57:08  adam
17250  * *** empty log message ***
17251  *
17252  * Revision 1.34  1994/12/08  21:31:40  adam
17253  * *** empty log message ***
17254  *
17255  * Revision 1.33  1994/12/08  12:33:01  mike
17256  * make boss dying more interesting.
17257  *
17258  * Revision 1.32  1994/12/04  21:39:40  matt
17259  * Added sound constants for endlevel explosions
17260  *
17261  * Revision 1.31  1994/11/30  14:02:58  mike
17262  * see/claw/attack sounds.
17263  *
17264  * Revision 1.30  1994/11/29  20:43:54  matt
17265  * Deleted a bunch of unused constants
17266  *
17267  * Revision 1.29  1994/11/29  15:48:11  matt
17268  * Cleaned up, & added new sounds
17269  *
17270  * Revision 1.28  1994/11/29  14:35:36  adam
17271  * moved lava noise index
17272  *
17273  * Revision 1.27  1994/11/29  13:23:30  matt
17274  * Cleaned up sound constants
17275  *
17276  * Revision 1.26  1994/11/29  13:01:04  rob
17277  * ADded badass explosion define.
17278  *
17279  * Revision 1.25  1994/11/29  11:34:23  rob
17280  * Added new HUD sounds.
17281  *
17282  * Revision 1.24  1994/11/15  16:52:01  mike
17283  * hiss sound placeholder.
17284  *
17285  * Revision 1.23  1994/10/25  16:21:45  adam
17286  * changed homing sound
17287  *
17288  * Revision 1.22  1994/10/23  00:27:34  matt
17289  * Made exploding wall do one long sound, instead of lots of small ones
17290  *
17291  * Revision 1.21  1994/10/22  14:12:35  mike
17292  * Add sound for missile tracking player.
17293  *
17294  * Revision 1.20  1994/10/11  12:25:21  matt
17295  * Added "hot rocks" that create badass explosion when hit by weapons
17296  *
17297  * Revision 1.19  1994/10/10  20:57:50  matt
17298  * Added sound for exploding wall (hostage door)
17299  *
17300  * Revision 1.18  1994/10/04  15:33:31  john
17301  * Took out the old PLAY_SOUND??? code and replaced it
17302  * with direct calls into digi_link_??? so that all sounds
17303  * can be made 3d.
17304  *
17305  * Revision 1.17  1994/09/29  21:13:41  john
17306  * Added Master volumes for digi and midi. Also took out panning,
17307  * because it doesn't work with MasterVolume stuff.
17308  *
17309  * Revision 1.16  1994/09/29  00:42:29  matt
17310  * Made hitting a locked door play a sound
17311  *
17312  * Revision 1.15  1994/09/20  19:14:34  john
17313  * Massaged the sound system; used a better formula for determining
17314  * which l/r balance, also, put in Mike's stuff that searches for a connection
17315  * between the 2 sounds' segments, stopping for closed doors, etc.
17316  *
17317  * Revision 1.14  1994/07/06  15:23:59  john
17318  * Revamped hostage sound.
17319  *
17320  * Revision 1.13  1994/06/21  19:13:27  john
17321  * *** empty log message ***
17322  *
17323  * Revision 1.12  1994/06/21  12:09:54  adam
17324  * *** empty log message ***
17325  *
17326  * Revision 1.11  1994/06/21  12:03:15  john
17327  * Added more sounds.
17328  *
17329  * Revision 1.10  1994/06/20  22:01:54  matt
17330  * Added prototype for Play3D()
17331  *
17332  * Revision 1.9  1994/06/20  21:06:06  yuan
17333  * Fixed up menus.
17334  *
17335  * Revision 1.8  1994/06/17  12:21:54  mike
17336  * Hook for robot hits player.
17337  *
17338  * Revision 1.7  1994/06/15  19:01:35  john
17339  * Added the capability to make 3d sounds play just once for the
17340  * laser hit wall effects.
17341  *
17342  * Revision 1.6  1994/06/08  11:43:03  john
17343  * Enable 3D sound.
17344  *
17345  * Revision 1.5  1994/06/07  18:21:20  john
17346  * Start changing sound to the new 3D system.
17347  *
17348  * Revision 1.4  1994/05/16  16:17:41  john
17349  * Bunch of stuff on my Inferno Task list May16-23
17350  *
17351  * Revision 1.3  1994/05/09  21:11:38  john
17352  * Sound changes; pass index instead of pointer to digi routines.
17353  * Made laser sound cut off the last laser sound.
17354  *
17355  * Revision 1.2  1994/04/27  11:47:46  john
17356  * First version.
17357  *
17358  * Revision 1.1  1994/04/26  10:44:36  john
17359  * Initial revision
17360
17361 ------------------------------------------------------------------------
17362 main/state.c:
17363
17364  * Revision 1.7  1995/10/31  10:18:25  allender
17365  * shareware stuff
17366  *
17367  * Revision 1.6  1995/10/21  22:25:45  allender
17368  * put in creator code and file type for saved games.
17369  * put save games in players folder
17370  *
17371  * Revision 1.5  1995/10/20  00:51:21  allender
17372  * close boxes and proper mouse support on save game stuff
17373  *
17374  * Revision 1.4  1995/10/17  13:19:02  allender
17375  * close boxes for load and save game
17376  *
17377  * Revision 1.3  1995/09/18  08:09:15  allender
17378  * made larger thumbnail and handled NULL gr_bitmap pointers
17379  * better
17380  *
17381  * Revision 1.2  1995/08/14  14:36:12  allender
17382  * change transparency to 0
17383  *
17384  * Revision 1.1  1995/05/16  15:31:12  allender
17385  * Initial revision
17386  *
17387  * Revision 2.14  1995/05/26  16:16:10  john
17388  * Split SATURN into define's for requiring cd, using cd, etc.
17389  * Also started adding all the Rockwell stuff.
17390  *
17391  * Revision 2.13  1995/04/06  15:12:20  john
17392  * Fixed bug with lunacy not working.
17393  *
17394  * Revision 2.12  1995/04/04  13:33:05  john
17395  * Removed multiplayer save.
17396  *
17397  * Revision 2.11  1995/03/31  13:42:10  john
17398  * Made saved games from the bogus saturn version read in
17399  * correctly.
17400  *
17401  * Revision 2.10  1995/03/31  12:45:28  john
17402  * Fixed bug with previous.
17403  *
17404  * Revision 2.9  1995/03/31  12:24:40  john
17405  * I had changed alt_textures from a pointer to a byte. This hosed old
17406  * saved games, so I restored it to an int.
17407  *
17408  * Revision 2.8  1995/03/28  11:22:47  john
17409  * Added cheats to save file. Changed lunacy text.
17410  *
17411  * Revision 2.7  1995/03/27  21:41:03  john
17412  * Added code to verify that the proper multi save file
17413  * is used when restoring a network game.
17414  *
17415  * Revision 2.6  1995/03/27  18:04:18  john
17416  * Made multi save/restore require the -multisave command line arg.
17417  *
17418  * Revision 2.5  1995/03/27  17:01:52  john
17419  * Made deafult choice work better.
17420  *
17421  * Revision 2.4  1995/03/27  15:49:44  john
17422  * Added slots to save games.
17423  *
17424  * Revision 2.3  1995/03/27  12:59:19  john
17425  * Initial version of multiplayer save games.
17426  *
17427  * Revision 2.2  1995/03/24  13:11:35  john
17428  * Added save game during briefing screens.
17429  *
17430  * Revision 2.1  1995/03/21  14:38:36  john
17431  * Ifdef'd out the NETWORK code.
17432  *
17433  * Revision 2.0  1995/02/27  11:27:00  john
17434  * New version 2.0, which has no anonymous unions, builds with
17435  * Watcom 10.0, and doesn't require parsing BITMAPS.TBL.
17436  *
17437  * Revision 1.43  1995/02/22  14:32:41  allender
17438  * remove anonymous unions from object structure
17439  *
17440  * Revision 1.42  1995/02/13  20:34:33  john
17441  * Lintized
17442  *
17443  * Revision 1.41  1995/02/13  10:37:30  john
17444  * Saved Buggin' cheat mode to save file.
17445  *
17446  * Revision 1.40  1995/02/09  10:24:25  john
17447  * *** empty log message ***
17448  *
17449  * Revision 1.39  1995/02/09  10:22:20  john
17450  * Fixed bug with callsign getting trashed if you copy somebody else
17451  * 's save game file into your directory.
17452  *
17453  * Revision 1.38  1995/02/08  21:01:27  john
17454  * Closed state file around the code that shows briefing screens so that the
17455  * code works on machines with clean boot with only 5 file handles.
17456  *
17457  * Revision 1.37  1995/02/07  14:02:33  john
17458  * Added code to verify game restore.
17459  *
17460  * Revision 1.36  1995/02/07  11:07:43  john
17461  * Added hooks for confirm on game state restore.
17462  *
17463  * Revision 1.35  1995/02/03  11:27:36  john
17464  * Made inbetween level save's thumbnail's have correct aspect.
17465  *
17466  * Revision 1.34  1995/02/03  10:58:43  john
17467  * Added code to save shareware style saved games into new format...
17468  * Also, made new player file format not have the saved game array in it.
17469  *
17470  * Revision 1.33  1995/02/02  19:40:52  john
17471  * Added 10 save game slots.
17472  *
17473  * Revision 1.32  1995/02/02  12:23:20  john
17474  * Made between level saves have picture.
17475  *
17476  * Revision 1.31  1995/01/31  11:21:43  john
17477  * Added code for fixed with menus.
17478  *
17479  * Revision 1.30  1995/01/29  21:37:29  mike
17480  * initialize variables on game load so you don't drain your energy when you fire.
17481  *
17482  * Revision 1.29  1995/01/29  13:47:58  mike
17483  * Restore some variables on game load (in game).
17484  *
17485  * Revision 1.28  1995/01/26  10:46:57  john
17486  * Fixed bug with state names getting hosed.
17487  *
17488  * Revision 1.27  1995/01/26  09:51:23  john
17489  * Fixed bug with game descriptions getting hosed.
17490  *
17491  * Revision 1.26  1995/01/25  16:35:49  john
17492  * Made so that when you hit enter during
17493  * game save, -empty- goes away.
17494  *
17495  * Revision 1.25  1995/01/25  15:01:39  john
17496  * Upped the save file version.
17497  *
17498  * Revision 1.24  1995/01/24  20:35:35  john
17499  * *** empty log message ***
17500  *
17501  * Revision 1.23  1995/01/24  20:34:24  john
17502  * Fixed bug with player stats not being set right for in
17503  * between level saves.
17504  *
17505  * Revision 1.22  1995/01/23  10:39:03  john
17506  * Added mission stuff to game saves.
17507  *
17508  * Revision 1.21  1995/01/22  16:07:12  mike
17509  * localization.
17510  *
17511  * Revision 1.20  1995/01/22  15:58:32  mike
17512  * localization
17513  *
17514  * Revision 1.19  1995/01/20  11:04:40  john
17515  * Upped state save version.
17516  *
17517  * Revision 1.18  1995/01/19  17:00:44  john
17518  * Made save game work between levels.
17519  *
17520  * Revision 1.17  1995/01/17  14:27:33  john
17521  * *** empty log message ***
17522  *
17523  * Revision 1.16  1995/01/17  13:36:37  john
17524  * Moved pig loading into StartNewLevelSub.
17525  *
17526  * Revision 1.15  1995/01/16  16:53:38  john
17527  * Added code to save cheat state during save game.
17528  *
17529  * Revision 1.14  1995/01/15  16:55:22  john
17530  * Improved mine texture parsing.
17531  *
17532  * Revision 1.13  1995/01/12  10:45:15  john
17533  * Added difficulty level to save/restore game.
17534  *
17535  * Revision 1.12  1995/01/05  15:46:55  john
17536  * Made weapons not rearm when starting a saved game.
17537  *
17538  * Revision 1.11  1995/01/05  11:51:45  john
17539  * Added better Abort game menu.
17540  * Made save state return success or nopt.
17541  *
17542  * Revision 1.10  1995/01/05  11:34:51  john
17543  * Took out endlevel save stuff for registered.
17544  *
17545  * Revision 1.9  1995/01/04  18:19:52  john
17546  * Added automap visited list saving.
17547  *
17548  * Revision 1.8  1995/01/04  17:29:56  john
17549  * Made save/restore ALT+F?. Also made them not work
17550  * in network mode, and if recording a demo, will
17551  * quit recording.
17552  *
17553  * Revision 1.7  1995/01/04  13:18:31  john
17554  * Added cool 6 game save.
17555  *
17556  * Revision 1.6  1995/01/03  20:38:46  john
17557  * Saved morph objects.
17558  *
17559  * Revision 1.5  1995/01/03  20:19:29  john
17560  * Pretty good working version of game save.
17561  *
17562  * Revision 1.4  1995/01/03  14:18:18  matt
17563  * ifdefs added to compile code add.  Added by Mike, I think.
17564  *
17565  * Revision 1.3  1994/12/29  18:40:19  john
17566  * Initial version.
17567  *
17568  * Revision 1.2  1994/12/29  15:26:40  john
17569  * Put in hooks for saving/restoring game state.
17570  *
17571  * Revision 1.1  1994/12/29  15:16:02  john
17572  * Initial revision
17573
17574 ------------------------------------------------------------------------
17575 main/state.h:
17576
17577  * Revision 1.1  1995/05/16  16:03:40  allender
17578  * Initial revision
17579  *
17580  * Revision 2.1  1995/03/27  21:40:35  john
17581  * Added code to verify that the proper multi save file
17582  * is used when restoring a network game.
17583  *
17584  * Revision 2.0  1995/02/27  11:28:44  john
17585  * New version 2.0, which has no anonymous unions, builds with
17586  * Watcom 10.0, and doesn't require parsing BITMAPS.TBL.
17587  *
17588  * Revision 1.6  1995/02/07  10:54:05  john
17589  * *** empty log message ***
17590  *
17591  * Revision 1.5  1995/02/03  10:58:12  john
17592  * Added code to save shareware style saved games into new format...
17593  * Also, made new player file format not have the saved game array in it.
17594  *
17595  * Revision 1.4  1995/01/19  17:00:51  john
17596  * Made save game work between levels.
17597  *
17598  * Revision 1.3  1995/01/05  11:51:44  john
17599  * Added better Abort game menu.
17600  * Made save state return success or nopt.
17601  *
17602  * Revision 1.2  1994/12/29  15:26:39  john
17603  * Put in hooks for saving/restoring game state.
17604  *
17605  * Revision 1.1  1994/12/29  15:15:47  john
17606  * Initial revision
17607
17608 ------------------------------------------------------------------------
17609 main/switch.c:
17610
17611  * Revision 1.2  1995/10/31  10:18:10  allender
17612  * shareware stuff
17613  *
17614  * Revision 1.1  1995/05/16  15:31:21  allender
17615  * Initial revision
17616  *
17617  * Revision 2.1  1995/03/21  14:39:08  john
17618  * Ifdef'd out the NETWORK code.
17619  *
17620  * Revision 2.0  1995/02/27  11:28:41  john
17621  * New version 2.0, which has no anonymous unions, builds with
17622  * Watcom 10.0, and doesn't require parsing BITMAPS.TBL.
17623  *
17624  * Revision 1.51  1995/01/31  15:26:23  rob
17625  * Don't trigger matcens in anarchy games.
17626  *
17627  * Revision 1.50  1995/01/26  12:18:26  rob
17628  * Changed network_do_frame call.
17629  *
17630  * Revision 1.49  1995/01/18  18:50:35  allender
17631  * don't process triggers if in demo playback mode.  Fix for Rob to only do
17632  * multi_send_endlevel_start if in multi player game
17633  *
17634  * Revision 1.48  1995/01/13  11:59:40  rob
17635  * Added palette fade after secret level exit.
17636  *
17637  * Revision 1.47  1995/01/12  17:00:41  rob
17638  * Fixed a problem with switches and secret levels.
17639  *
17640  * Revision 1.46  1995/01/12  13:35:11  rob
17641  * Added data flush after secret level exit.
17642  *
17643  * Revision 1.45  1995/01/03  15:25:11  rob
17644  * Fixed a compile error.
17645  *
17646  * Revision 1.44  1995/01/03  15:12:02  rob
17647  * Adding multiplayer switching.
17648  *
17649  * Revision 1.43  1994/11/29  16:52:12  yuan
17650  * Removed some obsolete commented out code.
17651  *
17652  * Revision 1.42  1994/11/27  23:15:07  matt
17653  * Made changes for new mprintf calling convention
17654  *
17655  * Revision 1.41  1994/11/22  18:36:45  rob
17656  * Added new hook for endlevel for secret doors.
17657  *
17658  * Revision 1.40  1994/11/21  17:29:43  matt
17659  * Cleaned up sequencing & game saving for secret levels
17660  *
17661  * Revision 1.39  1994/11/19  15:20:32  mike
17662  * rip out unused code and data
17663  *
17664  * Revision 1.38  1994/10/25  16:09:52  yuan
17665  * Fixed byte bug.
17666  *
17667  * Revision 1.37  1994/10/24  16:05:28  matt
17668  * Removed clear of fuelcen_control_center_destroyed
17669  *
17670  * Revision 1.36  1994/10/08  14:21:13  matt
17671  * Added include
17672  *
17673  * Revision 1.35  1994/10/07  12:34:09  matt
17674  * Added code fot going to/from secret levels
17675  *
17676  * Revision 1.34  1994/10/05  15:16:10  rob
17677  * Used to be that only player #0 could trigger switches, now only the
17678  * LOCAL player can do it (and he's expected to tell the other guy with
17679  * a com message if its important!)
17680  *
17681  * Revision 1.33  1994/09/24  17:42:03  mike
17682  * Kill temporary version of function written by Yuan, replaced by MK.
17683  *
17684  * Revision 1.32  1994/09/24  17:10:00  yuan
17685  * Added Matcen triggers.
17686  *
17687  * Revision 1.31  1994/09/23  18:02:21  yuan
17688  * Completed wall checking.
17689  *
17690  * Revision 1.30  1994/08/19  20:09:41  matt
17691  * Added end-of-level cut scene with external scene
17692  *
17693  * Revision 1.29  1994/08/18  10:47:36  john
17694  * Cleaned up game sequencing and player death stuff
17695  * in preparation for making the player explode into
17696  * pieces when dead.
17697  *
17698  * Revision 1.28  1994/08/12  22:42:11  john
17699  * Took away Player_stats; added Players array.
17700  *
17701  * Revision 1.27  1994/07/02  13:50:44  matt
17702  * Cleaned up includes
17703  *
17704  * Revision 1.26  1994/06/27  16:32:25  yuan
17705  * Commented out incomplete code...
17706  *
17707  * Revision 1.25  1994/06/27  15:53:27  john
17708  * #define'd out the newdemo stuff
17709  *
17710  *
17711  * Revision 1.24  1994/06/27  15:10:04  yuan
17712  * Might mess up triggers.
17713  *
17714  * Revision 1.23  1994/06/24  17:01:43  john
17715  * Add VFX support; Took Game Sequencing, like EndGame and stuff and
17716  * took it out of game.c and into gameseq.c
17717  *
17718  * Revision 1.22  1994/06/16  16:20:15  john
17719  * Made player start out in physics mode; Neatend up game loop a bit.
17720  *
17721  * Revision 1.21  1994/06/15  14:57:22  john
17722  * Added triggers to demo recording.
17723  *
17724  * Revision 1.20  1994/06/10  17:44:25  mike
17725  * Assert on result of find_connect_side == -1
17726  *
17727  * Revision 1.19  1994/06/08  10:20:15  yuan
17728  * Removed unused testing.
17729  *
17730  *
17731  * Revision 1.18  1994/06/07  13:10:48  yuan
17732  * Fixed bug in check trigger... Still working on other bugs.
17733  *
17734  * Revision 1.17  1994/05/30  20:22:04  yuan
17735  * New triggers.
17736  *
17737  * Revision 1.16  1994/05/27  10:32:46  yuan
17738  * New dialog boxes (Walls and Triggers) added.
17739  *
17740  *
17741  * Revision 1.15  1994/05/25  18:06:46  yuan
17742  * Making new dialog box controls for walls and triggers.
17743  *
17744  * Revision 1.14  1994/05/10  19:05:32  yuan
17745  * Made end of level flag rather than menu popping up
17746  *
17747  * Revision 1.13  1994/04/29  15:05:25  yuan
17748  * Added menu pop-up at exit trigger.
17749
17750 ------------------------------------------------------------------------
17751 main/switch.h:
17752
17753  * Revision 1.1  1995/05/16  16:03:48  allender
17754  * Initial revision
17755  *
17756  * Revision 2.0  1995/02/27  11:26:52  john
17757  * New version 2.0, which has no anonymous unions, builds with
17758  * Watcom 10.0, and doesn't require parsing BITMAPS.TBL.
17759  *
17760  * Revision 1.19  1995/01/12  17:00:36  rob
17761  * Fixed a problem with switches and secret levels.
17762  *
17763  * Revision 1.18  1994/10/06  21:24:40  matt
17764  * Added switch for exit to secret level
17765  *
17766  * Revision 1.17  1994/09/29  17:05:52  matt
17767  * Removed unused constant
17768  *
17769  * Revision 1.16  1994/09/24  17:10:07  yuan
17770  * Added Matcen triggers.
17771  *
17772  * Revision 1.15  1994/08/15  18:06:39  yuan
17773  * Added external trigger.
17774  *
17775  * Revision 1.14  1994/06/16  16:20:52  john
17776  * Made player start out in physics mode; Neatend up game loop a bit.
17777  *
17778  * Revision 1.13  1994/05/30  20:22:08  yuan
17779  * New triggers.
17780  *
17781  * Revision 1.12  1994/05/27  10:32:44  yuan
17782  * New dialog boxes (Walls and Triggers) added.
17783  *
17784  *
17785  * Revision 1.11  1994/05/25  18:06:32  yuan
17786  * Making new dialog box controls for walls and triggers.
17787  *
17788  * Revision 1.10  1994/04/28  18:04:40  yuan
17789  * Gamesave added.
17790  * Trigger problem fixed (seg pointer is replaced by index now.)
17791  *
17792  * Revision 1.9  1994/04/26  11:19:01  yuan
17793  * Make it so a trigger can only be triggered every 5 seconds.
17794
17795 ------------------------------------------------------------------------
17796 main/terrain.c:
17797
17798  * Revision 1.1  1995/05/16  15:31:29  allender
17799  * Initial revision
17800  *
17801  * Revision 2.0  1995/02/27  11:31:27  john
17802  * New version 2.0, which has no anonymous unions, builds with
17803  * Watcom 10.0, and doesn't require parsing BITMAPS.TBL.
17804  *
17805  * Revision 1.12  1994/12/03  00:18:00  matt
17806  * Made endlevel sequence cut off early
17807  * Made exit model and bit explosion always plot last (after all terrain)
17808  *
17809  * Revision 1.11  1994/11/27  23:13:46  matt
17810  * Made changes for new mprintf calling convention
17811  *
17812  * Revision 1.10  1994/11/21  18:04:36  matt
17813  * Fixed alloc/free problem with height array
17814  *
17815  * Revision 1.9  1994/11/21  17:30:42  matt
17816  * Properly free light array
17817  *
17818  * Revision 1.8  1994/11/19  12:40:55  matt
17819  * Added system to read endlevel data from file, and to make it work
17820  * with any exit tunnel.
17821  *
17822  * Revision 1.7  1994/11/16  11:49:44  matt
17823  * Added code to rotate terrain to match mine
17824  *
17825  * Revision 1.6  1994/11/02  16:22:59  matt
17826  * Killed mprintf
17827  *
17828  * Revision 1.5  1994/10/30  20:09:19  matt
17829  * For endlevel: added big explosion at tunnel exit; made lights in tunnel
17830  * go out; made more explosions on walls.
17831  *
17832  * Revision 1.4  1994/10/27  21:15:07  matt
17833  * Added better error handling
17834  *
17835  * Revision 1.3  1994/10/27  01:03:17  matt
17836  * Made terrain renderer use aribtary point in height array as origin
17837  *
17838  * Revision 1.2  1994/08/19  20:09:44  matt
17839  * Added end-of-level cut scene with external scene
17840  *
17841  * Revision 1.1  1994/08/17  20:20:49  matt
17842  * Initial revision
17843
17844 ------------------------------------------------------------------------
17845 main/terrain.h:
17846
17847  * Revision 1.1  1995/05/16  16:03:56  allender
17848  * Initial revision
17849  *
17850  * Revision 2.0  1995/02/27  11:32:53  john
17851  * New version 2.0, which has no anonymous unions, builds with
17852  * Watcom 10.0, and doesn't require parsing BITMAPS.TBL.
17853  *
17854  * Revision 1.3  1994/10/27  01:03:51  matt
17855  * Made terrain renderer use aribtary point in height array as origin
17856  *
17857  * Revision 1.2  1994/08/19  20:09:45  matt
17858  * Added end-of-level cut scene with external scene
17859  *
17860  * Revision 1.1  1994/08/17  20:33:36  matt
17861  * Initial revision
17862
17863 ------------------------------------------------------------------------
17864 main/texmerge.c:
17865
17866  * Revision 1.1  1995/05/16  15:31:36  allender
17867  * Initial revision
17868  *
17869  * Revision 2.0  1995/02/27  11:31:08  john
17870  * New version 2.0, which has no anonymous unions, builds with
17871  * Watcom 10.0, and doesn't require parsing BITMAPS.TBL.
17872  *
17873  * Revision 1.28  1995/01/14  19:16:56  john
17874  * First version of new bitmap paging code.
17875  *
17876  * Revision 1.27  1994/12/14  18:21:58  yuan
17877  * *** empty log message ***
17878  *
17879  * Revision 1.26  1994/12/13  09:50:08  john
17880  * Added Asserts to stop if wall looks like door.
17881  *
17882  * Revision 1.25  1994/12/07  00:35:24  mike
17883  * change how flat shading average color is computed for paste-ons.
17884  *
17885  * Revision 1.24  1994/11/19  15:20:29  mike
17886  * rip out unused code and data
17887  *
17888  * Revision 1.23  1994/11/12  16:38:51  mike
17889  * deal with avg_color in texture merging.
17890  *
17891  * Revision 1.22  1994/11/09  19:55:39  john
17892  * Added full rle support with texture rle caching.
17893  *
17894  * Revision 1.21  1994/10/20  15:21:16  john
17895  * Took out the texmerge caching.
17896  *
17897  * Revision 1.20  1994/10/10  19:00:57  john
17898  * Made caching info print every 1000 frames.
17899  *
17900  * Revision 1.19  1994/10/10  18:41:21  john
17901  * Printed out texture caching info.
17902  *
17903  * Revision 1.18  1994/08/11  18:59:02  mike
17904  * Use new assembler version of merge functions.
17905  *
17906  * Revision 1.17  1994/06/09  12:13:14  john
17907  * Changed selectors so that all bitmaps have a selector of
17908  * 0, but inside the texture mapper they get a selector set.
17909  *
17910  * Revision 1.16  1994/05/14  17:15:15  matt
17911  * Got rid of externs in source (non-header) files
17912  *
17913  * Revision 1.15  1994/05/09  17:21:09  john
17914  * Took out mprintf with cache hits/misses.
17915  *
17916  * Revision 1.14  1994/05/05  12:55:07  john
17917  * Made SuperTransparency work.
17918  *
17919  * Revision 1.13  1994/05/04  11:15:37  john
17920  * Added Super Transparency
17921  *
17922  * Revision 1.12  1994/04/28  23:36:04  john
17923  * Took out a debugging mprintf.
17924  *
17925  * Revision 1.11  1994/04/22  17:44:48  john
17926  * Made top 2 bits of paste-ons pick the
17927  * orientation of the bitmap.
17928  *
17929  * Revision 1.10  1994/03/31  12:05:51  matt
17930  * Cleaned up includes
17931  *
17932  * Revision 1.9  1994/03/15  16:31:52  yuan
17933  * Cleaned up bm-loading code.
17934  * (And structures)
17935  *
17936  * Revision 1.8  1994/01/24  13:15:19  john
17937  * Made caching work with pointers, not texture numbers,
17938  * that way, the animated textures cache.
17939  *
17940  * Revision 1.7  1994/01/21  16:38:10  john
17941  * Took out debug info.
17942  *
17943  * Revision 1.6  1994/01/21  16:28:43  john
17944  * added warning to print cache hit/miss.
17945  *
17946  * Revision 1.5  1994/01/21  16:22:30  john
17947  * Put in caching/
17948  *
17949  * Revision 1.4  1994/01/21  15:34:49  john
17950  * *** empty log message ***
17951  *
17952  * Revision 1.3  1994/01/21  15:33:08  john
17953  * *** empty log message ***
17954  *
17955  * Revision 1.2  1994/01/21  15:15:35  john
17956  * Created new module texmerge, that merges textures together and
17957  * caches the results.
17958  *
17959  * Revision 1.1  1994/01/21  14:55:29  john
17960  * Initial revision
17961
17962 ------------------------------------------------------------------------
17963 main/texmerge.h:
17964
17965  * Revision 1.1  1995/05/16  16:04:03  allender
17966  * Initial revision
17967  *
17968  * Revision 2.0  1995/02/27  11:28:05  john
17969  * New version 2.0, which has no anonymous unions, builds with
17970  * Watcom 10.0, and doesn't require parsing BITMAPS.TBL.
17971  *
17972  * Revision 1.4  1995/01/14  19:16:26  john
17973  * First version of new bitmap paging code.
17974  *
17975  * Revision 1.3  1994/01/21  15:23:26  john
17976  * made texmerge_close return void.
17977  *
17978  *
17979  * Revision 1.2  1994/01/21  15:16:01  john
17980  * Created new module texmerge, that merges textures together and
17981  * caches the results.
17982  *
17983  * Revision 1.1  1994/01/21  15:03:36  john
17984  * Initial revision
17985
17986 ------------------------------------------------------------------------
17987 main/text.c:
17988
17989  * Revision 1.1  1995/05/16  15:31:44  allender
17990  * Initial revision
17991  *
17992  * Revision 2.0  1995/02/27  11:33:09  john
17993  * New version 2.0, which has no anonymous unions, builds with
17994  * Watcom 10.0, and doesn't require parsing BITMAPS.TBL.
17995  *
17996  * Revision 1.11  1994/12/14  12:53:23  matt
17997  * Improved error handling
17998  *
17999  * Revision 1.10  1994/12/09  18:36:44  john
18000  * Added code to make text read from hogfile.
18001  *
18002  * Revision 1.9  1994/12/08  20:56:34  john
18003  * More cfile stuff.
18004  *
18005  * Revision 1.8  1994/12/08  17:20:06  yuan
18006  * Cfiling stuff.
18007  *
18008  * Revision 1.7  1994/12/05  15:10:36  allender
18009  * support encoded descent.tex file (descent.txb)
18010  *
18011  * Revision 1.6  1994/12/01  14:18:34  matt
18012  * Now support backslash chars in descent.tex file
18013  *
18014  * Revision 1.5  1994/10/27  00:13:10  john
18015  * Took out cfile.
18016  *
18017  * Revision 1.4  1994/07/11  15:33:49  matt
18018  * Put in command-line switch to load different text files
18019  *
18020  * Revision 1.3  1994/07/10  09:56:25  yuan
18021  * #include <stdio.h> added for FILE type.
18022  *
18023  * Revision 1.2  1994/07/09  22:48:14  matt
18024  * Added localizable text
18025  *
18026  * Revision 1.1  1994/07/09  21:30:46  matt
18027  * Initial revision
18028
18029 ------------------------------------------------------------------------
18030 main/text.h:
18031
18032  * Revision 1.3  1995/10/18  23:30:29  allender
18033  * fixed horrendous misspelling
18034  *
18035  * Revision 1.2  1995/10/18  23:27:33  allender
18036  * added new printscreen line to end of text string
18037  *
18038  * Revision 1.1  1995/05/16  16:04:11  allender
18039  * Initial revision
18040  *
18041  * Revision 2.2  1995/03/30  16:36:22  mike
18042  * text localization.
18043  *
18044  * Revision 2.1  1995/03/08  15:33:24  allender
18045  * *** empty log message ***
18046  *
18047  * Revision 2.0  1995/02/27  11:30:21  john
18048  * New version 2.0, which has no anonymous unions, builds with
18049  * Watcom 10.0, and doesn't require parsing BITMAPS.TBL.
18050  *
18051  * Revision 1.63  1995/02/11  14:59:42  rob
18052  * Added string for controlcen invul.
18053  *
18054  * Revision 1.62  1995/02/10  15:19:38  allender
18055  * added text for bad write on demo write
18056  *
18057  * Revision 1.61  1995/02/08  10:59:11  rob
18058  * Added string used in kill list view.
18059  *
18060  * Revision 1.60  1995/02/07  20:38:40  rob
18061  * Added new localized strings for new multi options.
18062  *
18063  * Revision 1.59  1995/02/02  15:29:17  matt
18064  * Changed & localized secret level text
18065  *
18066  * Revision 1.58  1995/02/02  12:24:14  adam
18067  * added automap string
18068  *
18069  * Revision 1.57  1995/02/01  18:06:50  rob
18070  * Localize default macros, other stuff frm network.c
18071  *
18072  * Revision 1.56  1995/01/30  15:29:53  rob
18073  * Localizing.
18074  *
18075  * Revision 1.55  1995/01/30  13:54:25  allender
18076  * added mission/demo text
18077  *
18078  * Revision 1.54  1995/01/24  22:03:22  mike
18079  * text localization.
18080  *
18081  * Revision 1.53  1995/01/23  13:05:59  adam
18082  * added save/load game text
18083  *
18084  * Revision 1.52  1995/01/22  15:58:42  mike
18085  * localization
18086  *
18087  * Revision 1.51  1994/12/29  12:08:47  rob
18088  * removed new text strings.
18089  *
18090  * Revision 1.50  1994/12/28  16:47:14  rob
18091  * Added new com setup strings.
18092  *
18093  * Revision 1.49  1994/12/15  23:24:22  rob
18094  * Added string for rejoin failure.
18095  *
18096  * Revision 1.48  1994/12/15  10:16:06  adam
18097  * added lame trademark notice
18098  *
18099  * Revision 1.47  1994/12/14  18:21:23  yuan
18100  * *** empty log message ***
18101  *
18102  * Revision 1.46  1994/12/14  16:57:01  matt
18103  * Added text for hat2
18104  *
18105  * Revision 1.45  1994/12/14  08:50:12  allender
18106  * *** empty log message ***
18107  *
18108  * Revision 1.44  1994/12/13  19:43:29  rob
18109  * Added string.
18110  *
18111  * Revision 1.43  1994/12/13  12:54:45  mike
18112  * add strings for hostages on board when you die.
18113  *
18114  * Revision 1.42  1994/12/13  10:04:09  allender
18115  * *** empty log message ***
18116  *
18117  * Revision 1.41  1994/12/12  22:20:23  rob
18118  * Added two new localized strings for modem.c
18119  *
18120  * Revision 1.40  1994/12/09  19:46:26  yuan
18121  * Localized the sucker.
18122  *
18123  * Revision 1.39  1994/12/09  14:35:30  yuan
18124  * Added localization string for Rob.
18125  *
18126  * Revision 1.38  1994/12/09  14:08:16  mike
18127  * text message for remaining ships at end bonus.
18128  *
18129  * Revision 1.37  1994/12/09  00:28:26  rob
18130  * Added "died in mine" string.
18131  *
18132  * Revision 1.36  1994/12/08  14:30:31  yuan
18133  * Fixed off by one problem.
18134  *
18135  * Revision 1.35  1994/12/08  11:18:56  allender
18136  * demo text string
18137  *
18138  * Revision 1.33  1994/12/07  19:14:33  matt
18139  * Cleaned up command-line options and command-line help message
18140  *
18141  * Revision 1.32  1994/12/07  17:20:34  yuan
18142  * Localization
18143  *
18144  * Revision 1.31  1994/12/07  16:49:15  yuan
18145  * More localization
18146  *
18147  * Revision 1.30  1994/12/07  14:52:11  yuan
18148  * Localization 492
18149  *
18150  * Revision 1.29  1994/12/07  11:28:12  matt
18151  * Did a little localization support
18152  *
18153  * Revision 1.28  1994/12/06  18:29:31  mike
18154  * Add text for cheat: Start at any level.
18155  *
18156  * Revision 1.27  1994/12/06  16:30:39  yuan
18157  * Localization
18158  *
18159  * Revision 1.26  1994/12/06  15:14:55  yuan
18160  * Fixed number of textstrings.
18161  *
18162  * Revision 1.25  1994/12/06  15:13:52  yuan
18163  * Localization
18164  *
18165  * Revision 1.24  1994/12/06  13:46:24  adam
18166  * *** empty log message ***
18167  *
18168  * Revision 1.23  1994/12/05  23:17:28  yuan
18169  * Localization bugs fixed.
18170  *
18171  * Revision 1.22  1994/12/05  23:05:41  yuan
18172  * Localization 425
18173  *
18174  * Revision 1.21  1994/12/05  22:42:27  rob
18175  * Added new connect status strings
18176  *
18177  * Revision 1.20  1994/12/05  16:47:30  rob
18178  * Added a new string.
18179  *
18180  *
18181  * Revision 1.19  1994/12/03  22:35:17  yuan
18182  * Localization 412
18183  *
18184  * Revision 1.18  1994/12/03  17:53:42  yuan
18185  * 382.
18186
18187 ------------------------------------------------------------------------
18188 main/textures.h:
18189
18190  * Revision 1.1  1995/05/16  16:04:20  allender
18191  * Initial revision
18192  *
18193  * Revision 2.0  1995/02/27  11:31:54  john
18194  * New version 2.0, which has no anonymous unions, builds with
18195  * Watcom 10.0, and doesn't require parsing BITMAPS.TBL.
18196  *
18197  * Revision 1.3  1994/03/15  16:32:56  yuan
18198  * Cleaned up bm-loading code.
18199  * (Fixed structures too)
18200  *
18201  * Revision 1.2  1993/12/05  22:49:53  matt
18202  * Reworked include files in an attempt to cut down on build times
18203  *
18204  * Revision 1.1  1993/12/05  20:16:26  matt
18205  * Initial revision
18206
18207 ------------------------------------------------------------------------
18208 main/titles.c:
18209
18210  * Revision 1.13  1995/11/03  12:52:23  allender
18211  * shareware changes
18212  *
18213  * Revision 1.12  1995/10/31  10:17:56  allender
18214  * shareware stuff
18215  *
18216  * Revision 1.11  1995/10/24  18:12:02  allender
18217  * don't do special processing on do_appl_quit anymore
18218  *
18219  * Revision 1.10  1995/10/21  22:25:02  allender
18220  * added bald guy cheat
18221  *
18222  * Revision 1.9  1995/10/17  13:14:30  allender
18223  * mouse will now move through title stuff
18224  *
18225  * Revision 1.8  1995/10/15  23:00:34  allender
18226  * made mouse move through screens and do event processing
18227  * at title screens
18228  *
18229  * Revision 1.7  1995/10/10  11:52:10  allender
18230  * use appropriate end01 file for registered
18231  *
18232  * Revision 1.6  1995/09/24  10:53:09  allender
18233  * added cmd-q to quit during titles screens and briefing screens
18234  *
18235  * Revision 1.5  1995/08/25  15:39:37  allender
18236  * save and resotre interpolation method during briefing screens
18237  *
18238  * Revision 1.4  1995/08/24  16:10:57  allender
18239  * endgame screen changes, and fixups to other stuff
18240  *
18241  * Revision 1.3  1995/08/14  14:40:37  allender
18242  * fixed up briefing screens to look correct.
18243  * made robot canvas smaller for now for speec
18244  *
18245  * Revision 1.2  1995/06/13  13:07:05  allender
18246  * do a bitblt during tight loops to get spinning robots and cursor flashing
18247  *
18248  * Revision 1.1  1995/05/16  15:31:52  allender
18249  * Initial revision
18250  *
18251  * Revision 2.10  1995/06/15  12:14:16  john
18252  * Made end game, win game and title sequences all go
18253  * on after 5 minutes automatically.
18254  *
18255  * Revision 2.9  1995/06/14  17:25:48  john
18256  * Fixed bug with VFX palette not getting loaded for credits, titles.
18257  *
18258  * Revision 2.8  1995/05/26  16:16:30  john
18259  * Split SATURN into define's for requiring cd, using cd, etc.
18260  * Also started adding all the Rockwell stuff.
18261  *
18262  * Revision 2.7  1995/03/24  13:11:36  john
18263  * Added save game during briefing screens.
18264  *
18265  * Revision 2.6  1995/03/21  14:41:17  john
18266  * Ifdef'd out the NETWORK code.
18267  *
18268  * Revision 2.5  1995/03/15  14:33:45  john
18269  * Added code to force the Descent CD-rom in the drive.
18270  *
18271  * Revision 2.4  1995/03/14  18:24:50  john
18272  * Force Destination Saturn to use CD-ROM drive.
18273  *
18274  * Revision 2.3  1995/03/10  13:05:52  john
18275  * Added code so that palette is correct for VFX1 helmets.
18276  *
18277  * Revision 2.2  1995/03/07  14:19:28  mike
18278  * More destination saturn stuff.
18279  *
18280  * Revision 2.1  1995/03/06  15:24:16  john
18281  * New screen techniques.
18282  *
18283  * Revision 2.0  1995/02/27  11:32:50  john
18284  * New version 2.0, which has no anonymous unions, builds with
18285  * Watcom 10.0, and doesn't require parsing BITMAPS.TBL.
18286  *
18287  * Revision 1.95  1995/02/12  04:07:19  matt
18288  * After freeing Robot_canv, set ptr to NULL
18289  *
18290  * Revision 1.94  1995/02/11  12:41:57  john
18291  * Added new song method, with FM bank switching..
18292  *
18293  * Revision 1.93  1995/02/11  09:51:59  john
18294  * Stripped out all SVGA references.
18295  *
18296  * Revision 1.92  1995/02/07  09:56:10  john
18297  * Fixed bug with wrong title screen drawing during save btwn lvls.
18298  *
18299  * Revision 1.91  1995/02/04  13:53:16  john
18300  * Added code to display the correct titles between levels
18301  * that have robot maps..
18302  *
18303  * Revision 1.90  1995/02/02  16:36:33  adam
18304  * *** empty log message ***
18305  *
18306  * Revision 1.89  1995/02/02  12:23:30  john
18307  * Made between level saves have picture.
18308  *
18309  * Revision 1.88  1995/02/02  01:50:16  adam
18310  * rearranged robot briefings.
18311  *
18312  * Revision 1.87  1995/02/01  22:28:54  mike
18313  * *** empty log message ***
18314  *
18315  * Revision 1.86  1995/02/01  17:12:21  mike
18316  * Make score come after endgame screens.
18317  *
18318  * Revision 1.85  1995/02/01  14:04:17  adam
18319  * mucked with screens
18320  *
18321  * Revision 1.84  1995/01/28  16:59:30  adam
18322  * added hook for special first briefing music
18323  *
18324  * Revision 1.83  1995/01/21  17:04:35  mike
18325  * fix endgame text bogosity.
18326  *
18327  * Revision 1.82  1995/01/21  16:26:29  matt
18328  * Made endlevel briefing work with missions
18329  *
18330  * Revision 1.81  1995/01/21  13:15:20  adam
18331  * added new robot briefings.
18332  *
18333  * Revision 1.80  1995/01/20  22:47:33  matt
18334  * Mission system implemented, though imcompletely
18335  *
18336  * Revision 1.79  1995/01/20  14:57:52  mike
18337  * support arbitrary number of screens/level.
18338  *
18339  * Revision 1.78  1995/01/15  14:29:12  john
18340  * Made the exit door page in.
18341  *
18342  * Revision 1.77  1995/01/15  14:27:09  adam
18343  * messed with endgame stuff
18344  *
18345  * Revision 1.76  1995/01/14  15:42:49  mike
18346  * Make endgame for registered support 3 screens.
18347  *
18348  * Revision 1.75  1995/01/14  14:00:59  adam
18349  * *** empty log message ***
18350  *
18351  * Revision 1.74  1995/01/09  11:28:53  mike
18352  * Support new $O thingy for bitmaps which cycle and are not the exit door.
18353  *
18354  * Revision 1.73  1995/01/02  12:39:13  mike
18355  * fix secret level sequencing.
18356  *
18357  * Revision 1.72  1994/12/12  19:44:14  rob
18358  * Added kill matrix to end of game sequence.
18359  *
18360  * Revision 1.71  1994/12/09  22:32:57  adam
18361  * messed with text positioning
18362  *
18363  * Revision 1.70  1994/12/09  14:08:37  mike
18364  * make briefing text work with hog files.
18365  *
18366  * Revision 1.69  1994/12/09  00:41:47  mike
18367  * fix hang in automap print screen.
18368  *
18369  * Revision 1.68  1994/12/08  20:56:36  john
18370  * More cfile stuff.
18371  *
18372  * Revision 1.67  1994/12/08  17:19:11  yuan
18373  * Cfiling stuff.
18374  *
18375  * Revision 1.66  1994/12/07  11:28:00  matt
18376  * Did a localization suppport
18377  *
18378  * Revision 1.65  1994/12/06  17:10:23  yuan
18379  * Fixed missing )
18380  *
18381  * Revision 1.64  1994/12/06  17:00:45  rob
18382  * Fixed problem with finishing the game in modem/serial mode.
18383  *
18384  * Revision 1.63  1994/12/06  16:58:37  matt
18385  * Killed warnings
18386  *
18387  * Revision 1.62  1994/12/06  15:54:28  mike
18388  * fix guy at end...
18389
18390 ------------------------------------------------------------------------
18391 main/titles.h:
18392
18393  * Revision 2.0  1995/02/27  11:27:40  john
18394  * New version 2.0, which has no anonymous unions, builds with
18395  * Watcom 10.0, and doesn't require parsing BITMAPS.TBL.
18396  *
18397  * Revision 1.12  1995/02/02  12:23:29  john
18398  * Made between level saves have picture.
18399  *
18400  * Revision 1.11  1995/01/21  16:27:11  matt
18401  * Made endlevel briefing work with missions
18402  *
18403  * Revision 1.10  1995/01/20  22:48:02  matt
18404  * Mission system implemented, though imcompletely
18405  *
18406  * Revision 1.9  1994/12/07  19:14:07  matt
18407  * Kill briefing screen disable switch for release version
18408  *
18409  * Revision 1.8  1994/11/21  16:40:24  matt
18410  * Added prototype
18411  *
18412  * Revision 1.7  1994/11/05  14:05:54  john
18413  * Fixed fade transitions between all screens by making gr_palette_fade_in and out keep
18414  * track of whether the palette is faded in or not.  Then, wherever the code needs to fade out,
18415  * it just calls gr_palette_fade_out and it will fade out if it isn't already.  The same with fade_in.
18416  * This eliminates the need for all the flags like Menu_fade_out, game_fade_in palette, etc.
18417  *
18418  * Revision 1.6  1994/11/01  17:57:48  mike
18419  * Briefing screens.
18420  *
18421  * Revision 1.5  1994/10/31  22:28:04  mike
18422  * briefing screens
18423  *
18424  * Revision 1.4  1994/09/16  16:14:31  john
18425  * Added acrade sequencing.
18426  *
18427  * Revision 1.3  1994/06/22  00:26:53  matt
18428  * Added support for Interplay's animating title sequence
18429  *
18430  * Revision 1.2  1994/06/17  12:13:36  john
18431  * More newdemo stuff; made editor->game transition start in slew mode.
18432  *
18433  * Revision 1.1  1994/06/17  10:50:12  john
18434  * Initial revision
18435
18436 ------------------------------------------------------------------------
18437 main/vclip.c:
18438
18439  * Revision 1.2  1995/09/14  14:14:31  allender
18440  * return void in draw_vclip_object
18441  *
18442  * Revision 1.1  1995/05/16  15:32:00  allender
18443  * Initial revision
18444  *
18445  * Revision 2.0  1995/02/27  11:32:41  john
18446  * New version 2.0, which has no anonymous unions, builds with
18447  * Watcom 10.0, and doesn't require parsing BITMAPS.TBL.
18448  *
18449  * Revision 1.8  1994/09/25  23:40:52  matt
18450  * Changed the object load & save code to read/write the structure fields one
18451  * at a time (rather than the whole structure at once).  This mean that the
18452  * object structure can be changed without breaking the load/save functions.
18453  * As a result of this change, the local_object data can be and has been
18454  * incorporated into the object array.  Also, timeleft is now a property
18455  * of all objects, and the object structure has been otherwise cleaned up.
18456  *
18457  * Revision 1.7  1994/09/25  15:45:26  matt
18458  * Added OBJ_LIGHT, a type of object that casts light
18459  * Added generalized lifeleft, and moved it to local_object
18460  *
18461  * Revision 1.6  1994/09/09  20:05:57  mike
18462  * Add vclips for weapons.
18463  *
18464  * Revision 1.5  1994/06/14  21:14:35  matt
18465  * Made rod objects draw lighted or not depending on a parameter, so the
18466  * materialization effect no longer darkens.
18467  *
18468  * Revision 1.4  1994/06/08  18:16:24  john
18469  * Bunch of new stuff that basically takes constants out of the code
18470  * and puts them into bitmaps.tbl.
18471  *
18472  * Revision 1.3  1994/06/03  10:47:17  matt
18473  * Made vclips (used by explosions) which can be either rods or blobs, as
18474  * specified in BITMAPS.TBL.  (This is for the materialization center effect).
18475  *
18476  * Revision 1.2  1994/05/11  09:25:25  john
18477  * Abandoned new vclip system for now because each wallclip, vclip,
18478  * etc, is different and it would be a huge pain to change all of them.
18479  *
18480  * Revision 1.1  1994/05/10  15:21:12  john
18481  * Initial revision
18482
18483 ------------------------------------------------------------------------
18484 main/vclip.h:
18485
18486  * Revision 1.2  1995/09/14  14:14:45  allender
18487  * return void in draw_vclip_object
18488  *
18489  * Revision 1.1  1995/05/16  16:04:35  allender
18490  * Initial revision
18491  *
18492  * Revision 2.0  1995/02/27  11:32:42  john
18493  * New version 2.0, which has no anonymous unions, builds with
18494  * Watcom 10.0, and doesn't require parsing BITMAPS.TBL.
18495  *
18496  * Revision 1.33  1994/11/21  11:17:57  adam
18497  * *** empty log message ***
18498  *
18499  * Revision 1.32  1994/10/12  13:07:07  mike
18500  * Add VCLIP_POWERUP_DISAPPEARANCE.
18501  *
18502  * Revision 1.31  1994/10/12  10:23:54  adam
18503  * *** empty log message ***
18504  *
18505  * Revision 1.30  1994/10/11  12:25:21  matt
18506  * Added "hot rocks" that create badass explosion when hit by weapons
18507  *
18508  * Revision 1.29  1994/10/06  14:10:07  matt
18509  * Added constant for player appearence effect
18510  *
18511  * Revision 1.28  1994/09/26  08:40:30  adam
18512  * *** empty log message ***
18513  *
18514  * Revision 1.27  1994/09/10  17:30:57  mike
18515  * move a prototype here, had been defined in object.c
18516  *
18517  * Revision 1.26  1994/09/09  20:04:25  mike
18518  * Add weapon_vclip.
18519  *
18520  * Revision 1.25  1994/08/31  19:27:09  mike
18521  * Increase max number of Vclips for new pile of weapon powerups.
18522  *
18523  * Revision 1.24  1994/08/14  23:14:43  matt
18524  * Added animating bitmap hostages, and cleaned up vclips a bit
18525  *
18526  * Revision 1.23  1994/07/23  19:56:39  matt
18527  * Took out unused constant
18528  *
18529  * Revision 1.22  1994/07/22  10:42:10  adam
18530  * upped max no. of vclips
18531  *
18532  * Revision 1.21  1994/06/14  21:15:14  matt
18533  * Made rod objects draw lighted or not depending on a parameter, so the
18534  * materialization effect no longer darkens.
18535  *
18536  * Revision 1.20  1994/06/09  19:38:16  john
18537  * Made each Vclip have its own sound... but only used in the
18538  * materialization center.
18539  *
18540  * Revision 1.19  1994/06/09  11:46:26  john
18541  * Took out unused vclip defines.
18542  *
18543  * Revision 1.18  1994/06/08  18:16:33  john
18544  * Bunch of new stuff that basically takes constants out of the code
18545  * and puts them into bitmaps.tbl.
18546  *
18547  * Revision 1.17  1994/06/08  12:49:01  mike
18548  * Add light_value to vclip.
18549  *
18550  * Revision 1.16  1994/06/08  11:43:28  mike
18551  * Allow 20 vclips, I think (anyway, more than it used to be, probably 12).
18552  *
18553  * Revision 1.15  1994/06/03  10:48:22  matt
18554  * Made vclips (used by explosions) which can be either rods or blobs, as
18555  * specified in BITMAPS.TBL.  (This is for the materialization center effect).
18556  *
18557  * Revision 1.14  1994/06/01  17:21:08  john
18558  * Added muzzle flash
18559  *
18560  * Revision 1.13  1994/06/01  10:34:02  john
18561  * Added robot morphing effect.
18562  *
18563  * Revision 1.12  1994/05/16  16:17:38  john
18564  * Bunch of stuff on my Inferno Task list May16-23
18565  *
18566  * Revision 1.11  1994/05/10  18:32:50  john
18567  * *** empty log message ***
18568  *
18569  * Revision 1.10  1994/04/29  14:35:52  matt
18570  * Added second kind of fireball
18571  *
18572  * Revision 1.9  1994/04/11  10:36:31  yuan
18573  * Started adding types for exploding hostages.
18574  *
18575  * Revision 1.8  1994/04/07  16:27:43  yuan
18576  * Added SUPERPIG the robot with 200 hit points.
18577  * Now robots can take multiple hits before blowing up.
18578  *
18579  * Revision 1.7  1994/04/07  13:45:58  yuan
18580  * Defined Pclips... maybe shouldn't be in this file.
18581  *
18582  * Revision 1.6  1994/03/28  20:58:22  yuan
18583  * Added blood vclip constant
18584  *
18585  * Revision 1.5  1994/03/15  16:31:56  yuan
18586  * Cleaned up bm-loading code.
18587  * (And structures)
18588  *
18589  * Revision 1.4  1994/03/04  17:09:43  yuan
18590  * New wall stuff
18591  *
18592  * Revision 1.3  1994/01/11  10:59:01  yuan
18593  * Added effects
18594  *
18595  * Revision 1.2  1994/01/06  17:13:15  john
18596  * Added Video clip functionality
18597  *
18598  * Revision 1.1  1994/01/06  15:10:15  john
18599  * Initial revision
18600
18601 ------------------------------------------------------------------------
18602 main/wall.c:
18603
18604  * Revision 1.1  1995/05/16  15:32:08  allender
18605  * Initial revision
18606  *
18607  * Revision 2.1  1995/03/21  14:39:04  john
18608  * Ifdef'd out the NETWORK code.
18609  *
18610  * Revision 2.0  1995/02/27  11:28:32  john
18611  * New version 2.0, which has no anonymous unions, builds with
18612  * Watcom 10.0, and doesn't require parsing BITMAPS.TBL.
18613  *
18614  * Revision 1.112  1995/02/22  13:53:07  allender
18615  * remove anonymous unions from object structure
18616  *
18617  * Revision 1.111  1995/02/01  17:32:17  adam
18618  * Took out a bogus int3.
18619  *
18620  * Revision 1.110  1995/02/01  17:20:24  john
18621  * Lintized.
18622  *
18623  * Revision 1.109  1995/01/21  17:39:50  matt
18624  * Cleaned up laser/player hit wall confusions
18625  *
18626  * Revision 1.108  1995/01/21  17:14:17  rob
18627  * Fixed bug in multiplayer door-butting.
18628  *
18629  * Revision 1.107  1995/01/18  18:57:11  rob
18630  * Added new hostage door hooks.
18631  *
18632  * Revision 1.106  1995/01/18  18:48:18  allender
18633  * removed #ifdef newdemo's.  Added function call to record a door that
18634  * starts to open. This fixes the rewind problem
18635  *
18636  * Revision 1.105  1995/01/16  11:55:39  mike
18637  * make control center (and robots whose id == your playernum) not able to open doors.
18638  *
18639  * Revision 1.104  1994/12/11  23:07:21  matt
18640  * Fixed stuck objects & blastable walls
18641  *
18642  * Revision 1.103  1994/12/10  16:44:34  matt
18643  * Added debugging code to track down door that turns into rock
18644  *
18645  * Revision 1.102  1994/12/06  16:27:05  matt
18646  * Added debugging
18647  *
18648  * Revision 1.101  1994/12/02  10:50:27  yuan
18649  * Localization
18650  *
18651  * Revision 1.100  1994/11/30  19:41:22  rob
18652  * Put in a fix so that door opening sounds travel through the door.
18653  *
18654  * Revision 1.99  1994/11/28  11:59:50  yuan
18655  * *** empty log message ***
18656  *
18657  * Revision 1.98  1994/11/28  11:25:45  matt
18658  * Cleaned up key hud messages
18659  *
18660  * Revision 1.97  1994/11/27  23:15:11  matt
18661  * Made changes for new mprintf calling convention
18662  *
18663  * Revision 1.96  1994/11/19  15:18:29  mike
18664  * rip out unused code and data.
18665  *
18666  * Revision 1.95  1994/11/17  14:57:12  mike
18667  * moved segment validation functions from editor to main.
18668  *
18669  * Revision 1.94  1994/11/07  08:47:30  john
18670  * Made wall state record.
18671  *
18672  * Revision 1.93  1994/11/04  16:06:37  rob
18673  * Fixed network damage of blastable walls.
18674  *
18675  * Revision 1.92  1994/11/02  21:54:01  matt
18676  * Don't let objects with zero size keep door from shutting
18677  *
18678  * Revision 1.91  1994/10/31  13:48:42  rob
18679  * Fixed bug in opening doors over network/modem.  Added a new message
18680  * type to multi.c that communicates door openings across the net.
18681  * Changed includes in multi.c and wall.c to accomplish this.
18682  *
18683  * Revision 1.90  1994/10/28  14:42:41  john
18684  * Added sound volumes to all sound calls.
18685  *
18686  * Revision 1.89  1994/10/23  19:16:55  matt
18687  * Fixed bug with "no key" messages
18688
18689 ------------------------------------------------------------------------
18690 main/wall.h:
18691
18692  * Revision 1.1  1995/05/16  16:05:14  allender
18693  * Initial revision
18694  *
18695  * Revision 2.0  1995/02/27  11:31:36  john
18696  * New version 2.0, which has no anonymous unions, builds with
18697  * Watcom 10.0, and doesn't require parsing BITMAPS.TBL.
18698  *
18699  * Revision 1.47  1994/11/19  15:20:35  mike
18700  * rip out unused code and data
18701  *
18702  * Revision 1.46  1994/10/25  15:40:12  yuan
18703  * MAX_WALLS pumped up
18704  *
18705  * Revision 1.45  1994/10/23  19:17:07  matt
18706  * Fixed bug with "no key" messages
18707  *
18708  * Revision 1.44  1994/10/18  15:38:03  mike
18709  * Define hidden walls.
18710  *
18711  * Revision 1.43  1994/10/04  13:32:26  adam
18712  * commented out MAX_DOOR_ANIMS
18713  *
18714  * Revision 1.42  1994/10/04  13:31:21  adam
18715  * upped MAX_WALL_ANIMS to 30
18716  *
18717  * Revision 1.41  1994/09/29  00:42:30  matt
18718  * Made hitting a locked door play a sound
18719  *
18720  * Revision 1.40  1994/09/27  15:42:41  mike
18721  * Prototype Wall_names.
18722  *
18723  * Revision 1.39  1994/09/23  22:15:32  matt
18724  * Made doors not close on objects, made doors open again if shot while
18725  * closing, and cleaned up walls/doors a bit.
18726  *
18727  * Revision 1.38  1994/09/22  15:31:33  matt
18728  * Mucked with, and hopefully improved, exploding walls
18729  *
18730  * Revision 1.37  1994/09/21  17:17:05  mike
18731  * Make objects stuck in doors go away when door opens.
18732  *
18733  * Revision 1.36  1994/09/13  21:10:46  matt
18734  * Added wclips that use tmap1 instead of tmap2, saving lots of merging
18735  *
18736  * Revision 1.35  1994/09/13  20:11:08  yuan
18737  * *** empty log message ***
18738  *
18739  * Revision 1.34  1994/09/10  13:31:53  matt
18740  * Made exploding walls a type of blastable walls.
18741  * Cleaned up blastable walls, making them tmap2 bitmaps.
18742  *
18743  * Revision 1.33  1994/08/17  12:55:34  matt
18744  * Added external walls to wall_is_doorway
18745  *
18746  * Revision 1.32  1994/08/15  17:54:35  john
18747  * *** empty log message ***
18748  *
18749  * Revision 1.31  1994/08/15  17:46:56  yuan
18750  * Added external walls, fixed blastable walls.
18751  *
18752  * Revision 1.30  1994/08/05  21:17:21  matt
18753  * Allow two doors to be linked together
18754  *
18755  * Revision 1.29  1994/08/01  10:39:10  matt
18756  * Parenthesized parms to WID() macro
18757  *
18758  * Revision 1.28  1994/07/20  17:35:03  yuan
18759  * Some minor bug fixes and new key gauges...
18760  *
18761  * Revision 1.27  1994/07/19  14:32:03  yuan
18762  * Fixed keys bug... renumbered some constants.
18763  *
18764  * Revision 1.26  1994/07/14  22:38:29  matt
18765  * Added exploding doors
18766  *
18767  * Revision 1.25  1994/07/11  15:08:43  yuan
18768  * Wall anim file names stored in structure.
18769
18770 ------------------------------------------------------------------------
18771 main/weapon.c:
18772
18773  * Revision 1.2  1995/10/31  10:17:39  allender
18774  * new shareware stuff
18775  *
18776  * Revision 1.1  1995/05/16  15:32:16  allender
18777  * Initial revision
18778  *
18779  * Revision 2.1  1995/03/21  14:38:43  john
18780  * Ifdef'd out the NETWORK code.
18781  *
18782  * Revision 2.0  1995/02/27  11:27:25  john
18783  * New version 2.0, which has no anonymous unions, builds with
18784  * Watcom 10.0, and doesn't require parsing BITMAPS.TBL.
18785  *
18786  * Revision 1.54  1995/02/15  15:21:48  mike
18787  * make smart missile select if mega missiles used up.
18788  *
18789  *
18790  * Revision 1.53  1995/02/12  02:12:30  john
18791  * Fixed bug with state restore making weapon beeps.
18792  *
18793  * Revision 1.52  1995/02/09  20:42:15  mike
18794  * change weapon autoselect, always autoselect smart, mega.
18795  *
18796  * Revision 1.51  1995/02/07  20:44:26  mike
18797  * autoselect mega, smart when you pick them up.
18798  *
18799  * Revision 1.50  1995/02/07  13:32:25  rob
18800  * Added include of multi.h
18801  *
18802  * Revision 1.49  1995/02/07  13:21:33  yuan
18803  * Fixed 2nd typo
18804  *
18805  * Revision 1.48  1995/02/07  13:16:39  yuan
18806  * Fixed typo.
18807  *
18808  * Revision 1.47  1995/02/07  12:53:12  rob
18809  * Added network sound prop. to weapon switch.
18810  *
18811  * Revision 1.46  1995/02/06  15:53:17  mike
18812  * don't autoselect smart or mega missile when you pick it up.
18813  *
18814  * Revision 1.45  1995/02/02  21:43:34  mike
18815  * make autoselection better.
18816  *
18817  * Revision 1.44  1995/02/02  16:27:21  mike
18818  * make concussion missiles trade up.
18819  *
18820  * Revision 1.43  1995/02/01  23:34:57  adam
18821  * messed with weapon change sounds
18822  *
18823  * Revision 1.42  1995/02/01  17:12:47  mike
18824  * Make smart missile, mega missile not auto-select.
18825  *
18826  * Revision 1.41  1995/02/01  15:50:54  mike
18827  * fix bogus weapon selection sound code.
18828  *
18829  * Revision 1.40  1995/01/31  16:16:31  mike
18830  * Separate smart blobs for robot and player.
18831  *
18832  * Revision 1.39  1995/01/30  21:12:11  mike
18833  * Use new weapon selection sounds, different for primary and secondary.
18834  *
18835  * Revision 1.38  1995/01/29  13:46:52  mike
18836  * Don't auto-select fusion cannon when you run out of energy.
18837  *
18838  * Revision 1.37  1995/01/20  11:11:13  allender
18839  * record weapon changes again.  (John somehow lost my 1.35 changes).
18840  *
18841  * Revision 1.36  1995/01/19  17:00:46  john
18842  * Made save game work between levels.
18843  *
18844  * Revision 1.34  1995/01/09  17:03:48  mike
18845  * fix autoselection of weapons.
18846  *
18847  * Revision 1.33  1995/01/05  15:46:31  john
18848  * Made weapons not rearm when starting a saved game.
18849  *
18850  * Revision 1.32  1995/01/03  12:34:23  mike
18851  * autoselect next lower weapon if run out of smart or mega missile.
18852  *
18853  * Revision 1.31  1994/12/12  21:39:37  matt
18854  * Changed vulcan ammo: 10K max, 5K w/weapon, 1250 per powerup
18855  *
18856  * Revision 1.30  1994/12/09  19:55:04  matt
18857  * Added weapon name in "not available in shareware" message
18858  *
18859  * Revision 1.29  1994/12/06  13:50:24  adam
18860  * added shareware msg. when choosing 4 top weapons
18861  *
18862  * Revision 1.28  1994/12/02  22:07:13  mike
18863  * if you gots 19 concussion missiles and you runs over 4, say you picks up 1, not 4, we do the math, see?
18864  *
18865  * Revision 1.27  1994/12/02  20:06:24  matt
18866  * Made vulcan ammo print at approx 25 times actual
18867  *
18868  * Revision 1.26  1994/12/02  15:05:03  matt
18869  * Fixed bogus weapon constants and arrays
18870  *
18871  * Revision 1.25  1994/12/02  10:50:34  yuan
18872  * Localization
18873  *
18874  * Revision 1.24  1994/11/29  15:48:28  matt
18875  * selecting weapon now makes sound
18876  *
18877  * Revision 1.23  1994/11/28  11:26:58  matt
18878  * Cleaned up hud message printing for picking up weapons
18879  *
18880  * Revision 1.22  1994/11/27  23:13:39  matt
18881  * Made changes for new mprintf calling convention
18882  *
18883  * Revision 1.21  1994/11/12  16:38:34  mike
18884  * clean up default ammo stuff.
18885  *
18886  * Revision 1.20  1994/11/07  17:41:18  mike
18887  * messages for when you try to fire a weapon you don't have or don't have ammo for.
18888  *
18889  * Revision 1.19  1994/10/21  20:40:05  mike
18890  * fix double vulcan ammo.
18891  *
18892  * Revision 1.18  1994/10/20  09:49:05  mike
18893  * kill messages no one liked...*sniff* *sniff*
18894  *
18895  * Revision 1.17  1994/10/19  11:17:07  mike
18896  * Limit amount of player ammo.
18897  *
18898  * Revision 1.16  1994/10/12  08:04:18  mike
18899  * Fix proximity/homing confusion.
18900  *
18901  * Revision 1.15  1994/10/11  18:27:58  matt
18902  * Changed auto selection of secondary weapons
18903  *
18904  * Revision 1.14  1994/10/08  23:37:54  matt
18905  * Don't pick up weapons you already have; also fixed auto_select bug
18906  * for seconary weapons
18907  *
18908  * Revision 1.13  1994/10/08  14:55:47  matt
18909  * Fixed bug that selected vulcan cannon when picked up ammo, even though
18910  * you didn't have the weapon.
18911  *
18912  * Revision 1.12  1994/10/08  12:50:32  matt
18913  * Fixed bug that let you select weapons you don't have
18914  *
18915  * Revision 1.11  1994/10/07  23:37:56  matt
18916  * Made weapons select when pick up better one
18917  *
18918  * Revision 1.10  1994/10/07  16:02:08  matt
18919  * Fixed problem with weapon auto-select
18920  *
18921  * Revision 1.9  1994/10/05  17:00:20  matt
18922  * Made player_has_weapon() public and moved constants to header file
18923  *
18924  * Revision 1.8  1994/09/26  11:27:13  mike
18925  * Fix auto selection of weapon when you run out of ammo.
18926  *
18927  * Revision 1.7  1994/09/13  16:40:45  mike
18928  * Add rearm delay and missile firing delay.
18929  *
18930  * Revision 1.6  1994/09/13  14:43:12  matt
18931  * Added cockpit weapon displays
18932  *
18933  * Revision 1.5  1994/09/03  15:23:06  mike
18934  * Auto select next weaker weapon when one runs out, clean up code.
18935  *
18936  * Revision 1.4  1994/09/02  16:38:19  mike
18937  * Eliminate a pile of arrays, associate weapon data with Weapon_info.
18938  *
18939  * Revision 1.3  1994/09/02  11:57:10  mike
18940  * Add a bunch of stuff, I forget what.
18941  *
18942  * Revision 1.2  1994/06/03  16:26:32  john
18943  * Initial version.
18944  *
18945  * Revision 1.1  1994/06/03  14:40:43  john
18946  * Initial revision
18947
18948 ------------------------------------------------------------------------
18949 main/weapon.h:
18950
18951  * Revision 1.2  1995/09/14  14:07:10  allender
18952  * fixed prototypes to have return value
18953  *
18954  * Revision 1.1  1995/05/16  16:05:22  allender
18955  * Initial revision
18956  *
18957  * Revision 2.0  1995/02/27  11:31:10  john
18958  * New version 2.0, which has no anonymous unions, builds with
18959  * Watcom 10.0, and doesn't require parsing BITMAPS.TBL.
18960  *
18961  * Revision 1.44  1995/01/30  17:14:18  mike
18962  * halve rate of vulcan ammo consumption.
18963  *
18964  * Revision 1.43  1995/01/19  17:45:04  mike
18965  * damage_force removed, that information coming from strength field.
18966  *
18967  * Revision 1.42  1995/01/05  15:46:11  john
18968  * Made weapons not rearm when starting a saved game.
18969  *
18970  * Revision 1.41  1995/01/04  12:20:27  john
18971  * Declearations to work better with game state save.
18972  *
18973  *
18974  * Revision 1.40  1994/12/13  12:54:16  mike
18975  * fix proximity, homing flags, backwards!
18976  *
18977  * Revision 1.39  1994/12/11  16:17:57  mike
18978  * change default weapon life so shots from ctrlcen on level 6 won't evaporate before they hit you.
18979  *
18980  * Revision 1.38  1994/12/09  19:55:26  matt
18981  * Added weapon name in "not available in shareware" message
18982  *
18983  * Revision 1.37  1994/12/07  12:55:27  mike
18984  * tweak vulcan amounts.
18985  *
18986  * Revision 1.36  1994/12/03  19:03:56  matt
18987  * Fixed vulcan ammo HUD message
18988  *
18989  * Revision 1.35  1994/12/02  15:05:02  matt
18990  * Fixed bogus weapon constants and arrays
18991  *
18992  * Revision 1.34  1994/11/29  14:26:05  john
18993  * Again.
18994  *
18995  * Revision 1.33  1994/11/29  14:13:47  adam
18996  * Changed the byte flash sound to short.
18997  *
18998  * Revision 1.32  1994/11/12  16:36:55  mike
18999  * default ammo stuff.
19000  *
19001  * Revision 1.31  1994/10/21  10:55:24  adam
19002  * upped MAX_WEAPON_TYPES to 30
19003  *
19004  * Revision 1.30  1994/10/19  11:16:37  mike
19005  * Limit ammo amounts.
19006  *
19007  * Revision 1.29  1994/10/12  08:05:04  mike
19008  * Clean up homing/proximity mess.
19009  *
19010  * Revision 1.28  1994/10/08  23:37:53  matt
19011  * Don't pick up weapons you already have; also fixed auto_select bug
19012  * for seconary weapons
19013  *
19014  * Revision 1.27  1994/10/07  23:37:56  matt
19015  * Made weapons select when pick up better one
19016  *
19017  * Revision 1.26  1994/10/07  16:02:17  matt
19018  * Fixed problem with weapon auto-select
19019  *
19020  * Revision 1.25  1994/10/05  17:07:44  matt
19021  * Made player_has_weapon() public and moved constants to header file
19022  *
19023  * Revision 1.24  1994/09/30  21:50:49  mike
19024  * Add homing_flag and 3 dummy bytes to weapon_info.
19025  *
19026  * Revision 1.23  1994/09/30  13:47:41  mike
19027  * Make speed and strength be difficulty level based.
19028  *
19029  * Revision 1.22  1994/09/20  16:10:13  mike
19030  * Prototype Primary_weapon_names and Secondary_weapon_names.
19031  *
19032  * Revision 1.21  1994/09/20  12:17:21  adam
19033  * upped weapon types
19034  *
19035  * Revision 1.20  1994/09/13  16:40:29  mike
19036  * Define REARM_TIME -- time it takes until you can fire a newly armed weapon.
19037  *
19038  * Revision 1.19  1994/09/13  14:43:03  matt
19039  * Added cockpit weapon displays
19040  *
19041  * Revision 1.18  1994/09/11  15:50:34  mike
19042  * Add matter and bounce to weapon_info.
19043  *
19044  * Revision 1.17  1994/09/10  17:32:17  mike
19045  * Add thrust to weapon_info.
19046  *
19047  * Revision 1.16  1994/09/09  20:04:54  mike
19048  * Add vclips for weapons.
19049  *
19050  * Revision 1.15  1994/09/07  15:59:14  mike
19051  * Add default lifetimes to weapons, destroyable, lifetime, damage_radius, damage_force fields to weapons.
19052  *
19053  * Revision 1.14  1994/09/03  15:18:06  mike
19054  * Add prototype for auto_select_weapon.
19055  *
19056  * Revision 1.13  1994/09/02  16:38:33  mike
19057  * Move data from global arrays to Weapon_info.
19058  *
19059  * Revision 1.12  1994/09/02  11:54:59  mike
19060  * Add a whole slew of constants for the whole slew of new weapons.
19061  *
19062  * Revision 1.11  1994/08/23  16:39:15  mike
19063  * Add light to weapon struct
19064
19065 ------------------------------------------------------------------------
19066 maths/fixc.c:
19067
19068  * Revision 1.7  1995/09/22  14:08:16  allender
19069  * fixed fix_atan2 to work correctly with doubles
19070  *
19071  * Revision 1.6  1995/08/31  15:43:49  allender
19072  * *** empty log message ***
19073  *
19074  * Revision 1.5  1995/07/05  16:15:15  allender
19075  * make fixmuldiv use doubles for PPC implementation
19076  *
19077  * Revision 1.4  1995/05/15  13:57:36  allender
19078  * make fixmuldiv compile when compiling under 68k
19079  *
19080  * Revision 1.3  1995/05/11  13:02:59  allender
19081  * some routines are now in assembly
19082  *
19083  * Revision 1.2  1995/05/04  20:04:45  allender
19084  * use MPW fixdiv if compiling with MPW (why did I do this?)
19085  *
19086  * Revision 1.1  1995/04/17  11:37:54  allender
19087  * Initial revision
19088  *
19089  *
19090  * --- PC RCS Info ---
19091  * Revision 1.1  1995/03/08  18:55:09  matt
19092  * Initial revision
19093
19094 ------------------------------------------------------------------------
19095 maths/tables.c:
19096
19097  * Revision 1.2  1995/08/31  15:44:36  allender
19098  * ..
19099  *
19100  * Revision 1.1  1995/04/17  11:38:04  allender
19101  * Initial revision
19102
19103 ------------------------------------------------------------------------
19104 maths/vecmat.c:
19105
19106  * Revision 1.5  1995/10/30  11:08:16  allender
19107  * fix check_vec to return if vector is the NULL vector
19108  *
19109  * Revision 1.4  1995/09/23  09:38:14  allender
19110  * removed calls for PPC that are now handled in asm
19111  *
19112  * Revision 1.3  1995/08/31  15:50:24  allender
19113  * fixing up of functions for PPC
19114  *
19115  * Revision 1.2  1995/07/05  16:40:21  allender
19116  * some vecmat stuff might be using isqrt -- commented out
19117  * for now
19118  *
19119  * Revision 1.1  1995/04/17  16:18:02  allender
19120  * Initial revision
19121  *
19122  *
19123  * --- PC RCS Information ---
19124  * Revision 1.1  1995/03/08  15:56:50  matt
19125  * Initial revision
19126
19127 ------------------------------------------------------------------------
19128 maths/vecmata.asm:
19129
19130 ; Revision 1.54  1995/01/31  00:14:50  matt
19131 ; Took out int3 from dotprod overflow, since it saturates now
19132 ;
19133 ; Revision 1.53  1994/12/14  18:29:33  matt
19134 ; Made dotprod overflow check stay in, and return saturated value
19135 ;
19136 ; Revision 1.52  1994/12/14  12:34:13  matt
19137 ; Disabled now-unused vector_2_matrix_norm()
19138 ;
19139 ; Revision 1.51  1994/12/13  16:55:13  matt
19140 ; Ripped out optimization from last version, which was bogus
19141 ;
19142 ; Revision 1.50  1994/12/13  14:55:18  matt
19143 ; Use quick normalize in a couple of places where it was safe to do so
19144 ;
19145 ; Revision 1.49  1994/12/13  14:44:12  matt
19146 ; Added vm_vector_2_matrix_norm()
19147 ;
19148 ; Revision 1.48  1994/12/13  13:26:49  matt
19149 ; Fixed overflow check
19150 ;
19151 ; Revision 1.47  1994/12/03  15:39:54  matt
19152 ; Gracefully handle some vector_2_matrix problems
19153 ;
19154 ; Revision 1.46  1994/11/19  17:15:05  matt
19155 ; Assemble out some code not used in DESCENT
19156 ;
19157 ; Revision 1.45  1994/11/17  11:41:05  matt
19158 ; Put handling in extract_angles_from_matrix to deal with bad matrices
19159 ;
19160 ; Revision 1.44  1994/11/16  11:48:10  matt
19161 ; Added error checking to vm_extract_angles_matrix()
19162 ;
19163 ; Revision 1.43  1994/09/19  22:00:10  matt
19164 ; Fixed register trash
19165 ;
19166 ; Revision 1.42  1994/09/11  19:23:05  matt
19167 ; Added vm_vec_normalized_dir_quick()
19168 ;
19169 ; Revision 1.41  1994/08/14  13:28:38  matt
19170 ; Put in check for zero-length vector in extract angles
19171 ;
19172 ; Revision 1.40  1994/07/19  18:52:53  matt
19173 ; Added vm_vec_normalize_quick() and vm_vec_copy_normalize_quick()
19174 ;
19175 ; Revision 1.39  1994/06/16  18:24:22  matt
19176 ; Added vm_vec_mag_quick()
19177 ;
19178 ; Revision 1.38  1994/06/10  23:18:38  matt
19179 ; Added new code for vm_vec_ang_2_matrix() which may be better, but may
19180 ; not be.
19181 ;
19182 ; Revision 1.37  1994/05/22  18:17:29  mike
19183 ; Optimize vm_vec_dist_quick, using jns in place of abs_eax.
19184 ;
19185 ; Revision 1.36  1994/05/19  12:07:04  matt
19186 ; Fixed globals and macros and added a constant
19187 ;
19188 ; Revision 1.35  1994/05/19  09:19:00  matt
19189 ; Made vm_vec_normalized_dir() return mag of vector
19190 ;
19191 ; Revision 1.34  1994/05/18  22:28:01  matt
19192 ; Added function vm_vec_normalized_dir()
19193 ; Added C macros IS_ZERO_VEC(), vm_vec_zero(), and vm_set_identity()
19194 ; Added C global static vars vmd_zero_vector & vmd_identity_matrix
19195 ;
19196 ; Revision 1.33  1994/05/18  21:44:16  matt
19197 ; Added functions:
19198 ;   vm_extract_angles_vector()
19199 ;   vm_extract_angles_vector_normalized()
19200 ;   vm_vec_copy_normalize()
19201 ;
19202 ; Revision 1.32  1994/05/13  12:41:51  matt
19203 ; Added new function, vm_vec_dist_quick(), which does an approximation.
19204 ;
19205 ; Revision 1.31  1994/05/04  17:41:31  mike
19206 ; Comment out debug_brk on null vector.
19207 ;
19208 ; Revision 1.30  1994/04/15  21:41:31  matt
19209 ; Check for foward vector straigt up in extract angles routine
19210 ;
19211 ; Revision 1.29  1994/03/30  15:45:05  matt
19212 ; Added two functions, vm_vec_scale_add() & vm_vec_scale_add2()
19213 ;
19214 ; Revision 1.28  1994/02/26  19:23:35  matt
19215 ; Do an int3 when we get a null vector when computing surface normal
19216 ;
19217 ; Revision 1.27  1994/02/10  18:29:45  matt
19218 ; Changed 'if DEBUG_ON' to 'ifndef NDEBUG'
19219 ;
19220 ; Revision 1.26  1994/02/10  18:28:55  matt
19221 ; Fixed bugs in extract angles function
19222 ;
19223 ; Revision 1.25  1994/01/31  22:46:07  matt
19224 ; Added vm_extract_angles_matrix() function
19225 ;
19226 ; Revision 1.24  1994/01/30  19:29:55  matt
19227 ; Put in debug_brk when vm_vec_2_matrix got zero-length vector
19228 ;
19229 ; Revision 1.23  1994/01/25  15:27:59  matt
19230 ; Added debugging check for dotprod overflow
19231 ;
19232 ; Revision 1.22  1994/01/24  11:52:59  matt
19233 ; Added checking for dest==src for several functions where this is not allowed
19234 ;
19235 ; Revision 1.21  1994/01/19  23:13:02  matt
19236 ; Fixed bug in vm_vec_ang_2_matrix()
19237 ;
19238 ; Revision 1.20  1994/01/04  12:33:43  mike
19239 ; Prevent divide overflow in vm_vec_scale2
19240 ;
19241 ; Revision 1.19  1993/12/21  19:46:26  matt
19242 ; Added function vm_dist_to_plane()
19243 ;
19244 ; Revision 1.18  1993/12/13  17:26:23  matt
19245 ; Added vm_vec_dist()
19246 ;
19247 ; Revision 1.17  1993/12/02  12:43:39  matt
19248 ; New functions: vm_vec_copy_scale(), vm_vec_scale2()
19249 ;
19250 ; Revision 1.16  1993/10/29  22:39:29  matt
19251 ; Changed matrix order, making direction vectors the rows
19252 ;
19253 ; Revision 1.15  1993/10/29  18:06:01  matt
19254 ; Fixed vm_vector_2_matrix() bug when forward vector was straight down
19255 ;
19256 ; Revision 1.14  1993/10/26  18:51:26  matt
19257 ; Fixed some register trashes in vm_vec_ang_2_matrix()
19258 ;
19259 ; Revision 1.13  1993/10/25  11:49:37  matt
19260 ; Made vm_vec_delta_ang() take optional forward vector to return signed delta
19261 ;
19262 ; Revision 1.12  1993/10/20  01:09:42  matt
19263 ; Added vm_vec_delta_ang(), vm_vec_delta_ang_norm(), and vm_vec_ang_2_matrix()
19264 ;
19265 ; Revision 1.11  1993/10/17  17:03:08  matt
19266 ; vm_vector_2_matrix() now takes optional right vector
19267 ;
19268 ; Revision 1.10  1993/10/10  18:11:42  matt
19269 ; Changed angles_2_matrix so that heading & bank rotate in the
19270 ; correct directions.
19271 ;
19272 ; Revision 1.9  1993/09/30  16:17:59  matt
19273 ; Fixed bug in vector_2_matrix() by adding another normalize
19274 ;
19275 ; Revision 1.8  1993/09/29  10:51:58  matt
19276 ; Fixed bad register trashes in crossprod, perp, & normal
19277 ;
19278 ; Revision 1.7  1993/09/28  12:16:46  matt
19279 ; Fixed bugs in cross product
19280 ; Added func vm_vector_2_matrix()
19281 ;
19282 ; Revision 1.6  1993/09/24  21:19:37  matt
19283 ; Added vm_vec_avg() and vm_vec_avg4()
19284 ;
19285 ; Revision 1.5  1993/09/20  18:15:07  matt
19286 ; Trap zero-length vectors in vm_vec_normalize(), vm_vec_perp(), and vm_vec_normal()
19287 ;
19288 ; Revision 1.4  1993/09/20  14:56:43  matt
19289 ; Fixed bug in vm_vec_normal(), made that routine normalize the results,
19290 ; and added new function vm_vec_perp().
19291 ;
19292 ; Revision 1.3  1993/09/20  10:12:06  mike
19293 ; no changes
19294 ;
19295 ; Revision 1.2  1993/09/17  11:10:33  matt
19296 ; Added vm_vec_add2() and vm_vec_sub2(), which take 2 args (dest==src0)
19297 ;
19298 ; Revision 1.1  1993/09/16  20:10:24  matt
19299 ; Initial revision
19300
19301 ------------------------------------------------------------------------
19302 misc/args.c:
19303
19304  * Revision 2.0  1995/02/27  11:31:22  john
19305  * New version 2.0, which has no anonymous unions, builds with
19306  * Watcom 10.0, and doesn't require parsing BITMAPS.TBL.
19307  *
19308  * Revision 1.9  1994/11/29  01:07:57  john
19309  * Took out some unused vars.
19310  *
19311  * Revision 1.8  1994/11/29  01:04:30  john
19312  * Took out descent.ini stuff.
19313  *
19314  * Revision 1.7  1994/09/20  19:29:15  matt
19315  * Made args require exact (not substring), though still case insensitive.
19316  *
19317  * Revision 1.6  1994/07/25  12:33:11  john
19318  * Network "pinging" in.
19319  *
19320  * Revision 1.5  1994/06/17  18:07:50  matt
19321  * Took out printf
19322  *
19323  * Revision 1.4  1994/05/11  19:45:33  john
19324  * *** empty log message ***
19325  *
19326  * Revision 1.3  1994/05/11  18:42:11  john
19327  * Added Descent.ini config file.
19328  *
19329  * Revision 1.2  1994/05/09  17:03:30  john
19330  * Split command line parameters into arg.c and arg.h.
19331  * Also added /dma, /port, /irq to digi.c
19332  *
19333  * Revision 1.1  1994/05/09  16:49:11  john
19334  * Initial revision
19335
19336 ------------------------------------------------------------------------
19337 misc/error.c:
19338
19339  * Revision 1.12  1994/12/07  18:49:39  matt
19340  * error_init() can now take NULL as parm
19341  *
19342  * Revision 1.11  1994/11/29  15:42:07  matt
19343  * Added newline before error message
19344  *
19345  * Revision 1.10  1994/11/27  23:20:39  matt
19346  * Made changes for new mprintf calling convention
19347  *
19348  * Revision 1.9  1994/06/20  21:20:56  matt
19349  * Allow NULL for warn func, to kill warnings
19350  *
19351  * Revision 1.8  1994/05/20  15:11:35  mike
19352  * mprintf Warning message so you can actually see it.
19353  *
19354  * Revision 1.7  1994/02/10  18:02:38  matt
19355  * Changed 'if DEBUG_ON' to 'ifndef NDEBUG'
19356  *
19357  * Revision 1.6  1993/10/17  18:19:10  matt
19358  * If error_init() not called, Error() now prints the error message before
19359  * calling exit()
19360  *
19361  * Revision 1.5  1993/10/14  15:29:11  matt
19362  * Added new function clear_warn_func()
19363  *
19364  * Revision 1.4  1993/10/08  16:17:19  matt
19365  * Made Assert() call function _Assert(), rather to do 'if...' inline.
19366  *
19367  * Revision 1.3  1993/09/28  12:45:25  matt
19368  * Fixed wrong print call, and made Warning() not append a CR to string
19369  *
19370  * Revision 1.2  1993/09/27  11:46:35  matt
19371  * Added function set_warn_func()
19372  *
19373  * Revision 1.1  1993/09/23  20:17:33  matt
19374  * Initial revision
19375
19376 ------------------------------------------------------------------------
19377 texmap/ntmap.c:
19378
19379  * Revision 1.52  1995/03/14  15:13:06  john
19380  * Increased MAX_Y_Pointers to 480.
19381  *
19382  * Revision 1.51  1995/02/23  14:25:09  john
19383  * Added editor tmap.
19384  *
19385  * Revision 1.50  1995/02/20  18:22:58  john
19386  * Put all the externs in the assembly modules into tmap_inc.asm.
19387  * Also, moved all the C versions of the inner loops into a new module,
19388  * scanline.c.
19389  *
19390  * Revision 1.49  1995/02/20  17:09:11  john
19391  * Added code so that you can build the tmapper with no assembly!
19392  *
19393  * Revision 1.48  1995/01/06  11:11:30  mike
19394  * even when not in editor, have 400 lines in texture map scanline table.
19395  *
19396  * Revision 1.47  1994/12/15  16:43:25  matt
19397  * Took out code only needed by editor
19398  *
19399  * Revision 1.46  1994/12/09  22:35:37  mike
19400  * fix bug in before call to asm_tmap_scanline_per causing write of pixel onto past right border onto left.
19401  *
19402  * Revision 1.45  1994/12/06  16:31:06  mike
19403  * fix bug in asm_tmap_scanline_matt interface.
19404  *
19405  * Revision 1.44  1994/12/04  20:37:18  mike
19406  * *** empty log message ***
19407  *
19408  * Revision 1.43  1994/12/02  23:30:04  mike
19409  * optimizations.
19410  *
19411  * Revision 1.42  1994/11/30  00:57:43  mike
19412  * optimizations.
19413  *
19414  * Revision 1.41  1994/11/28  13:34:27  mike
19415  * optimizations.
19416  *
19417  * Revision 1.40  1994/11/28  01:30:01  mike
19418  * kill warning.
19419  *
19420  * Revision 1.39  1994/11/28  01:28:59  mike
19421  * optimizations.
19422  *
19423  * Revision 1.38  1994/11/21  14:08:07  john
19424  * Took out all multiple instead of divide code.
19425  *
19426  * Revision 1.37  1994/11/19  15:21:52  mike
19427  * rip out unused code.
19428  *
19429  * Revision 1.36  1994/11/14  11:42:51  mike
19430  * optimization.
19431  *
19432  * Revision 1.35  1994/11/12  16:41:36  mike
19433  * *** empty log message ***
19434  *
19435  * Revision 1.34  1994/11/10  21:28:41  mike
19436  * remove call to init_interface_vars_to_assembler.
19437  *
19438  * Revision 1.33  1994/11/10  11:08:59  mike
19439  * detail level stuff.
19440  *
19441  * Revision 1.32  1994/11/09  22:55:52  matt
19442  * Added variable Current_seg_depth for detail level optimization
19443  *
19444  * Revision 1.31  1994/11/09  19:57:31  john
19445  * Added texture rle caching.
19446  *
19447  * Revision 1.30  1994/11/09  19:54:48  mike
19448  * Call flat shader if Tmap_flat_flag set.
19449  *
19450  * Revision 1.29  1994/11/02  21:33:31  john
19451  * Added Burger Bill's optimization, ie.. 2 muls per 8 pixels.
19452  *
19453  * Revision 1.28  1994/11/02  11:32:16  john
19454  * Added code for c callable inner loop and code to
19455  * test dividing out z0.
19456  *
19457  * Revision 1.27  1994/10/28  20:54:32  matt
19458  * Added error checking
19459  *
19460  * Revision 1.26  1994/10/25  11:20:20  mike
19461  * fix bug in lighting overflow checking for one scanline tall linear texture maps.
19462  *
19463  * Revision 1.25  1994/08/03  15:40:33  mike
19464  * Prevent divide overflows, decrease occurrence of precision-caused glitches.
19465  *
19466  * Revision 1.24  1994/07/27  09:31:16  mike
19467  * Fix concave texture map problem, decrease occurrence of unimportant int 3.
19468  *
19469  * Revision 1.23  1994/06/17  12:23:31  mike
19470  * Support non-lighted texture maps.
19471  *
19472  * Revision 1.22  1994/06/11  08:10:24  mike
19473  * Fix mysterious hang bug, lighting value was out of range.
19474  *
19475  * Revision 1.21  1994/06/09  16:10:16  mike
19476  * Change SC2000 from constant to variable.
19477
19478 ------------------------------------------------------------------------
19479 texmap/scanline.c:
19480
19481  * Revision 1.2  1995/02/20  18:23:39  john
19482  * Added new module for C versions of inner loops.
19483  *
19484  * Revision 1.1  1995/02/20  17:42:27  john
19485  * Initial revision
19486
19487 ------------------------------------------------------------------------
19488 texmap/scanline.h:
19489
19490  * Revision 1.2  1995/02/20  18:23:40  john
19491  * Added new module for C versions of inner loops.
19492  *
19493  * Revision 1.1  1995/02/20  17:44:16  john
19494  * Initial revision
19495
19496 ------------------------------------------------------------------------
19497 texmap/texmapl.h:
19498
19499  * Revision 1.14  1995/02/20  18:23:02  john
19500  * Put all the externs in the assembly modules into tmap_inc.asm.
19501  * Also, moved all the C versions of the inner loops into a new module,
19502  * scanline.c.
19503  *
19504  * Revision 1.13  1995/02/20  17:09:16  john
19505  * Added code so that you can build the tmapper with no assembly!
19506  *
19507  * Revision 1.12  1994/11/28  13:34:34  mike
19508  * optimizations.
19509  *
19510  * Revision 1.11  1994/11/12  16:41:27  mike
19511  * function prototype.
19512  *
19513  * Revision 1.10  1994/05/24  17:30:00  mike
19514  * Prototype fix_recip, asm_tmap_scanline_lin_v.
19515  *
19516  * Revision 1.9  1994/04/21  15:04:26  mike
19517  * Add prototype for texmapl.h
19518  *
19519  * Revision 1.8  1994/03/31  08:34:53  mike
19520  * *** empty log message ***
19521  *
19522  * Revision 1.7  1994/03/22  20:37:04  mike
19523  * *** empty log message ***
19524  *
19525  * Revision 1.6  1994/03/14  15:43:03  mike
19526  * streamline code.
19527  *
19528  * Revision 1.5  1994/01/31  15:43:18  mike
19529  * window_height, asm_tmap_scanline_lin_sky_v
19530  *
19531  * Revision 1.4  1994/01/21  21:12:27  mike
19532  * Prototype asm_tmap_scanline_lin_sky
19533  *
19534  * Revision 1.3  1994/01/14  14:01:45  mike
19535  * Add a bunch of variables.
19536  *
19537  * Revision 1.2  1993/11/22  10:25:11  mike
19538  * *** empty log message ***
19539  *
19540  * Revision 1.1  1993/09/08  17:29:13  mike
19541  * Initial revision
19542
19543 ------------------------------------------------------------------------
19544 texmap/tmap_flt.asm:
19545
19546 ; Revision 1.10  1995/02/20  18:22:53  john
19547 ; Put all the externs in the assembly modules into tmap_inc.asm.
19548 ; Also, moved all the C versions of the inner loops into a new module,
19549 ; scanline.c.
19550 ;
19551 ; Revision 1.9  1995/02/20  17:08:51  john
19552 ; Added code so that you can build the tmapper with no assembly!
19553 ;
19554 ; Revision 1.8  1994/12/02  23:29:21  mike
19555 ; change jb/ja to jl/jg.
19556 ;
19557 ; Revision 1.7  1994/11/12  16:39:35  mike
19558 ; jae to ja.
19559 ;
19560 ; Revision 1.6  1994/08/09  11:27:53  john
19561 ; Added cthru mode.
19562 ;
19563 ; Revision 1.5  1994/07/08  17:43:11  john
19564 ; Added flat-shaded-zbuffered polygon.
19565 ;
19566 ; Revision 1.4  1994/04/08  16:25:43  mike
19567 ; optimize inner loop of flat shader.
19568 ;
19569 ; Revision 1.3  1994/03/31  08:34:20  mike
19570 ; Optimized (well, speeded-up) inner loop for tmap-based flat shader.
19571 ;
19572 ; Revision 1.2  1993/11/22  10:24:57  mike
19573 ; *** empty log message ***
19574 ;
19575 ; Revision 1.1  1993/09/08  17:29:46  mike
19576 ; Initial revision
19577
19578 ------------------------------------------------------------------------
19579 texmap/tmap_inc.asm:
19580
19581 ; Revision 1.10  1995/02/20  18:22:52  john
19582 ; Put all the externs in the assembly modules into tmap_inc.asm.
19583 ; Also, moved all the C versions of the inner loops into a new module,
19584 ; scanline.c.
19585 ;
19586 ; Revision 1.9  1994/12/02  23:29:45  mike
19587 ; Add y_pointers.
19588 ;
19589 ; Revision 1.8  1994/11/12  16:39:36  mike
19590 ; jae to ja.
19591 ;
19592 ; Revision 1.7  1994/10/26  23:27:39  john
19593 ; Took out references to gr_inverse_table.
19594 ;
19595 ; Revision 1.6  1994/10/26  23:21:55  mike
19596 ; kill unused stuff.
19597 ;
19598 ; Revision 1.5  1994/07/27  18:39:20  john
19599 ; Took out references to blend table
19600 ;
19601 ; Revision 1.4  1994/01/31  15:40:17  mike
19602 ; Add window_height.
19603 ;
19604 ; Revision 1.3  1993/12/07  12:27:48  john
19605 ; Moved bmd_palette to gr_palette
19606 ;
19607 ; Revision 1.2  1993/11/22  10:24:10  mike
19608 ; *** empty log message ***
19609 ;
19610 ; Revision 1.1  1993/09/08  17:29:47  mike
19611 ; Initial revision
19612
19613 ------------------------------------------------------------------------
19614 texmap/tmap_lin.asm:
19615
19616 ; Revision 1.3  1995/02/20  18:22:57  john
19617 ; Put all the externs in the assembly modules into tmap_inc.asm.
19618 ; Also, moved all the C versions of the inner loops into a new module,
19619 ; scanline.c.
19620 ;
19621 ; Revision 1.2  1995/02/20  17:09:10  john
19622 ; Added code so that you can build the tmapper with no assembly!
19623 ;
19624 ; Revision 1.1  1994/11/30  12:24:04  mike
19625 ; Initial revision
19626 ;
19627 ; Revision 1.6  1994/11/12  16:39:40  mike
19628 ; jae to ja.
19629 ;
19630 ; Revision 1.5  1994/02/10  21:24:43  matt
19631 ; Got rid of debug_on set
19632 ;
19633 ; Revision 1.4  1994/01/31  15:39:53  mike
19634 ; Write additional inner loop for transparency.
19635 ;
19636 ; Revision 1.3  1994/01/26  11:50:04  john
19637 ; Added transparency to linear unlighted texture mapper.
19638 ;
19639 ; Revision 1.2  1993/11/22  10:24:36  mike
19640 ; *** empty log message ***
19641 ;
19642 ; Revision 1.1  1993/09/08  17:29:50  mike
19643 ; Initial revision
19644
19645 ------------------------------------------------------------------------
19646 texmap/tmap_ll.asm:
19647
19648 ; Revision 1.10  1995/02/20  18:22:54  john
19649 ; Put all the externs in the assembly modules into tmap_inc.asm.
19650 ; Also, moved all the C versions of the inner loops into a new module,
19651 ; scanline.c.
19652 ;
19653 ; Revision 1.9  1995/02/20  17:09:06  john
19654 ; Added code so that you can build the tmapper with no assembly!
19655 ;
19656 ; Revision 1.8  1994/11/19  23:52:56  mike
19657 ; rip out big unrolled loop to save 25K....remember when we cared more about speed?
19658 ;
19659 ; Revision 1.7  1994/11/12  16:39:41  mike
19660 ; jae to ja.
19661 ;
19662 ; Revision 1.6  1994/03/14  15:45:08  mike
19663 ; streamline code.
19664 ;
19665 ; Revision 1.5  1994/01/24  13:13:12  mike
19666 ; dithering.
19667 ;
19668 ; Revision 1.4  1994/01/14  14:02:47  mike
19669 ; *** empty log message ***
19670 ;
19671 ; Revision 1.3  1993/12/17  20:00:16  mike
19672 ; Change default setting of dither_intensity_lighting from 1 to 0
19673 ;
19674 ; Revision 1.2  1993/11/22  10:24:50  mike
19675 ; *** empty log message ***
19676 ;
19677 ; Revision 1.1  1993/09/08  17:29:52  mike
19678 ; Initial revision
19679
19680 ------------------------------------------------------------------------
19681 texmap/tmap_per.asm:
19682
19683 ; Revision 1.26  1995/02/20  18:22:55  john
19684 ; Put all the externs in the assembly modules into tmap_inc.asm.
19685 ; Also, moved all the C versions of the inner loops into a new module,
19686 ; scanline.c.
19687 ;
19688 ; Revision 1.25  1995/02/20  17:09:08  john
19689 ; Added code so that you can build the tmapper with no assembly!
19690 ;
19691 ; Revision 1.24  1995/01/10  09:32:07  mike
19692 ; mostly fix garbage at end of scanline, but slow down by 1-4%.
19693 ;
19694 ; Revision 1.23  1994/12/02  23:29:57  mike
19695 ; optimizations.
19696 ;
19697 ; Revision 1.22  1994/11/30  00:57:00  mike
19698 ; optimization.
19699 ;
19700 ; Revision 1.21  1994/11/21  13:57:42  mike
19701 ; fix right side shear bug
19702 ;
19703 ; Revision 1.20  1994/11/12  16:41:09  mike
19704 ; jae -> ja.
19705 ;
19706 ; Revision 1.19  1994/10/27  19:40:00  john
19707 ; Made lighting table lookup be _gr_fade_table[eax] instead
19708 ; of fs:[eax], which gets rig of a segment override that
19709 ; supposedly costs 1 clock on a 486.  Mainly, I wanted to verify
19710 ; that the only reason we need selectors is for the source texture
19711 ; data .
19712 ;
19713 ; Revision 1.18  1994/05/03  11:08:32  mike
19714 ; Trap divide overflows.
19715 ;
19716 ; Revision 1.17  1994/04/21  15:03:41  mike
19717 ; make faster.
19718 ;
19719 ; Revision 1.16  1994/04/08  16:46:57  john
19720 ; Made 32 fade levels. Hacked.
19721 ;
19722 ; Revision 1.15  1994/03/31  08:35:18  mike
19723 ; Fix quantized-by-4 bug in inner loop.
19724 ;
19725 ; Revision 1.14  1994/03/14  17:41:14  mike
19726 ; Fix bug in unlighted version.
19727 ;
19728 ; Revision 1.13  1994/03/14  15:45:14  mike
19729 ; streamline code.
19730 ;
19731 ; Revision 1.12  1994/01/14  14:01:58  mike
19732 ; *** empty log message ***
19733 ;
19734 ; Revision 1.11  1993/12/18  14:43:44  john
19735 ; Messed around with doing 1/z, the u*(1/z) and v*(1/z)
19736 ; (Went from 23 fps to 21 fps... not good! )
19737 ;
19738 ; Revision 1.10  1993/12/17  16:14:17  john
19739 ; Split lighted/nonlighted, so there is no cmp lighting
19740 ; in the inner loop.
19741 ;
19742 ; Revision 1.9  1993/12/17  12:34:29  john
19743 ; Made leftover bytes use linear approx instead of correct...
19744 ; should save about 8 divides per scanline on average.
19745 ; Also, took out anti-aliasing code and rearranged to
19746 ; order of some instructions to help on 486 pipelining.
19747 ; (The anti-aliasing code did *not* look good, so I
19748 ; figure there was no reason to keep it in. )
19749 ;
19750 ; Revision 1.8  1993/12/16  18:37:52  mike
19751 ; Align some stuff on 4 byte boundaries.
19752 ;
19753 ; Revision 1.7  1993/11/30  08:44:18  john
19754 ; Made selector set check for < 64*64 bitmaps.
19755 ;
19756 ; Revision 1.6  1993/11/23  17:25:26  john
19757 ; Added safety "and eax, 0fffh" in lighting lookup.
19758 ;
19759 ; Revision 1.5  1993/11/23  15:08:52  mike
19760 ; Fixed lighting bug.
19761 ;
19762 ; Revision 1.4  1993/11/23  14:38:50  john
19763 ; optimized NORMAL code by switching EBX and ESI, so BH can be used in
19764 ; the lighting process.
19765 ;
19766 ; Revision 1.3  1993/11/23  14:30:53  john
19767 ; Made the perspective tmapper do 1/8 divides; added lighting.
19768 ;
19769 ; Revision 1.2  1993/11/22  10:24:59  mike
19770 ; *** empty log message ***
19771 ;
19772 ; Revision 1.1  1993/09/08  17:29:53  mike
19773 ; Initial revision
19774
19775 ------------------------------------------------------------------------
19776 texmap/tmapfade.asm:
19777
19778 ; Revision 1.6  1995/02/20  18:23:01  john
19779 ; Put all the externs in the assembly modules into tmap_inc.asm.
19780 ; Also, moved all the C versions of the inner loops into a new module,
19781 ; scanline.c.
19782 ;
19783 ; Revision 1.5  1995/02/20  17:09:15  john
19784 ; Added code so that you can build the tmapper with no assembly!
19785 ;
19786 ; Revision 1.4  1994/12/02  23:29:36  mike
19787 ; change jb/ja to jl/jg.
19788 ;
19789 ; Revision 1.3  1994/11/30  00:57:36  mike
19790 ; *** empty log message ***
19791 ;
19792 ; Revision 1.2  1994/10/06  18:38:49  john
19793 ; Added the ability to fade a scanline by calling gr_upoly_tmap
19794 ; with Gr_scanline_darkening_level with a value < MAX_FADE_LEVELS.
19795 ;
19796 ; Revision 1.1  1994/10/06  18:04:42  john
19797 ; Initial revision
19798
19799 ------------------------------------------------------------------------
19800 texmap/tmapflat.c:
19801
19802  * Revision 1.13  1995/02/20  18:23:24  john
19803  * Added new module for C versions of inner loops.
19804  *
19805  * Revision 1.12  1995/02/20  17:09:17  john
19806  * Added code so that you can build the tmapper with no assembly!
19807  *
19808  * Revision 1.11  1994/11/30  00:58:01  mike
19809  * optimizations.
19810  *
19811  * Revision 1.10  1994/11/28  13:34:32  mike
19812  * optimizations.
19813  *
19814  * Revision 1.9  1994/11/19  15:21:46  mike
19815  * rip out unused code.
19816  *
19817  * Revision 1.8  1994/11/12  16:41:41  mike
19818  * *** empty log message ***
19819  *
19820  * Revision 1.7  1994/11/09  23:05:12  mike
19821  * do lighting on texture maps which get flat shaded instead.
19822  *
19823  * Revision 1.6  1994/10/06  19:53:07  matt
19824  * Added function that takes same parms as draw_tmap(), but renders flat
19825  *
19826  * Revision 1.5  1994/10/06  18:38:12  john
19827  * Added the ability to fade a scanline by calling gr_upoly_tmap
19828  * with Gr_scanline_darkening_level with a value < MAX_FADE_LEVELS.
19829  *
19830  * Revision 1.4  1994/05/25  18:46:32  matt
19831  * Added gr_upoly_tmap_ylr(), which generates ylr's for a polygon
19832  *
19833  * Revision 1.3  1994/04/08  16:25:58  mike
19834  * Comment out some includes (of header files)
19835  * call init_interface_vars_to_assembler.
19836  *
19837  * Revision 1.2  1994/03/31  08:33:44  mike
19838  * Fixup flat shading version of texture mapper (get it?)
19839  * (Or maybe not, I admit to not testing my code...hahahah!)
19840  *
19841  * Revision 1.1  1993/09/08  17:29:10  mike
19842  * Initial revision
19843 ------------------------------------------------------------------------