]> icculus.org git repositories - btb/d2x.git/blob - ChangeLog-old
replace byte with sbyte
[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.2  2004/08/28 23:37:35  schaffner
1057  * move old per-file change logs into new file ChangeLog-old
1058  *
1059  * Revision 1.1  2004/08/28 23:17:45  schaffner
1060  * move old per-file change logs into new file ChangeLog-old
1061  *
1062  * Revision 1.1.1.1  2001/01/19 03:30:15  bradleyb
1063  * Import of d2x-0.0.8
1064  *
1065  * Revision 1.1.1.1  1999/06/14 21:58:39  donut
1066  * Import of d1x 1.37 source.
1067  *
1068  * Revision 2.6  1995/03/29  11:19:32  john
1069  * Added broadcasting over a net.
1070  * 
1071  * Revision 2.5  1995/03/28  20:04:43  john
1072  * Took away alternate server stuff.
1073  * 
1074  * Revision 2.4  1995/03/23  19:00:10  john
1075  * Added user list capabitly.
1076  * 
1077  * Revision 2.3  1995/03/23  12:26:57  john
1078  * Move IPX into bios lib.
1079  * 
1080  * Revision 2.2  1995/03/22  19:08:14  john
1081  * Added code to fix sending packets over router... now
1082  * we just need to make broadcasts go over router!!
1083  * 
1084  * Revision 2.1  1995/03/21  08:39:56  john
1085  * Ifdef'd out the NETWORK code.
1086  * 
1087  * Revision 2.0  1995/02/27  11:30:16  john
1088  * New version 2.0, which has no anonymous unions, builds with
1089  * Watcom 10.0, and doesn't require parsing BITMAPS.TBL.
1090  * 
1091  * Revision 1.16  1995/02/16  17:34:52  john
1092  * Added code to allow dynamic socket changing.
1093  * 
1094  * Revision 1.15  1995/01/04  21:43:27  rob
1095  * Remove SPX size definition.
1096  * 
1097  * Revision 1.14  1995/01/03  13:46:18  john
1098  * Added code that should make ipx work over different servers,
1099  * but ifdef'd it out with SHAREWARE in ipx.c.  I haven't tested
1100  * this, and I hope it doesn't introduce net bugs.
1101  * 
1102  * Revision 1.13  1994/11/02  11:37:16  rob
1103  * Changed default socket number to a higher regions.
1104  * 
1105  * Revision 1.12  1994/11/01  15:56:51  rob
1106  * Added defines for SPX socketsx.
1107  * 
1108  * Revision 1.11  1994/10/31  19:23:31  rob
1109  * Added a prototype for the new object send function.
1110  * 
1111  * Revision 1.10  1994/09/07  13:37:25  john
1112  * Changed default socket to 0x4000, because 
1113  * the ipx/spx book says that we can only use
1114  * sockets 0x4000 - 0x7fff.
1115  * 
1116  * Revision 1.9  1994/08/25  18:14:45  matt
1117  * Changed socket because of packet change
1118  * 
1119  * Revision 1.8  1994/08/12  22:42:24  john
1120  * Took away Player_stats; added Players array.
1121  * 
1122  * Revision 1.7  1994/08/09  19:31:47  john
1123  * Networking changes.
1124  * 
1125  * Revision 1.6  1994/08/05  16:11:46  john
1126  * Psuedo working version of networking.
1127  * 
1128  * Revision 1.5  1994/08/04  19:17:20  john
1129  * Inbetween version of network stuff.
1130  * 
1131  * Revision 1.4  1994/07/29  16:08:59  john
1132  * *** empty log message ***
1133  * 
1134  * Revision 1.3  1994/07/25  12:33:22  john
1135  * Network "pinging" in.
1136  * 
1137  * Revision 1.2  1994/07/20  15:58:29  john
1138  * First installment of ipx stuff.
1139  * 
1140  * Revision 1.1  1994/07/19  15:43:05  john
1141  * Initial revision
1142
1143 ------------------------------------------------------------------------
1144 arch/dos/joy.c:
1145
1146  * $Log: not supported by cvs2svn $
1147  * Revision 1.2  2004/08/28 23:37:35  schaffner
1148  * move old per-file change logs into new file ChangeLog-old
1149  *
1150  * Revision 1.1  2004/08/28 23:17:45  schaffner
1151  * move old per-file change logs into new file ChangeLog-old
1152  *
1153  * Revision 1.5  2004/05/22 01:40:12  btb
1154  * use JOY_NUM_AXES instead of 4 in joy_(get|set)_cal_vals (d1x r1.3, r1.4)
1155  *
1156  * Revision 1.4  2001/10/24 09:25:05  bradleyb
1157  * Moved input stuff to arch subdirs, as in d1x.
1158  *
1159  * Revision 1.3  2001/01/29 14:03:56  bradleyb
1160  * Fixed build, minor fixes
1161  *
1162  * Revision 1.2  2001/01/24 04:29:45  bradleyb
1163  * changed args_find to FindArg
1164  *
1165  * Revision 1.1.1.2  2001/01/19 03:33:52  bradleyb
1166  * Import of d2x-0.0.9-pre1
1167  *
1168  * Revision 1.1.1.1  1999/06/14 21:58:26  donut
1169  * Import of d1x 1.37 source.
1170  *
1171  * Revision 1.37  1995/10/07  13:22:31  john
1172  * Added new method of reading joystick that allows higher-priority
1173  * interrupts to go off.
1174  * 
1175  * Revision 1.36  1995/03/30  11:03:40  john
1176  * Made -JoyBios read buttons using BIOS.
1177  * 
1178  * Revision 1.35  1995/02/14  11:39:25  john
1179  * Added polled/bios joystick readers..
1180  * 
1181  * Revision 1.34  1995/02/10  17:06:12  john
1182  * Fixed bug with plugging in a joystick not getting detected.
1183  * 
1184  * Revision 1.33  1995/01/27  16:39:42  john
1185  * Made so that if no joystick detected, it wont't
1186  * read buttons.
1187  * 
1188  * Revision 1.32  1995/01/12  13:16:40  john
1189  * Made it so that joystick can't lose an axis
1190  * by 1 weird reading. Reading has to occurr during
1191  * calibration for this to happen.
1192  * 
1193  * Revision 1.31  1994/12/28  15:56:03  john
1194  * Fixed bug that refused to read joysticks whose 
1195  * min,cen,max were less than 100 apart.
1196  * 
1197  * Revision 1.30  1994/12/28  15:31:53  john
1198  * Added code to read joystick axis not all at one time.
1199  * 
1200  * Revision 1.29  1994/12/27  15:44:36  john
1201  * Made the joystick timeout be at 1/100th of a second, 
1202  * regardless of CPU speed.
1203  * 
1204  * Revision 1.28  1994/12/04  11:54:54  john
1205  * Made stick read at whatever rate the clock is at, not
1206  * at 18.2 times/second.
1207  * 
1208  * Revision 1.27  1994/11/29  02:25:40  john
1209  * Made it so that the scaled reading returns 0 
1210  * if the calibration factors look funny..
1211  * 
1212  * Revision 1.26  1994/11/22  11:08:07  john
1213  * Commented out the ARCADE joystick.
1214  * 
1215  * Revision 1.25  1994/11/14  19:40:26  john
1216  * Fixed bug with no joystick being detected.
1217  * 
1218  * Revision 1.24  1994/11/14  19:36:40  john
1219  * Took out initial cheapy calibration.
1220  * 
1221  * Revision 1.23  1994/11/14  19:13:27  john
1222  * Took out the calibration in joy_init
1223  * 
1224  * Revision 1.22  1994/10/17  10:09:57  john
1225  * Made the state look at last_State, so that a joy_flush
1226  * doesn't cause a new down state to be added next reading.
1227  * 
1228  * Revision 1.21  1994/10/13  11:36:23  john
1229  * Made joy_down_time be kept track of in fixed seconds,
1230  * not ticks.
1231  * 
1232  * Revision 1.20  1994/10/12  16:58:50  john
1233  * Fixed bug w/ previous comment.
1234  * 
1235  * Revision 1.19  1994/10/12  16:57:44  john
1236  * Added function to set a joystick button's state.
1237  * 
1238  * Revision 1.18  1994/10/11  10:20:13  john
1239  * Fixed Flightstick Pro/
1240  * ..
1241  * 
1242  * Revision 1.17  1994/09/29  18:29:20  john
1243  * *** empty log message ***
1244  * 
1245  * Revision 1.16  1994/09/27  19:17:23  john
1246  * Added code so that is joy_init is never called, joystick is not
1247  * used at all.
1248  * 
1249  * Revision 1.15  1994/09/22  16:09:23  john
1250  * Fixed some virtual memory lockdown problems with timer and
1251  * joystick.
1252  * 
1253  * Revision 1.14  1994/09/16  11:44:42  john
1254  * Fixed bug with slow joystick.
1255  * 
1256  * Revision 1.13  1994/09/16  11:36:15  john
1257  * Fixed bug with reading non-present channels.
1258  * 
1259  * Revision 1.12  1994/09/15  20:52:48  john
1260  * rme john
1261  * Added support for the Arcade style joystick.
1262  * 
1263  * Revision 1.11  1994/09/13  20:04:49  john
1264  * Fixed bug with joystick button down_time.
1265  * 
1266  * Revision 1.10  1994/09/10  13:48:07  john
1267  * Made all 20 buttons read.
1268  * 
1269  * Revision 1.9  1994/08/31  09:55:02  john
1270  * *** empty log message ***
1271  * 
1272  * Revision 1.8  1994/08/29  21:02:14  john
1273  * Added joy_set_cal_values...
1274  * 
1275  * Revision 1.7  1994/08/29  20:52:17  john
1276  * Added better cyberman support; also, joystick calibration
1277  * value return funcctiionn,
1278  * 
1279  * Revision 1.6  1994/08/24  18:53:12  john
1280  * Made Cyberman read like normal mouse; added dpmi module; moved
1281  * mouse from assembly to c. Made mouse buttons return time_down.
1282  * 
1283  * Revision 1.5  1994/07/14  22:12:23  john
1284  * Used intrinsic forms of outp to fix vmm error.
1285  * 
1286  * Revision 1.4  1994/07/07  19:52:59  matt
1287  * Made joy_init() return success/fail flag
1288  * Made joy_init() properly detect a stick if one is plugged in after joy_init()
1289  * was called the first time.
1290  * 
1291  * Revision 1.3  1994/07/01  10:55:55  john
1292  * Fixed some bugs... added support for 4 axis.
1293  * 
1294  * Revision 1.2  1994/06/30  20:36:55  john
1295  * Revamped joystick code.
1296  * 
1297  * Revision 1.1  1994/06/30  15:42:15  john
1298  * Initial revision
1299
1300 ------------------------------------------------------------------------
1301 arch/dos/joydefs.c:
1302
1303  * $Log: not supported by cvs2svn $
1304  * Revision 1.2  2004/08/28 23:37:35  schaffner
1305  * move old per-file change logs into new file ChangeLog-old
1306  *
1307  * Revision 1.1  2004/08/28 23:17:45  schaffner
1308  * move old per-file change logs into new file ChangeLog-old
1309  *
1310  * Revision 1.3  2001/10/24 09:25:05  bradleyb
1311  * Moved input stuff to arch subdirs, as in d1x.
1312  *
1313  * Revision 1.2  2001/01/29 14:03:57  bradleyb
1314  * Fixed build, minor fixes
1315  *
1316  * Revision 1.1.1.2  2001/01/19 03:33:52  bradleyb
1317  * Import of d2x-0.0.9-pre1
1318  *
1319  * Revision 1.1.1.1  1999/06/14 21:58:29  donut
1320  * Import of d1x 1.37 source.
1321  *
1322  * Revision 2.2  1995/06/30  12:30:22  john
1323  * Added -Xname command line.
1324  * 
1325  * Revision 2.1  1995/04/06  12:13:20  john
1326  * Made so you can calibrate Gravis Gamepad.
1327  * 
1328  * Revision 2.0  1995/02/27  11:30:27  john
1329  * New version 2.0, which has no anonymous unions, builds with
1330  * Watcom 10.0, and doesn't require parsing BITMAPS.TBL.
1331  * 
1332  * Revision 1.71  1995/02/12  02:06:10  john
1333  * Fixed bug with joystick incorrectly asking for
1334  * calibration.
1335  * 
1336  * Revision 1.70  1995/01/28  15:58:07  john
1337  * Made joystick calibration be only when wrong detected in
1338  * menu or joystick axis changed.
1339  * 
1340  * Revision 1.69  1995/01/25  14:37:55  john
1341  * Made joystick only prompt for calibration once...
1342  * 
1343  * Revision 1.68  1995/01/24  16:34:29  john
1344  * Made so that if you reconfigure joystick and
1345  * add or subtract an axis, it asks for a recalibration
1346  * upon leaving.
1347  * 
1348  * Revision 1.67  1994/12/29  11:08:51  john
1349  * Fixed Thrustmaster and Logitech Wingman extreme
1350  * Hat by reading the y2 axis during the center stage
1351  * of the calibration, and using 75, 50, 27, and 3 %
1352  * as values for the 4 positions.
1353  * 
1354  * Revision 1.66  1994/12/15  18:17:39  john
1355  * Fixed warning with previous.
1356  * 
1357  * Revision 1.65  1994/12/15  18:15:48  john
1358  * Made the joy cal only write the .cfg file, not
1359  * the player file.
1360  * 
1361  * Revision 1.64  1994/12/13  14:43:35  john
1362  * Took out the code in kconfig to build direction array.
1363  * Called kc_set_controls after selecting a new control type.
1364  * 
1365  * Revision 1.63  1994/12/10  12:08:47  john
1366  * Changed some delays to use TICKER instead of timer_get_fixed_seconds.
1367  * 
1368  * Revision 1.62  1994/12/09  11:01:07  mike
1369  * force calibration of joystick on joystick selection from Controls... menu.
1370  * 
1371  * Revision 1.61  1994/12/07  21:50:27  john
1372  * Put stop/start time around joystick delay.
1373  * 
1374  * Revision 1.60  1994/12/07  19:34:39  john
1375  * Added delay.
1376  * 
1377  * Revision 1.59  1994/12/07  18:12:14  john
1378  * NEatened up joy cal.,
1379  * 
1380  * Revision 1.58  1994/12/07  17:07:51  john
1381  * Fixed up joy cal.
1382  * 
1383  * Revision 1.57  1994/12/07  16:48:53  yuan
1384  * localization
1385  * 
1386  * Revision 1.56  1994/12/07  16:05:55  john
1387  * Changed the way joystick calibration works.
1388  * 
1389  * Revision 1.55  1994/12/06  20:15:22  john
1390  * Took out code that unpauses songs that were never paused.
1391  * 
1392  * Revision 1.54  1994/12/06  15:14:09  yuan
1393  * Localization
1394  * 
1395  * Revision 1.53  1994/12/05  16:29:16  john
1396  * Took out music pause around the cheat menu.
1397  * 
1398  * Revision 1.52  1994/12/04  12:39:10  john
1399  * MAde so that FCS calibration doesn't ask for axis #2.
1400  * 
1401  * Revision 1.51  1994/12/03  15:14:59  john
1402  * Took out the delay mentioned previosuly cause it would
1403  * cause bigger problems than it helps, especially with netgames.
1404  * 
1405  * Revision 1.50  1994/12/03  14:16:14  john
1406  * Put a delay between screens in joy cal to keep Yuan from
1407  * double hitting.
1408  * 
1409  * Revision 1.49  1994/12/03  11:04:06  john
1410  * Changed newmenu code a bit to fix bug with bogus
1411  * backgrounds occcasionally.
1412  * 
1413  * Revision 1.48  1994/12/02  11:03:44  yuan
1414  * Localization.
1415  * 
1416  * Revision 1.47  1994/12/02  10:50:33  yuan
1417  * Localization
1418  * 
1419  * Revision 1.46  1994/12/01  12:21:59  john
1420  * Added code to calibrate 2 joysticks separately.
1421  * 
1422  * Revision 1.45  1994/12/01  11:52:31  john
1423  * Added message when you select FCS to say that if
1424  * you have WCS, see manuel.
1425  * 
1426  * Revision 1.44  1994/11/29  02:26:28  john
1427  * Made the prompts for upper-left, lower right for joy
1428  * calibration more obvious.
1429  * 
1430  * Revision 1.43  1994/11/26  13:13:59  matt
1431  * Changed "none" option to "keyboard only"
1432  * 
1433  * Revision 1.42  1994/11/21  19:35:13  john
1434  * Replaced calls to joy_init with if (joy_present)
1435  * 
1436  * Revision 1.41  1994/11/21  19:28:34  john
1437  * Changed warning for no joystick to use nm_messagebox..
1438  * 
1439  * Revision 1.40  1994/11/21  19:06:25  john
1440  * Made it so that it only stops sound when your in game mode. 
1441  * 
1442  * Revision 1.39  1994/11/21  11:47:18  john
1443  * Made sound pause during joystick calibration.
1444  * 
1445  * Revision 1.38  1994/11/10  20:34:18  rob
1446  * Removed menu-specific network mode support in favor in new stuff
1447  * in newmenu.c
1448  * 
1449  * Revision 1.37  1994/11/08  21:21:38  john
1450  * Made Esc exit joystick calibration.
1451  * 
1452  * Revision 1.36  1994/11/08  15:14:42  john
1453  * Added more calls so net doesn't die in net game.
1454  * 
1455  * Revision 1.35  1994/11/08  14:59:12  john
1456  * Added code to respond to network while in menus.
1457  * 
1458  * Revision 1.34  1994/10/24  19:56:32  john
1459  * Made the new user setup prompt for config options.
1460  * 
1461  * Revision 1.33  1994/10/22  14:11:52  mike
1462  * Suppress compiler warning message.
1463  * 
1464  * Revision 1.32  1994/10/19  12:44:24  john
1465  * Added hours field to player structure.
1466  * 
1467  * Revision 1.31  1994/10/17  13:07:13  john
1468  * Moved the descent.cfg info into the player config file.
1469  * 
1470  * Revision 1.30  1994/10/13  21:41:12  john
1471  * MAde Esc exit out of joystick calibration.
1472  * 
1473  * Revision 1.29  1994/10/13  19:22:27  john
1474  * Added separate config saves for different devices.
1475  * Made all the devices work together better, such as mice won't
1476  * get read when you're playing with the joystick.
1477  * 
1478  * Revision 1.28  1994/10/13  11:40:18  john
1479  * Took out warnings.
1480  * 
1481  * Revision 1.27  1994/10/13  11:35:23  john
1482  * Made Thrustmaster FCS Hat work.  Put a background behind the
1483  * keyboard configure.  Took out turn_sensitivity.  Changed sound/config
1484  * menu to new menu. Made F6 be calibrate joystick.
1485  * 
1486  * Revision 1.26  1994/10/11  21:29:03  matt
1487  * Made a bunch of menus have good initial selected values
1488  * 
1489  * Revision 1.25  1994/10/11  17:08:39  john
1490  * Added sliders for volume controls.
1491  * 
1492  * Revision 1.24  1994/10/10  17:59:21  john
1493  * Neatend previous.
1494  * 
1495  * Revision 1.23  1994/10/10  17:57:59  john
1496  * Neatend previous.
1497  * 
1498  * Revision 1.22  1994/10/10  17:56:11  john
1499  * Added messagebox that tells that config has been saved.
1500  * 
1501  * Revision 1.21  1994/09/30  12:37:26  john
1502  * Added midi,digi volume to configuration.
1503  * 
1504  * Revision 1.20  1994/09/22  16:14:14  john
1505  * Redid intro sequecing.
1506  * 
1507  * Revision 1.19  1994/09/19  18:50:15  john
1508  * Added switch to disable joystick.
1509  * 
1510  * Revision 1.18  1994/09/12  11:47:36  john
1511  * Made stupid cruise work better.  Make kconfig values get
1512  * read/written to disk.
1513  * 
1514  * Revision 1.17  1994/09/10  15:46:47  john
1515  * First version of new keyboard configuration.
1516  * 
1517  * Revision 1.16  1994/09/06  19:35:44  john
1518  * Fixed bug that didn';t load new size .cal file.
1519  * 
1520  * Revision 1.15  1994/09/06  14:51:58  john
1521  * Added sensitivity adjustment, fixed bug with joystick button not
1522  * staying down.
1523  * 
1524  * Revision 1.14  1994/09/02  16:13:47  john
1525  * Made keys fill in position.
1526  * 
1527  * Revision 1.13  1994/08/31  17:58:50  john
1528  * Made a bit simpler.
1529  * 
1530  * Revision 1.12  1994/08/31  14:17:54  john
1531  * *** empty log message ***
1532  * 
1533  * Revision 1.11  1994/08/31  14:10:56  john
1534  * Made keys not work when KEY_DELETE pressed.
1535  * 
1536  * Revision 1.10  1994/08/31  13:40:47  mike
1537  * Change constant
1538  * 
1539  * Revision 1.9  1994/08/31  12:56:27  john
1540  * *** empty log message ***
1541  * 
1542  * Revision 1.8  1994/08/30  20:38:29  john
1543  * Add more config stuff..
1544  * 
1545  * Revision 1.7  1994/08/30  16:37:25  john
1546  * Added menu options to set controls.
1547  * 
1548  * Revision 1.6  1994/08/30  09:27:18  john
1549  * *** empty log message ***
1550  * 
1551  * Revision 1.5  1994/08/30  09:12:01  john
1552  * *** empty log message ***
1553  * 
1554  * Revision 1.4  1994/08/29  21:18:32  john
1555  * First version of new keyboard/oystick remapping stuff.
1556  * 
1557  * Revision 1.3  1994/08/24  19:00:29  john
1558  * Changed key_down_time to return fixed seconds instead of
1559  * milliseconds.
1560  * 
1561  * Revision 1.2  1994/08/17  16:50:37  john
1562  * Added damaging fireballs, missiles.
1563  * 
1564  * Revision 1.1  1994/08/17  10:07:12  john
1565  * Initial revision
1566
1567 ------------------------------------------------------------------------
1568 arch/dos/key.c:
1569
1570  * $Log: not supported by cvs2svn $
1571  * Revision 1.2  2004/08/28 23:37:35  schaffner
1572  * move old per-file change logs into new file ChangeLog-old
1573  *
1574  * Revision 1.1  2004/08/28 23:17:45  schaffner
1575  * move old per-file change logs into new file ChangeLog-old
1576  *
1577  * Revision 1.3  2001/10/24 09:25:05  bradleyb
1578  * Moved input stuff to arch subdirs, as in d1x.
1579  *
1580  * Revision 1.3  2001/01/31 14:04:44  bradleyb
1581  * Fix compiler warnings
1582  *
1583  * Revision 1.2  2001/01/29 14:03:57  bradleyb
1584  * Fixed build, minor fixes
1585  *
1586  * Revision 1.1.1.2  2001/01/19 03:33:52  bradleyb
1587  * Import of d2x-0.0.9-pre1
1588  *
1589  * Revision 1.1.1.1  1999/06/14 21:58:32  donut
1590  * Import of d1x 1.37 source.
1591  *
1592  * Revision 1.35  1995/01/25  20:13:30  john
1593  * Took out not passing keys to debugger if w10.
1594  * 
1595  * Revision 1.34  1995/01/14  19:19:31  john
1596  * Made so when you press Shift+Baskspace, it release keys autmatically.
1597  * 
1598  * Revision 1.33  1994/12/13  09:21:48  john
1599  * Took out keyd_editor_mode, and KEY_DEBUGGED stuff for NDEBUG versions.
1600  * 
1601  * Revision 1.32  1994/11/12  13:52:01  john
1602  * Fixed bug with code that cleared bios buffer.
1603  * 
1604  * Revision 1.31  1994/10/24  15:16:16  john
1605  * Added code to detect KEY_PAUSE.
1606  * 
1607  * Revision 1.30  1994/10/24  13:57:53  john
1608  * Hacked in support for pause key onto code 0x61.
1609  * 
1610  * Revision 1.29  1994/10/21  15:18:13  john
1611  * *** empty log message ***
1612  * 
1613  * Revision 1.28  1994/10/21  15:17:24  john
1614  * Made LSHIFT+BACKSPACE do what PrtScr used to.
1615  * 
1616  * Revision 1.27  1994/09/22  16:09:18  john
1617  * Fixed some virtual memory lockdown problems with timer and
1618  * joystick.
1619  * 
1620  * Revision 1.26  1994/09/15  21:32:47  john
1621  * Added bounds checking for down_count scancode
1622  * parameter.
1623  * 
1624  * Revision 1.25  1994/08/31  12:22:20  john
1625  * Added KEY_DEBUGGED
1626  * 
1627  * Revision 1.24  1994/08/24  18:53:48  john
1628  * Made Cyberman read like normal mouse; added dpmi module; moved
1629  * mouse from assembly to c. Made mouse buttons return time_down.
1630  * 
1631  * Revision 1.23  1994/08/18  15:17:51  john
1632  * *** empty log message ***
1633  * 
1634  * Revision 1.22  1994/08/18  15:16:38  john
1635  * fixed some bugs with clear_key_times and then
1636  * removed it because i fixed key_flush to do the
1637  * same.
1638  * 
1639  * Revision 1.21  1994/08/17  19:01:25  john
1640  * Attempted to fix a bug with a key being held down
1641  * key_flush called, then the key released having too 
1642  * long of a time.
1643  * 
1644  * Revision 1.20  1994/08/08  10:43:48  john
1645  * Recorded when a key was pressed for key_inkey_time.
1646  * 
1647  * Revision 1.19  1994/06/22  15:00:03  john
1648  * Made keyboard close automatically on exit.
1649  * 
1650  * Revision 1.18  1994/06/21  09:16:29  john
1651  * *** empty log message ***
1652  * 
1653  * Revision 1.17  1994/06/21  09:08:23  john
1654  * *** empty log message ***
1655  * 
1656  * Revision 1.16  1994/06/21  09:05:01  john
1657  * *** empty log message ***
1658  * 
1659  * Revision 1.15  1994/06/21  09:04:24  john
1660  * Made PrtScreen do an int5
1661  * 
1662  * Revision 1.14  1994/06/17  17:17:06  john
1663  * Added keyd_time_last_key_was_pressed or something like that.
1664  * 
1665  * Revision 1.13  1994/05/14  13:55:16  matt
1666  * Added #define to control key passing to bios
1667  * 
1668  * Revision 1.12  1994/05/05  18:09:39  john
1669  * Took out BIOS to prevent stuck keys.
1670  * 
1671  * Revision 1.11  1994/05/03  17:39:12  john
1672  * *** empty log message ***
1673  * 
1674  * Revision 1.10  1994/04/29  12:14:20  john
1675  * Locked all memory used during interrupts so that program
1676  * won't hang when using virtual memory.
1677  * 
1678  * Revision 1.9  1994/04/28  23:49:41  john
1679  * Made key_flush flush more keys and also did something else but i forget what.
1680  * 
1681  * Revision 1.8  1994/04/22  12:52:12  john
1682  * *** empty log message ***
1683  * 
1684  * Revision 1.7  1994/04/01  10:44:59  mike
1685  * Change key_getch() to call getch() if our interrupt hasn't been installed.
1686  * 
1687  * Revision 1.6  1994/03/09  10:45:48  john
1688  * Neatend code a bit.
1689  * 
1690  * Revision 1.5  1994/02/17  17:24:16  john
1691  * Neatened up a bit.
1692  * 
1693  * Revision 1.4  1994/02/17  16:30:29  john
1694  * Put in code to pass keys when in debugger.
1695  * 
1696  * Revision 1.3  1994/02/17  15:57:59  john
1697  * Made handler not chain to BIOS handler.
1698  * 
1699  * Revision 1.2  1994/02/17  15:56:06  john
1700  * Initial version.
1701  * 
1702  * Revision 1.1  1994/02/17  15:54:07  john
1703  * Initial revision
1704
1705 ------------------------------------------------------------------------
1706 arch/dos/mono.c:
1707
1708  * $Log: not supported by cvs2svn $
1709  * Revision 1.2  2004/08/28 23:37:35  schaffner
1710  * move old per-file change logs into new file ChangeLog-old
1711  *
1712  * Revision 1.1  2004/08/28 23:17:45  schaffner
1713  * move old per-file change logs into new file ChangeLog-old
1714  *
1715  * Revision 1.1.1.1  2001/01/19 03:30:15  bradleyb
1716  * Import of d2x-0.0.8
1717  *
1718  * Revision 1.1.1.1  1999/06/14 21:58:35  donut
1719  * Import of d1x 1.37 source.
1720  *
1721  * Revision 1.12  1995/02/23  11:59:57  john
1722  * Made the windows smaller so they don't overwrite the debug file menus.
1723  * 
1724  * Revision 1.11  1994/11/27  23:07:50  matt
1725  * Made changes needed to be able to compile out monochrome debugging code
1726  * 
1727  * Revision 1.10  1994/10/26  22:23:43  john
1728  * Limited windows to 2.  Took away saving what was under
1729  * a window.
1730  * 
1731  * Revision 1.9  1994/07/14  23:25:44  matt
1732  * Allow window 0 to be opened; don't allow mono to be initialized twice
1733  * 
1734  * Revision 1.8  1994/03/09  10:45:38  john
1735  * Sped up scroll.
1736  * 
1737  * Revision 1.7  1994/01/26  08:56:55  mike
1738  * Comment out int3 in mputc.
1739  * 
1740  * Revision 1.6  1994/01/12  15:56:34  john
1741  * made backspace do an int3 during mono stuff.
1742  * .,
1743  * 
1744  * Revision 1.5  1993/12/07  12:33:23  john
1745  * *** empty log message ***
1746  * 
1747  * Revision 1.4  1993/10/15  10:10:25  john
1748  * *** empty log message ***
1749  * 
1750  * Revision 1.3  1993/09/14  20:55:13  matt
1751  * Made minit() and mopen() check for presence of mono card in machine.
1752  * 
1753  * Revision 1.2  1993/07/22  13:10:21  john
1754  * *** empty log message ***
1755  * 
1756  * Revision 1.1  1993/07/10  13:10:38  matt
1757  * Initial revision
1758
1759 ------------------------------------------------------------------------
1760 arch/dos/mono.h:
1761
1762  * Revision 1.6  1994/12/03  17:07:37  matt
1763  * Made mono code turn off with either NDEBUG or NMONO
1764  * 
1765  * Revision 1.5  1994/11/27  23:07:28  matt
1766  * Made changes needed to be able to compile out monochrome debugging code
1767  * 
1768  * Revision 1.4  1993/12/07  12:33:28  john
1769  * *** empty log message ***
1770  * 
1771  * Revision 1.3  1993/09/14  20:54:50  matt
1772  * Made minit() check for mono card, return -1 if present, 0 if not
1773  * 
1774  * Revision 1.2  1993/07/22  13:05:40  john
1775  * added macros to print variables
1776  * 
1777  * Revision 1.1  1993/07/10  13:10:40  matt
1778  * Initial revision
1779
1780 ------------------------------------------------------------------------
1781 arch/dos/mouse.c:
1782
1783  * Revision 1.11  1995/02/10  18:52:17  john
1784  * Fixed bug with mouse not getting closed.
1785  *
1786  * Revision 1.10  1995/02/02  11:10:33  john
1787  * Changed a bunch of mouse stuff around to maybe get
1788  * around PS/2 mouse hang.
1789  *
1790  * Revision 1.9  1995/01/14  19:19:52  john
1791  * Fixed signed short error cmp with -1 that caused mouse
1792  * to break under Watcom 10.0
1793  *
1794  * Revision 1.8  1994/12/27  12:38:23  john
1795  * Made mouse use temporary dos buffer instead of
1796  *
1797  * allocating its own.
1798  *
1799  *
1800  * Revision 1.7  1994/12/05  23:54:53  john
1801  * Fixed bug with mouse_get_delta only returning positive numbers..
1802  *
1803  * Revision 1.6  1994/11/18  23:18:18  john
1804  * Changed some shorts to ints.
1805  *
1806  * Revision 1.5  1994/09/13  12:34:02  john
1807  * Added functions to get down count and state.
1808  *
1809  * Revision 1.4  1994/08/29  20:52:19  john
1810  * Added better cyberman support; also, joystick calibration
1811  * value return funcctiionn,
1812  *
1813  * Revision 1.3  1994/08/24  18:54:32  john
1814  * *** empty log message ***
1815  *
1816  * Revision 1.2  1994/08/24  18:53:46  john
1817  * Made Cyberman read like normal mouse; added dpmi module; moved
1818  * mouse from assembly to c. Made mouse buttons return time_down.
1819  *
1820  * Revision 1.1  1994/08/24  13:56:37  john
1821  * Initial revision
1822
1823 ------------------------------------------------------------------------
1824 arch/include/joy.h:
1825
1826  * Revision 1.17  1995/10/07  13:22:30  john
1827  * Added new method of reading joystick that allows higher-priority
1828  * interrupts to go off.
1829  *
1830  * Revision 1.16  1995/02/14  11:17:13  john
1831  * Added BIOS readings for stick.
1832  *
1833  * Revision 1.15  1995/02/14  10:09:58  john
1834  * Added OS2 switch.
1835  *
1836  * Revision 1.14  1994/12/28  13:49:20  john
1837  * Added function to set joystick for slow reading
1838  *
1839  * Revision 1.13  1994/10/13  11:36:06  john
1840  * Made joy_down_time be kept track of in fixed seconds,
1841  * not ticks.
1842  *
1843  * Revision 1.12  1994/10/12  17:03:16  john
1844  * Added prototype for joy_get_scaled_reading.
1845  *
1846  * Revision 1.11  1994/10/12  16:57:55  john
1847  * Added function to set a joystick button's state.
1848  *
1849  * Revision 1.10  1994/09/22  16:09:00  john
1850  * Fixed some virtual memory lockdown problems with timer and
1851  * joystick.
1852  *
1853  * Revision 1.9  1994/08/31  09:54:57  john
1854  * *** empty log message ***
1855  *
1856  * Revision 1.8  1994/08/29  21:02:24  john
1857  * Added joy_set_cal_values...
1858  *
1859  * Revision 1.7  1994/08/29  20:51:52  john
1860  * Added better cyberman support; also, joystick calibration
1861  * value return funcctiionn,
1862  *
1863  * Revision 1.6  1994/07/01  10:55:44  john
1864  * Fixed some bugs... added support for 4 axis.
1865  *
1866  * Revision 1.5  1994/06/30  20:36:51  john
1867  * Revamped joystick code.
1868  *
1869  * Revision 1.4  1994/04/22  12:52:10  john
1870  * *** empty log message ***
1871  *
1872  * Revision 1.3  1994/01/18  13:53:39  john
1873  * Made all joystick functions return int's instead of
1874  * shorts.  Also made the stick reading be CPU speed
1875  * independant by using the timer_get_Stamp_64
1876  * function.
1877  *
1878  * Revision 1.2  1994/01/18  10:58:42  john
1879  * *** empty log message ***
1880  *
1881  * Revision 1.1  1993/07/10  13:10:39  matt
1882  * Initial revision
1883
1884 ------------------------------------------------------------------------
1885 arch/win32/include/key.h:
1886
1887  * Revision 1.19  1994/10/24  13:58:12  john
1888  * Hacked in support for pause key onto code 0x61.
1889  * 
1890  * Revision 1.18  1994/10/21  15:17:10  john
1891  * Added KEY_PRINT_SCREEN
1892  * 
1893  * Revision 1.17  1994/08/31  12:22:13  john
1894  * Added KEY_DEBUGGED
1895  * 
1896  * Revision 1.16  1994/08/24  18:53:50  john
1897  * Made Cyberman read like normal mouse; added dpmi module; moved
1898  * mouse from assembly to c. Made mouse buttons return time_down.
1899  * 
1900  * Revision 1.15  1994/08/18  14:56:16  john
1901  * *** empty log message ***
1902  * 
1903  * Revision 1.14  1994/08/08  10:43:24  john
1904  * Recorded when a key was pressed for key_inkey_time.
1905  * 
1906  * Revision 1.13  1994/06/17  17:17:28  john
1907  * Added keyd_time_last_key_was_pressed or something like that.
1908  * 
1909  * Revision 1.12  1994/04/29  12:14:19  john
1910  * Locked all memory used during interrupts so that program
1911  * won't hang when using virtual memory.
1912  * 
1913  * Revision 1.11  1994/02/17  15:57:14  john
1914  * Changed key libary to C.
1915  * 
1916  * Revision 1.10  1994/01/31  08:34:09  john
1917  * Fixed reversed lshift/rshift keys.
1918  * 
1919  * Revision 1.9  1994/01/18  10:58:17  john
1920  * *** empty log message ***
1921  * 
1922  * Revision 1.8  1993/10/16  19:24:43  matt
1923  * Added new function key_clear_times() & key_clear_counts()
1924  * 
1925  * Revision 1.7  1993/10/15  10:17:09  john
1926  * added keyd_last_key_pressed and released for use with recorder.
1927  * 
1928  * Revision 1.6  1993/10/06  16:20:37  john
1929  * fixed down arrow bug
1930  * 
1931  * Revision 1.5  1993/10/04  13:26:42  john
1932  * changed the #defines for scan codes.
1933  * 
1934  * Revision 1.4  1993/09/28  11:35:20  john
1935  * added key_peekkey
1936  * 
1937  * Revision 1.3  1993/09/20  18:36:43  john
1938  * *** empty log message ***
1939  * 
1940  * Revision 1.1  1993/07/10  13:10:39  matt
1941  * Initial revision
1942
1943 ------------------------------------------------------------------------
1944 arch/win32/include/mouse.h:
1945
1946  * Revision 1.10  1995/02/02  10:22:29  john
1947  * Added cyberman init parameter.
1948  * 
1949  * Revision 1.9  1994/11/18  23:18:09  john
1950  * Changed some shorts to ints.
1951  * 
1952  * Revision 1.8  1994/09/13  12:33:49  john
1953  * Added functions to get down count and state.
1954  * 
1955  * Revision 1.7  1994/08/29  20:52:20  john
1956  * Added better cyberman support; also, joystick calibration
1957  * value return funcctiionn,
1958  * 
1959  * Revision 1.6  1994/08/24  17:54:35  john
1960  * *** empty log message ***
1961  * 
1962  * Revision 1.5  1994/08/24  17:51:43  john
1963  * Added transparent cyberman support
1964  * 
1965  * Revision 1.4  1993/07/27  09:32:22  john
1966  * *** empty log message ***
1967  * 
1968  * Revision 1.3  1993/07/26  10:46:44  john
1969  * added definition for mouse_set_pos
1970  * 
1971  * Revision 1.2  1993/07/22  13:07:59  john
1972  * added header for mousesetlimts
1973  * 
1974  * Revision 1.1  1993/07/10  13:10:40  matt
1975  * Initial revision
1976
1977 ------------------------------------------------------------------------
1978 arch/win32/mouse.c:
1979
1980  * Revision 1.8  1996/02/21  13:57:36  allender
1981  * cursor device manager stuff added here so as not to
1982  * rely on InterfaceLib anymore
1983  *
1984  * Revision 1.7  1995/10/17  15:42:21  allender
1985  * new mouse function to determine single button press
1986  *
1987  * Revision 1.6  1995/10/03  11:27:31  allender
1988  * fixed up hotspot problems with the mouse on multiple monitors
1989  *
1990  * Revision 1.5  1995/07/13  11:27:08  allender
1991  * trap button checks at MAX_MOUSE_BUTTONS
1992  *
1993  * Revision 1.4  1995/06/25  21:56:53  allender
1994  * added events include
1995  *
1996  * Revision 1.3  1995/05/11  17:06:38  allender
1997  * fixed up mouse routines
1998  *
1999  * Revision 1.2  1995/05/11  13:05:53  allender
2000  * of mouse handler code
2001  *
2002  * Revision 1.1  1995/05/05  09:54:45  allender
2003  * Initial revision
2004  *
2005  * Revision 1.9  1995/01/14  19:19:52  john
2006  * Fixed signed short error cmp with -1 that caused mouse
2007  * to break under Watcom 10.0
2008  *
2009  * Revision 1.8  1994/12/27  12:38:23  john
2010  * Made mouse use temporary dos buffer instead of
2011  *
2012  * allocating its own.
2013  *
2014  * Revision 1.7  1994/12/05  23:54:53  john
2015  * Fixed bug with mouse_get_delta only returning positive numbers..
2016  *
2017  * Revision 1.6  1994/11/18  23:18:18  john
2018  * Changed some shorts to ints.
2019  *
2020  * Revision 1.5  1994/09/13  12:34:02  john
2021  * Added functions to get down count and state.
2022  *
2023  * Revision 1.4  1994/08/29  20:52:19  john
2024  * Added better cyberman support; also, joystick calibration
2025  * value return funcctiionn,
2026  *
2027  * Revision 1.3  1994/08/24  18:54:32  john
2028  * *** empty log message ***
2029  *
2030  * Revision 1.2  1994/08/24  18:53:46  john
2031  * Made Cyberman read like normal mouse; added dpmi module; moved
2032  * mouse from assembly to c. Made mouse buttons return time_down.
2033  *
2034  * Revision 1.1  1994/08/24  13:56:37  john
2035  * Initial revision
2036
2037 ------------------------------------------------------------------------
2038 cfile/cfile.c:
2039
2040  * Revision 1.7  1995/10/27  15:18:20  allender
2041  * get back to descent directory before trying to read a hog file
2042  *
2043  * Revision 1.6  1995/10/21  23:48:24  allender
2044  * hogfile(s) are now in :Data: folder
2045  *
2046  * Revision 1.5  1995/08/14  09:27:31  allender
2047  * added byteswap header
2048  *
2049  * Revision 1.4  1995/05/12  11:54:33  allender
2050  * changed memory stuff again
2051  *
2052  * Revision 1.3  1995/05/04  20:03:38  allender
2053  * added code that was missing...use NewPtr instead of malloc
2054  *
2055  * Revision 1.2  1995/04/03  09:59:49  allender
2056  * *** empty log message ***
2057  *
2058  * Revision 1.1  1995/03/30  10:25:02  allender
2059  * Initial revision
2060  *
2061  *
2062  * --- PC RCS Information ---
2063  * Revision 1.24  1995/03/15  14:20:27  john
2064  * Added critical error checker.
2065  *
2066  * Revision 1.23  1995/03/13  15:16:53  john
2067  * Added alternate directory stuff.
2068  *
2069  * Revision 1.22  1995/02/09  23:08:47  matt
2070  * Increased the max number of files in hogfile to 250
2071  *
2072  * Revision 1.21  1995/02/01  20:56:47  john
2073  * Added cfexist function
2074  *
2075  * Revision 1.20  1995/01/21  17:53:48  john
2076  * Added alternate pig file thing.
2077  *
2078  * Revision 1.19  1994/12/29  15:10:02  john
2079  * Increased hogfile max files to 200.
2080  *
2081  * Revision 1.18  1994/12/12  13:20:57  john
2082  * Made cfile work with fiellentth.
2083  *
2084  * Revision 1.17  1994/12/12  13:14:25  john
2085  * Made cfiles prefer non-hog files.
2086  *
2087  * Revision 1.16  1994/12/09  18:53:26  john
2088  * *** empty log message ***
2089  *
2090  * Revision 1.15  1994/12/09  18:52:56  john
2091  * Took out mem, error checking.
2092  *
2093  * Revision 1.14  1994/12/09  18:10:31  john
2094  * Speed up cfgets, which was slowing down the reading of
2095  * bitmaps.tbl, which was making POF loading look slow.
2096  *
2097  * Revision 1.13  1994/12/09  17:53:51  john
2098  * Added error checking to number of hogfiles..
2099  *
2100  * Revision 1.12  1994/12/08  19:02:55  john
2101  * Added cfgets.
2102  *
2103  * Revision 1.11  1994/12/07  21:57:48  john
2104  * Took out data dir.
2105  *
2106  * Revision 1.10  1994/12/07  21:38:02  john
2107  * Made cfile not return error..
2108  *
2109  * Revision 1.9  1994/12/07  21:35:34  john
2110  * Made it read from data directory.
2111  *
2112  * Revision 1.8  1994/12/07  21:33:55  john
2113  * Stripped out compression stuff...
2114  *
2115  * Revision 1.7  1994/04/13  23:44:59  matt
2116  * When file cannot be opened, free up the buffer for that file.
2117  *
2118  * Revision 1.6  1994/02/18  12:38:20  john
2119  * Optimized a bit
2120  *
2121  * Revision 1.5  1994/02/15  18:13:20  john
2122  * Fixed more bugs.
2123  *
2124  * Revision 1.4  1994/02/15  13:27:58  john
2125  * Works ok...
2126  *
2127  * Revision 1.3  1994/02/15  12:51:57  john
2128  * Crappy inbetween version
2129  *
2130  * Revision 1.2  1994/02/14  20:12:29  john
2131  * First version working with new cfile stuff.
2132  *
2133  * Revision 1.1  1994/02/14  15:51:33  john
2134  * Initial revision
2135  *
2136  * Revision 1.1  1994/02/10  15:45:12  john
2137  * Initial revision
2138
2139 ------------------------------------------------------------------------
2140 iff/iff.c:
2141
2142  * Revision 1.2  1995/05/12  11:54:43  allender
2143  * changed memory stuff again
2144  *
2145  * Revision 1.1  1995/05/05  08:59:41  allender
2146  * Initial revision
2147  *
2148  * Revision 1.43  1994/12/08  19:03:17  john
2149  * Added code to use cfile.
2150  *
2151  * Revision 1.42  1994/12/08  17:45:32  john
2152  * Put back in cfile stuff.
2153  *
2154  * Revision 1.41  1994/11/19  16:41:06  matt
2155  * Took out unused code
2156  *
2157  * Revision 1.40  1994/11/07  21:26:39  matt
2158  * Added new function iff_read_into_bitmap()
2159  *
2160  * Revision 1.39  1994/10/27  00:12:03  john
2161  * Used nocfile
2162  *
2163  * Revision 1.38  1994/08/10  19:49:58  matt
2164  * Fixed bitmaps in ILBM format with masking (stencil) on.
2165  *
2166  * Revision 1.37  1994/06/02  18:53:17  matt
2167  * Clear flags & selector in new bitmap structure
2168  *
2169  * Revision 1.36  1994/05/17  14:00:33  matt
2170  * Fixed bug with odd-width deltas & odd-length body chunks
2171  *
2172  * Revision 1.35  1994/05/16  20:38:55  matt
2173  * Made anim brushes work when odd width
2174  *
2175  * Revision 1.34  1994/05/06  19:37:26  matt
2176  * Improved error handling and checking
2177  *
2178  * Revision 1.33  1994/04/27  20:57:07  matt
2179  * Fixed problem with RLE decompression and odd-width bitmap
2180  * Added more error checking
2181  *
2182  * Revision 1.32  1994/04/16  21:44:19  matt
2183  * Fixed bug introduced last version
2184  *
2185  * Revision 1.31  1994/04/16  20:12:40  matt
2186  * Made masked (stenciled) bitmaps work
2187  *
2188  * Revision 1.30  1994/04/13  23:46:16  matt
2189  * Added function, iff_errormsg(), which returns ptr to error message.
2190  *
2191  * Revision 1.29  1994/04/13  23:27:25  matt
2192  * Put in support for anim brushes (.abm files)
2193  *
2194  * Revision 1.28  1994/04/13  16:33:31  matt
2195  * Cleaned up file read code, adding fake_file structure (FFILE), which
2196  * cleanly implements reading the entire file into a buffer and then reading
2197  * out of that buffer.
2198  *
2199  * Revision 1.27  1994/04/06  23:07:43  matt
2200  * Cleaned up code; added prototype (but no new code) for anim brush read
2201  *
2202  * Revision 1.26  1994/03/19  02:51:52  matt
2203  * Really did what I said I did last revision.
2204  *
2205  * Revision 1.25  1994/03/19  02:16:07  matt
2206  * Made work ILBMs which didn't have 8 planes
2207  *
2208  * Revision 1.24  1994/03/15  14:45:26  matt
2209  * When error, only free memory if has been allocated
2210  *
2211  * Revision 1.23  1994/02/18  12:39:05  john
2212  * Made code read from buffer.
2213  *
2214  * Revision 1.22  1994/02/15  18:15:26  john
2215  * Took out cfile attempt (too slow)
2216  *
2217  * Revision 1.21  1994/02/15  13:17:48  john
2218  * added assert to cfseek.
2219  *
2220  * Revision 1.20  1994/02/15  13:13:11  john
2221  * Made iff code work normally.
2222  *
2223  * Revision 1.19  1994/02/15  12:51:07  john
2224  * crappy inbetween version.
2225  *
2226  * Revision 1.18  1994/02/10  18:31:32  matt
2227  * Changed 'if DEBUG_ON' to 'ifndef NDEBUG'
2228  *
2229  * Revision 1.17  1994/01/24  11:51:26  john
2230  * Made write routine write transparency info.
2231  *
2232  * Revision 1.16  1994/01/22  14:41:11  john
2233  * Fixed bug with declareations.
2234  *
2235  * Revision 1.15  1994/01/22  14:23:00  john
2236  * Added global vars to check transparency
2237  *
2238  * Revision 1.14  1993/12/08  19:00:42  matt
2239  * Changed while loop to memset
2240  *
2241  * Revision 1.13  1993/12/08  17:23:51  mike
2242  * Speedup by converting while...getc to fread.
2243  *
2244  * Revision 1.12  1993/12/08  12:37:35  mike
2245  * Optimize parse_body.
2246  *
2247  * Revision 1.11  1993/12/05  17:30:14  matt
2248  * Made bitmaps with width <= 64 not compress
2249  *
2250  * Revision 1.10  1993/12/03  12:24:51  matt
2251  * Fixed TINY chunk when bitmap was part of a larger bitmap
2252  *
2253  * Revision 1.9  1993/11/22  17:26:43  matt
2254  * iff write now writes out a tiny chunk
2255  *
2256  * Revision 1.8  1993/11/21  22:04:13  matt
2257  * Fixed error with non-compressed bitmaps
2258  * Added Yuan's code to free raw data if we get an error parsing the body
2259  *
2260  * Revision 1.7  1993/11/11  12:12:12  yuan
2261  * Changed mallocs to MALLOCs.
2262  *
2263  * Revision 1.6  1993/11/01  19:02:23  matt
2264  * Fixed a couple bugs in rle compression
2265  *
2266  * Revision 1.5  1993/10/27  12:47:39  john
2267  * *** empty log message ***
2268  *
2269  * Revision 1.4  1993/10/27  12:37:31  yuan
2270  * Added mem.h
2271  *
2272  * Revision 1.3  1993/09/22  19:16:57  matt
2273  * Added new error type, IFF_CORRUPT, for internally bad IFF files.
2274  *
2275  * Revision 1.2  1993/09/08  19:24:16  matt
2276  * Fixed bug in RLE compression
2277  * Changed a bunch of unimportant values like aspect and page size when writing
2278  * Added new error condition, IFF_BAD_BM_TYPE
2279  * Make sub-bitmaps work correctly
2280  * Added compile flag to turn compression off (COMPRESS)
2281  *
2282  * Revision 1.1  1993/09/08  14:24:15  matt
2283  * Initial revision
2284
2285 ------------------------------------------------------------------------
2286 include/3d.h:
2287
2288  * Revision 1.2  1995/09/14  14:08:58  allender
2289  * return value for g3_draw_sphere
2290  *
2291  * Revision 1.1  1995/05/05  08:48:41  allender
2292  * Initial revision
2293  *
2294  * Revision 1.34  1994/11/11  19:22:14  matt
2295  * Added new function, g3_calc_point_depth()
2296  *
2297  * Revision 1.33  1994/09/09  14:23:58  matt
2298  * Added support for glowing textures, to add engine glow to Descent.
2299  *
2300  * Revision 1.32  1994/09/01  10:42:27  matt
2301  * Blob routine, renamed g3_draw_bitmap(), now takes seperate 3d width & height.
2302  *
2303  * Revision 1.31  1994/07/29  18:16:14  matt
2304  * Added instance by angles, and corrected parms for g3_init()
2305  *
2306  * Revision 1.30  1994/07/25  00:00:00  matt
2307  * Made 3d no longer deal with point numbers, but only with pointers.
2308  *
2309  * Revision 1.29  1994/07/22  17:57:27  matt
2310  * Changed the name of the rod functions, and took out some debugging code
2311  *
2312  * Revision 1.28  1994/06/07  16:49:12  matt
2313  * Made interpreter take lighting value as parm, rather than in global var
2314  *
2315  * Revision 1.27  1994/05/31  18:35:28  matt
2316  * Added light value to g3_draw_facing_bitmap()
2317  *
2318  * Revision 1.26  1994/05/30  22:48:04  matt
2319  * Added support for morph effect
2320  *
2321  * Revision 1.25  1994/05/30  11:34:57  matt
2322  * Added g3_set_special_render() to allow a user to specify functions to
2323  * call for 2d draws.
2324  *
2325  * Revision 1.24  1994/05/19  21:46:31  matt
2326  * Moved texture lighting out of 3d and into the game
2327  *
2328  * Revision 1.23  1994/05/14  15:26:48  matt
2329  * Added extern for polyobj outline flag
2330  *
2331  * Revision 1.22  1994/04/19  18:26:33  matt
2332  * Added g3_draw_sphere() function.
2333  *
2334  * Revision 1.21  1994/03/25  18:22:28  matt
2335  * g3_draw_polygon_model() now takes ptr to list of angles
2336  *
2337  * Revision 1.20  1994/03/15  21:23:23  matt
2338  * Added interpreter functions
2339  *
2340  * Revision 1.19  1994/02/15  17:37:34  matt
2341  * New function, g3_draw_blob()
2342  *
2343  * Revision 1.18  1994/02/09  11:47:47  matt
2344  * Added rod & delta point functions
2345  *
2346  * Revision 1.17  1994/01/26  12:38:11  matt
2347  * Added function g3_compute_lighting_value()
2348  *
2349  * Revision 1.16  1994/01/25  18:00:02  yuan
2350  * Fixed variable beam_brightness...
2351  *
2352  * Revision 1.15  1994/01/24  14:08:34  matt
2353  * Added instancing functions
2354  *
2355  * Revision 1.14  1994/01/22  18:21:48  matt
2356  * New lighting stuff now done in 3d; g3_draw_tmap() takes lighting parm
2357  *
2358  * Revision 1.13  1994/01/20  17:21:24  matt
2359  * New function g3_compute_sky_polygon()
2360  *
2361  * Revision 1.12  1994/01/14  17:20:25  matt
2362  * Added prototype for new function g3_draw_horizon()
2363  *
2364  * Revision 1.10  1993/12/20  20:21:52  matt
2365  * Added g3_point_2_vec()
2366  *
2367  * Revision 1.9  1993/12/07  23:05:47  matt
2368  * Fixed mistyped function name.
2369  *
2370  * Revision 1.8  1993/12/05  23:47:03  matt
2371  * Added function g3_draw_line_ptrs()
2372  *
2373  * Revision 1.7  1993/12/05  23:13:22  matt
2374  * Added prototypes for g3_rotate_point() and g3_project_point()
2375  *
2376  * Revision 1.6  1993/12/05  23:03:28  matt
2377  * Changed uvl structs to g3s_uvl
2378  *
2379  * Revision 1.5  1993/11/22  10:51:09  matt
2380  * Moved uvl structure here from segment.h, made texture map functions use it
2381  *
2382  * Revision 1.4  1993/11/21  20:08:31  matt
2383  * Added function g3_draw_object()
2384  *
2385  * Revision 1.3  1993/11/04  18:49:19  matt
2386  * Added system to only rotate points once per frame
2387  *
2388  * Revision 1.2  1993/11/04  08:16:06  mike
2389  * Add light field (p3_l) to g3s_point.
2390  *
2391  * Revision 1.1  1993/10/29  22:20:56  matt
2392  * Initial revision
2393
2394 ------------------------------------------------------------------------
2395 include/args.h:
2396
2397  * Revision 1.1  1995/05/16  15:54:24  allender
2398  * Initial revision
2399  *
2400  * Revision 2.0  1995/02/27  11:33:09  john
2401  * New version 2.0, which has no anonymous unions, builds with
2402  * Watcom 10.0, and doesn't require parsing BITMAPS.TBL.
2403  *
2404  * Revision 1.4  1994/07/11  16:27:28  matt
2405  * Took out prototypes for netipx funcs
2406  *
2407  * Revision 1.3  1994/05/11  19:45:34  john
2408  * *** empty log message ***
2409  *
2410  * Revision 1.2  1994/05/09  17:02:55  john
2411  * Split command line parameters into arg.c and arg.h.
2412  * Also added /dma, /port, /irq to digi.c
2413  *
2414  * Revision 1.1  1994/05/09  16:47:49  john
2415  * Initial revision
2416
2417 ------------------------------------------------------------------------
2418 include/byteswap.h:
2419
2420  * Revision 1.4  1995/08/23  21:28:15  allender
2421  * fix mcc compiler warning
2422  *
2423  * Revision 1.3  1995/08/18  15:51:42  allender
2424  * put back in old byteswapping code
2425  *
2426  * Revision 1.2  1995/05/04  20:10:18  allender
2427  * proper prototypes
2428  *
2429  * Revision 1.1  1995/03/30  15:02:11  allender
2430  * Initial revision
2431
2432 ------------------------------------------------------------------------
2433 include/cfile.h:
2434
2435  * Revision 1.1  1995/03/30  10:25:08  allender
2436  * Initial revision
2437  *
2438  *
2439  * -- PC RCS Information ---
2440  * Revision 1.10  1995/03/13  15:16:47  john
2441  * Added alternate directory stuff.
2442  *
2443  * Revision 1.9  1995/02/01  20:56:40  john
2444  * Added cfexist function
2445  *
2446  * Revision 1.8  1995/01/21  17:53:41  john
2447  * Added alternate pig file thing.
2448  *
2449  * Revision 1.7  1994/12/12  13:19:47  john
2450  * Made cfile work with fiellentth.
2451  *
2452  * Revision 1.6  1994/12/08  19:02:52  john
2453  * Added cfgets.
2454  *
2455  * Revision 1.5  1994/12/07  21:34:07  john
2456  * Stripped out compression stuff...
2457  *
2458  * Revision 1.4  1994/07/13  00:16:53  matt
2459  * Added include
2460  *
2461  * Revision 1.3  1994/02/17  17:36:19  john
2462  * Added CF_READ_MODE and CF_WRITE_MODE constants.
2463  *
2464  * Revision 1.2  1994/02/15  12:52:08  john
2465  * Crappy inbetween version
2466  *
2467  * Revision 1.1  1994/02/15  10:54:23  john
2468  * Initial revision
2469  *
2470  * Revision 1.1  1994/02/10  15:50:54  john
2471  * Initial revision
2472
2473 ------------------------------------------------------------------------
2474 include/error.h:
2475
2476  * Revision 1.12  1994/06/17  15:22:46  matt
2477  * Added pragma for Error() for when NDEBUG
2478  *
2479  * Revision 1.11  1994/03/07  13:22:14  matt
2480  * Since the Error() function has 'aborts' set in pragma, we do a jmp
2481  * to the function rather than call.
2482  *
2483  * Revision 1.10  1994/02/17  12:37:15  matt
2484  * Combined two pragma's for Error(), since second superseded the first
2485  *
2486  * Revision 1.9  1994/02/10  18:02:53  matt
2487  * Changed 'if DEBUG_ON' to 'ifndef NDEBUG'
2488  *
2489  * Revision 1.8  1994/02/09  15:18:29  matt
2490  * Added pragma saying that Error() never returns
2491  *
2492  * Revision 1.7  1993/10/19  12:57:53  matt
2493  * If DEBUG_ON not defined, define it to be 1
2494  *
2495  * Revision 1.6  1993/10/15  21:40:39  matt
2496  * Made error functions generate int3's if debugging on
2497  *
2498  * Revision 1.5  1993/10/14  15:29:22  matt
2499  * Added new function clear_warn_func()
2500  *
2501  * Revision 1.4  1993/10/08  16:16:47  matt
2502  * Made Assert() call function _Assert(), rather to do 'if...' inline.
2503  *
2504  * Revision 1.3  1993/09/29  11:39:07  matt
2505  * Added Assert() macro, like the system one, but calls Error()
2506  *
2507  * Revision 1.2  1993/09/27  11:47:03  matt
2508  * Added function set_warn_func()
2509  *
2510  * Revision 1.1  1993/09/23  20:17:46  matt
2511  * Initial revision
2512
2513 ------------------------------------------------------------------------
2514 include/gr.h:
2515
2516  * Revision 1.7  1995/09/13  08:39:44  allender
2517  * added prototype for gr_bitblt_cockpit
2518  *
2519  * Revision 1.6  1995/08/23  18:47:01  allender
2520  * fixed compiler warnings on mcc
2521  *
2522  * Revision 1.5  1995/08/14  15:51:01  allender
2523  * added #define for transparency color
2524  *
2525  * Revision 1.4  1995/06/13  13:03:55  allender
2526  * added graphics mode
2527  *
2528  * Revision 1.3  1995/04/18  09:50:16  allender
2529  * *** empty log message ***
2530  *
2531  * Revision 1.2  1995/04/07  07:32:33  allender
2532  * *** empty log message ***
2533  *
2534  * Revision 1.1  1995/03/09  09:04:16  allender
2535  * Initial revision
2536  *
2537  *
2538  * --- PC RCS information ---
2539  * Revision 1.45  1994/11/18  22:50:21  john
2540  * Changed shorts to ints in parameters.
2541  *
2542  * Revision 1.44  1994/11/13  13:04:07  john
2543  * Added paged out bit in bitmap structure.  Commented out the
2544  * poly code that is never used.
2545  *
2546  * Revision 1.43  1994/11/09  23:04:56  mike
2547  * Add avg_color field.
2548  *
2549  * Revision 1.42  1994/10/27  00:53:35  john
2550  * Added RLE Flag to bitmap structere.
2551  *
2552  * Revision 1.41  1994/10/26  23:55:52  john
2553  * Took out roller; Took out inverse table.
2554  *
2555  * Revision 1.40  1994/08/11  17:59:12  mike
2556  * Assembler merge functions written for 3 rotations of bitmaps.
2557  *
2558  * Revision 1.39  1994/08/10  12:24:56  matt
2559  * Added support for colors fonts & kerned fonts
2560  * Made our own font file format
2561  *
2562  * Revision 1.38  1994/07/27  18:30:18  john
2563  * Took away the blending table.
2564  *
2565  * Revision 1.37  1994/06/16  15:25:06  mike
2566  * Add flag BM_FLAG_NO_LIGHTING.
2567  *
2568  * Revision 1.36  1994/05/31  10:01:22  john
2569  * *** empty log message ***
2570  *
2571  * Revision 1.35  1994/05/31  07:53:34  john
2572  * *** empty log message ***
2573  *
2574  * Revision 1.34  1994/05/14  17:19:41  matt
2575  * Added externs
2576  *
2577  * Revision 1.33  1994/05/12  17:33:09  john
2578  * Added circle code.
2579  *
2580  * Revision 1.32  1994/05/06  12:50:16  john
2581  * Added supertransparency; neatend things up; took out warnings.
2582  *
2583  * Revision 1.31  1994/05/04  10:06:06  john
2584  * Added flag for bitmap super-transparency.
2585  *
2586  * Revision 1.30  1994/05/03  19:38:56  john
2587  * *** empty log message ***
2588  *
2589  * Revision 1.29  1994/04/22  11:16:05  john
2590  * *** empty log message ***
2591  *
2592  * Revision 1.28  1994/04/08  16:59:32  john
2593  * Add fading poly's; Made palette fade 32 instead of 16.
2594  *
2595  * Revision 1.27  1994/03/16  17:29:52  john
2596  * *** empty log message ***
2597  *
2598  * Revision 1.26  1994/03/16  17:20:51  john
2599  * Added slow palette searching options.
2600  *
2601  * Revision 1.25  1994/03/14  17:59:20  john
2602  * Added function to check bitmap's transparency.
2603  *
2604  * Revision 1.24  1994/03/14  16:56:26  john
2605  * Changed grs_bitmap structure to include bm_flags.
2606  *
2607  * Revision 1.23  1994/02/18  15:32:30  john
2608  * *** empty log message ***
2609  *
2610  * Revision 1.22  1994/01/25  11:40:48  john
2611  * Added gr_check_mode function.
2612  *
2613  * Revision 1.21  1994/01/12  13:45:24  john
2614  * Added scaler.
2615  *
2616  * Revision 1.20  1993/12/21  19:58:24  john
2617  * added selector stuff
2618  *
2619  * Revision 1.19  1993/12/21  11:40:40  john
2620  * *** empty log message ***
2621  *
2622  * Revision 1.18  1993/12/09  15:02:08  john
2623  * Changed palette stuff majorly
2624  *
2625  * Revision 1.17  1993/12/07  12:32:05  john
2626  * moved bmd_palette to gr_palette
2627  *
2628  * Revision 1.16  1993/11/28  12:08:06  mike
2629  * Change prototype for rotate_bitmap.
2630  *
2631  * Revision 1.15  1993/11/18  14:22:51  mike
2632  * Add prototype for rotate_bitmap.
2633  *
2634  * Revision 1.14  1993/11/17  19:00:59  mike
2635  * Add prototype for test_rotate_bitmap
2636  *
2637  * Revision 1.13  1993/11/16  11:28:58  john
2638  * *** empty log message ***
2639  *
2640  * Revision 1.12  1993/10/26  13:17:43  john
2641  * *** empty log message ***
2642  *
2643  * Revision 1.11  1993/10/15  16:23:37  john
2644  * y
2645  *
2646  * Revision 1.10  1993/09/28  15:32:33  john
2647  * added def for save/restore vidmode
2648  *
2649  * Revision 1.9  1993/09/28  12:51:46  matt
2650  * Added aspect ratio to grs_screen structure
2651  *
2652  * Revision 1.8  1993/09/26  22:45:12  matt
2653  * Changed prototypes for line functions to take fixes, not ints.
2654  *
2655  * Revision 1.7  1993/09/26  18:58:16  john
2656  * fadein/out stuff
2657  *
2658  * Revision 1.6  1993/09/14  16:26:44  matt
2659  * Changed gr_change_mode() to be gr_set_mode()
2660  *
2661  * Revision 1.4  1993/09/14  13:08:45  john
2662  * added gr_change_mode
2663  *
2664  * Revision 1.3  1993/09/08  13:56:03  matt
2665  * Put 'if' block around body of file; added bitmap type BM_RGB15
2666  *
2667  * Revision 1.2  1993/09/08  13:02:14  john
2668  * Changed structure definitions a bit.
2669  *
2670  * Revision 1.1  1993/09/08  11:25:15  john
2671  * Initial revision
2672
2673 ------------------------------------------------------------------------
2674 include/grdef.h:
2675
2676  * Revision 1.5  1995/09/14  15:36:33  allender
2677  * added stuff for 68k version
2678  *
2679  * Revision 1.4  1995/07/05  16:10:57  allender
2680  * gr_linear_movsd prototype changes
2681  *
2682  * Revision 1.3  1995/04/19  14:39:28  allender
2683  * changed function prototype
2684  *
2685  * Revision 1.2  1995/04/18  09:49:53  allender
2686  * *** empty log message ***
2687  *
2688  * Revision 1.1  1995/03/09  09:04:56  allender
2689  * Initial revision
2690  *
2691  *
2692  * --- PC RCS information ---
2693  * Revision 1.8  1994/05/06  12:50:09  john
2694  * Added supertransparency; neatend things up; took out warnings.
2695  *
2696  * Revision 1.7  1994/01/25  11:40:29  john
2697  * Added gr_check_mode function.
2698  *
2699  * Revision 1.6  1993/10/15  16:22:53  john
2700  * y
2701  *
2702  * Revision 1.5  1993/09/29  17:31:00  john
2703  * added gr_vesa_pixel
2704  *
2705  * Revision 1.4  1993/09/29  16:14:43  john
2706  * added global canvas descriptors.
2707  *
2708  * Revision 1.3  1993/09/08  17:38:02  john
2709  * Looking for errors
2710  *
2711  * Revision 1.2  1993/09/08  15:54:29  john
2712  * *** empty log message ***
2713  *
2714  * Revision 1.1  1993/09/08  11:37:57  john
2715  * Initial revision
2716
2717 ------------------------------------------------------------------------
2718 include/ibitblt.h:
2719
2720  * Revision 1.1  1995/08/18  15:50:57  allender
2721  * Initial revision
2722  *
2723  * Revision 1.2  1994/05/31  11:10:56  john
2724  * *** empty log message ***
2725  *
2726  * Revision 1.1  1994/05/30  16:08:46  john
2727  * Initial revision
2728
2729 ------------------------------------------------------------------------
2730 include/iff.h:
2731
2732  * Revision 1.2  1995/05/05  16:33:22  allender
2733  * changed types.h to dtypes.h
2734  *
2735  * Revision 1.1  1995/05/05  08:59:45  allender
2736  * Initial revision
2737  *
2738  * Revision 1.12  1994/11/07  21:26:53  matt
2739  * Added new function iff_read_into_bitmap()
2740  *
2741  * Revision 1.11  1994/05/06  19:37:38  matt
2742  * Improved error handling and checking
2743  *
2744  * Revision 1.10  1994/04/16  20:12:54  matt
2745  * Made masked (stenciled) bitmaps work
2746  *
2747  * Revision 1.9  1994/04/13  23:46:00  matt
2748  * Added function, iff_errormsg(), which returns ptr to error message.
2749  *
2750  * Revision 1.8  1994/04/13  23:27:10  matt
2751  * Put in support for anim brushes (.abm files)
2752  *
2753  * Revision 1.7  1994/04/06  23:08:02  matt
2754  * Cleaned up code; added prototype (but no new code) for anim brush read
2755  *
2756  * Revision 1.6  1994/01/22  14:40:59  john
2757  * Fixed bug with declareations.
2758  *
2759  * Revision 1.5  1994/01/22  14:23:13  john
2760  * Added global vars to check transparency
2761  *
2762  * Revision 1.4  1993/10/27  12:47:42  john
2763  * Extended the comments
2764  *
2765  * Revision 1.3  1993/09/22  19:17:20  matt
2766  * Fixed handling of pad byte in ILBM/PPB body - was writing pad byte to
2767  * destination buffer.
2768  *
2769  * Revision 1.2  1993/09/08  19:23:25  matt
2770  * Added additional return code, IFF_BAD_BM_TYPE
2771  *
2772  * Revision 1.1  1993/09/08  14:24:21  matt
2773  * Initial revision
2774
2775 ------------------------------------------------------------------------
2776 include/ipx.h:
2777
2778  * Revision 2.6  1995/03/29  11:19:32  john
2779  * Added broadcasting over a net.
2780  *
2781  * Revision 2.5  1995/03/28  20:04:43  john
2782  * Took away alternate server stuff.
2783  *
2784  * Revision 2.4  1995/03/23  19:00:10  john
2785  * Added user list capabitly.
2786  *
2787  * Revision 2.3  1995/03/23  12:26:57  john
2788  * Move IPX into bios lib.
2789  *
2790  * Revision 2.2  1995/03/22  19:08:14  john
2791  * Added code to fix sending packets over router... now
2792  * we just need to make broadcasts go over router!!
2793  *
2794  * Revision 2.1  1995/03/21  08:39:56  john
2795  * Ifdef'd out the NETWORK code.
2796  *
2797  * Revision 2.0  1995/02/27  11:30:16  john
2798  * New version 2.0, which has no anonymous unions, builds with
2799  * Watcom 10.0, and doesn't require parsing BITMAPS.TBL.
2800  *
2801  * Revision 1.16  1995/02/16  17:34:52  john
2802  * Added code to allow dynamic socket changing.
2803  *
2804  * Revision 1.15  1995/01/04  21:43:27  rob
2805  * Remove SPX size definition.
2806  *
2807  * Revision 1.14  1995/01/03  13:46:18  john
2808  * Added code that should make ipx work over different servers,
2809  * but ifdef'd it out with SHAREWARE in ipx.c.  I haven't tested
2810  * this, and I hope it doesn't introduce net bugs.
2811  *
2812  * Revision 1.13  1994/11/02  11:37:16  rob
2813  * Changed default socket number to a higher regions.
2814  *
2815  * Revision 1.12  1994/11/01  15:56:51  rob
2816  * Added defines for SPX socketsx.
2817  *
2818  * Revision 1.11  1994/10/31  19:23:31  rob
2819  * Added a prototype for the new object send function.
2820  *
2821  * Revision 1.10  1994/09/07  13:37:25  john
2822  * Changed default socket to 0x4000, because
2823  * the ipx/spx book says that we can only use
2824  * sockets 0x4000 - 0x7fff.
2825  *
2826  * Revision 1.9  1994/08/25  18:14:45  matt
2827  * Changed socket because of packet change
2828  *
2829  * Revision 1.8  1994/08/12  22:42:24  john
2830  * Took away Player_stats; added Players array.
2831  *
2832  * Revision 1.7  1994/08/09  19:31:47  john
2833  * Networking changes.
2834  *
2835  * Revision 1.6  1994/08/05  16:11:46  john
2836  * Psuedo working version of networking.
2837  *
2838  * Revision 1.5  1994/08/04  19:17:20  john
2839  * Inbetween version of network stuff.
2840  *
2841  * Revision 1.4  1994/07/29  16:08:59  john
2842  * *** empty log message ***
2843  *
2844  * Revision 1.3  1994/07/25  12:33:22  john
2845  * Network "pinging" in.
2846  *
2847  * Revision 1.2  1994/07/20  15:58:29  john
2848  * First installment of ipx stuff.
2849  *
2850  * Revision 1.1  1994/07/19  15:43:05  john
2851  * Initial revision
2852
2853 ------------------------------------------------------------------------
2854 include/palette.h:
2855
2856  * Revision 1.11  1994/11/15  17:55:10  john
2857  * Made text palette fade in when game over.
2858  *
2859  * Revision 1.10  1994/11/07  13:53:42  john
2860  * Added better gamma stufff.
2861  *
2862  * Revision 1.9  1994/11/07  13:38:03  john
2863  * Added gamma correction stuff.
2864  *
2865  * Revision 1.8  1994/11/05  13:05:59  john
2866  * Added back in code to allow keys during fade.
2867  *
2868  * Revision 1.7  1994/11/05  12:46:37  john
2869  * Changed palette stuff a bit.
2870  *
2871  * Revision 1.6  1994/09/22  16:08:37  john
2872  * Fixed some palette stuff.
2873  *
2874  * Revision 1.5  1994/08/09  11:27:04  john
2875  * Add cthru stuff.
2876  *
2877  * Revision 1.4  1994/06/09  10:39:33  john
2878  * In fade out.in functions, returned 1 if key was pressed...
2879  *
2880  * Revision 1.3  1994/05/31  19:04:24  john
2881  * Added key to stop fade if desired.
2882  *
2883  * Revision 1.2  1994/05/06  12:50:42  john
2884  * Added supertransparency; neatend things up; took out warnings.
2885  *
2886  * Revision 1.1  1994/05/04  14:59:57  john
2887  * Initial revision
2888
2889 ------------------------------------------------------------------------
2890 include/pcx.h:
2891
2892  * Revision 1.4  1995/01/21  17:07:34  john
2893  * Added out of memory error.
2894  *
2895  * Revision 1.3  1994/11/29  02:53:10  john
2896  * Added error messages; made call be more similiar to iff.
2897  *
2898  * Revision 1.2  1994/11/28  20:03:48  john
2899  * Added PCX functions.
2900  *
2901  * Revision 1.1  1994/11/28  19:57:45  john
2902  * Initial revision
2903
2904 ------------------------------------------------------------------------
2905 include/pstypes.h:
2906
2907  * Revision 1.2  1993/09/14  12:12:30  matt
2908  * Added #define for NULL
2909  *
2910  * Revision 1.1  1993/08/24  12:50:40  matt
2911  * Initial revision
2912
2913 ------------------------------------------------------------------------
2914 include/rle.h:
2915
2916  * Revision 1.5  1995/01/14  11:32:20  john
2917  * Added rle_cache_flush function.
2918  *
2919  * Revision 1.4  1994/11/10  13:16:01  matt
2920  * Added includes
2921  *
2922  * Revision 1.3  1994/11/09  19:53:51  john
2923  * Added texture rle caching.
2924  *
2925  * Revision 1.2  1994/11/09  16:35:18  john
2926  * First version with working RLE bitmaps.
2927  *
2928  * Revision 1.1  1994/11/09  12:40:17  john
2929  * Initial revision
2930
2931 ------------------------------------------------------------------------
2932 include/texmap.h:
2933
2934  * $Log: not supported by cvs2svn $
2935  * Revision 1.2  2004/08/28 23:37:35  schaffner
2936  * move old per-file change logs into new file ChangeLog-old
2937  *
2938  * Revision 1.1  2004/08/28 23:17:45  schaffner
2939  * move old per-file change logs into new file ChangeLog-old
2940  *
2941  * Revision 1.2  2003/03/19 19:21:34  btb
2942  * header/extern declaration housekeeping
2943  *
2944  * Revision 1.1.1.1  2001/01/19 03:30:16  bradleyb
2945  * Import of d2x-0.0.8
2946  *
2947  * Revision 1.2  1999/07/07 21:21:56  donut
2948  * increased recip table size to better accommodate 640 res
2949  *
2950  * Revision 1.1.1.1  1999/06/14 22:02:20  donut
2951  * Import of d1x 1.37 source.
2952  *
2953  * Revision 1.2  1995/09/04  14:22:10  allender
2954  * #defines for fixed point limits on render buffer
2955  *
2956  * Revision 1.1  1995/05/04  20:14:50  allender
2957  * Initial revision
2958  *
2959  * Revision 1.17  1994/11/10  11:09:16  mike
2960  * detail level stuff.
2961  * 
2962  * Revision 1.16  1994/11/09  22:55:32  matt
2963  * Added variable Current_seg_depth for detail level optimization
2964  * 
2965  * Revision 1.15  1994/06/09  16:10:04  mike
2966  * Add prototype for SC2000
2967  * 
2968  * Revision 1.14  1994/05/25  18:46:16  matt
2969  * Added gr_upoly_tmap_ylr(), which generates ylr's for a polygon
2970  * 
2971  * Revision 1.13  1994/05/25  09:47:12  mike
2972  * Added interface support for linear texture mapper (Mike change, Matt commnet)
2973  * 
2974  * Revision 1.12  1994/05/24  17:30:43  mike
2975  * Prototype a bunch of linear, vertical scanning functions.
2976  * 
2977  * Revision 1.11  1994/05/19  23:26:14  mike
2978  * Add constants NUM_LIGHTING_VALUES, MAX_LIGHTING_VALUE, MIN_LIGHTING_VALUE,
2979  * all part of new lighting_values_in_0_to_1 system.
2980  * 
2981  * Revision 1.10  1994/05/14  17:19:21  matt
2982  * Added externs
2983  * 
2984  * Revision 1.9  1994/04/13  23:55:44  matt
2985  * Increased max_tmap_verts from 16 to 25
2986  * 
2987  * Revision 1.8  1994/03/31  08:35:43  mike
2988  * Prototype for gr_upoly_tmap.
2989  * 
2990  * Revision 1.7  1994/02/08  15:17:54  mike
2991  * define label for MAX_TMAP_VERTS
2992  * 
2993  * Revision 1.6  1994/01/31  15:41:51  mike
2994  * Add texture_map_lin_lin_sky_v
2995  * 
2996  * Revision 1.5  1994/01/18  10:49:40  mike
2997  * prototype for texture_map_lin_lin_sky
2998  * 
2999  * Revision 1.4  1993/11/30  17:09:46  mike
3000  * prototype for compute_lighting_value.
3001  * 
3002  * Revision 1.3  1993/11/22  10:50:38  matt
3003  * Add ifndef around body of file
3004  * 
3005  * Revision 1.2  1993/10/06  12:41:25  mike
3006  * Change prototype for draw_tmap.
3007  * 
3008  * Revision 1.1  1993/09/08  17:29:11  mike
3009  * Initial revision
3010
3011 ------------------------------------------------------------------------
3012 include/timer.h:
3013
3014  * Revision 1.8  1994/12/10  12:27:23  john
3015  * Added timer_get_approx_seconds.
3016  *
3017  * Revision 1.7  1994/12/10  12:10:25  john
3018  * Added types.h.
3019  *
3020  * Revision 1.6  1994/12/10  12:07:06  john
3021  * Added tick counter variable.
3022  *
3023  * Revision 1.5  1994/11/15  12:04:15  john
3024  * Cleaned up timer code a bit... took out unused functions
3025  * like timer_get_milliseconds, etc.
3026  *
3027  * Revision 1.4  1994/04/28  23:50:08  john
3028  * Changed calling for init_timer.  Made the function that the
3029  * timer calls be a far function. All of this was done to make
3030  * our timer system compatible with the HMI sound stuff.
3031  *
3032  * Revision 1.3  1994/02/17  15:57:12  john
3033  * Changed key libary to C.
3034  *
3035  * Revision 1.2  1994/01/18  10:58:34  john
3036  * Added timer_get_fixed_seconds
3037  *
3038  * Revision 1.1  1993/07/10  13:10:41  matt
3039  * Initial revision
3040
3041 ------------------------------------------------------------------------
3042 include/u_dpmi.h:
3043
3044  * Revision 1.9  1995/01/14  19:20:14  john
3045  * Added function to set a selector's base address.
3046  *
3047  * Revision 1.8  1994/11/28  20:22:03  john
3048  * Added some variables that return the amount of available
3049  * memory.
3050  *
3051  * Revision 1.7  1994/11/15  18:26:38  john
3052  * Added verbose flag.
3053  *
3054  * Revision 1.6  1994/11/07  11:35:05  john
3055  * Added prototype for real_free
3056  *
3057  * Revision 1.5  1994/10/27  19:54:48  john
3058  * Added unlock region function,.
3059  *
3060  * Revision 1.4  1994/09/27  18:27:56  john
3061  * Added pragma to make inp,outp,enable,disable intrinsic
3062  *
3063  * Revision 1.3  1994/09/27  11:54:45  john
3064  * Added DPMI init function.
3065  *
3066  * Revision 1.2  1994/08/24  18:53:51  john
3067  * Made Cyberman read like normal mouse; added dpmi module; moved
3068  * mouse from assembly to c. Made mouse buttons return time_down.
3069  *
3070  * Revision 1.1  1994/08/24  10:22:48  john
3071  * Initial revision
3072
3073 ------------------------------------------------------------------------
3074 include/vecmat.h:
3075
3076  * Revision 1.1  1995/04/17  16:18:05  allender
3077  * Initial revision
3078  *
3079  *
3080  * --- PC RCS Information ---
3081  * Revision 1.37  1995/02/22  13:23:22  john
3082  * Added the vms_vector_array structure, to access a vms_vector
3083  * with an array.
3084  *
3085  * Revision 1.36  1995/02/22  12:34:33  john
3086  * Took out anonymous unions.
3087  *
3088  * Revision 1.35  1994/12/13  14:44:20  matt
3089  * Added vm_vector_2_matrix_norm()
3090  *
3091  * Revision 1.34  1994/09/11  19:22:55  matt
3092  * Added vm_vec_normalized_dir_quick()
3093  *
3094  * Revision 1.33  1994/08/04  19:45:38  matt
3095  * Added option to make a bunch of functions (add, sub, dotprod) inline
3096  *
3097  * Revision 1.32  1994/07/19  18:52:36  matt
3098  * Added vm_vec_normalize_quick() and vm_vec_copy_normalize_quick()
3099  *
3100  * Revision 1.31  1994/06/16  18:24:30  matt
3101  * Added vm_vec_mag_quick()
3102  *
3103  * Revision 1.30  1994/06/10  23:19:00  matt
3104  * New register usage for vm_vec_ang_2_matrix()
3105  *
3106  * Revision 1.29  1994/06/01  17:32:06  matt
3107  * Fixed modify list for vm_vec_normalized_dir()
3108  *
3109  * Revision 1.28  1994/05/19  12:07:20  matt
3110  * Fixed globals and macros and added a constant
3111  *
3112  * Revision 1.27  1994/05/19  09:19:15  matt
3113  * Made vm_vec_normalized_dir() return mag of vector
3114  *
3115  * Revision 1.26  1994/05/18  22:28:57  matt
3116  * Added function vm_vec_normalized_dir()
3117  * Added C macros IS_ZERO_VEC(), vm_vec_zero(), and vm_set_identity()
3118  * Added C global static vars vmd_zero_vector & vmd_identity_matrix
3119  *
3120  * Revision 1.25  1994/05/18  21:45:06  matt
3121  * Added functions:
3122  *   vm_extract_angles_vector()
3123  *   vm_extract_angles_vector_normalized()
3124  *   vm_vec_copy_normalize()
3125  *
3126  * Revision 1.24  1994/05/13  12:42:16  matt
3127  * Added new function, vm_vec_dist_quick(), which does an approximation.
3128  *
3129  * Revision 1.23  1994/03/30  13:37:34  matt
3130  * Added prototype for vm_vec_scale_add(), and fixed typos
3131  *
3132  * Revision 1.22  1994/03/30  13:29:42  matt
3133  * Header for vm_vec_scale_add2()
3134  *
3135  * Revision 1.21  1994/01/31  19:45:13  matt
3136  * Added function vm_extract_angles_matrix()
3137  *
3138  * Revision 1.20  1993/12/21  19:46:14  matt
3139  * Added function vm_dist_to_plane()
3140  *
3141  * Revision 1.19  1993/12/13  17:26:41  matt
3142  * Added vm_vec_dist()
3143  *
3144  * Revision 1.18  1993/12/02  12:45:11  matt
3145  * New functions: vm_vec_copy_scale(), vm_vec_scale2()
3146  * Aliases: vm_transpose(), vm_vec_dot(), vm_vec_cross(), vm_copy_transpose()
3147  *
3148  * Revision 1.17  1993/10/29  22:38:36  matt
3149  * Changed matrix order, making direction vectors the rows
3150  *
3151  * Revision 1.16  1993/10/25  11:49:57  matt
3152  * Made vm_vec_delta_ang() take optional forward vector to return signed delta
3153  *
3154  * Revision 1.15  1993/10/20  01:10:05  matt
3155  * Added vm_vec_delta_ang(), vm_vec_delta_ang_norm(), and vm_vec_ang_2_matrix()
3156  *
3157  * Revision 1.14  1993/10/17  17:02:52  matt
3158  * vm_vector_2_matrix() now takes optional right vector
3159  *
3160  * Revision 1.13  1993/10/12  19:31:39  matt
3161  * Added IDENTITY_MATRIX constant
3162  *
3163  * Revision 1.12  1993/10/08  18:10:16  matt
3164  * Changed vm_vec_make() and vm_angvec_make() to be inline assembly
3165  * functions, to get rid of compiler warnings.  Did not change vm_mat_make(),
3166  * which could still get warnings if the return value is unused.
3167  *
3168  * Revision 1.11  1993/09/29  12:10:07  matt
3169  * Changed modified regs in pragmas to include return register
3170  *
3171  * Revision 1.10  1993/09/28  12:15:41  matt
3172  * Added func vm_vector_2_matrix()
3173  *
3174  * Revision 1.9  1993/09/24  21:18:38  matt
3175  * Added vm_vec_avg(), vm_vec_avg4(), and vm_angvec_make().
3176  * Documented which functions could have dest==source
3177  *
3178  * Revision 1.8  1993/09/20  14:56:11  matt
3179  * Added new function, vm_vec_perp()
3180  *
3181  * Revision 1.7  1993/09/20  14:27:42  mike
3182  * unfix last fix which introduced a bug
3183  *
3184  * Revision 1.6  1993/09/20  10:11:53  mike
3185  * no changes
3186  *
3187  * Revision 1.5  1993/09/20  09:58:58  mike
3188  * Re-fix vm_vec_make
3189  *
3190  * Revision 1.4  1993/09/20  09:41:21  mike
3191  * Correct vm_vec_make and vm_mat_make macros to return the destination
3192  * as the value of the macro.
3193  *
3194  * Revision 1.3  1993/09/17  11:23:47  matt
3195  * Added row access (via xrow,yrow,zrow) to vms_matrix
3196  * Added macro vm_mat_make(), like vm_vec_make()
3197  *
3198  * Revision 1.2  1993/09/17  11:10:32  matt
3199  * Added vm_vec_add2() and vm_vec_sub2(), which take 2 args (dest==src0)
3200  *
3201  * Revision 1.1  1993/09/16  20:10:01  matt
3202  * Initial revision
3203
3204 ------------------------------------------------------------------------
3205 main/ai.c:
3206
3207  * Revision 1.1  1995/12/05  14:15:37  allender
3208  * Initial revision
3209  *
3210  * Revision 1.10  1995/11/09  09:36:12  allender
3211  * cheats not active during demo playback
3212  *
3213  * Revision 1.9  1995/11/03  12:51:55  allender
3214  * shareware changes
3215  *
3216  * Revision 1.8  1995/10/31  10:25:07  allender
3217  * shareware stuff
3218  *
3219  * Revision 1.7  1995/10/26  14:01:38  allender
3220  * optimization for doing robot stuff only if anim angles done last frame
3221  *
3222  * Revision 1.6  1995/10/25  09:35:43  allender
3223  * prototype some functions causing mcc problems
3224  *
3225  * Revision 1.5  1995/10/17  13:11:40  allender
3226  * fix in ai code that makes bots only look for you every so often
3227  *
3228  * Revision 1.4  1995/10/10  11:48:10  allender
3229  * PC ai code
3230  *
3231  * Revision 2.11  1995/07/09  11:15:48  john
3232  * Put in Mike's code to fix bug where bosses don't gate in bots after
3233  * 32767 seconds of playing.
3234  *
3235  * Revision 2.10  1995/06/15  12:31:08  john
3236  * Fixed bug with cheats getting enabled when you type
3237  * the whole alphabet.
3238  *
3239  * Revision 2.9  1995/05/26  16:16:18  john
3240  * Split SATURN into define's for requiring cd, using cd, etc.
3241  * Also started adding all the Rockwell stuff.
3242  *
3243  * Revision 2.8  1995/04/06  15:12:27  john
3244  * Fixed bug with insane not working.
3245  *
3246  * Revision 2.7  1995/03/30  16:36:44  mike
3247  * text localization.
3248  *
3249  * Revision 2.6  1995/03/28  11:22:24  john
3250  * Added cheats to save file. Changed lunacy text.
3251  *
3252  * Revision 2.5  1995/03/27  16:45:07  john
3253  * Fixed some cheat bugs.  Added astral cheat.
3254  *
3255  * Revision 2.4  1995/03/24  15:29:17  mike
3256  * add new cheats.
3257  *
3258  * Revision 2.3  1995/03/21  14:39:45  john
3259  * Ifdef'd out the NETWORK code.
3260  *
3261  * Revision 2.2  1995/03/14  18:24:39  john
3262  * Force Destination Saturn to use CD-ROM drive.
3263  *
3264  * Revision 2.1  1995/03/06  16:47:14  mike
3265  * destination saturn
3266  *
3267  * Revision 2.0  1995/02/27  11:30:01  john
3268  * New version 2.0, which has no anonymous unions, builds with
3269  * Watcom 10.0, and doesn't require parsing BITMAPS.TBL.
3270  *
3271  * Revision 1.295  1995/02/22  13:23:04  allender
3272  * remove anonymous unions from object structure
3273  *
3274  * Revision 1.294  1995/02/13  11:00:43  rob
3275  * Make brain guys high enough to get an open slot.
3276  *
3277  * Revision 1.293  1995/02/13  10:31:55  mike
3278  * Make brains understand they can't open locked doors.
3279  *
3280  * Revision 1.292  1995/02/13  10:18:01  rob
3281  * Reduced brain guy's level of awareness to keep him from hogging slots.
3282  *
3283  * Revision 1.291  1995/02/11  12:27:12  mike
3284  * fix path-to-exit cheat.
3285  *
3286  * Revision 1.290  1995/02/11  01:56:30  mike
3287  * robots don't fire cheat.
3288  *
3289  * Revision 1.289  1995/02/10  17:15:09  rob
3290  * Fixed some stuff with 64 awareness stuff.
3291  *
3292  * Revision 1.288  1995/02/10  16:31:32  mike
3293  * oops.
3294  *
3295  * Revision 1.287  1995/02/10  16:24:45  mike
3296  * fix the network follow path fix.
3297  *
3298  * Revision 1.286  1995/02/10  16:11:40  mike
3299  * in serial or modem games, follow path guys don't move if far away and
3300  * can't see player.
3301  *
3302  * Revision 1.285  1995/02/09  13:11:35  mike
3303  * comment out a bunch of mprintfs.
3304  * add toaster (drops prox bombs, runs away) to boss gate list.
3305  *
3306  * Revision 1.284  1995/02/08  22:44:53  rob
3307  * Lowerd anger level for follow path of any sort.
3308  *
3309  * Revision 1.283  1995/02/08  22:30:43  mike
3310  * lower awareness on station guys if they are returning home (multiplayer).
3311  *
3312  * Revision 1.282  1995/02/08  17:01:06  rob
3313  * Fixed problem with toasters dropping of proximity bombs.
3314  *
3315  * Revision 1.281  1995/02/08  11:49:35  rob
3316  * Reduce Green-guy attack awareness level so we don't let him attack us too.
3317  *
3318  * Revision 1.280  1995/02/08  11:37:52  mike
3319  * Check for failures in call to obj_create.
3320  *
3321  * Revision 1.279  1995/02/07  20:38:46  mike
3322  * fix toasters in multiplayer
3323  *
3324  *
3325  * Revision 1.278  1995/02/07  16:51:07  mike
3326  * fix sound time play bug.
3327  *
3328  * Revision 1.277  1995/02/06  22:33:04  mike
3329  * make robots follow path better in cooperative/roboarchy.
3330  *
3331  * Revision 1.276  1995/02/06  18:15:42  rob
3332  * Added forced sends for evasion movemnet.
3333  *
3334  * Revision 1.275  1995/02/06  16:41:22  rob
3335  * Change some positioning calls.
3336  *
3337  * Revision 1.274  1995/02/06  11:40:33  mike
3338  * replace some lint-related hacks with clean, proper code.
3339  *
3340  * Revision 1.273  1995/02/04  17:28:19  mike
3341  * make station guys return better.
3342  *
3343  * Revision 1.272  1995/02/03  17:40:55  mike
3344  * fix problem with robots falling asleep if you sit in game overnight, not in pause...bah.
3345  *
3346  * Revision 1.271  1995/02/02  21:11:25  rob
3347  * Tweaking stuff for multiplayer ai.
3348  *
3349  * Revision 1.270  1995/02/02  17:32:06  john
3350  * Added Hack for Assert that Mike put in after using Lint to find
3351  * uninitialized variables.
3352  *
3353  * Revision 1.269  1995/02/02  16:46:31  mike
3354  * fix boss gating.
3355  *
3356  * Revision 1.268  1995/02/02  16:27:29  mike
3357  * make boss not put out infinite robots.
3358  *
3359  * Revision 1.267  1995/02/01  21:10:02  mike
3360  * lint found bug! player_visibility not initialized!
3361  *
3362  * Revision 1.266  1995/02/01  20:51:27  john
3363  * Lintized
3364  *
3365  * Revision 1.265  1995/02/01  17:14:05  mike
3366  * fix robot sounds.
3367  *
3368  * Revision 1.264  1995/01/31  16:16:40  mike
3369  * Comment out "Darn you, John" Int3().
3370  *
3371  * Revision 1.263  1995/01/30  20:55:04  mike
3372  * fix nonsense in robot firing when a player is cloaked.
3373  *
3374  * Revision 1.262  1995/01/30  17:15:10  rob
3375  * Fixed problems with bigboss eclip messages.
3376  * Tweaked robot position sending for modem purposes.
3377  *
3378  * Revision 1.261  1995/01/30  15:30:31  rob
3379  * Prevent non-master players from gating in robots.
3380  *
3381  * Revision 1.260  1995/01/30  13:30:55  mike
3382  * new cases for firing at other players were bogus, could send position
3383  * without permission.
3384  *
3385  * Revision 1.259  1995/01/30  13:01:17  mike
3386  * Make robots fire at player other than one they are controlled by sometimes.
3387  *
3388  * Revision 1.258  1995/01/29  16:09:17  rob
3389  * Trying to get robots to shoot at non-controlling players.
3390  *
3391  * Revision 1.257  1995/01/29  13:47:05  mike
3392  * Make boss have more fireballs on death, have until end (though silent at end).
3393  * Fix bug which was preventing him from teleporting until hit, so he'd always
3394  * be in the same place when the player enters the room.
3395  *
3396  * Revision 1.256  1995/01/28  17:40:18  mike
3397  * make boss teleport & gate before you see him.
3398  *
3399  * Revision 1.255  1995/01/27  17:02:08  mike
3400  * move code around, was sending one frame (or worse!) old robot information.
3401  *
3402  * Revision 1.254  1995/01/26  17:02:43  mike
3403  * make fusion cannon have more chrome, make fusion, mega rock you!
3404  *
3405  * Revision 1.253  1995/01/26  15:11:17  rob
3406  * Shutup!  I fixed it!
3407  *
3408  * Revision 1.252  1995/01/26  15:08:55  rob
3409  * Changed robot gating to accomodate multiplayer.
3410  *
3411  * Revision 1.251  1995/01/26  14:49:04  rob
3412  * Increase awareness level for firing to 94.
3413  *
3414  * Revision 1.250  1995/01/26  12:41:20  mike
3415  * fix bogus multiplayer code, would send permission without getting permission.
3416  *
3417  * Revision 1.249  1995/01/26  12:23:23  rob
3418  * Removed defines that were moved to ai.h
3419  *
3420  * Revision 1.248  1995/01/25  23:38:48  mike
3421  * modify list of robots gated in by super boss.
3422  *
3423  * Revision 1.247  1995/01/25  21:21:13  rob
3424  * Trying to let robots fire at a player even if they're not in control.
3425  *
3426  * Revision 1.246  1995/01/25  13:50:37  mike
3427  * Robots make angry sounds.
3428  *
3429  * Revision 1.245  1995/01/25  10:53:47  mike
3430  * better handling of robots which poke out of mine and try to recover.
3431  *
3432  * Revision 1.244  1995/01/24  22:03:02  mike
3433  * Tricky code to move a robot to a legal position if he is poking out of
3434  * the mine, even if it means moving him to another segment.
3435  *
3436  * Revision 1.243  1995/01/24  20:12:06  rob
3437  * Changed robot fire awareness level from 74 to 94.
3438  *
3439  * Revision 1.242  1995/01/24  13:22:32  mike
3440  * make robots accelerate faster, and Difficulty_level dependent.
3441  *
3442  * Revision 1.241  1995/01/24  12:09:39  mike
3443  * make robots animate in multiplayer.
3444  *
3445  * Revision 1.240  1995/01/21  21:21:10  mike
3446  * Make boss only gate robots into specified segments.
3447  *
3448  * Revision 1.239  1995/01/20  20:21:26  mike
3449  * prevent unnecessary boss cloaking.
3450
3451 ------------------------------------------------------------------------
3452 main/ai.h:
3453
3454  * Revision 1.3  1995/10/15  16:28:07  allender
3455  * added flag to player_is_visible function
3456  *
3457  * Revision 1.2  1995/10/10  11:48:32  allender
3458  * PC ai header
3459  *
3460  * Revision 1.1  1995/05/16  15:54:00  allender
3461  * Initial revision
3462  *
3463  * Revision 2.0  1995/02/27  11:33:07  john
3464  * New version 2.0, which has no anonymous unions, builds with
3465  * Watcom 10.0, and doesn't require parsing BITMAPS.TBL.
3466  *
3467  * Revision 1.57  1995/02/04  17:28:31  mike
3468  * make station guys return better.
3469  *
3470  * Revision 1.56  1995/02/04  10:03:23  mike
3471  * Fly to exit cheat.
3472  *
3473  * Revision 1.55  1995/02/01  19:23:52  rob
3474  * Externed a boss var.
3475  *
3476  * Revision 1.54  1995/01/30  13:00:58  mike
3477  * Make robots fire at player other than one they are controlled by sometimes.
3478  *
3479  * Revision 1.53  1995/01/26  15:09:16  rob
3480  * Changed robot gating to accomodate multiplayer.
3481  *
3482  * Revision 1.52  1995/01/26  12:23:12  rob
3483  * Added new externs needed for multiplayer.
3484  *
3485  * Revision 1.51  1995/01/21  21:22:14  mike
3486  * Kill prototype of init_boss_segments, which didn't need to be public
3487  * and had changed.
3488  *
3489  * Revision 1.50  1995/01/16  19:24:29  mike
3490  * Publicize BOSS_GATE_MATCEN_NUM and Boss_been_hit.
3491  *
3492  * Revision 1.49  1995/01/02  16:17:35  mike
3493  * prototype some super boss function for gameseq.
3494  *
3495  * Revision 1.48  1994/12/19  17:08:06  mike
3496  * deal with new ai_multiplayer_awareness which returns a value saying whether this object can be moved by this player.
3497  *
3498  * Revision 1.47  1994/12/12  17:18:04  mike
3499  * make boss cloak/teleport when get hit, make quad laser 3/4 as powerful.
3500  *
3501  * Revision 1.46  1994/12/08  15:46:16  mike
3502  * better robot behavior.
3503  *
3504  * Revision 1.45  1994/11/27  23:16:08  matt
3505  * Made debug code go away when debugging turned off
3506  *
3507  * Revision 1.44  1994/11/16  23:38:41  mike
3508  * new improved boss teleportation behavior.
3509  *
3510  * Revision 1.43  1994/11/10  17:45:11  mike
3511  * debugging.
3512  *
3513  * Revision 1.42  1994/11/07  10:37:42  mike
3514  * hooks for rob's network code.
3515  *
3516  * Revision 1.41  1994/11/06  15:10:50  mike
3517  * prototype a debug function for dumping ai info.
3518  *
3519  * Revision 1.40  1994/11/02  17:57:30  rob
3520  * Added extern of Believe_player_pos needed to get control centers
3521  * locating people.
3522  *
3523  * Revision 1.39  1994/10/28  19:43:39  mike
3524  * Prototype Boss_cloak_start_time, Boss_cloak_end_time.
3525  *
3526  * Revision 1.38  1994/10/22  14:14:42  mike
3527  * Prototype ai_reset_all_paths.
3528  *
3529  * Revision 1.37  1994/10/21  20:42:01  mike
3530  * Define MAX_PATH_LENGTH: maximum allowed length of a path.
3531  *
3532  * Revision 1.36  1994/10/20  09:49:18  mike
3533  * Prototype something.
3534  *
3535  *
3536  * Revision 1.35  1994/10/18  15:37:52  mike
3537  * Define ROBOT_BOSS1.
3538  *
3539  * Revision 1.34  1994/10/13  11:12:25  mike
3540  * Prototype some door functions.
3541  *
3542  * Revision 1.33  1994/10/12  21:28:51  mike
3543  * Prototype create_n_segment_path_to_door
3544  * Prototype ai_open_doors_in_segment
3545  * Prototype ai_door_is_openable.
3546  *
3547  * Revision 1.32  1994/10/11  15:59:41  mike
3548  * Prototype Robot_firing_enabled.
3549  *
3550  * Revision 1.31  1994/10/09  22:02:48  mike
3551  * Adapt create_path_points and create_n_segment_path prototypes to use avoid_seg for player evasion.
3552  *
3553  * Revision 1.30  1994/09/18  18:07:44  mike
3554  * Update prototypes for create_path_points and create_path_to_player.
3555  *
3556  * Revision 1.29  1994/09/15  16:34:08  mike
3557  * Prototype do_ai_robot_hit_attack.
3558  *
3559  * Revision 1.28  1994/09/12  19:12:35  mike
3560  * Prototype attempt_to_resume_path.
3561  *
3562  * Revision 1.27  1994/08/25  21:55:32  mike
3563  * Add some prototypes.
3564  *
3565  * Revision 1.26  1994/08/10  19:53:24  mike
3566  * Prototype create_path_to_player and init_robots_for_level.
3567  *
3568  * Revision 1.25  1994/08/04  16:32:58  mike
3569  * prototype create_path_to_player.
3570  *
3571  * Revision 1.24  1994/08/03  15:17:20  mike
3572  * Prototype make_random_vector.
3573  *
3574  * Revision 1.23  1994/07/31  18:10:34  mike
3575  * Update prototype for create_path_points.
3576  *
3577  * Revision 1.22  1994/07/28  12:36:14  matt
3578  * Cleaned up object bumping code
3579
3580 ------------------------------------------------------------------------
3581 main/ai2.c:
3582
3583  * Revision 1.1  1995/05/25  12:00:31  mike
3584  * Initial revision
3585
3586 ------------------------------------------------------------------------
3587 main/aipath.c:
3588
3589  * Revision 1.5  1995/10/26  14:12:03  allender
3590  * prototype functions for mcc compiler
3591  *
3592  * Revision 1.4  1995/10/25  09:38:22  allender
3593  * prototype some functions causing mcc grief
3594  *
3595  * Revision 1.3  1995/10/10  11:48:43  allender
3596  * PC ai code
3597  *
3598  * Revision 2.0  1995/02/27  11:30:48  john
3599  * New version 2.0, which has no anonymous unions, builds with
3600  * Watcom 10.0, and doesn't require parsing BITMAPS.TBL.
3601  *
3602  * Revision 1.101  1995/02/22  13:42:44  allender
3603  * remove anonymous unions for object structure
3604  *
3605  * Revision 1.100  1995/02/10  16:20:04  mike
3606  * fix bogosity in create_path_points, assumed all objects were robots.
3607  *
3608  * Revision 1.99  1995/02/07  21:09:30  mike
3609  * make run_from guys have diff level based speed.
3610  *
3611  * Revision 1.98  1995/02/04  17:28:29  mike
3612  * make station guys return better.
3613  *
3614  * Revision 1.97  1995/02/04  10:28:39  mike
3615  * fix compile error!
3616  *
3617  * Revision 1.96  1995/02/04  10:03:37  mike
3618  * Fly to exit cheat.
3619  *
3620  * Revision 1.95  1995/02/01  21:10:36  mike
3621  * Array name was dereferenced.  Not a bug, but unclean.
3622  *
3623  * Revision 1.94  1995/02/01  17:14:12  mike
3624  * comment out some common mprintfs which didn't matter.
3625  *
3626  * Revision 1.93  1995/01/30  13:01:23  mike
3627  * Make robots fire at player other than one they are controlled by sometimes.
3628  *
3629  * Revision 1.92  1995/01/29  22:29:32  mike
3630  * add more debug info for guys that get lost.
3631  *
3632  * Revision 1.91  1995/01/20  16:56:05  mike
3633  * station stuff.
3634  *
3635  * Revision 1.90  1995/01/18  10:59:45  mike
3636  * comment out some mprintfs.
3637  *
3638  * Revision 1.89  1995/01/17  16:58:34  mike
3639  * make path following work for multiplayer.
3640  *
3641  * Revision 1.88  1995/01/17  14:21:44  mike
3642  * make run_from guys run better.
3643  *
3644  * Revision 1.87  1995/01/14  17:09:04  mike
3645  * playing with crazy josh, he's kinda slow and dumb now.
3646  *
3647  * Revision 1.86  1995/01/13  18:52:28  mike
3648  * comment out int3.
3649  *
3650  * Revision 1.85  1995/01/05  09:42:11  mike
3651  * compile out code based on SHAREWARE.
3652  *
3653  * Revision 1.84  1995/01/02  12:38:32  mike
3654  * make crazy josh turn faster, therefore evade player better.
3655  *
3656  * Revision 1.83  1994/12/27  15:59:40  mike
3657  * tweak ai_multiplayer_awareness constants.
3658  *
3659  * Revision 1.82  1994/12/19  17:07:10  mike
3660  * deal with new ai_multiplayer_awareness which returns a value saying whether this object can be moved by this player.
3661  *
3662  * Revision 1.81  1994/12/15  13:04:30  mike
3663  * Replace Players[Player_num].time_total references with GameTime.
3664  *
3665  * Revision 1.80  1994/12/09  16:13:23  mike
3666  * remove debug code.
3667  *
3668  * Revision 1.79  1994/12/07  00:36:54  mike
3669  * make robots get out of matcens better and be aware of player.
3670  *
3671  * Revision 1.78  1994/11/30  00:59:05  mike
3672  * optimizations.
3673  *
3674  * Revision 1.77  1994/11/27  23:13:39  matt
3675  * Made changes for new mprintf calling convention
3676  *
3677  * Revision 1.76  1994/11/23  21:59:34  mike
3678  * comment out some mprintfs.
3679  *
3680  * Revision 1.75  1994/11/21  16:07:14  mike
3681  * flip PARALLAX flag, prevent annoying debug information.
3682  *
3683  * Revision 1.74  1994/11/19  15:13:28  mike
3684  * remove unused code and data.
3685  *
3686  * Revision 1.73  1994/11/17  14:53:15  mike
3687  * segment validation functions moved from editor to main.
3688  *
3689  * Revision 1.72  1994/11/16  23:38:42  mike
3690  * new improved boss teleportation behavior.
3691  *
3692  * Revision 1.71  1994/11/13  17:18:30  mike
3693  * debug code, then comment it out.
3694  *
3695  * Revision 1.70  1994/11/11  16:41:43  mike
3696  * flip the PARALLAX flag.
3697  *
3698  * Revision 1.69  1994/11/11  16:33:45  mike
3699  * twiddle the PARALLAX flag.
3700  *
3701  *
3702  * Revision 1.68  1994/11/10  21:32:29  mike
3703  * debug code.
3704  *
3705  * Revision 1.67  1994/11/10  20:15:07  mike
3706  * fix stupid bug: uninitialized pointer.
3707  *
3708  * Revision 1.66  1994/11/10  17:45:15  mike
3709  * debugging.
3710  *
3711  * Revision 1.65  1994/11/10  17:28:10  mike
3712  * debugging.
3713
3714 ------------------------------------------------------------------------
3715 main/aistruct.h:
3716
3717  * Revision 1.2  1995/10/10  11:49:04  allender
3718  * PC ai code
3719  *
3720  * Revision 1.1  1995/05/16  15:54:08  allender
3721  * Initial revision
3722  *
3723  * Revision 2.0  1995/02/27  11:30:19  john
3724  * New version 2.0, which has no anonymous unions, builds with
3725  * Watcom 10.0, and doesn't require parsing BITMAPS.TBL.
3726  *
3727  * Revision 1.34  1995/01/25  13:50:46  mike
3728  * Robots make angry sounds.
3729  *
3730  * Revision 1.33  1994/12/29  12:44:56  rob
3731  * Added new coop robot flag.
3732  *
3733  * Revision 1.32  1994/12/20  20:41:54  rob
3734  * Added new ai flag for multiplayer robots.
3735  *
3736  * Revision 1.31  1994/12/19  16:37:39  rob
3737  * Added a new flag for remote controlled objects.
3738  *
3739  * Revision 1.30  1994/12/07  00:36:07  mike
3740  * fix phys_apply_rot for robots -- ai was bashing effect in next frame.
3741  *
3742  * Revision 1.29  1994/12/02  22:06:28  mike
3743  * add fields to allow robots to make awareness sounds every so often, not every damn blasted frame
3744  *
3745  * Revision 1.28  1994/11/04  17:18:35  yuan
3746  * Increased MAX_SEG_POINTS to 2500.
3747  *
3748  * Revision 1.27  1994/10/17  21:19:22  mike
3749  * robot cloaking.
3750  *
3751  * Revision 1.26  1994/10/12  21:28:38  mike
3752  * Add new ai mode: AIM_OPEN_DOOR.
3753  * Add GOALSIDE to aip.
3754  *
3755  * Revision 1.25  1994/09/25  23:41:08  matt
3756  * Changed the object load & save code to read/write the structure fields one
3757  * at a time (rather than the whole structure at once).  This mean that the
3758  * object structure can be changed without breaking the load/save functions.
3759  * As a result of this change, the local_object data can be and has been
3760  * incorporated into the object array.  Also, timeleft is now a property
3761  * of all objects, and the object structure has been otherwise cleaned up.
3762  *
3763  * Revision 1.24  1994/09/21  12:28:11  mike
3764  * Change AI behavior for when player cloaked
3765  *
3766  * Revision 1.23  1994/09/19  21:43:00  mike
3767  * Add follow_path_start_seg and follow_path_end_seg to aistruct.h.
3768  *
3769  * Revision 1.22  1994/09/18  18:06:14  mike
3770  * Add Last_uncloaked_time and Last_uncloaked_position variables.
3771  *
3772  * Revision 1.21  1994/09/15  16:31:38  mike
3773  * Define GREEN_GUY
3774  * Add previous_visibility to ai_local struct.
3775  *
3776  * Revision 1.20  1994/09/12  19:12:45  mike
3777  * Change some bytes to ints in ai_local so I could set watchpoints.
3778  *
3779  * Revision 1.19  1994/08/25  21:53:31  mike
3780  * Add behavior, taking place of what used to be mode.
3781  *
3782  * Revision 1.18  1994/08/23  16:38:09  mike
3783  * rapidfire_count in ai_local.
3784  *
3785  * Revision 1.17  1994/08/19  17:38:23  mike
3786  * *** empty log message ***
3787  *
3788  * Revision 1.16  1994/08/17  22:18:58  mike
3789  * add time_since_processed to ai_local.
3790  *
3791  * Revision 1.15  1994/08/10  19:52:25  mike
3792  * Add Overall_agitation.
3793  *
3794  * Revision 1.14  1994/08/04  16:32:32  mike
3795  * Add time_player_seen.
3796  *
3797  * Revision 1.13  1994/07/28  16:58:11  mike
3798  * Move constants from ai.c
3799  *
3800  * Revision 1.12  1994/07/19  15:26:24  mike
3801  * New ai_static and ai_local structures.
3802  *
3803  * Revision 1.11  1994/07/15  15:17:19  matt
3804  * Changes MAX_AI_FLAGS for better alignment
3805
3806 ------------------------------------------------------------------------
3807 main/automap.c:
3808
3809  * Revision 1.8  1995/10/31  10:24:54  allender
3810  * shareware stuff
3811  *
3812  * Revision 1.7  1995/10/21  16:18:20  allender
3813  * blit pcx background directly to Page canvas instead of creating
3814  * seperate bitmap for it -- hope to solve VM bug on some macs
3815  *
3816  * Revision 1.6  1995/10/20  00:49:16  allender
3817  * added redbook check during automap
3818  *
3819  * Revision 1.5  1995/09/13  08:44:07  allender
3820  * Dave Denhart's changes to speed up the automap
3821  *
3822  * Revision 1.4  1995/08/18  15:46:00  allender
3823  * put text all on upper bar -- and fixed background since
3824  * changing xparency color
3825  *
3826  * Revision 1.3  1995/08/03  15:15:18  allender
3827  * fixed edge hashing problem causing automap to crash
3828  *
3829  * Revision 1.2  1995/07/12  12:49:27  allender
3830  * works in 640x480 mode
3831  *
3832  * Revision 1.1  1995/05/16  15:22:59  allender
3833  * Initial revision
3834  *
3835  * Revision 2.2  1995/03/21  14:41:26  john
3836  * Ifdef'd out the NETWORK code.
3837  *
3838  * Revision 2.1  1995/03/20  18:16:06  john
3839  * Added code to not store the normals in the segment structure.
3840  *
3841  * Revision 2.0  1995/02/27  11:32:55  john
3842  * New version 2.0, which has no anonymous unions, builds with
3843  * Watcom 10.0, and doesn't require parsing BITMAPS.TBL.
3844  *
3845  * Revision 1.117  1995/02/22  14:11:31  allender
3846  * remove anonymous unions from object structure
3847  *
3848  * Revision 1.116  1995/02/22  13:24:39  john
3849  * Removed the vecmat anonymous unions.
3850  *
3851  * Revision 1.115  1995/02/09  14:57:02  john
3852  * Reduced mem usage. Made automap slide farther.
3853  *
3854  * Revision 1.114  1995/02/07  20:40:44  rob
3855  * Allow for anarchy automap of player pos by option.
3856  *
3857  * Revision 1.113  1995/02/07  15:45:33  john
3858  * Made automap memory be static.
3859  *
3860  * Revision 1.112  1995/02/02  12:24:00  adam
3861  * played with automap labels
3862  *
3863  * Revision 1.111  1995/02/02  01:52:52  john
3864  * Made the automap use small font.
3865  *
3866  * Revision 1.110  1995/02/02  01:34:34  john
3867  * Made Reset in automap not change segmentlimit.
3868  *
3869  * Revision 1.109  1995/02/02  01:23:11  john
3870  * Finalized the new automap partial viewer.
3871  *
3872  * Revision 1.108  1995/02/02  00:49:45  mike
3873  * new automap segment-depth functionality.
3874  *
3875  * Revision 1.107  1995/02/02  00:23:04  john
3876  * Half of the code for new connected distance stuff in automap.
3877  *
3878  * Revision 1.106  1995/02/01  22:54:00  john
3879  * Made colored doors not fade in automap. Made default
3880  * viewing area be maxxed.
3881  *
3882  * Revision 1.105  1995/02/01  13:16:13  john
3883  * Added great grates.
3884  *
3885  * Revision 1.104  1995/01/31  12:47:06  john
3886  * Made Alt+F only work with cheats enabled.
3887  *
3888  * Revision 1.103  1995/01/31  12:41:23  john
3889  * Working with new controls.
3890  *
3891  * Revision 1.102  1995/01/31  12:04:19  john
3892  * Version 2 of new key control.
3893  *
3894  * Revision 1.101  1995/01/31  11:32:00  john
3895  * First version of new automap system.
3896  *
3897  * Revision 1.100  1995/01/28  16:55:48  john
3898  * Made keys draw in automap in the segments that you have
3899  * visited.
3900  *
3901  * Revision 1.99  1995/01/28  14:44:51  john
3902  * Made hostage doors show up on automap.
3903  *
3904  * Revision 1.98  1995/01/22  17:03:49  rob
3905  * Fixed problem drawing playerships in automap coop/team mode
3906  *
3907  * Revision 1.97  1995/01/21  17:23:11  john
3908  * Limited S movement in map. Made map bitmap load from disk
3909  * and then freed it.
3910  *
3911  * Revision 1.96  1995/01/19  18:55:38  john
3912  * Don't draw players in automap if not obj_player.
3913  *
3914  * Revision 1.95  1995/01/19  18:48:13  john
3915  * Made player colors better in automap.
3916  *
3917  * Revision 1.94  1995/01/19  17:34:52  rob
3918  * Added team colorizations in automap.
3919  *
3920  * Revision 1.93  1995/01/19  17:15:36  rob
3921  * Trying to add player ships into map for coop and team mode.
3922  *
3923  * Revision 1.92  1995/01/19  17:11:09  john
3924  * Added code for Rob to draw Multiplayer ships in automap.
3925  *
3926  * Revision 1.91  1995/01/12  13:35:20  john
3927  * Fixed bug with Segment 0 not getting displayed
3928  * in automap if you have EDITOR compiled in.
3929  *
3930  * Revision 1.90  1995/01/08  16:17:14  john
3931  * Added code to draw player's up vector while in automap.
3932  *
3933  * Revision 1.89  1995/01/08  16:09:41  john
3934  * Fixed problems with grate.
3935  *
3936  * Revision 1.88  1994/12/14  22:54:17  john
3937  * Fixed bug that didn't show hostages in automap.
3938  *
3939  * Revision 1.87  1994/12/09  00:41:03  mike
3940  * fix hang in automap print screen
3941  *
3942  * Revision 1.86  1994/12/05  23:37:15  matt
3943  * Took out calls to warning() function
3944  *
3945  * Revision 1.85  1994/12/03  22:35:28  yuan
3946  * Localization 412
3947  *
3948  * Revision 1.84  1994/12/02  15:05:45  matt
3949  * Added new "official" cheats
3950  *
3951  * Revision 1.83  1994/11/30  12:10:49  adam
3952  * added support for PCX titles/brief screens
3953  *
3954  * Revision 1.82  1994/11/27  23:15:12  matt
3955  * Made changes for new mprintf calling convention
3956  *
3957  * Revision 1.81  1994/11/27  15:35:52  matt
3958  * Enable screen shots even when debugging is turned off
3959  *
3960  * Revision 1.80  1994/11/26  22:51:43  matt
3961  * Removed editor-only fields from segment structure when editor is compiled
3962  * out, and padded segment structure to even multiple of 4 bytes.
3963  *
3964  * Revision 1.79  1994/11/26  16:22:48  matt
3965  * Reduced leave_time
3966  *
3967  * Revision 1.78  1994/11/23  22:00:10  mike
3968  * show level number.
3969  *
3970  * Revision 1.77  1994/11/21  11:40:33  rob
3971  * Tweaked the game-loop for automap in multiplayer games.
3972  *
3973  * Revision 1.76  1994/11/18  16:42:06  adam
3974  * removed a font
3975  *
3976  * Revision 1.75  1994/11/17  13:06:48  adam
3977  * changed font
3978  *
3979  * Revision 1.74  1994/11/14  20:47:17  john
3980  * Attempted to strip out all the code in the game
3981  * directory that uses any ui code.
3982
3983 ------------------------------------------------------------------------
3984 main/automap.h:
3985
3986  * Revision 1.2  1995/07/12  12:48:33  allender
3987  * moved edge_list structure into here for mallocing in mglobal
3988  *
3989  * Revision 1.1  1995/05/16  15:54:31  allender
3990  * Initial revision
3991  *
3992  * Revision 2.0  1995/02/27  11:29:35  john
3993  * New version 2.0, which has no anonymous unions, builds with
3994  * Watcom 10.0, and doesn't require parsing BITMAPS.TBL.
3995  *
3996  * Revision 1.5  1994/12/09  00:41:21  mike
3997  * fix hang in automap print screen
3998  *
3999  * Revision 1.4  1994/07/14  11:25:29  john
4000  * Made control centers destroy better; made automap use Tab key.
4001  *
4002  * Revision 1.3  1994/07/12  15:45:51  john
4003  * Made paritial map.
4004  *
4005  * Revision 1.2  1994/07/07  18:35:05  john
4006  * First version of automap
4007  *
4008  * Revision 1.1  1994/07/07  15:12:13  john
4009  * Initial revision
4010
4011 ------------------------------------------------------------------------
4012 main/bm.c:
4013
4014  * Revision 1.1  1995/05/16  15:23:08  allender
4015  * Initial revision
4016  *
4017  * Revision 2.3  1995/03/14  16:22:04  john
4018  * Added cdrom alternate directory stuff.
4019  *
4020  * Revision 2.2  1995/03/07  16:51:48  john
4021  * Fixed robots not moving without edtiro bug.
4022  *
4023  * Revision 2.1  1995/03/06  15:23:06  john
4024  * New screen techniques.
4025  *
4026  * Revision 2.0  1995/02/27  11:27:05  john
4027  * New version 2.0, which has no anonymous unions, builds with
4028  * Watcom 10.0, and doesn't require parsing BITMAPS.TBL.
4029
4030 ------------------------------------------------------------------------
4031 main/bm.h:
4032
4033  * Revision 1.1  1995/05/16  15:54:39  allender
4034  * Initial revision
4035  *
4036  * Revision 2.0  1995/02/27  11:32:59  john
4037  * New version 2.0, which has no anonymous unions, builds with
4038  * Watcom 10.0, and doesn't require parsing BITMAPS.TBL.
4039  *
4040  * Revision 1.60  1994/12/06  13:24:58  matt
4041  * Made exit model come out of bitmaps.tbl
4042  *
4043  * Revision 1.59  1994/11/10  14:02:48  matt
4044  * Hacked in support for player ships with different textures
4045  *
4046  * Revision 1.58  1994/10/27  13:32:17  john
4047  * Made TmapList only be in if editor
4048  *
4049  * Revision 1.57  1994/10/11  12:25:20  matt
4050  * Added "hot rocks" that create badass explosion when hit by weapons
4051  *
4052  * Revision 1.56  1994/09/29  12:38:13  matt
4053  * Took out include of digi.h, saving hours of unneeded compiles
4054  *
4055  * Revision 1.55  1994/09/25  00:39:51  matt
4056  * Added the ability to make eclips (monitors, fans) which can be blown up
4057  *
4058  * Revision 1.54  1994/09/17  01:40:59  matt
4059  * Added status bar/sizable window mode, and in the process revamped the
4060  * whole cockpit mode system.
4061  *
4062  * Revision 1.53  1994/09/08  16:20:48  matt
4063  * Gave textures the ability to cause damage when scraped
4064  *
4065  * Revision 1.52  1994/08/30  22:23:43  matt
4066  * Added cabability for player ship to have alternate model to use to
4067  * create debris.
4068  *
4069  * Revision 1.51  1994/08/26  15:35:57  matt
4070  * Made eclips usable on more than one object at a time
4071  *
4072  * Revision 1.50  1994/08/23  16:59:51  john
4073  * Added 3 cockpuits
4074  *
4075  * Revision 1.49  1994/08/19  20:09:43  matt
4076  * Added end-of-level cut scene with external scene
4077  *
4078  * Revision 1.48  1994/08/12  22:20:45  matt
4079  * Generalized polygon objects (such as control center)
4080  *
4081  * Revision 1.47  1994/08/09  16:04:21  john
4082  * Added network players to editor.
4083  *
4084  * Revision 1.46  1994/08/09  09:01:31  john
4085  * Increase MAX_TEXTURES
4086  *
4087  * Revision 1.45  1994/07/13  00:14:57  matt
4088  * Moved all (or nearly all) of the values that affect player movement to
4089  * bitmaps.tbl
4090  *
4091  * Revision 1.44  1994/06/20  21:33:15  matt
4092  * Made bm.h not include sounds.h, to reduce dependencies
4093  *
4094  * Revision 1.43  1994/06/15  11:55:58  matt
4095  * Added 3d model for player
4096  *
4097  * Revision 1.42  1994/06/13  16:09:11  adam
4098  * increased max textures to 600
4099  *
4100  * Revision 1.41  1994/06/06  15:38:58  john
4101  * Made fullscreen view be just another cockpit, but the "hole"
4102  * in the cockpit is just bigger.
4103  *
4104  * Revision 1.40  1994/05/26  21:08:59  matt
4105  * Moved robot stuff out of polygon model and into robot_info struct
4106  * Made new file, robot.c, to deal with robots
4107  *
4108  * Revision 1.39  1994/05/18  11:00:05  mike
4109  * Add robot_info stuff.
4110  *
4111  * Revision 1.38  1994/05/17  14:44:56  mike
4112  * Get object type and id from ObjType and ObjId.
4113  *
4114  * Revision 1.37  1994/05/17  12:04:45  mike
4115  * Deal with little known fact that polygon object != robot.
4116  *
4117  * Revision 1.36  1994/05/16  16:17:35  john
4118  * Bunch of stuff on my Inferno Task list May16-23
4119  *
4120  * Revision 1.35  1994/04/27  11:43:42  john
4121  * First version of sound! Yay!
4122  *
4123  * Revision 1.34  1994/04/22  10:53:48  john
4124  * Increased MAX_TEXTURES to 500.
4125  *
4126  * Revision 1.33  1994/04/01  11:15:05  yuan
4127  * Added multiple bitmap functionality to all objects...
4128  * (hostages, powerups, lasers, etc.)
4129  * Hostages and powerups are implemented in the object system,
4130  * just need to finish function call to "affect" player.
4131  *
4132  * Revision 1.32  1994/03/25  17:30:37  yuan
4133  * Checking in hostage stuff.
4134  *
4135  * Revision 1.31  1994/03/17  18:07:28  yuan
4136  * Removed switch code... Now we just have Walls, Triggers, and Links...
4137  *
4138  * Revision 1.30  1994/03/15  17:03:51  yuan
4139  * Added Robot/object bitmap capability
4140  *
4141  * Revision 1.29  1994/03/15  16:32:58  yuan
4142  * Cleaned up bm-loading code.
4143  * (Fixed structures too)
4144  *
4145  * Revision 1.28  1994/03/04  17:09:13  yuan
4146  * New door stuff.
4147  *
4148  * Revision 1.27  1994/01/31  14:50:09  yuan
4149  * Added Robotex
4150  *
4151  * Revision 1.26  1994/01/31  12:27:14  yuan
4152  * Added demo stuff (menu, etc.)
4153  *
4154  * Revision 1.25  1994/01/25  17:11:43  john
4155  * New texmaped lasers.
4156  *
4157  * Revision 1.24  1994/01/24  11:48:06  yuan
4158  * Lighting stuff
4159  *
4160  * Revision 1.23  1994/01/22  13:40:15  yuan
4161  * Modified the bmd_bitmap structure a bit.
4162  * (Saves some memory, and added reflection)
4163  *
4164  * Revision 1.22  1994/01/11  10:58:38  yuan
4165  * Added effects system
4166  *
4167  * Revision 1.21  1994/01/06  17:13:12  john
4168  * Added Video clip functionality
4169  *
4170  * Revision 1.20  1993/12/21  20:00:15  john
4171  * moved selector stuff to grs_bitmap
4172  *
4173  * Revision 1.19  1993/12/21  19:33:58  john
4174  * Added selector to bmd_bitmap.
4175  *
4176  * Revision 1.18  1993/12/07  12:28:48  john
4177  * moved bmd_palette to gr_palette
4178  *
4179  * Revision 1.17  1993/12/06  18:40:37  matt
4180  * Changed object loading & handling
4181  *
4182  * Revision 1.16  1993/12/05  23:05:03  matt
4183  * Added include of gr.h
4184  *
4185  * Revision 1.15  1993/12/03  17:38:04  yuan
4186  * Ooops. meant to say:
4187  * Moved MAX variables to bm.c, Arrays left open.
4188  *
4189  * Revision 1.14  1993/12/03  17:37:26  yuan
4190  * Added Asserts.
4191  *
4192  * Revision 1.13  1993/12/02  17:22:54  yuan
4193  * New global var. Num_object_types
4194  *
4195  * Revision 1.12  1993/12/02  16:34:39  yuan
4196  * Added fireball hack stuff.
4197  *
4198  * Revision 1.11  1993/12/02  15:45:14  yuan
4199  * Added a buncha constants, variables, and function prototypes
4200  * for the new bitmaps.tbl format.
4201  *
4202  * Revision 1.10  1993/12/01  11:25:11  yuan
4203  * Changed MALLOC'd buffers for filename and type in
4204  * the bmd_bitmap structure into arrays... Saves time
4205  * at load up.
4206  *
4207  * Revision 1.9  1993/12/01  00:28:09  yuan
4208  * New bitmap system structure.
4209  *
4210  * Revision 1.8  1993/11/03  11:34:08  john
4211  * made it use bitmaps.tbl
4212  *
4213  * Revision 1.7  1993/10/26  18:11:03  john
4214  * made all palette data be statically allocated
4215  *
4216  * Revision 1.6  1993/10/19  12:17:51  john
4217  * *** empty log message ***
4218  *
4219  * Revision 1.5  1993/10/16  20:02:41  matt
4220  * Changed name of backdrop bitmap file
4221  *
4222  * Revision 1.4  1993/10/12  15:08:52  matt
4223  * Added a bunch of new textures
4224  *
4225  * Revision 1.3  1993/10/12  12:30:41  john
4226  * *** empty log message ***
4227  *
4228  * Revision 1.2  1993/10/12  11:27:58  john
4229  * added more bitmaps
4230  *
4231  * Revision 1.1  1993/09/23  13:09:10  john
4232  * Initial revision
4233
4234 ------------------------------------------------------------------------
4235 main/bmread.c:
4236
4237  * Revision 2.4  1995/03/28  18:05:29  john
4238  * Fixed it so you don't have to delete pig after changing bitmaps.tbl
4239  *
4240  * Revision 2.3  1995/03/07  16:52:03  john
4241  * Fixed robots not moving without edtiro bug.
4242  *
4243  * Revision 2.2  1995/03/06  16:10:20  mike
4244  * Fix compile errors if building without editor.
4245  *
4246  * Revision 2.1  1995/03/02  14:55:40  john
4247  * Fixed bug with EDITOR never defined.
4248  *
4249  * Revision 2.0  1995/02/27  11:33:10  john
4250  * New version 2.0, which has no anonymous unions, builds with
4251  * Watcom 10.0, and doesn't require parsing BITMAPS.TBL.
4252  *
4253  * Revision 1.1  1995/02/25  14:02:36  john
4254  * Initial revision
4255
4256 ------------------------------------------------------------------------
4257 main/ctrlcen.c:
4258
4259  * Revision 1.2  1995/10/17  13:12:13  allender
4260  * added param to ai call
4261  *
4262  * Revision 1.1  1995/05/16  15:23:27  allender
4263  * Initial revision
4264  *
4265  * Revision 2.1  1995/03/21  14:40:25  john
4266  * Ifdef'd out the NETWORK code.
4267  *
4268  * Revision 2.0  1995/02/27  11:31:25  john
4269  * New version 2.0, which has no anonymous unions, builds with
4270  * Watcom 10.0, and doesn't require parsing BITMAPS.TBL.
4271  *
4272  * Revision 1.22  1995/02/11  01:56:14  mike
4273  * robots don't fire cheat.
4274  *
4275  * Revision 1.21  1995/02/05  13:39:39  mike
4276  * fix stupid bug in control center firing timing.
4277  *
4278  * Revision 1.20  1995/02/03  17:41:21  mike
4279  * fix control cen next fire time in multiplayer.
4280  *
4281  * Revision 1.19  1995/01/29  13:46:41  mike
4282  * adapt to new create_small_fireball_on_object prototype.
4283  *
4284  * Revision 1.18  1995/01/18  16:12:13  mike
4285  * Make control center aware of a cloaked playerr when he fires.
4286  *
4287  * Revision 1.17  1995/01/12  12:53:44  rob
4288  * Trying to fix a bug with having cntrlcen in robotarchy games.
4289  *
4290  * Revision 1.16  1994/12/11  12:37:22  mike
4291  * make control center smarter about firing at cloaked player, don't fire through self, though
4292  * it still looks that way due to prioritization problems.
4293  *
4294  * Revision 1.15  1994/12/01  11:34:33  mike
4295  * fix control center shield strength in multiplayer team games.
4296  *
4297  * Revision 1.14  1994/11/30  15:44:29  mike
4298  * make cntrlcen harder at higher levels.
4299  *
4300  * Revision 1.13  1994/11/29  22:26:23  yuan
4301  * Fixed boss bug.
4302  *
4303  * Revision 1.12  1994/11/27  23:12:31  matt
4304  * Made changes for new mprintf calling convention
4305  *
4306  * Revision 1.11  1994/11/23  17:29:38  mike
4307  * deal with peculiarities going between net and regular game on boss level.
4308  *
4309  * Revision 1.10  1994/11/18  18:27:15  rob
4310  * Fixed some bugs with the last version.
4311  *
4312  * Revision 1.9  1994/11/18  17:13:59  mike
4313  * special case handling for level 8.
4314  *
4315  * Revision 1.8  1994/11/15  12:45:28  mike
4316  * don't let cntrlcen know where a cloaked player is.
4317  *
4318  * Revision 1.7  1994/11/08  12:18:37  mike
4319  * small explosions on control center.
4320  *
4321  * Revision 1.6  1994/11/02  17:59:18  rob
4322  * Changed control centers so they can find people in network games.
4323  * Side effect of this is that control centers can find cloaked players.
4324  * (see in-code comments for explanation).
4325  * Also added network hooks so control center shots 'sync up'.
4326  *
4327  * Revision 1.5  1994/10/22  14:13:21  mike
4328  * Make control center stop firing shortly after player dies.
4329  * Fix bug: If play from editor and die, tries to initialize non-control center object.
4330  *
4331  * Revision 1.4  1994/10/20  15:17:30  mike
4332  * Hack for control center inside boss robot.
4333  *
4334  * Revision 1.3  1994/10/20  09:47:46  mike
4335  * lots stuff.
4336  *
4337  * Revision 1.2  1994/10/17  21:35:09  matt
4338  * Added support for new Control Center/Main Reactor
4339  *
4340  * Revision 1.1  1994/10/17  20:24:01  matt
4341  * Initial revision
4342
4343 ------------------------------------------------------------------------
4344 main/ctrlcen.h:
4345
4346  * Revision 2.0  1995/02/27  11:30:40  john
4347  * New version 2.0, which has no anonymous unions, builds with
4348  * Watcom 10.0, and doesn't require parsing BITMAPS.TBL.
4349  *
4350  * Revision 1.7  1995/02/01  16:34:14  john
4351  * Linted.
4352  *
4353  * Revision 1.6  1995/01/03  20:19:14  john
4354  * Pretty good working version of game save.
4355  *
4356  * Revision 1.5  1994/11/08  12:18:28  mike
4357  * small explosions on control center.
4358  *
4359  * Revision 1.4  1994/11/02  18:00:12  rob
4360  * Added extern for Gun_pos array for network hooks.
4361  *
4362  * Revision 1.3  1994/10/20  09:47:37  mike
4363  * *** empty log message ***
4364  *
4365  * Revision 1.2  1994/10/17  21:35:10  matt
4366  * Added support for new Control Center/Main Reactor
4367  *
4368  * Revision 1.1  1994/10/17  20:24:28  matt
4369  * Initial revision
4370
4371 ------------------------------------------------------------------------
4372 main/collide.c:
4373
4374  * Revision 1.3  1995/11/08  17:15:21  allender
4375  * make collide_player_and_weapon play player_hit_sound if
4376  * shareware and not my playernum
4377  *
4378  * Revision 1.2  1995/10/31  10:24:37  allender
4379  * shareware stuff
4380  *
4381  * Revision 1.1  1995/05/16  15:23:34  allender
4382  * Initial revision
4383  *
4384  * Revision 2.5  1995/07/26  12:07:46  john
4385  * Made code that pages in weapon_info->robot_hit_vclip not
4386  * page in unless it is a badass weapon.  Took out old functionallity
4387  * of using this if no robot exp1_vclip, since all robots have these.
4388  *
4389  * Revision 2.4  1995/03/30  16:36:09  mike
4390  * text localization.
4391  *
4392  * Revision 2.3  1995/03/24  15:11:13  john
4393  * Added ugly robot cheat.
4394  *
4395  * Revision 2.2  1995/03/21  14:41:04  john
4396  * Ifdef'd out the NETWORK code.
4397  *
4398  * Revision 2.1  1995/03/20  18:16:02  john
4399  * Added code to not store the normals in the segment structure.
4400  *
4401  * Revision 2.0  1995/02/27  11:32:20  john
4402  * New version 2.0, which has no anonymous unions, builds with
4403  * Watcom 10.0, and doesn't require parsing BITMAPS.TBL.
4404  *
4405  * Revision 1.289  1995/02/22  13:56:06  allender
4406  * remove anonymous unions from object structure
4407  *
4408  * Revision 1.288  1995/02/11  15:52:45  rob
4409  * Included text.h.
4410  *
4411  * Revision 1.287  1995/02/11  15:04:11  rob
4412  * Localized a string.
4413  *
4414  * Revision 1.286  1995/02/11  14:25:41  rob
4415  * Added invul. controlcen option.
4416  *
4417  * Revision 1.285  1995/02/06  15:53:00  mike
4418  * create awareness event for player:wall collision.
4419  *
4420  * Revision 1.284  1995/02/05  23:18:17  matt
4421  * Deal with objects (such as fusion blobs) that get created already
4422  * poking through a wall
4423  *
4424  * Revision 1.283  1995/02/01  17:51:33  mike
4425  * fusion bolt can now toast multiple proximity bombs.
4426  *
4427  * Revision 1.282  1995/02/01  17:29:20  john
4428  * Lintized
4429  *
4430  * Revision 1.281  1995/02/01  15:04:00  rob
4431  * Changed sound of weapons hitting invulnerable players.
4432  *
4433  * Revision 1.280  1995/01/31  16:16:35  mike
4434  * Separate smart blobs for robot and player.
4435  *
4436  * Revision 1.279  1995/01/29  15:57:10  rob
4437  * Fixed another bug with robot_request_change calls.
4438  *
4439  * Revision 1.278  1995/01/28  18:15:06  rob
4440  * Fixed a bug in multi_request_robot_change.
4441  *
4442  * Revision 1.277  1995/01/27  15:15:44  rob
4443  * Fixing problems with controlcen damage.
4444  *
4445  * Revision 1.276  1995/01/27  15:13:10  mike
4446  * comment out mprintf.
4447  *
4448  * Revision 1.275  1995/01/26  22:11:51  mike
4449  * Purple chromo-blaster (ie, fusion cannon) spruce up (chromification)
4450  *
4451  * Revision 1.274  1995/01/26  18:57:55  rob
4452  * Changed two uses of digi_play_sample to digi_link_sound_to_pos which
4453  * made more sense.
4454  *
4455  * Revision 1.273  1995/01/25  23:37:58  mike
4456  * make persistent objects not hit player more than once.
4457  * Also, make them hit player before degrading them, else they often did 0 damage.
4458  *
4459  * Revision 1.272  1995/01/25  18:23:54  rob
4460  * Don't let players pick up powerups in exit tunnel.
4461  *
4462  * Revision 1.271  1995/01/25  13:43:18  rob
4463  * Added robot transfer for player collisions.
4464  * Removed mprintf from collide.c on Mike's request.
4465  *
4466  * Revision 1.270  1995/01/25  10:24:01  mike
4467  * Make sizzle and rock happen in lava even if you're invulnerable.
4468  *
4469  * Revision 1.269  1995/01/22  17:05:33  mike
4470  * Call multi_robot_request_change when a robot gets whacked by a player or
4471  * player weapon, if player_num != Player_num
4472  *
4473  * Revision 1.268  1995/01/21  21:20:28  matt
4474  * Fixed stupid bug
4475  *
4476  * Revision 1.267  1995/01/21  18:47:47  rob
4477  * Fixed a really dumb bug with player keys.
4478  *
4479  * Revision 1.266  1995/01/21  17:39:30  matt
4480  * Cleaned up laser/player hit wall confusions
4481  *
4482  * Revision 1.265  1995/01/19  17:44:42  mike
4483  * damage_force removed, that information coming from strength field.
4484  *
4485  * Revision 1.264  1995/01/18  17:12:56  rob
4486  * Fixed control stuff for multiplayer.
4487  *
4488  * Revision 1.263  1995/01/18  16:12:33  mike
4489  * Make control center aware of a cloaked playerr when he fires.
4490  *
4491  * Revision 1.262  1995/01/17  17:48:42  rob
4492  * Added key syncing for coop players.
4493  *
4494  * Revision 1.261  1995/01/16  19:30:28  rob
4495  * Fixed an assert error in fireball.c
4496  *
4497  * Revision 1.260  1995/01/16  19:23:51  mike
4498  * Say Boss_been_hit if he been hit so he gates appropriately.
4499  *
4500  * Revision 1.259  1995/01/16  11:55:16  mike
4501  * make enemies become aware of player if he damages control center.
4502  *
4503  * Revision 1.258  1995/01/15  16:42:00  rob
4504  * Fixed problem with robot bumping damage.
4505  *
4506  * Revision 1.257  1995/01/14  19:16:36  john
4507  * First version of new bitmap paging code.
4508  *
4509  * Revision 1.256  1995/01/03  17:58:37  rob
4510  * Fixed scoring problems.
4511  *
4512  * Revision 1.255  1994/12/29  12:41:11  rob
4513  * Tweaking robot exploding in coop.
4514  *
4515  * Revision 1.254  1994/12/28  10:37:59  rob
4516  * Fixed ifdef of multibot stuff.
4517  *
4518  * Revision 1.253  1994/12/21  19:03:14  rob
4519  * Fixing score accounting for multiplayer robots
4520  *
4521  * Revision 1.252  1994/12/21  17:36:31  rob
4522  * Fix hostage pickup problem in network.
4523  * tweaking robot powerup drops.
4524  *
4525  * Revision 1.251  1994/12/19  20:32:34  rob
4526  * Remove awareness events from player collisions and lasers that are not the console player.
4527  *
4528  * Revision 1.250  1994/12/19  20:01:22  rob
4529  * Added multibot.h include.
4530  *
4531  * Revision 1.249  1994/12/19  16:36:41  rob
4532  * Patches damaging of multiplayer robots.
4533  *
4534  * Revision 1.248  1994/12/14  21:15:18  rob
4535  * play lava hiss across network.
4536  *
4537  * Revision 1.247  1994/12/14  17:09:09  matt
4538  * Fixed problem with no sound when lasers hit closed walls, like grates.
4539  *
4540  * Revision 1.246  1994/12/14  09:51:49  mike
4541  * make any weapon cause proximity bomb detonation.
4542  *
4543  * Revision 1.245  1994/12/13  12:55:25  mike
4544  * change number of proximity bomb powerups which get dropped.
4545  *
4546  * Revision 1.244  1994/12/12  17:17:53  mike
4547  * make boss cloak/teleport when get hit, make quad laser 3/4 as powerful.
4548  *
4549  * Revision 1.243  1994/12/12  12:07:51  rob
4550  * Don't take damage if we're in endlevel sequence.
4551  *
4552  * Revision 1.242  1994/12/11  23:44:52  mike
4553  * less phys_apply_rot() at higher skill levels.
4554  *
4555  * Revision 1.241  1994/12/11  12:37:02  mike
4556  * remove stupid robot spinning code.  it was really stupid.  (actually, call here, code in ai.c).
4557  *
4558  * Revision 1.240  1994/12/10  16:44:51  matt
4559  * Added debugging code to track down door that turns into rock
4560  *
4561  * Revision 1.239  1994/12/09  14:59:19  matt
4562  * Added system to attach a fireball to another object for rendering purposes,
4563  * so the fireball always renders on top of (after) the object.
4564  *
4565  * Revision 1.238  1994/12/09  09:57:02  mike
4566  * Don't allow robots or their weapons to pass through control center.
4567  *
4568  * Revision 1.237  1994/12/08  15:46:03  mike
4569  * better robot behavior.
4570  *
4571  * Revision 1.236  1994/12/08  12:32:56  mike
4572  * make boss dying more interesting.
4573  *
4574  * Revision 1.235  1994/12/07  22:49:15  mike
4575  * tweak rotation due to collision.
4576  *
4577  * Revision 1.234  1994/12/07  16:44:50  mike
4578  * make bump sound if supposed to, even if not taking damage.
4579  *
4580  * Revision 1.233  1994/12/07  12:55:08  mike
4581  * tweak rotvel applied from collisions.
4582  *
4583  * Revision 1.232  1994/12/05  19:30:48  matt
4584  * Fixed horrible segment over-dereferencing
4585  *
4586  * Revision 1.231  1994/12/05  00:32:15  mike
4587  * do rotvel on badass and bump collisions.
4588  *
4589  * Revision 1.230  1994/12/03  12:49:22  mike
4590  * don't play bonk sound when you collide with a volatile wall (like lava).
4591  *
4592  * Revision 1.229  1994/12/02  16:51:09  mike
4593  * make lava sound only happen at 4 Hz.
4594  *
4595  * Revision 1.228  1994/11/30  23:55:27  rob
4596  * Fixed a bug where a laser hitting a wall was making 2 sounds.
4597  *
4598  * Revision 1.227  1994/11/30  20:11:00  rob
4599  * Fixed # of dropped laser powerups.
4600  *
4601  * Revision 1.226  1994/11/30  19:19:03  rob
4602  * Transmit collission sounds for net games.
4603  *
4604  * Revision 1.225  1994/11/30  16:33:01  mike
4605  * new boss behavior.
4606  *
4607  * Revision 1.224  1994/11/30  15:44:17  mike
4608  * /2 on boss smart children damage.
4609  *
4610  * Revision 1.223  1994/11/30  14:03:03  mike
4611  * hook for claw sounds
4612  *
4613  * Revision 1.222  1994/11/29  20:41:09  matt
4614  * Deleted a bunch of commented-out lines
4615  *
4616  * Revision 1.221  1994/11/27  23:15:08  matt
4617  * Made changes for new mprintf calling convention
4618  *
4619  * Revision 1.220  1994/11/19  16:11:28  rob
4620  * Collision damage with walls or lava is counted as suicides in net games
4621  *
4622  * Revision 1.219  1994/11/19  15:20:41  mike
4623  * rip out unused code and data
4624  *
4625  * Revision 1.218  1994/11/17  18:44:27  rob
4626  * Added OBJ_GHOST to list of valid player types to create eggs.
4627  *
4628  * Revision 1.217  1994/11/17  14:57:59  mike
4629  * moved segment validation functions from editor to main.
4630  *
4631  * Revision 1.216  1994/11/16  23:38:36  mike
4632  * new improved boss teleportation behavior.
4633  *
4634  * Revision 1.215  1994/11/16  12:16:29  mike
4635  * Enable collisions between robots.  A hack in fvi.c only does this for robots which lunge to attack (eg, green guy)
4636  *
4637  * Revision 1.214  1994/11/15  16:51:50  mike
4638  * bump player when he hits a volatile wall.
4639  *
4640  * Revision 1.213  1994/11/12  16:38:44  mike
4641  * allow flares to open doors.
4642  *
4643  * Revision 1.212  1994/11/10  13:09:19  matt
4644  * Added support for new run-length-encoded bitmaps
4645  *
4646  * Revision 1.211  1994/11/09  17:05:43  matt
4647  * Fixed problem with volatile walls
4648  *
4649  * Revision 1.210  1994/11/09  12:11:46  mike
4650  * only award points if ConsoleObject killed robot.
4651  *
4652  * Revision 1.209  1994/11/09  11:11:03  yuan
4653  * Made wall volatile if either tmap_num1 or tmap_num2 is a volatile wall.
4654  *
4655  * Revision 1.208  1994/11/08  12:20:15  mike
4656  * moved do_controlcen_destroyed_stuff from here to cntrlcen.c
4657  *
4658  * Revision 1.207  1994/11/02  23:22:08  mike
4659  * Make ` (backquote, KEY_LAPOSTRO) tell what wall was hit by laser.
4660  *
4661  * Revision 1.206  1994/11/02  18:03:00  rob
4662  * Fix control_center_been_hit logic so it only cares about the local player.
4663  * Other players take care of their own control center 'ai'.
4664  *
4665  * Revision 1.205  1994/11/01  19:37:33  rob
4666  * Changed the max # of consussion missiles to 4.
4667  * (cause they're lame and clutter things up)
4668  *
4669  * Revision 1.204  1994/11/01  18:06:35  john
4670  * Tweaked wall banging sound constant.
4671  *
4672  * Revision 1.203  1994/11/01  18:01:40  john
4673  * Made wall bang less obnoxious, but volume based.
4674  *
4675  * Revision 1.202  1994/11/01  17:11:05  rob
4676  * Changed some stuff in drop_player_eggs.
4677  *
4678  * Revision 1.201  1994/11/01  12:18:23  john
4679  * Added sound volume support. Made wall collisions be louder/softer.
4680  *
4681  * Revision 1.200  1994/10/31  13:48:44  rob
4682  * Fixed bug in opening doors over network/modem.  Added a new message
4683  * type to multi.c that communicates door openings across the net.
4684  * Changed includes in multi.c and wall.c to accomplish this.
4685  *
4686  * Revision 1.199  1994/10/28  14:42:52  john
4687  * Added sound volumes to all sound calls.
4688  *
4689  * Revision 1.198  1994/10/27  16:58:37  allender
4690  * added demo recording of monitors blowing up
4691  *
4692  * Revision 1.197  1994/10/26  23:20:52  matt
4693  * Tone down flash even more
4694  *
4695  * Revision 1.196  1994/10/26  23:01:50  matt
4696  * Toned down red flash when damaged
4697  *
4698  * Revision 1.195  1994/10/26  15:56:29  yuan
4699  * Tweaked some palette flashes.
4700  *
4701  * Revision 1.194  1994/10/25  11:32:26  matt
4702  * Fixed bugs with vulcan powerups in mutliplayer
4703  *
4704  * Revision 1.193  1994/10/25  10:51:18  matt
4705  * Vulcan cannon powerups now contain ammo count
4706  *
4707  * Revision 1.192  1994/10/24  14:14:05  matt
4708  * Fixed bug in bump_two_objects()
4709  *
4710  * Revision 1.191  1994/10/23  19:17:04  matt
4711  * Fixed bug with "no key" messages
4712  *
4713  * Revision 1.190  1994/10/22  00:08:46  matt
4714  * Fixed up problems with bonus & game sequencing
4715  * Player doesn't get credit for hostages unless he gets them out alive
4716  *
4717  * Revision 1.189  1994/10/21  20:42:34  mike
4718  * Clear number of hostages on board between levels.
4719  *
4720  * Revision 1.188  1994/10/20  15:17:43  mike
4721  * control center in boss handling.
4722  *
4723  * Revision 1.187  1994/10/20  10:09:47  mike
4724  * Only ever drop 1 shield powerup in multiplayer (as an egg).
4725  *
4726  * Revision 1.186  1994/10/20  09:47:11  mike
4727  * Fix bug in dropping vulcan ammo in multiplayer.
4728  * Also control center stuff.
4729  *
4730  * Revision 1.185  1994/10/19  15:14:32  john
4731  * Took % hits out of player structure, made %kills work properly.
4732  *
4733  * Revision 1.184  1994/10/19  11:33:16  john
4734  * Fixed hostage rescued percent.
4735  *
4736  * Revision 1.183  1994/10/19  11:16:49  mike
4737  * Don't allow crazy josh to open locked doors.
4738  * Don't allow weapons to harm parent.
4739  *
4740  * Revision 1.182  1994/10/18  18:37:01  mike
4741  * No more hostage killing.  Too much stuff to do to integrate into game.
4742  *
4743  * Revision 1.181  1994/10/18  16:37:35  mike
4744  * Debug function for Yuan: Show seg:side when hit by puny laser if Show_seg_and_side != 0.
4745  *
4746  * Revision 1.180  1994/10/18  10:53:17  mike
4747  * Support attack type as a property of a robot, not of being == GREEN_GUY.
4748  *
4749  * Revision 1.179  1994/10/17  21:18:36  mike
4750  * diminish damage player does to robot due to collision, only took 2-3 hits to kill a josh.
4751  *
4752  * Revision 1.178  1994/10/17  20:30:40  john
4753  * Made player_hostages_rescued or whatever count properly.
4754  *
4755  * Revision 1.177  1994/10/16  12:42:56  mike
4756  * Trap bogus amount of vulcan ammo dropping.
4757  *
4758  * Revision 1.176  1994/10/15  19:06:51  mike
4759  * Drop vulcan ammo if player has it, but no vulcan cannon (when he dies).
4760  *
4761  * Revision 1.175  1994/10/13  15:42:06  mike
4762  * Remove afterburner.
4763  *
4764  * Revision 1.174  1994/10/13  11:12:57  mike
4765  * Apply damage to robots.  I hosed it a couple weeks ago when I made the green guy special.
4766
4767 ------------------------------------------------------------------------
4768 main/collide.h:
4769
4770  * Revision 1.1  1995/05/16  15:55:09  allender
4771  * Initial revision
4772  *
4773  * Revision 2.0  1995/02/27  11:28:59  john
4774  * New version 2.0, which has no anonymous unions, builds with
4775  * Watcom 10.0, and doesn't require parsing BITMAPS.TBL.
4776  *
4777  * Revision 1.23  1995/01/26  22:11:47  mike
4778  * Purple chromo-blaster (ie, fusion cannon) spruce up (chromification)
4779  *
4780  * Revision 1.22  1994/12/21  19:03:24  rob
4781  * Fixing score accounting for multiplayer robots
4782  *
4783  * Revision 1.21  1994/12/21  11:34:56  mike
4784  * make control center take badass damage.
4785  *
4786  * Revision 1.20  1994/10/29  16:53:16  allender
4787  * added check_effect_blowup for demo recording to record monitor explosions
4788  *
4789  * Revision 1.19  1994/10/09  13:46:48  mike
4790  * Make public collide_player_and_powerup.
4791  *
4792  * Revision 1.18  1994/10/05  14:54:29  rob
4793  * Added serial game support in control center sequence..
4794  *
4795  * Revision 1.17  1994/09/15  16:32:12  mike
4796  * Prototype collide_player_and_nasty_robot.
4797  *
4798  * Revision 1.16  1994/09/11  15:49:04  mike
4799  * Prototype for maybe_detonate_weapon.
4800  *
4801  * Revision 1.15  1994/09/09  14:20:07  matt
4802  * Added prototype for scrape function
4803  *
4804  * Revision 1.14  1994/09/02  14:00:44  matt
4805  * Simplified explode_object() & mutliple-stage explosions
4806  *
4807  * Revision 1.13  1994/08/18  10:47:35  john
4808  * Cleaned up game sequencing and player death stuff
4809  * in preparation for making the player explode into
4810  * pieces when dead.
4811  *
4812  * Revision 1.12  1994/08/17  16:50:08  john
4813  * Added damaging fireballs, missiles.
4814  *
4815  * Revision 1.11  1994/08/03  16:45:31  mike
4816  * Prototype a function.
4817  *
4818  * Revision 1.10  1994/08/03  15:17:41  mike
4819  * make matcen whack on you if it's ready to make a robot.
4820  *
4821  * Revision 1.9  1994/07/22  12:08:03  mike
4822  * Make robot hit vclip and sound weapon-based until robot dies, then robot-based.
4823  *
4824  * Revision 1.8  1994/07/09  17:36:31  mike
4825  * Prototype apply_damage_to_robot.
4826  *
4827  * Revision 1.7  1994/07/09  13:20:36  mike
4828  * Prototype apply_damage_to_player.
4829  *
4830  * Revision 1.6  1994/06/20  23:35:52  john
4831  * Bunch of stuff.
4832  *
4833  * Revision 1.5  1994/06/17  18:04:03  yuan
4834  * Added Immaterialization...
4835  * Fixed Invulnerability to allow being hit.
4836  *
4837  * Revision 1.4  1994/05/13  20:28:02  john
4838  * Version II of John's new object code.
4839  *
4840  * Revision 1.3  1994/05/13  12:20:35  john
4841  * Fixed some potential problems with code using global variables
4842  * that are set in fvi.
4843  *
4844  * Revision 1.2  1994/05/12  23:20:32  john
4845  * Moved all object collision handling into collide.c.
4846  *
4847  * Revision 1.1  1994/05/12  20:39:09  john
4848  * Initial revision
4849
4850 ------------------------------------------------------------------------
4851 main/compbit.h:
4852
4853  * Revision 1.1  1995/05/16  15:55:16  allender
4854  * Initial revision
4855  *
4856  * Revision 2.0  1995/02/27  11:28:46  john
4857  * New version 2.0, which has no anonymous unions, builds with
4858  * Watcom 10.0, and doesn't require parsing BITMAPS.TBL.
4859  *
4860  * Revision 1.3  1994/12/05  15:10:28  allender
4861  * changed extern prototype definition
4862  *
4863  * Revision 1.2  1994/10/19  15:43:33  allender
4864  * header file which contains the xor value which is used when encrypting
4865  * bitmaps.tbl
4866  *
4867  * Revision 1.1  1994/10/19  13:22:19  allender
4868  * Initial revision
4869
4870 ------------------------------------------------------------------------
4871 main/config.c:
4872
4873  * Revision 1.8  1995/10/27  10:52:20  allender
4874  * call digi_set_master_volume when prefs are read in to
4875  * set the master volume of the mac
4876  *
4877  * Revision 1.7  1995/10/24  17:08:39  allender
4878  * Config_master_volume added for saving sound manager volume
4879  * across games
4880  *
4881  * Revision 1.6  1995/10/20  00:49:31  allender
4882  * use default values when no prefs file
4883  *
4884  * Revision 1.5  1995/09/21  10:06:58  allender
4885  * set digi and midi volume appropriately
4886  *
4887  * Revision 1.4  1995/09/13  08:49:38  allender
4888  * prefs file stuff
4889  *
4890  * Revision 1.3  1995/09/05  08:47:37  allender
4891  * prefs file working
4892  *
4893  * Revision 1.2  1995/05/26  06:54:14  allender
4894  * removed midi and digi references from config file
4895  *
4896  * Revision 1.1  1995/05/16  15:23:45  allender
4897  * Initial revision
4898  *
4899  * Revision 2.2  1995/03/27  09:42:59  john
4900  * Added VR Settings in config file.
4901  *
4902  * Revision 2.1  1995/03/16  11:20:40  john
4903  * Put in support for Crystal Lake soundcard.
4904  *
4905  * Revision 2.0  1995/02/27  11:30:13  john
4906  * New version 2.0, which has no anonymous unions, builds with
4907  * Watcom 10.0, and doesn't require parsing BITMAPS.TBL.
4908  *
4909  * Revision 1.14  1995/02/11  16:19:36  john
4910  * Added code to make the default mission be the one last played.
4911  *
4912  * Revision 1.13  1995/01/18  13:23:24  matt
4913  * Made curtom detail level vars initialize properly at load
4914  *
4915  * Revision 1.12  1995/01/04  22:15:36  matt
4916  * Fixed stupid bug using scanf() to read bytes
4917  *
4918  * Revision 1.11  1995/01/04  13:14:21  matt
4919  * Made custom detail level settings save in config file
4920  *
4921  * Revision 1.10  1994/12/12  21:35:09  john
4922  * *** empty log message ***
4923  *
4924  * Revision 1.9  1994/12/12  21:31:51  john
4925  * Made volume work better by making sure volumes are valid
4926  * and set correctly at program startup.
4927  *
4928  * Revision 1.8  1994/12/12  13:58:01  john
4929  * MAde -nomusic work.
4930  * Fixed GUS hang at exit by deinitializing digi before midi.
4931  *
4932  * Revision 1.7  1994/12/08  10:01:33  john
4933  * Changed the way the player callsign stuff works.
4934  *
4935  * Revision 1.6  1994/12/01  11:24:07  john
4936  * Made volume/gamma/joystick sliders all be the same length.  0-->8.
4937  *
4938  * Revision 1.5  1994/11/29  02:01:07  john
4939  * Added code to look at -volume command line arg.
4940  *
4941  * Revision 1.4  1994/11/14  20:14:11  john
4942  * Fixed some warnings.
4943  *
4944  * Revision 1.3  1994/11/14  19:51:01  john
4945  * Added joystick cal values to descent.cfg.
4946  *
4947  * Revision 1.2  1994/11/14  17:53:09  allender
4948  * read and write descent.cfg file
4949  *
4950  * Revision 1.1  1994/11/14  16:28:08  allender
4951  * Initial revision
4952
4953 ------------------------------------------------------------------------
4954 main/config.h:
4955
4956  * Revision 1.3  1995/09/08  17:12:26  allender
4957  * added modem tool stuff for prefs file
4958  *
4959  * Revision 1.2  1995/09/05  08:47:48  allender
4960  * prefs file working
4961  *
4962  * Revision 1.1  1995/05/16  15:55:23  allender
4963  * Initial revision
4964  *
4965  * Revision 2.0  1995/02/27  11:32:48  john
4966  * New version 2.0, which has no anonymous unions, builds with
4967  * Watcom 10.0, and doesn't require parsing BITMAPS.TBL.
4968  *
4969  * Revision 1.4  1995/02/11  16:20:06  john
4970  * Added code to make the default mission be the one last played.
4971  *
4972  * Revision 1.3  1994/12/08  10:01:41  john
4973  * Changed the way the player callsign stuff works.
4974  *
4975  * Revision 1.2  1994/11/14  17:53:17  allender
4976  * extern definitions for ReadConfigFile and WriteConfigFile
4977  *
4978  * Revision 1.1  1994/11/14  16:56:17  allender
4979  * Initial revision
4980
4981 ------------------------------------------------------------------------
4982 main/controls.c:
4983
4984  * Revision 1.3  1995/11/20  17:17:27  allender
4985  * call fix_fastsincos with tmp variable to prevent
4986  * writing to NULL
4987  *
4988  * Revision 1.2  1995/08/11  16:00:04  allender
4989  * fixed bug we think we never saw (overflow on max_rotthrust
4990  *
4991  * Revision 1.1  1995/05/16  15:23:53  allender
4992  * Initial revision
4993  *
4994  * Revision 2.0  1995/02/27  11:27:11  john
4995  * New version 2.0, which has no anonymous unions, builds with
4996  * Watcom 10.0, and doesn't require parsing BITMAPS.TBL.
4997  *
4998  * Revision 1.50  1995/02/22  14:11:19  allender
4999  * remove anonymous unions from object structure
5000  *
5001  * Revision 1.49  1994/12/15  13:04:10  mike
5002  * Replace Players[Player_num].time_total references with GameTime.
5003  *
5004  * Revision 1.48  1994/11/27  23:12:13  matt
5005  * Made changes for new mprintf calling convention
5006  *
5007  * Revision 1.47  1994/11/25  22:15:54  matt
5008  * Added asserts to try to trap frametime < 0 bug
5009  *
5010  * Revision 1.46  1994/11/16  11:25:40  matt
5011  * Took out int3's since I determined that the errors are caused by neg frametime
5012  *
5013  * Revision 1.45  1994/11/15  13:07:23  matt
5014  * Added int3's to try to trap bug
5015  *
5016  * Revision 1.44  1994/10/14  16:18:12  john
5017  * Made Assert that the object was player just nicely exit
5018  * the function.
5019  *
5020  * Revision 1.43  1994/10/13  11:35:25  john
5021  * Made Thrustmaster FCS Hat work.  Put a background behind the
5022  * keyboard configure.  Took out turn_sensitivity.  Changed sound/config
5023  * menu to new menu. Made F6 be calibrate joystick.
5024  *
5025  * Revision 1.42  1994/09/29  11:22:02  mike
5026  * Zero thrust when player dies.
5027  *
5028  * Revision 1.41  1994/09/16  13:10:30  mike
5029  * Hook in afterburner stuff.
5030  *
5031  * Revision 1.40  1994/09/14  22:21:54  matt
5032  * Avoid post-death assert
5033  *
5034  * Revision 1.39  1994/09/11  20:30:27  matt
5035  * Cleaned up thrust vars, changing a few names
5036  *
5037  * Revision 1.38  1994/09/10  15:46:31  john
5038  * First version of new keyboard configuration.
5039  *
5040  * Revision 1.37  1994/09/07  15:58:12  mike
5041  * Check for player dead in controls so you can't fire or move after dead, logical, huh?
5042  *
5043  * Revision 1.36  1994/09/06  14:51:56  john
5044  * Added sensitivity adjustment, fixed bug with joystick button not
5045  * staying down.
5046  *
5047  * Revision 1.35  1994/09/01  15:43:26  john
5048  * Put pitch bak like it was.
5049  *
5050  * Revision 1.34  1994/08/31  18:59:35  john
5051  * Made rotthrust back like it was.
5052  *
5053  * Revision 1.33  1994/08/31  18:49:17  john
5054  * Slowed Maxrothrust a bit,
5055  * ..
5056  *
5057  * Revision 1.32  1994/08/31  18:32:05  john
5058  * Lower max rotational thrust
5059  *
5060  * Revision 1.31  1994/08/29  21:18:27  john
5061  * First version of new keyboard/oystick remapping stuff.
5062  *
5063  * Revision 1.30  1994/08/29  16:18:30  mike
5064  * trap divide overflow.
5065  *
5066  * Revision 1.29  1994/08/26  14:40:45  john
5067  * *** empty log message ***
5068  *
5069  * Revision 1.28  1994/08/26  12:23:50  john
5070  * MAde joystick read up to 15 times per second max.
5071  *
5072  * Revision 1.27  1994/08/26  10:50:59  john
5073  * Took out Controls_always_stopped.
5074  *
5075  * Revision 1.26  1994/08/26  10:47:27  john
5076  * *** empty log message ***
5077  *
5078  * Revision 1.25  1994/08/26  10:46:50  john
5079  * New version of controls.
5080  *
5081  * Revision 1.24  1994/08/25  19:41:44  john
5082  * *** empty log message ***
5083  *
5084  * Revision 1.23  1994/08/25  18:44:55  john
5085  * *** empty log message ***
5086  *
5087  * Revision 1.22  1994/08/25  18:43:46  john
5088  * First revision of new control code.
5089  *
5090  * Revision 1.21  1994/08/24  20:02:46  john
5091  * Added cyberman support; made keys work key_down_time
5092  * returning seconds instead of milliseconds,.
5093  *
5094  *
5095  * Revision 1.20  1994/08/24  19:00:27  john
5096  * Changed key_down_time to return fixed seconds instead of
5097  * milliseconds.
5098  *
5099  * Revision 1.19  1994/08/19  15:22:12  mike
5100  * Fix divide overflow in sliding.
5101  *
5102  * Revision 1.18  1994/08/19  14:42:50  john
5103  * Added joystick sensitivity.
5104  *
5105  * Revision 1.17  1994/08/17  16:50:01  john
5106  * Added damaging fireballs, missiles.
5107  *
5108  * Revision 1.16  1994/08/12  22:41:54  john
5109  * Took away Player_stats; added Players array.
5110  *
5111  * Revision 1.15  1994/08/09  16:03:56  john
5112  * Added network players to editor.
5113  *
5114  * Revision 1.14  1994/07/28  12:33:31  matt
5115  * Made sliding use thrust, rather than changing velocity directly
5116  *
5117  * Revision 1.13  1994/07/27  20:53:21  matt
5118  * Added rotational drag & thrust, so turning now has momemtum like moving
5119  *
5120  * Revision 1.12  1994/07/25  10:24:06  john
5121  * Victor stuff.
5122  *
5123  * Revision 1.11  1994/07/22  17:53:16  john
5124  * Added better victormax support
5125  *
5126  * Revision 1.10  1994/07/21  21:31:29  john
5127  * First cheapo version of VictorMaxx tracking.
5128  *
5129  * Revision 1.9  1994/07/15  15:16:18  john
5130  * Fixed some joystick stuff.
5131  *
5132  * Revision 1.8  1994/07/15  09:32:09  john
5133  * Changes player movement.
5134  *
5135  * Revision 1.7  1994/07/13  00:14:58  matt
5136  * Moved all (or nearly all) of the values that affect player movement to
5137  * bitmaps.tbl
5138  *
5139  * Revision 1.6  1994/07/12  12:40:14  matt
5140  * Revamped physics system
5141  *
5142  * Revision 1.5  1994/07/02  13:50:39  matt
5143  * Cleaned up includes
5144  *
5145  * Revision 1.4  1994/07/01  10:55:25  john
5146  * Added analog joystick throttle
5147  *
5148  * Revision 1.3  1994/06/30  20:04:28  john
5149  * Added -joydef support.
5150  *
5151  * Revision 1.2  1994/06/30  19:01:58  matt
5152  * Moved flying controls code from physics.c to controls.c
5153  *
5154  * Revision 1.1  1994/06/30  18:41:25  matt
5155  * Initial revision
5156
5157 ------------------------------------------------------------------------
5158 main/controls.h:
5159
5160  * Revision 1.1  1995/05/16  15:55:31  allender
5161  * Initial revision
5162  *
5163  * Revision 2.0  1995/02/27  11:27:17  john
5164  * New version 2.0, which has no anonymous unions, builds with
5165  * Watcom 10.0, and doesn't require parsing BITMAPS.TBL.
5166  *
5167  * Revision 1.4  1994/07/21  18:15:33  matt
5168  * Ripped out a bunch of unused stuff
5169  *
5170  * Revision 1.3  1994/07/15  09:32:08  john
5171  * Changes player movement.
5172  *
5173  * Revision 1.2  1994/06/30  19:02:22  matt
5174  * Moved flying controls code from physics.c to controls.c
5175  *
5176  * Revision 1.1  1994/06/30  18:41:36  matt
5177  * Initial revision
5178
5179 ------------------------------------------------------------------------
5180 main/credits.c:
5181
5182  * Revision 1.8  1995/11/07  13:54:56  allender
5183  * loop shareware song since it is too short
5184  *
5185  * Revision 1.7  1995/10/31  10:24:25  allender
5186  * shareware stuff
5187  *
5188  * Revision 1.6  1995/10/27  15:17:57  allender
5189  * minor fix to get them to look right at top and bottom
5190  * of screens
5191  *
5192  * Revision 1.5  1995/10/21  22:50:49  allender
5193  * credits is way cool!!!!
5194  *
5195  * Revision 1.3  1995/08/08  13:45:26  allender
5196  * added macsys header file
5197  *
5198  * Revision 1.2  1995/07/17  08:49:48  allender
5199  * make work in 640x480 -- still needs major work!!
5200  *
5201  * Revision 1.1  1995/05/16  15:24:01  allender
5202  * Initial revision
5203  *
5204  * Revision 2.2  1995/06/14  17:26:08  john
5205  * Fixed bug with VFX palette not getting loaded for credits, titles.
5206  *
5207  * Revision 2.1  1995/03/06  15:23:30  john
5208  * New screen techniques.
5209  *
5210  * Revision 2.0  1995/02/27  11:29:25  john
5211  * New version 2.0, which has no anonymous unions, builds with
5212  * Watcom 10.0, and doesn't require parsing BITMAPS.TBL.
5213  *
5214  * Revision 1.33  1995/02/11  12:41:56  john
5215  * Added new song method, with FM bank switching..
5216  *
5217  * Revision 1.32  1995/02/03  14:18:06  john
5218  * Added columns.
5219  *
5220  * Revision 1.31  1994/12/28  10:43:00  john
5221  * More VFX tweaking.
5222  *
5223  * Revision 1.30  1994/12/20  18:22:31  john
5224  * Added code to support non-looping songs, and put
5225  * it in for endlevel and credits.
5226  *
5227  * Revision 1.29  1994/12/15  14:23:00  adam
5228  * fixed timing.
5229  *
5230  * Revision 1.28  1994/12/14  16:56:33  adam
5231  * *** empty log message ***
5232  *
5233  * Revision 1.27  1994/12/14  12:18:11  adam
5234  * messed w/timing
5235  *
5236  * Revision 1.26  1994/12/12  22:52:59  matt
5237  * Fixed little bug
5238  *
5239  * Revision 1.25  1994/12/12  22:49:35  adam
5240  * *** empty log message ***
5241  *
5242  * Revision 1.24  1994/12/09  23:16:50  john
5243  * Make credits.txb load.
5244  *
5245  * Revision 1.23  1994/12/09  00:41:54  mike
5246  * fix hang in automap print screen.
5247  *
5248  * Revision 1.22  1994/12/09  00:34:22  matt
5249  * Added support for half-height lines
5250  *
5251  * Revision 1.21  1994/12/08  18:36:03  yuan
5252  * More HOGfile support.
5253  *
5254  * Revision 1.20  1994/12/04  14:48:17  john
5255  * Made credits restore playing descent.hmp.
5256  *
5257  * Revision 1.19  1994/12/04  14:30:20  john
5258  * Added hooks for music..
5259  *
5260  * Revision 1.18  1994/12/04  12:06:46  matt
5261  * Put in support for large font
5262  *
5263  * Revision 1.17  1994/12/01  10:47:27  john
5264  * Took out code that allows keypresses to change scroll rate.
5265  *
5266  * Revision 1.16  1994/11/30  12:10:52  adam
5267  * added support for PCX titles/brief screens
5268  *
5269  * Revision 1.15  1994/11/27  23:12:17  matt
5270  * Made changes for new mprintf calling convention
5271  *
5272  * Revision 1.14  1994/11/27  19:51:46  matt
5273  * Made screen shots work in a few more places
5274  *
5275  * Revision 1.13  1994/11/18  16:41:51  adam
5276  * trimmed some more meat for shareware
5277  *
5278  * Revision 1.12  1994/11/10  20:38:29  john
5279  * Made credits not loop.
5280  *
5281  * Revision 1.11  1994/11/05  15:04:06  john
5282  * Added non-popup menu for the main menu, so that scores and credits don't have to save
5283  * the background.
5284  *
5285  * Revision 1.10  1994/11/05  14:05:52  john
5286  * Fixed fade transitions between all screens by making gr_palette_fade_in and out keep
5287  * track of whether the palette is faded in or not.  Then, wherever the code needs to fade out,
5288  * it just calls gr_palette_fade_out and it will fade out if it isn't already.  The same with fade_in.
5289  * This eliminates the need for all the flags like Menu_fade_out, game_fade_in palette, etc.
5290  *
5291  * Revision 1.9  1994/11/04  12:02:32  john
5292  * Fixed fading transitions a bit more.
5293  *
5294  * Revision 1.8  1994/11/04  11:30:44  john
5295  * Fixed fade transitions between game/menu/credits.
5296  *
5297  * Revision 1.7  1994/11/04  11:06:32  john
5298  * Added code to support credit fade table.
5299  *
5300  * Revision 1.6  1994/11/04  10:16:13  john
5301  * Made the credits fade in/out smoothly on top of a bitmap background.
5302  *
5303  * Revision 1.5  1994/11/03  21:24:12  john
5304  * Made credits exit the instant a key is pressed.
5305  * Made it scroll a bit slower.
5306  *
5307  * Revision 1.4  1994/11/03  21:20:28  john
5308  * Working.
5309  *
5310  * Revision 1.3  1994/11/03  21:01:24  john
5311  * First version of credits that works.
5312  *
5313  * Revision 1.2  1994/11/03  20:17:39  john
5314  * Added initial code for showing credits.
5315  *
5316  * Revision 1.1  1994/11/03  20:09:05  john
5317  * Initial revision
5318
5319 ------------------------------------------------------------------------
5320 main/credits.h:
5321
5322  * Revision 1.1  1995/05/16  15:55:39  allender
5323  * Initial revision
5324  *
5325  * Revision 2.0  1995/02/27  11:32:30  john
5326  * New version 2.0, which has no anonymous unions, builds with
5327  * Watcom 10.0, and doesn't require parsing BITMAPS.TBL.
5328  *
5329  * Revision 1.2  1994/11/03  20:17:40  john
5330  * Added initial code for showing credits.
5331  *
5332  * Revision 1.1  1994/11/03  20:09:19  john
5333  * Initial revision
5334
5335 ------------------------------------------------------------------------
5336 main/desc_id.h:
5337
5338  * Revision 1.1  1995/05/16  15:55:53  allender
5339  * Initial revision
5340  *
5341  * Revision 2.0  1995/02/27  11:29:38  john
5342  * New version 2.0, which has no anonymous unions, builds with
5343  * Watcom 10.0, and doesn't require parsing BITMAPS.TBL.
5344  *
5345  * Revision 1.3  1994/10/19  09:52:57  allender
5346  * Added variable for bogus error number return when game exits
5347  *
5348  * Revision 1.2  1994/10/18  16:43:52  allender
5349  * Added constants for id and time stamping
5350  *
5351  * Revision 1.1  1994/10/17  09:56:47  allender
5352  * Initial revision
5353  * Header for checksum stuff - No idea what for.
5354
5355 ------------------------------------------------------------------------
5356 main/digi.h:
5357
5358  * Revision 2.0  1995/02/27  11:28:40  john
5359  * New version 2.0, which has no anonymous unions, builds with
5360  * Watcom 10.0, and doesn't require parsing BITMAPS.TBL.
5361  *
5362  * Revision 1.29  1995/02/11  12:42:00  john
5363  * Added new song method, with FM bank switching..
5364  *
5365  * Revision 1.28  1995/02/03  17:08:26  john
5366  * Changed sound stuff to allow low memory usage.
5367  * Also, changed so that Sounds isn't an array of digi_sounds, it
5368  * is a ubyte pointing into GameSounds, this way the digi.c code that
5369  * locks sounds won't accidentally unlock a sound that is already playing, but
5370  * since it's Sounds[soundno] is different, it would erroneously be unlocked.
5371  *
5372  * Revision 1.27  1995/02/01  22:20:31  john
5373  * Added digi_is_sound_playing.
5374  *
5375  * Revision 1.26  1994/12/20  18:03:51  john
5376  * Added loop midi flag.
5377  *
5378  * Revision 1.25  1994/12/13  00:46:14  john
5379  * Split digi and midi volume into 2 seperate functions.
5380  *
5381  * Revision 1.24  1994/12/10  20:34:53  john
5382  * Added digi_kill_sound_linked_to_object.
5383  *
5384  * Revision 1.23  1994/12/10  15:59:39  mike
5385  * Fixed bug.
5386  *
5387  * Revision 1.22  1994/12/10  15:44:35  john
5388  * Added max_distance passing for sound objects.
5389  *
5390  * Revision 1.21  1994/12/05  12:17:40  john
5391  * Added code that locks/unlocks digital sounds on demand.
5392  *
5393  * Revision 1.20  1994/11/28  18:34:57  john
5394  * Made the digi_max_channels cut of an old sound instead of
5395  * not playing a new sound.
5396  *
5397  * Revision 1.19  1994/11/14  17:53:56  allender
5398  * made some digi variables extern
5399  *
5400  * Revision 1.18  1994/10/28  14:42:58  john
5401  * Added sound volumes to all sound calls.
5402  *
5403  * Revision 1.17  1994/10/11  15:25:37  john
5404  * Added new function to play a sound once...
5405  *
5406  * Revision 1.16  1994/10/03  20:51:44  john
5407  * Started added pause sound function; for the network I changed to
5408  * packet structure a bit; never tested, though.
5409  *
5410  *
5411  * Revision 1.15  1994/10/03  13:09:43  john
5412  * Added Pause function, but never tested it yet.
5413  *
5414  * Revision 1.14  1994/09/30  10:09:24  john
5415  * Changed sound stuff... made it so the reseting card doesn't hang,
5416  * made volume change only if sound is installed.
5417  *
5418  * Revision 1.13  1994/09/29  21:13:43  john
5419  * Added Master volumes for digi and midi. Also took out panning,
5420  * because it doesn't work with MasterVolume stuff.
5421  *
5422  * Revision 1.12  1994/09/29  12:42:34  john
5423  * Added sidenum to keep track of sound pos. Made sound functions
5424  * not do anything if nosound. Made sounds_init delete currently
5425  * playing sounds.
5426  *
5427  * Revision 1.11  1994/09/29  12:23:42  john
5428  * Added digi_kill_sound_linked_to_segment function.
5429  *
5430  * Revision 1.10  1994/09/29  11:59:04  john
5431  * Added digi_kill_sound
5432  *
5433  * Revision 1.9  1994/09/29  10:37:38  john
5434  * Added sound objects that dynamicaly change volume,pan.
5435  *
5436  * Revision 1.8  1994/09/28  16:18:37  john
5437  * Added capability to play midi song.
5438  *
5439  * Revision 1.7  1994/06/17  18:01:41  john
5440  * A bunch of new stuff by John
5441  *
5442  * Revision 1.6  1994/06/15  19:00:58  john
5443  * Added the capability to make 3d sounds play just once for the
5444  * laser hit wall effects.
5445  *
5446  * Revision 1.5  1994/06/07  10:54:30  john
5447  * Made key S reinit the sound system.
5448  *
5449  * Revision 1.4  1994/05/09  21:11:39  john
5450  * Sound changes; pass index instead of pointer to digi routines.
5451  * Made laser sound cut off the last laser sound.
5452  *
5453  * Revision 1.3  1994/04/27  11:44:25  john
5454  * First version of sound! Yay!
5455  *
5456  * Revision 1.2  1994/04/20  21:58:50  john
5457  * First version of sound stuff... hopefully everything
5458  * is commented out because it hangs..
5459  *
5460  * Revision 1.1  1994/04/15  14:25:02  john
5461  * Initial revision
5462
5463 ------------------------------------------------------------------------
5464 main/dumpmine.c:
5465
5466  * Revision 1.1  1995/05/16  15:24:16  allender
5467  * Initial revision
5468  *
5469  * Revision 2.1  1995/04/06  12:21:50  mike
5470  * Add texture map information to txm files.
5471  *
5472  * Revision 2.0  1995/02/27  11:26:41  john
5473  * New version 2.0, which has no anonymous unions, builds with
5474  * Watcom 10.0, and doesn't require parsing BITMAPS.TBL.
5475  *
5476  * Revision 1.24  1995/01/23  15:34:43  mike
5477  * New diagnostic code, levels.all stuff.
5478  *
5479  * Revision 1.23  1994/12/20  17:56:36  yuan
5480  * Multiplayer object capability.
5481  *
5482  * Revision 1.22  1994/11/27  23:12:19  matt
5483  * Made changes for new mprintf calling convention
5484  *
5485  * Revision 1.21  1994/11/23  12:19:04  mike
5486  * move out level names, stick in gamesave.
5487  *
5488  * Revision 1.20  1994/11/21  16:54:36  mike
5489  * oops.
5490  *
5491  *
5492  * Revision 1.19  1994/11/20  22:12:55  mike
5493  * Lotsa new stuff in this fine debug file.
5494  *
5495  * Revision 1.18  1994/11/17  14:58:09  mike
5496  * moved segment validation functions from editor to main.
5497  *
5498  * Revision 1.17  1994/11/15  21:43:02  mike
5499  * texture usage system.
5500  *
5501  * Revision 1.16  1994/11/15  12:45:59  mike
5502  * debug code for dumping texture info.
5503  *
5504  * Revision 1.15  1994/11/14  20:47:50  john
5505  * Attempted to strip out all the code in the game
5506  * directory that uses any ui code.
5507  *
5508  * Revision 1.14  1994/10/14  17:33:38  mike
5509  * Fix error reporting for number of multiplayer objects in mine.
5510  *
5511  * Revision 1.13  1994/10/14  13:37:46  mike
5512  * Forgot parameter in fprintf, was getting bogus number of excess keys.
5513  *
5514  * Revision 1.12  1994/10/12  08:05:33  mike
5515  * Detect keys contained in objects for error checking (txm file).
5516  *
5517  * Revision 1.11  1994/10/10  17:02:08  mike
5518  * fix fix.
5519  *
5520  * Revision 1.10  1994/10/10  17:00:37  mike
5521  * Add checking for proper number of players.
5522  *
5523  * Revision 1.9  1994/10/03  23:37:19  mike
5524  * Adapt to clear and rational understanding of matcens as related to fuelcens as related to something that might work.
5525  *
5526  * Revision 1.8  1994/09/30  17:15:29  mike
5527  * Fix error message, was telling bogus filename.
5528  *
5529  * Revision 1.7  1994/09/30  11:50:55  mike
5530  * More diagnostics.
5531  *
5532  * Revision 1.6  1994/09/28  17:31:19  mike
5533  * More error checking.
5534  *
5535  * Revision 1.5  1994/09/28  11:14:05  mike
5536  * Better checking on bogus walls.
5537  *
5538  * Revision 1.4  1994/09/28  09:23:50  mike
5539  * Change some Error messages to Warnings.
5540  *
5541  * Revision 1.3  1994/09/27  17:08:31  mike
5542  * More mine validation stuff.
5543  *
5544  * Revision 1.2  1994/09/27  15:43:22  mike
5545  * The amazing code to tell you everything and more about our mines!
5546  *
5547  * Revision 1.1  1994/09/27  10:51:15  mike
5548  * Initial revision
5549
5550 ------------------------------------------------------------------------
5551 main/editor/med.c:
5552
5553  * Revision 2.3  1995/03/06  18:23:52  john
5554  * Fixed bug with font screwing up.
5555  * 
5556  * Revision 2.2  1995/03/06  16:34:55  john
5557  * Fixed bug with previous.
5558  * 
5559  * Revision 2.1  1995/03/06  15:20:57  john
5560  * New screen mode method.
5561  * 
5562  * Revision 2.0  1995/02/27  11:35:54  john
5563  * Version 2.0! No anonymous unions, Watcom 10.0, with no need
5564  * for bitmaps.tbl.
5565  * 
5566  * Revision 1.192  1994/11/30  12:33:55  mike
5567  * set window clearing mode for editor.
5568  * 
5569  * Revision 1.191  1994/11/27  23:17:02  matt
5570  * Made changes for new mprintf calling convention
5571  * 
5572  * Revision 1.190  1994/11/19  00:04:33  john
5573  * Changed some shorts to ints.
5574  * 
5575  * Revision 1.189  1994/11/17  14:47:57  mike
5576  * validation functions moved from editor to game.
5577  * 
5578  * Revision 1.188  1994/11/14  11:41:38  john
5579  * Fixed bug with editor/game sequencing.
5580  * 
5581  * Revision 1.187  1994/11/13  15:36:44  john
5582  * Changed game sequencing with editor.
5583  * 
5584  * Revision 1.186  1994/11/10  16:49:12  matt
5585  * Don't sort seg list if no segs in list
5586  * 
5587  * Revision 1.185  1994/11/08  09:28:39  mike
5588  * reset ai paths on going to game.
5589  * 
5590  * Revision 1.184  1994/10/30  14:13:05  mike
5591  * rip out repair center stuff.
5592  * 
5593  * Revision 1.183  1994/10/27  10:07:06  mike
5594  * adapt to no inverse table.
5595  * 
5596  * Revision 1.182  1994/10/20  12:48:03  matt
5597  * Replaced old save files (MIN/SAV/HOT) with new LVL files
5598  * 
5599  * Revision 1.181  1994/10/13  11:39:22  john
5600  * Took out network stuff/.
5601  * 
5602  * Revision 1.180  1994/10/07  22:21:38  mike
5603  * Stop Delete-{whatever} from hanging you!
5604  * 
5605  * Revision 1.179  1994/10/03  23:39:37  mike
5606  * Adapt to newer, better, fuelcen_activate function.
5607  * 
5608  * Revision 1.178  1994/09/30  00:38:05  mike
5609  * Shorten diagnostic message erase -- was erasing outside canvas.
5610  * 
5611  * Revision 1.177  1994/09/28  17:31:37  mike
5612  * Add call to check_wall_validity();
5613  * 
5614  * Revision 1.176  1994/08/19  10:57:42  mike
5615  * Fix status message erase bug.
5616  * 
5617  * Revision 1.175  1994/08/18  10:48:12  john
5618  * Cleaned up game sequencing.
5619  * 
5620  * Revision 1.174  1994/08/16  18:11:04  yuan
5621  * Maded C place you in the center of a segment.
5622  * 
5623  * Revision 1.173  1994/08/10  19:55:05  john
5624  * Changed font stuff.
5625  * 
5626  * Revision 1.172  1994/08/09  16:06:06  john
5627  * Added the ability to place players.  Made old
5628  * Player variable be ConsoleObject.
5629  * 
5630  * Revision 1.171  1994/08/04  09:14:11  matt
5631  * Fixed problem I said I fixed last time
5632  * 
5633  * Revision 1.170  1994/08/04  00:27:57  matt
5634  * When viewing a wall, update the objects segnum if moved out of the segment
5635  * 
5636  * Revision 1.169  1994/08/02  14:18:12  mike
5637  * Clean up dialog boxes.
5638  * 
5639  * Revision 1.168  1994/07/29  15:34:35  mike
5640  * Kill some mprintfs.
5641  * 
5642  * Revision 1.167  1994/07/29  14:56:46  yuan
5643  * Close centers window, when you go into game.
5644  * 
5645  * Revision 1.166  1994/07/28  17:16:20  john
5646  * MAde editor use Network stuff.
5647  * 
5648  * Revision 1.165  1994/07/28  16:59:10  mike
5649  * objects containing objects.
5650  * 
5651  * Revision 1.164  1994/07/22  12:37:07  matt
5652  * Cleaned up editor/game interactions some more.
5653  * 
5654  * Revision 1.163  1994/07/21  19:35:11  yuan
5655  * Fixed #include problem
5656  * 
5657  * Revision 1.162  1994/07/21  18:02:09  matt
5658  * Don't re-init player stats when going from editor -> game
5659  * 
5660  * Revision 1.161  1994/07/21  12:47:53  mike
5661  * Add tilde key functionality for object movement.
5662  * 
5663  * Revision 1.160  1994/07/18  10:44:55  mike
5664  * One-click access to keypads.
5665  * 
5666  * Revision 1.159  1994/07/01  18:05:54  john
5667  * *** empty log message ***
5668  * 
5669  * Revision 1.158  1994/07/01  17:57:06  john
5670  * First version of not-working hostage system
5671  * 
5672  * 
5673  * Revision 1.157  1994/07/01  11:32:29  john
5674  * *** empty log message ***
5675  * 
5676  * Revision 1.156  1994/06/24  17:04:36  john
5677  * *** empty log message ***
5678  * 
5679  * Revision 1.155  1994/06/23  15:53:47  matt
5680  * Finished hacking in 3d rendering in big window
5681  * 
5682  * Revision 1.154  1994/06/21  16:17:54  yuan
5683  * Init stats when you go to game from editor
5684  * 
5685  * Revision 1.153  1994/06/21  12:57:14  yuan
5686  * Remove center from segment function added to menu.
5687
5688 ------------------------------------------------------------------------
5689 main/editor/medwall.h:
5690
5691  * Revision 2.0  1995/02/27  11:35:10  john
5692  * Version 2.0! No anonymous unions, Watcom 10.0, with no need
5693  * for bitmaps.tbl.
5694  * 
5695  * Revision 1.9  1994/09/28  17:31:51  mike
5696  * Prototype copy_group_walls().
5697  * 
5698  * Revision 1.8  1994/08/05  21:18:16  matt
5699  * Allow two doors to be linked together
5700  * 
5701  * Revision 1.7  1994/06/20  22:30:10  yuan
5702  * Fixed crazy runaway trigger bug that Adam found
5703  * 
5704  * Revision 1.6  1994/05/30  20:22:58  yuan
5705  * New triggers.
5706  * 
5707  * Revision 1.5  1994/05/25  18:08:37  yuan
5708  * Revamping walls and triggers interface.
5709  * Wall interface complete, but triggers are still in progress.
5710  * 
5711  * Revision 1.4  1994/05/18  18:22:04  yuan
5712  * Fixed delete segment and walls bug.
5713  * 
5714  * Revision 1.3  1994/03/17  18:08:41  yuan
5715  * New wall stuff... Cut out switches....
5716  * 
5717  * Revision 1.2  1994/03/15  16:34:10  yuan
5718  * Fixed bm loader (might have some changes in walls and switches)
5719  * 
5720  * Revision 1.1  1994/02/10  17:52:01  matt
5721  * Initial revision
5722
5723 ------------------------------------------------------------------------
5724 main/editor/segment.c:
5725
5726  * Revision 2.0  1995/02/27  11:35:21  john
5727  * Version 2.0! No anonymous unions, Watcom 10.0, with no need
5728  * for bitmaps.tbl.
5729  * 
5730  * Revision 1.191  1995/02/22  15:28:30  allender
5731  * remove anonymous unions from object structure
5732  * 
5733  * Revision 1.190  1995/02/02  02:59:40  yuan
5734  * Working on exterminating bogus matcen_nums... (harmless though)
5735  * 
5736  * Revision 1.189  1995/02/01  16:29:51  yuan
5737  * Stabilizing triggers and matcens.
5738  * 
5739  * Revision 1.188  1995/02/01  11:31:47  yuan
5740  * Trigger bug fixed.
5741  * 
5742  * Revision 1.187  1994/11/27  23:17:24  matt
5743  * Made changes for new mprintf calling convention
5744  * 
5745  * Revision 1.186  1994/11/17  14:48:12  mike
5746  * validation functions moved from editor to game.
5747  * 
5748  * Revision 1.185  1994/10/30  14:13:17  mike
5749  * rip out local segment stuff.
5750  * 
5751  * Revision 1.184  1994/10/27  10:04:24  matt
5752  * When triangulating, don't use WID() to see if connected, look at children
5753  * 
5754  * Revision 1.183  1994/10/26  13:40:23  mike
5755  * debug code for matt.
5756  * 
5757  * Revision 1.182  1994/10/24  16:34:00  mike
5758  * Force render after mine compress to prevent bugs in segment selection via clicking in 3d window.
5759  * 
5760  * Revision 1.181  1994/10/20  18:16:15  mike
5761  * Initialize ControlCenterTriggers.num_links in create_new_mine.
5762  * 
5763  * Revision 1.180  1994/10/18  16:29:14  mike
5764  * Write function to automatically fix bogus segnums in segment array.
5765  * 
5766  * Revision 1.179  1994/10/08  17:10:41  matt
5767  * Correctly set current_level_num when loading/creating mine in editor
5768  * 
5769  * Revision 1.178  1994/09/25  14:17:51  mike
5770  * Initialize (to 0) Num_robot_centers and Num_open_doors at mine creation.
5771  * 
5772  * Revision 1.177  1994/09/20  14:36:06  mike
5773  * Write function to find overlapping segments.
5774  * 
5775  * Revision 1.176  1994/08/25  21:55:57  mike
5776  * IS_CHILD stuff.
5777  * 
5778  * Revision 1.175  1994/08/23  15:28:03  mike
5779  * Fix peculiarity in med_combine_duplicate_vertices.
5780  * 
5781  * Revision 1.174  1994/08/09  16:06:17  john
5782  * Added the ability to place players.  Made old
5783  * Player variable be ConsoleObject.
5784  * 
5785  * Revision 1.173  1994/08/05  21:18:10  matt
5786  * Allow two doors to be linked together
5787  * 
5788  * Revision 1.172  1994/08/04  19:13:16  matt
5789  * Changed a bunch of vecmat calls to use multiple-function routines, and to
5790  * allow the use of C macros for some functions
5791  * 
5792  * Revision 1.171  1994/07/22  12:37:00  matt
5793  * Cleaned up editor/game interactions some more.
5794  * 
5795  * Revision 1.170  1994/07/22  11:20:08  mike
5796  * Set Lsegments validity.
5797  * 
5798  * Revision 1.169  1994/07/21  19:02:49  mike
5799  * lsegment stuff.
5800  * 
5801  * Revision 1.168  1994/07/21  13:27:17  matt
5802  * Ripped out remants of old demo system, and added demo
5803  * disables object movement and game options from menu.
5804  * 
5805  * Revision 1.167  1994/07/19  20:15:48  matt
5806  * Name for each level now saved in the .SAV file & stored in Current_level_name
5807  * 
5808  * Revision 1.166  1994/07/06  12:42:45  john
5809  * Made generic messages for hostages.
5810  * 
5811  * Revision 1.165  1994/06/24  17:04:29  john
5812  * *** empty log message ***
5813  * 
5814  * Revision 1.164  1994/06/15  15:42:40  mike
5815  * Initialize static_light field in new segments.
5816  * 
5817  * Revision 1.163  1994/06/13  17:49:19  mike
5818  * Fix bug in med_validate_side which was toasting lighting for removable walls.
5819  * 
5820  * Revision 1.162  1994/06/13  10:52:20  mike
5821  * Fix bug in triangulation of sides between connected segments.
5822  * Was assigning SIDE_IS_02 regardless of how triangulated, was
5823  * causing physics bugs.
5824  * 
5825  * Revision 1.161  1994/06/08  18:14:16  mike
5826  * Fix triangulation of sides in hallways (ie, where there is no wall),
5827  * so they get triangulated the same way, so find_new_seg doesn't get
5828  * stuck in an infinite recursion.
5829  * 
5830  * Revision 1.160  1994/06/08  11:44:31  mike
5831  * Fix bug in normals not being opposite on opposite sides of a segment.
5832  * Problem occurred due to difference in handling of remainder in signed divide.
5833  * 
5834  * Revision 1.159  1994/05/31  19:00:15  yuan
5835  * Fixed gamestate restore.
5836  * 
5837  * Revision 1.158  1994/05/30  20:22:36  yuan
5838  * New triggers.
5839  * 
5840  * Revision 1.157  1994/05/26  19:32:51  mike
5841  * Add bfs_parse.
5842  * 
5843  * Revision 1.156  1994/05/23  14:56:46  mike
5844  * make current segment be add segment.,
5845
5846 ------------------------------------------------------------------------
5847 main/editor/seguvs.h:
5848
5849  * Revision 2.0  1995/02/27  11:34:58  john
5850  * Version 2.0! No anonymous unions, Watcom 10.0, with no need
5851  * for bitmaps.tbl.
5852  * 
5853  * Revision 1.3  1994/08/03  10:32:28  mike
5854  * Add stretch_uvs_from_curedge.
5855  * 
5856  * Revision 1.2  1994/05/14  18:00:58  matt
5857  * Got rid of externs in source (non-header) files
5858  * 
5859  * Revision 1.1  1994/05/14  17:27:26  matt
5860  * Initial revision
5861
5862 ------------------------------------------------------------------------
5863 main/effects.c:
5864
5865  * Revision 1.1  1995/05/16  15:24:25  allender
5866  * Initial revision
5867  *
5868  * Revision 2.0  1995/02/27  11:32:49  john
5869  * New version 2.0, which has no anonymous unions, builds with
5870  * Watcom 10.0, and doesn't require parsing BITMAPS.TBL.
5871  *
5872  * Revision 1.21  1995/02/13  20:35:06  john
5873  * Lintized
5874  *
5875  * Revision 1.20  1994/12/10  16:44:50  matt
5876  * Added debugging code to track down door that turns into rock
5877  *
5878  * Revision 1.19  1994/12/06  16:27:14  matt
5879  * Fixed horrible bug that was referencing segment -1
5880  *
5881  * Revision 1.18  1994/12/02  23:20:51  matt
5882  * Reset bitmaps possibly changed by crit clips
5883  *
5884  * Revision 1.17  1994/11/14  14:00:19  matt
5885  * Fixed stupid bug
5886  *
5887  * Revision 1.16  1994/11/14  12:42:43  matt
5888  * Allow holes in effects list
5889  *
5890  * Revision 1.15  1994/11/08  21:11:52  matt
5891  * Added functions to stop & start effects
5892  *
5893  * Revision 1.14  1994/10/04  18:59:08  matt
5894  * Exploding eclips now play eclip while exploding, then switch to static bm
5895  *
5896  * Revision 1.13  1994/10/04  15:17:42  matt
5897  * Took out references to unused constant
5898  *
5899  * Revision 1.12  1994/09/29  11:00:01  matt
5900  * Made eclips (wall animations) not frame-rate dependent (for now)
5901  *
5902  * Revision 1.11  1994/09/25  00:40:24  matt
5903  * Added the ability to make eclips (monitors, fans) which can be blown up
5904  *
5905  * Revision 1.10  1994/08/14  23:15:14  matt
5906  * Added animating bitmap hostages, and cleaned up vclips a bit
5907  *
5908  * Revision 1.9  1994/08/05  15:56:04  matt
5909  * Cleaned up effects system, and added alternate effects for after mine
5910  * destruction.
5911  *
5912  * Revision 1.8  1994/08/01  23:17:21  matt
5913  * Add support for animating textures on robots
5914  *
5915  * Revision 1.7  1994/05/23  15:10:46  yuan
5916  * Make Eclips read directly...
5917  * No more need for $EFFECTS list.
5918  *
5919  * Revision 1.6  1994/04/06  14:42:44  yuan
5920  * Adding new powerups.
5921  *
5922  * Revision 1.5  1994/03/15  16:31:54  yuan
5923  * Cleaned up bm-loading code.
5924  * (And structures)
5925  *
5926  * Revision 1.4  1994/03/04  17:09:09  yuan
5927  * New door stuff.
5928  *
5929  * Revision 1.3  1994/01/11  11:18:50  yuan
5930  * Fixed frame_count
5931  *
5932  * Revision 1.2  1994/01/11  10:38:55  yuan
5933  * Special effects new implementation
5934  *
5935  * Revision 1.1  1994/01/10  09:45:29  yuan
5936  * Initial revision
5937
5938 ------------------------------------------------------------------------
5939 main/effects.h:
5940
5941  * Revision 1.1  1995/05/16  15:56:08  allender
5942  * Initial revision
5943  *
5944  * Revision 2.0  1995/02/27  11:27:34  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.15  1994/11/08  21:12:07  matt
5949  * Added functions to stop & start effects
5950  *
5951  * Revision 1.14  1994/10/13  17:14:11  adam
5952  * MAX_EFFECTS to 60 (ugh)
5953  *
5954  * Revision 1.13  1994/10/05  10:14:34  adam
5955  * MAX_EFFECTS to 50
5956  *
5957  * Revision 1.12  1994/10/04  18:59:09  matt
5958  * Exploding eclips now play eclip while exploding, then switch to static bm
5959  *
5960  * Revision 1.11  1994/10/04  15:17:52  matt
5961  * Took out references to unused constant
5962  *
5963  * Revision 1.10  1994/09/29  14:15:00  matt
5964  * Added sounds for eclips (wall effects)
5965  *
5966  * Revision 1.9  1994/09/25  00:40:24  matt
5967  * Added the ability to make eclips (monitors, fans) which can be blown up
5968  *
5969  * Revision 1.8  1994/08/05  15:55:25  matt
5970  * Cleaned up effects system, and added alternate effects for after mine
5971  * destruction.
5972  *
5973  * Revision 1.7  1994/08/01  23:17:20  matt
5974  * Add support for animating textures on robots
5975  *
5976  * Revision 1.6  1994/05/19  18:13:18  yuan
5977  * MAX_EFFECTS increased to 30
5978  *
5979  * Revision 1.5  1994/03/15  16:32:37  yuan
5980  * Cleaned up bm-loading code.
5981  * (Fixed structures too)
5982  *
5983  * Revision 1.4  1994/03/04  17:09:07  yuan
5984  * New door stuff.
5985  *
5986  * Revision 1.3  1994/01/19  18:22:45  yuan
5987  * Changed number of effects from 10-20
5988  *
5989  * Revision 1.2  1994/01/11  10:39:07  yuan
5990  * Special effects new implementation
5991  *
5992  * Revision 1.1  1994/01/10  10:36:14  yuan
5993  * Initial revision
5994
5995 ------------------------------------------------------------------------
5996 main/endlevel.c:
5997
5998  * Revision 1.5  1995/10/31  10:24:09  allender
5999  * shareware stuff
6000  *
6001  * Revision 1.4  1995/09/14  16:33:54  allender
6002  * fixed function return values for those that didn't
6003  * have them...thanks matt!
6004  *
6005  * Revision 1.3  1995/07/28  15:36:26  allender
6006  * reverse inverse sqrt change
6007  *
6008  * Revision 1.2  1995/07/28  15:17:40  allender
6009  * inverse magnitude fixup
6010  *
6011  * Revision 1.1  1995/05/16  15:24:32  allender
6012  * Initial revision
6013  *
6014  * Revision 2.2  1995/03/21  14:40:14  john
6015  * Ifdef'd out the NETWORK code.
6016  *
6017  * Revision 2.1  1995/03/20  18:15:50  john
6018  * Added code to not store the normals in the segment structure.
6019  *
6020  * Revision 2.0  1995/02/27  11:30:42  john
6021  * New version 2.0, which has no anonymous unions, builds with
6022  * Watcom 10.0, and doesn't require parsing BITMAPS.TBL.
6023  *
6024  * Revision 1.80  1995/02/22  13:24:45  john
6025  * Removed the vecmat anonymous unions.
6026  *
6027  * Revision 1.79  1995/02/11  12:41:54  john
6028  * Added new song method, with FM bank switching..
6029  *
6030  * Revision 1.78  1995/02/08  11:37:41  mike
6031  * Check for failures in call to obj_create.
6032  *
6033  * Revision 1.77  1995/02/05  22:09:49  matt
6034  * Switch out of rear view when starting endlevel sequence
6035  *
6036  * Revision 1.76  1995/01/30  18:08:28  rob
6037  * Add palette fade out before ending level on special missions.
6038  *
6039  * Revision 1.75  1995/01/29  16:19:19  rob
6040  * Fixed endlevel for custom missions.
6041  *
6042  * Revision 1.74  1995/01/26  12:18:10  rob
6043  * Changed calling convention of network_do_frame.
6044  *
6045  * Revision 1.73  1995/01/21  16:50:03  matt
6046  * Made endlevel work with new mission stuff
6047  *
6048  * Revision 1.72  1994/12/20  18:22:51  john
6049  * Added code to support non-looping songs, and put
6050  * it in for endlevel and credits.
6051  *
6052  * Revision 1.71  1994/12/15  12:23:58  matt
6053  * Added check for failure to create camera object
6054  *
6055  * Revision 1.70  1994/12/15  03:05:28  matt
6056  * Added error checking for NULL return from object_create_explosion()
6057  *
6058  * Revision 1.69  1994/12/12  21:41:38  matt
6059  * Don't start endlevel if OF_SHOULD_BE_DEAD is set for player
6060  *
6061  * Revision 1.68  1994/12/12  15:44:54  rob
6062  * Rolled back a change to endlevel_start that caused more bugs than
6063  * it fixed.
6064  *
6065  * Revision 1.67  1994/12/12  12:08:33  rob
6066  * IF a player is dead upon entering the tunnel, make them not dead.  Not perfect solution
6067  * but avoids some last-minute weirdness we want to fix.  This should be revisited in new
6068  * versions if possible!
6069  *
6070  * Revision 1.66  1994/12/11  22:02:13  allender
6071  * made endlevel data loading work with .txb encoded format (made with
6072  * compbit -i level0?.end -o level0?.txb)
6073  *
6074  * Revision 1.65  1994/12/11  20:32:47  matt
6075  * Made camera transition happen 1/3 of the way through exit tunnel
6076  *
6077  * Revision 1.64  1994/12/08  20:56:27  john
6078  * More cfile stuff.
6079  *
6080  * Revision 1.63  1994/12/07  17:00:52  rob
6081  * Trying to fix homing tone warning when in exit tunnel.
6082  *
6083  * Revision 1.62  1994/12/06  13:24:47  matt
6084  * Made exit model come out of bitmaps.tbl
6085  *
6086  * Revision 1.61  1994/12/06  12:06:22  matt
6087  * Fixed/cleaned up satellite (planet/sun) code
6088  *
6089  * Revision 1.60  1994/12/05  13:37:12  adam
6090  * removed slew-mode
6091  *
6092  * Revision 1.59  1994/12/05  12:49:37  matt
6093  * Made satellite a rod (instead of a plane old non-rotating bitmap), and
6094  * made the size settable in the .end file
6095  *
6096  * Revision 1.58  1994/12/04  21:40:00  matt
6097  * Added explosion sounds
6098  *
6099  * Revision 1.57  1994/12/04  18:31:41  matt
6100  * Wasn't coding planet position, causing it to disappear sometimes
6101  *
6102  * Revision 1.56  1994/12/04  14:30:26  john
6103  * Added hooks for music..
6104  *
6105  * Revision 1.55  1994/12/04  13:53:52  matt
6106  * Added code to make camera off-centered during lookback
6107  *
6108  * Revision 1.54  1994/12/04  12:30:18  matt
6109  * Fixed slew for short sequence
6110  *
6111  * Revision 1.53  1994/12/03  19:28:10  matt
6112  * Added alternate model for exit model after mine destruction
6113  *
6114  * Revision 1.52  1994/12/03  00:17:23  matt
6115  * Made endlevel sequence cut off early
6116  * Made exit model and bit explosion always plot last (after all terrain)
6117  *
6118  * Revision 1.51  1994/12/01  20:15:43  yuan
6119  * Localization.
6120  *
6121  * Revision 1.50  1994/11/30  23:27:35  adam
6122  * mucked around carelessly
6123  *
6124  * Revision 1.49  1994/11/28  21:50:37  mike
6125  * optimizations.
6126  *
6127  * Revision 1.48  1994/11/28  00:12:05  allender
6128  * took out demo code that was in at one time to record endlevel sequence.
6129  * We are _not_ recording endlevel sequence
6130  *
6131  * Revision 1.47  1994/11/27  23:35:54  allender
6132  * pause demo recording when starting endlevel sequence.  on demo playback,
6133  * don't do endlevel at all.
6134  *
6135  * Revision 1.46  1994/11/27  23:13:59  matt
6136  * Made changes for new mprintf calling convention
6137  *
6138  * Revision 1.45  1994/11/26  23:17:29  matt
6139  * When camera leaves mine, bank it so it's level with the ground
6140  *
6141  * Revision 1.44  1994/11/23  16:52:13  rob
6142  * Ended netgame endlevel sequence a bit earlier.
6143  *
6144  * Revision 1.43  1994/11/22  19:20:46  rob
6145  * Modem support for secret levels.
6146  *
6147  * Revision 1.42  1994/11/22  12:11:03  rob
6148  * Fixed bug - file handle left open in load_endlevel_data.
6149  *
6150  * Revision 1.41  1994/11/21  17:29:22  matt
6151  * Cleaned up sequencing & game saving for secret levels
6152  *
6153  * Revision 1.40  1994/11/19  15:14:54  mike
6154  * remove unused code and data
6155  *
6156  * Revision 1.39  1994/11/19  12:41:32  matt
6157  * Added system to read endlevel data from file, and to make it work
6158  * with any exit tunnel.
6159  *
6160  * Revision 1.38  1994/11/17  15:02:24  mike
6161  * support new segment validation functions.
6162  *
6163  * Revision 1.37  1994/11/17  13:04:45  allender
6164  * backout out newdemo changes
6165  *
6166  * Revision 1.35  1994/11/16  14:52:33  rob
6167  * Commented out SLEW_ON on Matt's direction.
6168  * Changed something to fix demo recording.
6169  *
6170  * Revision 1.34  1994/11/16  11:49:29  matt
6171  * Added code to rotate terrain to match mine
6172  *
6173  * Revision 1.33  1994/11/14  17:54:54  allender
6174  * on exit sequence during demo recording, force player exited from mine
6175  * packet to all other network players
6176  *
6177  * Revision 1.32  1994/11/10  21:27:42  matt
6178  * Took out printf's
6179  *
6180  * Revision 1.31  1994/11/10  14:02:24  matt
6181  * Hacked in support for player ships with different textures
6182  *
6183  * Revision 1.30  1994/11/09  10:31:33  matt
6184  * Don't create explosions if can't find seg to create them in
6185  *
6186  * Revision 1.29  1994/11/05  17:22:37  john
6187  * Fixed lots of sequencing problems with newdemo stuff.
6188  *
6189  * Revision 1.28  1994/11/03  11:10:39  matt
6190  * Fixed chase angles code
6191  * Maybe other things, too.
6192  *
6193  * Revision 1.27  1994/10/30  20:09:21  matt
6194  * For endlevel: added big explosion at tunnel exit; made lights in tunnel
6195  * go out; made more explosions on walls.
6196  *
6197  * Revision 1.26  1994/10/28  16:37:50  allender
6198  * stop demo recording when endlevel sequence activated
6199  *
6200  * Revision 1.25  1994/10/27  21:15:21  matt
6201  * Added explosions in mine chasing player
6202  *
6203  * Revision 1.24  1994/10/27  01:03:57  matt
6204  * Fixed several small bugs in flythrough
6205  *
6206  * Revision 1.23  1994/10/22  01:32:30  matt
6207  * Don't start endlevel sequence if player dead
6208  *
6209  * Revision 1.22  1994/10/22  00:08:06  matt
6210  * Fixed up problems with bonus & game sequencing
6211  * Player doesn't get credit for hostages unless he gets them out alive
6212
6213 ------------------------------------------------------------------------
6214 main/endlevel.h:
6215
6216  * Revision 1.2  1995/09/14  16:36:34  allender
6217  * fixed function prototype for those functions that didn't
6218  * have them...thanks matt
6219  *
6220  * Revision 1.1  1995/05/16  15:56:16  allender
6221  * Initial revision
6222  *
6223  * Revision 2.0  1995/02/27  11:31:37  john
6224  * New version 2.0, which has no anonymous unions, builds with
6225  * Watcom 10.0, and doesn't require parsing BITMAPS.TBL.
6226  *
6227  * Revision 1.5  1994/12/06  13:24:55  matt
6228  * Made exit model come out of bitmaps.tbl
6229  *
6230  * Revision 1.4  1994/11/19  12:41:35  matt
6231  * Added system to read endlevel data from file, and to make it work
6232  * with any exit tunnel.
6233  *
6234  * Revision 1.3  1994/10/30  20:09:20  matt
6235  * For endlevel: added big explosion at tunnel exit; made lights in tunnel
6236  * go out; made more explosions on walls.
6237  *
6238  * Revision 1.2  1994/08/19  20:09:38  matt
6239  * Added end-of-level cut scene with external scene
6240  *
6241  * Revision 1.1  1994/08/15  19:18:47  matt
6242  * Initial revision
6243
6244 ------------------------------------------------------------------------
6245 main/escort.c:
6246
6247  * Revision 1.1  1995/05/06  23:32:19  mike
6248  * Initial revision
6249
6250 ------------------------------------------------------------------------
6251 main/fireball.c:
6252
6253  * Revision 1.2  1995/10/31  10:23:56  allender
6254  * shareware stuff
6255  *
6256  * Revision 1.1  1995/05/16  15:24:41  allender
6257  * Initial revision
6258  *
6259  * Revision 2.2  1995/03/21  14:39:57  john
6260  * Ifdef'd out the NETWORK code.
6261  *
6262  * Revision 2.1  1995/03/20  18:15:47  john
6263  * Added code to not store the normals in the segment structure.
6264  *
6265  * Revision 2.0  1995/02/27  11:30:34  john
6266  * New version 2.0, which has no anonymous unions, builds with
6267  * Watcom 10.0, and doesn't require parsing BITMAPS.TBL.
6268  *
6269  * Revision 1.200  1995/02/22  13:18:41  allender
6270  * remove anonymous unions from object structure
6271  *
6272  * Revision 1.199  1995/02/14  19:58:32  mike
6273  * comment out "something bad has happened" int3.
6274  *
6275  * Revision 1.198  1995/02/09  13:11:01  mike
6276  * remove an annoying mprintf and Int3().
6277  *
6278  * Revision 1.197  1995/02/08  17:10:14  mike
6279  * don't drop cloaks if one nearby.
6280  *
6281  * Revision 1.196  1995/02/08  13:27:14  rob
6282  * Give keys dropped by robots 0 velocity in coop game.
6283  *
6284  * Revision 1.195  1995/02/08  11:57:40  mike
6285  * determine whether debris object failed to create because buffer was
6286  * exhausted or because limit was hit.
6287  *
6288  * Revision 1.194  1995/02/08  11:37:58  mike
6289  * Check for failures in call to obj_create.
6290  *
6291  * Revision 1.193  1995/02/07  21:09:41  mike
6292  * only replace weapon with energy 1/2 time.
6293  *
6294  * Revision 1.192  1995/01/30  18:21:52  rob
6295  * Replace extra life powerups in multiplayer to invul when
6296  * dropped by robots.
6297  *
6298  * Revision 1.191  1995/01/28  17:40:59  mike
6299  * fix stupidity in converting quad lasers to energy.
6300  *
6301  * Revision 1.190  1995/01/27  15:05:59  rob
6302  * Trying to fix a bug with damaging robots with player badass explosions.
6303  *
6304  * Revision 1.189  1995/01/26  18:59:04  rob
6305  * Powerups were flying too far in robot-cooperative games.
6306  *
6307  * Revision 1.188  1995/01/25  10:53:35  mike
6308  * make badass damage go through grates.
6309  *
6310  * Revision 1.187  1995/01/25  09:37:23  mike
6311  * fix objects containing robots, worked for powerups, bad {} placement.
6312  *
6313  * Revision 1.186  1995/01/23  22:51:20  mike
6314  * drop energy instead of primary weapon if you already have primary weapon.
6315  *
6316  * Revision 1.185  1995/01/20  16:56:37  mike
6317  * Cut damage done by badass weapons.
6318  *
6319  * Revision 1.184  1995/01/19  17:44:57  mike
6320  * damage_force removed, that information coming from strength field.
6321  *
6322  * Revision 1.183  1995/01/16  21:06:54  mike
6323  * Move function pick_random_point_in_segment from fireball.c to gameseg.c.
6324  *
6325  * Revision 1.182  1995/01/16  19:24:04  mike
6326  * If a gated-in robot and going to drop energy powerup, don't!
6327  *
6328  * Revision 1.181  1995/01/15  20:48:03  mike
6329  * drop energy in place of quad lasers if player already has quad lasers.
6330  *
6331  * Revision 1.180  1995/01/14  19:32:19  rob
6332  * Fixed an error.
6333  *
6334  * Revision 1.179  1995/01/14  18:50:55  rob
6335  * Make robot egg creation suitable for mutliplayer situations.
6336  *
6337  * Revision 1.178  1995/01/14  14:55:07  rob
6338  * Make weapons/keys/etc never disappear in network mode.
6339
6340 ------------------------------------------------------------------------
6341 main/fireball.h:
6342
6343  * Revision 1.1  1995/05/16  15:56:23  allender
6344  * Initial revision
6345  *
6346  * Revision 2.0  1995/02/27  11:27:03  john
6347  * New version 2.0, which has no anonymous unions, builds with
6348  * Watcom 10.0, and doesn't require parsing BITMAPS.TBL.
6349  *
6350  * Revision 1.13  1995/01/17  12:14:38  john
6351  * Made walls, object explosion vclips load at level start.
6352  *
6353  * Revision 1.12  1995/01/13  15:41:52  rob
6354  * Added prototype for maybe_replace_powerup_with_energy
6355  *
6356  * Revision 1.11  1994/11/17  16:28:36  rob
6357  * Changed maybe_drop_cloak_powerup to maybe_drop_net_powerup (more
6358  * generic and useful)
6359  *
6360  * Revision 1.10  1994/10/12  08:03:42  mike
6361  * Prototype maybe_drop_cloak_powerup.
6362  *
6363  * Revision 1.9  1994/10/11  12:24:39  matt
6364  * Cleaned up/change badass explosion calls
6365  *
6366  * Revision 1.8  1994/09/07  16:00:34  mike
6367  * Add object pointer to parameter list of object_create_badass_explosion.
6368  *
6369  * Revision 1.7  1994/09/02  14:00:39  matt
6370  * Simplified explode_object() & mutliple-stage explosions
6371  *
6372  * Revision 1.6  1994/08/17  16:49:58  john
6373  * Added damaging fireballs, missiles.
6374  *
6375  * Revision 1.5  1994/07/14  22:39:19  matt
6376  * Added exploding doors
6377  *
6378  * Revision 1.4  1994/06/08  10:56:36  matt
6379  * Improved debris: now get submodel size from new POF files; debris now has
6380  * limited life; debris can now be blown up.
6381  *
6382  * Revision 1.3  1994/04/01  13:35:44  matt
6383  * Added multiple-stage explosions
6384  *
6385  * Revision 1.2  1994/02/17  11:33:32  matt
6386  * Changes in object system
6387  *
6388  * Revision 1.1  1994/02/16  22:41:15  matt
6389  * Initial revision
6390
6391 ------------------------------------------------------------------------
6392 main/fuelcen.c:
6393
6394  * Revision 1.2  1995/10/31  10:23:40  allender
6395  * shareware stuff
6396  *
6397  * Revision 1.1  1995/05/16  15:24:50  allender
6398  * Initial revision
6399  *
6400  * Revision 2.3  1995/03/21  14:38:40  john
6401  * Ifdef'd out the NETWORK code.
6402  *
6403  * Revision 2.2  1995/03/06  15:23:09  john
6404  * New screen techniques.
6405  *
6406  * Revision 2.1  1995/02/27  13:13:26  john
6407  * Removed floating point.
6408  *
6409  * Revision 2.0  1995/02/27  11:27:20  john
6410  * New version 2.0, which has no anonymous unions, builds with
6411  * Watcom 10.0, and doesn't require parsing BITMAPS.TBL.
6412  *
6413  * Revision 1.159  1995/02/22  13:48:10  allender
6414  * remove anonymous unions in object structure
6415  *
6416  * Revision 1.158  1995/02/08  11:37:48  mike
6417  * Check for failures in call to obj_create.
6418  *
6419  * Revision 1.157  1995/02/07  20:39:39  mike
6420  * fix toasters in multiplayer
6421  *
6422  *
6423  * Revision 1.156  1995/02/02  18:40:10  john
6424  * Fixed bug with full screen cockpit flashing non-white.
6425  *
6426  * Revision 1.155  1995/01/28  15:27:22  yuan
6427  * Make sure fuelcen nums are valid.
6428  *
6429  * Revision 1.154  1995/01/03  14:26:23  rob
6430  * Better ifdef for robot centers.
6431  *
6432  * Revision 1.153  1995/01/03  11:27:49  rob
6433  * Added include of fuelcen.c
6434  *
6435  * Revision 1.152  1995/01/03  09:47:22  john
6436  * Some ifdef SHAREWARE lines.
6437  *
6438  * Revision 1.151  1995/01/02  21:02:07  rob
6439  * added matcen support for coop/multirobot.
6440  *
6441  * Revision 1.150  1994/12/15  18:31:22  mike
6442  * fix confusing precedence problems.
6443  *
6444  * Revision 1.149  1994/12/15  13:04:22  mike
6445  * Replace Players[Player_num].time_total references with GameTime.
6446  *
6447  * Revision 1.148  1994/12/15  03:05:18  matt
6448  * Added error checking for NULL return from object_create_explosion()
6449  *
6450  * Revision 1.147  1994/12/13  19:49:12  rob
6451  * Made the fuelcen noise quieter.
6452  *
6453  * Revision 1.146  1994/12/13  12:03:18  john
6454  * Made the warning sirens not start until after "desccruction
6455  * secquence activated voice".
6456  *
6457  * Revision 1.145  1994/12/12  17:18:30  mike
6458  * make warning siren louder.
6459  *
6460  * Revision 1.144  1994/12/11  23:18:04  john
6461  * Added -nomusic.
6462  * Added RealFrameTime.
6463  * Put in a pause when sound initialization error.
6464  * Made controlcen countdown and framerate use RealFrameTime.
6465  *
6466  * Revision 1.143  1994/12/11  14:10:16  mike
6467  * louder sounds.
6468  *
6469  * Revision 1.142  1994/12/06  11:33:19  yuan
6470  * Fixed bug with fueling when above 100.
6471  *
6472  * Revision 1.141  1994/12/05  23:37:14  matt
6473  * Took out calls to warning() function
6474  *
6475  * Revision 1.140  1994/12/05  23:19:18  yuan
6476  * Fixed fuel center refuelers..
6477  *
6478  * Revision 1.139  1994/12/03  12:48:12  mike
6479  * diminish rocking due to control center destruction.
6480  *
6481  * Revision 1.138  1994/12/02  23:30:32  mike
6482  * fix bumpiness after toasting control center.
6483  *
6484  * Revision 1.137  1994/12/02  22:48:14  mike
6485  * rock the ship after toasting the control center!
6486  *
6487  * Revision 1.136  1994/12/02  17:12:11  rob
6488  * Fixed countdown sounds.
6489  *
6490  * Revision 1.135  1994/11/29  20:59:43  rob
6491  * Don't run out of fuel in net games (don't want to sync it between machines)
6492  *
6493  * Revision 1.134  1994/11/29  19:10:57  john
6494  * Took out debugging mprintf.
6495  *
6496  * Revision 1.133  1994/11/29  13:19:40  john
6497  * Made voice for "destruction actived in t-"
6498  * be at 12.75 secs.
6499  *
6500  * Revision 1.132  1994/11/29  12:19:46  john
6501  * MAde the "Mine desctruction will commence"
6502  * voice play at 12.5 secs.
6503  *
6504  * Revision 1.131  1994/11/29  12:12:54  adam
6505  * *** empty log message ***
6506  *
6507  * Revision 1.130  1994/11/28  21:04:26  rob
6508  * Added code to cast noise when player refuels.
6509  *
6510  * Revision 1.129  1994/11/27  23:15:04  matt
6511  * Made changes for new mprintf calling convention
6512  *
6513  * Revision 1.128  1994/11/21  16:27:51  mike
6514  * debug code for morphing.
6515  *
6516  * Revision 1.127  1994/11/21  12:33:50  matt
6517  * For control center explosions, use small fireball, not pseudo-random vclip
6518  *
6519  * Revision 1.126  1994/11/20  22:12:15  mike
6520  * Fix bug in initializing materialization centers.
6521  *
6522  * Revision 1.125  1994/11/19  15:18:22  mike
6523  * rip out unused code and data.
6524  *
6525  * Revision 1.124  1994/11/08  12:18:59  mike
6526  * Initialize Fuelcen_seconds_left.
6527  *
6528  * Revision 1.123  1994/10/30  14:12:33  mike
6529  * rip out repair center stuff
6530  *
6531  * Revision 1.122  1994/10/28  14:42:45  john
6532  * Added sound volumes to all sound calls.
6533  *
6534  * Revision 1.121  1994/10/16  12:44:02  mike
6535  * Make time to exit mine after control center destruction diff level dependent.
6536  *
6537  * Revision 1.120  1994/10/09  22:03:26  mike
6538  * Adapt to new create_n_segment_path parameters.
6539  *
6540  * Revision 1.119  1994/10/06  14:52:42  mike
6541  * Remove last of ability to damage fuel centers.
6542  *
6543  * Revision 1.118  1994/10/06  14:08:45  matt
6544  * Made morph flash effect get orientation from segment
6545  *
6546  * Revision 1.117  1994/10/05  16:09:03  mike
6547  * Put debugging code into matcen/fuelcen synchronization problem.
6548  *
6549  * Revision 1.116  1994/10/04  15:32:41  john
6550  * Took out the old PLAY_SOUND??? code and replaced it
6551  * with direct calls into digi_link_??? so that all sounds
6552  * can be made 3d.
6553  *
6554  * Revision 1.115  1994/10/03  23:37:57  mike
6555  * Clean up this mess of confusion to the point where maybe matcens actually work.
6556  *
6557  * Revision 1.114  1994/10/03  13:34:40  matt
6558  * Added new (and hopefully better) game sequencing functions
6559  *
6560  * Revision 1.113  1994/09/30  14:41:57  matt
6561  * Fixed bug as per Mike's instructions
6562  *
6563  * Revision 1.112  1994/09/30  00:37:33  mike
6564  * Balance materialization centers.
6565  *
6566  * Revision 1.111  1994/09/28  23:12:52  matt
6567  * Macroized palette flash system
6568  *
6569  * Revision 1.110  1994/09/27  15:42:31  mike
6570  * Add names of Specials.
6571  *
6572  * Revision 1.109  1994/09/27  00:02:23  mike
6573  * Yet more materialization center stuff.
6574  *
6575  * Revision 1.108  1994/09/26  11:26:23  mike
6576  * Balance materialization centers.
6577  *
6578  * Revision 1.107  1994/09/25  23:40:47  matt
6579  * Changed the object load & save code to read/write the structure fields one
6580  * at a time (rather than the whole structure at once).  This mean that the
6581  * object structure can be changed without breaking the load/save functions.
6582  * As a result of this change, the local_object data can be and has been
6583  * incorporated into the object array.  Also, timeleft is now a property
6584  * of all objects, and the object structure has been otherwise cleaned up.
6585  *
6586  * Revision 1.106  1994/09/25  15:55:58  mike
6587  * Balance materialization centers, make them emit light, make them re-triggerable after awhile.
6588  *
6589  * Revision 1.105  1994/09/24  17:42:33  mike
6590  * Making materialization centers be activated by triggers and balancing them.
6591  *
6592  * Revision 1.104  1994/09/24  14:16:06  mike
6593  * Support new network constants.
6594  *
6595  * Revision 1.103  1994/09/20  19:14:40  john
6596  * Massaged the sound system; used a better formula for determining
6597  * which l/r balance, also, put in Mike's stuff that searches for a connection
6598  * between the 2 sounds' segments, stopping for closed doors, etc.
6599  *
6600  * Revision 1.102  1994/09/17  01:40:51  matt
6601  * Added status bar/sizable window mode, and in the process revamped the
6602  * whole cockpit mode system.
6603  *
6604  * Revision 1.101  1994/08/31  20:57:25  matt
6605  * Cleaned up endlevel/death code
6606  *
6607  * Revision 1.100  1994/08/30  17:54:20  mike
6608  * Slow down rate of creation of objects by materialization centers.
6609  *
6610  * Revision 1.99  1994/08/29  11:47:01  john
6611  * Added warning if no control centers in mine.
6612
6613 ------------------------------------------------------------------------
6614 main/fuelcen.h:
6615
6616  * Revision 1.1  1995/05/16  15:56:31  allender
6617  * Initial revision
6618  *
6619  * Revision 2.0  1995/02/27  11:28:43  john
6620  * New version 2.0, which has no anonymous unions, builds with
6621  * Watcom 10.0, and doesn't require parsing BITMAPS.TBL.
6622  *
6623  * Revision 1.26  1995/01/26  12:19:16  rob
6624  * Added externs of things needed for multiplayer.
6625  *
6626  * Revision 1.25  1994/10/30  14:11:10  mike
6627  * rip out repair center stuff.
6628  *
6629  * Revision 1.24  1994/10/03  23:36:36  mike
6630  * Add segnum and fuelcen_num (renaming dest_seg and *path) in matcen_info struct.
6631  *
6632  * Revision 1.23  1994/09/30  00:37:44  mike
6633  * Change FuelCenter struct.
6634  *
6635  * Revision 1.22  1994/09/27  15:42:49  mike
6636  * Kill some obsolete matcen constants, Prototype Special_names.
6637  *
6638  * Revision 1.21  1994/09/27  00:04:30  mike
6639  * Moved FuelCenter struct here from fuelcen.c
6640  *
6641  * Revision 1.20  1994/09/25  15:55:37  mike
6642  * Prototype function disable_matcens.
6643  *
6644  * Revision 1.19  1994/09/24  17:41:34  mike
6645  * Prototype trigger_matcen.
6646  *
6647  * Revision 1.18  1994/08/03  17:52:19  matt
6648  * Tidied up repair centers a bit
6649  *
6650  * Revision 1.17  1994/08/02  12:16:01  mike
6651  * *** empty log message ***
6652  *
6653  * Revision 1.16  1994/08/01  11:04:03  yuan
6654  * New materialization centers.
6655  *
6656  * Revision 1.15  1994/07/21  19:02:15  mike
6657  * break repair centers.
6658  *
6659  * Revision 1.14  1994/07/14  11:25:22  john
6660  * Made control centers destroy better; made automap use Tab key.
6661  *
6662  * Revision 1.13  1994/07/13  10:45:33  john
6663  * Made control center object switch when dead.
6664  *
6665  * Revision 1.12  1994/07/09  17:36:44  mike
6666  * Add extern for find_connected_repair_seg.
6667  *
6668  * Revision 1.11  1994/06/15  19:00:32  john
6669  * Show timer in on top of 3d with mine destroyed...
6670  *
6671  * Revision 1.10  1994/05/31  16:49:46  john
6672  * Begin to add robot materialization centers.
6673  *
6674  * Revision 1.9  1994/05/30  20:22:03  yuan
6675  * New triggers.
6676  *
6677  * Revision 1.8  1994/05/05  16:41:14  matt
6678  * Cleaned up repair center code, and moved some from object.c to fuelcen.c
6679  *
6680  * Revision 1.7  1994/04/21  20:41:21  yuan
6681  * Added extern.
6682  *
6683  * Revision 1.6  1994/04/21  20:28:32  john
6684  * Added flag for Yuan to tell when a fuel center is destroyed.
6685  *
6686  * Revision 1.5  1994/04/14  17:00:59  john
6687  * Made repair cen's work properly; added reset_all_fuelcens.
6688  *
6689  * Revision 1.4  1994/04/12  20:28:04  john
6690  * Added control center.
6691  *
6692  * Revision 1.3  1994/04/08  15:37:10  john
6693  * Added repair centers.
6694  *
6695  * Revision 1.2  1994/04/06  19:10:38  john
6696  * NEw version.
6697  *
6698  *
6699  * Revision 1.1  1994/04/06  12:39:02  john
6700  * Initial revision
6701
6702 ------------------------------------------------------------------------
6703 main/fvi.c:
6704
6705  * Revision 1.7  1995/10/21  23:52:18  allender
6706  * #ifdef'ed out stack debug stuff
6707  *
6708  * Revision 1.6  1995/10/10  12:07:42  allender
6709  * add forgotten ;
6710  *
6711  * Revision 1.5  1995/10/10  11:47:27  allender
6712  * put in stack space check
6713  *
6714  * Revision 1.4  1995/08/23  21:34:08  allender
6715  * fix mcc compiler warning
6716  *
6717  * Revision 1.3  1995/08/14  14:35:18  allender
6718  * changed transparency to 0
6719  *
6720  * Revision 1.2  1995/07/05  16:50:51  allender
6721  * transparency/kitchen change
6722  *
6723  * Revision 1.1  1995/05/16  15:24:59  allender
6724  * Initial revision
6725  *
6726  * Revision 2.3  1995/03/24  14:49:04  john
6727  * Added cheat for player to go thru walls.
6728  *
6729  * Revision 2.2  1995/03/21  17:58:32  john
6730  * Fixed bug with normals..
6731  *
6732  *
6733  * Revision 2.1  1995/03/20  18:15:37  john
6734  * Added code to not store the normals in the segment structure.
6735  *
6736  * Revision 2.0  1995/02/27  11:27:41  john
6737  * New version 2.0, which has no anonymous unions, builds with
6738  * Watcom 10.0, and doesn't require parsing BITMAPS.TBL.
6739  *
6740  * Revision 1.49  1995/02/22  14:45:47  allender
6741  * remove anonymous unions from object structure
6742  *
6743  * Revision 1.48  1995/02/22  13:24:50  john
6744  * Removed the vecmat anonymous unions.
6745  *
6746  * Revision 1.47  1995/02/07  16:17:26  matt
6747  * Disabled all robot-robot collisions except those involving two green
6748  * guys.  Used to do collisions if either robot was green guy.
6749  *
6750  * Revision 1.46  1995/02/02  14:07:53  matt
6751  * Fixed confusion about which segment you are touching when you're
6752  * touching a wall.  This manifested itself in spurious lava burns.
6753  *
6754  * Revision 1.45  1995/02/02  13:45:53  matt
6755  * Made a bunch of lint-inspired changes
6756  *
6757  * Revision 1.44  1995/01/24  12:10:17  matt
6758  * Fudged collisions for player/player, and player weapon/other player in
6759  * coop games.
6760  *
6761  * Revision 1.43  1995/01/14  19:16:45  john
6762  * First version of new bitmap paging code.
6763  *
6764  * Revision 1.42  1994/12/15  12:22:40  matt
6765  * Small change which may or may not help
6766  *
6767  * Revision 1.41  1994/12/14  11:45:51  matt
6768  * Fixed (hopefully) little bug with invalid segnum
6769  *
6770  * Revision 1.40  1994/12/13  17:12:01  matt
6771  * Increased edge tolerance a bunch more
6772  *
6773  * Revision 1.39  1994/12/13  14:37:59  matt
6774  * Fixed another stupid little bug
6775  *
6776  * Revision 1.38  1994/12/13  13:25:44  matt
6777  * Increased tolerance massively to avoid catching on corners
6778  *
6779  * Revision 1.37  1994/12/13  12:02:20  matt
6780  * Fixed small bug
6781  *
6782  * Revision 1.36  1994/12/13  11:17:35  matt
6783  * Lots of changes to hopefully fix objects leaving the mine.  Note that
6784  * this code should be considered somewhat experimental - one problem I
6785  * know about is that you can get stuck on edges more easily than before.
6786  * There may be other problems I don't know about yet.
6787  *
6788  * Revision 1.35  1994/12/12  01:20:57  matt
6789  * Added hack in object-object collisions that treats claw guys as
6790  * if they have 3/4 of their actual radius.
6791  *
6792  * Revision 1.34  1994/12/04  22:48:39  matt
6793  * Physics & FVI now only build seglist for player objects, and they
6794  * responsilby deal with buffer full conditions
6795  *
6796  * Revision 1.33  1994/12/04  22:07:05  matt
6797  * Added better handing of buffer full condition
6798  *
6799  * Revision 1.32  1994/12/01  21:06:33  matt
6800  * Several important changes:
6801  *  (1) Checking against triangulated sides has been standardized a bit
6802  *  (2) Code has been added to de-triangulate some sides
6803  *  (3) BIG ONE: the tolerance for checking a point against a plane has
6804  *      been drastically relaxed
6805  *
6806  *
6807  * Revision 1.31  1994/11/27  23:15:03  matt
6808  * Made changes for new mprintf calling convention
6809  *
6810  * Revision 1.30  1994/11/19  15:20:30  mike
6811  * rip out unused code and data
6812  *
6813  * Revision 1.29  1994/11/16  12:18:17  mike
6814  * hack for green_guy:green_guy collision detection.
6815  *
6816  * Revision 1.28  1994/11/10  13:08:54  matt
6817  * Added support for new run-length-encoded bitmaps
6818  *
6819  * Revision 1.27  1994/10/31  12:27:51  matt
6820  * Added new function object_intersects_wall()
6821  *
6822  * Revision 1.26  1994/10/20  13:59:27  matt
6823  * Added assert
6824  *
6825  * Revision 1.25  1994/10/09  23:51:09  matt
6826  * Made find_hitpoint_uv() work with triangulated sides
6827  *
6828  * Revision 1.24  1994/09/25  00:39:29  matt
6829  * Took out mprintf's
6830  *
6831  * Revision 1.23  1994/09/25  00:37:53  matt
6832  * Made the 'find the point in the bitmap where something hit' system
6833  * publicly accessible.
6834  *
6835  * Revision 1.22  1994/09/21  16:58:22  matt
6836  * Fixed bug in trans wall check that was checking against verically
6837  * flipped bitmap (i.e., the y coord was negative when checking).
6838  *
6839  * Revision 1.21  1994/09/02  11:31:40  matt
6840  * Fixed object/object collisions, so you can't fly through robots anymore.
6841  * Cleaned up object damage system.
6842  *
6843  * Revision 1.20  1994/08/26  09:42:03  matt
6844  * Increased the size of a buffer
6845  *
6846  * Revision 1.19  1994/08/11  18:57:53  mike
6847  * Convert shorts to ints for optimization.
6848  *
6849  * Revision 1.18  1994/08/08  21:38:24  matt
6850  * Put in small optimization
6851  *
6852  * Revision 1.17  1994/08/08  12:21:52  yuan
6853  * Fixed assert
6854  *
6855  * Revision 1.16  1994/08/08  11:47:04  matt
6856  * Cleaned up fvi and physics a little
6857  *
6858  * Revision 1.15  1994/08/04  00:21:04  matt
6859  * Cleaned up fvi & physics error handling; put in code to make sure objects
6860  * are in correct segment; simplified segment finding for objects and points
6861  *
6862  * Revision 1.14  1994/08/02  19:04:26  matt
6863  * Cleaned up vertex list functions
6864  *
6865  * Revision 1.13  1994/08/02  09:56:28  matt
6866  * Put in check for bad value find_plane_line_intersection()
6867  *
6868  * Revision 1.12  1994/08/01  17:27:26  matt
6869  * Added support for triangulated walls in trans point check
6870  *
6871  * Revision 1.11  1994/08/01  13:30:40  matt
6872  * Made fvi() check holes in transparent walls, and changed fvi() calling
6873  * parms to take all input data in query structure.
6874  *
6875  * Revision 1.10  1994/07/13  21:47:17  matt
6876  * FVI() and physics now keep lists of segments passed through which the
6877  * trigger code uses.
6878  *
6879  * Revision 1.9  1994/07/09  21:21:40  matt
6880  * Fixed, hopefull, bugs in sphere-to-vector intersection code
6881  *
6882  * Revision 1.8  1994/07/08  14:26:42  matt
6883  * Non-needed powerups don't get picked up now; this required changing FVI to
6884  * take a list of ingore objects rather than just one ignore object.
6885  *
6886  * Revision 1.7  1994/07/06  20:02:37  matt
6887  * Made change to match gameseg that uses lowest point number as reference
6888  * point when checking against a plane
6889  *
6890  * Revision 1.6  1994/06/29  15:43:58  matt
6891  * When computing intersection of vector and sphere, use the radii of both
6892  * objects.
6893  *
6894  * Revision 1.5  1994/06/14  15:57:58  matt
6895  * Took out asserts, and added other hacks, pending real bug fixes
6896  *
6897  * Revision 1.4  1994/06/13  23:10:08  matt
6898  * Fixed problems with triangulated sides
6899  *
6900  * Revision 1.3  1994/06/09  12:11:14  matt
6901  * Fixed confusing use of two variables, hit_objnum & fvi_hit_object, to
6902  * keep the same information in different ways.
6903  *
6904  * Revision 1.2  1994/06/09  09:58:38  matt
6905  * Moved find_vector_intersection() from physics.c to new file fvi.c
6906  *
6907  * Revision 1.1  1994/06/09  09:25:57  matt
6908  * Initial revision
6909
6910 ------------------------------------------------------------------------
6911 main/fvi.h:
6912
6913  * Revision 1.2  1995/08/23  21:34:29  allender
6914  * fix mcc compiler warning
6915  *
6916  * Revision 1.1  1995/05/16  15:56:38  allender
6917  * Initial revision
6918  *
6919  * Revision 2.1  1995/03/20  18:15:58  john
6920  * Added code to not store the normals in the segment structure.
6921  *
6922  * Revision 2.0  1995/02/27  11:32:02  john
6923  * New version 2.0, which has no anonymous unions, builds with
6924  * Watcom 10.0, and doesn't require parsing BITMAPS.TBL.
6925  *
6926  * Revision 1.10  1995/02/02  14:07:58  matt
6927  * Fixed confusion about which segment you are touching when you're
6928  * touching a wall.  This manifested itself in spurious lava burns.
6929  *
6930  * Revision 1.9  1994/12/04  22:48:04  matt
6931  * Physics & FVI now only build seglist for player objects, and they
6932  * responsilby deal with buffer full conditions
6933  *
6934  * Revision 1.8  1994/10/31  12:28:01  matt
6935  * Added new function object_intersects_wall()
6936  *
6937  * Revision 1.7  1994/10/10  13:10:00  matt
6938  * Increased max_fvi_segs
6939  *
6940  * Revision 1.6  1994/09/25  00:38:29  matt
6941  * Made the 'find the point in the bitmap where something hit' system
6942  * publicly accessible.
6943  *
6944  * Revision 1.5  1994/08/01  13:30:35  matt
6945  * Made fvi() check holes in transparent walls, and changed fvi() calling
6946  * parms to take all input data in query structure.
6947  *
6948  * Revision 1.4  1994/07/13  21:47:59  matt
6949  * FVI() and physics now keep lists of segments passed through which the
6950  * trigger code uses.
6951  *
6952  * Revision 1.3  1994/07/08  14:27:26  matt
6953  * Non-needed powerups don't get picked up now; this required changing FVI to
6954  * take a list of ingore objects rather than just one ignore object.
6955  *
6956  * Revision 1.2  1994/06/09  09:58:39  matt
6957  * Moved find_vector_intersection() from physics.c to new file fvi.c
6958  *
6959  * Revision 1.1  1994/06/09  09:26:14  matt
6960  * Initial revision
6961
6962 ------------------------------------------------------------------------
6963 main/game.c:
6964
6965  * Revision 1.1  1995/12/05  16:01:09  allender
6966  * Initial revision
6967  *
6968  * Revision 1.38  1995/11/13  13:02:35  allender
6969  * put up HUD message when player starts tournament
6970  *
6971  * Revision 1.37  1995/11/13  09:21:05  allender
6972  * ved and shorted tournament mode messages
6973  *
6974  * Revision 1.36  1995/11/09  17:27:00  allender
6975  * took out cheats during demo playback
6976  *
6977  * Revision 1.35  1995/11/07  17:05:41  allender
6978  * move registered cheats
6979  *
6980  * Revision 1.34  1995/11/03  12:55:45  allender
6981  * shareware changes
6982  *
6983  * Revision 1.33  1995/10/29  20:15:00  allender
6984  * took out frame rate cheat.  Pause for at least a second because
6985  * of cmd-P problem
6986  *
6987  * Revision 1.32  1995/10/26  14:11:26  allender
6988  * fix up message box stuff to align correctly
6989  *
6990  * Revision 1.31  1995/10/24  18:09:41  allender
6991  * ixed cockpit weirdness -- don't update cockpit when do_appl_quit
6992  * is called -- screen saved in mevent.c
6993  *
6994  * Revision 1.30  1995/10/21  23:39:10  allender
6995  * ruise marking indicator
6996  *
6997  * Revision 1.29  1995/10/21  22:52:27  allender
6998  * bald guy cheat -- print screen stuff
6999  *
7000  * Revision 1.28  1995/10/20  00:54:28  allender
7001  * new help menus and redbook checking in outer game loop
7002  *
7003  * Revision 1.27  1995/10/17  15:34:19  allender
7004  * pixel double is now default mode
7005  *
7006  * Revision 1.26  1995/10/12  17:34:44  allender
7007  * bigger message box -- command key equivs for function keys
7008  *
7009  * Revision 1.25  1995/10/11  12:17:14  allender
7010  * removed event loop processing
7011  *
7012  * Revision 1.24  1995/10/11  00:58:47  allender
7013  * removed debugging code
7014  *
7015  * Revision 1.23  1995/10/10  11:50:32  allender
7016  * fixed boxed message to align on 8 byte boundry,
7017  * and some debug code
7018  *
7019  * Revision 1.22  1995/09/24  10:51:26  allender
7020  * cannot go to finder in network..added cmd-q for quit
7021  *
7022  * Revision 1.21  1995/09/22  15:05:18  allender
7023  * *more* hud and font type stuff (messages)
7024  *
7025  * Revision 1.20  1995/09/22  14:39:57  allender
7026  * ved framerate counter up
7027  *
7028  * Revision 1.19  1995/09/18  17:01:28  allender
7029  * start of compatibility stuff
7030  *
7031  * Revision 1.18  1995/09/15  15:53:13  allender
7032  * better handling of PICT screen shots
7033  *
7034  * Revision 1.17  1995/09/14  15:27:41  allender
7035  * fixed function type on message_box routiens
7036  *
7037  * Revision 1.16  1995/09/13  11:37:47  allender
7038  * put in call to dump PICT file instead of PCX
7039  *
7040  * Revision 1.15  1995/09/08  17:13:28  allender
7041  * put back in ibitblt.h and start of PICT picture dump
7042  *
7043  * Revision 1.14  1995/09/07  10:20:58  allender
7044  * make cockpit mode default
7045  *
7046  * Revision 1.13  1995/09/07  10:17:34  allender
7047  * added command key equivalents for function keys
7048  *
7049  * Revision 1.12  1995/09/04  11:36:47  allender
7050  * fixed pixel double mode to have correct number of rendered
7051  * lines
7052  *
7053  * Revision 1.11  1995/09/01  15:47:07  allender
7054  * cap frame rate at 60 fps
7055  *
7056  * Revision 1.10  1995/08/26  16:25:59  allender
7057  * whole buncha' stuff!!!!
7058  *
7059  * Revision 1.9  1995/08/01  16:04:47  allender
7060  * put in ctrl_esc sequence to go to menubar
7061  *
7062  * Revision 1.8  1995/07/28  14:15:11  allender
7063  * added FRAME cheat to display frame rate
7064  *
7065  * Revision 1.7  1995/07/17  08:54:19  allender
7066  * *** empty log message ***
7067  *
7068  * Revision 1.6  1995/07/12  12:54:06  allender
7069  * removed some debug keys
7070  *
7071  * Revision 1.5  1995/07/05  16:44:35  allender
7072  * changed some debug keys
7073  *
7074  * Revision 1.4  1995/06/23  10:24:57  allender
7075  * added scanline doubling routine
7076  *
7077  * Revision 1.3  1995/06/13  13:08:26  allender
7078  * added special debug key to move window into upper left corner.
7079  * also added debug key to put game in 640x480 mode
7080  *
7081  * Revision 1.2  1995/06/12  11:10:31  allender
7082  * added DEL_SHIFT_M to move window to corner of screen
7083  *
7084  * Revision 1.1  1995/05/16  15:25:08  allender
7085  * Initial revision
7086  *
7087  * Revision 2.36  1996/01/05  16:52:05  john
7088  * Improved 3d stuff.
7089  *
7090  * Revision 2.35  1995/10/09  22:17:10  john
7091  * Took out the page flipping in set_screen_mode, which shouldn't
7092  * be there.  This was hosing the modex stuff.
7093  *
7094  * Revision 2.34  1995/10/09  19:46:34  john
7095  * Fixed bug with modex paging with lcdbios.
7096  *
7097  * Revision 2.33  1995/10/08  11:46:09  john
7098  * Fixed bug with 2d offset in interlaced mode in low res.
7099  * Made LCDBIOS with pageflipping using VESA set start
7100  * Address function.  X=CRTC offset, Y=0.
7101  *
7102  * Revision 2.32  1995/10/07  13:20:51  john
7103  * Added new modes for LCDBIOS, also added support for -JoyNice,
7104  * and added Shift+F1-F4 to controls various stereoscopic params.
7105  *
7106  * Revision 2.31  1995/05/31  14:34:43  unknown
7107  * fixed warnings.
7108  *
7109  * Revision 2.30  1995/05/08  11:23:45  john
7110  * Made 3dmax work like Kasan wants it to.
7111  *
7112  * Revision 2.29  1995/04/06  13:47:39  yuan
7113  * Restored rear view to original.
7114  *
7115  * Revision 2.28  1995/04/06  12:13:07  john
7116  * Fixed some bugs with 3dmax.
7117  *
7118  * Revision 2.27  1995/04/05  13:18:18  mike
7119  * decrease energy usage on fusion cannon
7120  *
7121  * Revision 2.26  1995/03/30  16:36:32  mike
7122  * text localization.
7123  *
7124  * Revision 2.25  1995/03/27  16:45:26  john
7125  * Fixed some cheat bugs.  Added astral cheat.
7126  *
7127  * Revision 2.24  1995/03/27  15:37:11  mike
7128  * boost fusion cannon for non-multiplayer modes.
7129  *
7130  * Revision 2.23  1995/03/24  17:48:04  john
7131  * Fixed bug with menus and 320x100.
7132  *
7133  * Revision 2.22  1995/03/24  15:34:02  mike
7134  * cheats.
7135  *
7136  * Revision 2.21  1995/03/24  13:11:39  john
7137  * Added save game during briefing screens.
7138  *
7139  * Revision 2.20  1995/03/21  14:40:50  john
7140  * Ifdef'd out the NETWORK code.
7141  *
7142  * Revision 2.19  1995/03/16  22:07:16  john
7143  * Made so only for screen can be used for anything other
7144  * than mode 13.
7145  *
7146  * Revision 2.18  1995/03/16  21:45:35  john
7147  * Made all paged modes have incompatible menus!
7148  *
7149  * Revision 2.17  1995/03/16  18:30:35  john
7150  * Made wider than 320 screens not have
7151  * a status bar mode.
7152  *
7153  * Revision 2.16  1995/03/16  10:53:34  john
7154  * Move VFX center to Shift+Z instead of Enter because
7155  * it conflicted with toggling HUD on/off.
7156  *
7157  * Revision 2.15  1995/03/16  10:18:33  john
7158  * Fixed bug with VFX mode not working. also made warning
7159  * when it can't set VESA mode.
7160  *
7161  * Revision 2.14  1995/03/14  16:22:39  john
7162  * Added cdrom alternate directory stuff.
7163  *
7164  * Revision 2.13  1995/03/14  12:14:17  john
7165  * Made VR helmets have 4 resolutions to choose from.
7166  *
7167  * Revision 2.12  1995/03/10  13:47:33  john
7168  * Added head tracking sensitivity.
7169  *
7170  * Revision 2.11  1995/03/10  13:13:47  john
7171  * Added code to show T-xx on iglasses.
7172  *
7173  * Revision 2.10  1995/03/09  18:07:29  john
7174  * Fixed bug with iglasses tracking not "centering" right.
7175  * Made VFX have bright headlight lighting.
7176  *
7177  * Revision 2.9  1995/03/09  11:48:02  john
7178  * Added HUD for VR helmets.
7179  *
7180  * Revision 2.8  1995/03/07  15:12:53  john
7181  * Fixed VFX,3dmax support.
7182  *
7183  * Revision 2.7  1995/03/07  11:35:03  john
7184  * Fixed bug with cockpit in rear view.
7185  *
7186  * Revision 2.6  1995/03/06  18:40:17  john
7187  * Added some ifdef EDITOR stuff.
7188  *
7189  * Revision 2.5  1995/03/06  18:31:21  john
7190  * Fixed bug with nmenu popping up on editor screen.
7191  *
7192  * Revision 2.4  1995/03/06  17:28:33  john
7193  * Fixed but with cockpit toggling wrong.
7194  *
7195  * Revision 2.3  1995/03/06  16:08:10  mike
7196  * Fix compile errors if building without editor.
7197  *
7198  * Revision 2.2  1995/03/06  15:24:10  john
7199  * New screen techniques.
7200  *
7201  * Revision 2.1  1995/02/27  13:41:03  john
7202  * Removed floating point from frame rate calculations.
7203  *
7204  * Revision 2.0  1995/02/27  11:31:54  john
7205  * New version 2.0, which has no anonymous unions, builds with
7206  * Watcom 10.0, and doesn't require parsing BITMAPS.TBL.
7207  *
7208  * Revision 1.770  1995/02/22  12:45:15  allender
7209  * remove anonymous unions from object structure
7210  *
7211  * Revision 1.769  1995/02/15  10:06:25  allender
7212  * make pause pause game during demo playback
7213  *
7214  * Revision 1.768  1995/02/13  20:35:11  john
7215  * Lintized
7216  *
7217  * Revision 1.767  1995/02/13  19:40:29  allender
7218  * added place to demo record restoration from rear view in place that
7219  * I forgot before
7220  *
7221  * Revision 1.766  1995/02/13  10:29:27  john
7222  * Fixed bug with cheats not restoreing across save games.
7223  *
7224  * Revision 1.765  1995/02/11  22:54:33  john
7225  * Made loading for pig not show up for demos.
7226  *
7227  * Revision 1.764  1995/02/11  17:30:08  allender
7228  * ifndef NDEBUG around strip frame stuff
7229  *
7230  * Revision 1.763  1995/02/11  17:13:01  rob
7231  * Took out modem.c code fille stuff.
7232  *
7233  * Revision 1.762  1995/02/11  16:36:47  allender
7234  * debug key to strip frames from end of demo
7235  *
7236  * Revision 1.761  1995/02/11  14:29:16  john
7237  * Turned off cheats when going into game.
7238  *
7239  * Revision 1.760  1995/02/11  13:46:54  mike
7240  * fix cheats.
7241  *
7242  * Revision 1.759  1995/02/11  12:36:09  matt
7243  * Cleaned up cheats
7244  *
7245  * Revision 1.758  1995/02/11  12:27:04  mike
7246  * fix path-to-exit cheat.
7247  *
7248  * Revision 1.757  1995/02/11  01:56:24  mike
7249  * robots don't fire cheat.
7250  *
7251  * Revision 1.756  1995/02/10  16:38:40  mike
7252  * illuminate path to exit cheat.
7253  *
7254  * Revision 1.755  1995/02/10  16:19:40  mike
7255  * new show-path-to-exit system, still buggy, compiled out.
7256  *
7257  * Revision 1.754  1995/02/10  15:54:46  matt
7258  * Added new cheats
7259  *
7260  * Revision 1.753  1995/02/09  12:25:42  matt
7261  * Made mem_fill() test routines not be called if RELEASE
7262  *
7263  * Revision 1.752  1995/02/09  08:49:32  mike
7264  * change fill opcode value to 0xcc, int 3 value.
7265  *
7266  *
7267  * Revision 1.751  1995/02/09  02:59:26  mike
7268  * check code for 00066xxx bugs.
7269  *
7270  * Revision 1.750  1995/02/08  17:10:02  mike
7271  * add, but don't call, debug code.
7272  *
7273  * Revision 1.749  1995/02/07  11:07:27  john
7274  * Added hooks for confirm on game state restore.
7275  *
7276  * Revision 1.748  1995/02/06  15:52:45  mike
7277  * add mini megawow powerup for giving reasonable weapons.
7278  *
7279  * Revision 1.747  1995/02/06  12:53:35  allender
7280  * force endlevel_sequence to 0 to fix weird bug
7281  *
7282  * Revision 1.746  1995/02/04  10:03:30  mike
7283  * Fly to exit cheat.
7284  *
7285  * Revision 1.745  1995/02/02  15:57:52  john
7286  * Added turbo mode cheat.
7287  *
7288  * Revision 1.744  1995/02/02  14:43:39  john
7289  * Uppped frametime limit to 150 Hz.
7290  *
7291  * Revision 1.743  1995/02/02  13:37:16  mike
7292  * move T-?? message down in certain modes.
7293  *
7294  * Revision 1.742  1995/02/02  01:26:59  john
7295  * Took out no key repeating.
7296  *
7297  * Revision 1.741  1995/01/29  21:36:44  mike
7298  * make fusion cannon not make pitching slow.
7299  *
7300  * Revision 1.740  1995/01/28  15:57:57  john
7301  * Made joystick calibration be only when wrong detected in
7302  * menu or joystick axis changed.
7303  *
7304  * Revision 1.739  1995/01/28  15:21:03  yuan
7305  * Added X-tra life cheat.
7306  *
7307  * Revision 1.738  1995/01/27  14:08:31  rob
7308  * Fixed a bug.
7309  *
7310  * Revision 1.737  1995/01/27  14:04:59  rob
7311  * Its not my fault, Mark told me to do it!
7312  *
7313  * Revision 1.736  1995/01/27  13:12:18  rob
7314  * Added charging noises to play across net.
7315  *
7316  * Revision 1.735  1995/01/27  11:48:28  allender
7317  * check for newdemo_state to be paused and stop recording.  We might be
7318  * in between levels
7319  *
7320  * Revision 1.734  1995/01/26  22:11:41  mike
7321  * Purple chromo-blaster (ie, fusion cannon) spruce up (chromification)
7322  *
7323  * Revision 1.733  1995/01/26  17:03:04  mike
7324  * make fusion cannon have more chrome, make fusion, mega rock you!
7325  *
7326  * Revision 1.732  1995/01/25  14:37:25  john
7327  * Made joystick only prompt for calibration once...
7328  *
7329  * Revision 1.731  1995/01/24  15:49:14  john
7330  * Made typeing in long net messages wrap on
7331  * small screen sizes.
7332  *
7333  * Revision 1.730  1995/01/24  15:23:42  mike
7334  * network message tweaking.
7335  *
7336  * Revision 1.729  1995/01/24  12:00:47  john
7337  * Fixed bug with defing macro passing keys to controls.
7338  *
7339  * Revision 1.728  1995/01/24  11:53:35  john
7340  * Added better macro defining code.
7341  *
7342  * Revision 1.727  1995/01/23  22:17:15  john
7343  * Fixed bug with not clearing key buffer when leaving f8.
7344  *
7345  * Revision 1.726  1995/01/23  22:07:09  john
7346  * Added flush to game inputs during F8.
7347
7348 ------------------------------------------------------------------------
7349 main/game.h:
7350
7351  * Revision 1.3  1995/09/14  13:44:34  allender
7352  * fixed function prototypes to have void return value to satify
7353  * moto compiler
7354  *
7355  * Revision 1.2  1995/08/17  09:25:05  allender
7356  * externed Scanline_double variable
7357  *
7358  * Revision 1.1  1995/05/16  15:56:46  allender
7359  * Initial revision
7360  *
7361  * Revision 2.1  1995/03/06  15:23:22  john
7362  * New screen techniques.
7363  *
7364  * Revision 2.0  1995/02/27  11:28:21  john
7365  * New version 2.0, which has no anonymous unions, builds with
7366  * Watcom 10.0, and doesn't require parsing BITMAPS.TBL.
7367  *
7368  * Revision 1.79  1995/02/13  10:37:17  john
7369  * Saved Buggin' cheat mode to save file.
7370  *
7371  * Revision 1.78  1995/02/01  16:34:12  john
7372  * Linted.
7373  *
7374  * Revision 1.77  1995/01/29  21:37:14  mike
7375  * initialize variables on game load so you don't drain your energy when you fire.
7376  *
7377  * Revision 1.76  1995/01/26  22:11:36  mike
7378  * Purple chromo-blaster (ie, fusion cannon) spruce up (chromification)
7379  *
7380  * Revision 1.75  1995/01/26  16:45:31  mike
7381  * Add autofire fusion cannon stuff.
7382  *
7383  * Revision 1.74  1994/12/11  23:18:06  john
7384  * Added -nomusic.
7385  * Added RealFrameTime.
7386  * Put in a pause when sound initialization error.
7387  * Made controlcen countdown and framerate use RealFrameTime.
7388  *
7389  * Revision 1.73  1994/12/09  00:41:24  mike
7390  * fix hang in automap print screen
7391  *
7392  * Revision 1.72  1994/12/04  13:47:00  mike
7393  * enhance custom detail level support.
7394  *
7395  * Revision 1.71  1994/12/02  15:05:44  matt
7396  * Added new "official" cheats
7397  *
7398  * Revision 1.70  1994/11/28  18:14:09  rob
7399  * Added game_mode flag for team games.
7400  *
7401  * Revision 1.69  1994/11/15  16:51:13  matt
7402  * Made rear view only switch to rear cockpit if cockpit on in front view
7403  *
7404  * Revision 1.68  1994/11/04  16:26:10  john
7405  * Fixed bug with letterbox mode game after you finish a game.
7406  *
7407  * Revision 1.67  1994/11/02  11:59:48  john
7408  * Moved menu out of game into inferno main loop.
7409  *
7410  * Revision 1.66  1994/10/26  23:02:19  matt
7411  * Made palette flash saturate negative values
7412  *
7413  * Revision 1.65  1994/10/26  15:21:05  mike
7414  * Detail level stuff.  Make Render_depth public.
7415  *
7416  * Revision 1.64  1994/10/19  00:13:01  matt
7417  * Added prototypes
7418  *
7419  * Revision 1.63  1994/10/09  14:54:39  matt
7420  * Made player cockpit state & window size save/restore with saved games & automap
7421  *
7422  * Revision 1.62  1994/10/08  19:56:32  matt
7423  * Added prototype
7424  *
7425  * Revision 1.61  1994/10/07  22:19:32  mike
7426  * Increase number of difficulty levels from 4 to 5.
7427  *
7428  * Revision 1.60  1994/10/06  14:14:11  matt
7429  * Added new function to reset time (to prevent big FrameTime) at start of level
7430  *
7431  * Revision 1.59  1994/10/05  17:08:43  matt
7432  * Changed order of cockpit bitmaps, since there's no longer a full-screen cockpit
7433  *
7434  * Revision 1.58  1994/10/03  23:44:13  matt
7435  * Save & restore palette effect around menus & pause message
7436  *
7437  * Revision 1.57  1994/09/29  17:42:12  matt
7438  * Cleaned up game_mode a little
7439  *
7440  * Revision 1.56  1994/09/28  23:12:01  matt
7441  * Macroized palette flash system
7442  *
7443  * Revision 1.55  1994/09/24  16:56:13  rob
7444  * Added new fields for the Game_mode bitvector for modem play.
7445  *
7446  * Revision 1.54  1994/09/24  14:16:20  mike
7447  * Added new game mode constants.
7448  *
7449  * Revision 1.53  1994/09/22  19:00:57  mike
7450  * Move NDL from robot.h to here.
7451  *
7452  * Revision 1.52  1994/09/22  10:46:51  mike
7453  * Add difficulty levels.
7454  *
7455  * Revision 1.51  1994/09/17  01:39:52  matt
7456  * Added status bar/sizable window mode, and in the process revamped the
7457  * whole cockpit mode system.
7458  *
7459  * Revision 1.50  1994/09/15  21:23:10  matt
7460  * Changed system to keep track of whether & what cockpit is up
7461  *
7462  * Revision 1.49  1994/09/15  16:11:33  john
7463  * Added support for VFX1 head tracking. Fixed bug with memory over-
7464  * write when using stereo mode.
7465  *
7466  * Revision 1.48  1994/09/13  16:40:10  mike
7467  * Prototype Global_missile_firing_count.
7468  *
7469  * Revision 1.47  1994/09/13  11:19:05  mike
7470  * Add Next_missile_fire_time.
7471  *
7472  * Revision 1.46  1994/09/12  09:52:50  john
7473  * Made global flush function that flushes keyboard,mouse, and joystick.
7474  *
7475  * Revision 1.45  1994/09/03  15:24:14  mike
7476  * Make global Global_laser_firing_count.
7477  *
7478  * Revision 1.44  1994/08/31  19:26:57  mike
7479  * Prototypes for Next_laser_fire_time, Laser_delay_time.
7480  *
7481  * Revision 1.43  1994/08/18  10:47:22  john
7482  * Cleaned up game sequencing and player death stuff
7483  * in preparation for making the player explode into
7484  * pieces when dead.
7485  *
7486  * Revision 1.42  1994/08/11  18:03:53  matt
7487  * Added prototype
7488  *
7489  * Revision 1.41  1994/06/29  20:41:38  matt
7490  * Added new pause mode; cleaned up countdown & game startup code
7491  *
7492  * Revision 1.40  1994/06/24  17:03:49  john
7493  * Added VFX support. Also took all game sequencing stuff like
7494  * EndGame out and put it into gameseq.c
7495  *
7496  * Revision 1.39  1994/06/20  15:01:08  yuan
7497  * Added death when mine blows up...
7498  * Continues onto next level.
7499  *
7500  * Revision 1.38  1994/06/17  18:07:20  matt
7501  * Moved some vars out of ifdef
7502  *
7503  * Revision 1.37  1994/06/15  11:09:22  yuan
7504  * Moved gauge_message to mono screen for now.
7505  *
7506  * Revision 1.36  1994/05/30  20:22:11  yuan
7507  * New triggers.
7508  *
7509  * Revision 1.35  1994/05/27  10:32:48  yuan
7510  * New dialog boxes (Walls and Triggers) added.
7511  *
7512  *
7513  * Revision 1.34  1994/05/20  11:56:45  matt
7514  * Cleaned up find_vector_intersection() interface
7515  * Killed check_point_in_seg(), check_player_seg(), check_object_seg()
7516  *
7517  * Revision 1.33  1994/05/19  21:45:21  matt
7518  * Removed unused prototypes
7519  *
7520  * Revision 1.32  1994/05/19  18:53:17  yuan
7521  * Changing player structure...
7522  *
7523  * Revision 1.31  1994/05/16  16:38:35  yuan
7524  * Fixed palette add so it doesn't show up in the menu.
7525  *
7526  * Revision 1.30  1994/05/16  09:28:17  matt
7527  * Renamed init_player() to be init_player_stats(), added new funtion
7528  * init_player_object()
7529  *
7530  * Revision 1.29  1994/05/14  17:14:57  matt
7531  * Got rid of externs in source (non-header) files
7532
7533 ------------------------------------------------------------------------
7534 main/gamefont.c:
7535
7536  * Revision 1.2  1995/08/18  10:23:25  allender
7537  * remove refernce to big font -- add PC small font for pixel
7538  * doubling display
7539  *
7540  * Revision 1.1  1995/05/16  15:25:22  allender
7541  * Initial revision
7542  *
7543  * Revision 2.0  1995/02/27  11:30:14  john
7544  * New version 2.0, which has no anonymous unions, builds with
7545  * Watcom 10.0, and doesn't require parsing BITMAPS.TBL.
7546  *
7547  * Revision 1.8  1994/11/18  16:41:39  adam
7548  * trimmed some meat
7549  *
7550  * Revision 1.7  1994/11/17  13:07:11  adam
7551  * removed unused font
7552  *
7553  * Revision 1.6  1994/11/03  21:36:12  john
7554  * Added code for credit fonts.
7555  *
7556  * Revision 1.5  1994/08/17  20:20:02  matt
7557  * Took out alternate-color versions of font3, since this is a mono font
7558  *
7559  * Revision 1.4  1994/08/12  12:03:44  adam
7560  * tweaked fonts.
7561  *
7562  * Revision 1.3  1994/08/11  12:43:40  adam
7563  * changed font filenames
7564  *
7565  * Revision 1.2  1994/08/10  19:57:15  john
7566  * Changed font stuff; Took out old menu; messed up lots of
7567  * other stuff like game sequencing messages, etc.
7568  *
7569  * Revision 1.1  1994/08/10  17:20:09  john
7570  * Initial revision
7571
7572 ------------------------------------------------------------------------
7573 main/gamefont.h:
7574
7575  * Revision 1.2  1995/08/18  10:23:54  allender
7576  * removed large font -- added PC small font
7577  *
7578  * Revision 1.1  1995/05/16  15:56:55  allender
7579  * Initial revision
7580  *
7581  * Revision 2.0  1995/02/27  11:31:09  john
7582  * New version 2.0, which has no anonymous unions, builds with
7583  * Watcom 10.0, and doesn't require parsing BITMAPS.TBL.
7584  *
7585  * Revision 1.7  1994/11/18  16:41:28  adam
7586  * trimmed meat
7587  *
7588  * Revision 1.6  1994/11/17  13:07:00  adam
7589  * removed unused font
7590  *
7591  * Revision 1.5  1994/11/03  21:36:02  john
7592  * Added code for credit fonts.
7593  *
7594  * Revision 1.4  1994/08/17  20:20:25  matt
7595  * Took out alternate-color versions of font3, since this is a mono font
7596  *
7597  * Revision 1.3  1994/08/11  12:44:32  adam
7598  * killed a #define
7599  *
7600  * Revision 1.2  1994/08/10  19:57:16  john
7601  * Changed font stuff; Took out old menu; messed up lots of
7602  * other stuff like game sequencing messages, etc.
7603  *
7604  * Revision 1.1  1994/08/10  17:20:22  john
7605  * Initial revision
7606
7607 ------------------------------------------------------------------------
7608 main/gamemine.c:
7609
7610  * Revision 1.2  1995/10/31  10:15:58  allender
7611  * code for shareware levels
7612  *
7613  * Revision 1.1  1995/05/16  15:25:29  allender
7614  * Initial revision
7615  *
7616  * Revision 2.2  1995/03/06  15:23:14  john
7617  * New screen techniques.
7618  *
7619  * Revision 2.1  1995/02/27  13:13:37  john
7620  * Removed floating point.
7621  *
7622  * Revision 2.0  1995/02/27  11:27:45  john
7623  * New version 2.0, which has no anonymous unions, builds with
7624  * Watcom 10.0, and doesn't require parsing BITMAPS.TBL.
7625  *
7626  * Revision 1.70  1995/02/13  20:35:09  john
7627  * Lintized
7628  *
7629  * Revision 1.69  1995/02/07  17:12:03  rob
7630  * Added ifdef's for Editor.
7631  *
7632  * Revision 1.68  1995/02/07  16:51:48  mike
7633  * fix gray rock josh problem.
7634  *
7635  * Revision 1.67  1995/02/01  15:46:26  yuan
7636  * Fixed matcen_nums.
7637  *
7638  * Revision 1.66  1995/01/19  15:19:28  mike
7639  * new super-compressed registered file format.
7640  *
7641  * Revision 1.65  1994/12/10  16:44:59  matt
7642  * Added debugging code to track down door that turns into rock
7643  *
7644  * Revision 1.64  1994/12/10  14:58:24  yuan
7645  * *** empty log message ***
7646  *
7647  * Revision 1.63  1994/12/08  17:19:10  yuan
7648  * Cfiling stuff.
7649  *
7650  * Revision 1.62  1994/12/07  14:05:33  yuan
7651  * Fixed wall assert problem... Bashed highest_segment
7652  * _index before WALL_IS_DOORWAY check.
7653  *
7654  * Revision 1.61  1994/11/27  23:14:52  matt
7655  * Made changes for new mprintf calling convention
7656  *
7657  * Revision 1.60  1994/11/27  18:05:20  matt
7658  * Compile out LVL reader when editor compiled out
7659  *
7660  * Revision 1.59  1994/11/26  22:51:45  matt
7661  * Removed editor-only fields from segment structure when editor is compiled
7662  * out, and padded segment structure to even multiple of 4 bytes.
7663  *
7664  * Revision 1.58  1994/11/26  21:48:02  matt
7665  * Fixed saturation in short light value
7666  *
7667  * Revision 1.57  1994/11/20  22:11:49  mike
7668  * comment out an apparently unnecessary call to fuelcen_reset().
7669  *
7670  * Revision 1.56  1994/11/18  21:56:42  john
7671  * Added a better, leaner pig format.
7672  *
7673  * Revision 1.55  1994/11/17  20:09:18  john
7674  * Added new compiled level format.
7675  *
7676  * Revision 1.54  1994/11/17  15:40:17  mike
7677  * Comment out mprintf which was causing important information to scroll away.
7678  *
7679  * Revision 1.53  1994/11/17  14:56:37  mike
7680  * moved segment validation functions from editor to main.
7681  *
7682  * Revision 1.52  1994/11/17  11:39:35  matt
7683  * Ripped out code to load old mines
7684  *
7685  * Revision 1.51  1994/11/14  20:47:53  john
7686  * Attempted to strip out all the code in the game
7687  * directory that uses any ui code.
7688  *
7689  * Revision 1.50  1994/11/14  16:05:38  matt
7690  * Fixed, maybe, again, errors when can't find texture during remap
7691  *
7692  * Revision 1.49  1994/11/14  14:34:03  matt
7693  * Fixed up handling when textures can't be found during remap
7694  *
7695  * Revision 1.48  1994/11/14  13:01:55  matt
7696  * Added Int3() when can't find texture
7697  *
7698  * Revision 1.47  1994/10/30  14:12:21  mike
7699  * rip out local segments stuff.
7700  *
7701  * Revision 1.46  1994/10/27  19:43:07  john
7702  * Disable the piglet option.
7703  *
7704  * Revision 1.45  1994/10/27  18:51:42  john
7705  * Added -piglet option that only loads needed textures for a
7706  * mine.  Only saved ~1MB, and code still doesn't free textures
7707  * before you load a new mine.
7708  *
7709  * Revision 1.44  1994/10/20  12:47:22  matt
7710  * Replace old save files (MIN/SAV/HOT) with new LVL files
7711  *
7712  * Revision 1.43  1994/10/19  16:46:40  matt
7713  * Made tmap overrides for robots remap texture numbers
7714  *
7715  * Revision 1.42  1994/10/03  23:37:01  mike
7716  * Adapt to changed fuelcen_activate parameters.
7717  *
7718  * Revision 1.41  1994/09/23  22:14:49  matt
7719  * Took out obsolete structure fields
7720  *
7721  * Revision 1.40  1994/08/01  11:04:11  yuan
7722  * New materialization centers.
7723  *
7724  * Revision 1.39  1994/07/21  19:01:47  mike
7725  * Call Lsegment stuff.
7726
7727 ------------------------------------------------------------------------
7728 main/gamemine.h:
7729
7730  * Revision 1.1  1995/05/16  15:57:02  allender
7731  * Initial revision
7732  *
7733  * Revision 2.0  1995/02/27  11:28:50  john
7734  * New version 2.0, which has no anonymous unions, builds with
7735  * Watcom 10.0, and doesn't require parsing BITMAPS.TBL.
7736  *
7737  * Revision 1.15  1994/11/17  11:39:34  matt
7738  * Ripped out code to load old mines
7739  *
7740  * Revision 1.14  1994/10/19  16:46:40  matt
7741  * Made tmap overrides for robots remap texture numbers
7742  *
7743  * Revision 1.13  1994/09/23  22:14:37  matt
7744  * Took out obsolete structure fields
7745  *
7746  * Revision 1.12  1994/07/22  12:36:32  matt
7747  * Cleaned up editor/game interactions some more.
7748  *
7749  * Revision 1.11  1994/06/01  11:21:37  yuan
7750  * Added controlcentertriggers to the gamesave.
7751  *
7752  * Revision 1.10  1994/05/10  12:14:26  yuan
7753  * Game save/load... Demo levels 1-5 added...
7754  * High scores fixed...
7755  *
7756  * Revision 1.9  1994/05/04  18:25:05  yuan
7757  * Working on gamesave.
7758  *
7759  * Revision 1.8  1994/05/03  15:53:27  yuan
7760  * Readded structure field groups for backward compatibility...
7761  *
7762  * Revision 1.7  1994/05/03  11:36:26  yuan
7763  * Stabilizing gamesave stuff.
7764  *
7765  * Revision 1.6  1994/04/28  11:01:32  yuan
7766  * Added objects in structure.
7767  *
7768  * Revision 1.5  1994/04/06  18:30:03  john
7769  * Added Refueling segments.
7770  *
7771  * Revision 1.4  1994/03/17  18:06:53  yuan
7772  * Removed switch code... Now we just have Walls, Triggers, and Links...
7773  *
7774  * Revision 1.3  1994/03/01  18:12:24  yuan
7775  * Wallswitches, triggers, and more!
7776  *
7777  * Revision 1.2  1994/02/10  15:36:01  matt
7778  * Various changes to make editor compile out.
7779  *
7780  * Revision 1.1  1994/02/09  17:11:45  matt
7781  * Initial revision
7782
7783 ------------------------------------------------------------------------
7784 main/gamesave.c:
7785
7786  * Revision 1.3  1996/02/21  13:59:17  allender
7787  * check Data folder when can't open a level file from a hog
7788  *
7789  * Revision 1.2  1995/10/31  10:23:23  allender
7790  * shareware stuff
7791  *
7792  * Revision 1.1  1995/05/16  15:25:37  allender
7793  * Initial revision
7794  *
7795  * Revision 2.2  1995/04/23  14:53:12  john
7796  * Made some mine structures read in with no structure packing problems.
7797  *
7798  * Revision 2.1  1995/03/20  18:15:43  john
7799  * Added code to not store the normals in the segment structure.
7800  *
7801  * Revision 2.0  1995/02/27  11:29:50  john
7802  * New version 2.0, which has no anonymous unions, builds with
7803  * Watcom 10.0, and doesn't require parsing BITMAPS.TBL.
7804  *
7805  * Revision 1.207  1995/02/23  10:17:36  allender
7806  * fixed parameter mismatch with compute_segment_center
7807  *
7808  * Revision 1.206  1995/02/22  14:51:17  allender
7809  * fixed some things that I missed
7810  *
7811  * Revision 1.205  1995/02/22  13:31:38  allender
7812  * remove anonymous unions from object structure
7813  *
7814  * Revision 1.204  1995/02/01  20:58:08  john
7815  * Made editor check hog.
7816  *
7817  * Revision 1.203  1995/01/28  17:40:34  mike
7818  * correct level names (use rdl, sdl) for dumpmine stuff.
7819  *
7820  * Revision 1.202  1995/01/25  20:03:46  matt
7821  * Moved matrix check to avoid orthogonalizing an uninitialize matrix
7822  *
7823  * Revision 1.201  1995/01/20  16:56:53  mike
7824  * remove some mprintfs.
7825  *
7826  * Revision 1.200  1995/01/15  19:42:13  matt
7827  * Ripped out hostage faces for registered version
7828  *
7829  * Revision 1.199  1995/01/05  16:59:09  yuan
7830  * Make it so if editor is loaded, don't get error from typo
7831  * in filename.
7832  *
7833  * Revision 1.198  1994/12/19  12:49:46  mike
7834  * Change fgets to cfgets.  fgets was getting a pointer mismatch warning.
7835  *
7836  * Revision 1.197  1994/12/12  01:20:03  matt
7837  * Took out object size hack for green claw guys
7838  *
7839  * Revision 1.196  1994/12/11  13:19:37  matt
7840  * Restored calls to fix_object_segs() when debugging is turned off, since
7841  * it's not a big routine, and could fix some possibly bad problems.
7842  *
7843  * Revision 1.195  1994/12/10  16:17:24  mike
7844  * fix editor bug that was converting transparent walls into rock.
7845  *
7846  * Revision 1.194  1994/12/09  14:59:27  matt
7847  * Added system to attach a fireball to another object for rendering purposes,
7848  * so the fireball always renders on top of (after) the object.
7849  *
7850  * Revision 1.193  1994/12/08  17:19:02  yuan
7851  * Cfiling stuff.
7852  *
7853  * Revision 1.192  1994/12/02  20:01:05  matt
7854  * Always give vulcan cannon powerup same amount of ammo, regardless of
7855  * how much it was saved with
7856  *
7857  * Revision 1.191  1994/11/30  17:45:57  yuan
7858  * Saving files now creates RDL/SDLs instead of CDLs.
7859  *
7860  * Revision 1.190  1994/11/30  17:22:14  matt
7861  * Ripped out hostage faces in shareware version
7862  *
7863  * Revision 1.189  1994/11/28  00:09:30  allender
7864  * commented out call to newdemo_record_start_demo in load_level...what is
7865  * this doing here anyway?????
7866  *
7867  * Revision 1.188  1994/11/27  23:13:48  matt
7868  * Made changes for new mprintf calling convention
7869  *
7870  * Revision 1.187  1994/11/27  18:06:20  matt
7871  * Cleaned up LVL/CDL file loading
7872  *
7873  * Revision 1.186  1994/11/25  22:46:29  matt
7874  * Allow ESC out of compiled/normal menu (esc=compiled).
7875  *
7876  * Revision 1.185  1994/11/23  12:18:35  mike
7877  * move level names here...a more logical place than dumpmine.
7878  *
7879  * Revision 1.184  1994/11/21  20:29:19  matt
7880  * If hostage info is bad, fix it.
7881  *
7882  * Revision 1.183  1994/11/21  20:26:07  matt
7883  * Fixed bug, I hope
7884  *
7885  * Revision 1.182  1994/11/21  20:20:37  matt
7886  * Fixed stupid mistake
7887  *
7888  * Revision 1.181  1994/11/21  20:18:40  matt
7889  * Fixed (hopefully) totally bogus writing of hostage data
7890  *
7891  * Revision 1.180  1994/11/20  14:11:56  matt
7892  * Gracefully handle two hostages having same id
7893  *
7894  * Revision 1.179  1994/11/19  23:55:05  mike
7895  * remove Assert, put in comment for Matt.
7896  *
7897  * Revision 1.178  1994/11/19  19:53:24  matt
7898  * Added code to full support different hostage head clip & message for
7899  * each hostage.
7900  *
7901  * Revision 1.177  1994/11/19  15:15:21  mike
7902  * remove unused code and data
7903  *
7904  * Revision 1.176  1994/11/19  10:28:28  matt
7905  * Took out write routines when editor compiled out
7906  *
7907  * Revision 1.175  1994/11/17  20:38:25  john
7908  * Took out warning.
7909  *
7910  * Revision 1.174  1994/11/17  20:36:34  john
7911  * Made it so that saving a mine will write the .cdl even
7912  * if .lvl gets error.
7913  *
7914  * Revision 1.173  1994/11/17  20:26:19  john
7915  * Made the game load whichever of .cdl or .lvl exists,
7916  * and if they both exist, prompt the user for which one.
7917  *
7918  * Revision 1.172  1994/11/17  20:11:20  john
7919  * Fixed warning.
7920  *
7921  * Revision 1.171  1994/11/17  20:09:26  john
7922  * Added new compiled level format.
7923  *
7924  * Revision 1.170  1994/11/17  14:57:21  mike
7925  * moved segment validation functions from editor to main.
7926  *
7927  * Revision 1.169  1994/11/17  11:39:21  matt
7928  * Ripped out code to load old mines
7929  *
7930  * Revision 1.168  1994/11/16  11:24:53  matt
7931  * Made attack-type robots have smaller radius, so they get closer to player
7932  *
7933  * Revision 1.167  1994/11/15  21:42:47  mike
7934  * better error messages.
7935  *
7936  * Revision 1.166  1994/11/15  15:30:41  matt
7937  * Save ptr to name of level being loaded
7938  *
7939  * Revision 1.165  1994/11/14  20:47:46  john
7940  * Attempted to strip out all the code in the game
7941  * directory that uses any ui code.
7942  *
7943  * Revision 1.164  1994/11/14  14:34:23  matt
7944  * Fixed up handling when textures can't be found during remap
7945  *
7946  * Revision 1.163  1994/11/10  14:02:49  matt
7947  * Hacked in support for player ships with different textures
7948  *
7949  * Revision 1.162  1994/11/06  14:38:17  mike
7950  * Remove an apparently unnecessary mprintf.
7951  *
7952  * Revision 1.161  1994/10/30  14:11:28  mike
7953  * ripout local segments stuff.
7954  *
7955  * Revision 1.160  1994/10/28  12:10:41  matt
7956  * Check that was supposed to happen only when editor was in was happening
7957  * only when editor was out.
7958  *
7959  * Revision 1.159  1994/10/27  11:25:32  matt
7960  * Only do connectivity error check when editor in
7961  *
7962  * Revision 1.158  1994/10/27  10:54:00  matt
7963  * Made connectivity error checking put up warning if errors found
7964  *
7965  * Revision 1.157  1994/10/25  10:50:54  matt
7966  * Vulcan cannon powerups now contain ammo count
7967  *
7968  * Revision 1.156  1994/10/23  02:10:43  matt
7969  * Got rid of obsolete hostage_info stuff
7970  *
7971  * Revision 1.155  1994/10/22  18:57:26  matt
7972  * Added call to check_segment_connections()
7973  *
7974  * Revision 1.154  1994/10/21  12:19:23  matt
7975  * Clear transient objects when saving (& loading) games
7976  *
7977  * Revision 1.153  1994/10/21  11:25:10  mike
7978  * Use new constant IMMORTAL_TIME.
7979  *
7980  * Revision 1.152  1994/10/20  12:46:59  matt
7981  * Replace old save files (MIN/SAV/HOT) with new LVL files
7982  *
7983  * Revision 1.151  1994/10/19  19:26:32  matt
7984  * Fixed stupid bug
7985  *
7986  * Revision 1.150  1994/10/19  16:46:21  matt
7987  * Made tmap overrides for robots remap texture numbers
7988  *
7989  * Revision 1.149  1994/10/18  08:50:27  yuan
7990  * Fixed correct variable this time.
7991  *
7992  * Revision 1.148  1994/10/18  08:45:02  yuan
7993  * Oops. forgot load function.
7994  *
7995  * Revision 1.147  1994/10/18  08:42:10  yuan
7996  * Avoid the int3.
7997  *
7998  * Revision 1.146  1994/10/17  21:34:57  matt
7999  * Added support for new Control Center/Main Reactor
8000  *
8001  * Revision 1.145  1994/10/15  19:06:34  mike
8002  * Fix bug, maybe, having to do with something or other, ...
8003  *
8004  * Revision 1.144  1994/10/12  21:07:33  matt
8005  * Killed unused field in object structure
8006  *
8007  * Revision 1.143  1994/10/06  14:52:55  mike
8008  * Put check in to detect possibly bogus walls in last segment which leaked through an earlier check
8009  * due to misuse of Highest_segment_index.
8010  *
8011  * Revision 1.142  1994/10/05  22:12:44  mike
8012  * Put in cleanup for matcen/fuelcen links.
8013  *
8014  * Revision 1.141  1994/10/03  11:30:05  matt
8015  * Make sure player in a valid segment before saving
8016  *
8017  * Revision 1.140  1994/09/28  11:14:41  mike
8018  * Better error messaging on bogus mines: Only bring up dialog box if a "real" (level??.*) level.
8019  *
8020  * Revision 1.139  1994/09/28  09:22:58  mike
8021  * Comment out a mprintf.
8022  *
8023  * Revision 1.138  1994/09/27  17:08:36  mike
8024  * Message boxes when you load bogus mines.
8025  *
8026  * Revision 1.137  1994/09/27  15:43:45  mike
8027  * Move the dump stuff to dumpmine.
8028  *
8029  * Revision 1.136  1994/09/27  00:02:31  mike
8030  * Dump text files (".txm") when loading a mine, showing all kinds of useful mine info.
8031  *
8032  * Revision 1.135  1994/09/26  11:30:41  matt
8033  * Took out code which loaded bogus player structure
8034  *
8035  * Revision 1.134  1994/09/26  11:18:44  john
8036  * Fixed some conflicts with newseg.
8037  *
8038  * Revision 1.133  1994/09/26  10:56:58  matt
8039  * Fixed inconsistancies in lifeleft for immortal objects
8040  *
8041  * Revision 1.132  1994/09/25  23:41:10  matt
8042  * Changed the object load & save code to read/write the structure fields one
8043  * at a time (rather than the whole structure at once).  This mean that the
8044  * object structure can be changed without breaking the load/save functions.
8045  * As a result of this change, the local_object data can be and has been
8046  * incorporated into the object array.  Also, timeleft is now a property
8047  * of all objects, and the object structure has been otherwise cleaned up.
8048
8049 ------------------------------------------------------------------------
8050 main/gamesave.h:
8051
8052  * Revision 1.1  1995/05/16  15:57:10  allender
8053  * Initial revision
8054  *
8055  * Revision 2.0  1995/02/27  11:30:25  john
8056  * New version 2.0, which has no anonymous unions, builds with
8057  * Watcom 10.0, and doesn't require parsing BITMAPS.TBL.
8058  *
8059  * Revision 1.11  1994/11/23  12:19:32  mike
8060  * detail level menu.
8061  *
8062  * Revision 1.10  1994/10/20  12:47:30  matt
8063  * Replace old save files (MIN/SAV/HOT) with new LVL files
8064  *
8065  * Revision 1.9  1994/09/27  17:08:47  mike
8066  * Message boxes when you load bogus mines.
8067  *
8068  * Revision 1.8  1994/09/27  15:43:05  mike
8069  * Prototype write_game_text.
8070  *
8071  * Revision 1.7  1994/09/14  15:46:39  matt
8072  * Added function load_mine_only()
8073  *
8074  * Revision 1.6  1994/07/22  12:36:28  matt
8075  * Cleaned up editor/game interactions some more.
8076  *
8077  * Revision 1.5  1994/07/20  13:38:14  matt
8078  * Added get_level_name() prototype
8079  *
8080  * Revision 1.4  1994/06/20  22:19:41  john
8081  * Added Gamesave_num_org_robots.
8082  *
8083  * Revision 1.3  1994/06/14  11:32:49  john
8084  * Made Newdemo record & restore the current mine.
8085  *
8086  * Revision 1.2  1994/05/14  17:16:25  matt
8087  * Got rid of externs in source (non-header) files
8088  *
8089  * Revision 1.1  1994/05/14  16:01:26  matt
8090  * Initial revision
8091
8092 ------------------------------------------------------------------------
8093 main/gameseg.c:
8094
8095  * Revision 1.9  1995/11/08  16:26:04  allender
8096  * minor bug fix in find_connected_distance
8097  *
8098  * Revision 1.8  1995/10/12  17:36:55  allender
8099  * made trace_segs only recurse 100 times max
8100  *
8101  * Revision 1.7  1995/10/11  18:29:01  allender
8102  * removed Int3 from trace_segs
8103  *
8104  * Revision 1.6  1995/10/11  14:13:54  allender
8105  * put in stack check code into trace-segs
8106  *
8107  * Revision 1.5  1995/09/23  09:40:25  allender
8108  * put in casts in extract_shortpos to try and solve shortpos problem
8109  * with appletalk
8110  *
8111  * Revision 1.4  1995/09/20  14:26:50  allender
8112  * added flag to swap bytes on extract shortpot
8113  *
8114  * Revision 1.3  1995/08/12  12:01:27  allender
8115  * added flag to create_shortpos to swap bytes
8116  *
8117  * Revision 1.2  1995/06/06  10:42:07  allender
8118  * made shortpos routines swap bytes when extracting and making shortpos structures
8119  *
8120  * Revision 1.1  1995/05/16  15:25:46  allender
8121  * Initial revision
8122  *
8123  * Revision 2.2  1995/03/20  18:15:39  john
8124  * Added code to not store the normals in the segment structure.
8125  *
8126  * Revision 2.1  1995/03/08  12:11:39  allender
8127  * fix shortpos reading/writing
8128  *
8129  * Revision 2.0  1995/02/27  11:29:21  john
8130  * New version 2.0, which has no anonymous unions, builds with
8131  * Watcom 10.0, and doesn't require parsing BITMAPS.TBL.
8132  *
8133  * Revision 1.78  1995/02/22  13:52:22  allender
8134  * remove anonymous unions from object structure
8135  *
8136  * Revision 1.77  1995/02/22  13:24:47  john
8137  * Removed the vecmat anonymous unions.
8138  *
8139  * Revision 1.76  1995/02/13  20:35:01  john
8140  * Lintized
8141  *
8142  * Revision 1.75  1995/02/09  13:10:51  mike
8143  * remove an annoying mprintf.
8144  *
8145  * Revision 1.74  1995/02/05  17:49:28  rob
8146  * Added assert to gameseg.c.
8147  *
8148  * Revision 1.73  1995/02/02  00:49:26  mike
8149  * new automap segment-depth functionality.
8150  *
8151  * Revision 1.72  1995/01/16  21:06:51  mike
8152  * Move function pick_random_point_in_segment from fireball.c to gameseg.c.
8153  *
8154  * Revision 1.71  1994/12/21  19:54:32  matt
8155  * Added error checking
8156  *
8157  * Revision 1.70  1994/12/11  21:34:09  matt
8158  * Changed assert() to int3()
8159  *
8160  * Revision 1.69  1994/12/01  21:04:37  matt
8161  * Several important changes:
8162  *  (1) Checking against triangulated sides has been standardized a bit
8163  *  (2) Code has been added to de-triangulate some sides
8164  *  (3) BIG ONE: the tolerance for checking a point against a plane has
8165  *      been drastically relaxed
8166  *
8167  *
8168  * Revision 1.67  1994/11/27  23:12:21  matt
8169  * Made changes for new mprintf calling convention
8170  *
8171  * Revision 1.66  1994/11/26  22:51:40  matt
8172  * Removed editor-only fields from segment structure when editor is compiled
8173  * out, and padded segment structure to even multiple of 4 bytes.
8174  *
8175  * Revision 1.65  1994/11/22  16:55:38  mike
8176  * use memset in place of loop to clear array.
8177  *
8178  * Revision 1.64  1994/11/19  15:20:37  mike
8179  * rip out unused code and data
8180  *
8181  * Revision 1.63  1994/11/18  18:31:48  matt
8182  * Fixed code again (and maybe for real)
8183  *
8184  * Revision 1.62  1994/11/18  16:54:24  matt
8185  * Fixed extract_orient_from_segment()
8186  *
8187  * Revision 1.61  1994/11/17  14:56:50  mike
8188  * moved segment validation functions from editor to main.
8189  *
8190  * Revision 1.60  1994/11/16  23:38:53  mike
8191  * new improved boss teleportation behavior.
8192  *
8193  * Revision 1.59  1994/10/30  14:12:46  mike
8194  * rip out local segments stuff.
8195  *
8196  * Revision 1.58  1994/10/27  10:53:39  matt
8197  * Made connectivity error checking put up warning if errors found
8198  *
8199  * Revision 1.57  1994/10/25  21:19:26  mike
8200  * debugging code.
8201  *
8202  * Revision 1.56  1994/10/25  11:26:09  mike
8203  * *** empty log message ***
8204  *
8205  * Revision 1.55  1994/10/22  22:36:08  matt
8206  * Improved error finding routine
8207  *
8208  * Revision 1.54  1994/10/22  18:56:51  matt
8209  * Fixed obscure bug in segment trace code
8210  * Added error find routine, check_segment_connections()
8211  *
8212  * Revision 1.53  1994/10/17  14:05:19  matt
8213  * Don't give recursion assert if doing lighting
8214  *
8215  * Revision 1.52  1994/10/15  19:03:48  mike
8216  * Don't do exhaustive search in smooth lighting.
8217  *
8218  * Revision 1.51  1994/10/12  09:46:44  mike
8219  * Add debug code for trapping exhaustive searches.
8220  *
8221  * Revision 1.50  1994/10/11  20:50:41  matt
8222  * Made find_point_seg() take -1 as segnum, meaning to search all segments
8223  *
8224  * Revision 1.49  1994/10/11  17:40:31  matt
8225  * Fixed bug that caused segment trace to only go through sides you can fly through
8226  *
8227  * Revision 1.48  1994/10/10  14:48:16  matt
8228  * Fixed mistake that caused odd pauses and occasional int3's
8229  *
8230  * Revision 1.47  1994/10/09  23:50:41  matt
8231  * Made find_hitpoint_uv() work with triangulated sides
8232  *
8233  * Revision 1.46  1994/10/08  23:06:52  matt
8234  * trace_segs() didn't know about external walls
8235  *
8236  * Revision 1.45  1994/10/07  22:18:57  mike
8237  * Put in asserts to trap bad segnums.
8238  *
8239  * Revision 1.44  1994/10/06  14:08:07  matt
8240  * Added new function, extract_orient_from_segment()
8241  *
8242  * Revision 1.43  1994/10/04  16:24:11  mike
8243  * Set global Connected_segment_distance for debug reasons for aipath.c.
8244  *
8245  * Revision 1.42  1994/10/04  09:18:42  mike
8246  * Comment out a variable definition, preventing a warning message.
8247  *
8248  * Revision 1.41  1994/10/03  23:43:42  mike
8249  * Put in a warning for overrunning point_segs buffer.
8250  *
8251  * Revision 1.40  1994/10/03  20:55:43  rob
8252  * Added velocity to shortpos.
8253  *
8254  * Revision 1.39  1994/09/27  11:46:06  rob
8255  * re-fixed that same bug (ugh).
8256  *
8257  * Revision 1.38  1994/09/27  10:10:51  rob
8258  * Fixed bug in extract_shortpos (obj_relink added).
8259  *
8260  * Revision 1.37  1994/09/25  23:41:02  matt
8261  * Changed the object load & save code to read/write the structure fields one
8262  * at a time (rather than the whole structure at once).  This mean that the
8263  * object structure can be changed without breaking the load/save functions.
8264  * As a result of this change, the local_object data can be and has been
8265  * incorporated into the object array.  Also, timeleft is now a property
8266  * of all objects, and the object structure has been otherwise cleaned up.
8267  *
8268  * Revision 1.36  1994/09/22  19:03:05  mike
8269  * Add shortpos manipulation functions create_shortpos and extract_shortpos.
8270  *
8271  * Revision 1.35  1994/09/19  21:21:16  mike
8272  * Minor optimization to find_connected_distance.
8273  *
8274  * Revision 1.34  1994/09/19  21:05:25  mike
8275  * Write function find_connected_distance,
8276  * returns distance between two points as travellable through the mine.
8277  *
8278  * Revision 1.33  1994/08/30  15:07:15  matt
8279  * Changed find_point_seg() to deal with some infinite recursion problems.
8280  *
8281  * Revision 1.32  1994/08/11  18:58:32  mike
8282  * Use ints in place of shorts for optimization.
8283  *
8284  * Revision 1.31  1994/08/04  00:20:09  matt
8285  * Cleaned up fvi & physics error handling; put in code to make sure objects
8286  * are in correct segment; simplified segment finding for objects and points
8287  *
8288  * Revision 1.30  1994/08/03  16:46:12  mike
8289  * not much...
8290  *
8291  * Revision 1.29  1994/08/02  20:41:31  matt
8292  * Fixed bug in get_side_verts()
8293  *
8294  * Revision 1.28  1994/08/02  19:04:25  matt
8295  * Cleaned up vertex list functions
8296  *
8297  * Revision 1.27  1994/08/01  10:39:44  matt
8298  * find_new_seg() now will look through any kind of wall but a totally solid one
8299  *
8300  * Revision 1.26  1994/07/28  19:15:59  matt
8301  * Fixed yet another bug in get_seg_masks()
8302
8303 ------------------------------------------------------------------------
8304 main/gameseg.h:
8305
8306  * Revision 1.1  1995/05/16  15:57:18  allender
8307  * Initial revision
8308  *
8309  * Revision 2.0  1995/02/27  11:31:20  john
8310  * New version 2.0, which has no anonymous unions, builds with
8311  * Watcom 10.0, and doesn't require parsing BITMAPS.TBL.
8312  *
8313  * Revision 1.24  1995/02/01  16:34:03  john
8314  * Linted.
8315  *
8316  * Revision 1.23  1995/01/16  21:06:36  mike
8317  * Move function pick_random_point_in_segment from fireball.c to gameseg.c.
8318  *
8319  * Revision 1.22  1994/11/23  12:18:59  mike
8320  * prototype for level names.
8321  *
8322  * Revision 1.21  1994/11/17  14:56:59  mike
8323  * moved segment validation functions from editor to main.
8324  *
8325  * Revision 1.20  1994/11/16  23:38:46  mike
8326  * new improved boss teleportation behavior.
8327  *
8328  * Revision 1.19  1994/10/30  14:12:14  mike
8329  * rip out local segments stuff.
8330  *
8331  * Revision 1.18  1994/10/09  23:51:07  matt
8332  * Made find_hitpoint_uv() work with triangulated sides
8333  *
8334  * Revision 1.17  1994/10/06  14:08:22  matt
8335  * Added new function, extract_orient_from_segment()
8336  *
8337  * Revision 1.16  1994/09/19  21:05:52  mike
8338  * Prototype for find_connected_distance.
8339  *
8340  * Revision 1.15  1994/08/11  18:58:45  mike
8341  * Change shorts to ints.
8342  *
8343  * Revision 1.14  1994/08/04  00:21:09  matt
8344  * Cleaned up fvi & physics error handling; put in code to make sure objects
8345  * are in correct segment; simplified segment finding for objects and points
8346  *
8347  * Revision 1.13  1994/08/02  19:04:25  matt
8348  * Cleaned up vertex list functions
8349  *
8350  * Revision 1.12  1994/07/21  19:01:53  mike
8351  * lsegment stuff.
8352  *
8353  * Revision 1.11  1994/07/07  09:31:13  matt
8354  * Added comments
8355  *
8356  * Revision 1.10  1994/06/14  12:21:20  matt
8357  * Added new function, find_point_seg()
8358  *
8359  * Revision 1.9  1994/05/29  23:17:38  matt
8360  * Move find_object_seg() from physics.c to gameseg.c
8361  * Killed unused find_point_seg()
8362  *
8363  * Revision 1.8  1994/05/20  11:56:57  matt
8364  * Cleaned up find_vector_intersection() interface
8365  * Killed check_point_in_seg(), check_player_seg(), check_object_seg()
8366  *
8367  * Revision 1.7  1994/03/17  18:07:38  yuan
8368  * Removed switch code... Now we just have Walls, Triggers, and Links...
8369  *
8370  * Revision 1.6  1994/02/22  18:14:44  yuan
8371  * Added new wall system
8372  *
8373  * Revision 1.5  1994/02/17  11:33:22  matt
8374  * Changes in object system
8375  *
8376  * Revision 1.4  1994/02/16  13:48:33  mike
8377  * enable editor to compile out.
8378  *
8379  * Revision 1.3  1994/02/14  12:05:07  mike
8380  * change segment data structure.
8381  *
8382  * Revision 1.2  1994/02/10  16:07:20  mike
8383  * separate editor from game based on EDITOR flag.
8384  *
8385  * Revision 1.1  1994/02/09  15:45:38  mike
8386  * Initial revision
8387
8388 ------------------------------------------------------------------------
8389 main/gameseq.c:
8390
8391  * Revision 1.1  1995/12/05  16:02:05  allender
8392  * Initial revision
8393  *
8394  * Revision 1.14  1995/11/03  12:55:30  allender
8395  * shareware changes
8396  *
8397  * Revision 1.13  1995/10/31  10:23:07  allender
8398  * shareware stuff
8399  *
8400  * Revision 1.12  1995/10/18  18:25:02  allender
8401  * call auto_select_weapon after initing ammo since that may
8402  * change the secondary weapon status
8403  *
8404  * Revision 1.11  1995/10/17  13:17:11  allender
8405  * added closebox when entering pilot name
8406  *
8407  * Revision 1.10  1995/09/24  10:56:59  allender
8408  * new players must be looked for in Players directory
8409  *
8410  * Revision 1.9  1995/09/18  08:08:08  allender
8411  * remove netgame binding if at endgame
8412  *
8413  * Revision 1.8  1995/09/14  14:13:01  allender
8414  * initplayerobject have void return
8415  *
8416  * Revision 1.7  1995/08/31  12:54:42  allender
8417  * try and fix bug
8418  *
8419  * Revision 1.6  1995/08/26  16:25:40  allender
8420  * put return values on needed functions
8421  *
8422  * Revision 1.5  1995/08/14  09:26:28  allender
8423  * added byteswap header files
8424  *
8425  * Revision 1.4  1995/08/01  13:57:42  allender
8426  * macified player file stuff -- players stored in seperate folder
8427  *
8428  * Revision 1.3  1995/06/08  12:54:37  allender
8429  * new function for calculating a segment based checksum since the old way
8430  * is byte order dependent
8431  *
8432  * Revision 1.2  1995/06/02  07:42:10  allender
8433  * removed duplicate extern for network_endlevel_poll2
8434  *
8435  * Revision 1.1  1995/05/16  15:25:56  allender
8436  * Initial revision
8437  *
8438  * Revision 2.10  1995/12/19  15:48:25  john
8439  * Made screen reset when loading new level.
8440  *
8441  * Revision 2.9  1995/07/07  16:47:52  john
8442  * Fixed bug with reactor time..
8443  *
8444  * Revision 2.8  1995/06/15  12:14:18  john
8445  * Made end game, win game and title sequences all go
8446  * on after 5 minutes automatically.
8447  *
8448  * Revision 2.7  1995/05/26  16:16:25  john
8449  * Split SATURN into define's for requiring cd, using cd, etc.
8450  * Also started adding all the Rockwell stuff.
8451  *
8452  * Revision 2.6  1995/03/24  13:11:20  john
8453  * Added save game during briefing screens.
8454  *
8455  * Revision 2.5  1995/03/23  17:56:20  allender
8456  * added code to record old laser level and weapons when player gets
8457  * new ship
8458  *
8459  * Revision 2.4  1995/03/21  08:39:14  john
8460  * Ifdef'd out the NETWORK code.
8461  *
8462  * Revision 2.3  1995/03/15  14:33:33  john
8463  * Added code to force the Descent CD-rom in the drive.
8464  *
8465  * Revision 2.2  1995/03/06  16:47:26  mike
8466  * destination saturn
8467  *
8468  * Revision 2.1  1995/03/06  15:23:23  john
8469  * New screen techniques.
8470  *
8471  * Revision 2.0  1995/02/27  11:28:53  john
8472  * New version 2.0, which has no anonymous unions, builds with
8473  * Watcom 10.0, and doesn't require parsing BITMAPS.TBL.
8474  *
8475  * Revision 1.310  1995/02/14  10:48:09  mike
8476  * zero bonus if you are a cheater.
8477  *
8478  * Revision 1.309  1995/02/11  19:17:08  rob
8479  * Fixed bug in laser fire rate after demo playback.
8480  *
8481  * Revision 1.308  1995/02/11  14:34:08  rob
8482  * Added include of netmisc.c
8483  *
8484  * Revision 1.307  1995/02/11  14:29:04  rob
8485  * Fixes for invul. controlcen.
8486  *
8487  * Revision 1.306  1995/02/11  13:47:00  mike
8488  * fix cheats.
8489  *
8490  * Revision 1.305  1995/02/11  13:10:52  rob
8491  * Fixed end of anarchy mission problems.
8492  *
8493  * Revision 1.304  1995/02/11  12:46:12  mike
8494  * initialize Robot_firing_enabled, part of AHIMSA cheat.
8495  *
8496  * Revision 1.303  1995/02/11  12:42:03  john
8497  * Added new song method, with FM bank switching..
8498  *
8499  * Revision 1.302  1995/02/10  17:39:29  matt
8500  * Changed secret exit message to be centered
8501  *
8502  * Revision 1.301  1995/02/10  16:17:33  mike
8503  * init Last_level_path_shown.
8504  *
8505  * Revision 1.300  1995/02/09  22:18:22  john
8506  * Took out between level saves.
8507  *
8508  * Revision 1.299  1995/02/09  12:11:42  rob
8509  * Get rid of high scores thing for multiplayer games.
8510  *
8511  * Revision 1.298  1995/02/08  20:34:24  rob
8512  * Took briefing screens back OUT of coop games (per Interplay request)
8513  *
8514  * Revision 1.297  1995/02/08  19:20:09  rob
8515  * Moved checksum calc.
8516  *
8517  * Revision 1.296  1995/02/05  14:39:24  rob
8518  * Changed object mapping to be more efficient.
8519  *
8520  * Revision 1.295  1995/02/02  19:05:38  john
8521  * Made end level menu for 27 not overwrite descent title..
8522  *
8523  * Revision 1.294  1995/02/02  16:36:42  adam
8524  * *** empty log message ***
8525  *
8526  * Revision 1.293  1995/02/02  15:58:02  john
8527  * Added turbo mode cheat.
8528  *
8529  * Revision 1.292  1995/02/02  15:29:34  matt
8530  * Changed & localized secret level text
8531  *
8532  * Revision 1.291  1995/02/02  10:50:03  adam
8533  * messed with secret level message
8534  *
8535  * Revision 1.290  1995/02/02  01:20:28  adam
8536  * changed endgame song temporarily.
8537  *
8538  * Revision 1.289  1995/02/01  23:19:43  rob
8539  * Fixed up endlevel stuff for multiplayer.
8540  * Put in palette fades around areas that didn't have them before.
8541  *
8542  * Revision 1.288  1995/02/01  17:12:34  mike
8543  * Make score come after endgame screens.
8544  *
8545  * Revision 1.287  1995/01/30  18:34:30  rob
8546  * Put briefing screens back into coop games.
8547  *
8548  * Revision 1.286  1995/01/27  13:07:59  rob
8549  * Removed erroneous warning message.
8550  *
8551  * Revision 1.285  1995/01/27  11:47:43  rob
8552  * Removed new secret level menu from multiplayer games.
8553  *
8554  * Revision 1.284  1995/01/26  22:11:11  mike
8555  * Purple chromo-blaster (ie, fusion cannon) spruce up (chromification)
8556  *
8557  * Revision 1.283  1995/01/26  16:55:13  rob
8558  * Removed ship bonus from cooperative endgame.
8559  *
8560  * Revision 1.282  1995/01/26  16:45:24  mike
8561  * Add autofire fusion cannon stuff.
8562  *
8563  * Revision 1.281  1995/01/26  14:44:44  rob
8564  * Removed unnecessary #ifdefs around mprintfs.
8565  * Changed NumNetPlayerPositions to be independant of MaxNumNetPlayers to
8566  * accomodate 4-player robo-archy games with 8 start positions.
8567  *
8568  * Revision 1.280  1995/01/26  12:19:01  rob
8569  * Changed network_do_frame call.
8570  *
8571  * Revision 1.279  1995/01/26  00:35:03  matt
8572  * Changed numbering convention for HMP files for levels
8573  *
8574  * Revision 1.278  1995/01/25  16:07:59  matt
8575  * Added message (prototype) when going to secret level
8576  *
8577  * Revision 1.277  1995/01/22  18:57:23  matt
8578  * Made player highest level work with missions
8579  *
8580  * Revision 1.276  1995/01/21  23:13:08  matt
8581  * Made high scores with (not work, really) with loaded missions
8582  * Don't give player high score when quit game
8583  *
8584  * Revision 1.275  1995/01/21  17:17:39  john
8585  * *** empty log message ***
8586  *
8587  * Revision 1.274  1995/01/21  17:15:38  john
8588  * Added include for state.h
8589  *
8590  * Revision 1.273  1995/01/21  16:21:14  matt
8591  * Fixed bugs in secret level sequencing
8592  *
8593  * Revision 1.272  1995/01/20  22:47:29  matt
8594  * Mission system implemented, though imcompletely
8595  *
8596  * Revision 1.271  1995/01/19  17:00:48  john
8597  * Made save game work between levels.
8598  *
8599  * Revision 1.270  1995/01/17  17:49:10  rob
8600  * Added key syncing for coop.
8601  *
8602  * Revision 1.269  1995/01/17  14:27:37  john
8603  * y
8604  *
8605  * Revision 1.268  1995/01/17  13:36:33  john
8606  * Moved pig loading into StartNewLevelSub.
8607  *
8608  * Revision 1.267  1995/01/16  16:53:55  john
8609  * Added code to save cheat state during save game.
8610  *
8611  * Revision 1.266  1995/01/15  19:42:10  matt
8612  * Ripped out hostage faces for registered version
8613  *
8614  * Revision 1.265  1995/01/15  16:55:06  john
8615  * Improved mine texture parsing.
8616  *
8617  * Revision 1.264  1995/01/15  11:56:24  john
8618  * Working version of paging.
8619  *
8620  * Revision 1.263  1995/01/14  19:16:40  john
8621  * First version of new bitmap paging code.
8622  *
8623  * Revision 1.262  1995/01/13  17:38:58  yuan
8624  * Removed Int3() for number players check.
8625  *
8626  * Revision 1.261  1995/01/12  12:09:52  yuan
8627  * Added coop object capability.
8628  *
8629  * Revision 1.260  1995/01/05  17:16:08  yuan
8630  * Removed Int3s.
8631  *
8632  * Revision 1.259  1995/01/05  11:34:29  john
8633  * Took out endlevel save stuff for registered.
8634  *
8635  * Revision 1.258  1995/01/04  19:00:16  rob
8636  * Added some debugging for two bugs.
8637  *
8638  * Revision 1.257  1995/01/04  13:18:18  john
8639  * Added cool 6 game save.
8640  *
8641  * Revision 1.256  1995/01/04  08:46:18  rob
8642  * JOHN CHECKED IN FOR ROB !!!
8643  *
8644  * Revision 1.255  1995/01/02  20:07:35  rob
8645  * Added score syncing.
8646  * Get rid of endlevel score for coop games (put it back in elsewhere)
8647  *
8648  * Revision 1.254  1995/01/02  16:17:43  mike
8649  * init super boss.
8650  *
8651  * Revision 1.253  1994/12/21  21:08:47  rob
8652  * fixed a bug in coop player ship positions.
8653  *
8654  * Revision 1.252  1994/12/21  12:57:08  rob
8655  * Handle additional player ships in mines.
8656
8657 ------------------------------------------------------------------------
8658 main/gameseq.h:
8659
8660  * Revision 1.4  1995/10/31  10:22:55  allender
8661  * shareware stuff
8662  *
8663  * Revision 1.3  1995/09/14  14:13:14  allender
8664  * initplayerobject have void return
8665  *
8666  * Revision 1.2  1995/08/24  15:36:17  allender
8667  * fixed prototypes warnings
8668  *
8669  * Revision 1.1  1995/05/16  15:57:26  allender
8670  * Initial revision
8671  *
8672  * Revision 2.0  1995/02/27  11:32:03  john
8673  * New version 2.0, which has no anonymous unions, builds with
8674  * Watcom 10.0, and doesn't require parsing BITMAPS.TBL.
8675  *
8676  * Revision 1.41  1995/02/07  10:51:54  rob
8677  * fix typo.
8678  *
8679  * Revision 1.40  1995/02/06  20:10:16  rob
8680  * Extern'ed DoEndLevelScoreGlitz.
8681  *
8682  * Revision 1.39  1995/02/01  16:34:13  john
8683  * Linted.
8684  *
8685  * Revision 1.38  1995/01/27  11:15:03  rob
8686  * Added extern for player position vars.
8687  *
8688  * Revision 1.37  1995/01/20  22:47:38  matt
8689  * Mission system implemented, though imcompletely
8690  *
8691  * Revision 1.36  1995/01/17  13:36:08  john
8692  * Moved pig loading into StartNewLevelSub.
8693  *
8694  * Revision 1.35  1995/01/04  12:21:28  john
8695  * *** empty log message ***
8696  *
8697  * Revision 1.34  1995/01/04  12:20:47  john
8698  * Declearations to work better with game state save.
8699  *
8700  *
8701  * Revision 1.33  1994/12/08  09:46:35  matt
8702  * Made level name len a multiple of 4 for alignment
8703  *
8704  * Revision 1.32  1994/11/29  16:33:29  rob
8705  * Added new defines for last_secret_level based on shareware or not shareware.
8706  *
8707  * Revision 1.31  1994/11/26  15:30:20  matt
8708  * Allow escape out of change pilot menu
8709  *
8710  * Revision 1.30  1994/11/21  17:29:38  matt
8711  * Cleaned up sequencing & game saving for secret levels
8712  *
8713  * Revision 1.29  1994/11/21  15:55:03  matt
8714  * Corrected LAST_LEVEL
8715  *
8716  * Revision 1.28  1994/11/20  22:12:43  mike
8717  * set LAST_LEVEL based on SHAREWARE.
8718  *
8719  * Revision 1.27  1994/11/09  10:55:51  matt
8720  * Cleaned up initialization for editor -> game transitions
8721  *
8722  * Revision 1.26  1994/11/08  17:50:48  rob
8723  * ADded prototype for StartNewLEvel.
8724  *
8725  *
8726  * Revision 1.25  1994/11/07  17:50:57  rob
8727  * Added extern prototype for init_player_stats_level called for
8728  * network games.
8729  *
8730  * Revision 1.24  1994/10/25  15:40:03  yuan
8731  * *** empty log message ***
8732  *
8733  * Revision 1.23  1994/10/22  00:08:52  matt
8734  * Fixed up problems with bonus & game sequencing
8735  * Player doesn't get credit for hostages unless he gets them out alive
8736  *
8737  * Revision 1.22  1994/10/18  18:57:08  matt
8738  * Added main menu option to enter new player name
8739  *
8740  * Revision 1.21  1994/10/07  23:37:32  matt
8741  * Added prototype
8742  *
8743  * Revision 1.20  1994/10/07  16:02:53  matt
8744  * Loading saved game no longer clears players weapons & other stats
8745  *
8746  * Revision 1.19  1994/10/06  14:12:46  matt
8747  * Added flash effect when player appears
8748  *
8749  * Revision 1.18  1994/10/03  13:34:44  matt
8750  * Added new (and hopefully better) game sequencing functions
8751  *
8752  * Revision 1.17  1994/09/30  15:19:53  matt
8753  * Added new game sequencing functions, but left them disabled for now.
8754  *
8755  * Revision 1.16  1994/09/28  17:24:34  matt
8756  * Added first draft of game save/load system
8757  *
8758  * Revision 1.15  1994/09/27  12:29:42  matt
8759  * Changed level naming
8760  *
8761  * Revision 1.14  1994/09/02  11:53:55  mike
8762  * Rename init_player_stats to init_player_stats_game.
8763  *
8764  * Revision 1.13  1994/08/31  20:57:34  matt
8765  * Cleaned up endlevel/death code
8766  *
8767  * Revision 1.12  1994/08/23  18:45:06  yuan
8768  * Added level 10 capability.. (LEDGES)
8769  *
8770  * Revision 1.11  1994/08/18  10:47:38  john
8771  * Cleaned up game sequencing and player death stuff
8772  * in preparation for making the player explode into
8773  * pieces when dead.
8774  *
8775  * Revision 1.10  1994/08/15  15:24:45  john
8776  * Made players know who killed them; Disabled cheat menu
8777  * during net player; fixed bug with not being able to turn
8778  * of invulnerability; Made going into edit/starting new leve
8779  * l drop you out of a net game; made death dialog box.
8780  *
8781  * Revision 1.9  1994/08/13  12:20:56  john
8782  * Made the networking uise the Players array.
8783  *
8784  * Revision 1.8  1994/07/22  12:36:24  matt
8785  * Cleaned up editor/game interactions some more.
8786  *
8787  * Revision 1.7  1994/07/19  20:15:33  matt
8788  * Name for each level now saved in the .SAV file & stored in Current_level_name
8789  *
8790  * Revision 1.6  1994/07/02  13:49:33  matt
8791  * Cleaned up includes
8792  *
8793  * Revision 1.5  1994/07/02  13:09:52  matt
8794  * Moved player stats struct from gameseq.h to player.h
8795  *
8796  * Revision 1.4  1994/07/01  16:35:35  yuan
8797  * Added key system
8798  *
8799  * Revision 1.3  1994/06/26  14:07:35  matt
8800  * Added prototypes
8801  *
8802  * Revision 1.2  1994/06/24  17:03:56  john
8803  * Added VFX support. Also took all game sequencing stuff like
8804  * EndGame out and put it into gameseq.c
8805  *
8806  * Revision 1.1  1994/06/24  14:13:53  john
8807  * Initial revision
8808
8809 ------------------------------------------------------------------------
8810 main/gauges.c:
8811
8812  * Revision 1.15  1995/10/31  10:22:37  allender
8813  * shareware stuff
8814  *
8815  * Revision 1.14  1995/10/26  14:11:05  allender
8816  * do copy of weapon boxes in cockpit correctly
8817  *
8818  * Revision 1.13  1995/10/21  22:54:56  allender
8819  * fixed up player names on hud
8820  *
8821  * Revision 1.12  1995/10/12  17:39:27  allender
8822  * fixed status bar lives display
8823  *
8824  * Revision 1.11  1995/09/22  15:21:46  allender
8825  * fixed hud problems (reticle and kill lists) for
8826  * non pixel doubled mode
8827  *
8828  * Revision 1.10  1995/09/13  11:38:47  allender
8829  * show KB left in heap instead of piggy cache
8830  *
8831  * Revision 1.9  1995/09/04  15:52:28  allender
8832  * fix vulcan ammo count to update without overwritting itself
8833  *
8834  * Revision 1.8  1995/08/31  14:11:20  allender
8835  * worked on hud kill list for non pixel doubled mode
8836  *
8837  * Revision 1.7  1995/08/24  16:05:05  allender
8838  * more gauge placement -- still not done!
8839  *
8840  * Revision 1.6  1995/08/18  15:44:56  allender
8841  * put in PC gauges for keys, lives, and reticle when pixel doubling
8842  *
8843  * Revision 1.5  1995/08/18  10:24:47  allender
8844  * added proper support for cockpit mode -- still needs
8845  *
8846  * Revision 1.4  1995/07/26  16:56:34  allender
8847  * more gauge stuff for status bar.  still problem
8848  * with ship
8849  *
8850  * Revision 1.3  1995/07/17  08:55:57  allender
8851  * fix up for large status bar.  Still needs some work though
8852  *
8853  * Revision 1.2  1995/06/20  09:54:29  allender
8854  * stopgap measure to get status bar "working" until real mac
8855  * status bar gets added
8856  *
8857  * Revision 1.1  1995/05/16  15:26:05  allender
8858  * Initial revision
8859  *
8860  * Revision 2.7  1995/12/19  16:18:33  john
8861  * Made weapon info align with canvas width, not 315.
8862  *
8863  * Revision 2.6  1995/03/21  14:39:25  john
8864  * Ifdef'd out the NETWORK code.
8865  *
8866  * Revision 2.5  1995/03/14  12:31:25  john
8867  * Prevent negative shields from printing.
8868  *
8869  * Revision 2.4  1995/03/10  12:57:58  allender
8870  * move rear view text up four pixels up when playing back demo
8871  *
8872  * Revision 2.3  1995/03/09  11:47:51  john
8873  * Added HUD for VR helmets.
8874  *
8875  * Revision 2.2  1995/03/06  15:23:26  john
8876  * New screen techniques.
8877  *
8878  * Revision 2.1  1995/02/27  13:13:45  john
8879  * Removed floating point.
8880  *
8881  * Revision 2.0  1995/02/27  11:29:06  john
8882  * New version 2.0, which has no anonymous unions, builds with
8883  * Watcom 10.0, and doesn't require parsing BITMAPS.TBL.
8884  *
8885  * Revision 1.203  1995/02/11  01:56:45  mike
8886  * move up weapons text on fullscreen hud, missiles was offscreen.
8887  *
8888  * Revision 1.202  1995/02/09  13:23:34  rob
8889  * Added reticle names in demo playback.
8890  *
8891  * Revision 1.201  1995/02/08  19:20:46  rob
8892  * Show cloaked teammates on H
8893  * UD.  Get rid of show ID's in anarchy option.
8894  *
8895  * Revision 1.200  1995/02/07  21:09:00  mike
8896  * add flashing to invulnerability and cloak on fullscreen.
8897  *
8898  * Revision 1.199  1995/02/02  21:55:57  matt
8899  * Added new colored key icons for fullscreen
8900  *
8901  * Revision 1.198  1995/01/30  17:17:07  rob
8902  * Fixed teammate names on hud.
8903  *
8904  * Revision 1.197  1995/01/28  17:40:49  mike
8905  * fix gauge fontcolor.
8906  *
8907  * Revision 1.196  1995/01/27  17:03:14  mike
8908  * fix placement of weapon info in multiplayer fullscreen, as per AP request.
8909  *
8910  * Revision 1.195  1995/01/27  11:51:23  rob
8911  * Put deaths tally into cooperative mode
8912  *
8913  * Revision 1.194  1995/01/27  11:43:24  adam
8914  * fiddled with key display
8915  *
8916  * Revision 1.193  1995/01/25  23:38:35  mike
8917  * fix keys on fullscreen.
8918  *
8919  * Revision 1.192  1995/01/24  22:03:28  mike
8920  * Lotsa hud stuff, put a lot of messages up.
8921  *
8922  * Revision 1.191  1995/01/23  16:47:21  rob
8923  * Fixed problem with playing extra life noise in coop.
8924  *
8925  * Revision 1.190  1995/01/22  16:00:46  mike
8926  * remove unneeded string.
8927  *
8928  * Revision 1.189  1995/01/22  15:58:22  mike
8929  * localization
8930  *
8931  * Revision 1.188  1995/01/20  17:19:45  rob
8932  * Fixing colors of hud kill list players.
8933  *
8934  * Revision 1.187  1995/01/20  09:19:18  allender
8935  * record player flags when in CM_FULL_SCREEN
8936  *
8937  * Revision 1.186  1995/01/19  16:29:09  allender
8938  * made demo recording of weapon change be in this file for shareware only
8939  *
8940  * Revision 1.185  1995/01/19  15:00:33  allender
8941  * code to record shield, energy, and ammo in fullscreen
8942  *
8943  * Revision 1.184  1995/01/19  13:43:13  matt
8944  * Fixed "cheater" message on HUD
8945  *
8946  * Revision 1.183  1995/01/18  16:11:58  mike
8947  * Don't show added scores of 0.
8948  *
8949  * Revision 1.182  1995/01/17  17:42:39  allender
8950  * do ammo counts in demo recording
8951  *
8952  * Revision 1.181  1995/01/16  17:26:25  rob
8953  * Fixed problem with coloration of team kill list.
8954  *
8955  * Revision 1.180  1995/01/16  17:22:39  john
8956  * Made so that KB and framerate don't collide.
8957  *
8958  * Revision 1.179  1995/01/16  14:58:31  matt
8959  * Changed score_added display to print "Cheater!" when cheats enabled
8960  *
8961  * Revision 1.178  1995/01/15  19:42:07  matt
8962  * Ripped out hostage faces for registered version
8963  *
8964  * Revision 1.177  1995/01/15  19:25:07  mike
8965  * show vulcan ammo and secondary ammo in fullscreen view.
8966  *
8967  * Revision 1.176  1995/01/15  13:16:12  john
8968  * Made so that paging always happens, lowmem just loads less.
8969  * Also, make KB load print to hud.
8970  *
8971  * Revision 1.175  1995/01/14  19:17:32  john
8972  * First version of piggy paging.
8973  *
8974  * Revision 1.174  1995/01/05  21:25:23  rob
8975  * Re-did some changes lost due to RCS weirdness.
8976  *
8977  * Revision 1.173  1995/01/05  12:22:34  rob
8978  * Don't show player names for cloaked players.
8979  *
8980  * Revision 1.172  1995/01/04  17:14:50  allender
8981  * make init_gauges work properly on demo playback
8982  *
8983  * Revision 1.171  1995/01/04  15:04:42  allender
8984  * new demo calls for registered version
8985  *
8986  * Revision 1.167  1995/01/03  13:03:57  allender
8987  * pass score points instead of total points.   Added ifdef for
8988  * multi_send_score
8989  *
8990  * Revision 1.166  1995/01/03  11:45:02  allender
8991  * add hook to record player score
8992  *
8993  * Revision 1.165  1995/01/03  11:25:19  allender
8994  * remove newdemo stuff around score display
8995  *
8996  * Revision 1.163  1995/01/02  21:03:53  rob
8997  * Fixing up the hud-score-list for coop games.
8998  *
8999  * Revision 1.162  1994/12/31  20:54:40  rob
9000  * Added coop mode HUD score list.
9001  * Added more generic system for player names on HUD.
9002  *
9003  * Revision 1.161  1994/12/30  20:13:01  rob
9004  * Ifdef reticle names on shareware.
9005  * Added robot reticle naming.
9006  *
9007  * Revision 1.160  1994/12/29  17:53:51  mike
9008  * move up energy/shield in fullscreen to get out of way of kill list.
9009  *
9010  * Revision 1.159  1994/12/29  16:44:05  mike
9011  * add energy and shield showing.
9012  *
9013  * Revision 1.158  1994/12/28  16:34:29  mike
9014  * make warning beep go away on Player_is_dead.
9015  *
9016  * Revision 1.157  1994/12/28  10:00:43  allender
9017  * change in init_gauges to for multiplayer demo playbacks
9018  *
9019  * Revision 1.156  1994/12/27  11:06:46  allender
9020  * removed some previous code to for demo playback stuff
9021  *
9022  * Revision 1.155  1994/12/23  14:23:06  john
9023  * Added floating reticle for VR helments.
9024  *
9025  * Revision 1.154  1994/12/21  12:56:41  allender
9026  * on multiplayer demo playback, show kills and deaths
9027  *
9028  * Revision 1.153  1994/12/19  20:28:42  rob
9029  * Get rid of kill list in coop games.
9030  *
9031  * Revision 1.152  1994/12/14  18:06:44  matt
9032  * Removed compile warnings
9033  *
9034  * Revision 1.151  1994/12/14  15:21:28  rob
9035  * Made gauges align in status_bar net game.
9036  *
9037  * Revision 1.150  1994/12/12  17:20:33  matt
9038  * Don't get bonus points when cheating
9039  *
9040  * Revision 1.149  1994/12/12  16:47:00  matt
9041  * When cheating, get no score.  Change level cheat to prompt for and
9042  * jump to new level.
9043  *
9044  * Revision 1.148  1994/12/12  12:05:45  rob
9045  * Grey out players who are disconnected.
9046  *
9047  * Revision 1.147  1994/12/09  16:19:48  yuan
9048  * kill matrix stuff.
9049  *
9050  * Revision 1.146  1994/12/09  16:12:34  rob
9051  * Fixed up the status bar kills gauges for net play.
9052  *
9053  * Revision 1.145  1994/12/09  01:55:34  rob
9054  * Added kills list to HUD/status bar.
9055  * Added something for Mark.
9056  *
9057  * Revision 1.144  1994/12/08  21:03:30  allender
9058  * pass old player flags to record_player_flags
9059  *
9060  * Revision 1.143  1994/12/07  22:49:33  mike
9061  * no homing missile warning during endlevel sequence.
9062  *
9063  * Revision 1.142  1994/12/06  13:55:31  matt
9064  * Use new rounding func, f2ir()
9065  *
9066  * Revision 1.141  1994/12/03  19:03:37  matt
9067  * Fixed vulcan ammo HUD message
9068  *
9069  * Revision 1.140  1994/12/03  18:43:18  matt
9070  * Fixed (hopefully) claok gauge
9071  *
9072  * Revision 1.139  1994/12/03  14:26:21  yuan
9073  * Fixed dumb bug
9074  *
9075  * Revision 1.138  1994/12/03  14:17:30  yuan
9076  * Localization 320
9077
9078 ------------------------------------------------------------------------
9079 main/gauges.h:
9080
9081  * Revision 1.3  1995/08/23  21:37:13  allender
9082  * fix mcc compiler warmings
9083  *
9084  * Revision 1.2  1995/08/18  15:45:24  allender
9085  * upped max gauges
9086  *
9087  * Revision 1.1  1995/05/16  15:57:34  allender
9088  * Initial revision
9089  *
9090  * Revision 2.0  1995/02/27  11:28:45  john
9091  * New version 2.0, which has no anonymous unions, builds with
9092  * Watcom 10.0, and doesn't require parsing BITMAPS.TBL.
9093  *
9094  * Revision 1.27  1994/12/14  18:06:39  matt
9095  * Added prototype
9096  *
9097  * Revision 1.26  1994/12/09  16:19:52  yuan
9098  * kill matrix stuff.
9099  *
9100  * Revision 1.25  1994/10/25  11:07:34  mike
9101  * Prototype play_homing_warning.
9102  *
9103  * Revision 1.24  1994/10/24  16:34:39  mike
9104  * Increase MAX_GAUGE_BMS from 56 to 80...
9105  *
9106  * Revision 1.23  1994/10/21  20:43:47  mike
9107  * Prototype add_bonus_points_to_score.
9108  *
9109  * Revision 1.22  1994/10/14  15:56:33  mike
9110  * Prototype update_laser_weapon_info.
9111  *
9112  * Revision 1.21  1994/10/13  15:17:26  mike
9113  * Remove afterburner references.
9114  *
9115  * Revision 1.20  1994/10/05  17:09:46  matt
9116  * Added functional reticle
9117  *
9118  * Revision 1.19  1994/10/04  21:41:29  matt
9119  * Added cloaked player gauge effect, and different ship bitmap for each player
9120  *
9121  * Revision 1.18  1994/09/26  13:29:40  matt
9122  * Added extra life each 100,000 points, and show icons on HUD for num lives
9123  *
9124  * Revision 1.17  1994/09/20  11:56:08  matt
9125  * Added prototype
9126  *
9127  * Revision 1.16  1994/09/20  00:11:03  matt
9128  * Finished gauges for Status Bar, including hostage video display.
9129  *
9130  * Revision 1.15  1994/09/17  23:57:18  matt
9131  * Got some, but not all, off the status bar gauges working
9132  *
9133  * Revision 1.14  1994/09/16  13:08:46  mike
9134  * Prototype say_afterburner_status.
9135  *
9136  * Revision 1.13  1994/09/14  16:27:03  mike
9137  * Prototype player_dead_message();
9138  *
9139  *
9140  * Revision 1.12  1994/07/20  17:34:43  yuan
9141  * Some minor bug fixes and new key gauges...
9142  *
9143  * Revision 1.11  1994/07/14  14:46:02  yuan
9144  * Added score effect.
9145  *
9146  * Revision 1.10  1994/07/12  16:22:00  yuan
9147  * Increased number of maximum gauges.
9148  *
9149  * Revision 1.9  1994/07/11  20:10:36  yuan
9150  * Numerical gauges.
9151  *
9152  * Revision 1.8  1994/07/10  18:01:28  yuan
9153  * Added new gauges.
9154  *
9155  * Revision 1.7  1994/06/21  15:08:22  john
9156  * Made demo record HUD message and cleaned up the HUD code.
9157  *
9158  * Revision 1.6  1994/06/21  12:40:46  yuan
9159  * Fixing HUD message.
9160  *
9161  * Revision 1.5  1994/06/21  12:11:56  yuan
9162  * Fixed up menus and added HUDisplay messages.
9163  *
9164  * Revision 1.4  1994/04/28  21:34:24  mike
9165  * prototype check_erase_gauge
9166  *
9167  * Revision 1.3  1994/04/06  14:42:46  yuan
9168  * Adding new powerups.
9169  *
9170  * Revision 1.2  1993/12/05  22:48:58  matt
9171  * Reworked include files in an attempt to cut down on build times
9172  *
9173  * Revision 1.1  1993/12/05  21:07:55  matt
9174  * Initial revision
9175
9176 ------------------------------------------------------------------------
9177 main/hostage.c:
9178
9179  * Revision 1.1  1995/05/16  15:26:24  allender
9180  * Initial revision
9181  *
9182  * Revision 2.0  1995/02/27  11:28:36  john
9183  * New version 2.0, which has no anonymous unions, builds with
9184  * Watcom 10.0, and doesn't require parsing BITMAPS.TBL.
9185  *
9186  * Revision 1.65  1995/02/22  13:45:54  allender
9187  * remove anonymous unions from object structure
9188  *
9189  * Revision 1.64  1995/02/13  20:34:57  john
9190  * Lintized
9191  *
9192  * Revision 1.63  1995/01/15  19:41:48  matt
9193  * Ripped out hostage faces for registered version
9194  *
9195  * Revision 1.62  1995/01/14  19:16:53  john
9196  * First version of new bitmap paging code.
9197  *
9198  * Revision 1.61  1994/12/19  16:35:09  john
9199  * Made hoastage playback end when ship dies.
9200  *
9201  * Revision 1.60  1994/12/06  16:30:41  yuan
9202  * Localization
9203  *
9204  * Revision 1.59  1994/11/30  17:32:46  matt
9205  * Put hostage_face_clip array back in so editor would work
9206  *
9207  * Revision 1.58  1994/11/30  17:22:13  matt
9208  * Ripped out hostage faces in shareware version
9209  *
9210  * Revision 1.57  1994/11/30  16:11:25  matt
9211  * Use correct constant for hostage voice
9212  *
9213  * Revision 1.56  1994/11/27  23:15:19  matt
9214  * Made changes for new mprintf calling convention
9215  *
9216  * Revision 1.55  1994/11/19  19:53:44  matt
9217  * Added code to full support different hostage head clip & message for
9218  * each hostage.
9219  *
9220  * Revision 1.54  1994/11/19  16:35:15  matt
9221  * Got rid of unused code, & made an array smaller
9222  *
9223  * Revision 1.53  1994/11/14  12:42:03  matt
9224  * Increased palette flash when hostage rescued
9225  *
9226  * Revision 1.52  1994/10/28  14:43:09  john
9227  * Added sound volumes to all sound calls.
9228  *
9229  * Revision 1.51  1994/10/23  02:10:57  matt
9230  * Got rid of obsolete hostage_info stuff
9231  *
9232  * Revision 1.50  1994/10/22  00:08:44  matt
9233  * Fixed up problems with bonus & game sequencing
9234  * Player doesn't get credit for hostages unless he gets them out alive
9235  *
9236  * Revision 1.49  1994/10/20  22:52:49  matt
9237  * Fixed compiler warnings
9238  *
9239  * Revision 1.48  1994/10/20  21:25:44  matt
9240  * Took out silly scale down/scale up code for hostage anim
9241  *
9242  * Revision 1.47  1994/10/20  12:47:28  matt
9243  * Replace old save files (MIN/SAV/HOT) with new LVL files
9244  *
9245  * Revision 1.46  1994/10/04  15:33:33  john
9246  * Took out the old PLAY_SOUND??? code and replaced it
9247  * with direct calls into digi_link_??? so that all sounds
9248  * can be made 3d.
9249  *
9250  * Revision 1.45  1994/09/28  23:10:46  matt
9251  * Made hostage rescue do palette flash
9252  *
9253  * Revision 1.44  1994/09/20  00:11:00  matt
9254  * Finished gauges for Status Bar, including hostage video display.
9255  *
9256  * Revision 1.43  1994/09/15  21:24:19  matt
9257  * Changed system to keep track of whether & what cockpit is up
9258  * Made hostage clip not queue when no cockpit
9259  *
9260  *
9261  * Revision 1.42  1994/08/25  13:45:19  matt
9262  * Made hostage vclips queue
9263  *
9264  * Revision 1.41  1994/08/14  23:15:06  matt
9265  * Added animating bitmap hostages, and cleaned up vclips a bit
9266  *
9267  * Revision 1.40  1994/08/12  22:41:11  john
9268  * Took away Player_stats; add Players array.
9269  *
9270  * Revision 1.39  1994/07/14  22:06:35  john
9271  * Fix radar/hostage vclip conflict.
9272  *
9273  * Revision 1.38  1994/07/12  18:40:21  yuan
9274  * Tweaked location of radar and hostage screen...
9275  * Still needs work.
9276  *
9277  *
9278  * Revision 1.37  1994/07/07  09:52:17  john
9279  * Moved hostage screen.
9280  *
9281  * Revision 1.36  1994/07/06  15:23:52  john
9282  * Revamped hostage sound.
9283  *
9284  * Revision 1.35  1994/07/06  15:14:54  john
9285  * Added hostage sound effect picking.
9286  *
9287  * Revision 1.34  1994/07/06  13:25:33  john
9288  * Added compress hostages functions.
9289  *
9290  * Revision 1.33  1994/07/06  12:52:59  john
9291  * Fixed compiler warnings.
9292  *
9293  * Revision 1.32  1994/07/06  12:43:50  john
9294  * Made generic messages for hostages.
9295  *
9296  * Revision 1.31  1994/07/06  10:55:07  john
9297  * New structures for hostages.
9298  *
9299  * Revision 1.30  1994/07/05  12:49:09  john
9300  * Put functionality of New Hostage spec into code.
9301  *
9302  * Revision 1.29  1994/07/02  13:08:47  matt
9303  * Increment stats when hostage rescued
9304  *
9305  * Revision 1.28  1994/07/01  18:07:46  john
9306  * y
9307  *
9308  * Revision 1.27  1994/07/01  18:07:03  john
9309  * *** empty log message ***
9310  *
9311  * Revision 1.26  1994/07/01  17:55:26  john
9312  * First version of not-working hostage system.
9313  *
9314  * Revision 1.25  1994/06/27  15:53:21  john
9315  * #define'd out the newdemo stuff
9316  *
9317  *
9318  * Revision 1.24  1994/06/20  16:08:52  john
9319  * Added volume control; made doors 3d sounds.
9320  *
9321  * Revision 1.23  1994/06/16  10:15:32  yuan
9322  * Fixed location of face.
9323  *
9324  * Revision 1.22  1994/06/15  15:05:33  john
9325  * *** empty log message ***
9326  *
9327  * Revision 1.21  1994/06/14  21:15:20  matt
9328  * Made rod objects draw lighted or not depending on a parameter, so the
9329  * materialization effect no longer darkens.
9330  *
9331  * Revision 1.20  1994/06/08  18:16:26  john
9332  * Bunch of new stuff that basically takes constants out of the code
9333  * and puts them into bitmaps.tbl.
9334  *
9335  * Revision 1.19  1994/06/02  19:30:08  matt
9336  * Moved texture-mapped rod drawing stuff (used for hostage & now for the
9337  * materialization center) to object.c
9338
9339 ------------------------------------------------------------------------
9340 main/hostage.h:
9341
9342  * Revision 1.1  1995/05/16  15:57:57  allender
9343  * Initial revision
9344  *
9345  * Revision 2.0  1995/02/27  11:27:50  john
9346  * New version 2.0, which has no anonymous unions, builds with
9347  * Watcom 10.0, and doesn't require parsing BITMAPS.TBL.
9348  *
9349  * Revision 1.23  1995/01/15  19:42:06  matt
9350  * Ripped out hostage faces for registered version
9351  *
9352  * Revision 1.22  1994/12/19  16:35:07  john
9353  * Made hoastage playback end when ship dies.
9354  *
9355  * Revision 1.21  1994/11/30  17:22:12  matt
9356  * Ripped out hostage faces in shareware version
9357  *
9358  * Revision 1.20  1994/11/19  19:53:43  matt
9359  * Added code to full support different hostage head clip & message for
9360  * each hostage.
9361  *
9362  * Revision 1.19  1994/11/19  16:35:28  matt
9363  * Got rid of unused code, & made an array smaller
9364  *
9365  * Revision 1.18  1994/10/23  02:10:57  matt
9366  * Got rid of obsolete hostage_info stuff
9367  *
9368  * Revision 1.17  1994/09/20  00:10:37  matt
9369  * Finished gauges for Status Bar, including hostage video display.
9370  *
9371  * Revision 1.16  1994/09/01  10:41:24  matt
9372  * Sizes for powerups now specified in bitmaps.tbl; blob bitmaps now plot
9373  * correctly if width & height of bitmap are different.
9374  *
9375  * Revision 1.15  1994/08/14  23:15:14  matt
9376  * Added animating bitmap hostages, and cleaned up vclips a bit
9377  *
9378  * Revision 1.14  1994/07/14  22:06:51  john
9379  * Fix radar/hostage vclip conflict.
9380  *
9381  * Revision 1.13  1994/07/14  22:05:41  john
9382  * Made radar display not conflict with hostage
9383  * vclip talking.
9384  *
9385  * Revision 1.12  1994/07/06  13:41:46  matt
9386  * Added support for bitmap hostages
9387  *
9388  * Revision 1.11  1994/07/06  12:43:36  john
9389  * Made generic messages for hostages.
9390  *
9391  * Revision 1.10  1994/07/06  10:55:09  john
9392  * New structures for hostages.
9393  *
9394  * Revision 1.9  1994/07/05  12:48:47  john
9395  * Put functionality of New Hostage spec into code.
9396  *
9397  * Revision 1.8  1994/07/01  17:55:14  john
9398  * First version of not-working hostage system.
9399  *
9400  * Revision 1.7  1994/06/15  14:57:10  john
9401  * Added triggers to demo recording.
9402  *
9403  * Revision 1.6  1994/06/08  18:15:49  john
9404  * Bunch of new stuff that basically takes constants out of the code
9405  * and puts them into bitmaps.tbl.
9406  *
9407  * Revision 1.5  1994/05/02  12:43:06  yuan
9408  * Fixed warnings.
9409  *
9410  * Revision 1.4  1994/04/06  14:42:46  yuan
9411  * Adding new powerups.
9412  *
9413  * Revision 1.3  1994/04/01  11:15:14  yuan
9414  * Added multiple bitmap functionality to all objects...
9415  * (hostages, powerups, lasers, etc.)
9416  * Hostages and powerups are implemented in the object system,
9417  * just need to finish function call to "affect" player.
9418  *
9419  * Revision 1.2  1994/03/31  12:04:35  matt
9420  * Added prototypes for 2 funcs
9421  *
9422  * Revision 1.1  1994/03/31  11:39:24  matt
9423  * Initial revision
9424
9425 ------------------------------------------------------------------------
9426 main/hud.c:
9427
9428  * Revision 1.4  1995/08/24  16:03:09  allender
9429  * fix up message placement
9430  *
9431  * Revision 1.3  1995/08/18  10:25:21  allender
9432  * added support for pixel doubling using PC game font
9433  *
9434  * Revision 1.2  1995/08/12  11:33:22  allender
9435  * removed #ifdef NEWDEMO -- always in
9436  *
9437  * Revision 1.1  1995/05/16  15:26:32  allender
9438  * Initial revision
9439  *
9440  * Revision 2.2  1995/03/30  16:36:40  mike
9441  * text localization.
9442  *
9443  * Revision 2.1  1995/03/06  15:23:50  john
9444  * New screen techniques.
9445  *
9446  * Revision 2.0  1995/02/27  11:30:41  john
9447  * New version 2.0, which has no anonymous unions, builds with
9448  * Watcom 10.0, and doesn't require parsing BITMAPS.TBL.
9449  *
9450  * Revision 1.27  1995/01/23  16:51:30  mike
9451  * Show hud messages on 3d if window in three largest sizes.
9452  *
9453  * Revision 1.26  1995/01/17  17:42:45  rob
9454  * Made message timeout for HUD messages longer.
9455  *
9456  * Revision 1.25  1995/01/04  11:39:03  rob
9457  * Made HUD text get out of the way of large HUD messages.
9458  *
9459  * Revision 1.24  1995/01/01  14:20:32  rob
9460  * longer timer for hud messages.
9461  *
9462  *
9463  * Revision 1.23  1994/12/15  13:04:34  mike
9464  * Replace Players[Player_num].time_total references with GameTime.
9465  *
9466  * Revision 1.22  1994/12/13  12:55:12  mike
9467  * move press any key to continue message when you are dead to bottom of window.
9468  *
9469  * Revision 1.21  1994/12/07  17:08:01  rob
9470  * removed unnecessary debug info.
9471  *
9472  * Revision 1.20  1994/12/07  16:24:16  john
9473  * Took out code that kept track of messages differently for different
9474  * screen modes... I made it so they just draw differently depending on screen mode.
9475  *
9476  * Revision 1.19  1994/12/07  15:42:57  rob
9477  * Added a bunch of debug stuff to look for HUD message problems in net games...
9478  *
9479  * Revision 1.18  1994/12/06  16:30:35  yuan
9480  * Localization
9481  *
9482  * Revision 1.17  1994/12/05  00:32:36  mike
9483  * fix randomness of color on status bar hud messages.
9484  *
9485  * Revision 1.16  1994/11/19  17:05:53  rob
9486  * Moved dead_player_message down to avoid overwriting HUD messages.
9487  *
9488  * Revision 1.15  1994/11/18  23:37:56  john
9489  * Changed some shorts to ints.
9490  *
9491  * Revision 1.14  1994/11/12  16:38:25  mike
9492  * clear some annoying debug messages.
9493  *
9494  * Revision 1.13  1994/11/11  15:36:39  mike
9495  * write hud messages on background if 3d window small enough
9496  *
9497  * Revision 1.12  1994/10/20  09:49:31  mike
9498  * Reduce number of messages.
9499  *
9500  * Revision 1.11  1994/10/17  10:49:15  john
9501  * Took out some warnings.
9502  *
9503  * Revision 1.10  1994/10/17  10:45:13  john
9504  * Made the player able to abort death by pressing any button or key.
9505  *
9506  * Revision 1.9  1994/10/13  15:17:33  mike
9507  * Remove afterburner references.
9508  *
9509  * Revision 1.8  1994/10/11  12:06:32  mike
9510  * Only show message advertising death sequence abort after player exploded.
9511  *
9512  * Revision 1.7  1994/10/10  17:21:53  john
9513  * Made so instead of saying too many messages, it scrolls off the
9514  * oldest message.
9515  *
9516  * Revision 1.6  1994/10/07  23:05:39  john
9517  * Fixed bug with HUD not drawing stuff sometimes...
9518  * ( I had a circular buffer that I was stepping thru
9519  * to draw text that went: for (i=first;i<last;i++)...
9520  * duh!! last could be less than first.)
9521  * /
9522  *
9523  * Revision 1.5  1994/09/16  13:08:20  mike
9524  * Arcade stuff, afterburner stuff.
9525  *
9526  * Revision 1.4  1994/09/14  16:26:57  mike
9527  * player_dead_message.
9528  *
9529  * Revision 1.3  1994/08/18  16:35:45  john
9530  * Made gauges messages stay up a bit longer.
9531  *
9532  * Revision 1.2  1994/08/18  12:10:21  john
9533  * Made HUD messages scroll.
9534  *
9535  * Revision 1.1  1994/08/18  11:22:09  john
9536  * Initial revision
9537
9538 ------------------------------------------------------------------------
9539 main/inferno.c:
9540
9541  * Revision 1.1  1995/12/05  15:57:49  allender
9542  * Initial revision
9543  *
9544  * Revision 1.19  1995/11/07  17:03:12  allender
9545  * added splash screen for descent contest
9546  *
9547  * Revision 1.18  1995/10/31  10:22:22  allender
9548  * shareware stuff
9549  *
9550  * Revision 1.17  1995/10/18  01:53:07  allender
9551  * mouse click to leave do not distribute screen
9552  *
9553  * Revision 1.16  1995/10/17  12:00:12  allender
9554  * mouse click gets past endgame screen
9555  *
9556  * Revision 1.15  1995/10/12  17:40:12  allender
9557  * read config file after digi initialized
9558  *
9559  * Revision 1.14  1995/10/05  10:38:22  allender
9560  * changed key_getch at exit to be key_inkey and moved
9561  * mouse init until after macintosh windowing init call
9562  *
9563  * Revision 1.13  1995/09/18  17:01:04  allender
9564  * put gr_init call before render buffer stuff
9565  *
9566  * Revision 1.12  1995/08/31  15:50:53  allender
9567  * call init for appletalk, and change name of intro screens
9568  *
9569  * Revision 1.11  1995/08/26  16:26:19  allender
9570  * whole bunch 'o stuff!!
9571  *
9572  * Revision 1.10  1995/07/12  21:48:18  allender
9573  * removed Int3 from beginning of program
9574  *
9575  * Revision 1.9  1995/07/05  16:45:48  allender
9576  * removed hide_cursor call
9577  *
9578  * Revision 1.8  1995/06/20  16:44:57  allender
9579  * game now renders in 640x480 at all times.  Changed code
9580  * to call game_init_render_buffers with right params
9581  *
9582  * Revision 1.7  1995/06/13  13:07:55  allender
9583  * change macintosh initialzation.  Mac windows now init'ed through gr_init.
9584  *
9585  * Revision 1.6  1995/06/08  16:36:53  allender
9586  * "ifdef" profile include
9587  *
9588  * Revision 1.5  1995/06/07  08:08:18  allender
9589  * dont' make memory info show at end of program
9590  *
9591  * Revision 1.4  1995/06/02  07:47:40  allender
9592  * removed network initialzation for now
9593  *
9594  * Revision 1.3  1995/05/26  06:54:52  allender
9595  * put digi_init after timer and key stuff since I was testing stuff
9596  * that needed the keyboard handler installed
9597  *
9598  * Revision 1.2  1995/05/19  11:28:09  allender
9599  * removed printf
9600  *
9601  * Revision 1.1  1995/05/16  15:26:39  allender
9602  * Initial revision
9603  *
9604  * Revision 2.36  1996/01/05  16:52:16  john
9605  * Improved 3d stuff.
9606  *
9607  * Revision 2.35  1995/10/07  13:20:06  john
9608  * Added new modes for LCDBIOS, also added support for -JoyNice,
9609  * and added Shift+F1-F4 to controls various stereoscopic params.
9610  *
9611  * Revision 2.34  1995/06/26  11:30:57  john
9612  * Made registration/copyright screen go away after 5 minutes.
9613  *
9614  * Revision 2.33  1995/05/31  14:26:55  unknown
9615  * Fixed ugly spacing.
9616  *
9617  * Revision 2.32  1995/05/26  16:15:28  john
9618  * Split SATURN into define's for requiring cd, using cd, etc.
9619  * Also started adding all the Rockwell stuff.
9620  *
9621  * Revision 2.31  1995/05/11  13:30:01  john
9622  * Changed 3dbios detection to work like Didde Kim wanted it to.
9623  *
9624  * Revision 2.30  1995/05/08  13:53:50  john
9625  * Added code to read vipport environemnt variable.
9626  *
9627  * Revision 2.29  1995/05/08  11:26:18  john
9628  * Reversed eyes in 3dmax mode.
9629  *
9630  * Revision 2.28  1995/05/08  11:24:06  john
9631  * Made 3dmax work like Kasan wants it to.
9632  *
9633  * Revision 2.27  1995/04/23  16:06:25  john
9634  * Moved rinvul into modem/null modem menu.
9635  *
9636  * Revision 2.26  1995/04/12  13:39:26  john
9637  * Fixed bug with -lowmem not working.
9638  *
9639  * Revision 2.25  1995/04/09  14:43:00  john
9640  * Made Dynamic sockets not print Msockets for help.
9641  *
9642  * Revision 2.24  1995/04/07  16:11:33  john
9643  * Fixed problem with VFX display when using setup.
9644  *
9645  * Revision 2.23  1995/04/06  15:40:51  john
9646  * Synced VFX with setup #'s.
9647  *
9648  * Revision 2.22  1995/04/06  12:12:53  john
9649  * Fixed some bugs with 3dmax.
9650  *
9651  * Revision 2.21  1995/03/30  16:36:51  mike
9652  * text localization.
9653  *
9654  * Revision 2.20  1995/03/29  15:33:52  john
9655  * Added code to parse descent.net file.
9656  *
9657  * Revision 2.19  1995/03/28  20:08:21  john
9658  * Took away alternate server thing.
9659  *
9660  * Revision 2.18  1995/03/27  09:43:08  john
9661  * Added VR Settings in config file.
9662  *
9663  * Revision 2.17  1995/03/23  19:02:21  john
9664  * Added descent.net file use.
9665  *
9666  * Revision 2.16  1995/03/23  12:25:11  john
9667  * Moved IPX stuff into BIOS lib.
9668  *
9669  * Revision 2.15  1995/03/21  16:52:34  john
9670  * Added 320x100.
9671  *
9672  * Revision 2.14  1995/03/21  14:40:33  john
9673  * Ifdef'd out the NETWORK code.
9674  *
9675  * Revision 2.13  1995/03/16  23:13:35  john
9676  * Fixed bug with piggy paging in bitmap not checking for disk
9677  * error, hence bogifying textures if you pull the CD out.
9678  *
9679  * Revision 2.12  1995/03/16  21:45:22  john
9680  * Made all paged modes have incompatible menus!
9681  *
9682  * Revision 2.11  1995/03/15  15:19:34  john
9683  * Took out code that changes to exe dir.
9684  *
9685  * Revision 2.10  1995/03/15  14:33:37  john
9686  * Added code to force the Descent CD-rom in the drive.
9687  *
9688  * Revision 2.9  1995/03/15  11:41:27  john
9689  * Better Saturn CD-ROM support.
9690  *
9691  * Revision 2.8  1995/03/14  18:24:46  john
9692  * Force Destination Saturn to use CD-ROM drive.
9693  *
9694  * Revision 2.7  1995/03/14  16:22:35  john
9695  * Added cdrom alternate directory stuff.
9696  *
9697  * Revision 2.6  1995/03/13  15:17:19  john
9698  * Added alternate hogfile directory.
9699  *
9700  * Revision 2.5  1995/03/10  13:05:35  john
9701  * Added code so that palette is correct for VFX1 helmets.
9702  *
9703  * Revision 2.4  1995/03/07  15:12:43  john
9704  * Fixed VFX,3dmax support.
9705  *
9706  * Revision 2.3  1995/03/07  14:19:35  mike
9707  * More destination saturn stuff.
9708  *
9709  * Revision 2.2  1995/03/06  16:47:34  mike
9710  * destination saturn
9711  *
9712  * Revision 2.1  1995/03/06  15:24:06  john
9713  * New screen techniques.
9714  *
9715  * Revision 2.0  1995/02/27  11:31:29  john
9716  * New version 2.0, which has no anonymous unions, builds with
9717  * Watcom 10.0, and doesn't require parsing BITMAPS.TBL.
9718  *
9719  * Revision 1.295  1995/02/23  12:02:14  john
9720  * Made mono  windows smaller.
9721  *
9722  * Revision 1.294  1995/02/16  17:35:00  john
9723  * Added code to allow dynamic socket changing.
9724  *
9725  * Revision 1.293  1995/02/14  19:29:29  john
9726  * Locked down critical error handler.
9727  *
9728  * Revision 1.292  1995/02/14  15:29:20  john
9729  * Added CR-LF to last line of menu help text.
9730  *
9731  * Revision 1.291  1995/02/14  11:39:01  john
9732  * Added polled/bios joystick readers.
9733  *
9734  * Revision 1.290  1995/02/13  20:35:03  john
9735  * Lintized
9736  *
9737  * Revision 1.289  1995/02/11  16:20:02  john
9738  * Added code to make the default mission be the one last played.
9739  *
9740  * Revision 1.288  1995/02/11  15:54:13  rob
9741  * changed cinvul to rinvul.
9742  *
9743  * Revision 1.287  1995/02/11  14:48:43  rob
9744  * Added max of 314 seconds to control invul. times
9745  *
9746  * Revision 1.286  1995/02/11  12:42:01  john
9747  * Added new song method, with FM bank switching..
9748  *
9749  * Revision 1.285  1995/02/11  11:36:11  rob
9750  * Added cinvul option.
9751  *
9752  * Revision 1.284  1995/02/10  16:07:45  matt
9753  * Took 'registered' out of printed info at startup
9754  *
9755  * Revision 1.283  1995/02/09  22:00:59  john
9756  * Added i-glasses tracking.
9757  *
9758  * Revision 1.282  1995/02/02  11:11:27  john
9759  * Added -nocyberman switch.
9760  *
9761  * Revision 1.281  1995/02/01  16:35:14  john
9762  * Linted.
9763  *
9764  * Revision 1.280  1995/01/31  02:04:25  matt
9765  * Fixed up cmdline help
9766  *
9767  * Revision 1.279  1995/01/30  16:25:55  john
9768  * Put back in graphical screen at program end.
9769  *
9770  * Revision 1.278  1995/01/28  17:05:50  matt
9771  * Changed imbedded copyright to use comma instead of hyphen
9772  *
9773  * Revision 1.277  1995/01/28  15:57:26  john
9774  * Made joystick calibration be only when wrong detected in
9775  * menu or joystick axis changed.
9776  *
9777  * Revision 1.276  1995/01/25  14:37:49  john
9778  * Made joystick only prompt for calibration once...
9779  *
9780  * Revision 1.275  1995/01/24  18:21:00  john
9781  * Added Adam's text warning.
9782  *
9783  * Revision 1.274  1995/01/22  15:57:20  john
9784  * Took out code that printed warning out as game exited.
9785  *
9786  * Revision 1.273  1995/01/22  13:31:35  matt
9787  * Added load of mission 0, so there's always a default mission
9788  *
9789  * Revision 1.272  1995/01/19  17:00:41  john
9790  * Made save game work between levels.
9791  *
9792  * Revision 1.271  1995/01/18  11:47:57  adam
9793  * changed copyright notice
9794  *
9795  * Revision 1.270  1995/01/15  13:42:42  john
9796  * Moved low_mem cutoff higher.
9797  *
9798  * Revision 1.269  1995/01/12  18:53:50  john
9799  * Put ifdef EDITOR around the code that checked for
9800  * a 800x600 mode, because this trashed some people's
9801  * computers (maybe) causing the mem allocation error in
9802  * mouse.c that many users reported.
9803  *
9804  * Revision 1.268  1995/01/12  11:41:42  john
9805  * Added external control reading.
9806  *
9807  * Revision 1.267  1995/01/06  10:26:55  john
9808  * Added -nodoscheck command line switch.
9809  *
9810  * Revision 1.266  1995/01/05  16:59:30  yuan
9811  * Don't show orderform in editor version.
9812  *
9813  * Revision 1.265  1994/12/28  15:33:51  john
9814  * Added -slowjoy option.
9815  *
9816  * Revision 1.264  1994/12/15  16:44:15  matt
9817  * Added trademark notice
9818  *
9819  * Revision 1.263  1994/12/14  20:13:59  john
9820  * Reduced physical mem requments to 2 MB.
9821  *
9822  * Revision 1.262  1994/12/14  19:06:17  john
9823  * Lowered physical memory requments to 2 MB.
9824  *
9825  * Revision 1.261  1994/12/14  09:41:29  allender
9826  * change to drive and directory (if needed) of command line invocation
9827  * so descent can be started from anywhere
9828  *
9829  * Revision 1.260  1994/12/13  19:08:59  john
9830  * Updated memory requirements.
9831  *
9832  * Revision 1.259  1994/12/13  17:30:33  john
9833  * Made the timer rate be changed right after initializing it.
9834  *
9835  * Revision 1.258  1994/12/13  02:46:25  matt
9836  * Added imbedded copyright
9837  *
9838  * Revision 1.257  1994/12/13  02:06:46  john
9839  * Added code to check stack used by descent... initial
9840  * check showed stack used 35k/50k, so we decided it wasn't
9841  * worth pursuing any more.
9842  *
9843  * Revision 1.256  1994/12/11  23:17:54  john
9844  * Added -nomusic.
9845  * Added RealFrameTime.
9846  * Put in a pause when sound initialization error.
9847  * Made controlcen countdown and framerate use RealFrameTime.
9848  *
9849  * Revision 1.255  1994/12/10  00:56:51  matt
9850  * Added -nomusic to command-line help
9851  *
9852  * Revision 1.254  1994/12/08  11:55:11  john
9853  * Took out low memory print.
9854  *
9855  * Revision 1.253  1994/12/08  11:51:00  john
9856  * Made strcpy only copy corect number of chars,.
9857  *
9858  * Revision 1.252  1994/12/08  00:38:29  matt
9859  * Cleaned up banner messages
9860  *
9861  * Revision 1.251  1994/12/07  19:14:52  matt
9862  * Cleaned up command-line options and command-line help message
9863  *
9864  * Revision 1.250  1994/12/06  19:33:28  john
9865  * Fixed text of message to make more sense.
9866  *
9867  * Revision 1.249  1994/12/06  16:30:55  john
9868  * Neatend mem message,..
9869  *
9870  * Revision 1.248  1994/12/06  16:17:35  john
9871  * Added better mem checking/printing.
9872  *
9873  * Revision 1.247  1994/12/06  14:14:37  john
9874  * Added code to set low mem based on memory.
9875  *
9876  * Revision 1.246  1994/12/05  12:29:09  allender
9877  * removed ifdefs around -norun option
9878  *
9879  * Revision 1.245  1994/12/05  00:03:30  matt
9880  * Added -norun option to exit after writing pig
9881  *
9882  * Revision 1.244  1994/12/04  14:47:01  john
9883  * MAde the intro and menu be the same song.
9884  *
9885  * Revision 1.243  1994/12/04  14:36:42  john
9886  * Added menu music.
9887  *
9888  * Revision 1.242  1994/12/02  13:50:17  yuan
9889  * Localization.
9890  *
9891  * Revision 1.241  1994/12/01  17:28:30  adam
9892  * added end-shareware stuff
9893  *
9894  * Revision 1.240  1994/11/30  12:10:57  adam
9895  * added support for PCX titles/brief screens
9896  *
9897  * Revision 1.239  1994/11/29  15:47:33  matt
9898  * Moved error_init to start of game, so error message prints last
9899  *
9900  * Revision 1.238  1994/11/29  14:19:22  jasen
9901  * reduced dos mem requirments.
9902  *
9903  * Revision 1.237  1994/11/29  03:46:35  john
9904  * Added joystick sensitivity; Added sound channels to detail menu.  Removed -maxchannels
9905  * command line arg.
9906  *
9907  * Revision 1.236  1994/11/29  02:50:18  john
9908  * Increased the amount a joystick has to be off before
9909  * asking if they want to recalibrate their joystick.
9910  *
9911  * Revision 1.235  1994/11/29  02:01:29  john
9912  * Corrected some of the Descent command line help items.
9913  *
9914  * Revision 1.234  1994/11/29  01:39:56  john
9915  * Fixed minor bug with vfx_light help not wrapping correctly.
9916  *
9917  * Revision 1.233  1994/11/28  21:34:17  john
9918  * Reduced dos mem rqment to 70k.
9919  *
9920  * Revision 1.232  1994/11/28  21:20:38  john
9921  * First version with memory checking.
9922  *
9923  * Revision 1.231  1994/11/28  20:06:21  rob
9924  * Removed old serial param command line options.
9925  * Added -noserial and -nonetwork to help listing.
9926  *
9927  * Revision 1.230  1994/11/27  23:15:24  matt
9928  * Made changes for new mprintf calling convention
9929  *
9930  * Revision 1.229  1994/11/27  20:50:51  matt
9931  * Don't set mem stuff if no debug
9932  *
9933  * Revision 1.228  1994/11/27  18:46:21  matt
9934  * Cleaned up command-line switches a little
9935  *
9936  * Revision 1.227  1994/11/21  17:48:00  matt
9937  * Added text to specifiy whether shareware or registered version
9938  *
9939  * Revision 1.226  1994/11/21  14:44:20  john
9940  * Fixed some bugs with setting volumes even when -nosound was used. Duh!
9941  *
9942  * Revision 1.225  1994/11/21  13:53:42  matt
9943  * Took out dos extender copyright
9944  *
9945  * Revision 1.224  1994/11/21  09:46:54  john
9946  * Added -showmeminfo parameter.
9947  *
9948  * Revision 1.223  1994/11/20  22:12:05  mike
9949  * Make some stuff dependent on SHAREWARE.
9950  *
9951  * Revision 1.222  1994/11/20  21:14:09  john
9952  * Changed -serial to -noserial.  MAde a 1 sec delay
9953  * before leaving title screen.  Clear keyboard buffer
9954  * before asking for player name.
9955  *
9956  * Revision 1.221  1994/11/19  15:20:20  mike
9957  * rip out unused code and data
9958  *
9959  * Revision 1.220  1994/11/17  19:14:29  adam
9960  * prevented order screen from coming up when -notitles is used
9961  *
9962  * Revision 1.219  1994/11/16  11:34:39  john
9963  * Added -nottitle switch.
9964  *
9965  * Revision 1.218  1994/11/16  10:05:53  john
9966  * Added verbose messages.
9967  *
9968  * Revision 1.217  1994/11/15  20:12:34  john
9969  * Added back in inferno and parallax screens.
9970  *
9971  * Revision 1.216  1994/11/15  18:35:30  john
9972  * Added verbose setting.
9973  *
9974  * Revision 1.215  1994/11/15  17:47:44  john
9975  * Added ordering info screen.
9976  *
9977  * Revision 1.214  1994/11/15  08:57:44  john
9978  * Added MS-DOS version checking and -nonetwork option.
9979  *
9980  * Revision 1.213  1994/11/15  08:34:32  john
9981  * Added better error messages for IPX init.
9982  *
9983  * Revision 1.212  1994/11/14  20:14:18  john
9984  * Fixed some warnings.
9985  *
9986  * Revision 1.211  1994/11/14  19:50:49  john
9987  * Added joystick cal values to descent.cfg.
9988  *
9989  * Revision 1.210  1994/11/14  17:56:44  allender
9990  * make call to ReadConfigFile at startup
9991  *
9992  * Revision 1.209  1994/11/14  11:41:55  john
9993  * Fixed bug with editor/game sequencing.
9994  *
9995  * Revision 1.208  1994/11/13  17:05:11  john
9996  * Made the callsign entry be a list box and gave the ability
9997  * to delete players.
9998  *
9999  * Revision 1.207  1994/11/13  15:39:22  john
10000  * Added critical error handler to game.  Took out -editor command line
10001  * option because it didn't work anymore and wasn't worth fixing.  Made scores
10002  * not use MINER enviroment variable on release version, and made scores
10003  * not print an error if there is no descent.hi.
10004  *
10005  * Revision 1.206  1994/11/10  20:53:29  john
10006  * Used new sound install parameters.
10007  *
10008  * Revision 1.205  1994/11/10  11:07:52  mike
10009  * Set default detail level.
10010  *
10011  * Revision 1.204  1994/11/09  13:45:43  matt
10012  * Made -? work again for help
10013  *
10014  * Revision 1.203  1994/11/09  10:55:58  matt
10015  * Cleaned up initialization for editor -> game transitions
10016  *
10017  * Revision 1.202  1994/11/07  21:35:47  matt
10018  * Use new function iff_read_into_bitmap()
10019  *
10020  * Revision 1.201  1994/11/05  17:22:16  john
10021  * Fixed lots of sequencing problems with newdemo stuff.
10022  *
10023  * Revision 1.200  1994/11/05  14:05:44  john
10024  * Fixed fade transitions between all screens by making
10025  * gr_palette_fade_in and out keep track of whether the palette is
10026  * faded in or not.  Then, wherever the code needs to fade out, it
10027  * just calls gr_palette_fade_out and it will fade out if it isn't
10028  * already.  The same with fade_in.
10029  * This eliminates the need for all the flags like Menu_fade_out,
10030  * game_fade_in palette, etc.
10031  *
10032  * Revision 1.199  1994/11/04  14:36:30  allender
10033  * change Auto_demo meaning to mean autostart from menu only.  Use
10034  * FindArgs when searching for AutoDemo from command line.  also,
10035  * set N_Players to 1 when starting in editor mode.
10036  *
10037  * Revision 1.198  1994/11/02  11:59:49  john
10038  * Moved menu out of game into inferno main loop.
10039  *
10040  * Revision 1.197  1994/11/01  17:57:39  mike
10041  * -noscreens option to bypass all screens.
10042  *
10043  * Revision 1.196  1994/10/28  15:42:34  allender
10044  * don't register player if Autodemo is on
10045  *
10046  * Revision 1.195  1994/10/28  10:58:01  matt
10047  * Added copyright notice for DOS4GW
10048  *
10049  * Revision 1.194  1994/10/20  21:26:48  matt
10050  * Took out old serial name/number code, and put up message if this
10051  * is a marked version.
10052  *
10053  * Revision 1.193  1994/10/19  09:52:14  allender
10054  * Print out who descent.exe belongs to if descent.exe is stamped.
10055  *
10056  * Revision 1.192  1994/10/18  16:43:05  allender
10057  * Added check for identifier stamp and time after which descent will
10058  * no longer run.
10059  *
10060  * Revision 1.191  1994/10/17  13:07:17  john
10061  * Moved the descent.cfg info into the player config file.
10062  *
10063  * Revision 1.190  1994/10/04  10:26:31  matt
10064  * Support new menu fade in
10065  *
10066  * Revision 1.189  1994/10/03  22:58:46  matt
10067  * Changed some values of game_mode
10068  *
10069  * Revision 1.188  1994/10/03  18:55:39  rob
10070  * Changed defaults for com port settings.
10071  *
10072  * Revision 1.187  1994/10/03  13:34:47  matt
10073  * Added new (and hopefully better) game sequencing functions
10074  *
10075  * Revision 1.186  1994/09/30  12:37:28  john
10076  * Added midi,digi volume to configuration.
10077  *
10078  * Revision 1.185  1994/09/30  10:08:48  john
10079  * Changed sound stuff... made it so the reseting card doesn't hang,
10080  * made volume change only if sound is installed.
10081  *
10082  * Revision 1.184  1994/09/28  17:25:00  matt
10083  * Added first draft of game save/load system
10084  *
10085  * Revision 1.183  1994/09/28  16:18:23  john
10086  * Added capability to play midi song.
10087  *
10088  * Revision 1.182  1994/09/28  11:31:18  john
10089  * Made text output unbuffered.
10090  *
10091  * Revision 1.181  1994/09/27  19:23:44  john
10092  * Added -nojoystick and -nomouse
10093  *
10094  * Revision 1.180  1994/09/24  16:55:29  rob
10095  * No longer open COM port immediately upon program start.
10096  * No longer set Network_active is serial_active is set.
10097  *
10098  * Revision 1.179  1994/09/24  14:16:30  mike
10099  * Support new game mode constants.
10100  *
10101  * Revision 1.178  1994/09/22  17:52:31  rob
10102  * Added Findargs hooks for -serial, -speed, and -com.
10103  *
10104  * Revision 1.177  1994/09/22  16:14:11  john
10105  * Redid intro sequecing.
10106  *
10107  * Revision 1.176  1994/09/21  16:32:58  john
10108  * Made mouse and keyboard init after bm_init. Why?
10109  * Because it seems to work better under virtual
10110  * memory.
10111  *
10112  * Revision 1.175  1994/09/21  16:27:52  john
10113  * Added mouse_init
10114  *
10115  * Revision 1.174  1994/09/20  15:14:10  matt
10116  * New message for new VFX switches
10117  *
10118  * Revision 1.173  1994/09/16  16:14:27  john
10119  * Added acrade sequencing.
10120  *
10121  * Revision 1.172  1994/09/16  11:49:52  john
10122  * Added first version of arcade joystick support;
10123  * Also fixed some bugs in kconfig.c, such as reading non-present
10124  * joysticks, which killed frame rate, and not reading key_down_time
10125  * when in slide mode or bank mode.
10126  *
10127  * Revision 1.171  1994/09/15  16:11:35  john
10128  * Added support for VFX1 head tracking. Fixed bug with memory over-
10129  * write when using stereo mode.
10130  *
10131  * Revision 1.170  1994/09/12  19:38:23  john
10132  * Made some stuff that prints to the DOS screen go to the
10133  * mono instead, since it really is debugging info.
10134  *
10135  * Revision 1.169  1994/08/29  21:18:28  john
10136  * First version of new keyboard/oystick remapping stuff.
10137  *
10138  * Revision 1.168  1994/08/26  13:02:00  john
10139  * Put high score system in.
10140  *
10141  * Revision 1.167  1994/08/24  19:00:23  john
10142  * Changed key_down_time to return fixed seconds instead of
10143  * milliseconds.
10144  *
10145  * Revision 1.166  1994/08/18  16:24:20  john
10146  * changed socket to channel in text.
10147  *
10148  * Revision 1.165  1994/08/18  16:16:51  john
10149  * Added support for different sockets.
10150  *
10151  * Revision 1.164  1994/08/18  10:47:53  john
10152  * *** empty log message ***
10153  *
10154  * Revision 1.163  1994/08/12  09:15:54  john
10155  * *** empty log message ***
10156  *
10157  * Revision 1.162  1994/08/12  03:11:19  john
10158  * Made network be default off; Moved network options into
10159  * main menu.  Made starting net game check that mines are the
10160  * same.
10161  *
10162  * Revision 1.161  1994/08/10  19:57:05  john
10163  * Changed font stuff; Took out old menu; messed up lots of
10164  * other stuff like game sequencing messages, etc.
10165  *
10166  * Revision 1.160  1994/08/05  16:30:23  john
10167  * Added capability to turn off network.
10168  *
10169  * Revision 1.159  1994/08/04  19:42:51  matt
10170  * Moved serial number & name (and version name) from inferno.c to inferno.ini
10171  *
10172  * Revision 1.158  1994/08/03  10:30:23  matt
10173  * Change cybermaxx switches, updated command-line help, and added serial number system
10174  *
10175  * Revision 1.157  1994/07/29  18:30:10  matt
10176  * New parms (lack of parms, actually) for g3_init()
10177  *
10178  * Revision 1.156  1994/07/24  00:39:25  matt
10179  * Added more text to TEX file; make NewGame() take a start level; made game
10180  * load/save menus use open/close window funcs.
10181  *
10182  * Revision 1.155  1994/07/21  21:31:27  john
10183  * First cheapo version of VictorMaxx tracking.
10184  *
10185  * Revision 1.154  1994/07/21  18:15:34  matt
10186  * Ripped out a bunch of unused stuff
10187  *
10188  * Revision 1.153  1994/07/21  17:59:10  matt
10189  * Cleaned up initial mode game/editor code
10190  *
10191  * Revision 1.152  1994/07/21  13:11:19  matt
10192  * Ripped out remants of old demo system, and added demo only system that
10193  * disables object movement and game options from menu.
10194  *
10195  * Revision 1.151  1994/07/20  15:58:27  john
10196  * First installment of ipx stuff.
10197  *
10198  * Revision 1.150  1994/07/15  16:04:24  matt
10199  * Changed comment for milestone 3 version
10200  *
10201  * Revision 1.149  1994/07/15  13:59:24  matt
10202  * Fixed stupid mistake I make in the last revision
10203  *
10204  * Revision 1.148  1994/07/15  13:20:15  matt
10205  * Updated comand-line help
10206  *
10207  * Revision 1.147  1994/07/14  23:29:43  matt
10208  * Open two mono debug messages, one for errors & one for spew
10209  *
10210  * Revision 1.146  1994/07/09  22:48:05  matt
10211  * Added localizable text
10212  *
10213  * Revision 1.145  1994/07/02  13:49:47  matt
10214  * Cleaned up includes
10215  *
10216  * Revision 1.144  1994/06/30  20:04:43  john
10217  * Added -joydef support.
10218  *
10219  * Revision 1.143  1994/06/24  17:01:44  john
10220  * Add VFX support; Took Game Sequencing, like EndGame and stuff and
10221  * took it out of game.c and into gameseq.c
10222
10223 ------------------------------------------------------------------------
10224 main/joydefs.c:
10225
10226  * Revision 1.10  1995/10/18  22:21:21  allender
10227  * fixed bug with gravis mousestick and call key_flush when
10228  * calibrating joystick since it used keystrokes for the trigger
10229  * (at least most of them do)
10230  *
10231  * Revision 1.9  1995/10/17  13:12:32  allender
10232  * fixed up controller support for mac world
10233  *
10234  * Revision 1.8  1995/10/15  19:27:04  allender
10235  * new Dave Denhart controller code
10236  *
10237  * Revision 1.7  1995/10/15  16:14:59  allender
10238  * fixed axis value for Thrustmaster rudders
10239  *
10240  * Revision 1.6  1995/09/13  11:39:39  allender
10241  * made joystick cal menu all text so buttons will work properly
10242  *
10243  * Revision 1.5  1995/09/01  13:13:13  allender
10244  * added close box on controls menu
10245  *
10246  * Revision 1.4  1995/08/18  10:22:47  allender
10247  * if thrustmaster choosen, set joystick at thrustmaster type
10248  * for proper reading in joyc.c
10249  *
10250  * Revision 1.3  1995/07/26  17:00:34  allender
10251  * put back in code to make joysticks work
10252  *
10253  * Revision 1.2  1995/07/17  08:52:21  allender
10254  * put back in code that was taken out previously
10255  *
10256  * Revision 1.1  1995/05/16  15:26:48  allender
10257  * Initial revision
10258  *
10259  * Revision 2.2  1995/06/30  12:30:22  john
10260  * Added -Xname command line.
10261  *
10262  * Revision 2.1  1995/04/06  12:13:20  john
10263  * Made so you can calibrate Gravis Gamepad.
10264  *
10265  * Revision 2.0  1995/02/27  11:30:27  john
10266  * New version 2.0, which has no anonymous unions, builds with
10267  * Watcom 10.0, and doesn't require parsing BITMAPS.TBL.
10268  *
10269  * Revision 1.71  1995/02/12  02:06:10  john
10270  * Fixed bug with joystick incorrectly asking for
10271  * calibration.
10272  *
10273  * Revision 1.70  1995/01/28  15:58:07  john
10274  * Made joystick calibration be only when wrong detected in
10275  * menu or joystick axis changed.
10276  *
10277  * Revision 1.69  1995/01/25  14:37:55  john
10278  * Made joystick only prompt for calibration once...
10279  *
10280  * Revision 1.68  1995/01/24  16:34:29  john
10281  * Made so that if you reconfigure joystick and
10282  * add or subtract an axis, it asks for a recalibration
10283  * upon leaving.
10284  *
10285  * Revision 1.67  1994/12/29  11:08:51  john
10286  * Fixed Thrustmaster and Logitech Wingman extreme
10287  * Hat by reading the y2 axis during the center stage
10288  * of the calibration, and using 75, 50, 27, and 3 %
10289  * as values for the 4 positions.
10290  *
10291  * Revision 1.66  1994/12/15  18:17:39  john
10292  * Fixed warning with previous.
10293  *
10294  * Revision 1.65  1994/12/15  18:15:48  john
10295  * Made the joy cal only write the .cfg file, not
10296  * the player file.
10297  *
10298  * Revision 1.64  1994/12/13  14:43:35  john
10299  * Took out the code in kconfig to build direction array.
10300  * Called kc_set_controls after selecting a new control type.
10301  *
10302  * Revision 1.63  1994/12/10  12:08:47  john
10303  * Changed some delays to use TICKER instead of timer_get_fixed_seconds.
10304  *
10305  * Revision 1.62  1994/12/09  11:01:07  mike
10306  * force calibration of joystick on joystick selection from Controls... menu.
10307  *
10308  * Revision 1.61  1994/12/07  21:50:27  john
10309  * Put stop/start time around joystick delay.
10310  *
10311  * Revision 1.60  1994/12/07  19:34:39  john
10312  * Added delay.
10313  *
10314  * Revision 1.59  1994/12/07  18:12:14  john
10315  * NEatened up joy cal.,
10316  *
10317  * Revision 1.58  1994/12/07  17:07:51  john
10318  * Fixed up joy cal.
10319  *
10320  * Revision 1.57  1994/12/07  16:48:53  yuan
10321  * localization
10322  *
10323  * Revision 1.56  1994/12/07  16:05:55  john
10324  * Changed the way joystick calibration works.
10325  *
10326  * Revision 1.55  1994/12/06  20:15:22  john
10327  * Took out code that unpauses songs that were never paused.
10328  *
10329  * Revision 1.54  1994/12/06  15:14:09  yuan
10330  * Localization
10331  *
10332  * Revision 1.53  1994/12/05  16:29:16  john
10333  * Took out music pause around the cheat menu.
10334  *
10335  * Revision 1.52  1994/12/04  12:39:10  john
10336  * MAde so that FCS calibration doesn't ask for axis #2.
10337  *
10338  * Revision 1.51  1994/12/03  15:14:59  john
10339  * Took out the delay mentioned previosuly cause it would
10340  * cause bigger problems than it helps, especially with netgames.
10341  *
10342  * Revision 1.50  1994/12/03  14:16:14  john
10343  * Put a delay between screens in joy cal to keep Yuan from
10344  * double hitting.
10345  *
10346  * Revision 1.49  1994/12/03  11:04:06  john
10347  * Changed newmenu code a bit to fix bug with bogus
10348  * backgrounds occcasionally.
10349  *
10350  * Revision 1.48  1994/12/02  11:03:44  yuan
10351  * Localization.
10352  *
10353  * Revision 1.47  1994/12/02  10:50:33  yuan
10354  * Localization
10355  *
10356  * Revision 1.46  1994/12/01  12:21:59  john
10357  * Added code to calibrate 2 joysticks separately.
10358  *
10359  * Revision 1.45  1994/12/01  11:52:31  john
10360  * Added message when you select FCS to say that if
10361  * you have WCS, see manuel.
10362  *
10363  * Revision 1.44  1994/11/29  02:26:28  john
10364  * Made the prompts for upper-left, lower right for joy
10365  * calibration more obvious.
10366  *
10367  * Revision 1.43  1994/11/26  13:13:59  matt
10368  * Changed "none" option to "keyboard only"
10369  *
10370  * Revision 1.42  1994/11/21  19:35:13  john
10371  * Replaced calls to joy_init with if (joy_present)
10372  *
10373  * Revision 1.41  1994/11/21  19:28:34  john
10374  * Changed warning for no joystick to use nm_messagebox..
10375  *
10376  * Revision 1.40  1994/11/21  19:06:25  john
10377  * Made it so that it only stops sound when your in game mode.
10378  *
10379  * Revision 1.39  1994/11/21  11:47:18  john
10380  * Made sound pause during joystick calibration.
10381  *
10382  * Revision 1.38  1994/11/10  20:34:18  rob
10383  * Removed menu-specific network mode support in favor in new stuff
10384  * in newmenu.c
10385  *
10386  * Revision 1.37  1994/11/08  21:21:38  john
10387  * Made Esc exit joystick calibration.
10388  *
10389  * Revision 1.36  1994/11/08  15:14:42  john
10390  * Added more calls so net doesn't die in net game.
10391  *
10392  * Revision 1.35  1994/11/08  14:59:12  john
10393  * Added code to respond to network while in menus.
10394  *
10395  * Revision 1.34  1994/10/24  19:56:32  john
10396  * Made the new user setup prompt for config options.
10397  *
10398  * Revision 1.33  1994/10/22  14:11:52  mike
10399  * Suppress compiler warning message.
10400  *
10401  * Revision 1.32  1994/10/19  12:44:24  john
10402  * Added hours field to player structure.
10403  *
10404  * Revision 1.31  1994/10/17  13:07:13  john
10405  * Moved the descent.cfg info into the player config file.
10406  *
10407  * Revision 1.30  1994/10/13  21:41:12  john
10408  * MAde Esc exit out of joystick calibration.
10409  *
10410  * Revision 1.29  1994/10/13  19:22:27  john
10411  * Added separate config saves for different devices.
10412  * Made all the devices work together better, such as mice won't
10413  * get read when you're playing with the joystick.
10414  *
10415  * Revision 1.28  1994/10/13  11:40:18  john
10416  * Took out warnings.
10417  *
10418  * Revision 1.27  1994/10/13  11:35:23  john
10419  * Made Thrustmaster FCS Hat work.  Put a background behind the
10420  * keyboard configure.  Took out turn_sensitivity.  Changed sound/config
10421  * menu to new menu. Made F6 be calibrate joystick.
10422  *
10423  * Revision 1.26  1994/10/11  21:29:03  matt
10424  * Made a bunch of menus have good initial selected values
10425  *
10426  * Revision 1.25  1994/10/11  17:08:39  john
10427  * Added sliders for volume controls.
10428  *
10429  * Revision 1.24  1994/10/10  17:59:21  john
10430  * Neatend previous.
10431  *
10432  * Revision 1.23  1994/10/10  17:57:59  john
10433  * Neatend previous.
10434  *
10435  * Revision 1.22  1994/10/10  17:56:11  john
10436  * Added messagebox that tells that config has been saved.
10437  *
10438  * Revision 1.21  1994/09/30  12:37:26  john
10439  * Added midi,digi volume to configuration.
10440  *
10441  * Revision 1.20  1994/09/22  16:14:14  john
10442  * Redid intro sequecing.
10443  *
10444  * Revision 1.19  1994/09/19  18:50:15  john
10445  * Added switch to disable joystick.
10446  *
10447  * Revision 1.18  1994/09/12  11:47:36  john
10448  * Made stupid cruise work better.  Make kconfig values get
10449  * read/written to disk.
10450  *
10451  * Revision 1.17  1994/09/10  15:46:47  john
10452  * First version of new keyboard configuration.
10453  *
10454  * Revision 1.16  1994/09/06  19:35:44  john
10455  * Fixed bug that didn';t load new size .cal file.
10456  *
10457  * Revision 1.15  1994/09/06  14:51:58  john
10458  * Added sensitivity adjustment, fixed bug with joystick button not
10459  * staying down.
10460  *
10461  * Revision 1.14  1994/09/02  16:13:47  john
10462  * Made keys fill in position.
10463  *
10464  * Revision 1.13  1994/08/31  17:58:50  john
10465  * Made a bit simpler.
10466  *
10467  * Revision 1.12  1994/08/31  14:17:54  john
10468  * *** empty log message ***
10469  *
10470  * Revision 1.11  1994/08/31  14:10:56  john
10471  * Made keys not work when KEY_DELETE pressed.
10472  *
10473  * Revision 1.10  1994/08/31  13:40:47  mike
10474  * Change constant
10475  *
10476  * Revision 1.9  1994/08/31  12:56:27  john
10477  * *** empty log message ***
10478  *
10479  * Revision 1.8  1994/08/30  20:38:29  john
10480  * Add more config stuff..
10481  *
10482  * Revision 1.7  1994/08/30  16:37:25  john
10483  * Added menu options to set controls.
10484  *
10485  * Revision 1.6  1994/08/30  09:27:18  john
10486  * *** empty log message ***
10487  *
10488  * Revision 1.5  1994/08/30  09:12:01  john
10489  * *** empty log message ***
10490  *
10491  * Revision 1.4  1994/08/29  21:18:32  john
10492  * First version of new keyboard/oystick remapping stuff.
10493  *
10494  * Revision 1.3  1994/08/24  19:00:29  john
10495  * Changed key_down_time to return fixed seconds instead of
10496  * milliseconds.
10497  *
10498  * Revision 1.2  1994/08/17  16:50:37  john
10499  * Added damaging fireballs, missiles.
10500  *
10501  * Revision 1.1  1994/08/17  10:07:12  john
10502  * Initial revision
10503
10504 ------------------------------------------------------------------------
10505 main/joydefs.h:
10506
10507  * Revision 2.0  1995/02/27  11:32:12  john
10508  * New version 2.0, which has no anonymous unions, builds with
10509  * Watcom 10.0, and doesn't require parsing BITMAPS.TBL.
10510  *
10511  * Revision 1.12  1995/01/25  14:37:52  john
10512  * Made joystick only prompt for calibration once...
10513  *
10514  * Revision 1.11  1994/10/13  11:35:43  john
10515  * Made Thrustmaster FCS Hat work.  Put a background behind the
10516  * keyboard configure.  Took out turn_sensitivity.  Changed sound/config
10517  * menu to new menu. Made F6 be calibrate joystick.
10518  *
10519  * Revision 1.10  1994/09/10  15:46:49  john
10520  * First version of new keyboard configuration.
10521  *
10522  * Revision 1.9  1994/09/06  14:51:29  john
10523  * Added sensitivity adjustment, fixed bug with joystick button not
10524  * staying down.
10525  *
10526  * Revision 1.8  1994/08/31  12:56:29  john
10527  * *** empty log message ***
10528  *
10529  * Revision 1.7  1994/08/30  16:37:07  john
10530  * Added menu options to set controls.
10531  *
10532  * Revision 1.6  1994/08/29  21:18:33  john
10533  * First version of new keyboard/oystick remapping stuff.
10534  *
10535  * Revision 1.5  1994/08/24  19:00:30  john
10536  * Changed key_down_time to return fixed seconds instead of
10537  * milliseconds.
10538  *
10539  * Revision 1.4  1994/08/17  16:50:04  john
10540  * Added damaging fireballs, missiles.
10541  *
10542  * Revision 1.3  1994/07/01  10:55:18  john
10543  * Added analog joystick throttle
10544  *
10545  * Revision 1.2  1994/06/30  20:04:46  john
10546  * Added -joydef support.
10547  *
10548  * Revision 1.1  1994/06/30  18:08:12  john
10549  * Initial revision
10550
10551 ------------------------------------------------------------------------
10552 main/kconfig.c:
10553
10554  * Revision 1.18  1995/10/29  20:14:10  allender
10555  * don't read mouse 30x/sec.  Still causes problems -- left with
10556  * exposure at > 60 frame/s
10557  *
10558  * Revision 1.17  1995/10/27  14:16:35  allender
10559  * don't set lastreadtime when doing mouse stuff if we didn't
10560  * read mouse this frame
10561  *
10562  * Revision 1.16  1995/10/24  18:10:22  allender
10563  * get mouse stuff working right this time?
10564  *
10565  * Revision 1.15  1995/10/23  14:50:50  allender
10566  * corrected values for control type in kc_set_controls
10567  *
10568  * Revision 1.14  1995/10/21  16:36:54  allender
10569  * fix up mouse read time
10570  *
10571  * Revision 1.13  1995/10/20  00:46:53  allender
10572  * fix up mouse reading problem
10573  *
10574  * Revision 1.12  1995/10/19  13:36:38  allender
10575  * mouse support in kconfig screens
10576  *
10577  * Revision 1.11  1995/10/18  21:06:06  allender
10578  * removed Int3 in cruise stuff -- was in there for debugging and
10579  * now not needed
10580  *
10581  * Revision 1.10  1995/10/17  13:12:47  allender
10582  * fixed config menus so buttons don't get configured
10583  *
10584  * Revision 1.9  1995/10/15  23:07:55  allender
10585  * added return key as second button for primary fire
10586  *
10587  * Revision 1.8  1995/09/05  08:49:47  allender
10588  * change 'PADRTN' label to 'ENTER'
10589  *
10590  * Revision 1.7  1995/09/01  15:38:22  allender
10591  * took out cap of reading controls max 25 times/sec
10592  *
10593  * Revision 1.6  1995/09/01  13:33:59  allender
10594  * erase all old text
10595  *
10596  * Revision 1.5  1995/08/18  10:20:55  allender
10597  * keep controls reading to 25 times/s max so fast
10598  * frame rates don't mess up control reading
10599  *
10600  * Revision 1.4  1995/07/28  15:43:13  allender
10601  * make mousebutton control primary fire
10602  *
10603  * Revision 1.3  1995/07/26  17:04:32  allender
10604  * new defaults and make joystick main button work correctly
10605  *
10606  * Revision 1.2  1995/07/17  08:51:03  allender
10607  * fixed up configuration menus to look right
10608  *
10609  * Revision 1.1  1995/05/16  15:26:56  allender
10610  * Initial revision
10611  *
10612  * Revision 2.11  1995/08/23  16:08:04  john
10613  * Added version 2 of external controls that passes the ship
10614  * position and orientation the drivers.
10615  *
10616  * Revision 2.10  1995/07/07  16:48:01  john
10617  * Fixed bug with new interface.
10618  *
10619  * Revision 2.9  1995/07/03  15:02:32  john
10620  * Added new version of external controls for Cybermouse absolute position.
10621  *
10622  * Revision 2.8  1995/06/30  12:30:28  john
10623  * Added -Xname command line.
10624  *
10625  * Revision 2.7  1995/03/30  16:36:56  mike
10626  * text localization.
10627  *
10628  * Revision 2.6  1995/03/21  14:39:31  john
10629  * Ifdef'd out the NETWORK code.
10630  *
10631  * Revision 2.5  1995/03/16  10:53:07  john
10632  * Move VFX center to Shift+Z instead of Enter because
10633  * it conflicted with toggling HUD on/off.
10634  *
10635  * Revision 2.4  1995/03/10  13:47:24  john
10636  * Added head tracking sensitivity.
10637  *
10638  * Revision 2.3  1995/03/09  18:07:06  john
10639  * Fixed bug with iglasses tracking not "centering" right.
10640  * Made VFX have bright headlight lighting.
10641  *
10642  * Revision 2.2  1995/03/08  15:32:39  john
10643  * Made VictorMaxx head tracking use Greenleaf code.
10644  *
10645  * Revision 2.1  1995/03/06  15:23:31  john
10646  * New screen techniques.
10647  *
10648  * Revision 2.0  1995/02/27  11:29:26  john
10649  * New version 2.0, which has no anonymous unions, builds with
10650  * Watcom 10.0, and doesn't require parsing BITMAPS.TBL.
10651  *
10652  * Revision 1.105  1995/02/22  14:11:58  allender
10653  * remove anonymous unions from object structure
10654  *
10655  * Revision 1.104  1995/02/13  12:01:56  john
10656  * Fixed bug with buggin not mmaking player faster.
10657  *
10658  * Revision 1.103  1995/02/09  22:00:46  john
10659  * Added i-glasses tracking.
10660  *
10661  * Revision 1.102  1995/01/24  21:25:47  john
10662  * Fixed bug with slide/bank on not working with
10663  * Cyberman heading.,
10664  *
10665  * Revision 1.101  1995/01/24  16:09:56  john
10666  * Fixed bug with Wingman extreme customize text overwriting title.
10667  *
10668  * Revision 1.100  1995/01/24  12:37:46  john
10669  * Made Esc exit key define menu.
10670  *
10671  * Revision 1.99  1995/01/23  23:54:43  matt
10672  * Made keypad enter work
10673  *
10674  * Revision 1.98  1995/01/23  16:42:00  john
10675  * Made the external controls always turn banking off, leveling off
10676  * and passed automap state thru to the tsr.
10677  *
10678  * Revision 1.97  1995/01/12  11:41:33  john
10679  * Added external control reading.
10680  *
10681  * Revision 1.96  1995/01/05  10:43:58  mike
10682  * Handle case when timer_get_fixed_seconds() goes negative.  Happens at 9.1
10683  * hours.  Previously, joystick would stop functioning.  Now will work.
10684  *
10685  * Revision 1.95  1994/12/29  11:17:38  john
10686  * Took out some warnings and mprintf.
10687  *
10688  * Revision 1.94  1994/12/29  11:07:41  john
10689  * Fixed Thrustmaster and Logitech Wingman extreme
10690  * Hat by reading the y2 axis during the center stage
10691  * of the calibration, and using 75, 50, 27, and 3 %
10692  * as values for the 4 positions.
10693  *
10694  * Revision 1.93  1994/12/27  12:16:20  john
10695  * Fixed bug with slide on not working with joystick or mouse buttons.
10696  *
10697  * Revision 1.92  1994/12/20  10:34:15  john
10698  * Made sensitivity work for mouse & joystick and made
10699  * it only affect, pitch, heading, and roll.
10700  *
10701  * Revision 1.91  1994/12/16  00:11:23  matt
10702  * Made delete key act normally when debug out
10703  *
10704  * Revision 1.90  1994/12/14  17:41:15  john
10705  * Added more buttons so that  Yoke would work.
10706  *
10707  * Revision 1.89  1994/12/13  17:25:35  allender
10708  * Added Assert for bogus time for joystick reading.
10709  *
10710  * Revision 1.88  1994/12/13  14:48:01  john
10711  * Took out some debugging mprintf's
10712  *
10713  *
10714  * Revision 1.87  1994/12/13  14:43:02  john
10715  * Took out the code in kconfig to build direction array.
10716  * Called kc_set_controls after selecting a new control type.
10717  *
10718  * Revision 1.86  1994/12/13  01:11:32  john
10719  * Fixed bug with message clearing overwriting
10720  * right border.
10721  *
10722  * Revision 1.85  1994/12/12  00:35:58  john
10723  * Added or thing for keys.
10724  *
10725  * Revision 1.84  1994/12/09  17:08:06  john
10726  * Made mouse a bit less sensitive.
10727  *
10728  * Revision 1.83  1994/12/09  16:04:00  john
10729  * Increased mouse sensitivity.
10730  *
10731  * Revision 1.82  1994/12/09  00:41:26  mike
10732  * fix hang in automap print screen
10733  *
10734  * Revision 1.81  1994/12/08  11:50:37  john
10735  * Made strcpy only copy corect number of chars,.
10736  *
10737  * Revision 1.80  1994/12/07  16:16:06  john
10738  * Added command to check to see if a joystick axes has been used.
10739  *
10740  * Revision 1.79  1994/12/07  14:52:28  yuan
10741  * Localization 492
10742  *
10743  * Revision 1.78  1994/12/07  13:37:40  john
10744  * Made the joystick thrust work in reverse.
10745  *
10746  * Revision 1.77  1994/12/07  11:28:24  matt
10747  * Did a little localization support
10748  *
10749  * Revision 1.76  1994/12/04  12:30:03  john
10750  * Made the Thrustmaster stick read every frame, not every 10 frames,
10751  * because it uses analog axis as buttons.
10752  *
10753  * Revision 1.75  1994/12/03  22:35:25  yuan
10754  * Localization 412
10755  *
10756  * Revision 1.74  1994/12/03  15:39:24  john
10757  * Made numeric keypad move in conifg.
10758  *
10759  * Revision 1.73  1994/12/01  16:23:39  john
10760  * Fixed include mistake.
10761  *
10762  * Revision 1.72  1994/12/01  16:07:57  john
10763  * Fixed bug that disabled joystick in automap because it used gametime, which is
10764  * paused during automap. Fixed be used timer_Get_fixed_seconds instead of GameTime.
10765  *
10766  * Revision 1.71  1994/12/01  12:30:49  john
10767  * Made Ctrl+D delete, not Ctrl+E
10768  *
10769  * Revision 1.70  1994/12/01  11:52:52  john
10770  * Added default values for GamePad.
10771  *
10772  * Revision 1.69  1994/11/30  00:59:12  mike
10773  * optimizations.
10774  *
10775  * Revision 1.68  1994/11/29  03:45:50  john
10776  * Added joystick sensitivity; Added sound channels to detail menu.  Removed -maxchannels
10777  * command line arg.
10778  *
10779  * Revision 1.67  1994/11/27  23:13:44  matt
10780  * Made changes for new mprintf calling convention
10781  *
10782  * Revision 1.66  1994/11/27  19:52:12  matt
10783  * Made screen shots work in a few more places
10784  *
10785  * Revision 1.65  1994/11/22  16:54:50  mike
10786  * autorepeat on missiles.
10787  *
10788  * Revision 1.64  1994/11/21  11:16:17  rob
10789  * Changed calls to GameLoop to calls to multi_menu_poll and changed
10790  * conditions under which they are called.
10791  *
10792  * Revision 1.63  1994/11/19  15:14:48  mike
10793  * remove unused code and data
10794  *
10795  * Revision 1.62  1994/11/18  23:37:56  john
10796  * Changed some shorts to ints.
10797  *
10798  * Revision 1.61  1994/11/17  13:36:35  rob
10799  * Added better network hook in kconfig menu.
10800  *
10801  * Revision 1.60  1994/11/14  20:09:13  john
10802  * Made Tab be default for automap.
10803  *
10804  * Revision 1.59  1994/11/13  16:34:07  matt
10805  * Fixed victormaxx angle conversions
10806  *
10807  * Revision 1.58  1994/11/12  14:47:05  john
10808  * Added support for victor head tracking.
10809  *
10810  * Revision 1.57  1994/11/08  15:14:55  john
10811  * Added more calls so net doesn't die in net game.
10812  *
10813  * Revision 1.56  1994/11/07  14:01:07  john
10814  * Changed the gamma correction sequencing.
10815  *
10816  * Revision 1.55  1994/11/01  16:40:08  john
10817  * Added Gamma correction.
10818  *
10819  * Revision 1.54  1994/10/25  23:09:26  john
10820  * Made the automap key configurable.
10821  *
10822  * Revision 1.53  1994/10/25  13:11:59  john
10823  * Made keys the way Adam speced 'em for final game.
10824  *
10825  * Revision 1.52  1994/10/24  17:44:22  john
10826  * Added stereo channel reversing.
10827  *
10828  * Revision 1.51  1994/10/22  13:23:18  john
10829  * Made default rear view key be R.
10830  *
10831  * Revision 1.50  1994/10/22  13:20:09  john
10832  * Took out toggle primary/secondary weapons.  Fixed black
10833  * background for 'axes' and 'buttons' text.
10834  *
10835  * Revision 1.49  1994/10/21  15:20:15  john
10836  * Made PrtScr do screen dump, not F2.
10837  *
10838  * Revision 1.48  1994/10/21  13:41:36  john
10839  * Allowed F2 to screen dump.
10840  *
10841  * Revision 1.47  1994/10/17  13:07:05  john
10842  * Moved the descent.cfg info into the player config file.
10843  *
10844  * Revision 1.46  1994/10/14  15:30:22  john
10845  * Added Cyberman default positions.
10846  *
10847  * Revision 1.45  1994/10/14  15:24:54  john
10848  * Made Cyberman work with config.
10849  *
10850  * Revision 1.44  1994/10/14  12:46:04  john
10851  * Added the ability to reset all to default.
10852  *
10853  * Revision 1.43  1994/10/14  12:18:31  john
10854  * Made mouse invert axis always be 0 or 1.
10855  *
10856  * Revision 1.42  1994/10/14  12:16:03  john
10857  * Changed code so that by doing DEL+F12 saves the current kconfig
10858  * values as default. Added support for drop_bomb key.  Took out
10859  * unused slots for keyboard.  Made keyboard use control_type of 0
10860  * save slots.
10861  *
10862  * Revision 1.41  1994/10/13  21:27:02  john
10863  * Made axis invert value always be 0 or 1.
10864  *
10865  * Revision 1.40  1994/10/13  20:18:15  john
10866  * Added some more system keys, such as F? and CAPSLOCK.
10867  *
10868  * Revision 1.39  1994/10/13  19:22:29  john
10869  * Added separate config saves for different devices.
10870  * Made all the devices work together better, such as mice won't
10871  * get read when you're playing with the joystick.
10872  *
10873  * Revision 1.38  1994/10/13  15:41:57  mike
10874  * Remove afterburner.
10875
10876 ------------------------------------------------------------------------
10877 main/kconfig.h:
10878
10879  * Revision 1.1  1995/05/16  15:58:27  allender
10880  * Initial revision
10881  *
10882  * Revision 2.0  1995/02/27  11:29:38  john
10883  * New version 2.0, which has no anonymous unions, builds with
10884  * Watcom 10.0, and doesn't require parsing BITMAPS.TBL.
10885  *
10886  * Revision 1.23  1995/01/12  11:41:44  john
10887  * Added external control reading.
10888  *
10889  * Revision 1.22  1994/12/07  16:15:30  john
10890  * Added command to check to see if a joystick axes has been used.
10891  *
10892  * Revision 1.21  1994/11/29  03:46:29  john
10893  * Added joystick sensitivity; Added sound channels to detail menu.  Removed -maxchannels
10894  * command line arg.
10895  *
10896  * Revision 1.20  1994/11/22  16:54:45  mike
10897  * autorepeat on missiles.
10898  *
10899  * Revision 1.19  1994/11/07  14:01:27  john
10900  * Changed the gamma correction sequencing.
10901  *
10902  * Revision 1.18  1994/11/01  16:40:02  john
10903  * Added Gamma correction.
10904  *
10905  * Revision 1.17  1994/10/25  23:09:24  john
10906  * Made the automap key configurable.
10907  *
10908  * Revision 1.16  1994/10/24  19:56:51  john
10909  * Made the new user setup prompt for config options.
10910  *
10911  * Revision 1.15  1994/10/24  17:44:18  john
10912  * Added stereo channel reversing.
10913  *
10914  * Revision 1.14  1994/10/22  13:19:33  john
10915  * Took out toggle primary/secondary weapons.  Fixed black
10916  * background for 'axes' and 'buttons' text.
10917  *
10918  * Revision 1.13  1994/10/17  13:06:51  john
10919  * Moved the descent.cfg info into the player config file.
10920  *
10921  * Revision 1.12  1994/10/14  12:14:47  john
10922  * Changed code so that by doing DEL+F12 saves the current kconfig
10923  * values as default. Added support for drop_bomb key.  Took out
10924  * unused slots for keyboard.  Made keyboard use control_type of 0
10925  * save slots.
10926  *
10927  * Revision 1.11  1994/10/13  19:21:33  john
10928  * Added separate config saves for different devices.
10929  * Made all the devices work together better, such as mice won't
10930  * get read when you're playing with the joystick.
10931  *
10932  * Revision 1.10  1994/10/13  15:18:41  john
10933  * Started ripping out old afterburner, show message, show automap
10934  * keys in the keyboard config stuff.
10935  *
10936  * Revision 1.9  1994/10/13  11:35:27  john
10937  * Made Thrustmaster FCS Hat work.  Put a background behind the
10938  * keyboard configure.  Took out turn_sensitivity.  Changed sound/config
10939  * menu to new menu. Made F6 be calibrate joystick.
10940  *
10941  * Revision 1.8  1994/10/06  14:10:50  matt
10942  * New function reset_cruise()
10943  *
10944  * Revision 1.7  1994/10/03  14:58:25  john
10945  * Added rear_view_down_state so that the rear view can
10946  * work like the automap.
10947  *
10948  * Revision 1.6  1994/09/30  12:37:25  john
10949  * Added midi,digi volume to configuration.
10950  *
10951  * Revision 1.5  1994/09/19  18:49:59  john
10952  * Added switch to disable joystick.
10953  *
10954  * Revision 1.4  1994/09/15  16:11:21  john
10955  * Added support for VFX1 head tracking. Fixed bug with memory over-
10956  * write when using stereo mode.
10957  *
10958  * Revision 1.3  1994/09/12  11:47:38  john
10959  * Made stupid cruise work better.  Make kconfig values get
10960  * read/written to disk.
10961  *
10962  * Revision 1.2  1994/09/10  15:46:55  john
10963  * First version of new keyboard configuration.
10964  *
10965  * Revision 1.1  1994/09/10  13:51:40  john
10966  * Initial revision
10967
10968 ------------------------------------------------------------------------
10969 main/kmatrix.c:
10970
10971  * Revision 1.6  1995/09/24  10:57:48  allender
10972  * made any key move off of kill matrix screen as text indicates it should
10973  *
10974  * Revision 1.5  1995/08/18  08:33:05  allender
10975  * fixed text problem with top level player names
10976  *
10977  * Revision 1.4  1995/07/26  17:03:05  allender
10978  * sort of fixed spacing for mac
10979  *
10980  * Revision 1.3  1995/06/06  15:36:14  allender
10981  * be sure to bitblt to screen inside of kmatrix loop
10982  *
10983  * Revision 1.2  1995/06/02  07:47:15  allender
10984  * removed bogus include files
10985  *
10986  * Revision 1.1  1995/05/16  15:27:07  allender
10987  * Initial revision
10988  *
10989  * Revision 2.3  1995/05/02  17:01:22  john
10990  * Fixed bug with kill list not showing up in VFX mode.
10991  *
10992  * Revision 2.2  1995/03/21  14:38:20  john
10993  * Ifdef'd out the NETWORK code.
10994  *
10995  * Revision 2.1  1995/03/06  15:22:54  john
10996  * New screen techniques.
10997  *
10998  * Revision 2.0  1995/02/27  11:25:56  john
10999  * New version 2.0, which has no anonymous unions, builds with
11000  * Watcom 10.0, and doesn't require parsing BITMAPS.TBL.
11001  *
11002  * Revision 1.19  1995/02/15  14:47:23  john
11003  * Added code to keep track of kills during endlevel.
11004  *
11005  * Revision 1.18  1995/02/08  11:00:06  rob
11006  * Moved string to localized file
11007  *
11008  * Revision 1.17  1995/02/01  23:45:55  rob
11009  * Fixed string.
11010  *
11011  * Revision 1.16  1995/01/30  21:47:11  rob
11012  * Added a line of instructions.
11013  *
11014  * Revision 1.15  1995/01/20  16:58:43  rob
11015  * careless careless careless...
11016  *
11017  *
11018  * Revision 1.14  1995/01/20  13:43:48  rob
11019  * Longer time to view.
11020  *
11021  * Revision 1.13  1995/01/20  13:42:34  rob
11022  * Fixed sorting bug.
11023  *
11024  * Revision 1.12  1995/01/19  17:35:21  rob
11025  * Fixed coloration of player names in team mode.
11026  *
11027  * Revision 1.11  1995/01/16  21:26:15  rob
11028  * Fixed it!!
11029  *
11030  * Revision 1.10  1995/01/16  18:55:41  rob
11031  * Added include of network.h
11032  *
11033  * Revision 1.9  1995/01/16  18:22:35  rob
11034  * Fixed problem with signs.
11035  *
11036  * Revision 1.8  1995/01/12  16:07:51  rob
11037  * ADded sorting before display.
11038  *
11039  * Revision 1.7  1995/01/04  08:46:53  rob
11040  * JOHN CHECKED IN FOR ROB !!!
11041  *
11042  * Revision 1.6  1994/12/09  20:17:20  yuan
11043  * Touched up
11044  *
11045  * Revision 1.5  1994/12/09  19:46:35  yuan
11046  * Localized the sucker.
11047  *
11048  * Revision 1.4  1994/12/09  19:24:58  rob
11049  * Yuan's fix to the centering.
11050  *
11051  * Revision 1.3  1994/12/09  19:02:37  yuan
11052  * Cleaned up a bit.
11053  *
11054  * Revision 1.2  1994/12/09  16:19:46  yuan
11055  * kill matrix stuff.
11056  *
11057  * Revision 1.1  1994/12/09  15:08:58  yuan
11058  * Initial revision
11059
11060 ------------------------------------------------------------------------
11061 main/kmatrix.h:
11062
11063  * Revision 1.1  1995/05/16  15:58:35  allender
11064  * Initial revision
11065  *
11066  * Revision 2.0  1995/02/27  11:28:51  john
11067  * New version 2.0, which has no anonymous unions, builds with
11068  * Watcom 10.0, and doesn't require parsing BITMAPS.TBL.
11069  *
11070  * Revision 1.3  1995/02/15  14:47:39  john
11071  * Added code to keep track of kills during endlevel.
11072  *
11073  * Revision 1.2  1994/12/09  16:19:46  yuan
11074  * kill matrix stuff.
11075  *
11076  * Revision 1.1  1994/12/09  15:58:33  yuan
11077  * Initial revision
11078
11079 ------------------------------------------------------------------------
11080 main/laser.c:
11081
11082  * Revision 1.1  1993/11/29  17:19:02  john
11083  * Initial revision
11084
11085 ------------------------------------------------------------------------
11086 main/laser.h:
11087
11088  * Revision 1.1  1995/05/16  15:58:43  allender
11089  * Initial revision
11090  *
11091  * Revision 2.0  1995/02/27  11:32:27  john
11092  * New version 2.0, which has no anonymous unions, builds with
11093  * Watcom 10.0, and doesn't require parsing BITMAPS.TBL.
11094  *
11095  * Revision 1.50  1995/02/01  21:03:44  john
11096  * Lintified.
11097  *
11098  * Revision 1.49  1995/02/01  16:34:11  john
11099  * Linted.
11100  *
11101  * Revision 1.48  1995/01/31  16:16:16  mike
11102  * Separate smart blobs for robot and player.
11103  *
11104  * Revision 1.47  1995/01/27  17:02:55  mike
11105  * Add LASER_ID -- why wasn't this added in June?
11106  *
11107  * Revision 1.46  1995/01/25  10:53:27  mike
11108  * make badass damage go through grates.
11109  *
11110  * Revision 1.45  1994/12/12  17:17:32  mike
11111  * make boss cloak/teleport when get hit, make quad laser 3/4 as powerful.
11112  *
11113  * Revision 1.44  1994/12/04  16:17:23  mike
11114  * spruce up homing missile behavior.
11115  *
11116  * Revision 1.43  1994/12/03  12:48:30  mike
11117  * make homing missile tracking not frame rate dependent (more-or-less)
11118  *
11119  * Revision 1.42  1994/10/12  08:04:54  mike
11120  * Clean up proximity/homing mess.
11121  *
11122  * Revision 1.41  1994/10/09  20:07:04  rob
11123  * Change prototype for do_laser_firing
11124  *
11125  * Revision 1.40  1994/10/09  00:15:48  mike
11126  * Add constants for super mech missile, regular mech missile, silent spreadfire.
11127  *
11128  * Revision 1.39  1994/10/08  19:52:09  rob
11129  * Added new weapon fire flags.
11130  *
11131  * Revision 1.38  1994/10/07  15:31:12  mike
11132  * Prototypes for new laser functions which don't necessarily make sound.
11133  *
11134  * Revision 1.37  1994/10/05  17:08:29  matt
11135  * Fixed a couple of small bugs, and made homing missiles alternate sides
11136  *
11137  * Revision 1.36  1994/09/28  14:28:55  rob
11138  * Added firing of missiles on networks/serial.
11139  *
11140  * Revision 1.35  1994/09/24  14:17:02  mike
11141  * Prototype do_laser_firing.
11142  *
11143  * Revision 1.34  1994/09/23  11:36:49  mike
11144  * Prototype Laser_create_new_easy.
11145  *
11146  * Revision 1.33  1994/09/20  11:55:01  mike
11147  * Fix bug.
11148  *
11149  * Revision 1.32  1994/09/20  11:48:34  mike
11150  * Change spreadfire laser to use new bitmap. (Define SPREADFIRE_ID)
11151  *
11152  * Revision 1.31  1994/09/15  16:31:28  mike
11153  * Prototype object_to_object_visibility.
11154  *
11155  * Revision 1.30  1994/09/10  17:31:40  mike
11156  * Add thrust to weapons.
11157  *
11158  * Revision 1.29  1994/09/08  14:49:44  mike
11159  * Bunch of IDs for new weapon types.
11160  *
11161  * Revision 1.28  1994/09/07  19:16:40  mike
11162  * Homing missile.
11163  *
11164  * Revision 1.27  1994/09/07  15:59:47  mike
11165  * Kill FLARE_MAX_TIME (now defined in bitmaps.tbl), add PROXIMITY_ID (shame!), prototype do_laser_firing, do_missile_firing.
11166  *
11167  * Revision 1.26  1994/09/03  15:22:41  mike
11168  * Kill Projectile_player_fire prototype.
11169  *
11170  * Revision 1.25  1994/09/02  16:39:00  mike
11171  * IDs for primary weapons.
11172  *
11173  * Revision 1.24  1994/09/02  11:55:54  mike
11174  * Define some illegal constants.
11175  *
11176  * Revision 1.23  1994/08/25  18:12:06  matt
11177  * Made player's weapons and flares fire from the positions on the 3d model.
11178  * Also added support for quad lasers.
11179  *
11180  * Revision 1.22  1994/08/19  15:22:28  mike
11181  * Define constant for MAX_LASER_LEVEL.
11182  *
11183  * Revision 1.21  1994/08/13  12:20:47  john
11184  * Made the networking uise the Players array.
11185  *
11186  * Revision 1.20  1994/08/10  10:44:05  john
11187  * Made net players fire..
11188  *
11189  * Revision 1.19  1994/06/27  18:30:57  mike
11190  * Add flares.
11191  *
11192  * Revision 1.18  1994/06/09  15:32:37  mike
11193  * Muzzle flash
11194  *
11195  * Revision 1.17  1994/05/19  09:09:00  mike
11196  * Move a bunch of laser variables to bm.h, I think.
11197  * Also, added Robot_laser_speed, instead of hard-coding Laser_speed/4.
11198  *
11199  * Revision 1.16  1994/05/14  17:16:20  matt
11200  * Got rid of externs in source (non-header) files
11201  *
11202  * Revision 1.15  1994/05/13  20:27:39  john
11203  * Version II of John's new object code.
11204  *
11205  * Revision 1.14  1994/04/20  15:06:47  john
11206  * Neatend laser code and fixed some laser bugs.
11207  *
11208  * Revision 1.13  1994/04/01  13:35:15  matt
11209  * Cleaned up laser code a bit; moved some code here object.c to laser.c
11210  *
11211  * Revision 1.12  1994/04/01  11:14:24  yuan
11212  * Added multiple bitmap functionality to all objects...
11213  * (hostages, powerups, lasers, etc.)
11214  * Hostages and powerups are implemented in the object system,
11215  * just need to finish function call to "affect" player.
11216  *
11217  * Revision 1.11  1994/03/31  09:10:09  matt
11218  * Added #define to turn crosshair off
11219  *
11220  * Revision 1.10  1994/02/17  11:33:15  matt
11221  * Changes in object system
11222  *
11223  * Revision 1.9  1994/01/06  11:56:01  john
11224  * Made lasers be lines, not purple blobs
11225  *
11226  * Revision 1.8  1994/01/05  10:53:35  john
11227  * New object code by John.
11228  *
11229  * Revision 1.7  1993/12/08  14:21:36  john
11230  * Added ExplodeObject
11231  *
11232  * Revision 1.6  1993/12/08  11:28:54  john
11233  * Made lasers look like bolts.
11234  *
11235  * Revision 1.5  1993/12/01  13:12:40  john
11236  * made lasers frame-rate independant
11237  *
11238  * Revision 1.4  1993/11/30  19:00:42  john
11239  * lasers working kinda
11240  *
11241  * Revision 1.3  1993/11/29  19:44:53  john
11242  * *** empty log message ***
11243  *
11244  * Revision 1.2  1993/11/29  17:44:55  john
11245  * *** empty log message ***
11246  *
11247  * Revision 1.1  1993/11/29  17:19:19  john
11248  * Initial revision
11249
11250 ------------------------------------------------------------------------
11251 main/lighting.c:
11252
11253  * Revision 1.4  1995/09/20  14:26:12  allender
11254  * more optimizations(?) ala MK
11255  *
11256  * Revision 1.2  1995/07/05  21:27:31  allender
11257  * new and improved lighting code by MK!
11258  *
11259  * Revision 2.1  1995/07/24  13:21:56  john
11260  * Added new lighting calculation code to speed things up.
11261  *
11262  * Revision 2.0  1995/02/27  11:27:33  john
11263  * New version 2.0, which has no anonymous unions, builds with
11264  * Watcom 10.0, and doesn't require parsing BITMAPS.TBL.
11265  *
11266  * Revision 1.43  1995/02/22  13:57:10  allender
11267  * remove anonymous union from object structure
11268  *
11269  * Revision 1.42  1995/02/13  20:35:07  john
11270  * Lintized
11271  *
11272  * Revision 1.41  1995/02/04  21:43:40  matt
11273  * Changed an assert() to an int3() and deal with the bad case
11274  *
11275  * Revision 1.40  1995/01/15  20:48:27  mike
11276  * support light field for powerups.
11277  *
11278  * Revision 1.39  1994/12/15  13:04:19  mike
11279  * Replace Players[Player_num].time_total references with GameTime.
11280  *
11281  * Revision 1.38  1994/11/28  21:50:41  mike
11282  * optimizations.
11283  *
11284  * Revision 1.37  1994/11/28  01:32:33  mike
11285  * lighting optimization.
11286  *
11287  * Revision 1.36  1994/11/15  12:01:00  john
11288  * Changed a bunch of code that uses timer_get_milliseconds to
11289  * timer_get_fixed_Seconds.
11290  *
11291  * Revision 1.35  1994/10/31  21:56:07  matt
11292  * Fixed bug & added error checking
11293  *
11294  * Revision 1.34  1994/10/21  11:24:57  mike
11295  * Trap divide overflows in lighting.
11296  *
11297  * Revision 1.33  1994/10/08  14:49:11  matt
11298  * If viewer changed, don't do smooth lighting hack
11299  *
11300  * Revision 1.32  1994/09/25  23:41:07  matt
11301  * Changed the object load & save code to read/write the structure fields one
11302  * at a time (rather than the whole structure at once).  This mean that the
11303  * object structure can be changed without breaking the load/save functions.
11304  * As a result of this change, the local_object data can be and has been
11305  * incorporated into the object array.  Also, timeleft is now a property
11306  * of all objects, and the object structure has been otherwise cleaned up.
11307  *
11308  * Revision 1.31  1994/09/25  15:45:15  matt
11309  * Added OBJ_LIGHT, a type of object that casts light
11310  * Added generalized lifeleft, and moved it to local_object
11311  *
11312  * Revision 1.30  1994/09/11  15:48:27  mike
11313  * Use vm_vec_mag_quick in place of vm_vec_mag in point_dist computation.
11314  *
11315  * Revision 1.29  1994/09/08  21:44:49  matt
11316  * Made lighting ramp 4x as fast; made only static (ambient) light ramp
11317  * up, but not headlight & dynamic light
11318  *
11319  * Revision 1.28  1994/09/02  14:00:07  matt
11320  * Simplified explode_object() & mutliple-stage explosions
11321  *
11322  * Revision 1.27  1994/08/29  19:06:44  mike
11323  * Make lighting proportional to square of distance, not linear.
11324  *
11325  * Revision 1.26  1994/08/25  18:08:38  matt
11326  * Made muzzle flash cast 3x as much light
11327  *
11328  * Revision 1.25  1994/08/23  16:38:31  mike
11329  * Key weapon light off bitmaps.tbl.
11330  *
11331  * Revision 1.24  1994/08/13  12:20:44  john
11332  * Made the networking uise the Players array.
11333  *
11334  * Revision 1.23  1994/08/12  22:42:18  john
11335  * Took away Player_stats; added Players array.
11336  *
11337  * Revision 1.22  1994/07/06  10:19:22  matt
11338  * Changed include
11339  *
11340  * Revision 1.21  1994/06/28  13:20:22  mike
11341  * Oops, fixed a dumb typo.
11342  *
11343  * Revision 1.20  1994/06/28  12:53:25  mike
11344  * Change lighting function for flares, make brighter and asynchronously flicker.
11345  *
11346  * Revision 1.19  1994/06/27  18:31:15  mike
11347  * Add flares.
11348  *
11349  * Revision 1.18  1994/06/20  13:41:17  matt
11350  * Added time-based gradual lighting hack for objects
11351  * Took out strobing robots
11352  *
11353  * Revision 1.17  1994/06/19  16:25:54  mike
11354  * Optimize lighting.
11355  *
11356  * Revision 1.16  1994/06/17  18:08:08  mike
11357  * Make robots cast more and variable light.
11358  *
11359  * Revision 1.15  1994/06/13  15:15:55  mike
11360  * Fix phantom light, every 64K milliseconds, muzzle flash would flash again.
11361
11362 ------------------------------------------------------------------------
11363 main/lighting.h:
11364
11365  * Revision 1.1  1995/05/16  15:58:51  allender
11366  * Initial revision
11367  *
11368  * Revision 2.0  1995/02/27  11:27:52  john
11369  * New version 2.0, which has no anonymous unions, builds with
11370  * Watcom 10.0, and doesn't require parsing BITMAPS.TBL.
11371  *
11372  * Revision 1.6  1994/11/28  21:50:56  mike
11373  * optimizations.
11374  *
11375  * Revision 1.5  1994/06/07  16:51:58  matt
11376  * Made object lighting work correctly; changed name of Ambient_light to
11377  * Dynamic_light; cleaned up polygobj object rendering a little.
11378  *
11379  * Revision 1.4  1994/05/31  18:41:35  matt
11380  * Added comments
11381  *
11382  * Revision 1.3  1994/05/23  15:00:08  mike
11383  * Change MIN_LIGHT_DIST.
11384  *
11385  * Revision 1.2  1994/05/22  15:30:09  mike
11386  * First version.
11387  *
11388  * Revision 1.1  1994/05/22  15:16:44  mike
11389  * Initial revision
11390
11391 ------------------------------------------------------------------------
11392 main/menu.h:
11393
11394  * Revision 1.1  1995/05/16  15:59:14  allender
11395  * Initial revision
11396  *
11397  * Revision 2.1  1995/03/06  16:47:41  mike
11398  * destination saturn
11399  *
11400  * Revision 2.0  1995/02/27  11:29:47  john
11401  * New version 2.0, which has no anonymous unions, builds with
11402  * Watcom 10.0, and doesn't require parsing BITMAPS.TBL.
11403  *
11404  * Revision 1.34  1994/12/12  00:16:16  john
11405  * Added auto-leveling flag.
11406  *
11407  * Revision 1.33  1994/12/07  20:04:26  mike
11408  * set Max_debris_objects.
11409  *
11410  * Revision 1.32  1994/11/14  17:23:19  rob
11411  * ADded extern for default difficulty settings.
11412  *
11413  * Revision 1.31  1994/11/10  11:08:29  mike
11414  * detail level stuff.
11415  *
11416  * Revision 1.30  1994/11/05  14:05:53  john
11417  * Fixed fade transitions between all screens by making gr_palette_fade_in and out keep
11418  * track of whether the palette is faded in or not.  Then, wherever the code needs to fade out,
11419  * it just calls gr_palette_fade_out and it will fade out if it isn't already.  The same with fade_in.
11420  * This eliminates the need for all the flags like Menu_fade_out, game_fade_in palette, etc.
11421  *
11422  * Revision 1.29  1994/11/02  11:59:44  john
11423  * Moved menu out of game into inferno main loop.
11424  *
11425  * Revision 1.28  1994/10/17  20:30:59  john
11426  * Made the text for the difficulty labels global so that
11427  * the high score screen can print "rookie" or whatever.
11428  *
11429  * Revision 1.27  1994/10/04  10:47:09  matt
11430  * Made main menu remember selected item
11431  *
11432  * Revision 1.26  1994/08/10  19:55:19  john
11433  * Changed font stuff; Took out old menu; messed up lots of
11434  * other stuff like game sequencing messages, etc.
11435  *
11436  * Revision 1.25  1994/06/23  18:54:09  matt
11437  * Cleaned up game start/menu interaction, and improved main menu a little
11438  *
11439  * Revision 1.24  1994/06/21  12:11:50  yuan
11440  * Fixed up menus and added HUDisplay messages.
11441  *
11442  * Revision 1.23  1994/06/20  23:15:16  yuan
11443  * Color switching capability for the menus.
11444  *
11445  * Revision 1.22  1994/06/20  22:02:25  yuan
11446  * Made menu GREEN by POPULAR DEMAND!!
11447  *
11448  * Revision 1.21  1994/06/20  21:05:48  yuan
11449  * Fixed up menus.
11450  *
11451  * Revision 1.20  1994/06/20  19:19:29  yuan
11452  * Tidied up the menu and the "message blocks" between levels, etc.
11453  *
11454  * Revision 1.19  1994/06/17  18:01:10  john
11455  * A bunch of new stuff by John
11456  *
11457  * Revision 1.18  1994/05/16  09:37:22  matt
11458  * Got rid of global continue_flag
11459  *
11460  * Revision 1.17  1994/05/14  17:14:51  matt
11461  * Got rid of externs in source (non-header) files
11462  *
11463  * Revision 1.16  1994/05/10  12:14:26  yuan
11464  * Game save/load... Demo levels 1-5 added...
11465  * High scores fixed...
11466  *
11467  * Revision 1.15  1994/05/05  09:21:21  yuan
11468  * *** empty log message ***
11469  *
11470  * Revision 1.14  1994/04/29  14:55:40  mike
11471  * Change some menu colors.
11472  *
11473  * Revision 1.13  1994/04/28  18:04:36  yuan
11474  * Gamesave added.
11475  * Trigger problem fixed (seg pointer is replaced by index now.)
11476  *
11477  * Revision 1.12  1994/02/18  11:55:01  yuan
11478  * Fixed menu to be called from game.
11479  *
11480  * Revision 1.11  1994/02/10  17:45:39  yuan
11481  * Integrated some hacks which still need to be fixed.
11482  *
11483  * Revision 1.10  1994/02/01  22:50:23  yuan
11484  * Final menu version for demo
11485  *
11486  * Revision 1.9  1994/02/01  11:50:17  yuan
11487  * Moved quit message down just a tiny bit
11488  *
11489  * Revision 1.8  1994/01/31  17:30:16  yuan
11490  * Fixed quit not disappearing problem
11491  *
11492  * Revision 1.7  1994/01/31  12:25:20  yuan
11493  * New menu stuff
11494  *
11495  * Revision 1.6  1994/01/26  13:14:04  john
11496  * *** empty log message ***
11497  *
11498  * Revision 1.5  1993/12/29  16:44:44  yuan
11499  * Added some function definitions
11500  *
11501  * Revision 1.4  1993/12/13  18:53:12  yuan
11502  * Fixed dependency problem
11503  *
11504  * Revision 1.3  1993/12/12  13:53:51  yuan
11505  * Added menu and -g flag
11506  *
11507  * Revision 1.2  1993/12/10  16:07:17  yuan
11508  * Working on menu system.  Updated the title screen.
11509  *
11510  * Revision 1.1  1993/12/10  12:45:27  yuan
11511  * Initial revision
11512
11513 ------------------------------------------------------------------------
11514 main/mglobal.c:
11515
11516  * Revision 1.1  1995/12/05  16:03:10  allender
11517  * Initial revision
11518  *
11519  * Revision 1.3  1995/10/10  11:49:41  allender
11520  * removed malloc of static data now in ai module
11521  *
11522  * Revision 1.2  1995/07/12  12:48:52  allender
11523  * malloc out edge_list global here, not static in automap.c
11524  *
11525  * Revision 1.1  1995/05/16  15:27:40  allender
11526  * Initial revision
11527  *
11528  * Revision 2.2  1995/03/14  18:24:37  john
11529  * Force Destination Saturn to use CD-ROM drive.
11530  *
11531  * Revision 2.1  1995/03/06  16:47:23  mike
11532  * destination saturn
11533  *
11534  * Revision 2.0  1995/02/27  11:30:00  john
11535  * New version 2.0, which has no anonymous unions, builds with
11536  * Watcom 10.0, and doesn't require parsing BITMAPS.TBL.
11537  *
11538  * Revision 1.43  1995/01/19  17:00:53  john
11539  * Made save game work between levels.
11540  *
11541  * Revision 1.42  1994/12/05  14:23:53  adam
11542  * changed default detail to max, not custom
11543  *
11544  * Revision 1.41  1994/11/19  15:15:07  mike
11545  * remove unused code and data
11546  *
11547  * Revision 1.40  1994/11/03  10:13:19  yuan
11548  * Added #include "game.h"
11549  *
11550  * Revision 1.39  1994/11/03  10:09:59  matt
11551  * Properly initialize detail & difficulty levels
11552  *
11553  * Revision 1.38  1994/10/30  14:11:21  mike
11554  * rip out local segments stuff.
11555  *
11556  * Revision 1.37  1994/10/26  15:21:30  mike
11557  * detail level.
11558  *
11559  * Revision 1.36  1994/09/22  10:46:12  mike
11560  * Add difficulty levels.
11561  *
11562  * Revision 1.35  1994/09/13  11:19:11  mike
11563  * Add Next_missile_fire_time.
11564  *
11565  * Revision 1.34  1994/08/31  19:25:34  mike
11566  * GameTime and laser-firing limiting stuff added.
11567  *
11568  * Revision 1.33  1994/08/11  18:58:53  mike
11569  * Add Side_to_verts_int.
11570  *
11571  * Revision 1.32  1994/07/21  19:01:38  mike
11572  * Add Lsegment.
11573  *
11574  * Revision 1.31  1994/07/21  13:11:24  matt
11575  * Ripped out remants of old demo system, and added demo only system that
11576  * disables object movement and game options from menu.
11577  *
11578  * Revision 1.30  1994/06/17  18:06:48  matt
11579  * Made password be treated as lowercase, since cmdline parsing converts
11580  * everything to lowercase.
11581  *
11582  * Revision 1.29  1994/03/15  16:33:04  yuan
11583  * Cleaned up bm-loading code.
11584  * (Fixed structures too)
11585  *
11586  * Revision 1.28  1994/02/17  11:32:45  matt
11587  * Changes in object system
11588  *
11589  * Revision 1.27  1994/02/16  17:08:43  matt
11590  * Added needed include of 3d.h
11591  *
11592  * Revision 1.26  1994/02/16  13:47:58  mike
11593  * fix bugs so editor can compile out.
11594  *
11595  * Revision 1.25  1994/02/11  21:52:13  matt
11596  * Made password protection selectable by #define (and thus INFERNO.INI)
11597  *
11598  * Revision 1.24  1994/02/10  15:35:56  matt
11599  * Various changes to make editor compile out.
11600  *
11601  * Revision 1.23  1994/02/02  12:34:29  mike
11602  * take out BATS encryption.
11603  *
11604  * Revision 1.22  1994/01/21  16:08:11  matt
11605  * Added FrameCount variable
11606  *
11607  * Revision 1.21  1994/01/06  17:13:10  john
11608  * Added Video clip functionality
11609  *
11610  * Revision 1.20  1993/12/08  17:45:08  matt
11611  * Changed password again
11612  *
11613  * Revision 1.19  1993/12/08  17:41:05  matt
11614  * Changed password
11615  *
11616  * Revision 1.18  1993/12/08  10:55:10  mike
11617  * Add free_obj_list
11618  *
11619  * Revision 1.17  1993/12/07  13:46:38  john
11620  * Added Explosion bitmap array
11621  *
11622  * Revision 1.16  1993/12/06  18:40:35  matt
11623  * Changed object loading & handling
11624  *
11625  * Revision 1.15  1993/12/05  22:47:48  matt
11626  * Reworked include files in an attempt to cut down on build times
11627  *
11628  * Revision 1.14  1993/12/01  11:44:11  matt
11629  * Chagned Frfract to FrameTime
11630  *
11631  * Revision 1.13  1993/12/01  00:27:11  yuan
11632  * Implemented new bitmap structure system...
11633  * overall bitmap scheme still needs some work.
11634  *
11635  * Revision 1.12  1993/11/19  17:21:59  matt
11636  * Changed the bitmap number of object class UNICLASS
11637  * Removed static initialization for objects
11638  *
11639  * Revision 1.11  1993/11/18  13:51:47  mike
11640  * Add Classes, Class_views, Objects
11641  *
11642  * Revision 1.10  1993/11/04  18:52:36  matt
11643  * Made Vertices[] and Segment_points[] use same constant for size, since
11644  * they must be the same size anyway
11645  *
11646  * Revision 1.9  1993/11/04  14:01:06  matt
11647  * Mucked with include files
11648  *
11649  * Revision 1.8  1993/10/26  13:58:42  mike
11650  * Add password protection.
11651  *
11652  * Revision 1.7  1993/10/14  18:05:50  mike
11653  * Change Side_to_verts to use MAX_SIDES_PER_SEGMENT in place of CONNECTIVITY
11654  *
11655  * Revision 1.6  1993/10/12  13:57:19  john
11656  * added texture[]
11657  *
11658  * Revision 1.5  1993/10/12  09:58:15  mike
11659  * Move Side_to_verts here from eglobal.c, since it is needed in the game.
11660  *
11661  * Revision 1.4  1993/10/09  15:52:30  mike
11662  * Move test_pos, test_orient here from render.c.
11663  *
11664  * Revision 1.3  1993/10/02  18:15:45  mike
11665  * Killed include of segment.h, which gets included by inferno.h.
11666  *
11667  * Revision 1.2  1993/09/23  17:54:24  mike
11668  * Add Segment_points
11669  *
11670  * Revision 1.1  1993/09/23  15:01:50  mike
11671  * Initial revision
11672
11673 ------------------------------------------------------------------------
11674 main/mission.c:
11675
11676  * Revision 1.4  1995/10/31  10:21:40  allender
11677  * no mission support in shareware
11678  *
11679  * Revision 1.3  1995/10/21  22:53:04  allender
11680  * moved missions to data folder
11681  *
11682  * Revision 1.2  1995/09/13  08:47:29  allender
11683  * made to work with Chris' direct stuff
11684  *
11685  * Revision 1.1  1995/05/16  15:27:48  allender
11686  * Initial revision
11687  *
11688  * Revision 2.9  1995/05/26  16:16:32  john
11689  * Split SATURN into define's for requiring cd, using cd, etc.
11690  * Also started adding all the Rockwell stuff.
11691  *
11692  * Revision 2.8  1995/03/20  15:49:31  mike
11693  * Remove eof char from comment which confused make depend, causing
11694  * no mission.obj: line in makefile.  Pretty stupid tool, huh?
11695  *
11696  * Revision 2.7  1995/03/20  12:12:11  john
11697  * Added ifdef SATURN.
11698  *
11699  * Revision 2.6  1995/03/15  14:32:49  john
11700  * Added code to force the Descent CD-rom in the drive.
11701  *
11702  * Revision 2.5  1995/03/15  11:41:15  john
11703  * Better Saturn CD-ROM support.
11704  *
11705  * Revision 2.4  1995/03/14  18:24:14  john
11706  * Force Destination Saturn to use CD-ROM drive.
11707  *
11708  * Revision 2.3  1995/03/07  14:19:41  mike
11709  * More destination saturn stuff.
11710  *
11711  * Revision 2.2  1995/03/06  23:09:03  mike
11712  * more saturn stuff: make briefings work for saturn mission.
11713  *
11714  * Revision 2.1  1995/03/06  16:47:48  mike
11715  * destination saturn
11716  *
11717  * Revision 2.0  1995/02/27  11:27:49  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.14  1995/02/15  11:30:37  john
11722  * Fixed bug with potential mem overwrite on line 160.
11723  *
11724  * Revision 1.13  1995/02/10  17:53:20  matt
11725  * Changed mission name again
11726  *
11727  * Revision 1.12  1995/02/10  17:35:38  matt
11728  * Changed name of built-in mission
11729  *
11730  * Revision 1.11  1995/02/07  17:13:51  allender
11731  * removed return statement in load_mission so that built in mission will
11732  * actually set the Current_mission_name and _filename
11733  *
11734  * Revision 1.10  1995/01/31  01:19:45  matt
11735  * Made build_mission_list() sort missions by name
11736  *
11737  * Revision 1.9  1995/01/30  13:49:58  allender
11738  * changed build_mission_list in load_mission_by_name to include
11739  * anarchy levels.
11740  *
11741  * Revision 1.8  1995/01/30  13:03:51  matt
11742  * Fixed dumb mistake
11743  *
11744  * Revision 1.7  1995/01/30  12:55:22  matt
11745  * Added vars to point to mission names
11746  *
11747  * Revision 1.6  1995/01/22  18:57:28  matt
11748  * Made player highest level work with missions
11749  *
11750  * Revision 1.5  1995/01/22  14:13:08  matt
11751  * Added flag in mission list for anarchy-only missions
11752  *
11753  * Revision 1.4  1995/01/21  23:13:12  matt
11754  * Made high scores with (not work, really) with loaded missions
11755  * Don't give player high score when quit game
11756  *
11757  * Revision 1.3  1995/01/21  16:27:12  matt
11758  * Made endlevel briefing work with missions
11759  *
11760  * Revision 1.2  1995/01/20  22:47:50  matt
11761  * Mission system implemented, though imcompletely
11762  *
11763  * Revision 1.1  1995/01/20  13:42:19  matt
11764  * Initial revision
11765
11766 ------------------------------------------------------------------------
11767 main/mission.h:
11768
11769  * Revision 1.1  1995/05/16  15:59:22  allender
11770  * Initial revision
11771  *
11772  * Revision 2.0  1995/02/27  11:31:35  john
11773  * New version 2.0, which has no anonymous unions, builds with
11774  * Watcom 10.0, and doesn't require parsing BITMAPS.TBL.
11775  *
11776  * Revision 1.6  1995/01/30  12:55:41  matt
11777  * Added vars to point to mission names
11778  *
11779  * Revision 1.5  1995/01/22  18:57:21  matt
11780  * Made player highest level work with missions
11781  *
11782  * Revision 1.4  1995/01/22  14:13:21  matt
11783  * Added flag in mission list for anarchy-only missions
11784  *
11785  * Revision 1.3  1995/01/21  23:13:12  matt
11786  * Made high scores with (not work, really) with loaded missions
11787  * Don't give player high score when quit game
11788  *
11789  * Revision 1.2  1995/01/20  22:47:53  matt
11790  * Mission system implemented, though imcompletely
11791  *
11792  * Revision 1.1  1995/01/20  13:42:26  matt
11793  * Initial revision
11794
11795 ------------------------------------------------------------------------
11796 main/modem.h:
11797
11798  * Revision 1.2  1995/09/05  14:06:40  allender
11799  * checkpoint again
11800  *
11801  * Revision 1.1  1995/05/16  15:59:29  allender
11802  * Initial revision
11803  *
11804  * Revision 2.1  1995/03/21  14:40:38  john
11805  * Ifdef'd out the NETWORK code.
11806  *
11807  * Revision 2.0  1995/02/27  11:31:34  john
11808  * New version 2.0, which has no anonymous unions, builds with
11809  * Watcom 10.0, and doesn't require parsing BITMAPS.TBL.
11810  *
11811  * Revision 1.18  1994/11/22  17:12:05  rob
11812  * Starting working on secret level fix for modem games.
11813  *
11814  * Revision 1.17  1994/11/17  16:43:17  rob
11815  * Added prototype for com_level_sync function.
11816  *
11817  * Revision 1.16  1994/11/15  21:30:32  rob
11818  * Added prototype for new menu hook.
11819  *
11820  * Revision 1.15  1994/10/07  16:15:33  rob
11821  * Changed calls to multi_send_position.
11822  *
11823  * Revision 1.14  1994/10/07  12:52:24  rob
11824  * Fixed some problems.
11825  *
11826  * Revision 1.13  1994/10/07  11:25:47  rob
11827  * Tried to fix modem to work with new multi stuff.  Still a bit jacked up, tho.
11828  *
11829  * Revision 1.12  1994/10/05  19:14:50  rob
11830  * Exported macros and arrays to support network object mapping.
11831  *
11832  * Revision 1.11  1994/10/05  17:48:59  rob
11833  * Several changes, most to end_of_level sequencing.
11834  *
11835  * Revision 1.10  1994/10/05  14:22:54  rob
11836  * Added com_end_level.
11837  *
11838  * Revision 1.9  1994/09/30  18:37:22  rob
11839  * Another day's worth of work.  Mostly menus, error checking.  Added
11840  * level checksums during sync, carrier detect during all com calls,
11841  * generic com_abort() procedure for bailing out, and nm_messagebox
11842  * handling of QUIT instead of HUD message (which never gets seen).
11843  *
11844  * Revision 1.8  1994/09/29  20:55:16  rob
11845  * Lots of changes.
11846  *
11847  * Revision 1.7  1994/09/29  16:09:20  rob
11848  * Added explode stuff.
11849  *
11850  * Revision 1.6  1994/09/28  14:31:08  rob
11851  * Added serial setup menu.
11852  *
11853  * Revision 1.5  1994/09/27  15:02:49  rob
11854  * Null modem basic routines working.  Sending DEAD messages and
11855  * missiles still need to be done.
11856  *
11857  * Revision 1.4  1994/09/24  16:52:33  rob
11858  * Added stubbed funcs for startup and stop of serial games.
11859  *
11860  * Revision 1.3  1994/09/24  14:47:31  rob
11861  * New function protos.
11862  *
11863  * Revision 1.2  1994/09/22  17:53:29  rob
11864  * First revision, not yet functional.
11865  *
11866  * Revision 1.1  1994/09/22  12:39:25  rob
11867  * Initial revision
11868
11869 ------------------------------------------------------------------------
11870 main/morph.c:
11871
11872  * Revision 1.5  1995/08/23  21:36:10  allender
11873  * mcc compiler warnings fixed
11874  *
11875  * Revision 1.4  1995/08/12  11:34:19  allender
11876  * removed #ifdef NEWDEMO -- always in
11877  *
11878  * Revision 1.3  1995/07/28  15:39:51  allender
11879  * removed fixdiv thing
11880  *
11881  * Revision 1.2  1995/07/28  15:21:23  allender
11882  * inverse magnitude fixup thing
11883  *
11884  * Revision 1.1  1995/05/16  15:28:05  allender
11885  * Initial revision
11886  *
11887  * Revision 2.1  1995/02/27  18:26:33  john
11888  * Fixed bug that was caused by externing Polygon_models, and I had
11889  * changed the type of it in polyobj.c, thus causing page faults.
11890  *
11891  * Revision 2.0  1995/02/27  11:27:44  john
11892  * New version 2.0, which has no anonymous unions, builds with
11893  * Watcom 10.0, and doesn't require parsing BITMAPS.TBL.
11894  *
11895  * Revision 1.35  1995/02/22  14:45:37  allender
11896  * remove anonymous unions from object structure
11897  *
11898  * Revision 1.34  1995/01/14  19:16:52  john
11899  * First version of new bitmap paging code.
11900  *
11901  * Revision 1.33  1995/01/03  20:38:36  john
11902  * Externed MAX_MORPH_OBJECTS
11903  *
11904  * Revision 1.32  1994/11/17  15:34:04  matt
11905  * Attempt #4 to fix morph bug
11906  *
11907  * Revision 1.31  1994/11/15  10:57:14  matt
11908  * Tried again to fix morph
11909  *
11910  * Revision 1.30  1994/11/14  14:06:45  matt
11911  * Fixed stupid bug
11912  *
11913  * Revision 1.29  1994/11/14  11:55:13  matt
11914  * Added divide overflow check
11915  *
11916  * Revision 1.28  1994/09/26  17:28:14  matt
11917  * Made new multiple-object morph code work with the demo system
11918  *
11919  * Revision 1.27  1994/09/26  15:39:56  matt
11920  * Allow multiple simultaneous morphing objects
11921  *
11922  * Revision 1.26  1994/09/11  22:44:59  mike
11923  * quick on vecmat function.
11924  *
11925  * Revision 1.25  1994/08/26  15:36:00  matt
11926  * Made eclips usable on more than one object at a time
11927  *
11928  * Revision 1.24  1994/07/25  00:02:46  matt
11929  * Various changes to accomodate new 3d, which no longer takes point numbers
11930  * as parms, and now only takes pointers to points.
11931  *
11932  * Revision 1.23  1994/07/12  12:39:58  matt
11933  * Revamped physics system
11934  *
11935  * Revision 1.22  1994/06/28  11:54:51  john
11936  * Made newdemo system record/play directly to/from disk, so
11937  * we don't need the 4 MB buffer anymore.
11938  *
11939  * Revision 1.21  1994/06/27  15:53:01  john
11940  * #define'd out the newdemo stuff
11941  *
11942  *
11943  * Revision 1.20  1994/06/16  14:30:19  matt
11944  * Moved morph record data call to reder routine
11945  *
11946  * Revision 1.19  1994/06/16  13:57:23  matt
11947  * Added support for morphing objects in demos
11948  *
11949  * Revision 1.18  1994/06/16  12:24:23  matt
11950  * Made robot lighting not mess with Lighting_on so robots now night
11951  * according to this variable.
11952  *
11953  * Revision 1.17  1994/06/14  16:55:01  matt
11954  * Got rid of physics_object speed field
11955  *
11956  * Revision 1.16  1994/06/08  21:16:29  matt
11957  * Made objects spin while morphing
11958  *
11959  * Revision 1.15  1994/06/08  18:21:53  matt
11960  * Made morphing objects light correctly
11961  *
11962  * Revision 1.14  1994/06/07  16:50:49  matt
11963  * Made object lighting work correctly; changed name of Ambient_light to
11964  * Dynamic_light; cleaned up polygobj object rendering a little.
11965  *
11966  * Revision 1.13  1994/06/01  16:33:59  yuan
11967  * Fixed bug.
11968  *
11969  *
11970  * Revision 1.12  1994/06/01  16:29:08  matt
11971  * If morph_frame called on object this isn't the morph object, kill it.
11972  *
11973  * Revision 1.11  1994/06/01  12:46:34  matt
11974  * Added needed include
11975  *
11976  * Revision 1.10  1994/05/31  22:12:41  matt
11977  * Set lighting for morph objects
11978  * Don't let another object start morph while one is morphing, unless
11979  * that one dies.
11980  *
11981  * Revision 1.9  1994/05/31  18:49:53  john
11982  * Took out debugging printf's that Matt left in.
11983  *
11984  * Revision 1.8  1994/05/30  22:50:22  matt
11985  * Added morph effect for robots
11986
11987 ------------------------------------------------------------------------
11988 main/morph.h:
11989
11990  * Revision 1.2  1995/08/23  21:35:58  allender
11991  * fix mcc compiler warnings
11992  *
11993  * Revision 1.1  1995/05/16  15:59:37  allender
11994  * Initial revision
11995  *
11996  * Revision 2.0  1995/02/27  11:32:19  john
11997  * New version 2.0, which has no anonymous unions, builds with
11998  * Watcom 10.0, and doesn't require parsing BITMAPS.TBL.
11999  *
12000  * Revision 1.9  1995/01/04  12:20:46  john
12001  * Declearations to work better with game state save.
12002  *
12003  *
12004  * Revision 1.8  1995/01/03  20:38:44  john
12005  * Externed MAX_MORPH_OBJECTS
12006  *
12007  * Revision 1.7  1994/09/26  17:28:33  matt
12008  * Made new multiple-object morph code work with the demo system
12009  *
12010  * Revision 1.6  1994/09/26  15:40:17  matt
12011  * Allow multiple simultaneous morphing objects
12012  *
12013  * Revision 1.5  1994/06/28  11:55:19  john
12014  * Made newdemo system record/play directly to/from disk, so
12015  * we don't need the 4 MB buffer anymore.
12016  *
12017  * Revision 1.4  1994/06/16  13:57:40  matt
12018  * Added support for morphing objects in demos
12019  *
12020  * Revision 1.3  1994/06/08  18:22:03  matt
12021  * Made morphing objects light correctly
12022  *
12023  * Revision 1.2  1994/05/30  22:50:25  matt
12024  * Added morph effect for robots
12025  *
12026  * Revision 1.1  1994/05/30  12:04:19  matt
12027  * Initial revision
12028
12029 ------------------------------------------------------------------------
12030 main/multi.h:
12031
12032  * Revision 2.3  1995/04/03  08:49:50  john
12033  * Added code to get someone's player struct.
12034  *
12035  * Revision 2.2  1995/03/27  12:59:17  john
12036  * Initial version of multiplayer save games.
12037  *
12038  * Revision 2.1  1995/03/21  14:39:06  john
12039  * Ifdef'd out the NETWORK code.
12040  *
12041  * Revision 2.0  1995/02/27  11:28:34  john
12042  * New version 2.0, which has no anonymous unions, builds with
12043  * Watcom 10.0, and doesn't require parsing BITMAPS.TBL.
12044  *
12045  * Revision 1.74  1995/02/11  11:36:42  rob
12046  * Added new var.
12047  *
12048  * Revision 1.73  1995/02/08  18:17:41  rob
12049  * Added prototype for reset function.
12050  *
12051  * Revision 1.72  1995/02/05  14:37:42  rob
12052  * Made object mapping more efficient.
12053  *
12054  * Revision 1.71  1995/02/01  18:07:36  rob
12055  * Change object mapping to int functions.
12056  *
12057  * Revision 1.70  1995/02/01  12:55:00  rob
12058  * Changed message type.
12059  *
12060  * Revision 1.69  1995/01/31  12:46:12  rob
12061  * Fixed a bug with object overflow handling.
12062  *
12063  * Revision 1.68  1995/01/27  11:15:13  rob
12064  * removed extern of variable no longer in multi.c
12065  *
12066  * Revision 1.67  1995/01/24  11:53:13  john
12067  * Added better macro defining code.
12068  *
12069  * Revision 1.66  1995/01/24  11:32:03  john
12070  * Added new defining macro method.
12071  *
12072  * Revision 1.65  1995/01/23  17:17:06  john
12073  * Added multi_sending_message.
12074  *
12075  * Revision 1.64  1995/01/23  16:02:42  rob
12076  * Added prototype for mission select function.
12077  *
12078  * Revision 1.63  1995/01/18  19:01:21  rob
12079  * Added new message for hostage door sync.
12080  *
12081  * Revision 1.62  1995/01/14  18:39:57  rob
12082  * Added new message type for dropping robot powerups.
12083  *
12084  * Revision 1.61  1995/01/12  21:41:13  rob
12085  * Fixed incompat. with 1.0 and 1.1.
12086  *
12087  * Revision 1.60  1995/01/04  21:40:55  rob
12088  * Added new type for boss actions in coop.
12089  *
12090  * Revision 1.59  1995/01/04  11:38:09  rob
12091  * Fixed problem with lost character in messages.
12092  *
12093  * Revision 1.58  1995/01/03  20:12:44  rob
12094  * Made max message length in shareware = 40.
12095  *
12096  * Revision 1.57  1995/01/03  14:27:25  rob
12097  * ADded trigger messages.
12098  *
12099  * Revision 1.56  1995/01/02  20:08:21  rob
12100  * Added robot creation.
12101  *
12102  * Revision 1.55  1995/01/02  14:41:30  rob
12103  * Added score syncing.
12104  *
12105  * Revision 1.54  1994/12/21  21:02:01  rob
12106  * Added new message type for ROBOT_FIRE
12107  *
12108  * Revision 1.53  1994/12/21  17:27:25  rob
12109  * Changed the format for send_create_powerup messages.
12110  *
12111  *
12112  * Revision 1.52  1994/12/20  20:41:39  rob
12113  * ADded robot release message type.
12114  *
12115  * Revision 1.51  1994/12/19  19:00:12  rob
12116  * Changed buf to multibuf so it can be safely externed.
12117  *
12118  * Revision 1.50  1994/12/19  16:41:14  rob
12119  * Added new message types for robot support.
12120  * Added prototype for external use of multi_send_data (from multibot.c)
12121  *
12122  * Revision 1.49  1994/12/11  13:30:13  rob
12123  * Added new variables to get players out of nested menus.
12124  *
12125  * Revision 1.48  1994/12/11  01:58:57  rob
12126  * Added variable to track menu deth..
12127  *
12128  * Revision 1.47  1994/12/08  12:41:17  rob
12129  * Added audio taunts.
12130  *
12131  * Revision 1.46  1994/12/07  21:53:12  rob
12132  * Fixing sequencing bugginess in modem/serial.
12133  *
12134  * Revision 1.45  1994/12/07  16:46:58  rob
12135  * Added prototype.
12136  *
12137  * Revision 1.44  1994/12/01  12:22:31  rob
12138  * Added de-cloak message for demo.
12139  *
12140  * Revision 1.43  1994/12/01  00:54:14  rob
12141  * Added variable for tracking homing missiles.
12142  *
12143  * Revision 1.42  1994/11/30  16:04:39  rob
12144  * Added show reticle name variable for team games.
12145  *
12146  * Revision 1.41  1994/11/29  19:33:38  rob
12147  * Team support.
12148  *
12149  * Revision 1.40  1994/11/29  12:49:37  rob
12150  * Added more team support stuff.
12151  *
12152  * Revision 1.39  1994/11/28  21:20:49  rob
12153  * Cleaned up the .h file, removed an unused function.
12154  *
12155  * Revision 1.38  1994/11/28  21:04:50  rob
12156  * Added support for network sound-casting.
12157  *
12158  * Revision 1.37  1994/11/28  14:02:08  rob
12159  * Added protocol versioning for registered versus shareware.
12160  *
12161  * Revision 1.36  1994/11/28  13:30:04  rob
12162  * Added a define for protocol version.
12163  *
12164  * Revision 1.35  1994/11/22  19:19:48  rob
12165  * remove unused function.
12166  *
12167  * Revision 1.34  1994/11/22  18:47:34  rob
12168  * Added hooks for modem support for secret levels.
12169  *
12170  * Revision 1.33  1994/11/22  17:10:50  rob
12171  * Fix for secret levels in network play mode.
12172  *
12173  * Revision 1.32  1994/11/21  16:00:28  rob
12174  * Added secret-level hooks.
12175  *
12176  * Revision 1.31  1994/11/18  18:28:50  rob
12177  * Added new function for multiplayer score screen.
12178  *
12179  * Revision 1.30  1994/11/18  16:31:05  rob
12180  * Added kill list timer variable.
12181  *
12182  * Revision 1.29  1994/11/17  16:38:15  rob
12183  * Added creation of net powerups.
12184  *
12185  * Revision 1.28  1994/11/17  13:37:33  rob
12186  * Added prototype for multi_new_game.
12187  *
12188  * Revision 1.27  1994/11/17  12:58:45  rob
12189  * Added kill matrix.
12190  *
12191  * Revision 1.26  1994/11/16  20:35:24  rob
12192  * Changed explosion hook.
12193  *
12194  * Revision 1.25  1994/11/15  21:31:13  rob
12195  * Bumped max message size, was giving modem.c fits.
12196  *
12197  * Revision 1.24  1994/11/15  19:28:37  matt
12198  * Added prototypes
12199  *
12200  * Revision 1.23  1994/11/14  17:22:19  rob
12201  * Added extern for message macros.
12202  *
12203  * Revision 1.22  1994/11/11  18:16:44  rob
12204  * Made multi_menu_poll return a value to exit menus.
12205  *
12206  * Revision 1.21  1994/11/11  11:06:19  rob
12207  * Added prototype for multi_menu_poll.
12208  *
12209  * Revision 1.20  1994/11/10  21:48:41  rob
12210  * Changed multi_endlevel to return an int.
12211  *
12212  * Revision 1.19  1994/11/08  17:48:14  rob
12213  * Fixing endlevel stuff.
12214  *
12215  * Revision 1.18  1994/11/07  17:49:07  rob
12216  * Changed prototype for object mapping funcs.
12217  *
12218  * Revision 1.17  1994/11/07  15:46:32  rob
12219  * Changed the way remote object number mapping works, and it was a real
12220  * pain in the ass..  I think it will work more reliably now.
12221  *
12222  * Revision 1.16  1994/11/04  19:53:01  rob
12223  * Added a new message type for Player_leave 'explosions'.
12224  * Added a prototype for function moved over from network.c
12225  *
12226  * Revision 1.15  1994/11/02  18:02:33  rob
12227  * Added message type for control center firing.
12228  *
12229  * Revision 1.14  1994/11/02  11:38:00  rob
12230  * Added player-in-process-of-dying explosions to network game.
12231  *
12232  * Revision 1.13  1994/11/01  19:31:44  rob
12233  * Bumped max_net_create_objects to 20 to accomodate a fully equipped
12234  * character blowing up.
12235  *
12236  * Revision 1.12  1994/10/31  13:48:02  rob
12237  * Fixed bug in opening doors over network/modem.  Added a new message
12238  * type to multi.c that communicates door openings across the net.
12239  * Changed includes in multi.c and wall.c to accomplish this.
12240  *
12241  * Revision 1.11  1994/10/09  20:08:20  rob
12242  * Added some exported func prototypes.
12243  * Changed max net message length to 25 (from 30).
12244  * Removed some message types no longer used.
12245  *
12246  * Revision 1.10  1994/10/08  20:06:10  rob
12247  * fixed a typo.
12248  *
12249  * Revision 1.9  1994/10/08  19:59:43  rob
12250  * Moved MAX_MESSAGE_LEN to here.
12251  *
12252  * Revision 1.8  1994/10/07  23:09:54  rob
12253  * Fixed some prototypes.
12254  *
12255  * Revision 1.7  1994/10/07  18:11:19  rob
12256  * Added multi_do_death to multi.c.
12257  *
12258  * Revision 1.6  1994/10/07  16:14:32  rob
12259  * Added new message type for player reappear
12260  *
12261  * Revision 1.5  1994/10/07  12:58:17  rob
12262  * Added multi_leave_game.
12263  *
12264  * Revision 1.4  1994/10/07  12:17:17  rob
12265  * Fixed some stuff in multi_do_frame and exported the message_length
12266  * array.
12267  *
12268  * Revision 1.3  1994/10/07  11:10:17  john
12269  * Added function to parse multiple messages into individual
12270  * messages.
12271  *
12272  * Revision 1.2  1994/10/07  10:28:06  rob
12273  * Headers and stuff for multi.c (obviously)
12274  *
12275  * Revision 1.1  1994/10/06  16:07:39  rob
12276  * Initial revision
12277
12278 ------------------------------------------------------------------------
12279 main/multibot.h:
12280
12281  * Revision 1.2  1995/08/24  16:04:38  allender
12282  * fix function prototype for compiler warning
12283  *
12284  * Revision 1.1  1995/05/16  15:59:53  allender
12285  * Initial revision
12286  *
12287  * Revision 2.1  1995/03/21  14:40:18  john
12288  * Ifdef'd out the NETWORK code.
12289  *
12290  * Revision 2.0  1995/02/27  11:30:57  john
12291  * New version 2.0, which has no anonymous unions, builds with
12292  * Watcom 10.0, and doesn't require parsing BITMAPS.TBL.
12293  *
12294  * Revision 1.20  1995/02/06  18:18:05  rob
12295  * Tweaking cooperative stuff.
12296  *
12297  * Revision 1.19  1995/02/04  16:49:50  rob
12298  * Changed multi_send_robot_frame to return the number of robot positions that were sent.
12299  *
12300  * Revision 1.18  1995/02/04  12:29:32  rob
12301  * Added buffered fire sends.
12302  *
12303  * Revision 1.17  1995/01/30  17:22:02  rob
12304  * Added prototype for modem robot send function.
12305  *
12306  * Revision 1.16  1995/01/26  18:24:56  rob
12307  * Reduced # of controlled bots.
12308  *
12309  * Revision 1.15  1995/01/25  19:26:35  rob
12310  * Added define for robot laser agitation.
12311  *
12312  * Revision 1.14  1995/01/25  13:45:26  rob
12313  * Added prototype of robot transfer fucm.
12314  *
12315  * Revision 1.13  1995/01/14  19:01:08  rob
12316  * Added prototypes for new functionality.
12317  *
12318  * Revision 1.12  1995/01/12  16:41:53  rob
12319  * Added new prototypes.
12320  *
12321  * Revision 1.11  1995/01/12  15:42:55  rob
12322  * Fixing score awards for coop.
12323  *
12324  * Revision 1.10  1995/01/02  21:00:40  rob
12325  * added robot matcen support.
12326  *
12327  * Revision 1.9  1994/12/31  21:03:53  rob
12328  * More tweaking for robot behavior.
12329  *
12330  * Revision 1.8  1994/12/29  13:54:25  rob
12331  * Ooops.. fixed a bug..
12332  *
12333  * Revision 1.7  1994/12/29  12:51:38  rob
12334  * ADded proto for multi_robot_explode_sub
12335  *
12336  * Revision 1.6  1994/12/21  21:08:32  rob
12337  * Added new functions for robot firing.
12338  *
12339  * Revision 1.5  1994/12/21  19:04:02  rob
12340  * Fixing score accounting for multi robot games.
12341  *
12342  * Revision 1.4  1994/12/21  17:36:09  rob
12343  * Added a new func.
12344  *
12345  * Revision 1.3  1994/12/21  11:12:02  rob
12346  * Added new function and new vars.
12347  *
12348  * Revision 1.2  1994/12/19  16:41:42  rob
12349  * first revision.
12350  *
12351  * Revision 1.1  1994/12/16  15:48:20  rob
12352  * Initial revision
12353
12354 ------------------------------------------------------------------------
12355 main/netmisc.c:
12356
12357  * Revision 1.1  1995/05/16  15:28:41  allender
12358  * Initial revision
12359  *
12360  * Revision 2.0  1995/02/27  11:27:24  john
12361  * New version 2.0, which has no anonymous unions, builds with
12362  * Watcom 10.0, and doesn't require parsing BITMAPS.TBL.
12363  *
12364  * Revision 1.3  1994/11/19  15:19:34  mike
12365  * rip out unused code and data.
12366  *
12367  * Revision 1.2  1994/08/09  19:31:53  john
12368  * Networking changes.
12369  *
12370  * Revision 1.1  1994/08/08  11:06:07  john
12371  * Initial revision
12372
12373 ------------------------------------------------------------------------
12374 main/netmisc.h:
12375
12376  * Revision 1.1  1995/05/16  16:00:08  allender
12377  * Initial revision
12378  *
12379  * Revision 2.0  1995/02/27  11:30:18  john
12380  * New version 2.0, which has no anonymous unions, builds with
12381  * Watcom 10.0, and doesn't require parsing BITMAPS.TBL.
12382  *
12383  * Revision 1.2  1994/08/09  19:31:54  john
12384  * Networking changes.
12385  *
12386  * Revision 1.1  1994/08/08  11:18:40  john
12387  * Initial revision
12388
12389 ------------------------------------------------------------------------
12390 main/network.h:
12391
12392  * Revision 1.7  1995/10/31  10:20:04  allender
12393  * shareware stuff
12394  *
12395  * Revision 1.6  1995/09/21  14:31:18  allender
12396  * new appltalk type packet which contains shortpos
12397  *
12398  * Revision 1.5  1995/09/18  08:07:08  allender
12399  * added function prototype to remove netgame NBP
12400  *
12401  * Revision 1.4  1995/08/31  15:51:55  allender
12402  * new prototypes for join and start games
12403  *
12404  * Revision 1.3  1995/07/26  17:02:29  allender
12405  * implemented and working on mac
12406  *
12407  * Revision 1.2  1995/06/02  07:42:34  allender
12408  * fixed prototype for network_endlevel_poll2
12409  *
12410  * Revision 1.1  1995/05/16  16:00:15  allender
12411  * Initial revision
12412  *
12413  * Revision 2.2  1995/03/21  14:58:09  john
12414  * *** empty log message ***
12415  *
12416  * Revision 2.1  1995/03/21  14:39:43  john
12417  * Ifdef'd out the NETWORK code.
12418  *
12419  * Revision 2.0  1995/02/27  11:29:48  john
12420  * New version 2.0, which has no anonymous unions, builds with
12421  * Watcom 10.0, and doesn't require parsing BITMAPS.TBL.
12422  *
12423  * Revision 1.72  1995/02/11  14:24:39  rob
12424  * Added suppor for invul. cntrlcen.
12425  *
12426  * Revision 1.71  1995/02/08  19:18:43  rob
12427  * Added extern for segments checksum.
12428  *
12429  * Revision 1.70  1995/02/08  11:01:16  rob
12430  * Fixed a bug.
12431  *
12432  * Revision 1.69  1995/02/07  21:16:49  rob
12433  * Added flag for automap.
12434  *
12435  * Revision 1.68  1995/02/06  18:18:33  rob
12436  * Extern'ed Packet Urgent.
12437  *
12438  * Revision 1.67  1995/02/05  14:36:29  rob
12439  * Moved defines to network.h.
12440  *
12441  * Revision 1.66  1995/02/01  16:34:09  john
12442  * Linted.
12443  *
12444  * Revision 1.65  1995/01/30  21:14:35  rob
12445  * Fixed a bug in join menu.
12446  * Simplified mission load support.
12447  *
12448  * Revision 1.64  1995/01/30  18:19:40  rob
12449  * Added mission title to gameinfo packet.
12450  *
12451  * Revision 1.63  1995/01/28  17:02:39  rob
12452  * Fixed monitor syncing bug (minor 19).
12453  *
12454  * Revision 1.62  1995/01/27  11:15:25  rob
12455  * removed extern of variable no longer in network.c
12456  *
12457  * Revision 1.61  1995/01/26  12:17:34  rob
12458  * Added new param to network_do_frame.
12459  *
12460  * Revision 1.60  1995/01/22  17:32:11  rob
12461  * Added mission support for network games.
12462  *
12463  * Revision 1.59  1995/01/17  17:10:33  rob
12464  * Added some flags to netgame struct.
12465  *
12466  * Revision 1.58  1995/01/12  18:57:15  rob
12467  * Added score resync stuff.
12468  *
12469  * Revision 1.57  1995/01/12  16:42:18  rob
12470  * Added new prototypes.
12471  *
12472  * Revision 1.56  1995/01/05  12:12:10  rob
12473  * Fixed a problem with packet size.
12474  *
12475  * Revision 1.55  1995/01/05  11:12:36  rob
12476  * Reduced packet size by 1 byte just to be safe.
12477  *
12478  * Revision 1.54  1995/01/04  21:39:32  rob
12479  * New framedata packet for registered.
12480  *
12481  * Revision 1.53  1995/01/04  08:47:04  rob
12482  * JOHN CHECKED IN FOR ROB !!!
12483  *
12484  * Revision 1.52  1994/12/30  20:09:07  rob
12485  * ADded a toggle for showing player names on HUD.
12486  *
12487  * Revision 1.51  1994/12/29  15:59:52  rob
12488  * Centralized network disconnects.
12489  *
12490  * Revision 1.50  1994/12/09  21:21:57  rob
12491  * rolled back changes.
12492  *
12493  * Revision 1.48  1994/12/05  22:59:27  rob
12494  * added prototype for send_endlevel_packet.
12495  *
12496  * Revision 1.47  1994/12/05  21:47:34  rob
12497  * Added a new field to netgame struct.
12498  *
12499  * Revision 1.46  1994/12/05  14:39:16  rob
12500  * Added new variable to indicate new net game starting.
12501  *
12502  * Revision 1.45  1994/12/04  15:37:18  rob
12503  * Fixed a typo.
12504  *
12505  * Revision 1.44  1994/12/04  15:30:42  rob
12506  * Added new fields to netgame struct.
12507  *
12508  * Revision 1.43  1994/12/03  18:03:19  rob
12509  * ADded team kill syncing.
12510  *
12511  * Revision 1.42  1994/12/01  21:21:27  rob
12512  * Added new system for object sync on rejoin.
12513  *
12514  * Revision 1.41  1994/11/29  13:07:33  rob
12515  * Changed structure defs to .h files.
12516  *
12517  * Revision 1.40  1994/11/22  17:10:48  rob
12518  * Fix for secret levels in network play mode.
12519  *
12520  * Revision 1.39  1994/11/18  16:36:31  rob
12521  * Added variable network_rejoined to enable random placement
12522  * of rejoining palyers.
12523  *
12524  * Revision 1.38  1994/11/12  19:51:13  rob
12525  * Changed prototype for network_send_data to pass
12526  * urgent flag.
12527  *
12528  * Revision 1.37  1994/11/10  21:48:26  rob
12529  * Changed net_endlevel to return an int.
12530  *
12531  * Revision 1.36  1994/11/10  20:32:49  rob
12532  * Added extern for LastPacketTime.
12533  *
12534  * Revision 1.35  1994/11/09  11:36:34  rob
12535  * ADded return value to network_level_sync for success/fail.
12536  *
12537  * Revision 1.34  1994/11/08  21:22:31  rob
12538  * Added proto for network_endlevel_snyc
12539  *
12540  * Revision 1.33  1994/11/08  15:20:00  rob
12541  * added proto for change_playernum_to
12542  *
12543  * Revision 1.32  1994/11/07  17:45:40  rob
12544  * Added prototype for network_endlevel (called from multi.c)
12545  *
12546  * Revision 1.31  1994/11/04  19:52:37  rob
12547  * Removed a function from network.h (network_show_player_list)
12548  *
12549  * Revision 1.30  1994/11/01  19:39:26  rob
12550  * Removed a couple of variables that should be externed from multi.c
12551  * (remnants of the changover)
12552  *
12553  * Revision 1.29  1994/10/31  19:18:24  rob
12554  * Changed prototype for network_do_frame to add a parameter if you wish
12555  * to force the frame to be sent.  Important if this is a leave_game frame.
12556  *
12557  * Revision 1.28  1994/10/08  19:59:20  rob
12558  * Removed network message variables.
12559  *
12560  * Revision 1.27  1994/10/08  11:08:38  john
12561  * Moved network_delete_unused objects into multi.c,
12562  * took out network callsign stuff and used Matt's net
12563  * players[.].callsign stuff.
12564  *
12565  * Revision 1.26  1994/10/07  11:26:20  rob
12566  * Changed network_start_frame to network_do_frame,.
12567  *
12568  *
12569  * Revision 1.25  1994/10/05  13:58:10  rob
12570  * Added a new function net_endlevel that is called after each level is
12571  * completed.  Currently it only does anything if SERIAL game is in effect.
12572  *
12573  * Revision 1.24  1994/10/04  19:34:57  rob
12574  * export network_find_max_net_players.
12575  *
12576  * Revision 1.23  1994/10/04  17:31:10  rob
12577  * Exported MaxNumNetPlayers.
12578  *
12579  * Revision 1.22  1994/10/03  22:57:30  matt
12580  * Took out redundant definition of callsign_len
12581  *
12582  * Revision 1.21  1994/10/03  15:12:48  rob
12583  * Boosted MAX_CREATE_OBJECTS to 15.
12584  *
12585  * Revision 1.20  1994/09/30  18:19:51  rob
12586  * Added two new variables for tracking object creation.
12587  *
12588  * Revision 1.19  1994/09/27  15:03:18  rob
12589  * Added prototype for network_delete_extra_objects used by modem.c
12590  *
12591  * Revision 1.18  1994/09/27  14:36:45  rob
12592  * Added two new varaibles for network/serial weapon firing.
12593  *
12594  * Revision 1.17  1994/09/07  17:10:57  john
12595  * Started adding code to sync powerups.
12596  *
12597  * Revision 1.16  1994/09/06  19:29:05  john
12598  * Added trial version of rejoin function.
12599  *
12600  * Revision 1.15  1994/08/26  13:01:54  john
12601  * Put high score system in.
12602  *
12603  * Revision 1.14  1994/08/25  18:12:04  matt
12604  * Made player's weapons and flares fire from the positions on the 3d model.
12605  * Also added support for quad lasers.
12606  *
12607  * Revision 1.13  1994/08/17  16:50:00  john
12608  * Added damaging fireballs, missiles.
12609  *
12610  * Revision 1.12  1994/08/16  12:25:22  john
12611  * Added hooks for sending messages.
12612  *
12613  * Revision 1.11  1994/08/13  12:20:18  john
12614  * Made the networking uise the Players array.
12615  *
12616  * Revision 1.10  1994/08/12  22:41:27  john
12617  * Took away Player_stats; add Players array.
12618  *
12619  * Revision 1.9  1994/08/12  03:10:22  john
12620  * Made network be default off; Moved network options into
12621  * main menu.  Made starting net game check that mines are the
12622  * same.
12623  *
12624  * Revision 1.8  1994/08/11  21:57:08  john
12625  * Moved network options to main menu.
12626  *
12627  * Revision 1.7  1994/08/10  11:29:20  john
12628  * *** empty log message ***
12629  *
12630  * Revision 1.6  1994/08/10  10:44:12  john
12631  * Made net players fire..
12632  *
12633  * Revision 1.5  1994/08/09  19:31:46  john
12634  * Networking changes.
12635  *
12636  * Revision 1.4  1994/08/05  16:30:26  john
12637  * Added capability to turn off network.
12638  *
12639  * Revision 1.3  1994/08/05  16:11:43  john
12640  * Psuedo working version of networking.
12641  *
12642  * Revision 1.2  1994/07/25  12:33:34  john
12643  * Network "pinging" in.
12644  *
12645  * Revision 1.1  1994/07/20  16:09:05  john
12646  * Initial revision
12647
12648 ------------------------------------------------------------------------
12649 main/newdemo.c:
12650
12651  * Revision 1.12  1995/10/31  10:19:43  allender
12652  * shareware stuff
12653  *
12654  * Revision 1.11  1995/10/17  13:19:16  allender
12655  * close boxes for demo save
12656  *
12657  * Revision 1.10  1995/10/05  10:36:07  allender
12658  * fixed calls to digi_play_sample to account for differing volume and angle calculations
12659  *
12660  * Revision 1.9  1995/09/12  15:49:13  allender
12661  * define __useAppleExts__ if not already defined
12662  *
12663  * Revision 1.8  1995/09/05  14:28:32  allender
12664  * fixed previous N_players bug in newdemo_goto_end
12665  *
12666  * Revision 1.7  1995/09/05  14:16:51  allender
12667  * added space to allowable demo filename characters
12668  * and fixed bug with netgame demos N_players got getting
12669  * set correctly
12670  *
12671  * Revision 1.6  1995/09/01  16:10:47  allender
12672  * fixed bug with reading in N_players variable on
12673  * netgame demo playback
12674  *
12675  * Revision 1.5  1995/08/24  16:04:11  allender
12676  * fix signed byte problem
12677  *
12678  * Revision 1.4  1995/08/12  12:21:59  allender
12679  * made call to create_shortpos not swap the shortpos
12680  * elements
12681  *
12682  * Revision 1.3  1995/08/01  16:04:19  allender
12683  * made random picking of demo work
12684  *
12685  * Revision 1.2  1995/08/01  13:56:56  allender
12686  * demo system working on the mac
12687  *
12688  * Revision 1.1  1995/05/16  15:28:59  allender
12689  * Initial revision
12690  *
12691  * Revision 2.7  1995/05/26  16:16:06  john
12692  * Split SATURN into define's for requiring cd, using cd, etc.
12693  * Also started adding all the Rockwell stuff.
12694  *
12695  * Revision 2.6  1995/03/21  14:39:38  john
12696  * Ifdef'd out the NETWORK code.
12697  *
12698  * Revision 2.5  1995/03/14  18:24:31  john
12699  * Force Destination Saturn to use CD-ROM drive.
12700  *
12701  * Revision 2.4  1995/03/14  16:22:29  john
12702  * Added cdrom alternate directory stuff.
12703  *
12704  * Revision 2.3  1995/03/10  12:58:33  allender
12705  * only display rear view cockpit when cockpit mode was CM_FULL_COCKPIT.
12706  *
12707  * Revision 2.2  1995/03/08  16:12:15  allender
12708  * changes for Destination Saturn
12709  *
12710  * Revision 2.1  1995/03/08  12:11:26  allender
12711  * fix shortpos reading
12712  *
12713  * Revision 2.0  1995/02/27  11:29:40  john
12714  * New version 2.0, which has no anonymous unions, builds with
12715  * Watcom 10.0, and doesn't require parsing BITMAPS.TBL.
12716  *
12717  * Revision 1.189  1995/02/22  14:53:42  allender
12718  * missed some anonymous stuff
12719  *
12720  * Revision 1.188  1995/02/22  13:24:53  john
12721  * Removed the vecmat anonymous unions.
12722  *
12723  * Revision 1.187  1995/02/22  13:13:54  allender
12724  * remove anonymous unions from object structure
12725  *
12726  * Revision 1.186  1995/02/14  15:36:41  allender
12727  * fix fix for morph effect
12728  *
12729  * Revision 1.185  1995/02/14  11:25:48  allender
12730  * save cockpit mode and restore after playback.  get orientation for morph
12731  * effect when object is morph vclip
12732  *
12733  * Revision 1.184  1995/02/13  12:18:14  allender
12734  * change to decide about interpolating or not
12735  *
12736  * Revision 1.183  1995/02/12  00:46:23  adam
12737  * don't decide to skip frames until after at least 10 frames have
12738  * passed -- allender
12739  *
12740  * Revision 1.182  1995/02/11  22:34:01  john
12741  * Made textures page in for newdemos before playback time.
12742  *
12743  * Revision 1.181  1995/02/11  17:28:32  allender
12744  * strip frames from end of demo
12745  *
12746  * Revision 1.180  1995/02/11  16:40:35  allender
12747  * start of frame stripping debug code
12748  *
12749  * Revision 1.179  1995/02/10  17:40:06  allender
12750  * put back in wall_hit_process code to fix door problem
12751  *
12752  * Revision 1.178  1995/02/10  17:17:24  adam
12753  * allender } fix
12754  *
12755  * Revision 1.177  1995/02/10  17:16:24  allender
12756  * fix possible tmap problems
12757  *
12758  * Revision 1.176  1995/02/10  15:54:37  allender
12759  * changes for out of space on device.
12760  *
12761  * Revision 1.175  1995/02/09  19:55:00  allender
12762  * fix bug with morph recording -- force rendertype to RT_POLYOBJ when
12763  * playing back since it won't render until fully morphed otherwise
12764  *
12765  * Revision 1.174  1995/02/07  17:15:35  allender
12766  * DOH!!!!!
12767  *
12768  * Revision 1.173  1995/02/07  17:14:21  allender
12769  * immediately return when loading bogus level stuff when reading a frame
12770  *
12771  * Revision 1.172  1995/02/02  11:15:03  allender
12772  * after loading new level, read next frame (forward or back) always because
12773  * of co-op ships showing up when level is loaded
12774  *
12775  * Revision 1.171  1995/02/02  10:24:16  allender
12776  * removed cfile stuff.  Use standard FILE functions for demo playback
12777  *
12778  * Revision 1.170  1995/01/30  13:54:32  allender
12779  * support for missions
12780  *
12781  * Revision 1.169  1995/01/27  16:27:35  allender
12782  * put game mode to demo_game_mode when sorting multiplayer kill (and score)
12783  * list
12784  *
12785  * Revision 1.168  1995/01/27  09:52:25  allender
12786  * minor changes because of object/segment linking problems
12787  *
12788  * Revision 1.167  1995/01/27  09:22:28  allender
12789  * changed way multi-player score is recorded.  Record difference, not
12790  * actual
12791  *
12792  * Revision 1.166  1995/01/25  14:32:44  allender
12793  * changed with recorded player flags.  More checks for paused state
12794  * during interpolation reading of objects
12795  *
12796  * Revision 1.165  1995/01/25  11:23:32  allender
12797  * found bug with out of disk space problem
12798  *
12799  * Revision 1.164  1995/01/25  11:11:33  allender
12800  * coupla' things.  Fix problem with objects apparently being linked in
12801  * the wrong segment.  Put an Int3 in to check why demos will write to
12802  * end of space on drive. close demo file if demo doens't start playing
12803  * back.  Put obj->type == OBJ_ROBOT around checking for boss cloaking
12804  *
12805  * Revision 1.163  1995/01/24  19:44:30  allender
12806  * fix obscure problem with rewinding and having the wrong object linked
12807  * to the wrong segments.  will investigate further.
12808  *
12809  * Revision 1.162  1995/01/23  09:31:28  allender
12810  * add team score in team mode playback
12811  *
12812  * Revision 1.161  1995/01/20  22:47:39  matt
12813  * Mission system implemented, though imcompletely
12814  *
12815  * Revision 1.160  1995/01/20  09:30:37  allender
12816  * don't call LoadLevel with bogus data
12817  *
12818  * Revision 1.159  1995/01/20  09:13:23  allender
12819  * *&^%&*%$ typo
12820  *
12821  * Revision 1.158  1995/01/20  09:12:04  allender
12822  * record team names during demo recoring in GM_TEAM
12823  *
12824  * Revision 1.157  1995/01/19  16:31:09  allender
12825  * forgot to bump demo version for new weapon change stuff
12826  *
12827  * Revision 1.156  1995/01/19  16:29:33  allender
12828  * added new byte for weapon change (old weapon) so rewinding works
12829  * correctly for weapon changes in registered
12830  *
12831  * Revision 1.155  1995/01/19  15:00:05  allender
12832  * remove code to take away blastable walls in multiplayer demo playbacks
12833  *
12834  * Revision 1.154  1995/01/19  11:07:05  allender
12835  * put in psuedo cloaking for boss robots.  Problem is that cloaking is
12836  * time based, and that don't get done in demos, so bosses just disappear.
12837  * oh well
12838  *
12839  * Revision 1.153  1995/01/19  09:42:29  allender
12840  * record laser levels in demos
12841  *
12842  * Revision 1.152  1995/01/18  20:43:12  allender
12843  * fix laser level stuff on goto-beginning and goto-end
12844  *
12845  * Revision 1.151  1995/01/18  20:28:18  allender
12846  * cloak robots now cloak (except maybe for boss........)  Put in function
12847  * to deal with control center triggers
12848  *
12849  * Revision 1.150  1995/01/18  18:55:07  allender
12850  * bug fix
12851  *
12852  * Revision 1.149  1995/01/18  18:49:03  allender
12853  * lots 'o stuff....record laser level.  Record beginning of door opening
12854  * sequence.  Fix some problems with control center stuff.  Control center
12855  * triggers now work in reverse
12856  *
12857  * Revision 1.148  1995/01/18  08:51:40  allender
12858  * forgot to record ammo counts at beginning of demo
12859  *
12860  * Revision 1.147  1995/01/17  17:42:07  allender
12861  * added primary and secondary ammo counts.  Changed goto_end routine
12862  * to be more efficient
12863  *
12864  * Revision 1.146  1995/01/17  13:46:35  allender
12865  * fix problem with destroyed control center and rewinding a demo.
12866  * Save callsign and restore after demo playback
12867  *
12868  * Revision 1.145  1995/01/12  10:21:53  allender
12869  * fixes for 1.0 to 1.1 demo incompatibility
12870  *
12871  * Revision 1.144  1995/01/05  13:51:43  allender
12872  * fixed type of player num variable
12873  *
12874  * Revision 1.143  1995/01/04  16:58:28  allender
12875  * bumped up demo version number
12876  *
12877  * Revision 1.142  1995/01/04  14:59:02  allender
12878  * added more information to end of demo for registered.  Forced game mode
12879  * to be GM_NORMAL on demo playback
12880  *
12881  * Revision 1.141  1995/01/03  17:30:47  allender
12882  * fixed logic problem with cloak stuf
12883  *
12884  * Revision 1.140  1995/01/03  17:12:23  allender
12885  * fix for getting cloak stuff at end of demo for shareware
12886  *
12887  * Revision 1.139  1995/01/03  15:20:24  allender
12888  * fix goto_end for shareware -- changes to goto_end for registered
12889  *
12890  * Revision 1.138  1995/01/03  13:13:26  allender
12891  * add } I forgot
12892  *
12893  * Revision 1.137  1995/01/03  13:10:29  allender
12894  * make score work forwards and backwards
12895  *
12896  * Revision 1.136  1995/01/03  11:45:20  allender
12897  * added code to record players scores
12898  *
12899  * Revision 1.135  1994/12/30  10:03:57  allender
12900  * put cloak stuff at end of demo for fast forward to the end
12901  *
12902  * Revision 1.134  1994/12/29  17:02:55  allender
12903  * spelling fix on SHAREWARE
12904  *
12905  * Revision 1.133  1994/12/29  16:43:41  allender
12906  * lots of new multiplayer stuff.  wrapped much code with SHAREWARE defines
12907  *
12908  * Revision 1.132  1994/12/28  14:15:01  allender
12909  * added routines to deal with connecting and reconnecting players when
12910  * recording multiplayer demos
12911  *
12912  * Revision 1.131  1994/12/21  12:57:59  allender
12913  * bug fix
12914  *
12915  * Revision 1.130  1994/12/21  12:46:53  allender
12916  * record multi player deaths and kills
12917  *
12918  * Revision 1.129  1994/12/19  16:37:27  allender
12919  * pick good filename when trying to save in network play and player
12920  * gets bumped out of menu by multi-player code
12921  *
12922  * Revision 1.128  1994/12/14  10:49:01  allender
12923  * reset bad_read variable when starting demo playback
12924  *
12925  * Revision 1.127  1994/12/14  08:53:06  allender
12926  * lowered watermark for out of space
12927  *
12928  * Revision 1.126  1994/12/14  08:49:52  allender
12929  * put up warning when starting demo recording if not enough space and
12930  * not let them record
12931  *
12932  * Revision 1.125  1994/12/13  00:01:37  allender
12933  * CLOAK FIX -- (I'm tempted to take cloak out of game because I can't
12934  * seem to get it right in demo playback)
12935  *
12936  * Revision 1.124  1994/12/12  14:51:21  allender
12937  * more fixed to multiplayer cloak stuff
12938  *
12939  * Revision 1.123  1994/12/12  11:33:11  allender
12940  * fixed rearview mode to work again
12941  *
12942  * Revision 1.122  1994/12/12  11:00:16  matt
12943  * Added code to handle confusion with attached objects
12944  *
12945  * Revision 1.121  1994/12/12  00:31:29  allender
12946  * give better warning when out of space when recording.  Don't record
12947  * until no space left.  We have 500K watermark when we now stop recording
12948  *
12949  * Revision 1.120  1994/12/10  16:44:54  matt
12950  * Added debugging code to track down door that turns into rock
12951  *
12952  * Revision 1.119  1994/12/09  18:46:15  matt
12953  * Added code to handle odd error condition
12954  *
12955  * Revision 1.118  1994/12/09  17:27:37  allender
12956  * force playernum to 0 when demo is done playing
12957  *
12958  * Revision 1.117  1994/12/09  16:40:39  allender
12959  * yet more cloak stuff.  Assign cloak/invuln time when starting demo
12960  * if flags are set.  Check cloak and invuln time when demo
12961  * even when paused
12962  *
12963  * Revision 1.116  1994/12/09  14:59:22  matt
12964  * Added system to attach a fireball to another object for rendering purposes,
12965  * so the fireball always renders on top of (after) the object.
12966  *
12967  * Revision 1.115  1994/12/09  12:21:45  allender
12968  * only allow valid chars when typing in demo filename
12969  *
12970  * Revision 1.114  1994/12/08  23:19:02  allender
12971  * final(?) fix for getting cloak gauge to work on demo playback
12972  * with forward and reverse
12973  *
12974  * Revision 1.113  1994/12/08  21:34:38  allender
12975  * record old and new player flags to accuratedly record cloaking and
12976  * decloaking
12977  * ./
12978  *
12979  * Revision 1.112  1994/12/08  18:04:47  allender
12980  * bashed playernum right after reading it in demo header so shields
12981  * and energy are put in right place
12982  *
12983  * Revision 1.111  1994/12/08  17:10:07  allender
12984  * encode playernum in demo header.  Bash viewer segment to 0 if in
12985  * bogus segnum.  Don't link render objs for same reason
12986  *
12987  * Revision 1.110  1994/12/08  15:36:12  allender
12988  * cloak stuff works forwards and backwards
12989  *
12990  * Revision 1.109  1994/12/08  13:46:03  allender
12991  * don't record rearview anymore, but leave in case statement for playback
12992  * purposes.  change the way letterbox <--> cockpit transitions happen
12993  *
12994  * Revision 1.108  1994/12/08  12:36:06  matt
12995  * Added new object allocation & deallocation functions so other code
12996  * could stop messing around with internal object data structures.
12997  *
12998  * Revision 1.107  1994/12/08  11:19:04  allender
12999  * handle out of space (more) gracefully then before
13000  *
13001  * Revision 1.106  1994/12/08  00:29:49  allender
13002  * fixed bug that didn't load level on goto_beginning
13003  *
13004  * Revision 1.105  1994/12/08  00:11:51  mike
13005  * change matrix interpolation.
13006  *
13007  * Revision 1.104  1994/12/07  23:46:37  allender
13008  * changed invulnerability and cloak to work (almost) correctly both
13009  * in single and multi player
13010  *
13011  * Revision 1.103  1994/12/07  11:48:49  adam
13012  * BY ALLENDER -- added dampening of interpolation factor to 1 if greater
13013  * than 1 (although I have not seen this happen).  this is attempt to
13014  * get wobbling problem solved
13015  *
13016  * Revision 1.102  1994/12/07  11:23:56  allender
13017  * attempt at getting rid of wobbling on demo playback
13018  *
13019  * Revision 1.101  1994/12/06  19:31:17  allender
13020  * moved blastable wall stuff code to where we load level during demo
13021  * playback
13022  *
13023  * Revision 1.100  1994/12/06  19:21:51  allender
13024  * multi games, destroy blastable walls.  Do wall toggle when control center
13025  * destroyed
13026  *
13027  * Revision 1.99  1994/12/06  16:54:48  allender
13028  * fixed code so if demo automatically started from menu, don't bring up
13029  * message if demo is too old
13030  *
13031  * Revision 1.98  1994/12/06  13:55:15  matt
13032  * Use new rounding func, f2ir()
13033  *
13034  * Revision 1.97  1994/12/06  13:44:45  allender
13035  * suppressed compiler warnings
13036  *
13037  * Revision 1.96  1994/12/06  13:38:03  allender
13038  * removed recording of wall hit process.  I think that all bases are covered
13039  * elsewhere
13040  *
13041  * Revision 1.95  1994/12/06  12:57:35  allender
13042  * added recording of multi_decloaking.  Fixed some other cloaking code so
13043  * that cloak should last as long as player was cloaked.  We will lose the
13044  * guage effect, but the time is probably more important on playback
13045  *
13046  * Revision 1.94  1994/12/05  23:37:17  matt
13047  * Took out calls to warning() function
13048  *
13049  * Revision 1.93  1994/12/03  17:52:04  yuan
13050  * Localization 380ish
13051  *
13052  * Revision 1.92  1994/12/02  12:53:39  allender
13053  * fixed goto_beginning and goto_end on demo playback
13054  *
13055  * Revision 1.91  1994/12/01  12:01:49  allender
13056  * added multi player cloak stuff
13057  *
13058  * Revision 1.90  1994/11/30  09:33:58  allender
13059  * added field in header to tell what version (shareware or registered)
13060  * demo was recorded with.  Don't allow demo recorded on one to playback
13061  * on the other
13062  *
13063  * Revision 1.89  1994/11/29  00:31:01  allender
13064  * major changes -- added level recording feature which records level
13065  * advancement.  Changes to internal code to handle this.
13066  *
13067  * Revision 1.88  1994/11/27  23:13:54  matt
13068  * Made changes for new mprintf calling convention
13069  *
13070  * Revision 1.87  1994/11/27  23:07:35  allender
13071  * starting on code to get all level transitions recorded. not done yet
13072  *
13073  * Revision 1.86  1994/11/27  17:39:47  matt
13074  * Don't xlate tmap numbers when editor compiled out
13075  *
13076  * Revision 1.85  1994/11/23  09:27:21  allender
13077  * put up info box with message if demo version is too old or level
13078  * cannot be loaded
13079  *
13080  * Revision 1.84  1994/11/22  19:37:39  allender
13081  * fix array mistake
13082  *
13083  * Revision 1.83  1994/11/22  19:35:09  allender
13084  * record player ship colors in multiplayer demo recordings
13085  *
13086  * Revision 1.82  1994/11/19  15:36:42  mike
13087  * fix fix.
13088  *
13089  * Revision 1.81  1994/11/19  15:23:21  mike
13090  * rip out unused code
13091  *
13092  * Revision 1.80  1994/11/16  14:51:49  rob
13093  * Fixed network/demo incompatibility.
13094  *
13095  * Revision 1.79  1994/11/15  10:55:48  allender
13096  * made start of demo playback read initial demo information so
13097  * level will get loaded.  Made demo record to single file which
13098  * will get renamed.  Added numerics after old filename so
13099  * sequential filenames would be defaulted to
13100  *
13101  * Revision 1.78  1994/11/15  09:46:06  allender
13102  * added versioning.  Fixed problems with trying to interpolating a completely
13103  * 0 orientation matrix
13104  *
13105  * Revision 1.77  1994/11/14  14:34:31  matt
13106  * Fixed up handling when textures can't be found during remap
13107  *
13108  * Revision 1.76  1994/11/14  09:15:29  allender
13109  * make ESC from file save menu exit w/o saving.  Fix letterbox, rear view,
13110  * to normal cockpit mode transition to work correctly when skipping and
13111  * interpolating frames
13112  *
13113  * Revision 1.75  1994/11/11  16:22:07  allender
13114  * made morphing objects record only the object being morphed.
13115  *
13116  * Revision 1.74  1994/11/08  14:59:19  john
13117  * Added code to respond to network while in menus.
13118  *
13119  * Revision 1.73  1994/11/08  14:52:20  adam
13120  * *** empty log message ***
13121  *
13122  * Revision 1.72  1994/11/07  15:47:04  allender
13123  * prompt for filename when done recording demo
13124  *
13125  * Revision 1.71  1994/11/07  11:47:19  allender
13126  * when interpolating frames, delete weapon, fireball, and debris objects
13127  * from an inpolated frame if they don't appear in the next recorded
13128  * frame
13129  *
13130  * Revision 1.70  1994/11/07  11:02:41  allender
13131  * more with interpolation. I believe that I have it right now
13132  *
13133  * Revision 1.69  1994/11/07  08:47:40  john
13134  * Made wall state record.
13135  *
13136  * Revision 1.68  1994/11/05  17:22:51  john
13137  * Fixed lots of sequencing problems with newdemo stuff.
13138  *
13139  * Revision 1.67  1994/11/04  20:11:52  john
13140  * Neatening up palette stuff with demos.
13141  *
13142  * Revision 1.66  1994/11/04  16:49:44  allender
13143  * changed newdemo_do_interpolate to default to on
13144  *
13145  * Revision 1.65  1994/11/04  16:44:51  allender
13146  * added filename support for demo recording.  more auto demo stuff
13147  *
13148  * Revision 1.64  1994/11/04  13:05:31  allender
13149  * fixing the lifeleft variable again.  (I think I got it right this time)
13150  *
13151  * Revision 1.63  1994/11/04  11:37:37  allender
13152  * commented out fprintfs and fixed compiler warning
13153  *
13154  * Revision 1.62  1994/11/04  11:33:50  allender
13155  * added OBJ_FLARE and OBJ_LIGHT to obj->lifeleft recording
13156  *
13157  * Revision 1.61  1994/11/04  11:29:21  allender
13158  * more interpolation stuff -- not done yet.  Fixed so hostage vclips
13159  * render correctly.  Changed lifeleft to full precision, but only
13160  * write it when object is fireball or weapon type of object
13161  *
13162  * Revision 1.60  1994/11/03  10:00:11  allender
13163  * fixed divide by zero in calculating render time.  more interpolation
13164  * stuff which isn't quite done
13165  *
13166  * Revision 1.59  1994/11/02  17:10:59  allender
13167  * never play recorded frames when interpolation is occuring
13168  *
13169  * Revision 1.58  1994/11/02  14:28:58  allender
13170  * profile total playback time and average frame render time
13171  *
13172  * Revision 1.57  1994/11/02  14:09:03  allender
13173  * record rear view.  start of playback interpolation code -- this
13174  * is not yet done
13175  *
13176  * Revision 1.56  1994/11/01  13:25:30  allender
13177  * drop frames if playing back demo on slower machine
13178  *
13179  * Revision 1.55  1994/10/31  16:10:40  allender
13180  * record letterbox mode on death seq, and then restore
13181  *
13182  * Revision 1.54  1994/10/29  16:01:38  allender
13183  * added ND_STATE_NODEMOS to indicate that there are no demos currently
13184  * available for playback
13185  *
13186  * Revision 1.53  1994/10/29  15:38:42  allender
13187  * in newdemo_start_playback, make Newdemo_at_eof = 0
13188  *
13189  * Revision 1.52  1994/10/28  14:45:28  john
13190  * fixed typo from last checkin.
13191  *
13192  * Revision 1.51  1994/10/28  14:42:55  john
13193  * Added sound volumes to all sound calls.
13194  *
13195  * Revision 1.50  1994/10/28  14:31:57  allender
13196  * homing missle and autodemo stuff
13197  *
13198  * Revision 1.49  1994/10/28  12:42:14  allender
13199  * record homing distance
13200  *
13201  * Revision 1.48  1994/10/27  16:57:54  allender
13202  * changed demo vcr to be able to play any number of frames by storing
13203  * frame length (in bytes) in the demo file.  Added blowing up monitors
13204  *
13205  * Revision 1.47  1994/10/26  16:50:50  allender
13206  * put two functions inside of VCR_MODE ifdef
13207  *
13208  * Revision 1.46  1994/10/26  15:20:32  allender
13209  * added CT_REMOTE as valid control type for recording
13210  *
13211  * Revision 1.45  1994/10/26  14:45:35  allender
13212  * completed hacked in vcr demo playback stuff
13213  *
13214  * Revision 1.44  1994/10/26  13:40:52  allender
13215  * vcr playback of demo stuff
13216  *
13217  * Revision 1.43  1994/10/26  08:51:57  allender
13218  * record player weapon change
13219  *
13220  * Revision 1.42  1994/10/25  15:48:01  allender
13221  * add shields, energy, and player flags to demo recording.
13222  * ,
13223  *
13224  * Revision 1.41  1994/10/24  08:19:35  allender
13225  * fixed compilation errors
13226  *
13227  * Revision 1.40  1994/10/23  19:17:08  matt
13228  * Fixed bug with "no key" messages
13229  *
13230  * Revision 1.39  1994/10/22  14:15:08  mike
13231  * Suppress compiler warnings.
13232  *
13233  * Revision 1.38  1994/10/21  15:24:55  allender
13234  * compressed writing of object structures with specialized code
13235  * to write out only pertinent object structures.
13236  *
13237  * Revision 1.37  1994/10/20  13:03:17  matt
13238  * Replaced old save files (MIN/SAV/HOT) with new LVL files
13239  *
13240  * Revision 1.36  1994/09/28  23:13:10  matt
13241  * Macroized palette flash system
13242  *
13243  * Revision 1.35  1994/09/26  17:28:32  matt
13244  * Made new multiple-object morph code work with the demo system
13245  *
13246  * Revision 1.34  1994/09/10  13:31:54  matt
13247  * Made exploding walls a type of blastable walls.
13248  * Cleaned up blastable walls, making them tmap2 bitmaps.
13249  *
13250  * Revision 1.33  1994/08/15  18:05:28  john
13251  * *** empty log message ***
13252  *
13253  * Revision 1.32  1994/08/15  17:56:38  john
13254  * ,
13255  *
13256  * Revision 1.31  1994/08/10  09:44:54  john
13257  * *** empty log message ***
13258  *
13259  * Revision 1.30  1994/07/22  12:35:48  matt
13260  * Cleaned up editor/game interactions some more.
13261  *
13262  * Revision 1.29  1994/07/21  13:06:45  matt
13263  * Ripped out remants of old demo system, and added demo only system that
13264  * disables object movement and game options from menu.
13265  *
13266  * Revision 1.28  1994/07/18  16:22:44  john
13267  * Made all file read/writes call the same routine.
13268  *
13269  * Revision 1.27  1994/07/14  22:38:27  matt
13270  * Added exploding doors
13271  *
13272  * Revision 1.26  1994/07/05  12:49:04  john
13273  * Put functionality of New Hostage spec into code.
13274  *
13275  * Revision 1.25  1994/06/29  11:05:38  john
13276  * Made demos read in compressed.
13277  *
13278  * Revision 1.24  1994/06/29  09:14:06  john
13279  * Made files write out uncompressed and read in compressed.
13280  *
13281  * Revision 1.23  1994/06/28  11:55:28  john
13282  * Made newdemo system record/play directly to/from disk, so
13283  * we don't need the 4 MB buffer anymore.
13284  *
13285  * Revision 1.22  1994/06/27  15:52:38  john
13286  * #define'd out the newdemo stuff
13287  *
13288  *
13289  * Revision 1.21  1994/06/22  00:29:04  john
13290  * Fixed bug with playing demo then playing game without
13291  * loading new mine.
13292  *
13293  * Revision 1.20  1994/06/22  00:14:23  john
13294  * Attempted to fix sign.
13295  *
13296  * Revision 1.19  1994/06/21  23:57:54  john
13297  * Hopefully fixed bug with negative countdowns.
13298  *
13299  * Revision 1.18  1994/06/21  23:47:44  john
13300  * MAde Malloc always 4*1024*1024.
13301  *
13302  * Revision 1.17  1994/06/21  22:58:47  john
13303  * Added error if out of memory.
13304  *
13305  * Revision 1.16  1994/06/21  22:15:48  john
13306  * Added  % done to demo recording.
13307  *
13308  *
13309  * Revision 1.15  1994/06/21  19:45:55  john
13310  * Added palette effects to demo recording.
13311  *
13312  * Revision 1.14  1994/06/21  15:08:54  john
13313  * Made demo record HUD message and cleaned up the HUD code.
13314  *
13315  * Revision 1.13  1994/06/21  14:20:08  john
13316  * Put in hooks to record HUD messages.
13317  *
13318  * Revision 1.12  1994/06/20  11:50:15  john
13319  * Made demo record flash effect, and control center triggers.
13320  *
13321  * Revision 1.11  1994/06/17  18:01:33  john
13322  * A bunch of new stuff by John
13323  *
13324  * Revision 1.10  1994/06/17  12:13:31  john
13325  * More newdemo stuff; made editor->game transition start in slew mode.
13326  *
13327  * Revision 1.9  1994/06/16  13:14:36  matt
13328  * Fixed typo
13329  *
13330  * Revision 1.8  1994/06/16  13:02:07  john
13331  * Added morph hooks.
13332  *
13333  * Revision 1.7  1994/06/15  19:01:33  john
13334  * Added the capability to make 3d sounds play just once for the
13335  * laser hit wall effects.
13336  *
13337  * Revision 1.6  1994/06/15  14:56:59  john
13338  * Added triggers to demo recording.
13339  *
13340  * Revision 1.5  1994/06/14  20:42:15  john
13341  * Made robot matztn cntr not work until no robots or player are
13342  * in the segment.
13343  *
13344  * Revision 1.4  1994/06/14  14:43:27  john
13345  * Made doors work with newdemo system.
13346  *
13347  * Revision 1.3  1994/06/14  11:32:29  john
13348  * Made Newdemo record & restore the current mine.
13349  *
13350  * Revision 1.2  1994/06/13  21:02:43  john
13351  * Initial version of new demo recording system.
13352  *
13353  * Revision 1.1  1994/06/13  11:09:00  john
13354  * Initial revision
13355
13356 ------------------------------------------------------------------------
13357 main/newdemo.h:
13358
13359  * Revision 1.1  1995/05/16  16:00:24  allender
13360  * Initial revision
13361  *
13362  * Revision 2.0  1995/02/27  11:27:18  john
13363  * New version 2.0, which has no anonymous unions, builds with
13364  * Watcom 10.0, and doesn't require parsing BITMAPS.TBL.
13365  *
13366  * Revision 1.43  1995/01/19  09:41:43  allender
13367  * prototype for laser level recording
13368  *
13369  * Revision 1.42  1995/01/18  18:48:49  allender
13370  * added function prototype for door_open
13371  *
13372  * Revision 1.41  1995/01/17  17:42:31  allender
13373  * new prototypes for ammo counts
13374  *
13375  * Revision 1.40  1995/01/04  15:04:27  allender
13376  * added some different prototypes for registered
13377  *
13378  * Revision 1.39  1995/01/03  11:45:11  allender
13379  * extern function definition
13380  *
13381  * Revision 1.38  1994/12/29  16:43:31  allender
13382  * new function prototype
13383  *
13384  * Revision 1.37  1994/12/28  14:15:27  allender
13385  * new function prototypes
13386  *
13387  * Revision 1.36  1994/12/21  12:46:41  allender
13388  * new functions for multiplayer deaths and kills
13389  *
13390  * Revision 1.35  1994/12/12  11:32:55  allender
13391  * added new record function to restore after in rearview mode
13392  *
13393  * Revision 1.34  1994/12/08  21:03:15  allender
13394  * added new param to record_player_flags
13395  *
13396  * Revision 1.33  1994/12/08  13:47:01  allender
13397  * removed function call to record_rearview
13398  *
13399  * Revision 1.32  1994/12/06  12:57:10  allender
13400  * added new prototype for multi decloaking
13401  *
13402  * Revision 1.31  1994/12/01  11:46:34  allender
13403  * added recording prototype for multi player cloak
13404  *
13405  * Revision 1.30  1994/11/27  23:04:22  allender
13406  * function prototype for recording new levels
13407  *
13408  * Revision 1.29  1994/11/07  08:47:43  john
13409  * Made wall state record.
13410  *
13411  * Revision 1.28  1994/11/05  17:22:53  john
13412  * Fixed lots of sequencing problems with newdemo stuff.
13413  *
13414  * Revision 1.27  1994/11/04  16:48:49  allender
13415  * extern Newdemo_do_interpolate variable
13416  *
13417  * Revision 1.26  1994/11/02  14:08:53  allender
13418  * record rearview
13419  *
13420  * Revision 1.25  1994/10/31  13:35:04  allender
13421  * added two record functions to save and restore cockpit state on
13422  * death sequence
13423  *
13424  * Revision 1.24  1994/10/29  16:01:11  allender
13425  * added ND_STATE_NODEMOS to indicate that there are no demos currently
13426  * available for playback
13427  *
13428  * Revision 1.23  1994/10/28  12:41:58  allender
13429  * add homing distance recording event
13430  *
13431  * Revision 1.22  1994/10/27  16:57:32  allender
13432  * removed VCR_MODE stuff, and added monitor blowup effects
13433  *
13434  * Revision 1.21  1994/10/26  14:44:48  allender
13435  * completed hacked in vcr type demo playback states
13436  *
13437  * Revision 1.20  1994/10/26  13:40:38  allender
13438  * more vcr demo playback defines
13439  *
13440  * Revision 1.19  1994/10/26  08:51:26  allender
13441  * record player weapon change
13442  *
13443  * Revision 1.18  1994/10/25  16:25:31  allender
13444  * prototypes for shield, energy and flags
13445  *
13446  * Revision 1.17  1994/08/15  18:05:30  john
13447  * *** empty log message ***
13448  *
13449  * Revision 1.16  1994/07/21  13:11:26  matt
13450  * Ripped out remants of old demo system, and added demo only system that
13451  * disables object movement and game options from menu.
13452  *
13453  * Revision 1.15  1994/07/05  12:49:02  john
13454  * Put functionality of New Hostage spec into code.
13455  *
13456  * Revision 1.14  1994/06/27  15:53:12  john
13457  * #define'd out the newdemo stuff
13458  *
13459  *
13460  * Revision 1.13  1994/06/24  17:01:25  john
13461  * Add VFX support; Took Game Sequencing, like EndGame and stuff and
13462  * took it out of game.c and into gameseq.c
13463  *
13464  * Revision 1.12  1994/06/21  19:46:05  john
13465  * Added palette effects to demo recording.
13466  *
13467  * Revision 1.11  1994/06/21  14:19:58  john
13468  * Put in hooks to record HUD messages.
13469  *
13470  * Revision 1.10  1994/06/20  11:50:42  john
13471  * Made demo record flash effect, and control center triggers.
13472  *
13473  * Revision 1.9  1994/06/17  18:01:29  john
13474  * A bunch of new stuff by John
13475  *
13476  * Revision 1.8  1994/06/17  12:13:34  john
13477  * More newdemo stuff; made editor->game transition start in slew mode.
13478  *
13479  * Revision 1.7  1994/06/16  13:02:02  john
13480  * Added morph hooks.
13481  *
13482  * Revision 1.6  1994/06/15  19:01:42  john
13483  * Added the capability to make 3d sounds play just once for the
13484  * laser hit wall effects.
13485  *
13486  * Revision 1.5  1994/06/15  14:57:11  john
13487  * Added triggers to demo recording.
13488  *
13489  * Revision 1.4  1994/06/14  20:42:19  john
13490  * Made robot matztn cntr not work until no robots or player are
13491  * in the segment.
13492  *
13493  * Revision 1.3  1994/06/14  14:43:52  john
13494  * Made doors work with newdemo system.
13495  *
13496  * Revision 1.2  1994/06/13  21:02:44  john
13497  * Initial version of new demo recording system.
13498  *
13499  * Revision 1.1  1994/06/13  15:51:09  john
13500  * Initial revision
13501
13502 ------------------------------------------------------------------------
13503 main/newmenu.c:
13504
13505  * Revision 1.26  1996/04/14  21:07:35  allender
13506  * some change for update
13507  *
13508  * Revision 1.25  1995/10/31  10:19:25  allender
13509  * shareware stuff
13510  *
13511  * Revision 1.24  1995/10/27  11:09:04  allender
13512  * always cd to descent dir before any menu processing --
13513  * sanity check because of way mac does volume mounting and
13514  * other file stuff
13515  *
13516  * Revision 1.23  1995/10/24  18:11:19  allender
13517  * do_appl_quit saves and restores background -- don't
13518  * do any special processing.  fixed newmenu_do3 to pass width
13519  * and height to ...do_4
13520  *
13521  * Revision 1.22  1995/10/21  23:26:25  allender
13522  * can't do cmd-q in multiplayer games
13523  *
13524  * Revision 1.21  1995/10/21  22:53:25  allender
13525  * menus need to be 8 byte multiple wide -- printscreen stuff
13526  *
13527  * Revision 1.20  1995/10/20  00:50:15  allender
13528  * redbook stuff and make esc leave menu always
13529  *
13530  * Revision 1.19  1995/10/17  13:14:52  allender
13531  * mouse support for other menus now operational -- dragging
13532  * mouse will also move sliders
13533  *
13534  * Revision 1.18  1995/10/12  17:35:19  allender
13535  * mouse support for pilot and demos
13536  *
13537  * Revision 1.17  1995/10/11  12:17:47  allender
13538  * removed event loop processing
13539  *
13540  * Revision 1.16  1995/10/10  11:51:29  allender
13541  * align menus to 8 byte boundry
13542  *
13543  * Revision 1.15  1995/10/05  14:09:36  allender
13544  * lowered starting x location on menus to fixup network
13545  * status screen chopping off characters
13546  *
13547  * Revision 1.14  1995/09/24  10:52:27  allender
13548  * made close boxes work
13549  * maybe some other minor stuff?
13550  *
13551  * Revision 1.13  1995/09/15  09:02:04  allender
13552  * started putting mouse support in listboxes
13553  *
13554  * Revision 1.12  1995/09/13  08:50:14  allender
13555  * close box in this rev?  Worked on getting list box better
13556  * looking
13557  *
13558  * Revision 1.11  1995/09/01  10:52:37  allender
13559  * fixed up list boxes
13560  *
13561  * Revision 1.10  1995/08/24  16:23:08  allender
13562  * mouse support for most menus
13563  *
13564  * Revision 1.9  1995/08/08  13:46:56  allender
13565  * added macsys header file
13566  *
13567  * Revision 1.8  1995/08/01  16:03:54  allender
13568  * added file list with Desalvo's directory stuff
13569  *
13570  * Revision 1.7  1995/07/26  17:03:37  allender
13571  * show then hide cursor during newmenu operations -- not quite
13572  * right yet
13573  *
13574  * Revision 1.6  1995/07/17  08:56:26  allender
13575  * fixed up menus to look better with new high res fonts
13576  *
13577  * Revision 1.5  1995/07/12  10:35:52  allender
13578  * removed old debug thing
13579  *
13580  * Revision 1.4  1995/06/23  10:23:21  allender
13581  * menus should work in any resolution now
13582  *
13583  * Revision 1.3  1995/06/20  09:11:19  allender
13584  * changed menu system to support 640x480 instead of 320x200
13585  *
13586  * Revision 1.2  1995/06/13  13:07:30  allender
13587  * added special key to move 320x200 window to upper left corner of screen
13588  *
13589  * Revision 1.1  1995/05/16  15:29:13  allender
13590  * Initial revision
13591  *
13592  * Revision 2.8  1995/05/26  16:16:28  john
13593  * Split SATURN into define's for requiring cd, using cd, etc.
13594  * Also started adding all the Rockwell stuff.
13595  *
13596  * Revision 2.7  1995/04/23  14:54:17  john
13597  * Fixed bug with background breaking in first menu.
13598  *
13599  * Revision 2.6  1995/03/21  14:38:46  john
13600  * Ifdef'd out the NETWORK code.
13601  *
13602  * Revision 2.5  1995/03/15  14:33:29  john
13603  * Added code to force the Descent CD-rom in the drive.
13604  *
13605  * Revision 2.4  1995/03/14  18:24:28  john
13606  * Force Destination Saturn to use CD-ROM drive.
13607  *
13608  * Revision 2.3  1995/03/14  16:22:23  john
13609  * Added cdrom alternate directory stuff.
13610  *
13611  * Revision 2.2  1995/03/06  18:30:51  john
13612  * Fixed bug with newmenu trashing editor font.
13613  *
13614  * Revision 2.1  1995/03/06  15:23:17  john
13615  * New screen techniques.
13616  *
13617  * Revision 2.0  1995/02/27  11:27:55  john
13618  * New version 2.0, which has no anonymous unions, builds with
13619  * Watcom 10.0, and doesn't require parsing BITMAPS.TBL.
13620  *
13621  * Revision 1.129  1995/02/11  16:19:56  john
13622  * Added code to make the default mission be the one last played.
13623  *
13624  * Revision 1.128  1995/02/02  19:41:33  john
13625  * Added 10 save game slots.
13626  *
13627  * Revision 1.127  1995/02/01  18:13:52  john
13628  * Fixed some constants.
13629  *
13630  * Revision 1.126  1995/02/01  18:04:01  yuan
13631  * Added 50 characters to list.
13632  *
13633  * Revision 1.125  1995/02/01  13:39:35  john
13634  * Made menu text that changes not overwrite.
13635  *
13636  * Revision 1.124  1995/01/31  10:47:57  john
13637  * Added menu that you can specify the width of the menu.
13638  *
13639  * Revision 1.123  1995/01/28  17:18:12  john
13640  * Added file list box.
13641  *
13642  * Revision 1.122  1995/01/27  17:15:55  john
13643  * Made prev comment actually work.
13644  *
13645  * Revision 1.121  1995/01/27  16:49:03  john
13646  * *** empty log message ***
13647  *
13648  * Revision 1.120  1995/01/27  16:46:40  john
13649  * Made so that input_menu only clears text if -empty-.
13650  *
13651  * Revision 1.119  1995/01/27  15:25:04  john
13652  * Delete saved game when deleteing a pilot file.
13653  *
13654  * Revision 1.118  1995/01/25  16:36:09  john
13655  * Made so that when you hit enter during
13656  * game save, -empty- goes away.
13657  *
13658  * Revision 1.117  1995/01/24  16:59:30  john
13659  * took out mono debugging text.
13660  *
13661  * Revision 1.116  1995/01/24  16:23:16  john
13662  * Fixed some bugs with listboxes.
13663  *
13664  * Revision 1.115  1995/01/23  23:47:36  matt
13665  * Made keypad enter work in menus
13666  *
13667  * Revision 1.114  1995/01/23  19:29:59  john
13668  * Added scrolling listbox menus.
13669  *
13670  * Revision 1.113  1995/01/19  12:33:34  john
13671  * Made keys jump to sliders, etc in menus.
13672  *
13673  * Revision 1.112  1995/01/15  14:33:08  rob
13674  * Fixed problem with nested nm_messageboxes.
13675  *
13676  * Revision 1.111  1995/01/03  17:33:40  john
13677  * Made scrolling textbox. Used it for scores cool saying.
13678  *
13679  * Revision 1.110  1994/12/28  10:42:58  john
13680  * More VFX tweaking.
13681  *
13682  * Revision 1.109  1994/12/28  10:26:39  john
13683  * Fixed some VFX problems.
13684  *
13685  * Revision 1.108  1994/12/15  23:18:10  john
13686  * Added fix so that VFX mode doesn't hang.
13687  *
13688  * Revision 1.107  1994/12/15  12:19:55  john
13689  * Made menu use clipped bitblt functions.
13690  *
13691  * Revision 1.106  1994/12/09  00:41:30  mike
13692  * fix hang in automap print screen
13693  *
13694  * Revision 1.105  1994/12/08  10:01:34  john
13695  * Changed the way the player callsign stuff works.
13696  *
13697  * Revision 1.104  1994/12/04  15:34:30  john
13698  * Fixed bug with newmenu not restoring font properly.
13699  *
13700  * Revision 1.103  1994/12/03  17:47:09  john
13701  * Fixed bug that didn't free filename mem when not .plr files found.
13702  *
13703  * Revision 1.102  1994/12/03  15:06:15  john
13704  * If no pilot exists, bring up box asking for name.
13705  *
13706  * Revision 1.101  1994/12/03  11:04:02  john
13707  * Changed newmenu code a bit to fix bug with bogus
13708  * backgrounds occcasionally.
13709  *
13710  * Revision 1.100  1994/12/01  20:15:48  yuan
13711  * Localization.
13712  *
13713  * Revision 1.99  1994/12/01  10:33:28  john
13714  * Fixed bug with large menu backgrounds not drawing correctly.
13715  *
13716  * Revision 1.98  1994/12/01  02:41:56  john
13717  * Fixed warnining.
13718  *
13719  * Revision 1.97  1994/11/30  22:52:43  john
13720  * Fixed bug in code that made the backgrounds behind menus.
13721  *
13722  * Revision 1.96  1994/11/30  19:47:42  john
13723  * Added a check for out o' memory when mallocing background.
13724  *
13725  * Revision 1.95  1994/11/30  19:39:10  john
13726  * ..
13727  *
13728  * Revision 1.94  1994/11/30  19:38:27  john
13729  * fixed bug with previous.
13730  *
13731  * Revision 1.93  1994/11/30  19:36:47  john
13732  * Made Gravis Ultrasound work again.  Made the scores blink
13733  * at a constant rate.  Revamped the newmenu background storage,
13734  * which hopefully fixed some bugs.  Made menus in ame not pause
13735  * sound, except for the pause key.               ^== Game!
13736  *
13737  * Revision 1.92  1994/11/30  18:06:05  matt
13738  * When player types space in callsign, comes up as underscore
13739  *
13740  * Revision 1.91  1994/11/30  12:28:22  adam
13741  * added PCX support
13742  *
13743  * Revision 1.90  1994/11/30  12:10:59  adam
13744  * added support for PCX titles/brief screens
13745  *
13746  * Revision 1.89  1994/11/29  00:59:12  allender
13747  * change newmenu_get_filename so demo files can be deleted too
13748  *
13749  * Revision 1.88  1994/11/27  21:16:18  allender
13750  * made some return values in newmenu_get_filename 0 instead of -1
13751  *
13752  * Revision 1.87  1994/11/27  16:58:17  matt
13753  * Made printscreen work all the time (not just when no ndebug) and made it
13754  * work when getting a filename.
13755  *
13756  * Revision 1.86  1994/11/27  16:47:51  john
13757  * Made the call to fade in palette only happen if it needs to be, just
13758  * because I thought it might reduce code paging with vm in menus.
13759  *
13760  * Revision 1.85  1994/11/26  15:30:16  matt
13761  * Allow escape out of change pilot menu
13762  *
13763  * Revision 1.84  1994/11/26  14:17:26  matt
13764  * Player can now only enter valid chars for his name
13765  *
13766  * Revision 1.83  1994/11/23  14:13:17  allender
13767  * if no demo files, displays less "techy" message
13768  *
13769  * Revision 1.82  1994/11/21  11:55:52  john
13770  * Fixed some sound pausing in menus bugs.
13771  *
13772  * Revision 1.81  1994/11/19  15:14:58  mike
13773  * remove unused code and data
13774  *
13775  * Revision 1.80  1994/11/18  23:37:54  john
13776  * Changed some shorts to ints.
13777  *
13778  * Revision 1.79  1994/11/15  09:29:21  john
13779  * Made it so that pressing a letter when selecting players moves to
13780  * a matching choice.
13781  *
13782  * Revision 1.78  1994/11/14  17:12:28  adam
13783  * *** empty log message ***
13784  *
13785  * Revision 1.77  1994/11/14  16:58:31  rob
13786  * Tried to fix a problem with save demo dialog.
13787  *
13788  * Revision 1.76  1994/11/14  16:13:46  matt
13789  * Fixed handling of players with DOS device names
13790  *
13791  * Revision 1.75  1994/11/13  18:12:53  matt
13792  * Fixed handling of filenames that are the same as DOS devices
13793  *
13794  * Revision 1.74  1994/11/13  17:20:44  john
13795  * Fixed text a bit.
13796  *
13797  * Revision 1.73  1994/11/13  17:18:22  john
13798  * Changed wording of new pilot.
13799  *
13800  * Revision 1.72  1994/11/13  17:14:21  john
13801  * Fixed bug with player list box.
13802  *
13803  * Revision 1.71  1994/11/13  17:12:48  john
13804  * Fixed broken demo file list.
13805  *
13806  * Revision 1.70  1994/11/13  17:04:49  john
13807  * Made the callsign entry be a list box and gave the ability
13808  * to delete players.
13809  *
13810  * Revision 1.69  1994/11/13  15:38:03  john
13811  * Added critical error handler to game.  Took out -editor command line
13812  * option because it didn't work anymore and wasn't worth fixing.  Made scores
13813  * not use MINER enviroment variable on release version, and made scores
13814  * not print an error if there is no descent.hi.
13815  *
13816  * Revision 1.68  1994/11/11  18:17:03  rob
13817  * Made multi_menu_poll return a value to exit menus.
13818  *
13819  * Revision 1.67  1994/11/11  11:07:06  rob
13820  * Added include of multi.h
13821  *
13822  * Revision 1.66  1994/11/10  20:25:16  rob
13823  * John's stuff to make network menus work.
13824  *
13825  * Revision 1.65  1994/11/08  14:51:39  john
13826  * Added nm_messagebox1, (like the original, only you can pass a function).
13827  *
13828  * Revision 1.64  1994/11/08  08:30:39  john
13829  * Fixed bug with centering titles.
13830  *
13831  * Revision 1.63  1994/11/08  08:27:00  john
13832  * Made titles and subtitles center.
13833  *
13834  * Revision 1.62  1994/11/07  09:40:48  john
13835  * Neatend file list box some.
13836  *
13837  * Revision 1.61  1994/11/05  17:22:41  john
13838  * Fixed lots of sequencing problems with newdemo stuff.
13839  *
13840  * Revision 1.60  1994/11/05  15:04:08  john
13841  * Added non-popup menu for the main menu, so that scores and credits don't have to save
13842  * the background.
13843  *
13844  * Revision 1.59  1994/11/05  14:03:52  john
13845  * Fixed fade transitions between all screens by making gr_palette_fade_in and out keep
13846  * track of whether the palette is faded in or not.  Then, wherever the code needs to fade out,
13847  * it just calls gr_palette_fade_out and it will fade out if it isn't already.  The same with fade_in.
13848  * This eliminates the need for all the flags like Menu_fade_out, game_fade_in palette, etc.
13849  *
13850  * Revision 1.58  1994/11/04  20:11:50  john
13851  * Neatening up palette stuff with demos.
13852  *
13853  * Revision 1.57  1994/11/04  13:49:24  allender
13854  * fixed newmenu_get_filename to work with less than 10 files
13855  *
13856  * Revision 1.56  1994/11/03  19:37:44  john
13857  * Added scrolling file list box
13858  *
13859  * Revision 1.55  1994/10/31  18:16:42  john
13860  * Made Pad arrows work with menus.
13861  *
13862  * Revision 1.54  1994/10/28  14:54:25  john
13863  * Added forward dec. for newmenu_close.
13864  * .\
13865  *
13866  * Revision 1.53  1994/10/28  14:53:00  john
13867  * Fixed hideous bug that would bomb if you called newmenu_draw_background
13868  * before any menus were ever displayed.
13869  *
13870  * Revision 1.52  1994/10/24  19:56:53  john
13871  * Made the new user setup prompt for config options.
13872  *
13873  * Revision 1.51  1994/10/24  15:15:49  john
13874  * Made Esc exit nm_messagebox's,
13875  * ,
13876  *
13877  * Revision 1.50  1994/10/21  15:20:20  john
13878  * Made PrtScr do screen dump, not F2.
13879  *
13880  * Revision 1.49  1994/10/18  12:33:38  john
13881  * Only used copy the item text into the saved_text field
13882  * if it is an inputbox or inputbox_menu.
13883  *
13884  * Revision 1.48  1994/10/17  11:04:01  john
13885  * Made backtab work also.
13886  *
13887  * Revision 1.47  1994/10/17  10:47:49  john
13888  * MAde Tab work like down arrow.
13889  *
13890  * Revision 1.46  1994/10/17  10:45:10  john
13891  * Made the player able to abort death by pressing any button or key.
13892  *
13893  * Revision 1.45  1994/10/13  21:52:02  john
13894  * Made it so that if a messagebox has 1 choice, then
13895  * Esc will return -1.
13896  *
13897  * Revision 1.44  1994/10/13  11:35:38  john
13898  * Made Thrustmaster FCS Hat work.  Put a background behind the
13899  * keyboard configure.  Took out turn_sensitivity.  Changed sound/config
13900  * menu to new menu. Made F6 be calibrate joystick.
13901  *
13902  * Revision 1.43  1994/10/11  17:18:52  john
13903  * Fixed bug with sliders always starting at -1.
13904  *
13905  * Revision 1.42  1994/10/11  17:08:29  john
13906  * Added sliders for volume controls.
13907  *
13908  * Revision 1.41  1994/10/06  16:04:40  john
13909  * Made text items color differently than others. Adam
13910  * is gonna make a diff colored font for these.
13911  *
13912  * Revision 1.40  1994/10/06  15:08:23  rob
13913  * Allowed any negative key value to abort the menu and return.
13914  *
13915  * Revision 1.39  1994/10/04  10:26:06  matt
13916  * Changed fade in to happen every time a global var is set
13917  *
13918  * Revision 1.38  1994/10/04  09:16:08  john
13919  * If you pass -1 as choice in newmenu_do1, then
13920  * no item is highlighted until you press up or
13921  * down arrows.
13922  *
13923  * Revision 1.37  1994/10/03  23:44:37  matt
13924  * Save & restore palette effect around menus & pause message
13925  *
13926  * Revision 1.36  1994/10/03  22:59:40  matt
13927  * Re-enabled backspace to generate Int3()
13928  *
13929  * Revision 1.35  1994/10/03  19:11:21  matt
13930  * Changed string input cursor to blinking underscore
13931  *
13932  * Revision 1.34  1994/10/03  14:44:15  john
13933  * Added newmenu_do1, which allows you to pass the starting
13934  * item to the menu system
13935  *
13936  * Revision 1.33  1994/09/30  11:51:21  john
13937  * Added Matt's NM_TYPE_INPUT_MENU
13938  *
13939  * Revision 1.32  1994/09/28  17:22:56  matt
13940  * Added extra space between subtitle and menu items
13941  * Made shortcut key check ignore leading spaces in text
13942  *
13943  * Revision 1.31  1994/09/15  16:11:22  john
13944  * Added support for VFX1 head tracking. Fixed bug with memory over-
13945  * write when using stereo mode.
13946  *
13947  * Revision 1.30  1994/09/12  09:52:59  john
13948  * Made global flush function that flushes keyboard,mouse, and joystick.
13949  *
13950  * Revision 1.29  1994/09/10  19:10:54  matt
13951  * Fixed a few things (like arrow key handling) for menus with all
13952  * text items, such as the key help message.
13953  *
13954  * Revision 1.28  1994/09/01  18:55:38  john
13955  * freed scores.lbm
13956  *
13957  * Revision 1.27  1994/09/01  18:03:50  john
13958  * Neatened up scores a bit.
13959  *
13960  * Revision 1.26  1994/08/30  20:38:13  john
13961  * Passed citem in newmenu sub.
13962  *
13963  * Revision 1.25  1994/08/30  11:13:01  john
13964  * Added beveled edges to menus.
13965  *
13966  * Revision 1.24  1994/08/26  13:01:58  john
13967  * Put high score system in.
13968  *
13969  * Revision 1.23  1994/08/16  00:18:44  john
13970  * Made pressing the first letter of a menu
13971  * item move to it.
13972  *
13973  * Revision 1.22  1994/08/15  23:17:43  john
13974  * *** empty log message ***
13975  *
13976  * Revision 1.21  1994/08/15  23:15:28  john
13977  * Made 1 menu/checkbox return with any keypress.
13978  *
13979  * Revision 1.20  1994/08/12  10:18:23  john
13980  * *** empty log message ***
13981  *
13982  * Revision 1.19  1994/08/12  10:09:11  john
13983  * Made borders better.
13984  *
13985  * Revision 1.18  1994/08/12  03:11:16  john
13986  * Made network be default off; Moved network options into
13987  * main menu.  Made starting net game check that mines are the
13988  * same.
13989  *
13990  * Revision 1.17  1994/08/11  22:14:43  john
13991  * Free'd up some memory that I forgot to free.
13992  *
13993  * Revision 1.16  1994/08/11  19:27:35  john
13994  * Made the Backspace drop into the debugger only
13995  * if you're not in an inputbox.
13996  *
13997  * Revision 1.15  1994/08/11  18:01:49  matt
13998  * Added F2 and BACKSPACE keys to new menu system
13999  *
14000  * Revision 1.14  1994/08/11  14:25:58  john
14001  * *** empty log message ***
14002  *
14003  * Revision 1.13  1994/08/11  14:25:40  john
14004  * *** empty log message ***
14005  *
14006  * Revision 1.12  1994/08/11  13:47:02  john
14007  * Made newmenu have subtitles, passed key through to
14008  * the newmenu subfunctions.
14009  *
14010  * Revision 1.11  1994/08/11  12:45:08  john
14011  * *** empty log message ***
14012  *
14013  * Revision 1.10  1994/08/11  12:25:45  john
14014  * Made right_offset spacing different
14015  *
14016  * Revision 1.9  1994/08/11  12:09:49  john
14017  * Made work with bitmapped fonts.
14018  *
14019  * Revision 1.8  1994/08/10  19:56:16  john
14020  * Changed font stuff; Took out old menu; messed up lots of
14021  * other stuff like game sequencing messages, etc.
14022  *
14023  * Revision 1.7  1994/07/27  16:12:23  john
14024  * Changed newmenu system to have a callback function.
14025  * /.
14026  *
14027  * Revision 1.6  1994/07/25  15:10:23  john
14028  * *** empty log message ***
14029  *
14030  * Revision 1.5  1994/07/25  12:33:35  john
14031  * Network "pinging" in.
14032  *
14033  * Revision 1.4  1994/07/24  18:21:27  john
14034  * Took out first time stuff.
14035  *
14036  * Revision 1.3  1994/07/24  17:32:47  john
14037  * Added percent item.  Also neatend up a bit.
14038  *
14039  * Revision 1.2  1994/07/22  17:48:13  john
14040  * Added new menuing system.
14041  *
14042  * Revision 1.1  1994/07/22  13:55:38  john
14043  * Initial revision
14044
14045 ------------------------------------------------------------------------
14046 main/newmenu.h:
14047
14048  * Revision 1.3  1995/10/17  13:15:19  allender
14049  * new call to nm_listbox for close_box
14050  *
14051  * Revision 1.2  1995/09/13  08:48:50  allender
14052  * new prototype for newmenu -- have close box
14053  *
14054  * Revision 1.1  1995/05/16  16:00:32  allender
14055  * Initial revision
14056  *
14057  * Revision 2.0  1995/02/27  11:32:28  john
14058  * New version 2.0, which has no anonymous unions, builds with
14059  * Watcom 10.0, and doesn't require parsing BITMAPS.TBL.
14060  *
14061  * Revision 1.24  1995/02/11  16:20:05  john
14062  * Added code to make the default mission be the one last played.
14063  *
14064  * Revision 1.23  1995/01/31  10:21:41  john
14065  * Added code to specify width, height.
14066  *
14067  * Revision 1.22  1995/01/28  17:09:21  john
14068  * *** empty log message ***
14069  *
14070  * Revision 1.21  1995/01/23  18:38:43  john
14071  * Added listbox function.
14072  *
14073  * Revision 1.20  1994/11/26  15:29:55  matt
14074  * Allow escape out of change pilot menu
14075  *
14076  * Revision 1.19  1994/11/26  14:17:05  matt
14077  * Player can now only enter valid chars for his name
14078  *
14079  * Revision 1.18  1994/11/18  16:17:13  mike
14080  * prototype Max_linear_depth_objects.
14081  *
14082  * Revision 1.17  1994/11/08  14:51:17  john
14083  * Added nm_messagebox1, (like the original, only you can pass a function).
14084  *
14085  * Revision 1.16  1994/11/05  14:31:45  john
14086  * Added a new menu function for the background.
14087  *
14088  * Revision 1.15  1994/11/05  14:05:46  john
14089  * Fixed fade transitions between all screens by making gr_palette_fade_in and out keep
14090  * track of whether the palette is faded in or not.  Then, wherever the code needs to fade out,
14091  * it just calls gr_palette_fade_out and it will fade out if it isn't already.  The same with fade_in.
14092  * This eliminates the need for all the flags like Menu_fade_out, game_fade_in palette, etc.
14093  *
14094  * Revision 1.14  1994/11/03  19:37:35  john
14095  * Added scrolling file list box
14096  *
14097  * Revision 1.13  1994/10/13  11:34:03  john
14098  * Made Thrustmaster FCS Hat work.  Put a background behind the
14099  * keyboard configure.  Took out turn_sensitivity.  Changed sound/config
14100  * menu to new menu. Made F6 be calibrate joystick.
14101  *
14102  * Revision 1.12  1994/10/11  17:08:32  john
14103  * Added sliders for volume controls.
14104  *
14105  * Revision 1.11  1994/10/04  10:26:23  matt
14106  * Changed fade in to happen every time a global var is set
14107  *
14108  * Revision 1.10  1994/10/03  14:43:56  john
14109  * Added newmenu_do1, which allows you to pass the starting
14110  * item to the menu system
14111  *
14112  * Revision 1.9  1994/09/30  11:51:33  john
14113  * Added Matt's NM_TYPE_INPUT_MENU
14114  *
14115  * Revision 1.8  1994/08/30  20:38:28  john
14116  * Passed citem in newmenu sub.
14117  *
14118  * Revision 1.7  1994/08/12  03:11:00  john
14119  * Made network be default off; Moved network options into
14120  * main menu.  Made starting net game check that mines are the
14121  * same.
14122  *
14123  * Revision 1.6  1994/08/11  13:47:05  john
14124  * Made newmenu have subtitles, passed key through to
14125  * the newmenu subfunctions.
14126  *
14127  * Revision 1.5  1994/07/27  16:12:24  john
14128  * Changed newmenu system to have a callback function.
14129  * /.
14130  *
14131  * Revision 1.4  1994/07/24  17:41:38  john
14132  * *** empty log message ***
14133  *
14134  * Revision 1.3  1994/07/24  17:33:01  john
14135  * Added percent item.  Also neatend up a bit.
14136  *
14137  * Revision 1.2  1994/07/22  17:48:12  john
14138  * Added new menuing system.
14139  *
14140  * Revision 1.1  1994/07/22  13:55:51  john
14141  * Initial revision
14142
14143 ------------------------------------------------------------------------
14144 main/object.c:
14145
14146  * Revision 1.5  1995/10/26  14:08:03  allender
14147  * optimization to do physics on objects that didn't render last
14148  * frame only every so often
14149  *
14150  * Revision 1.4  1995/10/20  00:50:57  allender
14151  * make alt texture for player ship work correctly when cloaked
14152  *
14153  * Revision 1.3  1995/09/14  14:11:32  allender
14154  * fix_object_segs returns void
14155  *
14156  * Revision 1.2  1995/08/12  11:31:01  allender
14157  * removed #ifdef NEWDEMO -- always in
14158  *
14159  * Revision 1.1  1995/05/16  15:29:23  allender
14160  * Initial revision
14161  *
14162  * Revision 2.3  1995/06/15  12:30:51  john
14163  * Fixed bug with multiplayer ships cloaking out wrongly.
14164  *
14165  * Revision 2.2  1995/05/15  11:34:53  john
14166  * Fixed bug as Matt directed that fixed problems with the exit
14167  * triggers being missed on slow frame rate computer.
14168  *
14169  * Revision 2.1  1995/03/21  14:38:51  john
14170  * Ifdef'd out the NETWORK code.
14171  *
14172  * Revision 2.0  1995/02/27  11:28:14  john
14173  * New version 2.0, which has no anonymous unions, builds with
14174  * Watcom 10.0, and doesn't require parsing BITMAPS.TBL.
14175  *
14176  * Revision 1.335  1995/02/22  12:57:30  allender
14177  * remove anonymous unions from object structure
14178  *
14179  * Revision 1.334  1995/02/09  22:04:40  mike
14180  * fix lifeleft on badass weapons.
14181  *
14182  * Revision 1.333  1995/02/08  12:54:00  matt
14183  * Fixed object freeing code which was deleting some explosions it shouldn't
14184  *
14185  * Revision 1.332  1995/02/08  11:37:26  mike
14186  * Check for failures in call to obj_create.
14187  *
14188  * Revision 1.331  1995/02/05  17:48:52  rob
14189  * Changed assert in obj_relink, more robust.
14190  *
14191  * Revision 1.330  1995/02/05  13:39:48  mike
14192  * remove invulnerability effect code (actually, comment out).
14193  *
14194  * Revision 1.329  1995/02/04  12:29:52  rob
14195  * Get rid of potential assert error for explosion detachment.
14196  *
14197  * Revision 1.328  1995/02/01  18:15:57  rob
14198  * Removed debugging output from engine glow change.
14199  *
14200  * Revision 1.327  1995/02/01  16:20:12  matt
14201  * Made engine glow vary over a wider range, and made the glow be based
14202  * on thrust/speed, without regard to direction.
14203  *
14204  * Revision 1.326  1995/01/29  14:46:24  rob
14205  * Fixed invul. vclip to only appear on player who is invul.
14206  *
14207  * Revision 1.325  1995/01/29  13:48:16  mike
14208  * Add invulnerability graphical effect viewable by other players.
14209  *
14210  * Revision 1.324  1995/01/29  11:39:25  mike
14211  * Add invulnerability effect.
14212  *
14213  * Revision 1.323  1995/01/27  17:02:41  mike
14214  * add more information to an Error call.
14215  *
14216  * Revision 1.322  1995/01/26  22:11:30  mike
14217  * Purple chromo-blaster (ie, fusion cannon) spruce up (chromification)
14218  *
14219  * Revision 1.321  1995/01/25  20:04:10  matt
14220  * Moved matrix check to avoid orthogonalizing an uninitialize matrix
14221  *
14222  * Revision 1.320  1995/01/25  12:11:35  matt
14223  * Make sure orient matrix is orthogonal when resetting player object
14224  *
14225  * Revision 1.319  1995/01/21  21:46:22  mike
14226  * Optimize code in Assert (and prevent warning message).
14227  *
14228  * Revision 1.318  1995/01/21  21:22:16  rob
14229  * Removed HUD clear messages.
14230  * Added more Asserts to try and find illegal control type bug.
14231  *
14232  * Revision 1.317  1995/01/15  15:34:30  matt
14233  * When freeing object slots, don't free fireballs that will be deleting
14234  * other objects.
14235  *
14236  * Revision 1.316  1995/01/14  19:16:48  john
14237  * First version of new bitmap paging code.
14238  *
14239  * Revision 1.315  1995/01/12  18:53:37  john
14240  * Fixed parameter passing error.
14241  *
14242  * Revision 1.314  1995/01/12  12:09:47  yuan
14243  * Added coop object capability.
14244  *
14245  * Revision 1.313  1994/12/15  16:45:44  matt
14246  * Took out slew stuff for release version
14247  *
14248  * Revision 1.312  1994/12/15  13:04:25  mike
14249  * Replace Players[Player_num].time_total references with GameTime.
14250  *
14251  * Revision 1.311  1994/12/15  11:01:04  mike
14252  * add Object_minus_one for debugging.
14253  *
14254  * Revision 1.310  1994/12/15  03:03:33  matt
14255  * Added error checking for NULL return from object_create_explosion()
14256  *
14257  * Revision 1.309  1994/12/14  17:25:31  matt
14258  * Made next viewer func based on release not ndebug
14259  *
14260  * Revision 1.308  1994/12/13  12:55:42  mike
14261  * hostages on board messages for when you die.
14262  *
14263  * Revision 1.307  1994/12/12  17:18:11  mike
14264  * make boss cloak/teleport when get hit, make quad laser 3/4 as powerful.
14265  *
14266  * Revision 1.306  1994/12/12  00:27:11  matt
14267  * Added support for no-levelling option
14268  *
14269  * Revision 1.305  1994/12/11  22:41:14  matt
14270  * Added command-line option, -nolevel, which turns off player ship levelling
14271  *
14272  * Revision 1.304  1994/12/11  22:03:23  mike
14273  * free up object slots as necessary.
14274  *
14275  * Revision 1.303  1994/12/11  14:09:31  mike
14276  * make boss explosion sounds softer.
14277  *
14278  * Revision 1.302  1994/12/11  13:25:11  matt
14279  * Restored calls to fix_object_segs() when debugging is turned off, since
14280  * it's not a big routine, and could fix some possibly bad problems.
14281  *
14282  * Revision 1.301  1994/12/11  12:38:25  mike
14283  * make boss explosion sounds louder in create_small_fireball.
14284  *
14285  * Revision 1.300  1994/12/10  15:28:37  matt
14286  * Added asserts for debugging
14287  *
14288  * Revision 1.299  1994/12/09  16:18:51  matt
14289  * Fixed init_player_object, for editor
14290  *
14291  * Revision 1.298  1994/12/09  15:03:10  matt
14292  * Two changes for Mike:
14293  *   1.  Do better placement of camera during death sequence (prevents hang)
14294  *   2.  Only record dodging information if the player fired in a frame
14295  *
14296  * Revision 1.297  1994/12/09  14:59:12  matt
14297  * Added system to attach a fireball to another object for rendering purposes,
14298  * so the fireball always renders on top of (after) the object.
14299  *
14300  * Revision 1.296  1994/12/08  20:05:07  matt
14301  * Removed unneeded debug message
14302  *
14303  * Revision 1.295  1994/12/08  12:36:02  matt
14304  * Added new object allocation & deallocation functions so other code
14305  * could stop messing around with internal object data structures.
14306  *
14307  * Revision 1.294  1994/12/07  20:13:37  matt
14308  * Added debris object limiter
14309  *
14310  * Revision 1.293  1994/12/06  16:58:38  matt
14311  * Killed warnings
14312  *
14313  * Revision 1.292  1994/12/05  22:34:35  matt
14314  * Make tmap_override objects use override texture as alt texture.  This
14315  * should have the effect of making simpler models use the override texture.
14316  *
14317  * Revision 1.291  1994/12/05  12:23:53  mike
14318  * make camera start closer, but move away from player in death sequence.
14319  *
14320  * Revision 1.290  1994/12/02  11:11:18  mike
14321  * hook sound effect to player small explosions (ctrlcen, too).
14322  *
14323  * Revision 1.289  1994/11/28  21:50:52  mike
14324  * optimizations.
14325  *
14326  * Revision 1.288  1994/11/27  23:12:28  matt
14327  * Made changes for new mprintf calling convention
14328  *
14329  * Revision 1.287  1994/11/27  20:35:50  matt
14330  * Fixed dumb mistake
14331  *
14332  * Revision 1.286  1994/11/27  20:30:52  matt
14333  * Got rid of warning
14334  *
14335  * Revision 1.285  1994/11/21  11:43:21  mike
14336  * ndebug stuff.
14337  *
14338  * Revision 1.284  1994/11/19  15:19:37  mike
14339  * rip out unused code and data.
14340  *
14341  * Revision 1.283  1994/11/18  23:41:59  john
14342  * Changed some shorts to ints.
14343  *
14344  * Revision 1.282  1994/11/18  16:16:17  mike
14345  * Separate depth on objects vs. walls.
14346  *
14347  * Revision 1.281  1994/11/18  12:05:35  rob
14348  * Removed unnecessary invulnerability flag set in player death.
14349  * (I hope its unnecessary.. its commented out if it proves crucial)
14350  * fixes powerup dropping bug for net play.
14351  *
14352  * Revision 1.280  1994/11/16  20:36:34  rob
14353  * Changed player explosion (small) code.
14354  *
14355  * Revision 1.279  1994/11/16  18:26:04  matt
14356  * Clear tmap override on player, to fix "rock ship" bug
14357  *
14358  * Revision 1.278  1994/11/16  14:54:12  rob
14359  * Moved hook for network explosions.
14360  *
14361  * Revision 1.277  1994/11/14  11:40:42  mike
14362  * plot inner polygon on laser based on detail level.
14363  *
14364  * Revision 1.276  1994/11/10  14:02:59  matt
14365  * Hacked in support for player ships with different textures
14366  *
14367  * Revision 1.275  1994/11/08  12:19:08  mike
14368  * Make a generally useful function for putting small explosions on any object.
14369  *
14370  * Revision 1.274  1994/11/04  19:55:54  rob
14371  * Changed calls to player_explode to accomodate new parameter.
14372  *
14373  * Revision 1.273  1994/11/02  21:54:27  matt
14374  * Delete the camera when the death sequence is done
14375  *
14376  * Revision 1.272  1994/11/02  11:36:35  rob
14377  * Added player-in-process-of-dying explosions to network play.
14378  *
14379  * Revision 1.271  1994/10/31  17:25:33  matt
14380  * Fixed cloaked bug
14381  *
14382  * Revision 1.270  1994/10/31  16:11:19  allender
14383  * on demo recording, store letterbox mode in demo.
14384  *
14385  * Revision 1.269  1994/10/31  10:36:18  mike
14386  * Make cloak effect fadein/fadeout different for robots versus player.
14387  *
14388  * Revision 1.268  1994/10/30  14:11:44  mike
14389  * rip out repair center stuff.
14390  *
14391  * Revision 1.267  1994/10/28  19:43:52  mike
14392  * Boss cloaking effect.
14393  *
14394  * Revision 1.266  1994/10/27  11:33:42  mike
14395  * Add Highest_ever_object_index -- high water mark in object creation.
14396  *
14397  * Revision 1.265  1994/10/25  10:51:12  matt
14398  * Vulcan cannon powerups now contain ammo count
14399  *
14400  * Revision 1.264  1994/10/24  20:49:24  matt
14401  * Made cloaked objects pulse
14402  *
14403  * Revision 1.263  1994/10/21  12:19:45  matt
14404  * Clear transient objects when saving (& loading) games
14405  *
14406  * Revision 1.262  1994/10/21  11:25:23  mike
14407  * Use new constant IMMORTAL_TIME.
14408  *
14409  * Revision 1.261  1994/10/19  16:50:35  matt
14410  * If out of segment, put player in center of segment when checking objects
14411  *
14412  *
14413  * Revision 1.260  1994/10/17  23:21:55  mike
14414  * Clean up robot cloaking, move more to ai.c
14415  *
14416  * Revision 1.259  1994/10/17  21:34:49  matt
14417  * Added support for new Control Center/Main Reactor
14418  *
14419  * Revision 1.258  1994/10/17  21:18:04  mike
14420  * robot cloaking.
14421  *
14422  * Revision 1.257  1994/10/17  14:12:23  matt
14423  * Cleaned up problems with player dying from mine explosion
14424  *
14425  * Revision 1.256  1994/10/15  19:04:31  mike
14426  * Don't remove proximity bombs after you die.
14427  *
14428  * Revision 1.255  1994/10/14  15:57:00  mike
14429  * Don't show ids in network mode.
14430  * Fix, I hope, but in death sequence.
14431  *
14432  * Revision 1.254  1994/10/12  08:04:29  mike
14433  * Don't decloak player on death.
14434  *
14435  * Revision 1.253  1994/10/11  20:36:16  matt
14436  * Clear "transient" objects (weapons,explosions,etc.) when starting a level
14437  *
14438  * Revision 1.252  1994/10/11  12:24:09  matt
14439  * Cleaned up/change badass explosion calls
14440  *
14441  * Revision 1.251  1994/10/08  19:30:20  matt
14442  * Fixed (I hope) a bug in cloaking of multiplayer objects
14443  *
14444  * Revision 1.250  1994/10/08  14:03:15  rob
14445  * Changed cloaking routine.
14446  *
14447  * Revision 1.249  1994/10/07  22:17:27  mike
14448  * Asserts on valid segnum.
14449  *
14450  * Revision 1.248  1994/10/07  19:11:14  matt
14451  * Added cool cloak transition effect
14452
14453 ------------------------------------------------------------------------
14454 main/object.h:
14455
14456  * Revision 1.6  1995/09/20  14:24:45  allender
14457  * swap bytes on extractshortpos
14458  *
14459  * Revision 1.5  1995/09/14  14:11:42  allender
14460  * fix_object_segs returns void
14461  *
14462  * Revision 1.4  1995/08/12  12:02:44  allender
14463  * added flag to create_shortpos
14464  *
14465  * Revision 1.3  1995/07/12  12:55:08  allender
14466  * move structures back to original form as found on PC because
14467  * of network play
14468  *
14469  * Revision 1.2  1995/06/19  07:55:06  allender
14470  * rearranged structure members for possible better alignment
14471  *
14472  * Revision 1.1  1995/05/16  16:00:40  allender
14473  * Initial revision
14474  *
14475  * Revision 2.1  1995/03/31  12:24:10  john
14476  * I had changed alt_textures from a pointer to a byte. This hosed old
14477  * saved games, so I restored it to an int.
14478  *
14479  * Revision 2.0  1995/02/27  11:26:47  john
14480  * New version 2.0, which has no anonymous unions, builds with
14481  * Watcom 10.0, and doesn't require parsing BITMAPS.TBL.
14482  *
14483  * Revision 1.122  1995/02/22  12:35:53  allender
14484  * remove anonymous unions
14485  *
14486  * Revision 1.121  1995/02/06  20:43:25  rob
14487  * Extern'ed Dead_player_camera so it can be reset by multi.c
14488  *
14489  * Revision 1.120  1995/02/01  16:34:07  john
14490  * Linted.
14491  *
14492  * Revision 1.119  1995/01/29  13:46:42  mike
14493  * adapt to new create_small_fireball_on_object prototype.
14494  *
14495  * Revision 1.118  1995/01/26  22:11:27  mike
14496  * Purple chromo-blaster (ie, fusion cannon) spruce up (chromification)
14497  *
14498  * Revision 1.117  1995/01/24  12:09:29  mike
14499  * Boost MAX_OBJECTS from 250 to 350.
14500  *
14501  * Revision 1.116  1995/01/13  19:39:51  rob
14502  * Removed outdated remote_info structure.  (looking for cause of bugs
14503  *
14504  * Revision 1.115  1995/01/12  12:09:38  yuan
14505  * Added coop object capability.
14506  *
14507  * Revision 1.114  1994/12/15  13:04:20  mike
14508  * Replace Players[Player_num].time_total references with GameTime.
14509  *
14510  * Revision 1.113  1994/12/12  17:18:09  mike
14511  * make boss cloak/teleport when get hit, make quad laser 3/4 as powerful.
14512  *
14513  * Revision 1.112  1994/12/09  14:58:42  matt
14514  * Added system to attach a fireball to another object for rendering purposes,
14515  * so the fireball always renders on top of (after) the object.
14516  *
14517  * Revision 1.111  1994/12/08  12:35:35  matt
14518  * Added new object allocation & deallocation functions so other code
14519  * could stop messing around with internal object data structures.
14520  *
14521  * Revision 1.110  1994/11/21  17:30:21  matt
14522  * Increased max number of objects
14523  *
14524  * Revision 1.109  1994/11/18  23:41:52  john
14525  * Changed some shorts to ints.
14526  *
14527  * Revision 1.108  1994/11/10  14:02:45  matt
14528  * Hacked in support for player ships with different textures
14529  *
14530  * Revision 1.107  1994/11/08  12:19:27  mike
14531  * Small explosions on objects.
14532  *
14533  * Revision 1.106  1994/10/25  10:51:17  matt
14534  * Vulcan cannon powerups now contain ammo count
14535  *
14536  * Revision 1.105  1994/10/21  12:19:41  matt
14537  * Clear transient objects when saving (& loading) games
14538  *
14539  * Revision 1.104  1994/10/21  11:25:04  mike
14540  * Add IMMORTAL_TIME.
14541  *
14542  * Revision 1.103  1994/10/17  21:34:54  matt
14543  * Added support for new Control Center/Main Reactor
14544  *
14545  * Revision 1.102  1994/10/14  18:12:28  mike
14546  * Make egg dropping return object number.
14547  *
14548  * Revision 1.101  1994/10/12  21:07:19  matt
14549  * Killed unused field in object structure
14550  *
14551  * Revision 1.100  1994/10/12  10:38:24  mike
14552  * Add field OF_SILENT to obj->flags.
14553  *
14554  * Revision 1.99  1994/10/11  20:35:48  matt
14555  * Clear "transient" objects (weapons,explosions,etc.) when starting a level
14556  *
14557  * Revision 1.98  1994/10/03  20:56:13  rob
14558  * Added velocity to shortpos strucutre.
14559  *
14560  * Revision 1.97  1994/09/30  18:24:00  rob
14561  * Added new control type CT_REMOTE for remote controlled objects.
14562  * Also added a union struct 'remote_info' for this type.
14563  *
14564  * Revision 1.96  1994/09/28  09:23:05  mike
14565  * Prototype Object_type_names.
14566  *
14567  * Revision 1.95  1994/09/25  23:32:37  matt
14568  * Changed the object load & save code to read/write the structure fields one
14569  * at a time (rather than the whole structure at once).  This mean that the
14570  * object structure can be changed without breaking the load/save functions.
14571  * As a result of this change, the local_object data can be and has been
14572  * incorporated into the object array.  Also, timeleft is now a property
14573  * of all objects, and the object structure has been otherwise cleaned up.
14574  *
14575  * Revision 1.94  1994/09/25  15:45:28  matt
14576  * Added OBJ_LIGHT, a type of object that casts light
14577  * Added generalized lifeleft, and moved it to local_object
14578  *
14579  * Revision 1.93  1994/09/24  17:41:19  mike
14580  * Add stuff to Local_object structure for materialization centers.
14581  *
14582  * Revision 1.92  1994/09/24  13:16:50  matt
14583  * Added (hacked in, really) support for overriding the bitmaps used on to
14584  * texture map a polygon object, and using a new bitmap for all the faces.
14585  *
14586  * Revision 1.91  1994/09/22  19:02:14  mike
14587  * Prototype functions extract_shortpos and create_shortpos which reside in
14588  * gameseg.c, but are prototyped here to prevent circular dependencies.
14589  *
14590  * Revision 1.90  1994/09/15  21:47:14  mike
14591  * Prototype dead_player_end().
14592  *
14593  * Revision 1.89  1994/09/15  16:34:47  mike
14594  * Add danger_laser_num and danger_laser_signature to object_local to
14595  * enable robots to efficiently (too efficiently!) avoid player fire.
14596  *
14597  * Revision 1.88  1994/09/11  22:46:19  mike
14598  * Death_sequence_aborted prototyped.
14599  *
14600  * Revision 1.87  1994/09/09  20:04:30  mike
14601  * Add vclips for weapons.
14602  *
14603  * Revision 1.86  1994/09/09  14:20:54  matt
14604  * Added flag that says object uses thrust
14605  *
14606  * Revision 1.85  1994/09/08  14:51:32  mike
14607  * Make a crucial name change to a field of local_object struct.
14608  *
14609  * Revision 1.84  1994/09/07  19:16:45  mike
14610  * Homing missile.
14611  *
14612  * Revision 1.83  1994/09/06  17:05:43  matt
14613  * Added new type for dead player
14614  *
14615  * Revision 1.82  1994/09/02  11:56:09  mike
14616  * Add persistency (PF_PERSISTENT) to physics_info.
14617  *
14618  * Revision 1.81  1994/08/28  19:10:28  mike
14619  * Add Player_is_dead.
14620  *
14621  * Revision 1.80  1994/08/18  15:11:44  mike
14622  * powerup stuff.
14623  *
14624  * Revision 1.79  1994/08/15  15:24:54  john
14625  * Made players know who killed them; Disabled cheat menu
14626  * during net player; fixed bug with not being able to turn
14627  * of invulnerability; Made going into edit/starting new leve
14628  * l drop you out of a net game; made death dialog box.
14629  *
14630  * Revision 1.78  1994/08/14  23:15:12  matt
14631  * Added animating bitmap hostages, and cleaned up vclips a bit
14632  *
14633  * Revision 1.77  1994/08/13  14:58:27  matt
14634  * Finished adding support for miscellaneous objects
14635  *
14636  * Revision 1.76  1994/08/09  16:04:13  john
14637  * Added network players to editor.
14638  *
14639  * Revision 1.75  1994/08/03  21:06:19  matt
14640  * Added prototype for fix_object_segs(), and renamed now-unused spawn_pos
14641  *
14642  * Revision 1.74  1994/08/02  12:30:27  matt
14643  * Added support for spinning objects
14644  *
14645  * Revision 1.73  1994/07/27  20:53:25  matt
14646  * Added rotational drag & thrust, so turning now has momemtum like moving
14647  *
14648  * Revision 1.72  1994/07/27  19:44:21  mike
14649  * Objects containing objects.
14650  *
14651  * Revision 1.71  1994/07/22  20:43:29  matt
14652  * Fixed flares, by adding a physics flag that makes them stick to walls.
14653  *
14654  * Revision 1.70  1994/07/21  12:42:10  mike
14655  * Prototype new find_object_seg and update_object_seg.
14656  *
14657  * Revision 1.69  1994/07/19  15:26:39  mike
14658  * New ai_static structure.
14659  *
14660  * Revision 1.68  1994/07/13  00:15:06  matt
14661  * Moved all (or nearly all) of the values that affect player movement to
14662  * bitmaps.tbl
14663  *
14664  * Revision 1.67  1994/07/12  12:40:12  matt
14665  * Revamped physics system
14666  *
14667  * Revision 1.66  1994/07/06  15:26:23  yuan
14668  * Added chase mode.
14669
14670 ------------------------------------------------------------------------
14671 main/paging.c:
14672
14673  * Revision 1.5  1995/10/30  11:06:58  allender
14674  * added change to paging code ala John -- check tmap_override
14675  * when paging in robots
14676  *
14677  * Revision 1.4  1995/09/13  08:48:28  allender
14678  * John's new paging code
14679  *
14680  * Revision 1.3  1995/08/18  10:20:31  allender
14681  * changed hard coded black pixel value to use BM_XRGB
14682  *
14683  * Revision 1.2  1995/07/26  17:02:10  allender
14684  * small fix to page in effect bitmaps correctly
14685  *
14686  * Revision 1.1  1995/05/16  15:29:35  allender
14687  * Initial revision
14688  *
14689  * Revision 2.5  1995/10/07  13:18:21  john
14690  * Added PSX debugging stuff that builds .PAG files.
14691  *
14692  * Revision 2.4  1995/08/24  13:40:03  john
14693  * Added code to page in vclip for powerup disapperance and to
14694  * fix bug that made robot makers not page in the correct bot
14695  * textures.
14696  *
14697  * Revision 2.3  1995/07/26  12:09:19  john
14698  * Made code that pages in weapon_info->robot_hit_vclip not
14699  * page in unless it is a badass weapon.  Took out old functionallity
14700  * of using this if no robot exp1_vclip, since all robots have these.
14701  *
14702  * Revision 2.2  1995/07/24  13:22:11  john
14703  * Made sure everything gets paged in at the
14704  * level start.  Fixed bug with robot effects not
14705  * getting paged in correctly.
14706  *
14707  * Revision 2.1  1995/05/12  15:50:16  allender
14708  * fix to check effects dest_bm_num > -1 before paging in
14709  *
14710  * Revision 2.0  1995/02/27  11:27:39  john
14711  * New version 2.0, which has no anonymous unions, builds with
14712  * Watcom 10.0, and doesn't require parsing BITMAPS.TBL.
14713  *
14714  * Revision 1.18  1995/02/22  14:12:28  allender
14715  * remove anonyous union from object structure
14716  *
14717  * Revision 1.17  1995/02/11  22:54:15  john
14718  * Made loading for pig not show up for demos.
14719  *
14720  * Revision 1.16  1995/02/11  22:37:04  john
14721  * Made cockpit redraw.
14722  *
14723  * Revision 1.15  1995/01/28  16:29:35  john
14724  * *** empty log message ***
14725  *
14726  * Revision 1.14  1995/01/27  17:16:18  john
14727  * Added code to page in all the weapons.
14728  *
14729  * Revision 1.13  1995/01/24  21:51:22  matt
14730  * Clear the boxed message to fix a mem leakage
14731  *
14732  * Revision 1.12  1995/01/23  13:00:46  john
14733  * Added hostage vclip paging.
14734  *
14735  * Revision 1.11  1995/01/23  12:29:52  john
14736  * Added code to page in eclip on robots, dead control center,
14737  * gauges bitmaps, and weapon pictures.
14738  *
14739  * Revision 1.10  1995/01/21  12:54:15  adam
14740  * *** empty log message ***
14741  *
14742  * Revision 1.9  1995/01/21  12:41:29  adam
14743  * changed orb to loading box
14744  *
14745  * Revision 1.8  1995/01/18  15:09:02  john
14746  * Added start/stop time around paging.
14747  * Made paging clear screen around globe.
14748  *
14749  * Revision 1.7  1995/01/18  10:37:00  john
14750  * Added code to page in exploding monitors.
14751  *
14752  * Revision 1.6  1995/01/17  19:03:35  john
14753  * Added cool spinning orb during loading.
14754  *
14755  * Revision 1.5  1995/01/17  14:49:26  john
14756  * Paged in weapons.
14757  *
14758  * Revision 1.4  1995/01/17  12:14:07  john
14759  * Made walls, object explosion vclips load at level start.
14760  *
14761  * Revision 1.3  1995/01/15  13:23:24  john
14762  * First working version
14763  *
14764  * Revision 1.2  1995/01/15  11:56:45  john
14765  * Working version of paging.
14766  *
14767  * Revision 1.1  1995/01/15  11:33:37  john
14768  * Initial revision
14769
14770 ------------------------------------------------------------------------
14771 main/paging.h:
14772
14773  * Revision 1.1  1995/05/16  16:00:48  allender
14774  * Initial revision
14775  *
14776  * Revision 2.0  1995/02/27  11:30:12  john
14777  * New version 2.0, which has no anonymous unions, builds with
14778  * Watcom 10.0, and doesn't require parsing BITMAPS.TBL.
14779  *
14780  * Revision 1.2  1995/01/15  11:56:39  john
14781  * Working version of paging.
14782  *
14783  * Revision 1.1  1995/01/15  11:33:52  john
14784  * Initial revision
14785
14786 ------------------------------------------------------------------------
14787 main/physics.c:
14788
14789  * Revision 1.5  1995/10/12  17:28:08  allender
14790  * put in code to move and object to center of segment in
14791  * do_physics sim when fvi fails with bad point
14792  *
14793  * Revision 1.4  1995/08/23  21:32:44  allender
14794  * fix mcc compiler warnings
14795  *
14796  * Revision 1.3  1995/07/28  15:38:56  allender
14797  * removed isqrt thing -- not required here
14798  *
14799  * Revision 1.2  1995/07/28  15:13:29  allender
14800  * fixed vector magnitude thing
14801  *
14802  * Revision 1.1  1995/05/16  15:29:42  allender
14803  * Initial revision
14804  *
14805  * Revision 2.2  1995/03/24  14:48:54  john
14806  * Added cheat for player to go thru walls.
14807  *
14808  * Revision 2.1  1995/03/20  18:15:59  john
14809  * Added code to not store the normals in the segment structure.
14810  *
14811  * Revision 2.0  1995/02/27  11:32:06  john
14812  * New version 2.0, which has no anonymous unions, builds with
14813  * Watcom 10.0, and doesn't require parsing BITMAPS.TBL.
14814  *
14815  * Revision 1.213  1995/02/22  13:40:48  allender
14816  * remove anonymous unions from object structure
14817  *
14818  * Revision 1.212  1995/02/22  13:24:42  john
14819  * Removed the vecmat anonymous unions.
14820  *
14821  * Revision 1.211  1995/02/06  19:46:59  matt
14822  * New function (untested), set_thrust_from_velocity()
14823  *
14824  * Revision 1.210  1995/02/02  16:26:12  matt
14825  * Changed assert that was causing a problem
14826  *
14827  * Revision 1.209  1995/02/02  14:07:00  matt
14828  * Fixed confusion about which segment you are touching when you're
14829  * touching a wall.  This manifested itself in spurious lava burns.
14830  *
14831  * Revision 1.208  1995/02/01  21:03:24  john
14832  * Lintified.
14833  *
14834  * Revision 1.207  1995/01/25  13:53:35  rob
14835  * Removed an Int3 from multiplayer games.
14836  *
14837  * Revision 1.206  1995/01/23  17:30:47  rob
14838  * Removed Int3 on bogus sim time.
14839  *
14840  * Revision 1.205  1995/01/17  11:08:56  matt
14841  * Disable new-ish FVI edge checking for all objects except the player,
14842  * since it was causing problems with the fusion cannon.
14843  *
14844  * Revision 1.204  1995/01/05  09:43:49  matt
14845  * Took out int3s from new code
14846  *
14847  * Revision 1.203  1995/01/04  22:19:23  matt
14848  * Added hack to keep player from squeezing through closed walls/doors
14849  *
14850  * Revision 1.202  1995/01/02  12:38:48  mike
14851  * physics hack to crazy josh not get hung up on proximity bombs.  Matt notified via email.
14852  *
14853  * Revision 1.201  1994/12/13  15:39:22  mike
14854  * #ifndef NDEBUG some code.
14855  *
14856  * Revision 1.200  1994/12/13  13:28:34  yuan
14857  * Fixed type.
14858  *
14859  * Revision 1.199  1994/12/13  13:25:00  matt
14860  * Made bump hack compile out if so desired
14861  *
14862  * Revision 1.198  1994/12/13  12:02:39  matt
14863  * Added hack to bump player a little if stuck
14864  *
14865  * Revision 1.197  1994/12/12  00:32:23  matt
14866  * When objects other than player go out of mine, jerk to center of segment
14867  *
14868  * Revision 1.196  1994/12/10  22:52:42  mike
14869  * make physics left-the-mine checking always be in.
14870  *
14871  * Revision 1.195  1994/12/08  00:53:01  mike
14872  * oops...phys rot bug.
14873  *
14874  * Revision 1.194  1994/12/07  12:54:54  mike
14875  * tweak rotvel applied from collisions.
14876  *
14877  * Revision 1.193  1994/12/07  00:36:08  mike
14878  * fix phys_apply_rot for robots -- ai was bashing effect in next frame.
14879  *
14880  * Revision 1.192  1994/12/05  17:23:10  matt
14881  * Made a bunch of debug code compile out
14882  *
14883  * Revision 1.191  1994/12/05  16:30:10  matt
14884  * Was illegally changing an object's segment...shoot me.
14885  *
14886  * Revision 1.190  1994/12/05  11:58:51  mike
14887  * fix stupid apply_force_rot() bug.
14888  *
14889  * Revision 1.189  1994/12/05  09:42:17  mike
14890  * fix 0 mag problem when object applies force to itself.
14891  *
14892  * Revision 1.188  1994/12/04  22:48:40  matt
14893  * Physics & FVI now only build seglist for player objects, and they
14894  * responsilby deal with buffer full conditions
14895  *
14896  * Revision 1.187  1994/12/04  22:14:07  mike
14897  * apply instantaneous rotation to an object due to a force blow.
14898  *
14899  * Revision 1.186  1994/12/04  18:51:30  matt
14900  * When weapons get stuck, delete them!
14901  *
14902  * Revision 1.185  1994/12/04  18:38:56  matt
14903  * Added better handling of point-not-in-seg problem
14904  *
14905  * Revision 1.184  1994/11/27  23:13:42  matt
14906  * Made changes for new mprintf calling convention
14907  *
14908  * Revision 1.183  1994/11/25  23:46:18  matt
14909  * Fixed drag problems with framerates over 60Hz
14910  *
14911  * Revision 1.182  1994/11/25  22:15:52  matt
14912  * Added asserts to try to trap frametime < 0 bug
14913  *
14914  * Revision 1.181  1994/11/21  11:42:44  mike
14915  * ndebug stuff.
14916  *
14917  * Revision 1.180  1994/11/19  15:15:04  mike
14918  * remove unused code and data
14919  *
14920  * Revision 1.179  1994/11/16  11:25:22  matt
14921  * Abort physics if negative frametime
14922  *
14923  * Revision 1.178  1994/10/05  19:50:41  rob
14924  * Removed a non-critical Int3 where an object's segnum is checked.
14925  * Left mprintf message.
14926  *
14927  * Revision 1.177  1994/10/03  22:57:50  matt
14928  * Fixed problem with matrix corruption of non-moving (but rotating) objects
14929  *
14930  * Revision 1.176  1994/09/28  09:23:28  mike
14931  * Add useful information to mprintf(1,... error messages.
14932  *
14933  * Revision 1.175  1994/09/21  17:16:54  mike
14934  * Make objects stuck in doors go away when door opens.
14935  *
14936  * Revision 1.174  1994/09/12  14:19:06  matt
14937  * Drag & thrust now handled differently
14938  *
14939  * Revision 1.173  1994/09/09  14:21:12  matt
14940  * Use new thrust flag
14941  *
14942  * Revision 1.172  1994/09/08  16:21:57  matt
14943  * Cleaned up player-hit-wall code, and added object scrape handling
14944  * Also added weapon-on-weapon hit sound
14945  *
14946  * Revision 1.171  1994/09/02  12:30:37  matt
14947  * Fixed weapons which go through objects
14948  *
14949  * Revision 1.170  1994/09/02  11:55:14  mike
14950  * Kill redefinition of a constant which is properly defined in object.h
14951  *
14952  * Revision 1.169  1994/09/02  11:35:01  matt
14953  * Fixed typo
14954  *
14955  * Revision 1.168  1994/09/02  11:32:48  matt
14956  * Fixed object/object collisions, so you can't fly through robots anymore.
14957  * Cleaned up object damage system.
14958  *
14959  * Revision 1.167  1994/08/30  21:58:15  matt
14960  * Made phys_apply_force() do nothing to an object if it's not a phys object
14961  *
14962  * Revision 1.166  1994/08/26  10:47:01  john
14963  * New version of controls.
14964  *
14965  * Revision 1.165  1994/08/25  21:53:57  mike
14966  * Prevent counts of -1 which eventually add up to a positive number in do_ai_frame, causing
14967  * the too-many-retries behavior.
14968  *
14969  * Revision 1.164  1994/08/25  18:43:33  john
14970  * First revision of new control code.
14971  *
14972  * Revision 1.163  1994/08/17  22:18:05  mike
14973  * Make robots which have rotvel or rotthrust, but not movement, move.
14974  *
14975  * Revision 1.162  1994/08/13  17:31:18  mike
14976  * retry count stuff.
14977  *
14978  * Revision 1.161  1994/08/11  18:59:16  mike
14979  * *** empty log message ***
14980  *
14981  * Revision 1.160  1994/08/10  19:53:47  mike
14982  * Debug code (which is still in...)
14983  * and adapt to changed interface to create_path_to_player.
14984  *
14985  * Revision 1.159  1994/08/08  21:38:43  matt
14986  * Cleaned up a code a little and optimized a little
14987  *
14988  * Revision 1.158  1994/08/08  15:21:50  mike
14989  * Trap retry count >= 4, but don't do AI hack unless >= 6.
14990  *
14991  * Revision 1.157  1994/08/08  11:47:15  matt
14992  * Cleaned up fvi and physics a little
14993  *
14994  * Revision 1.156  1994/08/05  10:10:10  yuan
14995  * Commented out debug stuff that was killing framerate.
14996  *
14997  * Revision 1.155  1994/08/04  19:12:36  matt
14998  * Changed a bunch of vecmat calls to use multiple-function routines, and to
14999  * allow the use of C macros for some functions
15000  *
15001  * Revision 1.154  1994/08/04  16:33:57  mike
15002  * Kill a pile of RCS stuff.
15003  * Call create_path_to_player for a stuck object.
15004  *
15005  * Revision 1.153  1994/08/04  00:21:02  matt
15006  * Cleaned up fvi & physics error handling; put in code to make sure objects
15007  * are in correct segment; simplified segment finding for objects and points
15008  *
15009  * Revision 1.152  1994/08/01  16:25:34  matt
15010  * Check for moved_time == 0 when computing hit speed
15011  *
15012  * Revision 1.151  1994/08/01  13:30:32  matt
15013  * Made fvi() check holes in transparent walls, and changed fvi() calling
15014  * parms to take all input data in query structure.
15015  *
15016  * Revision 1.150  1994/07/29  23:41:46  matt
15017  * Fixed turn banking, which changed when I added rotational velocity
15018  *
15019  * Revision 1.149  1994/07/27  20:53:23  matt
15020  * Added rotational drag & thrust, so turning now has momemtum like moving
15021
15022 ------------------------------------------------------------------------
15023 main/physics.h:
15024
15025  * Revision 1.2  1995/08/23  21:33:04  allender
15026  * fix mcc compiler warnings
15027  *
15028  * Revision 1.1  1995/05/16  16:00:56  allender
15029  * Initial revision
15030  *
15031  * Revision 2.0  1995/02/27  11:33:06  john
15032  * New version 2.0, which has no anonymous unions, builds with
15033  * Watcom 10.0, and doesn't require parsing BITMAPS.TBL.
15034  *
15035  * Revision 1.29  1995/02/06  19:47:18  matt
15036  * New function (untested), set_thrust_from_velocity()
15037  *
15038  * Revision 1.28  1994/12/04  22:14:20  mike
15039  * apply instantaneous rotation to an object due to a force blow.
15040  *
15041  * Revision 1.27  1994/08/01  13:29:42  matt
15042  * Made fvi() check holes in transparent walls, and changed fvi() calling
15043  * parms to take all input data in query structure.
15044  *
15045  * Revision 1.26  1994/07/28  12:35:22  matt
15046  * Added prototype
15047  *
15048  * Revision 1.25  1994/07/13  21:48:05  matt
15049  * FVI() and physics now keep lists of segments passed through which the
15050  * trigger code uses.
15051  *
15052  * Revision 1.24  1994/06/30  19:01:55  matt
15053  * Moved flying controls code from physics.c to controls.c
15054  *
15055  * Revision 1.23  1994/06/16  14:14:20  mike
15056  * Change physics_lookahead to return hit_info.
15057  *
15058  * Revision 1.22  1994/06/09  09:58:43  matt
15059  * Moved find_vector_intersection() from physics.c to new file fvi.c
15060  *
15061  * Revision 1.21  1994/05/20  16:11:07  matt
15062  * Added new parm, ignore_obj, to find_vector_intersection()
15063  *
15064  * Revision 1.20  1994/05/20  15:16:58  matt
15065  * Added new fvi return type; took out some troublesome (and troubling) asserts
15066
15067 ------------------------------------------------------------------------
15068 main/piggy.c:
15069
15070  * Revision 1.16  1995/11/09  17:27:47  allender
15071  * put in missing quote on new gauge name
15072  *
15073  * Revision 1.15  1995/11/08  17:28:03  allender
15074  * add PC gauges to gauge list of non-substitutatble bitmaps
15075  *
15076  * Revision 1.14  1995/11/08  15:14:49  allender
15077  * fixed horrible bug where the piggy cache size was incorrect
15078  * for mac shareware
15079  *
15080  * Revision 1.13  1995/11/03  12:53:37  allender
15081  * shareware changes
15082  *
15083  * Revision 1.12  1995/10/21  22:25:14  allender
15084  * added bald guy cheat
15085  *
15086  * Revision 1.11  1995/10/20  22:42:15  allender
15087  * changed load path of descent.pig to :data:descent.pig
15088  *
15089  * Revision 1.10  1995/10/20  00:08:01  allender
15090  * put in event loop calls when loading data (hides it nicely
15091  * from user) so TM can get it's strokes stuff
15092  *
15093  * Revision 1.9  1995/09/13  08:48:01  allender
15094  * added lower memory requirement to load alternate bitmaps
15095  *
15096  * Revision 1.8  1995/08/16  09:39:13  allender
15097  * moved "loading" text up a little
15098  *
15099  * Revision 1.7  1995/08/08  13:54:26  allender
15100  * added macsys header file
15101  *
15102  * Revision 1.6  1995/07/12  12:49:56  allender
15103  * total hack for bitmaps > 512 bytes wide -- check these by name
15104  *
15105  * Revision 1.5  1995/07/05  16:47:05  allender
15106  * kitchen stuff
15107  *
15108  * Revision 1.4  1995/06/23  08:55:28  allender
15109  * make "loading data" text y loc based off of curcanv
15110  *
15111  * Revision 1.3  1995/06/08  14:08:52  allender
15112  * PPC aligned data sets
15113  *
15114  * Revision 1.2  1995/05/26  06:54:27  allender
15115  * removed refences to sound data at end of pig file (since they will
15116  * now be Macintosh snd resources for effects
15117  *
15118  * Revision 1.1  1995/05/16  15:29:51  allender
15119  * Initial revision
15120  *
15121  * Revision 2.10  1995/10/07  13:17:26  john
15122  * Made all bitmaps paged out by default.
15123  *
15124  * Revision 2.9  1995/04/14  14:05:24  john
15125  * *** empty log message ***
15126  *
15127  * Revision 2.8  1995/04/12  13:39:37  john
15128  * Fixed bug with -lowmem not working.
15129  *
15130  * Revision 2.7  1995/03/29  23:23:17  john
15131  * Fixed major bug with sounds not building into pig right.
15132  *
15133  * Revision 2.6  1995/03/28  18:05:00  john
15134  * Fixed it so you don't have to delete pig after changing bitmaps.tbl
15135  *
15136  * Revision 2.5  1995/03/16  23:13:06  john
15137  * Fixed bug with piggy paging in bitmap not checking for disk
15138  * error, hence bogifying textures if you pull the CD out.
15139  *
15140  * Revision 2.4  1995/03/14  16:22:27  john
15141  * Added cdrom alternate directory stuff.
15142  *
15143  * Revision 2.3  1995/03/06  15:23:20  john
15144  * New screen techniques.
15145  *
15146  * Revision 2.2  1995/02/27  13:13:40  john
15147  * Removed floating point.
15148  *
15149  * Revision 2.1  1995/02/27  12:31:25  john
15150  * Made work without editor.
15151  *
15152  * Revision 2.0  1995/02/27  11:28:02  john
15153  * New version 2.0, which has no anonymous unions, builds with
15154  * Watcom 10.0, and doesn't require parsing BITMAPS.TBL.
15155  *
15156  * Revision 1.85  1995/02/09  12:54:24  john
15157  * Made paged out bitmaps have bm_data be a valid pointer
15158  * instead of NULL, in case anyone accesses it.
15159  *
15160  * Revision 1.84  1995/02/09  12:50:59  john
15161  * Bullet-proofed the piggy loading code.
15162  *
15163  * Revision 1.83  1995/02/07  17:08:51  john
15164  * Added some error handling stuff instead of asserts.
15165  *
15166  * Revision 1.82  1995/02/03  17:06:48  john
15167  * Changed sound stuff to allow low memory usage.
15168  * Also, changed so that Sounds isn't an array of digi_sounds, it
15169  * is a ubyte pointing into GameSounds, this way the digi.c code that
15170  * locks sounds won't accidentally unlock a sound that is already playing, but
15171  * since it's Sounds[soundno] is different, it would erroneously be unlocked.
15172  *
15173  * Revision 1.81  1995/02/02  21:56:39  matt
15174  * Added data for new gauge bitmaps
15175  *
15176  * Revision 1.80  1995/02/01  23:31:57  john
15177  * Took out loading bar.
15178  *
15179  * Revision 1.79  1995/01/28  15:13:18  allender
15180  * bumped up Piggy_bitmap_cache_size
15181  *
15182  * Revision 1.78  1995/01/26  12:30:43  john
15183  * Took out prev.
15184  *
15185  * Revision 1.77  1995/01/26  12:12:17  john
15186  * Made buffer be big for bitmaps.
15187  *
15188  * Revision 1.76  1995/01/25  20:15:38  john
15189  * Made editor allocate all mem.
15190  *
15191  * Revision 1.75  1995/01/25  14:52:56  john
15192  * Made bitmap buffer be 1.5 MB.
15193  *
15194  * Revision 1.74  1995/01/22  16:03:19  mike
15195  * localization.
15196  *
15197  * Revision 1.73  1995/01/22  15:58:36  mike
15198  * localization
15199  *
15200  * Revision 1.72  1995/01/18  20:51:20  john
15201  * Took out warnings.
15202  *
15203  * Revision 1.71  1995/01/18  20:47:21  john
15204  * Added code to allocate sounds & bitmaps into diff
15205  * buffers, also made sounds not be compressed for registered.
15206  *
15207  * Revision 1.70  1995/01/18  15:08:41  john
15208  * Added start/stop time around paging.
15209  * Made paging clear screen around globe.
15210  *
15211  * Revision 1.69  1995/01/18  10:07:51  john
15212  *
15213  * Took out debugging mprintfs.
15214  *
15215  * Revision 1.68  1995/01/17  14:27:42  john
15216  * y
15217  *
15218  * Revision 1.67  1995/01/17  12:14:39  john
15219  * Made walls, object explosion vclips load at level start.
15220  *
15221  * Revision 1.66  1995/01/15  13:15:44  john
15222  * Made so that paging always happens, lowmem just loads less.
15223  * Also, make KB load print to hud.
15224  *
15225  * Revision 1.65  1995/01/15  11:56:28  john
15226  * Working version of paging.
15227  *
15228  * Revision 1.64  1995/01/14  19:17:07  john
15229  * First version of new bitmap paging code.
15230  *
15231  * Revision 1.63  1994/12/15  12:26:44  john
15232  * Added -nolowmem function.
15233  *
15234  * Revision 1.62  1994/12/14  21:12:26  john
15235  * Fixed bug with page fault when exiting and using
15236  * -nosound.
15237  *
15238  * Revision 1.61  1994/12/14  11:35:31  john
15239  * Evened out thermometer for pig read.
15240  *
15241  * Revision 1.60  1994/12/14  10:51:00  john
15242  * Sped up sound loading.
15243  *
15244  * Revision 1.59  1994/12/14  10:12:08  john
15245  * Sped up pig loading.
15246  *
15247  * Revision 1.58  1994/12/13  09:14:47  john
15248  * *** empty log message ***
15249  *
15250  * Revision 1.57  1994/12/13  09:12:57  john
15251  * Made the bar always fill up.
15252  *
15253  * Revision 1.56  1994/12/13  03:49:08  john
15254  * Made -lowmem not load the unnecessary bitmaps.
15255  *
15256  * Revision 1.55  1994/12/06  16:06:35  john
15257  * Took out piggy sorting.
15258  *
15259  * Revision 1.54  1994/12/06  15:11:14  john
15260  * Fixed bug with reading pigs.
15261  *
15262  * Revision 1.53  1994/12/06  14:14:47  john
15263  * Added code to set low mem based on memory.
15264  *
15265  * Revision 1.52  1994/12/06  14:01:10  john
15266  * Fixed bug that was causing -lowmem all the time..
15267  *
15268  * Revision 1.51  1994/12/06  13:33:48  john
15269  * Added lowmem option.
15270  *
15271  * Revision 1.50  1994/12/05  19:40:10  john
15272  * If -nosound or no sound card selected, don't load sounds from pig.
15273  *
15274  * Revision 1.49  1994/12/05  12:17:44  john
15275  * Added code that locks/unlocks digital sounds on demand.
15276  *
15277  * Revision 1.48  1994/12/05  11:39:03  matt
15278  * Fixed little mistake
15279  *
15280  * Revision 1.47  1994/12/05  09:29:22  john
15281  * Added clength to the sound field.
15282  *
15283  * Revision 1.46  1994/12/04  15:27:15  john
15284  * Fixed my stupid bug that looked at -nosound instead of digi_driver_card
15285  * to see whether or not to lock down sound memory.
15286  *
15287  * Revision 1.45  1994/12/03  14:17:00  john
15288  * Took out my debug mprintf.
15289  *
15290  * Revision 1.44  1994/12/03  13:32:37  john
15291  * Fixed bug with offscreen bitmap.
15292  *
15293  * Revision 1.43  1994/12/03  13:07:13  john
15294  * Made the pig read/write compressed sounds.
15295  *
15296  * Revision 1.42  1994/12/03  11:48:51  matt
15297  * Added option to not dump sounds to pigfile
15298  *
15299  * Revision 1.41  1994/12/02  20:02:20  matt
15300  * Made sound files constant match constant for table
15301  *
15302  * Revision 1.40  1994/11/29  11:03:09  adam
15303  * upped # of sounds
15304  *
15305  * Revision 1.39  1994/11/27  23:13:51  matt
15306  * Made changes for new mprintf calling convention
15307  *
15308  * Revision 1.38  1994/11/20  18:40:34  john
15309  * MAde the piggy.lst and piggy.all not dump for release.
15310  *
15311  * Revision 1.37  1994/11/19  23:54:45  mike
15312  * up number of bitmaps for shareware version.
15313  *
15314  * Revision 1.36  1994/11/19  19:53:05  mike
15315  * change MAX_BITMAP_FILES
15316  *
15317  * Revision 1.35  1994/11/19  10:42:56  matt
15318  * Increased number of bitmaps for non-shareware version
15319  *
15320  * Revision 1.34  1994/11/19  09:11:52  john
15321  * Added avg_color to bitmaps saved in pig.
15322  *
15323  * Revision 1.33  1994/11/19  00:07:05  john
15324  * Fixed bug with 8 char sound filenames not getting read from pig.
15325  *
15326  * Revision 1.32  1994/11/18  22:24:54  john
15327  * Added -bigpig command line that doesn't rle your pig.
15328  *
15329  * Revision 1.31  1994/11/18  21:56:53  john
15330  * Added a better, leaner pig format.
15331  *
15332  * Revision 1.30  1994/11/16  12:06:16  john
15333  * Fixed bug with calling .bbms abms.
15334  *
15335  * Revision 1.29  1994/11/16  12:00:56  john
15336  * Added piggy.all dump.
15337  *
15338  * Revision 1.28  1994/11/10  21:16:02  adam
15339  * nothing important
15340  *
15341  * Revision 1.27  1994/11/10  13:42:00  john
15342  * Made sounds not lock down if using -nosound.
15343  *
15344  * Revision 1.26  1994/11/09  19:55:40  john
15345  * Added full rle support with texture rle caching.
15346  *
15347  * Revision 1.25  1994/11/09  16:36:42  john
15348  * First version with RLE bitmaps in Pig.
15349  *
15350  * Revision 1.24  1994/10/27  19:42:59  john
15351  * Disable the piglet option.
15352  *
15353  * Revision 1.23  1994/10/27  18:51:40  john
15354  * Added -piglet option that only loads needed textures for a
15355  * mine.  Only saved ~1MB, and code still doesn't free textures
15356  * before you load a new mine.
15357  *
15358  * Revision 1.22  1994/10/25  13:11:42  john
15359  * Made the sounds sort. Dumped piggy.lst.
15360  *
15361  * Revision 1.21  1994/10/06  17:06:23  john
15362  * Took out rle stuff.
15363  *
15364  * Revision 1.20  1994/10/06  15:45:36  adam
15365  * bumped MAX_BITMAP_FILES again!
15366  *
15367  * Revision 1.19  1994/10/06  11:01:17  yuan
15368  * Upped MAX_BITMAP_FILES
15369  *
15370  * Revision 1.18  1994/10/06  10:44:45  john
15371  * Added diagnostic message and psuedo run-length-encoder
15372  * to see how much memory we would save by storing bitmaps
15373  * in a RLE method.  Also, I commented out the code that
15374  * stores 4K bitmaps on a 4K boundry to reduce pig size
15375  * a bit.
15376  *
15377  * Revision 1.17  1994/10/04  20:03:13  matt
15378  * Upped maximum number of bitmaps
15379  *
15380  * Revision 1.16  1994/10/03  18:04:20  john
15381  * Fixed bug with data_offset not set right for bitmaps
15382  * that are 64x64 and not aligned on a 4k boundry.
15383  *
15384  * Revision 1.15  1994/09/28  11:30:55  john
15385  * changed inferno.pig to descent.pig, changed the way it
15386  * is read.
15387  *
15388  * Revision 1.14  1994/09/22  16:14:17  john
15389  * Redid intro sequecing.
15390  *
15391  * Revision 1.13  1994/09/19  14:42:47  john
15392  * Locked down sounds with Virtual memory.
15393  *
15394  * Revision 1.12  1994/09/10  17:31:52  mike
15395  * Increase number of loadable bitmaps.
15396  *
15397  * Revision 1.11  1994/09/01  19:32:49  mike
15398  * Boost texture map allocation.
15399  *
15400  * Revision 1.10  1994/08/16  11:51:02  john
15401  * Added grwased pigs.
15402  *
15403  * Revision 1.9  1994/07/06  09:18:03  adam
15404  * upped bitmap #s
15405  *
15406  * Revision 1.8  1994/06/20  22:02:15  matt
15407  * Fixed bug from last change
15408  *
15409  * Revision 1.7  1994/06/20  21:33:18  matt
15410  * Made bm.h not include sounds.h, to reduce dependencies
15411  *
15412  * Revision 1.6  1994/06/20  16:52:19  john
15413  * cleaned up init output a bit.
15414  *
15415  * Revision 1.5  1994/06/08  14:20:57  john
15416  * Made piggy dump before going into game.
15417  *
15418  * Revision 1.4  1994/06/02  18:59:22  matt
15419  * Clear selector field of bitmap loaded from pig file
15420  *
15421  * Revision 1.3  1994/05/06  15:31:41  john
15422  * Made name field a bit longer.
15423  *
15424  * Revision 1.2  1994/05/06  13:02:44  john
15425  * Added piggy stuff; worked on supertransparency
15426  *
15427  * Revision 1.1  1994/05/06  11:47:26  john
15428  * Initial revision
15429
15430 ------------------------------------------------------------------------
15431 main/piggy.h:
15432
15433  * Revision 1.1  1995/05/16  16:01:04  allender
15434  * Initial revision
15435  *
15436  * Revision 2.0  1995/02/27  11:31:21  john
15437  * New version 2.0, which has no anonymous unions, builds with
15438  * Watcom 10.0, and doesn't require parsing BITMAPS.TBL.
15439  *
15440  * Revision 1.10  1995/02/03  17:08:29  john
15441  * Changed sound stuff to allow low memory usage.
15442  * Also, changed so that Sounds isn't an array of digi_sounds, it
15443  * is a ubyte pointing into GameSounds, this way the digi.c code that
15444  * locks sounds won't accidentally unlock a sound that is already playing, but
15445  * since it's Sounds[soundno] is different, it would erroneously be unlocked.
15446  *
15447  * Revision 1.9  1995/01/24  14:33:49  john
15448  * *** empty log message ***
15449  *
15450  * Revision 1.8  1995/01/24  14:32:35  john
15451  * Took out paging in code.
15452  *
15453  * Revision 1.7  1995/01/23  12:30:17  john
15454  * Made debug code that mprintf what bitmap gets paged in.
15455  *
15456  * Revision 1.6  1995/01/17  14:11:37  john
15457  * Added function that is called after level loaded.
15458  *
15459  * Revision 1.5  1995/01/14  19:16:58  john
15460  * First version of new bitmap paging code.
15461  *
15462  * Revision 1.4  1994/10/27  18:51:57  john
15463  * Added -piglet option that only loads needed textures for a
15464  * mine.  Only saved ~1MB, and code still doesn't free textures
15465  * before you load a new mine.
15466  *
15467  * Revision 1.3  1994/06/08  14:20:47  john
15468  * Made piggy dump before going into game.
15469  *
15470  * Revision 1.2  1994/05/06  13:02:40  john
15471  * Added piggy stuff; worked on supertransparency
15472  *
15473  * Revision 1.1  1994/05/06  11:47:46  john
15474  * Initial revision
15475
15476 ------------------------------------------------------------------------
15477 main/player.h:
15478
15479  * Revision 1.1  1995/05/16  16:01:11  allender
15480  * Initial revision
15481  *
15482  * Revision 2.0  1995/02/27  11:30:25  john
15483  * New version 2.0, which has no anonymous unions, builds with
15484  * Watcom 10.0, and doesn't require parsing BITMAPS.TBL.
15485  *
15486  * Revision 1.41  1994/12/20  17:56:43  yuan
15487  * Multiplayer object capability.
15488  *
15489  * Revision 1.40  1994/12/02  15:04:42  matt
15490  * Fixed bogus weapon constants and arrays
15491  *
15492  * Revision 1.39  1994/11/25  22:47:08  matt
15493  * Made saved game descriptions longer
15494  *
15495  * Revision 1.38  1994/11/21  17:29:38  matt
15496  * Cleaned up sequencing & game saving for secret levels
15497  *
15498  * Revision 1.37  1994/11/17  12:57:13  rob
15499  * Changed net_kills_level to net_killed_total.
15500  *
15501  * Revision 1.36  1994/11/14  17:20:33  rob
15502  * Bumped player file version.
15503  *
15504  * Revision 1.35  1994/11/04  19:55:06  rob
15505  * Changed a previously unused pad character to represent whether or not
15506  * the player is connected to a net game (used to be objnum=-1 but we
15507  * want to keep the objnum info in case of re-joins)
15508  *
15509  * Revision 1.34  1994/10/22  14:13:54  mike
15510  * Add homing_object_dist field to player struct.
15511  *
15512  * Revision 1.33  1994/10/22  00:08:45  matt
15513  * Fixed up problems with bonus & game sequencing
15514  * Player doesn't get credit for hostages unless he gets them out alive
15515  *
15516  * Revision 1.32  1994/10/21  20:43:03  mike
15517  * Add hostages_on_board to player struct.
15518  *
15519  * Revision 1.31  1994/10/19  20:00:00  john
15520  * Added bonus points at the end of level based on skill level.
15521  *
15522  * Revision 1.30  1994/10/19  15:14:24  john
15523  * Took % hits out of player structure, made %kills work properly.
15524  *
15525  * Revision 1.29  1994/10/19  12:12:27  john
15526  * Added hour variable.
15527  *
15528  * Revision 1.28  1994/10/17  17:24:48  john
15529  * Added starting_level to player struct.
15530  *
15531  * Revision 1.27  1994/10/13  15:42:02  mike
15532  * Remove afterburner.
15533  *
15534  * Revision 1.26  1994/10/10  17:00:23  mike
15535  * Lower number of players from 10 to 8.
15536  *
15537  * Revision 1.25  1994/10/09  14:53:26  matt
15538  * Made player cockpit state & window size save/restore with saved games & automap
15539  *
15540  * Revision 1.24  1994/10/08  20:24:10  matt
15541  * Added difficulty level to player structure for game load/save
15542  *
15543  * Revision 1.23  1994/10/05  17:39:53  rob
15544  * Changed killer_objnum to a short (was char)
15545  *
15546  * Revision 1.22  1994/10/03  22:59:07  matt
15547  * Limit callsign to 8 chars long, so we can use it as filename
15548  *
15549  * Revision 1.21  1994/09/23  10:14:30  mike
15550  * Rename PLAYER_FLAGS_INVINCIBLE to PLAYER_FLAGS_INVULNERABLE.
15551  * Add INVULNERABLE_TIME_MAX = 30 seconds.
15552  *
15553  * Revision 1.20  1994/09/21  20:44:22  matt
15554  * Player explosion fireball now specified in bitmaps.tbl
15555  *
15556  * Revision 1.19  1994/09/21  12:27:37  mike
15557  * Move CLOAK_TIME_MAX here from game.c
15558  *
15559  * Revision 1.18  1994/09/16  13:10:16  mike
15560  * Add afterburner and cloak stuff.
15561  *
15562  * Revision 1.17  1994/09/11  20:30:26  matt
15563  * Cleaned up thrust vars, changing a few names
15564  *
15565  * Revision 1.16  1994/09/09  14:22:45  matt
15566  * Added extra gun for player
15567  *
15568  * Revision 1.15  1994/09/07  13:30:11  john
15569  * Added code to tell how many packets were lost.
15570  *
15571  * Revision 1.14  1994/09/02  11:56:33  mike
15572  * Alignment on the player struct.
15573  *
15574  * Revision 1.13  1994/08/25  18:12:05  matt
15575  * Made player's weapons and flares fire from the positions on the 3d model.
15576  * Also added support for quad lasers.
15577  *
15578  * Revision 1.12  1994/08/22  15:49:40  mike
15579  * change spelling on num_missles -> num_missiles.
15580  *
15581  * Revision 1.11  1994/08/18  10:47:32  john
15582  * Cleaned up game sequencing and player death stuff
15583  * in preparation for making the player explode into
15584  * pieces when dead.
15585  *
15586  * Revision 1.10  1994/08/17  16:50:05  john
15587  * Added damaging fireballs, missiles.
15588  *
15589  * Revision 1.9  1994/08/15  00:24:10  john
15590  * First version of netgame with players killing
15591  * each other. still buggy...
15592  *
15593  * Revision 1.8  1994/08/12  22:41:26  john
15594  * Took away Player_stats; add Players array.
15595  *
15596  * Revision 1.7  1994/08/09  17:53:25  adam
15597  * *** empty log message ***
15598  *
15599  * Revision 1.6  1994/07/13  00:15:05  matt
15600  * Moved all (or nearly all) of the values that affect player movement to
15601  * bitmaps.tbl
15602  *
15603  * Revision 1.5  1994/07/08  21:44:17  matt
15604  * Made laser powerups saturate correctly
15605  *
15606  * Revision 1.4  1994/07/07  14:59:02  john
15607  * Made radar powerups.
15608  *
15609  *
15610  * Revision 1.3  1994/07/02  13:49:39  matt
15611  * Cleaned up includes
15612  *
15613  * Revision 1.2  1994/07/02  13:10:03  matt
15614  * Moved player stats struct from gameseq.h to player.h
15615  *
15616  * Revision 1.1  1994/07/02  11:00:43  matt
15617  * Initial revision
15618
15619 ------------------------------------------------------------------------
15620 main/playsave.c:
15621
15622  * Revision 1.1  1995/12/05  16:05:47  allender
15623  * Initial revision
15624  *
15625  * Revision 1.10  1995/11/03  12:53:24  allender
15626  * shareware changes
15627  *
15628  * Revision 1.9  1995/10/31  10:19:12  allender
15629  * shareware stuff
15630  *
15631  * Revision 1.8  1995/10/23  14:50:11  allender
15632  * set control type for new player *before* calling kc_set_controls
15633  *
15634  * Revision 1.7  1995/10/21  22:25:31  allender
15635  * *** empty log message ***
15636  *
15637  * Revision 1.6  1995/10/17  15:57:42  allender
15638  * removed line setting wrong COnfig_control_type
15639  *
15640  * Revision 1.5  1995/10/17  13:16:44  allender
15641  * new controller support
15642  *
15643  * Revision 1.4  1995/08/24  16:03:38  allender
15644  * call joystick code when player file uses joystick
15645  *
15646  * Revision 1.3  1995/08/03  15:15:39  allender
15647  * got player save file working (more to go for shareware)
15648  *
15649  * Revision 1.2  1995/08/01  13:57:20  allender
15650  * macified the player file stuff -- in a seperate folder
15651  *
15652  * Revision 1.1  1995/05/16  15:30:00  allender
15653  * Initial revision
15654  *
15655  * Revision 2.3  1995/05/26  16:16:23  john
15656  * Split SATURN into define's for requiring cd, using cd, etc.
15657  * Also started adding all the Rockwell stuff.
15658  *
15659  * Revision 2.2  1995/03/24  17:48:21  john
15660  * Made player files from saturn excrement the highest level for
15661  * normal descent levels.
15662  *
15663  * Revision 2.1  1995/03/21  14:38:49  john
15664  * Ifdef'd out the NETWORK code.
15665  *
15666  * Revision 2.0  1995/02/27  11:27:59  john
15667  * New version 2.0, which has no anonymous unions, builds with
15668  * Watcom 10.0, and doesn't require parsing BITMAPS.TBL.
15669  *
15670  * Revision 1.57  1995/02/13  20:34:55  john
15671  * Lintized
15672  *
15673  * Revision 1.56  1995/02/13  13:23:24  john
15674  * Fixed bug with new player joystick selection.
15675  *
15676  * Revision 1.55  1995/02/13  12:01:19  john
15677  * Fixed bug with joystick throttle still asking for
15678  * calibration with new pilots.
15679  *
15680  * Revision 1.54  1995/02/13  10:29:12  john
15681  * Fixed bug with creating new player not resetting everything to default.
15682  *
15683  * Revision 1.53  1995/02/03  10:58:46  john
15684  * Added code to save shareware style saved games into new format...
15685  * Also, made new player file format not have the saved game array in it.
15686  *
15687  * Revision 1.52  1995/02/02  21:09:28  matt
15688  * Let player start of level 8 if he made it to level 7 in the shareware
15689  *
15690  * Revision 1.51  1995/02/02  18:50:14  john
15691  * Added warning for FCS when new pilot chooses.
15692  *
15693  * Revision 1.50  1995/02/02  11:21:34  john
15694  * Made joystick calibrate when new user selects.
15695  *
15696  * Revision 1.49  1995/02/01  18:06:38  rob
15697  * Put defaults macros into descent.tex
15698  *
15699  * Revision 1.48  1995/01/25  14:37:53  john
15700  * Made joystick only prompt for calibration once...
15701  *
15702  * Revision 1.47  1995/01/24  19:37:12  matt
15703  * Took out incorrect mprintf
15704  *
15705  * Revision 1.46  1995/01/22  18:57:22  matt
15706  * Made player highest level work with missions
15707  *
15708  * Revision 1.45  1995/01/21  16:36:05  matt
15709  * Made starting level system work for now, pending integration with
15710  * mission code.
15711  *
15712  * Revision 1.44  1995/01/20  22:47:32  matt
15713  * Mission system implemented, though imcompletely
15714  *
15715  * Revision 1.43  1995/01/04  14:58:39  rob
15716  * Fixed for shareware build.
15717  *
15718  * Revision 1.42  1995/01/04  11:36:43  rob
15719  * Added compatibility with older shareware pilot files.
15720  *
15721  * Revision 1.41  1995/01/03  11:01:58  rob
15722  * fixed a default macro.
15723  *
15724  * Revision 1.40  1995/01/03  10:44:06  rob
15725  * Added default taunt macros.
15726  *
15727  * Revision 1.39  1994/12/13  10:01:16  allender
15728  * pop up message box when unable to correctly save player file
15729  *
15730  * Revision 1.38  1994/12/12  11:37:14  matt
15731  * Fixed auto leveling defaults & saving
15732  *
15733  * Revision 1.37  1994/12/12  00:26:59  matt
15734  * Added support for no-levelling option
15735  *
15736  * Revision 1.36  1994/12/10  19:09:54  matt
15737  * Added assert for valid player number when loading game
15738  *
15739  * Revision 1.35  1994/12/08  10:53:07  rob
15740  * Fixed a bug in highest_level tracking.
15741  *
15742  * Revision 1.34  1994/12/08  10:01:36  john
15743  * Changed the way the player callsign stuff works.
15744  *
15745  * Revision 1.33  1994/12/07  18:30:38  rob
15746  * Load highest level along with player (used to be only if higher)
15747  * Capped at LAST_LEVEL in case a person loads a registered player in shareware.
15748  *
15749  * Revision 1.32  1994/12/03  16:01:12  matt
15750  * When player file has bad version, force player to choose another
15751  *
15752  * Revision 1.31  1994/12/02  19:54:00  yuan
15753  * Localization.
15754  *
15755  * Revision 1.30  1994/12/02  11:01:36  yuan
15756  * Localization.
15757  *
15758  * Revision 1.29  1994/11/29  03:46:28  john
15759  * Added joystick sensitivity; Added sound channels to detail menu.  Removed -maxchannels
15760  * command line arg.
15761  *
15762  * Revision 1.28  1994/11/29  01:10:23  john
15763  * Took out code that allowed new players to
15764  * configure keyboard.
15765  *
15766  * Revision 1.27  1994/11/25  22:47:10  matt
15767  * Made saved game descriptions longer
15768  *
15769  * Revision 1.26  1994/11/22  12:10:42  rob
15770  * Fixed file handle left open if player file versions don't
15771  * match.
15772  *
15773  * Revision 1.25  1994/11/21  19:35:30  john
15774  * Replaced calls to joy_init with if (joy_present)
15775  *
15776  * Revision 1.24  1994/11/21  17:29:34  matt
15777  * Cleaned up sequencing & game saving for secret levels
15778  *
15779  * Revision 1.23  1994/11/21  11:10:01  john
15780  * Fixed bug with read-only .plr file making the config file
15781  * not update.
15782  *
15783  * Revision 1.22  1994/11/20  19:03:08  john
15784  * Fixed bug with if not having a joystick, default
15785  * player input device is cyberman.
15786  *
15787  * Revision 1.21  1994/11/17  12:24:07  matt
15788  * Made an array the right size, to fix error loading games
15789  *
15790  * Revision 1.20  1994/11/14  17:52:54  allender
15791  * add call to WriteConfigFile when player files gets written
15792  *
15793  * Revision 1.19  1994/11/14  17:19:23  rob
15794  * Removed gamma, joystick calibration, and sound settings from player file.
15795  * Added default difficulty and multi macros.
15796  *
15797  * Revision 1.18  1994/11/07  14:01:23  john
15798  * Changed the gamma correction sequencing.
15799  *
15800  * Revision 1.17  1994/11/05  17:22:49  john
15801  * Fixed lots of sequencing problems with newdemo stuff.
15802  *
15803  * Revision 1.16  1994/11/01  16:40:11  john
15804  * Added Gamma correction.
15805  *
15806  * Revision 1.15  1994/10/24  19:56:50  john
15807  * Made the new user setup prompt for config options.
15808  *
15809  * Revision 1.14  1994/10/24  17:44:21  john
15810  * Added stereo channel reversing.
15811  *
15812  * Revision 1.13  1994/10/24  16:05:12  matt
15813  * Improved handling of player names that are the names of DOS devices
15814  *
15815  * Revision 1.12  1994/10/22  00:08:51  matt
15816  * Fixed up problems with bonus & game sequencing
15817  * Player doesn't get credit for hostages unless he gets them out alive
15818  *
15819  * Revision 1.11  1994/10/19  19:59:57  john
15820  * Added bonus points at the end of level based on skill level.
15821  *
15822  * Revision 1.10  1994/10/19  15:14:34  john
15823  * Took % hits out of player structure, made %kills work properly.
15824  *
15825  * Revision 1.9  1994/10/19  12:44:26  john
15826  * Added hours field to player structure.
15827  *
15828  * Revision 1.8  1994/10/17  17:24:34  john
15829  * Added starting_level to player struct.
15830  *
15831  * Revision 1.7  1994/10/17  13:07:15  john
15832  * Moved the descent.cfg info into the player config file.
15833  *
15834  * Revision 1.6  1994/10/09  14:54:31  matt
15835  * Made player cockpit state & window size save/restore with saved games & automap
15836  *
15837  * Revision 1.5  1994/10/08  23:08:09  matt
15838  * Added error check & handling for game load/save disk io
15839  *
15840  * Revision 1.4  1994/10/05  17:40:54  rob
15841  * Bumped save_file_version to 5 due to change in player.h
15842  *
15843  * Revision 1.3  1994/10/03  23:00:54  matt
15844  * New file version for shorter callsigns
15845  *
15846  * Revision 1.2  1994/09/28  17:25:05  matt
15847  * Added first draft of game save/load system
15848  *
15849  * Revision 1.1  1994/09/27  14:39:12  matt
15850  * Initial revision
15851
15852 ------------------------------------------------------------------------
15853 main/playsave.h:
15854
15855  * Revision 1.1  1995/05/16  16:01:19  allender
15856  * Initial revision
15857  *
15858  * Revision 2.0  1995/02/27  11:31:24  john
15859  * New version 2.0, which has no anonymous unions, builds with
15860  * Watcom 10.0, and doesn't require parsing BITMAPS.TBL.
15861  *
15862  * Revision 1.10  1995/01/22  18:57:04  matt
15863  * Made player highest level work with missions
15864  *
15865  * Revision 1.9  1994/12/12  11:37:15  matt
15866  * Fixed auto leveling defaults & saving
15867  *
15868  * Revision 1.8  1994/12/08  10:01:37  john
15869  * Changed the way the player callsign stuff works.
15870  *
15871  * Revision 1.7  1994/11/25  22:46:56  matt
15872  * Made saved game descriptions longer
15873  *
15874  * Revision 1.6  1994/10/24  20:00:02  john
15875  * Added prototype for read_player_file.
15876  *
15877  * Revision 1.5  1994/10/17  13:07:12  john
15878  * Moved the descent.cfg info into the player config file.
15879  *
15880  * Revision 1.4  1994/10/09  14:54:32  matt
15881  * Made player cockpit state & window size save/restore with saved games & automap
15882  *
15883  * Revision 1.3  1994/10/08  23:08:09  matt
15884  * Added error check & handling for game load/save disk io
15885  *
15886  * Revision 1.2  1994/09/28  17:25:06  matt
15887  * Added first draft of game save/load system
15888  *
15889  * Revision 1.1  1994/09/27  15:47:23  matt
15890  * Initial revision
15891
15892 ------------------------------------------------------------------------
15893 main/polyobj.c:
15894
15895  * Revision 1.3  1995/10/25  14:07:07  allender
15896  * removed load_poly_model function
15897  *
15898  * Revision 1.2  1995/09/14  14:10:20  allender
15899  * two funtions should be void
15900  *
15901  * Revision 1.1  1995/05/16  15:30:08  allender
15902  * Initial revision
15903  *
15904  * Revision 2.1  1995/05/26  16:10:37  john
15905  * Support for new 4-byte align v8 pof files.
15906  *
15907  * Revision 2.0  1995/02/27  11:32:44  john
15908  * New version 2.0, which has no anonymous unions, builds with
15909  * Watcom 10.0, and doesn't require parsing BITMAPS.TBL.
15910  *
15911  * Revision 1.64  1995/01/14  19:16:43  john
15912  * First version of new bitmap paging code.
15913  *
15914  * Revision 1.63  1994/12/14  18:06:54  matt
15915  * Removed compile warnings
15916  *
15917  * Revision 1.62  1994/12/09  17:54:31  john
15918  * Made the CFILE's close right after reading in data.
15919  *
15920  * Revision 1.61  1994/12/09  16:13:28  mike
15921  * speedup pof file reading, but still horribly slow using hog file...problem somewhere else.
15922  *
15923  * Revision 1.60  1994/12/08  17:41:20  yuan
15924  * Cfiling stuff.
15925  *
15926  * Revision 1.59  1994/11/21  11:02:19  matt
15927  * Added error checking
15928  *
15929  * Revision 1.58  1994/11/14  11:32:49  matt
15930  * Allow switching to simpler models even when alt_textures specified
15931  *
15932  * Revision 1.57  1994/11/13  21:15:24  matt
15933  * Added basic support for more than one level of detail simplification
15934  *
15935  * Revision 1.56  1994/11/11  19:29:25  matt
15936  * Added code to show low detail polygon models
15937  *
15938  * Revision 1.55  1994/11/10  14:02:57  matt
15939  * Hacked in support for player ships with different textures
15940  *
15941  * Revision 1.54  1994/11/03  11:01:59  matt
15942  * Made robot pics lighted
15943  *
15944  * Revision 1.53  1994/11/02  16:18:34  matt
15945  * Moved draw_model_picture() out of editor
15946  *
15947  * Revision 1.52  1994/10/18  14:38:11  matt
15948  * Restored assert now that bug is fixed
15949  *
15950  * Revision 1.51  1994/10/17  21:35:03  matt
15951  * Added support for new Control Center/Main Reactor
15952  *
15953  * Revision 1.50  1994/10/14  17:46:23  yuan
15954  * Made the soft Int3 only work in net mode.
15955  *
15956  * Revision 1.49  1994/10/14  17:43:47  yuan
15957  * Added soft int3's instead of Asserts  for some common network bugs.
15958  *
15959  * Revision 1.48  1994/10/14  17:09:04  yuan
15960  * Made Assert on line 610 be if in an attempt
15961  * to bypass.
15962  *
15963  * Revision 1.47  1994/09/09  14:23:42  matt
15964  * Added glow code to polygon models for engine glow
15965  *
15966  * Revision 1.46  1994/08/26  18:03:30  matt
15967  * Added code to remap polygon model numbers by matching filenames
15968  *
15969  * Revision 1.45  1994/08/26  15:35:58  matt
15970  * Made eclips usable on more than one object at a time
15971  *
15972  * Revision 1.44  1994/08/25  18:11:58  matt
15973  * Made player's weapons and flares fire from the positions on the 3d model.
15974  * Also added support for quad lasers.
15975  *
15976  * Revision 1.43  1994/07/25  00:14:18  matt
15977  * Made a couple of minor changes for the drivethrough
15978  *
15979  * Revision 1.42  1994/07/25  00:02:41  matt
15980  * Various changes to accomodate new 3d, which no longer takes point numbers
15981  * as parms, and now only takes pointers to points.
15982
15983 ------------------------------------------------------------------------
15984 main/polyobj.h:
15985
15986  * Revision 1.2  1995/09/14  14:10:30  allender
15987  * two functions should be void
15988  *
15989  * Revision 1.1  1995/05/16  16:01:27  allender
15990  * Initial revision
15991  *
15992  * Revision 2.1  1995/02/27  18:21:54  john
15993  * Added extern for robot_points.
15994  *
15995  * Revision 2.0  1995/02/27  11:29:58  john
15996  * New version 2.0, which has no anonymous unions, builds with
15997  * Watcom 10.0, and doesn't require parsing BITMAPS.TBL.
15998  *
15999  * Revision 1.28  1995/01/12  12:10:16  adam
16000  * *** empty log message ***
16001  *
16002  * Revision 1.27  1994/11/11  19:28:58  matt
16003  * Added code to show low detail polygon models
16004  *
16005  * Revision 1.26  1994/11/10  14:03:05  matt
16006  * Hacked in support for player ships with different textures
16007  *
16008  * Revision 1.25  1994/11/02  16:18:24  matt
16009  * Moved draw_model_picture() out of editor
16010  *
16011  * Revision 1.24  1994/10/18  10:55:57  adam
16012  * bumped MAX_POLYGON_OBJECTS up
16013  *
16014  * Revision 1.23  1994/10/17  21:35:01  matt
16015  * Added support for new Control Center/Main Reactor
16016  *
16017  * Revision 1.22  1994/09/09  14:23:42  matt
16018  * Added glow code to polygon models for engine glow
16019  *
16020  * Revision 1.21  1994/08/26  18:03:43  matt
16021  * Added code to remap polygon model numbers by matching filenames
16022  *
16023  * Revision 1.20  1994/08/26  15:36:00  matt
16024  * Made eclips usable on more than one object at a time
16025  *
16026  * Revision 1.19  1994/07/22  20:44:23  matt
16027  * Killed unused fields in polygon model structure
16028  *
16029  * Revision 1.18  1994/06/16  17:52:11  matt
16030  * Made submodels rotate around their centers, not their pivot points
16031  *
16032  * Revision 1.17  1994/06/14  12:22:05  matt
16033  * Integrated with drive code, using #defines to switch versions
16034  *
16035  * Revision 1.16  1994/06/09  16:25:01  matt
16036  * Fixed confusion with two constants, MAX_SUBOBJS & MAX_SUBMODELS, which
16037  * were used for the same things, but had different values.
16038  *
16039  * Revision 1.15  1994/06/08  10:56:38  matt
16040  * Improved debris: now get submodel size from new POF files; debris now has
16041  * limited life; debris can now be blown up.
16042  *
16043  * Revision 1.14  1994/06/07  16:51:57  matt
16044  * Made object lighting work correctly; changed name of Ambient_light to
16045  * Dynamic_light; cleaned up polygobj object rendering a little.
16046  *
16047  * Revision 1.13  1994/05/26  21:08:59  matt
16048  * Moved robot stuff out of polygon model and into robot_info struct
16049  * Made new file, robot.c, to deal with robots
16050  *
16051  * Revision 1.12  1994/05/18  19:35:05  matt
16052  * Added fields for the rest of the subobj data
16053  *
16054  * Revision 1.11  1994/05/16  16:17:13  john
16055  * Bunch of stuff on my Inferno Task list May16-23
16056  *
16057  * Revision 1.10  1994/05/13  11:08:31  matt
16058  * Added support for multiple gun positions on polygon models
16059  *
16060  * Revision 1.9  1994/04/29  09:18:04  matt
16061  * Added support for multiple-piece explosions
16062  *
16063  * Revision 1.8  1994/04/28  18:44:18  matt
16064  * Took out code for old-style (non-interpreted) objects.
16065  *
16066  * Revision 1.7  1994/03/25  16:54:38  matt
16067  * draw_polygon_object() now takes pointer to animation data
16068  *
16069  * Revision 1.6  1994/03/15  17:44:33  matt
16070  * Changed a bunch of names
16071  *
16072  * Revision 1.5  1994/03/07  20:02:29  matt
16073  * Added pointer to normals in polyobj struct
16074  * Added prototype for draw_polygon_object()
16075  *
16076  * Revision 1.4  1994/03/01  17:16:19  matt
16077  * Lots of changes to support loadable binary ".pof" robot files
16078  *
16079  * Revision 1.3  1994/01/31  15:51:20  matt
16080  * Added ptr for rgb table for robot colors
16081  *
16082  * Revision 1.2  1994/01/28  13:52:01  matt
16083  * Added flesh to this previously skeletal file.
16084  *
16085  * Revision 1.1  1994/01/28  13:47:42  matt
16086  * Initial revision
16087
16088 ------------------------------------------------------------------------
16089 main/powerup.c:
16090
16091  * Revision 1.2  1995/10/31  10:18:55  allender
16092  * shareware stuff
16093  *
16094  * Revision 1.1  1995/05/16  15:30:16  allender
16095  * Initial revision
16096  *
16097  * Revision 2.2  1995/03/24  13:50:36  john
16098  * Added mega-wowie zowie to release.
16099  *
16100  * Revision 2.1  1995/03/21  14:38:39  john
16101  * Ifdef'd out the NETWORK code.
16102  *
16103  * Revision 2.0  1995/02/27  11:27:15  john
16104  * New version 2.0, which has no anonymous unions, builds with
16105  * Watcom 10.0, and doesn't require parsing BITMAPS.TBL.
16106  *
16107  * Revision 1.94  1995/02/22  13:46:03  allender
16108  * remove anonymous unions from object structure
16109  *
16110  * Revision 1.93  1995/02/06  15:52:51  mike
16111  * add mini megawow powerup for giving reasonable weapons.
16112  *
16113  * Revision 1.92  1995/01/23  22:49:59  mike
16114  * drop energy instead of primary weapon if you have primary weapon
16115  * (drop nothing if want to drop vulcan ammo and you are maxed out)
16116  * if you have primary weapon and primary weapon there, get energy instead.
16117  *
16118  * Revision 1.91  1995/01/19  09:42:22  allender
16119  * record laser levels for demos
16120  *
16121  * Revision 1.90  1994/12/31  12:28:01  rob
16122  * Added sound for coop key grabs.
16123  *
16124  * Revision 1.89  1994/12/19  19:55:17  rob
16125  * Fixing key semantics for coop game.
16126  *
16127  * Revision 1.88  1994/12/07  12:55:21  mike
16128  * tweak vulcan amounts.
16129  *
16130  * Revision 1.87  1994/12/06  13:55:36  matt
16131  * Made shield & energy powerup messages round to match HUD message
16132  *
16133  * Revision 1.86  1994/12/03  19:03:57  matt
16134  * Fixed vulcan ammo HUD message
16135  *
16136  * Revision 1.85  1994/11/29  11:35:41  rob
16137  * Added sound casting for grabbing powerups.
16138  *
16139  * Revision 1.84  1994/11/28  11:26:38  matt
16140  * Cleaned up hud message printing for picking up weapons
16141  *
16142  * Revision 1.83  1994/11/27  23:14:01  matt
16143  * Made changes for new mprintf calling convention
16144  *
16145  * Revision 1.82  1994/11/21  16:02:51  mike
16146  * comment out unused powerups.
16147  *
16148  * Revision 1.81  1994/11/20  18:25:47  john
16149  * Fixed some #ifndef RELEASE inconsistancies.
16150  *
16151  * Revision 1.80  1994/11/19  23:54:13  mike
16152  * limit megawowiezowie to shareware powerups if in shareware version.
16153  *
16154  * Revision 1.79  1994/11/14  16:06:16  yuan
16155  * Made cloak and invulnerability only picked up once.
16156  *
16157  * Revision 1.78  1994/11/07  17:41:06  mike
16158  * messages for when you're fully stocked with missiles.
16159  *
16160  * Revision 1.77  1994/10/28  14:42:50  john
16161  * Added sound volumes to all sound calls.
16162  *
16163  * Revision 1.76  1994/10/26  15:55:23  yuan
16164  * Made vulcan cannon give 100 ammo if it has less than that.
16165  *
16166  * Revision 1.75  1994/10/26  15:54:57  yuan
16167  * *** empty log message ***
16168  *
16169  * Revision 1.74  1994/10/25  14:31:25  allender
16170  * Fixed bug where getting cloak powerup while cloaked resulted in
16171  * player being cloaked forever.
16172  *
16173  * Revision 1.73  1994/10/25  10:51:21  matt
16174  * Vulcan cannon powerups now contain ammo count
16175  *
16176  * Revision 1.72  1994/10/21  20:41:32  mike
16177  * Fix silly backwards (- instead of +) bug in invulnerability powerup.
16178  *
16179  * Revision 1.71  1994/10/20  09:49:23  mike
16180  * Fix up powerups in some way.
16181  *
16182  * Revision 1.70  1994/10/19  11:16:25  mike
16183  * Limit amount of each type of ammo player can hold.
16184  *
16185  * Revision 1.69  1994/10/17  14:12:11  matt
16186  * Added sound for powerup disappearance effect
16187  *
16188  * Revision 1.68  1994/10/17  14:07:04  mike
16189  * Make shields and energy max out at 200.
16190  *
16191  * Revision 1.67  1994/10/16  12:43:37  mike
16192  * Don't allow you to pick up a primary weapon, or invulnerability, you already have.
16193  * Make cloak time additive.
16194  *
16195  * Revision 1.66  1994/10/15  19:05:30  mike
16196  * Define constants for vulcan ammo amounts.
16197  *
16198  * Revision 1.65  1994/10/14  15:57:28  mike
16199  * When you pick up a laser boost or quad_laser powerup, update weapon display.
16200  *
16201  * Revision 1.64  1994/10/13  10:57:51  adam
16202  * fiddled with powerup disappearance
16203  *
16204  * Revision 1.63  1994/10/12  13:07:33  mike
16205  * Make powerup play vclip when it goes away.
16206  *
16207  * Revision 1.62  1994/10/12  08:04:42  mike
16208  * Make proximity powerup worth 4 bombs.
16209  *
16210  * Revision 1.61  1994/10/08  23:37:33  matt
16211  * Don't pick up weapons you already have; also fixed auto_select bug
16212  * for seconary weapons
16213  *
16214  * Revision 1.60  1994/10/08  15:41:00  mike
16215  * Diminish palette effect due to powerups.
16216  *
16217  * Revision 1.59  1994/10/07  23:37:45  matt
16218  * Made weapons select when pick up better one
16219  *
16220  * Revision 1.58  1994/10/07  22:09:20  rob
16221  * Added network hook for grabbing the cloaking device.
16222
16223 ------------------------------------------------------------------------
16224 main/powerup.h:
16225
16226  * Revision 1.1  1995/05/16  16:01:35  allender
16227  * Initial revision
16228  *
16229  * Revision 2.0  1995/02/27  11:27:35  john
16230  * New version 2.0, which has no anonymous unions, builds with
16231  * Watcom 10.0, and doesn't require parsing BITMAPS.TBL.
16232  *
16233  * Revision 1.34  1995/02/06  15:52:37  mike
16234  * add mini megawow powerup for giving reasonable weapons.
16235  *
16236  * Revision 1.33  1995/01/30  17:14:11  mike
16237  * halve rate of vulcan ammo consumption.
16238  *
16239  * Revision 1.32  1995/01/15  20:47:56  mike
16240  * add lighting field to powerups.
16241  *
16242  * Revision 1.31  1994/12/12  21:39:58  matt
16243  * Changed vulcan ammo: 10K max, 5K w/weapon, 1250 per powerup
16244  *
16245  * Revision 1.30  1994/12/07  12:55:26  mike
16246  * tweak vulcan amounts.
16247  *
16248  * Revision 1.29  1994/12/02  20:06:46  matt
16249  * Made vulcan ammo print at approx 25 times actual
16250  *
16251  * Revision 1.28  1994/10/26  15:56:27  yuan
16252  * Made vulcan cannon give 100 ammo if it has less than that.
16253  *
16254  * Revision 1.27  1994/10/15  19:07:10  mike
16255  * Define constants for amount of vulcan ammo per powerup.
16256  *
16257  * Revision 1.26  1994/09/26  13:29:38  matt
16258  * Added extra life each 100,000 points, and show icons on HUD for num lives
16259  *
16260  * Revision 1.25  1994/09/22  19:00:25  mike
16261  * Kill constants ENERGY_BOOST and SHIELD_BOOST: it's now difficulty level dependent.
16262  *
16263  * Revision 1.24  1994/09/20  19:46:11  mike
16264  * Fix powerup number assignments.
16265  *
16266  * Revision 1.23  1994/09/02  11:53:34  mike
16267  * Add the megawow powerup.  If you don't know about it, that's because it's a secret.
16268  *
16269  * Revision 1.22  1994/09/01  10:41:35  matt
16270  * Sizes for powerups now specified in bitmaps.tbl; blob bitmaps now plot
16271  * correctly if width & height of bitmap are different.
16272  *
16273  * Revision 1.21  1994/08/31  19:26:14  mike
16274  * Start adding new pile of powerups.
16275  *
16276  * Revision 1.20  1994/08/25  17:56:08  matt
16277  * Added quad laser powerup
16278  *
16279  * Revision 1.19  1994/08/18  15:11:50  mike
16280  * missile powerups.
16281  *
16282  * Revision 1.18  1994/08/09  17:54:33  adam
16283  * upped no. of powerup types
16284  *
16285  * Revision 1.17  1994/08/09  17:53:39  adam
16286  * *** empty log message ***
16287  *
16288  * Revision 1.16  1994/07/27  19:44:16  mike
16289  * Objects containing objects.
16290  *
16291  * Revision 1.15  1994/07/26  18:31:32  mike
16292  * Move some constants here from eobject.c.
16293  *
16294  * Revision 1.14  1994/07/20  17:35:03  yuan
16295  * Some minor bug fixes and new key gauges...
16296  *
16297  * Revision 1.13  1994/07/12  15:53:23  john
16298  * *** empty log message ***
16299  *
16300  * Revision 1.12  1994/07/12  15:30:47  mike
16301  * Prototype diminish_towards_max.
16302  *
16303  * Revision 1.11  1994/07/07  14:59:04  john
16304  * Made radar powerups.
16305  *
16306  *
16307  * Revision 1.10  1994/07/01  16:35:40  yuan
16308  * Added key system
16309  *
16310  * Revision 1.9  1994/06/29  19:43:33  matt
16311  * Made powerup animation not happen in render routine
16312  *
16313  * Revision 1.8  1994/06/21  18:54:03  matt
16314  * Added support for powerups that don't get picked up if not needed, but this
16315  * feature is commented out at the end of do_powerup(), since the physics gave
16316  * me all sorts of problems, with the player getting stuck on a powerup.
16317  *
16318  * Revision 1.7  1994/06/08  18:16:32  john
16319  * Bunch of new stuff that basically takes constants out of the code
16320  * and puts them into bitmaps.tbl.
16321  *
16322  * Revision 1.6  1994/05/18  13:26:30  yuan
16323  * *** empty log message ***
16324  *
16325  * Revision 1.5  1994/05/17  17:01:48  yuan
16326  * Added constant for boosts.
16327  *
16328  * Revision 1.4  1994/04/06  14:42:50  yuan
16329  * Adding new powerups.
16330  *
16331  * Revision 1.3  1994/04/01  14:36:59  yuan
16332  * John's head is an extra life...
16333  *
16334  * Revision 1.2  1994/04/01  11:15:22  yuan
16335  * Added multiple bitmap functionality to all objects...
16336  * (hostages, powerups, lasers, etc.)
16337  * Hostages and powerups are implemented in the object system,
16338  * just need to finish function call to "affect" player.
16339  *
16340  * Revision 1.1  1994/03/31  17:01:43  yuan
16341  * Initial revision
16342
16343 ------------------------------------------------------------------------
16344 main/render.c:
16345
16346  * Revision 1.9  1995/11/20  17:17:48  allender
16347  * *** empty log message ***
16348  *
16349  * Revision 1.8  1995/10/26  14:08:35  allender
16350  * added assigment for physics optimization
16351  *
16352  * Revision 1.7  1995/09/22  14:28:46  allender
16353  * changed render_zoom to make game match PC aspect
16354  *
16355  * Revision 1.6  1995/08/14  14:35:54  allender
16356  * change transparency to 0
16357  *
16358  * Revision 1.5  1995/08/12  11:32:02  allender
16359  * removed #ifdef NEWDEMO -- always in
16360  *
16361  * Revision 1.4  1995/07/05  16:48:31  allender
16362  * kitchen stuff
16363  *
16364  * Revision 1.3  1995/06/23  10:22:54  allender
16365  * fix outline mode
16366  *
16367  * Revision 1.2  1995/06/16  16:11:18  allender
16368  * changed sort func to accept const parameters
16369  *
16370  * Revision 1.1  1995/05/16  15:30:24  allender
16371  * Initial revision
16372  *
16373  * Revision 2.5  1995/12/19  15:31:36  john
16374  * Made stereo mode only record 1 eye in demo.
16375  *
16376  * Revision 2.4  1995/03/20  18:15:53  john
16377  * Added code to not store the normals in the segment structure.
16378  *
16379  * Revision 2.3  1995/03/13  16:11:05  john
16380  * Maybe fixed bug that lighting didn't work with vr helmets.
16381  *
16382  * Revision 2.2  1995/03/09  15:33:49  john
16383  * Fixed bug with iglasses timeout too long, and objects
16384  * disappearing from left eye.
16385  *
16386  * Revision 2.1  1995/03/06  15:23:59  john
16387  * New screen techniques.
16388  *
16389  * Revision 2.0  1995/02/27  11:31:01  john
16390  * New version 2.0, which has no anonymous unions, builds with
16391  * Watcom 10.0, and doesn't require parsing BITMAPS.TBL.
16392  *
16393  * Revision 1.252  1995/02/22  13:49:38  allender
16394  * remove anonymous unions from object structure
16395  *
16396  * Revision 1.251  1995/02/11  15:07:26  matt
16397  * Took out code which was mostly intended as part of a larger renderer
16398  * change which never happened.  This new code was causing problems with
16399  * the level 4 control center.
16400  *
16401  * Revision 1.250  1995/02/07  16:28:53  matt
16402  * Fixed problem with new code
16403  *
16404  * Revision 1.249  1995/02/06  14:38:58  matt
16405  * Took out some code that didn't compile when editor in
16406  *
16407  * Revision 1.248  1995/02/06  13:45:25  matt
16408  * Structural changes, plus small sorting improvements
16409  *
16410  * Revision 1.247  1995/02/02  15:59:26  matt
16411  * Changed assert to int3.
16412  *
16413  * Revision 1.246  1995/02/01  21:02:27  matt
16414  * Added partial fix for rendering bugs
16415  * Ripped out laser hack system
16416  *
16417  * Revision 1.245  1995/01/20  15:14:30  matt
16418  * Added parens to fix precedence bug
16419  *
16420  * Revision 1.244  1995/01/14  19:16:59  john
16421  * First version of new bitmap paging code.
16422  *
16423  * Revision 1.243  1995/01/03  20:19:25  john
16424  * Pretty good working version of game save.
16425  *
16426  * Revision 1.242  1994/12/29  13:51:05  john
16427  * Made the floating reticle draw in the spot
16428  * regardless of the eye offset.
16429  *
16430  * Revision 1.241  1994/12/23  15:02:55  john
16431  * Tweaked floating reticle.
16432  *
16433  * Revision 1.240  1994/12/23  14:27:45  john
16434  * Changed offset of floating reticle to line up with
16435  * lasers a bit better.
16436  *
16437  * Revision 1.239  1994/12/23  14:22:50  john
16438  * Added floating reticle for VR helments.
16439  *
16440  * Revision 1.238  1994/12/13  14:07:50  matt
16441  * Fixed tmap_num2 bug in search mode
16442  *
16443  * Revision 1.237  1994/12/11  00:45:53  matt
16444  * Fixed problem when object sort buffer got full
16445  *
16446  * Revision 1.236  1994/12/09  18:46:06  matt
16447  * Added a little debugging
16448  *
16449  * Revision 1.235  1994/12/09  14:59:16  matt
16450  * Added system to attach a fireball to another object for rendering purposes,
16451  * so the fireball always renders on top of (after) the object.
16452  *
16453  * Revision 1.234  1994/12/08  15:46:54  matt
16454  * Fixed buffer overflow that caused seg depth screwup
16455  *
16456  * Revision 1.233  1994/12/08  11:51:53  matt
16457  * Took out some unused stuff
16458  *
16459  * Revision 1.232  1994/12/06  16:31:48  mike
16460  * fix detriangulation problems.
16461  *
16462  * Revision 1.231  1994/12/05  15:32:51  matt
16463  * Changed an assert to an int3 & return
16464  *
16465  * Revision 1.230  1994/12/04  17:28:04  matt
16466  * Got rid of unused no_render_flag array, and took out box clear when searching
16467  *
16468  * Revision 1.229  1994/12/04  15:51:14  matt
16469  * Fixed linear tmap transition for objects
16470  *
16471  * Revision 1.228  1994/12/03  20:16:50  matt
16472  * Turn off window clip for objects
16473  *
16474  * Revision 1.227  1994/12/03  14:48:00  matt
16475  * Restored some default settings
16476  *
16477  * Revision 1.226  1994/12/03  14:44:32  matt
16478  * Fixed another difficult bug in the window clip system
16479  *
16480  * Revision 1.225  1994/12/02  13:19:56  matt
16481  * Fixed rect clears at terminus of rendering
16482  * Made a bunch of debug code compile out
16483  *
16484  * Revision 1.224  1994/12/02  11:58:21  matt
16485  * Fixed window clip bug
16486  *
16487  * Revision 1.223  1994/11/28  21:50:42  mike
16488  * optimizations.
16489  *
16490  * Revision 1.222  1994/11/28  01:32:15  mike
16491  * turn off window clearing.
16492  *
16493  * Revision 1.221  1994/11/27  23:11:52  matt
16494  * Made changes for new mprintf calling convention
16495  *
16496  * Revision 1.220  1994/11/20  15:58:55  matt
16497  * Don't migrate the control center, since it doesn't move out of its segment
16498  *
16499  * Revision 1.219  1994/11/19  23:54:36  mike
16500  * change window colors.
16501  *
16502  * Revision 1.218  1994/11/19  15:20:25  mike
16503  * rip out unused code and data
16504  *
16505  * Revision 1.217  1994/11/18  13:21:24  mike
16506  * Clear only view portals into rest of world based on value of Clear_window.
16507  *
16508  * Revision 1.216  1994/11/15  17:02:10  matt
16509  * Re-added accidentally deleted variable
16510  *
16511  * Revision 1.215  1994/11/15  16:51:50  matt
16512  * Made rear view only switch to rear cockpit if cockpit on in front view
16513  *
16514  * Revision 1.214  1994/11/14  20:47:57  john
16515  * Attempted to strip out all the code in the game
16516  * directory that uses any ui code.
16517  *
16518  * Revision 1.213  1994/11/11  15:37:07  mike
16519  * write orange for background to show render bugs.
16520  *
16521  * Revision 1.212  1994/11/09  22:57:18  matt
16522  * Keep tract of depth of segments rendered, for detail level optimization
16523  *
16524  * Revision 1.211  1994/11/01  23:40:14  matt
16525  * Elegantly handler buffer getting full
16526  *
16527  * Revision 1.210  1994/10/31  22:28:13  mike
16528  * Fix detriangulation bug.
16529  *
16530  * Revision 1.209  1994/10/31  11:48:56  mike
16531  * Optimize detriangulation, speedup of about 4% in many cases, 0% in many.
16532  *
16533  * Revision 1.208  1994/10/30  20:08:34  matt
16534  * For endlevel: added big explosion at tunnel exit; made lights in tunnel
16535  * go out; made more explosions on walls.
16536  *
16537  * Revision 1.207  1994/10/27  14:14:35  matt
16538  * Don't do light flash during endlevel sequence
16539  *
16540  * Revision 1.206  1994/10/11  12:05:42  mike
16541  * Improve detriangulation.
16542  *
16543  * Revision 1.205  1994/10/07  15:27:00  john
16544  * Commented out the code that moves your eye
16545  * forward.
16546  *
16547  * Revision 1.204  1994/10/05  16:07:38  mike
16548  * Don't detriangulate sides if in player's segment.  Prevents player going behind a wall,
16549  * though there are cases in which it would be ok to detriangulate these.
16550  *
16551  * Revision 1.203  1994/10/03  12:44:05  matt
16552  * Took out unreferenced code
16553  *
16554  * Revision 1.202  1994/09/28  14:08:45  john
16555  * Added Zoom stuff back in, but ifdef'd it out.
16556  *
16557  * Revision 1.201  1994/09/25  23:41:49  matt
16558  * Changed the object load & save code to read/write the structure fields one
16559  * at a time (rather than the whole structure at once).  This mean that the
16560  * object structure can be changed without breaking the load/save functions.
16561  * As a result of this change, the local_object data can be and has been
16562  * incorporated into the object array.  Also, timeleft is now a property
16563  * of all objects, and the object structure has been otherwise cleaned up.
16564  *
16565  * Revision 1.200  1994/09/25  15:50:10  mike
16566  * Integrate my debug changes which shows how many textures were rendered
16567  * this frame.
16568  *
16569  * Revision 1.199  1994/09/25  15:45:22  matt
16570  * Added OBJ_LIGHT, a type of object that casts light
16571  * Added generalized lifeleft, and moved it to local_object
16572  *
16573  * Revision 1.198  1994/09/15  21:23:32  matt
16574  * Changed system to keep track of whether & what cockpit is up
16575  *
16576  * Revision 1.197  1994/09/15  16:30:12  mike
16577  * Comment out call to object_render_targets, which did nothing.
16578  *
16579  * Revision 1.196  1994/09/07  22:25:51  matt
16580  * Don't migrate through semi-transparent walls
16581  *
16582  * Revision 1.195  1994/09/07  19:16:21  mike
16583  * Homing missile.
16584  *
16585  * Revision 1.194  1994/08/31  20:54:17  matt
16586  * Don't do flash effect while whiting out
16587  *
16588  * Revision 1.193  1994/08/23  17:20:12  john
16589  * Added rear-view cockpit.
16590  *
16591  * Revision 1.192  1994/08/22  14:36:35  john
16592  * Made R key make a "reverse" view render.
16593  *
16594  * Revision 1.191  1994/08/19  20:09:26  matt
16595  * Added end-of-level cut scene with external scene
16596  *
16597  * Revision 1.190  1994/08/10  19:56:17  john
16598  * Changed font stuff; Took out old menu; messed up lots of
16599  * other stuff like game sequencing messages, etc.
16600  *
16601  * Revision 1.189  1994/08/10  14:45:05  john
16602  * *** empty log message ***
16603  *
16604  * Revision 1.188  1994/08/09  16:04:06  john
16605  * Added network players to editor.
16606  *
16607  * Revision 1.187  1994/08/05  17:07:05  john
16608  * Made lasers be two objects, one drawing after the other
16609  * all the time.
16610  *
16611  * Revision 1.186  1994/08/05  10:07:57  matt
16612  * Disable window check checking (i.e., always use window check)
16613  *
16614  * Revision 1.185  1994/08/04  19:11:30  matt
16615  * Changed a bunch of vecmat calls to use multiple-function routines, and to
16616  * allow the use of C macros for some functions
16617  *
16618  * Revision 1.184  1994/08/04  00:21:14  matt
16619  * Cleaned up fvi & physics error handling; put in code to make sure objects
16620  * are in correct segment; simplified segment finding for objects and points
16621  *
16622  * Revision 1.183  1994/08/02  19:04:28  matt
16623  * Cleaned up vertex list functions
16624  *
16625  * Revision 1.182  1994/07/29  15:13:33  matt
16626  * When window check turned off, cut render depth in half
16627  *
16628  * Revision 1.181  1994/07/29  11:03:50  matt
16629  * Use highest_segment_index instead of num_segments so render works from
16630  * the editor
16631  *
16632  * Revision 1.180  1994/07/29  10:04:34  mike
16633  * Update Cursegp when an object is selected.
16634  *
16635  * Revision 1.179  1994/07/25  00:02:50  matt
16636  * Various changes to accomodate new 3d, which no longer takes point numbers
16637  * as parms, and now only takes pointers to points.
16638  *
16639  * Revision 1.178  1994/07/24  14:37:49  matt
16640  * Added angles for player head
16641  *
16642  * Revision 1.177  1994/07/20  19:08:07  matt
16643  * If in editor, don't move eye from center of viewer object
16644
16645 ------------------------------------------------------------------------
16646 main/render.h:
16647
16648  * Revision 1.1  1995/05/16  16:01:51  allender
16649  * Initial revision
16650  *
16651  * Revision 2.0  1995/02/27  11:33:00  john
16652  * New version 2.0, which has no anonymous unions, builds with
16653  * Watcom 10.0, and doesn't require parsing BITMAPS.TBL.
16654  *
16655  * Revision 1.17  1994/11/30  12:33:33  mike
16656  * prototype Clear_window.
16657  *
16658  * Revision 1.16  1994/11/02  16:19:52  matt
16659  * Increased size of extra object buffer
16660  *
16661  * Revision 1.15  1994/07/25  00:02:49  matt
16662  * Various changes to accomodate new 3d, which no longer takes point numbers
16663  * as parms, and now only takes pointers to points.
16664  *
16665  * Revision 1.14  1994/07/24  14:37:42  matt
16666  * Added angles for player head
16667  *
16668  * Revision 1.13  1994/06/24  17:01:34  john
16669  * Add VFX support; Took Game Sequencing, like EndGame and stuff and
16670  * took it out of game.c and into gameseq.c
16671  *
16672  * Revision 1.12  1994/06/16  10:55:57  matt
16673  * Made a bunch of test code dependent on #defines
16674  *
16675  * Revision 1.11  1994/06/01  00:01:36  matt
16676  * Added mine destruction flashing effect
16677  *
16678  * Revision 1.10  1994/05/22  18:47:36  mike
16679  * make Render_list a globally accessible variable.
16680  *
16681  * Revision 1.9  1994/05/22  15:29:32  mike
16682  * Separation of lighting from render.c to lighting.c.
16683  *
16684  * Revision 1.8  1994/05/14  17:59:39  matt
16685  * Added extern.
16686  *
16687  * Revision 1.7  1994/05/14  17:15:17  matt
16688  * Got rid of externs in source (non-header) files
16689  *
16690  * Revision 1.6  1994/02/17  11:32:41  matt
16691  * Changes in object system
16692  *
16693  * Revision 1.5  1994/01/21  17:31:48  matt
16694  * Moved code from render_frame() to caller, making code cleaner
16695  *
16696  * Revision 1.4  1994/01/06  09:46:12  john
16697  * Added removable walls... all code that checked for
16698  * children to see if a wall was a doorway, i changed
16699  * to yuan's wall_is_doorway function that is in wall.c...
16700  * doesn't work yet.
16701  *
16702  * Revision 1.3  1994/01/05  11:25:47  john
16703  * Changed Player_zoom to Render_zoom
16704  *
16705  * Revision 1.2  1994/01/05  10:53:43  john
16706  * New object code by John.
16707  *
16708  * Revision 1.1  1993/11/04  14:01:43  matt
16709  * Initial revision
16710
16711 ------------------------------------------------------------------------
16712 main/robot.c:
16713
16714  * Revision 1.1  1995/05/16  15:30:34  allender
16715  * Initial revision
16716  *
16717  * Revision 2.1  1995/03/07  16:52:02  john
16718  * Fixed robots not moving without edtiro bug.
16719  *
16720  * Revision 2.0  1995/02/27  11:31:11  john
16721  * New version 2.0, which has no anonymous unions, builds with
16722  * Watcom 10.0, and doesn't require parsing BITMAPS.TBL.
16723  *
16724  * Revision 1.19  1995/02/22  13:58:09  allender
16725  * remove anonymous unions from object structure
16726  *
16727  * Revision 1.18  1995/01/27  11:17:06  rob
16728  * Avoid problems with illegal gun num.
16729  *
16730  * Revision 1.17  1994/11/19  15:15:02  mike
16731  * remove unused code and data
16732  *
16733  * Revision 1.16  1994/11/05  16:41:31  adam
16734  * upped MAX_ROBOT_JOINTS
16735  *
16736  * Revision 1.15  1994/09/26  15:29:29  matt
16737  * Allow morphing objects to fire
16738  *
16739  * Revision 1.14  1994/06/20  14:31:02  matt
16740  * Don't include joint zero in animation data
16741  *
16742  * Revision 1.13  1994/06/10  14:39:58  matt
16743  * Increased limit of robot joints
16744  *
16745  * Revision 1.12  1994/06/10  10:59:18  matt
16746  * Do error checking on list of angles
16747  *
16748  * Revision 1.11  1994/06/09  16:21:32  matt
16749  * Took out special-case and test code.
16750  *
16751  * Revision 1.10  1994/06/07  13:21:14  matt
16752  * Added support for new chunk-based POF files, with robot animation data.
16753  *
16754  * Revision 1.9  1994/06/01  17:58:24  mike
16755  * Greater flinch effect.
16756  *
16757  * Revision 1.8  1994/06/01  14:59:25  matt
16758  * Fixed calc_gun_position(), which was rotating the wrong way for the
16759  * object orientation.
16760  *
16761  * Revision 1.7  1994/06/01  12:44:04  matt
16762  * Added flinch state for test robot
16763  *
16764  * Revision 1.6  1994/05/31  19:17:24  matt
16765  * Fixed test robot angles
16766  *
16767  * Revision 1.5  1994/05/30  19:43:50  mike
16768  * Call set_test_robot.
16769  *
16770  *
16771  * Revision 1.4  1994/05/30  00:02:44  matt
16772  * Got rid of robot render type, and generally cleaned up polygon model
16773  * render objects.
16774  *
16775  * Revision 1.3  1994/05/29  18:46:15  matt
16776  * Added stuff for getting robot animation info for different states
16777  *
16778  * Revision 1.2  1994/05/26  21:09:15  matt
16779  * Moved robot stuff out of polygon model and into robot_info struct
16780  * Made new file, robot.c, to deal with robots
16781  *
16782  * Revision 1.1  1994/05/26  18:02:04  matt
16783  * Initial revision
16784
16785 ------------------------------------------------------------------------
16786 main/robot.h:
16787
16788  * Revision 1.1  1995/05/16  16:01:59  allender
16789  * Initial revision
16790  *
16791  * Revision 2.1  1995/03/07  16:52:00  john
16792  * Fixed robots not moving without edtiro bug.
16793  *
16794  * Revision 2.0  1995/02/27  11:30:59  john
16795  * New version 2.0, which has no anonymous unions, builds with
16796  * Watcom 10.0, and doesn't require parsing BITMAPS.TBL.
16797  *
16798  * Revision 1.25  1994/11/30  14:02:44  mike
16799  * fields for see/attack/claw sounds.
16800  *
16801  * Revision 1.24  1994/10/27  15:55:41  adam
16802  * *** empty log message ***
16803  *
16804  * Revision 1.23  1994/10/20  15:17:03  mike
16805  * Add boss flag.
16806  *
16807  * Revision 1.22  1994/10/20  09:51:00  adam
16808  * *** empty log message ***
16809  *
16810  * Revision 1.21  1994/10/18  10:52:54  mike
16811  * Support robots lunging as an attack_type.
16812  *
16813  * Revision 1.20  1994/10/17  21:19:02  mike
16814  * robot cloaking.
16815  *
16816  * Revision 1.19  1994/09/27  00:03:39  mike
16817  * Add score_value to robot_info struct.
16818  *
16819  * Revision 1.18  1994/09/22  19:01:12  mike
16820  * Move NDL from here to game.h
16821  *
16822  * Revision 1.17  1994/09/22  15:46:55  mike
16823  * Add default contained objects for robots.
16824  *
16825  * Revision 1.16  1994/09/22  10:46:57  mike
16826  * Add difficulty levels.
16827  *
16828  * Revision 1.15  1994/09/15  16:34:16  mike
16829  * Change rapidfire_count to a byte, add evade_speed, dum1, dum2.
16830  *
16831  * Revision 1.14  1994/09/09  14:21:58  matt
16832  * Increased maximum number of games
16833  *
16834  * Revision 1.13  1994/08/25  18:12:13  matt
16835  * Made player's weapons and flares fire from the positions on the 3d model.
16836  * Also added support for quad lasers.
16837  *
16838  * Revision 1.12  1994/08/23  16:37:24  mike
16839  * Add rapidfire_count to robot_info.
16840  *
16841  * Revision 1.11  1994/07/27  19:45:01  mike
16842  * Objects containing objects.
16843  *
16844  * Revision 1.10  1994/07/12  12:40:01  matt
16845  * Revamped physics system
16846  *
16847  * Revision 1.9  1994/06/21  12:17:12  mike
16848  * Add circle_distance to robot_info.
16849  *
16850  * Revision 1.8  1994/06/09  16:22:28  matt
16851  * Moved header for calc_gun_point() here, where it belongs
16852  *
16853  * Revision 1.7  1994/06/08  18:16:23  john
16854  * Bunch of new stuff that basically takes constants out of the code
16855  * and puts them into bitmaps.tbl.
16856  *
16857  * Revision 1.6  1994/06/03  11:38:09  john
16858  * Made robots get their strength for RobotInfo->strength, which
16859  * is read in from bitmaps.tbl
16860  *
16861  * Revision 1.5  1994/05/30  19:43:31  mike
16862  * Add voluminous comment for robot_get_anim_state.
16863  *
16864  * Revision 1.4  1994/05/30  00:03:18  matt
16865  * Got rid of robot render type, and generally cleaned up polygon model
16866  * render objects.
16867  *
16868  * Revision 1.3  1994/05/29  18:46:37  matt
16869  * Added stuff for getting robot animation info for different states
16870  *
16871  * Revision 1.2  1994/05/26  21:09:18  matt
16872  * Moved robot stuff out of polygon model and into robot_info struct
16873  * Made new file, robot.c, to deal with robots
16874  *
16875  * Revision 1.1  1994/05/26  18:02:12  matt
16876  * Initial revision
16877
16878 ------------------------------------------------------------------------
16879 main/scores.c:
16880
16881  * Revision 1.1  1995/12/05  16:06:29  allender
16882  * Initial revision
16883  *
16884  * Revision 1.3  1995/08/14  09:25:16  allender
16885  * add byteswap header
16886  *
16887  * Revision 1.2  1995/07/14  13:45:17  allender
16888  * fixed up high score code to work and look pretty good
16889  * needs some work tho'
16890  *
16891  * Revision 1.1  1995/05/16  15:30:42  allender
16892  * Initial revision
16893  *
16894  * Revision 2.2  1995/06/15  12:13:54  john
16895  * Made end game, win game and title sequences all go
16896  * on after 5 minutes automatically.
16897  *
16898  * Revision 2.1  1995/03/06  15:23:57  john
16899  * New screen techniques.
16900  *
16901  * Revision 2.0  1995/02/27  11:30:53  john
16902  * New version 2.0, which has no anonymous unions, builds with
16903  * Watcom 10.0, and doesn't require parsing BITMAPS.TBL.
16904  *
16905  * Revision 1.109  1995/02/09  12:23:19  rob
16906  * Added assert for length of filename.
16907  *
16908  * Revision 1.108  1995/01/03  17:33:24  john
16909  * Made scrolling textbox. Used it for scores cool saying.
16910  *
16911  * Revision 1.107  1994/12/28  10:42:51  john
16912  * More VFX tweaking.
16913  *
16914  * Revision 1.106  1994/12/28  10:26:19  john
16915  * Fixed some VFX problems.
16916  *
16917  * Revision 1.105  1994/12/15  16:42:12  adam
16918  * some fix
16919  *
16920  * Revision 1.104  1994/12/14  11:59:19  john
16921  * Changed the default high scores.
16922  *
16923  * Revision 1.103  1994/12/09  00:41:12  mike
16924  * fix hang in automap print screen
16925  *
16926  * Revision 1.102  1994/12/07  00:36:26  mike
16927  * scores sequencing stuff.
16928  *
16929  * Revision 1.101  1994/12/06  15:14:21  yuan
16930  * Localization
16931  *
16932  * Revision 1.100  1994/12/03  17:07:52  yuan
16933  * Localization 368
16934  *
16935  * Revision 1.99  1994/12/03  14:49:27  mark
16936  * Fixed john's bug with previous.
16937  *
16938  * Revision 1.98  1994/12/03  14:43:54  john
16939  * Added enter, space  to exit scores.
16940  *
16941  * Revision 1.97  1994/12/03  14:32:34  john
16942  * Added integrated-super-deluxe-ctrl-r to reset high scores.
16943  *
16944  * Revision 1.96  1994/12/01  20:15:20  yuan
16945  * Localization
16946  *
16947  * Revision 1.95  1994/11/30  19:36:36  john
16948  * Made Gravis Ultrasound work again.  Made the scores blink
16949  * at a constant rate.  Revamped the newmenu background storage,
16950  * which hopefully fixed some bugs.  Made menus in ame not pause
16951  * sound, except for the pause key.               ^== Game!
16952  *
16953  * Revision 1.94  1994/11/30  12:32:08  john
16954  * Made secret levels print correctly.
16955  *
16956  * Revision 1.93  1994/11/30  12:06:47  mike
16957  * fix bug: looper not initialized.
16958  *
16959  * Revision 1.92  1994/11/29  13:20:04  john
16960  * changed the "Wow! You placed .." to something better.
16961  *
16962  * Revision 1.91  1994/11/29  01:35:38  john
16963  * Made it so that even if you don't get a high score, you still show
16964  * up on the chart..
16965  *
16966  * Revision 1.90  1994/11/23  17:29:29  mike
16967  * fix xx-xx level bug in high scores.
16968  *
16969  * Revision 1.89  1994/11/22  16:55:27  mike
16970  * allow high scores even in pudly trainee level.
16971  *
16972  * Revision 1.88  1994/11/21  17:28:33  john
16973  * Changed default score values.
16974  *
16975  * Revision 1.87  1994/11/18  23:37:53  john
16976  * Changed some shorts to ints.
16977  *
16978  * Revision 1.86  1994/11/13  15:39:24  john
16979  * Added critical error handler to game.  Took out -editor command line
16980  * option because it didn't work anymore and wasn't worth fixing.  Made scores
16981  * not use MINER enviroment variable on release version, and made scores
16982  * not print an error if there is no descent.hi.
16983  *
16984  * Revision 1.85  1994/11/06  10:15:58  john
16985  * Took out kill % and hostage %
16986  *
16987  * Revision 1.84  1994/11/05  15:03:39  john
16988  * Added non-popup menu for the main menu, so that scores and credits don't have to save
16989  * the background.
16990  *
16991  * Revision 1.83  1994/11/05  14:05:57  john
16992  * Fixed fade transitions between all screens by making gr_palette_fade_in and out keep
16993  * track of whether the palette is faded in or not.  Then, wherever the code needs to fade out,
16994  * it just calls gr_palette_fade_out and it will fade out if it isn't already.  The same with fade_in.
16995  * This eliminates the need for all the flags like Menu_fade_out, game_fade_in palette, etc.
16996  *
16997  * Revision 1.82  1994/11/04  20:11:41  john
16998  * Neatening up palette stuff with demos.
16999  *
17000  * Revision 1.81  1994/11/04  12:02:34  john
17001  * Fixed fading transitions a bit more.
17002  *
17003  * Revision 1.80  1994/10/27  12:10:39  john
17004  * Moved kill % a little to the right.
17005  *
17006  * Revision 1.79  1994/10/24  20:25:03  john
17007  * Fixed bug with space at end of 1 line message.
17008  * Made Enter go between the two input lines.
17009  *
17010  * Revision 1.78  1994/10/24  18:20:18  john
17011  * Made the current high score flash.
17012  *
17013  * Revision 1.77  1994/10/24  13:37:22  mike
17014  * Fix grammar error.  --anal Mike.
17015  *
17016  * Revision 1.76  1994/10/22  13:19:19  john
17017  * Made joy/mouse buttons leave score screen.
17018  *
17019  * Revision 1.75  1994/10/21  15:26:57  john
17020  * Used PrtScr instead of F2.
17021  *
17022  * Revision 1.74  1994/10/21  13:54:21  matt
17023  * Replace '1' with special wide '1' to make numbers line up
17024  *
17025  * Revision 1.73  1994/10/19  20:48:01  john
17026  * Made so that people playing on wimp level
17027  * can't get high scores.
17028  *
17029  * Revision 1.72  1994/10/19  15:14:05  john
17030  * Took % hits out of player structure, made %kills work properly.
17031  *
17032  * Revision 1.71  1994/10/19  14:39:27  john
17033  * Finished up; added keys to prtscr, int3.
17034  *
17035  * Revision 1.70  1994/10/19  12:44:09  john
17036  * Added hours field to player structure.
17037  *
17038  * Revision 1.69  1994/10/19  11:25:21  john
17039  * Looking good.
17040  *
17041  * Revision 1.68  1994/10/19  10:54:12  john
17042  * Test version.
17043  *
17044  * Revision 1.67  1994/10/19  10:00:27  john
17045  * *** empty log message ***
17046  *
17047  * Revision 1.66  1994/10/19  09:59:03  john
17048  * Made cool saying have the potential to be up to 50 chars
17049  *
17050  * Revision 1.65  1994/10/19  09:53:30  john
17051  * Working version of scores.
17052  *
17053  * Revision 1.64  1994/10/18  21:07:46  john
17054  * Fixed bug that didn't print name correctly.
17055  *
17056  * Revision 1.63  1994/10/18  18:21:46  john
17057  * NEw score system.
17058  *
17059  * Revision 1.62  1994/10/17  20:31:42  john
17060  * Made the text for the difficulty labels global so that
17061  * the high score screen can print "rookie" or whatever.
17062  *
17063  * Revision 1.61  1994/10/17  17:27:44  john
17064  * Added starting_level to high score system.
17065  *
17066  * Revision 1.60  1994/10/17  16:56:35  john
17067  * Added starting level to stats menu.
17068  *
17069  * Revision 1.59  1994/10/17  16:55:25  john
17070  * Added starting level, but didn't hook it to anything.
17071  *
17072  * Revision 1.58  1994/10/17  16:47:17  john
17073  * Added diff. level.
17074  *
17075  * Revision 1.57  1994/10/17  15:49:53  john
17076  * Added stats screen.
17077  *
17078  * Revision 1.56  1994/10/03  23:02:29  matt
17079  * After player added or not to scores, scores are now displayed
17080  *
17081  * Revision 1.55  1994/09/01  18:09:38  john
17082  * Made commas in scores work correctly .
17083  *
17084  *
17085  * Revision 1.54  1994/09/01  18:03:57  john
17086  * Neatened up scores a bit.
17087  *
17088  * Revision 1.53  1994/08/26  14:27:37  john
17089  * Made it prompt for name
17090  *
17091  * Revision 1.52  1994/08/26  13:03:17  john
17092  * *** empty log message ***
17093  *
17094  * Revision 1.51  1994/08/26  13:01:52  john
17095  * Put high score system in.
17096  *
17097  * Revision 1.50  1994/08/10  19:57:01  john
17098  * Changed font stuff; Took out old menu; messed up lots of
17099  * other stuff like game sequencing messages, etc.
17100  *
17101  * Revision 1.49  1994/07/25  15:40:27  matt
17102  * Took out debugging code accidentally left in.
17103
17104 ------------------------------------------------------------------------
17105 main/scores.h:
17106
17107  * Revision 1.1  1995/05/16  16:02:07  allender
17108  * Initial revision
17109  *
17110  * Revision 2.0  1995/02/27  11:31:53  john
17111  * New version 2.0, which has no anonymous unions, builds with
17112  * Watcom 10.0, and doesn't require parsing BITMAPS.TBL.
17113  *
17114  * Revision 1.13  1994/12/07  00:36:36  mike
17115  * scores sequencing stuff.
17116  *
17117  * Revision 1.12  1994/11/28  11:26:09  matt
17118  * Took out scores for weapons, which are no longer used
17119  *
17120  * Revision 1.11  1994/10/24  18:20:03  john
17121  * Made the current high score flash.
17122  *
17123  * Revision 1.10  1994/10/18  18:21:36  john
17124  * NEw score system.
17125  *
17126  * Revision 1.9  1994/10/03  23:01:58  matt
17127  * New parms for scores_view()
17128  *
17129  *
17130  * Revision 1.8  1994/09/27  16:10:37  adam
17131  * changed scores of course
17132  *
17133  * Revision 1.7  1994/08/31  19:25:46  mike
17134  * Add score values for new powerups.
17135  *
17136  * Revision 1.6  1994/08/26  16:00:18  mike
17137  * enhanced (?) scoring.
17138  *
17139  * Revision 1.5  1994/08/26  13:01:45  john
17140  * Put high score system in.
17141  *
17142  * Revision 1.4  1994/05/30  16:33:21  yuan
17143  * Revamping high scores.
17144  *
17145  * Revision 1.3  1994/05/14  17:15:07  matt
17146  * Got rid of externs in source (non-header) files
17147  *
17148  * Revision 1.2  1994/05/13  13:13:57  yuan
17149  * Added player death...
17150  *
17151  * When you die, if just pops up a a message.
17152  * When game is over, a message is popped up, and if you have a high score,
17153  * you get to enter it.
17154  *
17155  * Revision 1.1  1994/05/13  10:22:16  yuan
17156  * Initial revision
17157
17158 ------------------------------------------------------------------------
17159 main/screens.h:
17160
17161  * Revision 1.1  1995/05/16  16:02:15  allender
17162  * Initial revision
17163  *
17164  * Revision 2.2  1995/03/14  12:14:00  john
17165  * Made VR helmets have 4 resolutions to choose from.
17166  *
17167  * Revision 2.1  1995/03/06  15:24:09  john
17168  * New screen techniques.
17169  *
17170  * Revision 2.0  1995/02/27  11:31:40  john
17171  * New version 2.0, which has no anonymous unions, builds with
17172  * Watcom 10.0, and doesn't require parsing BITMAPS.TBL.
17173  *
17174  * Revision 1.15  1994/08/10  19:56:45  john
17175  * Changed font stuff; Took out old menu; messed up lots of
17176  * other stuff like game sequencing messages, etc.
17177  *
17178  * Revision 1.14  1994/07/20  21:04:26  john
17179  * Add VictorMax VR helment support.
17180  *
17181  * Revision 1.13  1994/06/24  17:01:28  john
17182  * Add VFX support; Took Game Sequencing, like EndGame and stuff and
17183  * took it out of game.c and into gameseq.c
17184  *
17185  * Revision 1.12  1994/04/20  20:30:03  john
17186  * *** empty log message ***
17187  *
17188  * Revision 1.11  1994/03/30  21:12:05  yuan
17189  * Use only 119 lines (saves 3 scanlines)
17190  *
17191  * Revision 1.10  1994/03/17  16:49:37  john
17192  * *** empty log message ***
17193  *
17194  * Revision 1.9  1994/02/11  15:07:44  matt
17195  * Added extern of Canv_game_offscrn
17196  *
17197  * Revision 1.8  1994/01/31  16:52:43  john
17198  * redid cockpit bounds.
17199  *
17200  * Revision 1.7  1994/01/26  18:13:53  john
17201  * Changed 3d constants..
17202  *
17203  * Revision 1.6  1994/01/25  17:11:46  john
17204  * *** empty log message ***
17205  *
17206  * Revision 1.5  1994/01/25  11:43:25  john
17207  * Changed game window size.
17208  *
17209  * Revision 1.4  1993/12/13  16:32:39  yuan
17210  * Fixed menu system memory errors, and other bugs.
17211  *
17212  * Revision 1.3  1993/12/10  16:07:23  yuan
17213  * Working on menu system.  Updated the title screen.
17214  *
17215  * Revision 1.2  1993/12/09  21:27:46  matt
17216  * Added 3d window sizing constants
17217  *
17218  * Revision 1.1  1993/12/06  09:50:33  matt
17219  * Initial revision
17220
17221 ------------------------------------------------------------------------
17222 main/segment.h:
17223
17224  * Revision 1.4  1995/11/03  12:53:11  allender
17225  * shareware changes
17226  *
17227  * Revision 1.3  1995/07/26  16:53:45  allender
17228  * put sides and segment structure back the PC way for checksumming reasons
17229  *
17230  * Revision 1.2  1995/06/19  07:55:22  allender
17231  * rearranged structure members for possible better alignment
17232  *
17233  * Revision 1.1  1995/05/16  16:02:22  allender
17234  * Initial revision
17235  *
17236  * Revision 2.1  1995/03/20  18:15:22  john
17237  * Added code to not store the normals in the segment structure.
17238  *
17239  * Revision 2.0  1995/02/27  11:26:49  john
17240  * New version 2.0, which has no anonymous unions, builds with
17241  * Watcom 10.0, and doesn't require parsing BITMAPS.TBL.
17242  *
17243  * Revision 1.89  1995/01/24  15:07:55  yuan
17244  * *** empty log message ***
17245  *
17246  * Revision 1.88  1994/12/12  01:04:06  yuan
17247  * Boosted MAX_GAME_VERTS.
17248  *
17249  * Revision 1.87  1994/12/11  16:18:14  mike
17250  * add constants so we can detect too-large mines for game while in editor.
17251  *
17252  * Revision 1.86  1994/12/08  15:07:29  yuan
17253  * *** empty log message ***
17254  *
17255  * Revision 1.85  1994/12/01  21:06:39  matt
17256  * Moved plane tolerance constant to gameseg.c, the only file that used it.
17257  *
17258  * Revision 1.84  1994/11/27  14:01:41  matt
17259  * Fixed segment structure so LVLs work
17260  *
17261  * Revision 1.83  1994/11/26  22:50:20  matt
17262  * Removed editor-only fields from segment structure when editor is compiled
17263  * out, and padded segment structure to even multiple of 4 bytes.
17264  *
17265  * Revision 1.82  1994/11/21  11:43:36  mike
17266  * smaller segment and vertex buffers.
17267  *
17268  * Revision 1.81  1994/11/17  11:39:35  matt
17269  * Ripped out code to load old mines
17270  *
17271  * Revision 1.80  1994/10/30  14:12:05  mike
17272  * rip out local segments stuff.
17273  *
17274  * Revision 1.79  1994/10/27  11:33:58  mike
17275  * lower number of segments by 100, saving 116K.
17276  *
17277  * Revision 1.78  1994/08/25  21:54:50  mike
17278  * Add macro IS_CHILD to make checking for the presence of a child centralized.
17279  *
17280  * Revision 1.77  1994/08/11  18:58:16  mike
17281  * Add prototype for Side_to_verts_int.
17282  *
17283  * Revision 1.76  1994/08/01  11:04:13  yuan
17284  * New materialization centers.
17285  *
17286  * Revision 1.75  1994/07/25  00:04:19  matt
17287  * Various changes to accomodate new 3d, which no longer takes point numbers
17288  * as parms, and now only takes pointers to points.
17289  *
17290  * Revision 1.74  1994/07/21  19:01:30  mike
17291  * new lsegment structure.
17292  *
17293  * Revision 1.73  1994/06/08  14:30:48  matt
17294  * Added static_light field to segment structure, and padded side struct
17295  * to be longword aligned.
17296  *
17297  * Revision 1.72  1994/05/19  23:25:17  mike
17298  * Change MINE_VERSION to 15, DEFAULT_LIGHTING to 0
17299  *
17300  * Revision 1.71  1994/05/12  14:45:54  mike
17301  * New segment data structure (!!), group, special, object, value = short.
17302  *
17303  * Revision 1.70  1994/05/03  11:06:46  mike
17304  * Remove constants VMAG and UMAG which are editor specific..
17305  *
17306  * Revision 1.69  1994/04/18  10:40:28  yuan
17307  * Increased segment limit to 1000
17308  * (From 500)
17309
17310 ------------------------------------------------------------------------
17311 main/segpoint.h:
17312
17313  * Revision 1.1  1995/05/16  16:02:38  allender
17314  * Initial revision
17315  *
17316  * Revision 2.0  1995/02/27  11:26:54  john
17317  * New version 2.0, which has no anonymous unions, builds with
17318  * Watcom 10.0, and doesn't require parsing BITMAPS.TBL.
17319  *
17320  * Revision 1.2  1994/02/16  17:14:40  matt
17321  * Added include of 3d.h
17322  *
17323  * Revision 1.1  1993/12/06  09:51:37  matt
17324  * Initial revision
17325
17326 ------------------------------------------------------------------------
17327 main/slew.c:
17328
17329  * Revision 1.1  1995/05/16  15:30:57  allender
17330  * Initial revision
17331  *
17332  * Revision 2.0  1995/02/27  11:29:32  john
17333  * New version 2.0, which has no anonymous unions, builds with
17334  * Watcom 10.0, and doesn't require parsing BITMAPS.TBL.
17335  *
17336  * Revision 1.34  1995/02/22  14:23:28  allender
17337  * remove anonymous unions from object structure
17338  *
17339  * Revision 1.33  1995/02/22  13:24:26  john
17340  * Removed the vecmat anonymous unions.
17341  *
17342  * Revision 1.32  1994/09/10  15:46:42  john
17343  * First version of new keyboard configuration.
17344  *
17345  * Revision 1.31  1994/08/31  18:29:58  matt
17346  * Made slew work with new key system
17347  *
17348  * Revision 1.30  1994/08/31  14:10:48  john
17349  * Made slew go faster.
17350  *
17351  * Revision 1.29  1994/08/29  19:16:38  matt
17352  * Made slew object not have physics movement type, so slew objects don't
17353  * get bumped.
17354  *
17355  * Revision 1.28  1994/08/24  18:59:59  john
17356  * Changed key_down_time to return fixed seconds instead of
17357  * milliseconds.
17358  *
17359  * Revision 1.27  1994/07/01  11:33:05  john
17360  * Fixed bug with looking for stick even if one not present.
17361  *
17362  * Revision 1.26  1994/05/20  11:56:33  matt
17363  * Cleaned up find_vector_intersection() interface
17364  * Killed check_point_in_seg(), check_player_seg(), check_object_seg()
17365  *
17366  * Revision 1.25  1994/05/19  12:08:41  matt
17367  * Use new vecmat macros and globals
17368  *
17369  * Revision 1.24  1994/05/14  17:16:18  matt
17370  * Got rid of externs in source (non-header) files
17371  *
17372  * Revision 1.23  1994/05/03  12:26:38  matt
17373  * Removed use of physics_info var rotvel, which wasn't used for rotational
17374  * velocity at all.
17375  *
17376  * Revision 1.22  1994/02/17  11:32:34  matt
17377  * Changes in object system
17378  *
17379  * Revision 1.21  1994/01/18  14:03:53  john
17380  * made joy_get_pos use the new ints instead of
17381  * shorts.
17382  *
17383  * Revision 1.20  1994/01/10  17:11:35  mike
17384  * Add prototype for check_object_seg
17385  *
17386  * Revision 1.19  1994/01/05  10:53:38  john
17387  * New object code by John.
17388  *
17389  * Revision 1.18  1993/12/22  15:32:50  john
17390  * took out previos code that attempted to make
17391  * modifiers cancel keydowntime.
17392  *
17393  * Revision 1.17  1993/12/22  11:41:56  john
17394  * Made so that keydowntime recognizes editor special case!
17395  *
17396  * Revision 1.16  1993/12/14  18:13:52  matt
17397  * Made slew work in editor even when game isn't in slew mode
17398  *
17399  * Revision 1.15  1993/12/07  23:53:39  matt
17400  * Made slew work in editor even when game isn't in slew mode
17401  *
17402  * Revision 1.14  1993/12/05  22:47:49  matt
17403  * Reworked include files in an attempt to cut down on build times
17404  *
17405  * Revision 1.13  1993/12/01  11:44:14  matt
17406  * Chagned Frfract to FrameTime
17407  *
17408  * Revision 1.12  1993/11/08  16:21:42  john
17409  * made stop_slew or whatever return an int
17410  *
17411  * Revision 1.11  1993/11/01  13:59:49  john
17412  * more slew experiments.
17413
17414 ------------------------------------------------------------------------
17415 main/slew.h:
17416
17417  * Revision 1.1  1995/05/16  16:03:09  allender
17418  * Initial revision
17419  *
17420  * Revision 2.0  1995/02/27  11:33:05  john
17421  * New version 2.0, which has no anonymous unions, builds with
17422  * Watcom 10.0, and doesn't require parsing BITMAPS.TBL.
17423  *
17424  * Revision 1.5  1994/12/15  16:43:58  matt
17425  * Made slew functions compile out for release versions
17426  *
17427  * Revision 1.4  1994/02/17  11:32:41  matt
17428  * Changes in object system
17429  *
17430  * Revision 1.3  1994/01/05  10:53:42  john
17431  * New object code by John.
17432  *
17433  * Revision 1.2  1993/12/05  22:48:57  matt
17434  * Reworked include files in an attempt to cut down on build times
17435  *
17436  * Revision 1.1  1993/12/05  20:20:16  matt
17437  * Initial revision
17438
17439 ------------------------------------------------------------------------
17440 main/songs.c:
17441
17442  * Revision 1.5  1995/11/03  12:52:59  allender
17443  * shareware changes
17444  *
17445  * Revision 1.4  1995/10/18  01:51:33  allender
17446  * fixed up stuff for redbook
17447  *
17448  * Revision 1.3  1995/10/17  13:13:44  allender
17449  * dont' add resource value to songs to play -- now done in digi
17450  * code
17451  *
17452  * Revision 1.2  1995/07/17  08:50:35  allender
17453  * make work with new music system
17454  *
17455  * Revision 1.1  1995/05/16  15:31:05  allender
17456  * Initial revision
17457  *
17458  * Revision 2.1  1995/05/02  16:15:21  john
17459  * Took out printf.
17460  *
17461  * Revision 2.0  1995/02/27  11:27:13  john
17462  * New version 2.0, which has no anonymous unions, builds with
17463  * Watcom 10.0, and doesn't require parsing BITMAPS.TBL.
17464  *
17465  * Revision 1.2  1995/02/11  12:42:12  john
17466  * Added new song method, with FM bank switching..
17467  *
17468  * Revision 1.1  1995/02/11  10:20:33  john
17469  * Initial revision
17470
17471 ------------------------------------------------------------------------
17472 main/songs.h:
17473
17474  * Revision 2.0  1995/02/27  11:30:52  john
17475  * New version 2.0, which has no anonymous unions, builds with
17476  * Watcom 10.0, and doesn't require parsing BITMAPS.TBL.
17477  *
17478  * Revision 1.6  1995/02/11  22:21:44  adam
17479  * *** empty log message ***
17480  *
17481  * Revision 1.5  1995/02/11  19:10:49  adam
17482  * *** empty log message ***
17483  *
17484  * Revision 1.4  1995/02/11  18:34:40  adam
17485  * *** empty log message ***
17486  *
17487  * Revision 1.3  1995/02/11  18:04:51  adam
17488  * upped songs
17489  *
17490  * Revision 1.2  1995/02/11  12:42:12  john
17491  * Added new song method, with FM bank switching..
17492  *
17493  * Revision 1.1  1995/02/11  10:20:18  john
17494  * Initial revision
17495
17496 ------------------------------------------------------------------------
17497 main/sounds.h:
17498
17499  * Revision 1.1  1995/05/16  16:03:32  allender
17500  * Initial revision
17501  *
17502  * Revision 2.0  1995/02/27  11:27:32  john
17503  * New version 2.0, which has no anonymous unions, builds with
17504  * Watcom 10.0, and doesn't require parsing BITMAPS.TBL.
17505  *
17506  * Revision 1.41  1995/02/03  17:08:28  john
17507  * Changed sound stuff to allow low memory usage.
17508  * Also, changed so that Sounds isn't an array of digi_sounds, it
17509  * is a ubyte pointing into GameSounds, this way the digi.c code that
17510  * locks sounds won't accidentally unlock a sound that is already playing, but
17511  * since it's Sounds[soundno] is different, it would erroneously be unlocked.
17512  *
17513  * Revision 1.40  1995/01/30  21:45:17  adam
17514  * added weapon change sounds
17515  *
17516  * Revision 1.39  1995/01/30  21:11:57  mike
17517  * Use new weapon selection sounds, different for primary and secondary.
17518  *
17519  * Revision 1.38  1995/01/26  17:02:58  mike
17520  * make fusion cannon have more chrome, make fusion, mega rock you!
17521  *
17522  * Revision 1.37  1995/01/18  19:46:15  matt
17523  * Added sound for invulnerability wearing off, and voice message for cheating
17524  *
17525  * Revision 1.36  1995/01/18  19:05:04  john
17526  * Increased MAX_SOUNDS.
17527  *
17528  * Revision 1.35  1994/12/14  16:57:08  adam
17529  * *** empty log message ***
17530  *
17531  * Revision 1.34  1994/12/08  21:31:40  adam
17532  * *** empty log message ***
17533  *
17534  * Revision 1.33  1994/12/08  12:33:01  mike
17535  * make boss dying more interesting.
17536  *
17537  * Revision 1.32  1994/12/04  21:39:40  matt
17538  * Added sound constants for endlevel explosions
17539  *
17540  * Revision 1.31  1994/11/30  14:02:58  mike
17541  * see/claw/attack sounds.
17542  *
17543  * Revision 1.30  1994/11/29  20:43:54  matt
17544  * Deleted a bunch of unused constants
17545  *
17546  * Revision 1.29  1994/11/29  15:48:11  matt
17547  * Cleaned up, & added new sounds
17548  *
17549  * Revision 1.28  1994/11/29  14:35:36  adam
17550  * moved lava noise index
17551  *
17552  * Revision 1.27  1994/11/29  13:23:30  matt
17553  * Cleaned up sound constants
17554  *
17555  * Revision 1.26  1994/11/29  13:01:04  rob
17556  * ADded badass explosion define.
17557  *
17558  * Revision 1.25  1994/11/29  11:34:23  rob
17559  * Added new HUD sounds.
17560  *
17561  * Revision 1.24  1994/11/15  16:52:01  mike
17562  * hiss sound placeholder.
17563  *
17564  * Revision 1.23  1994/10/25  16:21:45  adam
17565  * changed homing sound
17566  *
17567  * Revision 1.22  1994/10/23  00:27:34  matt
17568  * Made exploding wall do one long sound, instead of lots of small ones
17569  *
17570  * Revision 1.21  1994/10/22  14:12:35  mike
17571  * Add sound for missile tracking player.
17572  *
17573  * Revision 1.20  1994/10/11  12:25:21  matt
17574  * Added "hot rocks" that create badass explosion when hit by weapons
17575  *
17576  * Revision 1.19  1994/10/10  20:57:50  matt
17577  * Added sound for exploding wall (hostage door)
17578  *
17579  * Revision 1.18  1994/10/04  15:33:31  john
17580  * Took out the old PLAY_SOUND??? code and replaced it
17581  * with direct calls into digi_link_??? so that all sounds
17582  * can be made 3d.
17583  *
17584  * Revision 1.17  1994/09/29  21:13:41  john
17585  * Added Master volumes for digi and midi. Also took out panning,
17586  * because it doesn't work with MasterVolume stuff.
17587  *
17588  * Revision 1.16  1994/09/29  00:42:29  matt
17589  * Made hitting a locked door play a sound
17590  *
17591  * Revision 1.15  1994/09/20  19:14:34  john
17592  * Massaged the sound system; used a better formula for determining
17593  * which l/r balance, also, put in Mike's stuff that searches for a connection
17594  * between the 2 sounds' segments, stopping for closed doors, etc.
17595  *
17596  * Revision 1.14  1994/07/06  15:23:59  john
17597  * Revamped hostage sound.
17598  *
17599  * Revision 1.13  1994/06/21  19:13:27  john
17600  * *** empty log message ***
17601  *
17602  * Revision 1.12  1994/06/21  12:09:54  adam
17603  * *** empty log message ***
17604  *
17605  * Revision 1.11  1994/06/21  12:03:15  john
17606  * Added more sounds.
17607  *
17608  * Revision 1.10  1994/06/20  22:01:54  matt
17609  * Added prototype for Play3D()
17610  *
17611  * Revision 1.9  1994/06/20  21:06:06  yuan
17612  * Fixed up menus.
17613  *
17614  * Revision 1.8  1994/06/17  12:21:54  mike
17615  * Hook for robot hits player.
17616  *
17617  * Revision 1.7  1994/06/15  19:01:35  john
17618  * Added the capability to make 3d sounds play just once for the
17619  * laser hit wall effects.
17620  *
17621  * Revision 1.6  1994/06/08  11:43:03  john
17622  * Enable 3D sound.
17623  *
17624  * Revision 1.5  1994/06/07  18:21:20  john
17625  * Start changing sound to the new 3D system.
17626  *
17627  * Revision 1.4  1994/05/16  16:17:41  john
17628  * Bunch of stuff on my Inferno Task list May16-23
17629  *
17630  * Revision 1.3  1994/05/09  21:11:38  john
17631  * Sound changes; pass index instead of pointer to digi routines.
17632  * Made laser sound cut off the last laser sound.
17633  *
17634  * Revision 1.2  1994/04/27  11:47:46  john
17635  * First version.
17636  *
17637  * Revision 1.1  1994/04/26  10:44:36  john
17638  * Initial revision
17639
17640 ------------------------------------------------------------------------
17641 main/state.c:
17642
17643  * Revision 1.7  1995/10/31  10:18:25  allender
17644  * shareware stuff
17645  *
17646  * Revision 1.6  1995/10/21  22:25:45  allender
17647  * put in creator code and file type for saved games.
17648  * put save games in players folder
17649  *
17650  * Revision 1.5  1995/10/20  00:51:21  allender
17651  * close boxes and proper mouse support on save game stuff
17652  *
17653  * Revision 1.4  1995/10/17  13:19:02  allender
17654  * close boxes for load and save game
17655  *
17656  * Revision 1.3  1995/09/18  08:09:15  allender
17657  * made larger thumbnail and handled NULL gr_bitmap pointers
17658  * better
17659  *
17660  * Revision 1.2  1995/08/14  14:36:12  allender
17661  * change transparency to 0
17662  *
17663  * Revision 1.1  1995/05/16  15:31:12  allender
17664  * Initial revision
17665  *
17666  * Revision 2.14  1995/05/26  16:16:10  john
17667  * Split SATURN into define's for requiring cd, using cd, etc.
17668  * Also started adding all the Rockwell stuff.
17669  *
17670  * Revision 2.13  1995/04/06  15:12:20  john
17671  * Fixed bug with lunacy not working.
17672  *
17673  * Revision 2.12  1995/04/04  13:33:05  john
17674  * Removed multiplayer save.
17675  *
17676  * Revision 2.11  1995/03/31  13:42:10  john
17677  * Made saved games from the bogus saturn version read in
17678  * correctly.
17679  *
17680  * Revision 2.10  1995/03/31  12:45:28  john
17681  * Fixed bug with previous.
17682  *
17683  * Revision 2.9  1995/03/31  12:24:40  john
17684  * I had changed alt_textures from a pointer to a byte. This hosed old
17685  * saved games, so I restored it to an int.
17686  *
17687  * Revision 2.8  1995/03/28  11:22:47  john
17688  * Added cheats to save file. Changed lunacy text.
17689  *
17690  * Revision 2.7  1995/03/27  21:41:03  john
17691  * Added code to verify that the proper multi save file
17692  * is used when restoring a network game.
17693  *
17694  * Revision 2.6  1995/03/27  18:04:18  john
17695  * Made multi save/restore require the -multisave command line arg.
17696  *
17697  * Revision 2.5  1995/03/27  17:01:52  john
17698  * Made deafult choice work better.
17699  *
17700  * Revision 2.4  1995/03/27  15:49:44  john
17701  * Added slots to save games.
17702  *
17703  * Revision 2.3  1995/03/27  12:59:19  john
17704  * Initial version of multiplayer save games.
17705  *
17706  * Revision 2.2  1995/03/24  13:11:35  john
17707  * Added save game during briefing screens.
17708  *
17709  * Revision 2.1  1995/03/21  14:38:36  john
17710  * Ifdef'd out the NETWORK code.
17711  *
17712  * Revision 2.0  1995/02/27  11:27:00  john
17713  * New version 2.0, which has no anonymous unions, builds with
17714  * Watcom 10.0, and doesn't require parsing BITMAPS.TBL.
17715  *
17716  * Revision 1.43  1995/02/22  14:32:41  allender
17717  * remove anonymous unions from object structure
17718  *
17719  * Revision 1.42  1995/02/13  20:34:33  john
17720  * Lintized
17721  *
17722  * Revision 1.41  1995/02/13  10:37:30  john
17723  * Saved Buggin' cheat mode to save file.
17724  *
17725  * Revision 1.40  1995/02/09  10:24:25  john
17726  * *** empty log message ***
17727  *
17728  * Revision 1.39  1995/02/09  10:22:20  john
17729  * Fixed bug with callsign getting trashed if you copy somebody else
17730  * 's save game file into your directory.
17731  *
17732  * Revision 1.38  1995/02/08  21:01:27  john
17733  * Closed state file around the code that shows briefing screens so that the
17734  * code works on machines with clean boot with only 5 file handles.
17735  *
17736  * Revision 1.37  1995/02/07  14:02:33  john
17737  * Added code to verify game restore.
17738  *
17739  * Revision 1.36  1995/02/07  11:07:43  john
17740  * Added hooks for confirm on game state restore.
17741  *
17742  * Revision 1.35  1995/02/03  11:27:36  john
17743  * Made inbetween level save's thumbnail's have correct aspect.
17744  *
17745  * Revision 1.34  1995/02/03  10:58:43  john
17746  * Added code to save shareware style saved games into new format...
17747  * Also, made new player file format not have the saved game array in it.
17748  *
17749  * Revision 1.33  1995/02/02  19:40:52  john
17750  * Added 10 save game slots.
17751  *
17752  * Revision 1.32  1995/02/02  12:23:20  john
17753  * Made between level saves have picture.
17754  *
17755  * Revision 1.31  1995/01/31  11:21:43  john
17756  * Added code for fixed with menus.
17757  *
17758  * Revision 1.30  1995/01/29  21:37:29  mike
17759  * initialize variables on game load so you don't drain your energy when you fire.
17760  *
17761  * Revision 1.29  1995/01/29  13:47:58  mike
17762  * Restore some variables on game load (in game).
17763  *
17764  * Revision 1.28  1995/01/26  10:46:57  john
17765  * Fixed bug with state names getting hosed.
17766  *
17767  * Revision 1.27  1995/01/26  09:51:23  john
17768  * Fixed bug with game descriptions getting hosed.
17769  *
17770  * Revision 1.26  1995/01/25  16:35:49  john
17771  * Made so that when you hit enter during
17772  * game save, -empty- goes away.
17773  *
17774  * Revision 1.25  1995/01/25  15:01:39  john
17775  * Upped the save file version.
17776  *
17777  * Revision 1.24  1995/01/24  20:35:35  john
17778  * *** empty log message ***
17779  *
17780  * Revision 1.23  1995/01/24  20:34:24  john
17781  * Fixed bug with player stats not being set right for in
17782  * between level saves.
17783  *
17784  * Revision 1.22  1995/01/23  10:39:03  john
17785  * Added mission stuff to game saves.
17786  *
17787  * Revision 1.21  1995/01/22  16:07:12  mike
17788  * localization.
17789  *
17790  * Revision 1.20  1995/01/22  15:58:32  mike
17791  * localization
17792  *
17793  * Revision 1.19  1995/01/20  11:04:40  john
17794  * Upped state save version.
17795  *
17796  * Revision 1.18  1995/01/19  17:00:44  john
17797  * Made save game work between levels.
17798  *
17799  * Revision 1.17  1995/01/17  14:27:33  john
17800  * *** empty log message ***
17801  *
17802  * Revision 1.16  1995/01/17  13:36:37  john
17803  * Moved pig loading into StartNewLevelSub.
17804  *
17805  * Revision 1.15  1995/01/16  16:53:38  john
17806  * Added code to save cheat state during save game.
17807  *
17808  * Revision 1.14  1995/01/15  16:55:22  john
17809  * Improved mine texture parsing.
17810  *
17811  * Revision 1.13  1995/01/12  10:45:15  john
17812  * Added difficulty level to save/restore game.
17813  *
17814  * Revision 1.12  1995/01/05  15:46:55  john
17815  * Made weapons not rearm when starting a saved game.
17816  *
17817  * Revision 1.11  1995/01/05  11:51:45  john
17818  * Added better Abort game menu.
17819  * Made save state return success or nopt.
17820  *
17821  * Revision 1.10  1995/01/05  11:34:51  john
17822  * Took out endlevel save stuff for registered.
17823  *
17824  * Revision 1.9  1995/01/04  18:19:52  john
17825  * Added automap visited list saving.
17826  *
17827  * Revision 1.8  1995/01/04  17:29:56  john
17828  * Made save/restore ALT+F?. Also made them not work
17829  * in network mode, and if recording a demo, will
17830  * quit recording.
17831  *
17832  * Revision 1.7  1995/01/04  13:18:31  john
17833  * Added cool 6 game save.
17834  *
17835  * Revision 1.6  1995/01/03  20:38:46  john
17836  * Saved morph objects.
17837  *
17838  * Revision 1.5  1995/01/03  20:19:29  john
17839  * Pretty good working version of game save.
17840  *
17841  * Revision 1.4  1995/01/03  14:18:18  matt
17842  * ifdefs added to compile code add.  Added by Mike, I think.
17843  *
17844  * Revision 1.3  1994/12/29  18:40:19  john
17845  * Initial version.
17846  *
17847  * Revision 1.2  1994/12/29  15:26:40  john
17848  * Put in hooks for saving/restoring game state.
17849  *
17850  * Revision 1.1  1994/12/29  15:16:02  john
17851  * Initial revision
17852
17853 ------------------------------------------------------------------------
17854 main/state.h:
17855
17856  * Revision 1.1  1995/05/16  16:03:40  allender
17857  * Initial revision
17858  *
17859  * Revision 2.1  1995/03/27  21:40:35  john
17860  * Added code to verify that the proper multi save file
17861  * is used when restoring a network game.
17862  *
17863  * Revision 2.0  1995/02/27  11:28:44  john
17864  * New version 2.0, which has no anonymous unions, builds with
17865  * Watcom 10.0, and doesn't require parsing BITMAPS.TBL.
17866  *
17867  * Revision 1.6  1995/02/07  10:54:05  john
17868  * *** empty log message ***
17869  *
17870  * Revision 1.5  1995/02/03  10:58:12  john
17871  * Added code to save shareware style saved games into new format...
17872  * Also, made new player file format not have the saved game array in it.
17873  *
17874  * Revision 1.4  1995/01/19  17:00:51  john
17875  * Made save game work between levels.
17876  *
17877  * Revision 1.3  1995/01/05  11:51:44  john
17878  * Added better Abort game menu.
17879  * Made save state return success or nopt.
17880  *
17881  * Revision 1.2  1994/12/29  15:26:39  john
17882  * Put in hooks for saving/restoring game state.
17883  *
17884  * Revision 1.1  1994/12/29  15:15:47  john
17885  * Initial revision
17886
17887 ------------------------------------------------------------------------
17888 main/switch.c:
17889
17890  * Revision 1.2  1995/10/31  10:18:10  allender
17891  * shareware stuff
17892  *
17893  * Revision 1.1  1995/05/16  15:31:21  allender
17894  * Initial revision
17895  *
17896  * Revision 2.1  1995/03/21  14:39:08  john
17897  * Ifdef'd out the NETWORK code.
17898  *
17899  * Revision 2.0  1995/02/27  11:28:41  john
17900  * New version 2.0, which has no anonymous unions, builds with
17901  * Watcom 10.0, and doesn't require parsing BITMAPS.TBL.
17902  *
17903  * Revision 1.51  1995/01/31  15:26:23  rob
17904  * Don't trigger matcens in anarchy games.
17905  *
17906  * Revision 1.50  1995/01/26  12:18:26  rob
17907  * Changed network_do_frame call.
17908  *
17909  * Revision 1.49  1995/01/18  18:50:35  allender
17910  * don't process triggers if in demo playback mode.  Fix for Rob to only do
17911  * multi_send_endlevel_start if in multi player game
17912  *
17913  * Revision 1.48  1995/01/13  11:59:40  rob
17914  * Added palette fade after secret level exit.
17915  *
17916  * Revision 1.47  1995/01/12  17:00:41  rob
17917  * Fixed a problem with switches and secret levels.
17918  *
17919  * Revision 1.46  1995/01/12  13:35:11  rob
17920  * Added data flush after secret level exit.
17921  *
17922  * Revision 1.45  1995/01/03  15:25:11  rob
17923  * Fixed a compile error.
17924  *
17925  * Revision 1.44  1995/01/03  15:12:02  rob
17926  * Adding multiplayer switching.
17927  *
17928  * Revision 1.43  1994/11/29  16:52:12  yuan
17929  * Removed some obsolete commented out code.
17930  *
17931  * Revision 1.42  1994/11/27  23:15:07  matt
17932  * Made changes for new mprintf calling convention
17933  *
17934  * Revision 1.41  1994/11/22  18:36:45  rob
17935  * Added new hook for endlevel for secret doors.
17936  *
17937  * Revision 1.40  1994/11/21  17:29:43  matt
17938  * Cleaned up sequencing & game saving for secret levels
17939  *
17940  * Revision 1.39  1994/11/19  15:20:32  mike
17941  * rip out unused code and data
17942  *
17943  * Revision 1.38  1994/10/25  16:09:52  yuan
17944  * Fixed byte bug.
17945  *
17946  * Revision 1.37  1994/10/24  16:05:28  matt
17947  * Removed clear of fuelcen_control_center_destroyed
17948  *
17949  * Revision 1.36  1994/10/08  14:21:13  matt
17950  * Added include
17951  *
17952  * Revision 1.35  1994/10/07  12:34:09  matt
17953  * Added code fot going to/from secret levels
17954  *
17955  * Revision 1.34  1994/10/05  15:16:10  rob
17956  * Used to be that only player #0 could trigger switches, now only the
17957  * LOCAL player can do it (and he's expected to tell the other guy with
17958  * a com message if its important!)
17959  *
17960  * Revision 1.33  1994/09/24  17:42:03  mike
17961  * Kill temporary version of function written by Yuan, replaced by MK.
17962  *
17963  * Revision 1.32  1994/09/24  17:10:00  yuan
17964  * Added Matcen triggers.
17965  *
17966  * Revision 1.31  1994/09/23  18:02:21  yuan
17967  * Completed wall checking.
17968  *
17969  * Revision 1.30  1994/08/19  20:09:41  matt
17970  * Added end-of-level cut scene with external scene
17971  *
17972  * Revision 1.29  1994/08/18  10:47:36  john
17973  * Cleaned up game sequencing and player death stuff
17974  * in preparation for making the player explode into
17975  * pieces when dead.
17976  *
17977  * Revision 1.28  1994/08/12  22:42:11  john
17978  * Took away Player_stats; added Players array.
17979  *
17980  * Revision 1.27  1994/07/02  13:50:44  matt
17981  * Cleaned up includes
17982  *
17983  * Revision 1.26  1994/06/27  16:32:25  yuan
17984  * Commented out incomplete code...
17985  *
17986  * Revision 1.25  1994/06/27  15:53:27  john
17987  * #define'd out the newdemo stuff
17988  *
17989  *
17990  * Revision 1.24  1994/06/27  15:10:04  yuan
17991  * Might mess up triggers.
17992  *
17993  * Revision 1.23  1994/06/24  17:01:43  john
17994  * Add VFX support; Took Game Sequencing, like EndGame and stuff and
17995  * took it out of game.c and into gameseq.c
17996  *
17997  * Revision 1.22  1994/06/16  16:20:15  john
17998  * Made player start out in physics mode; Neatend up game loop a bit.
17999  *
18000  * Revision 1.21  1994/06/15  14:57:22  john
18001  * Added triggers to demo recording.
18002  *
18003  * Revision 1.20  1994/06/10  17:44:25  mike
18004  * Assert on result of find_connect_side == -1
18005  *
18006  * Revision 1.19  1994/06/08  10:20:15  yuan
18007  * Removed unused testing.
18008  *
18009  *
18010  * Revision 1.18  1994/06/07  13:10:48  yuan
18011  * Fixed bug in check trigger... Still working on other bugs.
18012  *
18013  * Revision 1.17  1994/05/30  20:22:04  yuan
18014  * New triggers.
18015  *
18016  * Revision 1.16  1994/05/27  10:32:46  yuan
18017  * New dialog boxes (Walls and Triggers) added.
18018  *
18019  *
18020  * Revision 1.15  1994/05/25  18:06:46  yuan
18021  * Making new dialog box controls for walls and triggers.
18022  *
18023  * Revision 1.14  1994/05/10  19:05:32  yuan
18024  * Made end of level flag rather than menu popping up
18025  *
18026  * Revision 1.13  1994/04/29  15:05:25  yuan
18027  * Added menu pop-up at exit trigger.
18028
18029 ------------------------------------------------------------------------
18030 main/switch.h:
18031
18032  * Revision 1.1  1995/05/16  16:03:48  allender
18033  * Initial revision
18034  *
18035  * Revision 2.0  1995/02/27  11:26:52  john
18036  * New version 2.0, which has no anonymous unions, builds with
18037  * Watcom 10.0, and doesn't require parsing BITMAPS.TBL.
18038  *
18039  * Revision 1.19  1995/01/12  17:00:36  rob
18040  * Fixed a problem with switches and secret levels.
18041  *
18042  * Revision 1.18  1994/10/06  21:24:40  matt
18043  * Added switch for exit to secret level
18044  *
18045  * Revision 1.17  1994/09/29  17:05:52  matt
18046  * Removed unused constant
18047  *
18048  * Revision 1.16  1994/09/24  17:10:07  yuan
18049  * Added Matcen triggers.
18050  *
18051  * Revision 1.15  1994/08/15  18:06:39  yuan
18052  * Added external trigger.
18053  *
18054  * Revision 1.14  1994/06/16  16:20:52  john
18055  * Made player start out in physics mode; Neatend up game loop a bit.
18056  *
18057  * Revision 1.13  1994/05/30  20:22:08  yuan
18058  * New triggers.
18059  *
18060  * Revision 1.12  1994/05/27  10:32:44  yuan
18061  * New dialog boxes (Walls and Triggers) added.
18062  *
18063  *
18064  * Revision 1.11  1994/05/25  18:06:32  yuan
18065  * Making new dialog box controls for walls and triggers.
18066  *
18067  * Revision 1.10  1994/04/28  18:04:40  yuan
18068  * Gamesave added.
18069  * Trigger problem fixed (seg pointer is replaced by index now.)
18070  *
18071  * Revision 1.9  1994/04/26  11:19:01  yuan
18072  * Make it so a trigger can only be triggered every 5 seconds.
18073
18074 ------------------------------------------------------------------------
18075 main/terrain.c:
18076
18077  * Revision 1.1  1995/05/16  15:31:29  allender
18078  * Initial revision
18079  *
18080  * Revision 2.0  1995/02/27  11:31:27  john
18081  * New version 2.0, which has no anonymous unions, builds with
18082  * Watcom 10.0, and doesn't require parsing BITMAPS.TBL.
18083  *
18084  * Revision 1.12  1994/12/03  00:18:00  matt
18085  * Made endlevel sequence cut off early
18086  * Made exit model and bit explosion always plot last (after all terrain)
18087  *
18088  * Revision 1.11  1994/11/27  23:13:46  matt
18089  * Made changes for new mprintf calling convention
18090  *
18091  * Revision 1.10  1994/11/21  18:04:36  matt
18092  * Fixed alloc/free problem with height array
18093  *
18094  * Revision 1.9  1994/11/21  17:30:42  matt
18095  * Properly free light array
18096  *
18097  * Revision 1.8  1994/11/19  12:40:55  matt
18098  * Added system to read endlevel data from file, and to make it work
18099  * with any exit tunnel.
18100  *
18101  * Revision 1.7  1994/11/16  11:49:44  matt
18102  * Added code to rotate terrain to match mine
18103  *
18104  * Revision 1.6  1994/11/02  16:22:59  matt
18105  * Killed mprintf
18106  *
18107  * Revision 1.5  1994/10/30  20:09:19  matt
18108  * For endlevel: added big explosion at tunnel exit; made lights in tunnel
18109  * go out; made more explosions on walls.
18110  *
18111  * Revision 1.4  1994/10/27  21:15:07  matt
18112  * Added better error handling
18113  *
18114  * Revision 1.3  1994/10/27  01:03:17  matt
18115  * Made terrain renderer use aribtary point in height array as origin
18116  *
18117  * Revision 1.2  1994/08/19  20:09:44  matt
18118  * Added end-of-level cut scene with external scene
18119  *
18120  * Revision 1.1  1994/08/17  20:20:49  matt
18121  * Initial revision
18122
18123 ------------------------------------------------------------------------
18124 main/terrain.h:
18125
18126  * Revision 1.1  1995/05/16  16:03:56  allender
18127  * Initial revision
18128  *
18129  * Revision 2.0  1995/02/27  11:32:53  john
18130  * New version 2.0, which has no anonymous unions, builds with
18131  * Watcom 10.0, and doesn't require parsing BITMAPS.TBL.
18132  *
18133  * Revision 1.3  1994/10/27  01:03:51  matt
18134  * Made terrain renderer use aribtary point in height array as origin
18135  *
18136  * Revision 1.2  1994/08/19  20:09:45  matt
18137  * Added end-of-level cut scene with external scene
18138  *
18139  * Revision 1.1  1994/08/17  20:33:36  matt
18140  * Initial revision
18141
18142 ------------------------------------------------------------------------
18143 main/texmerge.c:
18144
18145  * Revision 1.1  1995/05/16  15:31:36  allender
18146  * Initial revision
18147  *
18148  * Revision 2.0  1995/02/27  11:31:08  john
18149  * New version 2.0, which has no anonymous unions, builds with
18150  * Watcom 10.0, and doesn't require parsing BITMAPS.TBL.
18151  *
18152  * Revision 1.28  1995/01/14  19:16:56  john
18153  * First version of new bitmap paging code.
18154  *
18155  * Revision 1.27  1994/12/14  18:21:58  yuan
18156  * *** empty log message ***
18157  *
18158  * Revision 1.26  1994/12/13  09:50:08  john
18159  * Added Asserts to stop if wall looks like door.
18160  *
18161  * Revision 1.25  1994/12/07  00:35:24  mike
18162  * change how flat shading average color is computed for paste-ons.
18163  *
18164  * Revision 1.24  1994/11/19  15:20:29  mike
18165  * rip out unused code and data
18166  *
18167  * Revision 1.23  1994/11/12  16:38:51  mike
18168  * deal with avg_color in texture merging.
18169  *
18170  * Revision 1.22  1994/11/09  19:55:39  john
18171  * Added full rle support with texture rle caching.
18172  *
18173  * Revision 1.21  1994/10/20  15:21:16  john
18174  * Took out the texmerge caching.
18175  *
18176  * Revision 1.20  1994/10/10  19:00:57  john
18177  * Made caching info print every 1000 frames.
18178  *
18179  * Revision 1.19  1994/10/10  18:41:21  john
18180  * Printed out texture caching info.
18181  *
18182  * Revision 1.18  1994/08/11  18:59:02  mike
18183  * Use new assembler version of merge functions.
18184  *
18185  * Revision 1.17  1994/06/09  12:13:14  john
18186  * Changed selectors so that all bitmaps have a selector of
18187  * 0, but inside the texture mapper they get a selector set.
18188  *
18189  * Revision 1.16  1994/05/14  17:15:15  matt
18190  * Got rid of externs in source (non-header) files
18191  *
18192  * Revision 1.15  1994/05/09  17:21:09  john
18193  * Took out mprintf with cache hits/misses.
18194  *
18195  * Revision 1.14  1994/05/05  12:55:07  john
18196  * Made SuperTransparency work.
18197  *
18198  * Revision 1.13  1994/05/04  11:15:37  john
18199  * Added Super Transparency
18200  *
18201  * Revision 1.12  1994/04/28  23:36:04  john
18202  * Took out a debugging mprintf.
18203  *
18204  * Revision 1.11  1994/04/22  17:44:48  john
18205  * Made top 2 bits of paste-ons pick the
18206  * orientation of the bitmap.
18207  *
18208  * Revision 1.10  1994/03/31  12:05:51  matt
18209  * Cleaned up includes
18210  *
18211  * Revision 1.9  1994/03/15  16:31:52  yuan
18212  * Cleaned up bm-loading code.
18213  * (And structures)
18214  *
18215  * Revision 1.8  1994/01/24  13:15:19  john
18216  * Made caching work with pointers, not texture numbers,
18217  * that way, the animated textures cache.
18218  *
18219  * Revision 1.7  1994/01/21  16:38:10  john
18220  * Took out debug info.
18221  *
18222  * Revision 1.6  1994/01/21  16:28:43  john
18223  * added warning to print cache hit/miss.
18224  *
18225  * Revision 1.5  1994/01/21  16:22:30  john
18226  * Put in caching/
18227  *
18228  * Revision 1.4  1994/01/21  15:34:49  john
18229  * *** empty log message ***
18230  *
18231  * Revision 1.3  1994/01/21  15:33:08  john
18232  * *** empty log message ***
18233  *
18234  * Revision 1.2  1994/01/21  15:15:35  john
18235  * Created new module texmerge, that merges textures together and
18236  * caches the results.
18237  *
18238  * Revision 1.1  1994/01/21  14:55:29  john
18239  * Initial revision
18240
18241 ------------------------------------------------------------------------
18242 main/texmerge.h:
18243
18244  * Revision 1.1  1995/05/16  16:04:03  allender
18245  * Initial revision
18246  *
18247  * Revision 2.0  1995/02/27  11:28:05  john
18248  * New version 2.0, which has no anonymous unions, builds with
18249  * Watcom 10.0, and doesn't require parsing BITMAPS.TBL.
18250  *
18251  * Revision 1.4  1995/01/14  19:16:26  john
18252  * First version of new bitmap paging code.
18253  *
18254  * Revision 1.3  1994/01/21  15:23:26  john
18255  * made texmerge_close return void.
18256  *
18257  *
18258  * Revision 1.2  1994/01/21  15:16:01  john
18259  * Created new module texmerge, that merges textures together and
18260  * caches the results.
18261  *
18262  * Revision 1.1  1994/01/21  15:03:36  john
18263  * Initial revision
18264
18265 ------------------------------------------------------------------------
18266 main/text.c:
18267
18268  * Revision 1.1  1995/05/16  15:31:44  allender
18269  * Initial revision
18270  *
18271  * Revision 2.0  1995/02/27  11:33:09  john
18272  * New version 2.0, which has no anonymous unions, builds with
18273  * Watcom 10.0, and doesn't require parsing BITMAPS.TBL.
18274  *
18275  * Revision 1.11  1994/12/14  12:53:23  matt
18276  * Improved error handling
18277  *
18278  * Revision 1.10  1994/12/09  18:36:44  john
18279  * Added code to make text read from hogfile.
18280  *
18281  * Revision 1.9  1994/12/08  20:56:34  john
18282  * More cfile stuff.
18283  *
18284  * Revision 1.8  1994/12/08  17:20:06  yuan
18285  * Cfiling stuff.
18286  *
18287  * Revision 1.7  1994/12/05  15:10:36  allender
18288  * support encoded descent.tex file (descent.txb)
18289  *
18290  * Revision 1.6  1994/12/01  14:18:34  matt
18291  * Now support backslash chars in descent.tex file
18292  *
18293  * Revision 1.5  1994/10/27  00:13:10  john
18294  * Took out cfile.
18295  *
18296  * Revision 1.4  1994/07/11  15:33:49  matt
18297  * Put in command-line switch to load different text files
18298  *
18299  * Revision 1.3  1994/07/10  09:56:25  yuan
18300  * #include <stdio.h> added for FILE type.
18301  *
18302  * Revision 1.2  1994/07/09  22:48:14  matt
18303  * Added localizable text
18304  *
18305  * Revision 1.1  1994/07/09  21:30:46  matt
18306  * Initial revision
18307
18308 ------------------------------------------------------------------------
18309 main/text.h:
18310
18311  * Revision 1.3  1995/10/18  23:30:29  allender
18312  * fixed horrendous misspelling
18313  *
18314  * Revision 1.2  1995/10/18  23:27:33  allender
18315  * added new printscreen line to end of text string
18316  *
18317  * Revision 1.1  1995/05/16  16:04:11  allender
18318  * Initial revision
18319  *
18320  * Revision 2.2  1995/03/30  16:36:22  mike
18321  * text localization.
18322  *
18323  * Revision 2.1  1995/03/08  15:33:24  allender
18324  * *** empty log message ***
18325  *
18326  * Revision 2.0  1995/02/27  11:30:21  john
18327  * New version 2.0, which has no anonymous unions, builds with
18328  * Watcom 10.0, and doesn't require parsing BITMAPS.TBL.
18329  *
18330  * Revision 1.63  1995/02/11  14:59:42  rob
18331  * Added string for controlcen invul.
18332  *
18333  * Revision 1.62  1995/02/10  15:19:38  allender
18334  * added text for bad write on demo write
18335  *
18336  * Revision 1.61  1995/02/08  10:59:11  rob
18337  * Added string used in kill list view.
18338  *
18339  * Revision 1.60  1995/02/07  20:38:40  rob
18340  * Added new localized strings for new multi options.
18341  *
18342  * Revision 1.59  1995/02/02  15:29:17  matt
18343  * Changed & localized secret level text
18344  *
18345  * Revision 1.58  1995/02/02  12:24:14  adam
18346  * added automap string
18347  *
18348  * Revision 1.57  1995/02/01  18:06:50  rob
18349  * Localize default macros, other stuff frm network.c
18350  *
18351  * Revision 1.56  1995/01/30  15:29:53  rob
18352  * Localizing.
18353  *
18354  * Revision 1.55  1995/01/30  13:54:25  allender
18355  * added mission/demo text
18356  *
18357  * Revision 1.54  1995/01/24  22:03:22  mike
18358  * text localization.
18359  *
18360  * Revision 1.53  1995/01/23  13:05:59  adam
18361  * added save/load game text
18362  *
18363  * Revision 1.52  1995/01/22  15:58:42  mike
18364  * localization
18365  *
18366  * Revision 1.51  1994/12/29  12:08:47  rob
18367  * removed new text strings.
18368  *
18369  * Revision 1.50  1994/12/28  16:47:14  rob
18370  * Added new com setup strings.
18371  *
18372  * Revision 1.49  1994/12/15  23:24:22  rob
18373  * Added string for rejoin failure.
18374  *
18375  * Revision 1.48  1994/12/15  10:16:06  adam
18376  * added lame trademark notice
18377  *
18378  * Revision 1.47  1994/12/14  18:21:23  yuan
18379  * *** empty log message ***
18380  *
18381  * Revision 1.46  1994/12/14  16:57:01  matt
18382  * Added text for hat2
18383  *
18384  * Revision 1.45  1994/12/14  08:50:12  allender
18385  * *** empty log message ***
18386  *
18387  * Revision 1.44  1994/12/13  19:43:29  rob
18388  * Added string.
18389  *
18390  * Revision 1.43  1994/12/13  12:54:45  mike
18391  * add strings for hostages on board when you die.
18392  *
18393  * Revision 1.42  1994/12/13  10:04:09  allender
18394  * *** empty log message ***
18395  *
18396  * Revision 1.41  1994/12/12  22:20:23  rob
18397  * Added two new localized strings for modem.c
18398  *
18399  * Revision 1.40  1994/12/09  19:46:26  yuan
18400  * Localized the sucker.
18401  *
18402  * Revision 1.39  1994/12/09  14:35:30  yuan
18403  * Added localization string for Rob.
18404  *
18405  * Revision 1.38  1994/12/09  14:08:16  mike
18406  * text message for remaining ships at end bonus.
18407  *
18408  * Revision 1.37  1994/12/09  00:28:26  rob
18409  * Added "died in mine" string.
18410  *
18411  * Revision 1.36  1994/12/08  14:30:31  yuan
18412  * Fixed off by one problem.
18413  *
18414  * Revision 1.35  1994/12/08  11:18:56  allender
18415  * demo text string
18416  *
18417  * Revision 1.33  1994/12/07  19:14:33  matt
18418  * Cleaned up command-line options and command-line help message
18419  *
18420  * Revision 1.32  1994/12/07  17:20:34  yuan
18421  * Localization
18422  *
18423  * Revision 1.31  1994/12/07  16:49:15  yuan
18424  * More localization
18425  *
18426  * Revision 1.30  1994/12/07  14:52:11  yuan
18427  * Localization 492
18428  *
18429  * Revision 1.29  1994/12/07  11:28:12  matt
18430  * Did a little localization support
18431  *
18432  * Revision 1.28  1994/12/06  18:29:31  mike
18433  * Add text for cheat: Start at any level.
18434  *
18435  * Revision 1.27  1994/12/06  16:30:39  yuan
18436  * Localization
18437  *
18438  * Revision 1.26  1994/12/06  15:14:55  yuan
18439  * Fixed number of textstrings.
18440  *
18441  * Revision 1.25  1994/12/06  15:13:52  yuan
18442  * Localization
18443  *
18444  * Revision 1.24  1994/12/06  13:46:24  adam
18445  * *** empty log message ***
18446  *
18447  * Revision 1.23  1994/12/05  23:17:28  yuan
18448  * Localization bugs fixed.
18449  *
18450  * Revision 1.22  1994/12/05  23:05:41  yuan
18451  * Localization 425
18452  *
18453  * Revision 1.21  1994/12/05  22:42:27  rob
18454  * Added new connect status strings
18455  *
18456  * Revision 1.20  1994/12/05  16:47:30  rob
18457  * Added a new string.
18458  *
18459  *
18460  * Revision 1.19  1994/12/03  22:35:17  yuan
18461  * Localization 412
18462  *
18463  * Revision 1.18  1994/12/03  17:53:42  yuan
18464  * 382.
18465
18466 ------------------------------------------------------------------------
18467 main/textures.h:
18468
18469  * Revision 1.1  1995/05/16  16:04:20  allender
18470  * Initial revision
18471  *
18472  * Revision 2.0  1995/02/27  11:31:54  john
18473  * New version 2.0, which has no anonymous unions, builds with
18474  * Watcom 10.0, and doesn't require parsing BITMAPS.TBL.
18475  *
18476  * Revision 1.3  1994/03/15  16:32:56  yuan
18477  * Cleaned up bm-loading code.
18478  * (Fixed structures too)
18479  *
18480  * Revision 1.2  1993/12/05  22:49:53  matt
18481  * Reworked include files in an attempt to cut down on build times
18482  *
18483  * Revision 1.1  1993/12/05  20:16:26  matt
18484  * Initial revision
18485
18486 ------------------------------------------------------------------------
18487 main/titles.c:
18488
18489  * Revision 1.13  1995/11/03  12:52:23  allender
18490  * shareware changes
18491  *
18492  * Revision 1.12  1995/10/31  10:17:56  allender
18493  * shareware stuff
18494  *
18495  * Revision 1.11  1995/10/24  18:12:02  allender
18496  * don't do special processing on do_appl_quit anymore
18497  *
18498  * Revision 1.10  1995/10/21  22:25:02  allender
18499  * added bald guy cheat
18500  *
18501  * Revision 1.9  1995/10/17  13:14:30  allender
18502  * mouse will now move through title stuff
18503  *
18504  * Revision 1.8  1995/10/15  23:00:34  allender
18505  * made mouse move through screens and do event processing
18506  * at title screens
18507  *
18508  * Revision 1.7  1995/10/10  11:52:10  allender
18509  * use appropriate end01 file for registered
18510  *
18511  * Revision 1.6  1995/09/24  10:53:09  allender
18512  * added cmd-q to quit during titles screens and briefing screens
18513  *
18514  * Revision 1.5  1995/08/25  15:39:37  allender
18515  * save and resotre interpolation method during briefing screens
18516  *
18517  * Revision 1.4  1995/08/24  16:10:57  allender
18518  * endgame screen changes, and fixups to other stuff
18519  *
18520  * Revision 1.3  1995/08/14  14:40:37  allender
18521  * fixed up briefing screens to look correct.
18522  * made robot canvas smaller for now for speec
18523  *
18524  * Revision 1.2  1995/06/13  13:07:05  allender
18525  * do a bitblt during tight loops to get spinning robots and cursor flashing
18526  *
18527  * Revision 1.1  1995/05/16  15:31:52  allender
18528  * Initial revision
18529  *
18530  * Revision 2.10  1995/06/15  12:14:16  john
18531  * Made end game, win game and title sequences all go
18532  * on after 5 minutes automatically.
18533  *
18534  * Revision 2.9  1995/06/14  17:25:48  john
18535  * Fixed bug with VFX palette not getting loaded for credits, titles.
18536  *
18537  * Revision 2.8  1995/05/26  16:16:30  john
18538  * Split SATURN into define's for requiring cd, using cd, etc.
18539  * Also started adding all the Rockwell stuff.
18540  *
18541  * Revision 2.7  1995/03/24  13:11:36  john
18542  * Added save game during briefing screens.
18543  *
18544  * Revision 2.6  1995/03/21  14:41:17  john
18545  * Ifdef'd out the NETWORK code.
18546  *
18547  * Revision 2.5  1995/03/15  14:33:45  john
18548  * Added code to force the Descent CD-rom in the drive.
18549  *
18550  * Revision 2.4  1995/03/14  18:24:50  john
18551  * Force Destination Saturn to use CD-ROM drive.
18552  *
18553  * Revision 2.3  1995/03/10  13:05:52  john
18554  * Added code so that palette is correct for VFX1 helmets.
18555  *
18556  * Revision 2.2  1995/03/07  14:19:28  mike
18557  * More destination saturn stuff.
18558  *
18559  * Revision 2.1  1995/03/06  15:24:16  john
18560  * New screen techniques.
18561  *
18562  * Revision 2.0  1995/02/27  11:32:50  john
18563  * New version 2.0, which has no anonymous unions, builds with
18564  * Watcom 10.0, and doesn't require parsing BITMAPS.TBL.
18565  *
18566  * Revision 1.95  1995/02/12  04:07:19  matt
18567  * After freeing Robot_canv, set ptr to NULL
18568  *
18569  * Revision 1.94  1995/02/11  12:41:57  john
18570  * Added new song method, with FM bank switching..
18571  *
18572  * Revision 1.93  1995/02/11  09:51:59  john
18573  * Stripped out all SVGA references.
18574  *
18575  * Revision 1.92  1995/02/07  09:56:10  john
18576  * Fixed bug with wrong title screen drawing during save btwn lvls.
18577  *
18578  * Revision 1.91  1995/02/04  13:53:16  john
18579  * Added code to display the correct titles between levels
18580  * that have robot maps..
18581  *
18582  * Revision 1.90  1995/02/02  16:36:33  adam
18583  * *** empty log message ***
18584  *
18585  * Revision 1.89  1995/02/02  12:23:30  john
18586  * Made between level saves have picture.
18587  *
18588  * Revision 1.88  1995/02/02  01:50:16  adam
18589  * rearranged robot briefings.
18590  *
18591  * Revision 1.87  1995/02/01  22:28:54  mike
18592  * *** empty log message ***
18593  *
18594  * Revision 1.86  1995/02/01  17:12:21  mike
18595  * Make score come after endgame screens.
18596  *
18597  * Revision 1.85  1995/02/01  14:04:17  adam
18598  * mucked with screens
18599  *
18600  * Revision 1.84  1995/01/28  16:59:30  adam
18601  * added hook for special first briefing music
18602  *
18603  * Revision 1.83  1995/01/21  17:04:35  mike
18604  * fix endgame text bogosity.
18605  *
18606  * Revision 1.82  1995/01/21  16:26:29  matt
18607  * Made endlevel briefing work with missions
18608  *
18609  * Revision 1.81  1995/01/21  13:15:20  adam
18610  * added new robot briefings.
18611  *
18612  * Revision 1.80  1995/01/20  22:47:33  matt
18613  * Mission system implemented, though imcompletely
18614  *
18615  * Revision 1.79  1995/01/20  14:57:52  mike
18616  * support arbitrary number of screens/level.
18617  *
18618  * Revision 1.78  1995/01/15  14:29:12  john
18619  * Made the exit door page in.
18620  *
18621  * Revision 1.77  1995/01/15  14:27:09  adam
18622  * messed with endgame stuff
18623  *
18624  * Revision 1.76  1995/01/14  15:42:49  mike
18625  * Make endgame for registered support 3 screens.
18626  *
18627  * Revision 1.75  1995/01/14  14:00:59  adam
18628  * *** empty log message ***
18629  *
18630  * Revision 1.74  1995/01/09  11:28:53  mike
18631  * Support new $O thingy for bitmaps which cycle and are not the exit door.
18632  *
18633  * Revision 1.73  1995/01/02  12:39:13  mike
18634  * fix secret level sequencing.
18635  *
18636  * Revision 1.72  1994/12/12  19:44:14  rob
18637  * Added kill matrix to end of game sequence.
18638  *
18639  * Revision 1.71  1994/12/09  22:32:57  adam
18640  * messed with text positioning
18641  *
18642  * Revision 1.70  1994/12/09  14:08:37  mike
18643  * make briefing text work with hog files.
18644  *
18645  * Revision 1.69  1994/12/09  00:41:47  mike
18646  * fix hang in automap print screen.
18647  *
18648  * Revision 1.68  1994/12/08  20:56:36  john
18649  * More cfile stuff.
18650  *
18651  * Revision 1.67  1994/12/08  17:19:11  yuan
18652  * Cfiling stuff.
18653  *
18654  * Revision 1.66  1994/12/07  11:28:00  matt
18655  * Did a localization suppport
18656  *
18657  * Revision 1.65  1994/12/06  17:10:23  yuan
18658  * Fixed missing )
18659  *
18660  * Revision 1.64  1994/12/06  17:00:45  rob
18661  * Fixed problem with finishing the game in modem/serial mode.
18662  *
18663  * Revision 1.63  1994/12/06  16:58:37  matt
18664  * Killed warnings
18665  *
18666  * Revision 1.62  1994/12/06  15:54:28  mike
18667  * fix guy at end...
18668
18669 ------------------------------------------------------------------------
18670 main/titles.h:
18671
18672  * Revision 2.0  1995/02/27  11:27:40  john
18673  * New version 2.0, which has no anonymous unions, builds with
18674  * Watcom 10.0, and doesn't require parsing BITMAPS.TBL.
18675  *
18676  * Revision 1.12  1995/02/02  12:23:29  john
18677  * Made between level saves have picture.
18678  *
18679  * Revision 1.11  1995/01/21  16:27:11  matt
18680  * Made endlevel briefing work with missions
18681  *
18682  * Revision 1.10  1995/01/20  22:48:02  matt
18683  * Mission system implemented, though imcompletely
18684  *
18685  * Revision 1.9  1994/12/07  19:14:07  matt
18686  * Kill briefing screen disable switch for release version
18687  *
18688  * Revision 1.8  1994/11/21  16:40:24  matt
18689  * Added prototype
18690  *
18691  * Revision 1.7  1994/11/05  14:05:54  john
18692  * Fixed fade transitions between all screens by making gr_palette_fade_in and out keep
18693  * track of whether the palette is faded in or not.  Then, wherever the code needs to fade out,
18694  * it just calls gr_palette_fade_out and it will fade out if it isn't already.  The same with fade_in.
18695  * This eliminates the need for all the flags like Menu_fade_out, game_fade_in palette, etc.
18696  *
18697  * Revision 1.6  1994/11/01  17:57:48  mike
18698  * Briefing screens.
18699  *
18700  * Revision 1.5  1994/10/31  22:28:04  mike
18701  * briefing screens
18702  *
18703  * Revision 1.4  1994/09/16  16:14:31  john
18704  * Added acrade sequencing.
18705  *
18706  * Revision 1.3  1994/06/22  00:26:53  matt
18707  * Added support for Interplay's animating title sequence
18708  *
18709  * Revision 1.2  1994/06/17  12:13:36  john
18710  * More newdemo stuff; made editor->game transition start in slew mode.
18711  *
18712  * Revision 1.1  1994/06/17  10:50:12  john
18713  * Initial revision
18714
18715 ------------------------------------------------------------------------
18716 main/vclip.c:
18717
18718  * Revision 1.2  1995/09/14  14:14:31  allender
18719  * return void in draw_vclip_object
18720  *
18721  * Revision 1.1  1995/05/16  15:32:00  allender
18722  * Initial revision
18723  *
18724  * Revision 2.0  1995/02/27  11:32:41  john
18725  * New version 2.0, which has no anonymous unions, builds with
18726  * Watcom 10.0, and doesn't require parsing BITMAPS.TBL.
18727  *
18728  * Revision 1.8  1994/09/25  23:40:52  matt
18729  * Changed the object load & save code to read/write the structure fields one
18730  * at a time (rather than the whole structure at once).  This mean that the
18731  * object structure can be changed without breaking the load/save functions.
18732  * As a result of this change, the local_object data can be and has been
18733  * incorporated into the object array.  Also, timeleft is now a property
18734  * of all objects, and the object structure has been otherwise cleaned up.
18735  *
18736  * Revision 1.7  1994/09/25  15:45:26  matt
18737  * Added OBJ_LIGHT, a type of object that casts light
18738  * Added generalized lifeleft, and moved it to local_object
18739  *
18740  * Revision 1.6  1994/09/09  20:05:57  mike
18741  * Add vclips for weapons.
18742  *
18743  * Revision 1.5  1994/06/14  21:14:35  matt
18744  * Made rod objects draw lighted or not depending on a parameter, so the
18745  * materialization effect no longer darkens.
18746  *
18747  * Revision 1.4  1994/06/08  18:16:24  john
18748  * Bunch of new stuff that basically takes constants out of the code
18749  * and puts them into bitmaps.tbl.
18750  *
18751  * Revision 1.3  1994/06/03  10:47:17  matt
18752  * Made vclips (used by explosions) which can be either rods or blobs, as
18753  * specified in BITMAPS.TBL.  (This is for the materialization center effect).
18754  *
18755  * Revision 1.2  1994/05/11  09:25:25  john
18756  * Abandoned new vclip system for now because each wallclip, vclip,
18757  * etc, is different and it would be a huge pain to change all of them.
18758  *
18759  * Revision 1.1  1994/05/10  15:21:12  john
18760  * Initial revision
18761
18762 ------------------------------------------------------------------------
18763 main/vclip.h:
18764
18765  * Revision 1.2  1995/09/14  14:14:45  allender
18766  * return void in draw_vclip_object
18767  *
18768  * Revision 1.1  1995/05/16  16:04:35  allender
18769  * Initial revision
18770  *
18771  * Revision 2.0  1995/02/27  11:32:42  john
18772  * New version 2.0, which has no anonymous unions, builds with
18773  * Watcom 10.0, and doesn't require parsing BITMAPS.TBL.
18774  *
18775  * Revision 1.33  1994/11/21  11:17:57  adam
18776  * *** empty log message ***
18777  *
18778  * Revision 1.32  1994/10/12  13:07:07  mike
18779  * Add VCLIP_POWERUP_DISAPPEARANCE.
18780  *
18781  * Revision 1.31  1994/10/12  10:23:54  adam
18782  * *** empty log message ***
18783  *
18784  * Revision 1.30  1994/10/11  12:25:21  matt
18785  * Added "hot rocks" that create badass explosion when hit by weapons
18786  *
18787  * Revision 1.29  1994/10/06  14:10:07  matt
18788  * Added constant for player appearence effect
18789  *
18790  * Revision 1.28  1994/09/26  08:40:30  adam
18791  * *** empty log message ***
18792  *
18793  * Revision 1.27  1994/09/10  17:30:57  mike
18794  * move a prototype here, had been defined in object.c
18795  *
18796  * Revision 1.26  1994/09/09  20:04:25  mike
18797  * Add weapon_vclip.
18798  *
18799  * Revision 1.25  1994/08/31  19:27:09  mike
18800  * Increase max number of Vclips for new pile of weapon powerups.
18801  *
18802  * Revision 1.24  1994/08/14  23:14:43  matt
18803  * Added animating bitmap hostages, and cleaned up vclips a bit
18804  *
18805  * Revision 1.23  1994/07/23  19:56:39  matt
18806  * Took out unused constant
18807  *
18808  * Revision 1.22  1994/07/22  10:42:10  adam
18809  * upped max no. of vclips
18810  *
18811  * Revision 1.21  1994/06/14  21:15:14  matt
18812  * Made rod objects draw lighted or not depending on a parameter, so the
18813  * materialization effect no longer darkens.
18814  *
18815  * Revision 1.20  1994/06/09  19:38:16  john
18816  * Made each Vclip have its own sound... but only used in the
18817  * materialization center.
18818  *
18819  * Revision 1.19  1994/06/09  11:46:26  john
18820  * Took out unused vclip defines.
18821  *
18822  * Revision 1.18  1994/06/08  18:16:33  john
18823  * Bunch of new stuff that basically takes constants out of the code
18824  * and puts them into bitmaps.tbl.
18825  *
18826  * Revision 1.17  1994/06/08  12:49:01  mike
18827  * Add light_value to vclip.
18828  *
18829  * Revision 1.16  1994/06/08  11:43:28  mike
18830  * Allow 20 vclips, I think (anyway, more than it used to be, probably 12).
18831  *
18832  * Revision 1.15  1994/06/03  10:48:22  matt
18833  * Made vclips (used by explosions) which can be either rods or blobs, as
18834  * specified in BITMAPS.TBL.  (This is for the materialization center effect).
18835  *
18836  * Revision 1.14  1994/06/01  17:21:08  john
18837  * Added muzzle flash
18838  *
18839  * Revision 1.13  1994/06/01  10:34:02  john
18840  * Added robot morphing effect.
18841  *
18842  * Revision 1.12  1994/05/16  16:17:38  john
18843  * Bunch of stuff on my Inferno Task list May16-23
18844  *
18845  * Revision 1.11  1994/05/10  18:32:50  john
18846  * *** empty log message ***
18847  *
18848  * Revision 1.10  1994/04/29  14:35:52  matt
18849  * Added second kind of fireball
18850  *
18851  * Revision 1.9  1994/04/11  10:36:31  yuan
18852  * Started adding types for exploding hostages.
18853  *
18854  * Revision 1.8  1994/04/07  16:27:43  yuan
18855  * Added SUPERPIG the robot with 200 hit points.
18856  * Now robots can take multiple hits before blowing up.
18857  *
18858  * Revision 1.7  1994/04/07  13:45:58  yuan
18859  * Defined Pclips... maybe shouldn't be in this file.
18860  *
18861  * Revision 1.6  1994/03/28  20:58:22  yuan
18862  * Added blood vclip constant
18863  *
18864  * Revision 1.5  1994/03/15  16:31:56  yuan
18865  * Cleaned up bm-loading code.
18866  * (And structures)
18867  *
18868  * Revision 1.4  1994/03/04  17:09:43  yuan
18869  * New wall stuff
18870  *
18871  * Revision 1.3  1994/01/11  10:59:01  yuan
18872  * Added effects
18873  *
18874  * Revision 1.2  1994/01/06  17:13:15  john
18875  * Added Video clip functionality
18876  *
18877  * Revision 1.1  1994/01/06  15:10:15  john
18878  * Initial revision
18879
18880 ------------------------------------------------------------------------
18881 main/wall.c:
18882
18883  * Revision 1.1  1995/05/16  15:32:08  allender
18884  * Initial revision
18885  *
18886  * Revision 2.1  1995/03/21  14:39:04  john
18887  * Ifdef'd out the NETWORK code.
18888  *
18889  * Revision 2.0  1995/02/27  11:28:32  john
18890  * New version 2.0, which has no anonymous unions, builds with
18891  * Watcom 10.0, and doesn't require parsing BITMAPS.TBL.
18892  *
18893  * Revision 1.112  1995/02/22  13:53:07  allender
18894  * remove anonymous unions from object structure
18895  *
18896  * Revision 1.111  1995/02/01  17:32:17  adam
18897  * Took out a bogus int3.
18898  *
18899  * Revision 1.110  1995/02/01  17:20:24  john
18900  * Lintized.
18901  *
18902  * Revision 1.109  1995/01/21  17:39:50  matt
18903  * Cleaned up laser/player hit wall confusions
18904  *
18905  * Revision 1.108  1995/01/21  17:14:17  rob
18906  * Fixed bug in multiplayer door-butting.
18907  *
18908  * Revision 1.107  1995/01/18  18:57:11  rob
18909  * Added new hostage door hooks.
18910  *
18911  * Revision 1.106  1995/01/18  18:48:18  allender
18912  * removed #ifdef newdemo's.  Added function call to record a door that
18913  * starts to open. This fixes the rewind problem
18914  *
18915  * Revision 1.105  1995/01/16  11:55:39  mike
18916  * make control center (and robots whose id == your playernum) not able to open doors.
18917  *
18918  * Revision 1.104  1994/12/11  23:07:21  matt
18919  * Fixed stuck objects & blastable walls
18920  *
18921  * Revision 1.103  1994/12/10  16:44:34  matt
18922  * Added debugging code to track down door that turns into rock
18923  *
18924  * Revision 1.102  1994/12/06  16:27:05  matt
18925  * Added debugging
18926  *
18927  * Revision 1.101  1994/12/02  10:50:27  yuan
18928  * Localization
18929  *
18930  * Revision 1.100  1994/11/30  19:41:22  rob
18931  * Put in a fix so that door opening sounds travel through the door.
18932  *
18933  * Revision 1.99  1994/11/28  11:59:50  yuan
18934  * *** empty log message ***
18935  *
18936  * Revision 1.98  1994/11/28  11:25:45  matt
18937  * Cleaned up key hud messages
18938  *
18939  * Revision 1.97  1994/11/27  23:15:11  matt
18940  * Made changes for new mprintf calling convention
18941  *
18942  * Revision 1.96  1994/11/19  15:18:29  mike
18943  * rip out unused code and data.
18944  *
18945  * Revision 1.95  1994/11/17  14:57:12  mike
18946  * moved segment validation functions from editor to main.
18947  *
18948  * Revision 1.94  1994/11/07  08:47:30  john
18949  * Made wall state record.
18950  *
18951  * Revision 1.93  1994/11/04  16:06:37  rob
18952  * Fixed network damage of blastable walls.
18953  *
18954  * Revision 1.92  1994/11/02  21:54:01  matt
18955  * Don't let objects with zero size keep door from shutting
18956  *
18957  * Revision 1.91  1994/10/31  13:48:42  rob
18958  * Fixed bug in opening doors over network/modem.  Added a new message
18959  * type to multi.c that communicates door openings across the net.
18960  * Changed includes in multi.c and wall.c to accomplish this.
18961  *
18962  * Revision 1.90  1994/10/28  14:42:41  john
18963  * Added sound volumes to all sound calls.
18964  *
18965  * Revision 1.89  1994/10/23  19:16:55  matt
18966  * Fixed bug with "no key" messages
18967
18968 ------------------------------------------------------------------------
18969 main/wall.h:
18970
18971  * Revision 1.1  1995/05/16  16:05:14  allender
18972  * Initial revision
18973  *
18974  * Revision 2.0  1995/02/27  11:31:36  john
18975  * New version 2.0, which has no anonymous unions, builds with
18976  * Watcom 10.0, and doesn't require parsing BITMAPS.TBL.
18977  *
18978  * Revision 1.47  1994/11/19  15:20:35  mike
18979  * rip out unused code and data
18980  *
18981  * Revision 1.46  1994/10/25  15:40:12  yuan
18982  * MAX_WALLS pumped up
18983  *
18984  * Revision 1.45  1994/10/23  19:17:07  matt
18985  * Fixed bug with "no key" messages
18986  *
18987  * Revision 1.44  1994/10/18  15:38:03  mike
18988  * Define hidden walls.
18989  *
18990  * Revision 1.43  1994/10/04  13:32:26  adam
18991  * commented out MAX_DOOR_ANIMS
18992  *
18993  * Revision 1.42  1994/10/04  13:31:21  adam
18994  * upped MAX_WALL_ANIMS to 30
18995  *
18996  * Revision 1.41  1994/09/29  00:42:30  matt
18997  * Made hitting a locked door play a sound
18998  *
18999  * Revision 1.40  1994/09/27  15:42:41  mike
19000  * Prototype Wall_names.
19001  *
19002  * Revision 1.39  1994/09/23  22:15:32  matt
19003  * Made doors not close on objects, made doors open again if shot while
19004  * closing, and cleaned up walls/doors a bit.
19005  *
19006  * Revision 1.38  1994/09/22  15:31:33  matt
19007  * Mucked with, and hopefully improved, exploding walls
19008  *
19009  * Revision 1.37  1994/09/21  17:17:05  mike
19010  * Make objects stuck in doors go away when door opens.
19011  *
19012  * Revision 1.36  1994/09/13  21:10:46  matt
19013  * Added wclips that use tmap1 instead of tmap2, saving lots of merging
19014  *
19015  * Revision 1.35  1994/09/13  20:11:08  yuan
19016  * *** empty log message ***
19017  *
19018  * Revision 1.34  1994/09/10  13:31:53  matt
19019  * Made exploding walls a type of blastable walls.
19020  * Cleaned up blastable walls, making them tmap2 bitmaps.
19021  *
19022  * Revision 1.33  1994/08/17  12:55:34  matt
19023  * Added external walls to wall_is_doorway
19024  *
19025  * Revision 1.32  1994/08/15  17:54:35  john
19026  * *** empty log message ***
19027  *
19028  * Revision 1.31  1994/08/15  17:46:56  yuan
19029  * Added external walls, fixed blastable walls.
19030  *
19031  * Revision 1.30  1994/08/05  21:17:21  matt
19032  * Allow two doors to be linked together
19033  *
19034  * Revision 1.29  1994/08/01  10:39:10  matt
19035  * Parenthesized parms to WID() macro
19036  *
19037  * Revision 1.28  1994/07/20  17:35:03  yuan
19038  * Some minor bug fixes and new key gauges...
19039  *
19040  * Revision 1.27  1994/07/19  14:32:03  yuan
19041  * Fixed keys bug... renumbered some constants.
19042  *
19043  * Revision 1.26  1994/07/14  22:38:29  matt
19044  * Added exploding doors
19045  *
19046  * Revision 1.25  1994/07/11  15:08:43  yuan
19047  * Wall anim file names stored in structure.
19048
19049 ------------------------------------------------------------------------
19050 main/weapon.c:
19051
19052  * Revision 1.2  1995/10/31  10:17:39  allender
19053  * new shareware stuff
19054  *
19055  * Revision 1.1  1995/05/16  15:32:16  allender
19056  * Initial revision
19057  *
19058  * Revision 2.1  1995/03/21  14:38:43  john
19059  * Ifdef'd out the NETWORK code.
19060  *
19061  * Revision 2.0  1995/02/27  11:27:25  john
19062  * New version 2.0, which has no anonymous unions, builds with
19063  * Watcom 10.0, and doesn't require parsing BITMAPS.TBL.
19064  *
19065  * Revision 1.54  1995/02/15  15:21:48  mike
19066  * make smart missile select if mega missiles used up.
19067  *
19068  *
19069  * Revision 1.53  1995/02/12  02:12:30  john
19070  * Fixed bug with state restore making weapon beeps.
19071  *
19072  * Revision 1.52  1995/02/09  20:42:15  mike
19073  * change weapon autoselect, always autoselect smart, mega.
19074  *
19075  * Revision 1.51  1995/02/07  20:44:26  mike
19076  * autoselect mega, smart when you pick them up.
19077  *
19078  * Revision 1.50  1995/02/07  13:32:25  rob
19079  * Added include of multi.h
19080  *
19081  * Revision 1.49  1995/02/07  13:21:33  yuan
19082  * Fixed 2nd typo
19083  *
19084  * Revision 1.48  1995/02/07  13:16:39  yuan
19085  * Fixed typo.
19086  *
19087  * Revision 1.47  1995/02/07  12:53:12  rob
19088  * Added network sound prop. to weapon switch.
19089  *
19090  * Revision 1.46  1995/02/06  15:53:17  mike
19091  * don't autoselect smart or mega missile when you pick it up.
19092  *
19093  * Revision 1.45  1995/02/02  21:43:34  mike
19094  * make autoselection better.
19095  *
19096  * Revision 1.44  1995/02/02  16:27:21  mike
19097  * make concussion missiles trade up.
19098  *
19099  * Revision 1.43  1995/02/01  23:34:57  adam
19100  * messed with weapon change sounds
19101  *
19102  * Revision 1.42  1995/02/01  17:12:47  mike
19103  * Make smart missile, mega missile not auto-select.
19104  *
19105  * Revision 1.41  1995/02/01  15:50:54  mike
19106  * fix bogus weapon selection sound code.
19107  *
19108  * Revision 1.40  1995/01/31  16:16:31  mike
19109  * Separate smart blobs for robot and player.
19110  *
19111  * Revision 1.39  1995/01/30  21:12:11  mike
19112  * Use new weapon selection sounds, different for primary and secondary.
19113  *
19114  * Revision 1.38  1995/01/29  13:46:52  mike
19115  * Don't auto-select fusion cannon when you run out of energy.
19116  *
19117  * Revision 1.37  1995/01/20  11:11:13  allender
19118  * record weapon changes again.  (John somehow lost my 1.35 changes).
19119  *
19120  * Revision 1.36  1995/01/19  17:00:46  john
19121  * Made save game work between levels.
19122  *
19123  * Revision 1.34  1995/01/09  17:03:48  mike
19124  * fix autoselection of weapons.
19125  *
19126  * Revision 1.33  1995/01/05  15:46:31  john
19127  * Made weapons not rearm when starting a saved game.
19128  *
19129  * Revision 1.32  1995/01/03  12:34:23  mike
19130  * autoselect next lower weapon if run out of smart or mega missile.
19131  *
19132  * Revision 1.31  1994/12/12  21:39:37  matt
19133  * Changed vulcan ammo: 10K max, 5K w/weapon, 1250 per powerup
19134  *
19135  * Revision 1.30  1994/12/09  19:55:04  matt
19136  * Added weapon name in "not available in shareware" message
19137  *
19138  * Revision 1.29  1994/12/06  13:50:24  adam
19139  * added shareware msg. when choosing 4 top weapons
19140  *
19141  * Revision 1.28  1994/12/02  22:07:13  mike
19142  * if you gots 19 concussion missiles and you runs over 4, say you picks up 1, not 4, we do the math, see?
19143  *
19144  * Revision 1.27  1994/12/02  20:06:24  matt
19145  * Made vulcan ammo print at approx 25 times actual
19146  *
19147  * Revision 1.26  1994/12/02  15:05:03  matt
19148  * Fixed bogus weapon constants and arrays
19149  *
19150  * Revision 1.25  1994/12/02  10:50:34  yuan
19151  * Localization
19152  *
19153  * Revision 1.24  1994/11/29  15:48:28  matt
19154  * selecting weapon now makes sound
19155  *
19156  * Revision 1.23  1994/11/28  11:26:58  matt
19157  * Cleaned up hud message printing for picking up weapons
19158  *
19159  * Revision 1.22  1994/11/27  23:13:39  matt
19160  * Made changes for new mprintf calling convention
19161  *
19162  * Revision 1.21  1994/11/12  16:38:34  mike
19163  * clean up default ammo stuff.
19164  *
19165  * Revision 1.20  1994/11/07  17:41:18  mike
19166  * messages for when you try to fire a weapon you don't have or don't have ammo for.
19167  *
19168  * Revision 1.19  1994/10/21  20:40:05  mike
19169  * fix double vulcan ammo.
19170  *
19171  * Revision 1.18  1994/10/20  09:49:05  mike
19172  * kill messages no one liked...*sniff* *sniff*
19173  *
19174  * Revision 1.17  1994/10/19  11:17:07  mike
19175  * Limit amount of player ammo.
19176  *
19177  * Revision 1.16  1994/10/12  08:04:18  mike
19178  * Fix proximity/homing confusion.
19179  *
19180  * Revision 1.15  1994/10/11  18:27:58  matt
19181  * Changed auto selection of secondary weapons
19182  *
19183  * Revision 1.14  1994/10/08  23:37:54  matt
19184  * Don't pick up weapons you already have; also fixed auto_select bug
19185  * for seconary weapons
19186  *
19187  * Revision 1.13  1994/10/08  14:55:47  matt
19188  * Fixed bug that selected vulcan cannon when picked up ammo, even though
19189  * you didn't have the weapon.
19190  *
19191  * Revision 1.12  1994/10/08  12:50:32  matt
19192  * Fixed bug that let you select weapons you don't have
19193  *
19194  * Revision 1.11  1994/10/07  23:37:56  matt
19195  * Made weapons select when pick up better one
19196  *
19197  * Revision 1.10  1994/10/07  16:02:08  matt
19198  * Fixed problem with weapon auto-select
19199  *
19200  * Revision 1.9  1994/10/05  17:00:20  matt
19201  * Made player_has_weapon() public and moved constants to header file
19202  *
19203  * Revision 1.8  1994/09/26  11:27:13  mike
19204  * Fix auto selection of weapon when you run out of ammo.
19205  *
19206  * Revision 1.7  1994/09/13  16:40:45  mike
19207  * Add rearm delay and missile firing delay.
19208  *
19209  * Revision 1.6  1994/09/13  14:43:12  matt
19210  * Added cockpit weapon displays
19211  *
19212  * Revision 1.5  1994/09/03  15:23:06  mike
19213  * Auto select next weaker weapon when one runs out, clean up code.
19214  *
19215  * Revision 1.4  1994/09/02  16:38:19  mike
19216  * Eliminate a pile of arrays, associate weapon data with Weapon_info.
19217  *
19218  * Revision 1.3  1994/09/02  11:57:10  mike
19219  * Add a bunch of stuff, I forget what.
19220  *
19221  * Revision 1.2  1994/06/03  16:26:32  john
19222  * Initial version.
19223  *
19224  * Revision 1.1  1994/06/03  14:40:43  john
19225  * Initial revision
19226
19227 ------------------------------------------------------------------------
19228 main/weapon.h:
19229
19230  * Revision 1.2  1995/09/14  14:07:10  allender
19231  * fixed prototypes to have return value
19232  *
19233  * Revision 1.1  1995/05/16  16:05:22  allender
19234  * Initial revision
19235  *
19236  * Revision 2.0  1995/02/27  11:31:10  john
19237  * New version 2.0, which has no anonymous unions, builds with
19238  * Watcom 10.0, and doesn't require parsing BITMAPS.TBL.
19239  *
19240  * Revision 1.44  1995/01/30  17:14:18  mike
19241  * halve rate of vulcan ammo consumption.
19242  *
19243  * Revision 1.43  1995/01/19  17:45:04  mike
19244  * damage_force removed, that information coming from strength field.
19245  *
19246  * Revision 1.42  1995/01/05  15:46:11  john
19247  * Made weapons not rearm when starting a saved game.
19248  *
19249  * Revision 1.41  1995/01/04  12:20:27  john
19250  * Declearations to work better with game state save.
19251  *
19252  *
19253  * Revision 1.40  1994/12/13  12:54:16  mike
19254  * fix proximity, homing flags, backwards!
19255  *
19256  * Revision 1.39  1994/12/11  16:17:57  mike
19257  * change default weapon life so shots from ctrlcen on level 6 won't evaporate before they hit you.
19258  *
19259  * Revision 1.38  1994/12/09  19:55:26  matt
19260  * Added weapon name in "not available in shareware" message
19261  *
19262  * Revision 1.37  1994/12/07  12:55:27  mike
19263  * tweak vulcan amounts.
19264  *
19265  * Revision 1.36  1994/12/03  19:03:56  matt
19266  * Fixed vulcan ammo HUD message
19267  *
19268  * Revision 1.35  1994/12/02  15:05:02  matt
19269  * Fixed bogus weapon constants and arrays
19270  *
19271  * Revision 1.34  1994/11/29  14:26:05  john
19272  * Again.
19273  *
19274  * Revision 1.33  1994/11/29  14:13:47  adam
19275  * Changed the byte flash sound to short.
19276  *
19277  * Revision 1.32  1994/11/12  16:36:55  mike
19278  * default ammo stuff.
19279  *
19280  * Revision 1.31  1994/10/21  10:55:24  adam
19281  * upped MAX_WEAPON_TYPES to 30
19282  *
19283  * Revision 1.30  1994/10/19  11:16:37  mike
19284  * Limit ammo amounts.
19285  *
19286  * Revision 1.29  1994/10/12  08:05:04  mike
19287  * Clean up homing/proximity mess.
19288  *
19289  * Revision 1.28  1994/10/08  23:37:53  matt
19290  * Don't pick up weapons you already have; also fixed auto_select bug
19291  * for seconary weapons
19292  *
19293  * Revision 1.27  1994/10/07  23:37:56  matt
19294  * Made weapons select when pick up better one
19295  *
19296  * Revision 1.26  1994/10/07  16:02:17  matt
19297  * Fixed problem with weapon auto-select
19298  *
19299  * Revision 1.25  1994/10/05  17:07:44  matt
19300  * Made player_has_weapon() public and moved constants to header file
19301  *
19302  * Revision 1.24  1994/09/30  21:50:49  mike
19303  * Add homing_flag and 3 dummy bytes to weapon_info.
19304  *
19305  * Revision 1.23  1994/09/30  13:47:41  mike
19306  * Make speed and strength be difficulty level based.
19307  *
19308  * Revision 1.22  1994/09/20  16:10:13  mike
19309  * Prototype Primary_weapon_names and Secondary_weapon_names.
19310  *
19311  * Revision 1.21  1994/09/20  12:17:21  adam
19312  * upped weapon types
19313  *
19314  * Revision 1.20  1994/09/13  16:40:29  mike
19315  * Define REARM_TIME -- time it takes until you can fire a newly armed weapon.
19316  *
19317  * Revision 1.19  1994/09/13  14:43:03  matt
19318  * Added cockpit weapon displays
19319  *
19320  * Revision 1.18  1994/09/11  15:50:34  mike
19321  * Add matter and bounce to weapon_info.
19322  *
19323  * Revision 1.17  1994/09/10  17:32:17  mike
19324  * Add thrust to weapon_info.
19325  *
19326  * Revision 1.16  1994/09/09  20:04:54  mike
19327  * Add vclips for weapons.
19328  *
19329  * Revision 1.15  1994/09/07  15:59:14  mike
19330  * Add default lifetimes to weapons, destroyable, lifetime, damage_radius, damage_force fields to weapons.
19331  *
19332  * Revision 1.14  1994/09/03  15:18:06  mike
19333  * Add prototype for auto_select_weapon.
19334  *
19335  * Revision 1.13  1994/09/02  16:38:33  mike
19336  * Move data from global arrays to Weapon_info.
19337  *
19338  * Revision 1.12  1994/09/02  11:54:59  mike
19339  * Add a whole slew of constants for the whole slew of new weapons.
19340  *
19341  * Revision 1.11  1994/08/23  16:39:15  mike
19342  * Add light to weapon struct
19343
19344 ------------------------------------------------------------------------
19345 maths/fixc.c:
19346
19347  * Revision 1.7  1995/09/22  14:08:16  allender
19348  * fixed fix_atan2 to work correctly with doubles
19349  *
19350  * Revision 1.6  1995/08/31  15:43:49  allender
19351  * *** empty log message ***
19352  *
19353  * Revision 1.5  1995/07/05  16:15:15  allender
19354  * make fixmuldiv use doubles for PPC implementation
19355  *
19356  * Revision 1.4  1995/05/15  13:57:36  allender
19357  * make fixmuldiv compile when compiling under 68k
19358  *
19359  * Revision 1.3  1995/05/11  13:02:59  allender
19360  * some routines are now in assembly
19361  *
19362  * Revision 1.2  1995/05/04  20:04:45  allender
19363  * use MPW fixdiv if compiling with MPW (why did I do this?)
19364  *
19365  * Revision 1.1  1995/04/17  11:37:54  allender
19366  * Initial revision
19367  *
19368  *
19369  * --- PC RCS Info ---
19370  * Revision 1.1  1995/03/08  18:55:09  matt
19371  * Initial revision
19372
19373 ------------------------------------------------------------------------
19374 maths/tables.c:
19375
19376  * Revision 1.2  1995/08/31  15:44:36  allender
19377  * ..
19378  *
19379  * Revision 1.1  1995/04/17  11:38:04  allender
19380  * Initial revision
19381
19382 ------------------------------------------------------------------------
19383 maths/vecmat.c:
19384
19385  * Revision 1.5  1995/10/30  11:08:16  allender
19386  * fix check_vec to return if vector is the NULL vector
19387  *
19388  * Revision 1.4  1995/09/23  09:38:14  allender
19389  * removed calls for PPC that are now handled in asm
19390  *
19391  * Revision 1.3  1995/08/31  15:50:24  allender
19392  * fixing up of functions for PPC
19393  *
19394  * Revision 1.2  1995/07/05  16:40:21  allender
19395  * some vecmat stuff might be using isqrt -- commented out
19396  * for now
19397  *
19398  * Revision 1.1  1995/04/17  16:18:02  allender
19399  * Initial revision
19400  *
19401  *
19402  * --- PC RCS Information ---
19403  * Revision 1.1  1995/03/08  15:56:50  matt
19404  * Initial revision
19405
19406 ------------------------------------------------------------------------
19407 maths/vecmata.asm:
19408
19409 ; Revision 1.54  1995/01/31  00:14:50  matt
19410 ; Took out int3 from dotprod overflow, since it saturates now
19411 ;
19412 ; Revision 1.53  1994/12/14  18:29:33  matt
19413 ; Made dotprod overflow check stay in, and return saturated value
19414 ;
19415 ; Revision 1.52  1994/12/14  12:34:13  matt
19416 ; Disabled now-unused vector_2_matrix_norm()
19417 ;
19418 ; Revision 1.51  1994/12/13  16:55:13  matt
19419 ; Ripped out optimization from last version, which was bogus
19420 ;
19421 ; Revision 1.50  1994/12/13  14:55:18  matt
19422 ; Use quick normalize in a couple of places where it was safe to do so
19423 ;
19424 ; Revision 1.49  1994/12/13  14:44:12  matt
19425 ; Added vm_vector_2_matrix_norm()
19426 ;
19427 ; Revision 1.48  1994/12/13  13:26:49  matt
19428 ; Fixed overflow check
19429 ;
19430 ; Revision 1.47  1994/12/03  15:39:54  matt
19431 ; Gracefully handle some vector_2_matrix problems
19432 ;
19433 ; Revision 1.46  1994/11/19  17:15:05  matt
19434 ; Assemble out some code not used in DESCENT
19435 ;
19436 ; Revision 1.45  1994/11/17  11:41:05  matt
19437 ; Put handling in extract_angles_from_matrix to deal with bad matrices
19438 ;
19439 ; Revision 1.44  1994/11/16  11:48:10  matt
19440 ; Added error checking to vm_extract_angles_matrix()
19441 ;
19442 ; Revision 1.43  1994/09/19  22:00:10  matt
19443 ; Fixed register trash
19444 ;
19445 ; Revision 1.42  1994/09/11  19:23:05  matt
19446 ; Added vm_vec_normalized_dir_quick()
19447 ;
19448 ; Revision 1.41  1994/08/14  13:28:38  matt
19449 ; Put in check for zero-length vector in extract angles
19450 ;
19451 ; Revision 1.40  1994/07/19  18:52:53  matt
19452 ; Added vm_vec_normalize_quick() and vm_vec_copy_normalize_quick()
19453 ;
19454 ; Revision 1.39  1994/06/16  18:24:22  matt
19455 ; Added vm_vec_mag_quick()
19456 ;
19457 ; Revision 1.38  1994/06/10  23:18:38  matt
19458 ; Added new code for vm_vec_ang_2_matrix() which may be better, but may
19459 ; not be.
19460 ;
19461 ; Revision 1.37  1994/05/22  18:17:29  mike
19462 ; Optimize vm_vec_dist_quick, using jns in place of abs_eax.
19463 ;
19464 ; Revision 1.36  1994/05/19  12:07:04  matt
19465 ; Fixed globals and macros and added a constant
19466 ;
19467 ; Revision 1.35  1994/05/19  09:19:00  matt
19468 ; Made vm_vec_normalized_dir() return mag of vector
19469 ;
19470 ; Revision 1.34  1994/05/18  22:28:01  matt
19471 ; Added function vm_vec_normalized_dir()
19472 ; Added C macros IS_ZERO_VEC(), vm_vec_zero(), and vm_set_identity()
19473 ; Added C global static vars vmd_zero_vector & vmd_identity_matrix
19474 ;
19475 ; Revision 1.33  1994/05/18  21:44:16  matt
19476 ; Added functions:
19477 ;   vm_extract_angles_vector()
19478 ;   vm_extract_angles_vector_normalized()
19479 ;   vm_vec_copy_normalize()
19480 ;
19481 ; Revision 1.32  1994/05/13  12:41:51  matt
19482 ; Added new function, vm_vec_dist_quick(), which does an approximation.
19483 ;
19484 ; Revision 1.31  1994/05/04  17:41:31  mike
19485 ; Comment out debug_brk on null vector.
19486 ;
19487 ; Revision 1.30  1994/04/15  21:41:31  matt
19488 ; Check for foward vector straigt up in extract angles routine
19489 ;
19490 ; Revision 1.29  1994/03/30  15:45:05  matt
19491 ; Added two functions, vm_vec_scale_add() & vm_vec_scale_add2()
19492 ;
19493 ; Revision 1.28  1994/02/26  19:23:35  matt
19494 ; Do an int3 when we get a null vector when computing surface normal
19495 ;
19496 ; Revision 1.27  1994/02/10  18:29:45  matt
19497 ; Changed 'if DEBUG_ON' to 'ifndef NDEBUG'
19498 ;
19499 ; Revision 1.26  1994/02/10  18:28:55  matt
19500 ; Fixed bugs in extract angles function
19501 ;
19502 ; Revision 1.25  1994/01/31  22:46:07  matt
19503 ; Added vm_extract_angles_matrix() function
19504 ;
19505 ; Revision 1.24  1994/01/30  19:29:55  matt
19506 ; Put in debug_brk when vm_vec_2_matrix got zero-length vector
19507 ;
19508 ; Revision 1.23  1994/01/25  15:27:59  matt
19509 ; Added debugging check for dotprod overflow
19510 ;
19511 ; Revision 1.22  1994/01/24  11:52:59  matt
19512 ; Added checking for dest==src for several functions where this is not allowed
19513 ;
19514 ; Revision 1.21  1994/01/19  23:13:02  matt
19515 ; Fixed bug in vm_vec_ang_2_matrix()
19516 ;
19517 ; Revision 1.20  1994/01/04  12:33:43  mike
19518 ; Prevent divide overflow in vm_vec_scale2
19519 ;
19520 ; Revision 1.19  1993/12/21  19:46:26  matt
19521 ; Added function vm_dist_to_plane()
19522 ;
19523 ; Revision 1.18  1993/12/13  17:26:23  matt
19524 ; Added vm_vec_dist()
19525 ;
19526 ; Revision 1.17  1993/12/02  12:43:39  matt
19527 ; New functions: vm_vec_copy_scale(), vm_vec_scale2()
19528 ;
19529 ; Revision 1.16  1993/10/29  22:39:29  matt
19530 ; Changed matrix order, making direction vectors the rows
19531 ;
19532 ; Revision 1.15  1993/10/29  18:06:01  matt
19533 ; Fixed vm_vector_2_matrix() bug when forward vector was straight down
19534 ;
19535 ; Revision 1.14  1993/10/26  18:51:26  matt
19536 ; Fixed some register trashes in vm_vec_ang_2_matrix()
19537 ;
19538 ; Revision 1.13  1993/10/25  11:49:37  matt
19539 ; Made vm_vec_delta_ang() take optional forward vector to return signed delta
19540 ;
19541 ; Revision 1.12  1993/10/20  01:09:42  matt
19542 ; Added vm_vec_delta_ang(), vm_vec_delta_ang_norm(), and vm_vec_ang_2_matrix()
19543 ;
19544 ; Revision 1.11  1993/10/17  17:03:08  matt
19545 ; vm_vector_2_matrix() now takes optional right vector
19546 ;
19547 ; Revision 1.10  1993/10/10  18:11:42  matt
19548 ; Changed angles_2_matrix so that heading & bank rotate in the
19549 ; correct directions.
19550 ;
19551 ; Revision 1.9  1993/09/30  16:17:59  matt
19552 ; Fixed bug in vector_2_matrix() by adding another normalize
19553 ;
19554 ; Revision 1.8  1993/09/29  10:51:58  matt
19555 ; Fixed bad register trashes in crossprod, perp, & normal
19556 ;
19557 ; Revision 1.7  1993/09/28  12:16:46  matt
19558 ; Fixed bugs in cross product
19559 ; Added func vm_vector_2_matrix()
19560 ;
19561 ; Revision 1.6  1993/09/24  21:19:37  matt
19562 ; Added vm_vec_avg() and vm_vec_avg4()
19563 ;
19564 ; Revision 1.5  1993/09/20  18:15:07  matt
19565 ; Trap zero-length vectors in vm_vec_normalize(), vm_vec_perp(), and vm_vec_normal()
19566 ;
19567 ; Revision 1.4  1993/09/20  14:56:43  matt
19568 ; Fixed bug in vm_vec_normal(), made that routine normalize the results,
19569 ; and added new function vm_vec_perp().
19570 ;
19571 ; Revision 1.3  1993/09/20  10:12:06  mike
19572 ; no changes
19573 ;
19574 ; Revision 1.2  1993/09/17  11:10:33  matt
19575 ; Added vm_vec_add2() and vm_vec_sub2(), which take 2 args (dest==src0)
19576 ;
19577 ; Revision 1.1  1993/09/16  20:10:24  matt
19578 ; Initial revision
19579
19580 ------------------------------------------------------------------------
19581 misc/args.c:
19582
19583  * Revision 2.0  1995/02/27  11:31:22  john
19584  * New version 2.0, which has no anonymous unions, builds with
19585  * Watcom 10.0, and doesn't require parsing BITMAPS.TBL.
19586  *
19587  * Revision 1.9  1994/11/29  01:07:57  john
19588  * Took out some unused vars.
19589  *
19590  * Revision 1.8  1994/11/29  01:04:30  john
19591  * Took out descent.ini stuff.
19592  *
19593  * Revision 1.7  1994/09/20  19:29:15  matt
19594  * Made args require exact (not substring), though still case insensitive.
19595  *
19596  * Revision 1.6  1994/07/25  12:33:11  john
19597  * Network "pinging" in.
19598  *
19599  * Revision 1.5  1994/06/17  18:07:50  matt
19600  * Took out printf
19601  *
19602  * Revision 1.4  1994/05/11  19:45:33  john
19603  * *** empty log message ***
19604  *
19605  * Revision 1.3  1994/05/11  18:42:11  john
19606  * Added Descent.ini config file.
19607  *
19608  * Revision 1.2  1994/05/09  17:03:30  john
19609  * Split command line parameters into arg.c and arg.h.
19610  * Also added /dma, /port, /irq to digi.c
19611  *
19612  * Revision 1.1  1994/05/09  16:49:11  john
19613  * Initial revision
19614
19615 ------------------------------------------------------------------------
19616 misc/error.c:
19617
19618  * Revision 1.12  1994/12/07  18:49:39  matt
19619  * error_init() can now take NULL as parm
19620  *
19621  * Revision 1.11  1994/11/29  15:42:07  matt
19622  * Added newline before error message
19623  *
19624  * Revision 1.10  1994/11/27  23:20:39  matt
19625  * Made changes for new mprintf calling convention
19626  *
19627  * Revision 1.9  1994/06/20  21:20:56  matt
19628  * Allow NULL for warn func, to kill warnings
19629  *
19630  * Revision 1.8  1994/05/20  15:11:35  mike
19631  * mprintf Warning message so you can actually see it.
19632  *
19633  * Revision 1.7  1994/02/10  18:02:38  matt
19634  * Changed 'if DEBUG_ON' to 'ifndef NDEBUG'
19635  *
19636  * Revision 1.6  1993/10/17  18:19:10  matt
19637  * If error_init() not called, Error() now prints the error message before
19638  * calling exit()
19639  *
19640  * Revision 1.5  1993/10/14  15:29:11  matt
19641  * Added new function clear_warn_func()
19642  *
19643  * Revision 1.4  1993/10/08  16:17:19  matt
19644  * Made Assert() call function _Assert(), rather to do 'if...' inline.
19645  *
19646  * Revision 1.3  1993/09/28  12:45:25  matt
19647  * Fixed wrong print call, and made Warning() not append a CR to string
19648  *
19649  * Revision 1.2  1993/09/27  11:46:35  matt
19650  * Added function set_warn_func()
19651  *
19652  * Revision 1.1  1993/09/23  20:17:33  matt
19653  * Initial revision
19654
19655 ------------------------------------------------------------------------
19656 texmap/ntmap.c:
19657
19658  * Revision 1.52  1995/03/14  15:13:06  john
19659  * Increased MAX_Y_Pointers to 480.
19660  *
19661  * Revision 1.51  1995/02/23  14:25:09  john
19662  * Added editor tmap.
19663  *
19664  * Revision 1.50  1995/02/20  18:22:58  john
19665  * Put all the externs in the assembly modules into tmap_inc.asm.
19666  * Also, moved all the C versions of the inner loops into a new module,
19667  * scanline.c.
19668  *
19669  * Revision 1.49  1995/02/20  17:09:11  john
19670  * Added code so that you can build the tmapper with no assembly!
19671  *
19672  * Revision 1.48  1995/01/06  11:11:30  mike
19673  * even when not in editor, have 400 lines in texture map scanline table.
19674  *
19675  * Revision 1.47  1994/12/15  16:43:25  matt
19676  * Took out code only needed by editor
19677  *
19678  * Revision 1.46  1994/12/09  22:35:37  mike
19679  * fix bug in before call to asm_tmap_scanline_per causing write of pixel onto past right border onto left.
19680  *
19681  * Revision 1.45  1994/12/06  16:31:06  mike
19682  * fix bug in asm_tmap_scanline_matt interface.
19683  *
19684  * Revision 1.44  1994/12/04  20:37:18  mike
19685  * *** empty log message ***
19686  *
19687  * Revision 1.43  1994/12/02  23:30:04  mike
19688  * optimizations.
19689  *
19690  * Revision 1.42  1994/11/30  00:57:43  mike
19691  * optimizations.
19692  *
19693  * Revision 1.41  1994/11/28  13:34:27  mike
19694  * optimizations.
19695  *
19696  * Revision 1.40  1994/11/28  01:30:01  mike
19697  * kill warning.
19698  *
19699  * Revision 1.39  1994/11/28  01:28:59  mike
19700  * optimizations.
19701  *
19702  * Revision 1.38  1994/11/21  14:08:07  john
19703  * Took out all multiple instead of divide code.
19704  *
19705  * Revision 1.37  1994/11/19  15:21:52  mike
19706  * rip out unused code.
19707  *
19708  * Revision 1.36  1994/11/14  11:42:51  mike
19709  * optimization.
19710  *
19711  * Revision 1.35  1994/11/12  16:41:36  mike
19712  * *** empty log message ***
19713  *
19714  * Revision 1.34  1994/11/10  21:28:41  mike
19715  * remove call to init_interface_vars_to_assembler.
19716  *
19717  * Revision 1.33  1994/11/10  11:08:59  mike
19718  * detail level stuff.
19719  *
19720  * Revision 1.32  1994/11/09  22:55:52  matt
19721  * Added variable Current_seg_depth for detail level optimization
19722  *
19723  * Revision 1.31  1994/11/09  19:57:31  john
19724  * Added texture rle caching.
19725  *
19726  * Revision 1.30  1994/11/09  19:54:48  mike
19727  * Call flat shader if Tmap_flat_flag set.
19728  *
19729  * Revision 1.29  1994/11/02  21:33:31  john
19730  * Added Burger Bill's optimization, ie.. 2 muls per 8 pixels.
19731  *
19732  * Revision 1.28  1994/11/02  11:32:16  john
19733  * Added code for c callable inner loop and code to
19734  * test dividing out z0.
19735  *
19736  * Revision 1.27  1994/10/28  20:54:32  matt
19737  * Added error checking
19738  *
19739  * Revision 1.26  1994/10/25  11:20:20  mike
19740  * fix bug in lighting overflow checking for one scanline tall linear texture maps.
19741  *
19742  * Revision 1.25  1994/08/03  15:40:33  mike
19743  * Prevent divide overflows, decrease occurrence of precision-caused glitches.
19744  *
19745  * Revision 1.24  1994/07/27  09:31:16  mike
19746  * Fix concave texture map problem, decrease occurrence of unimportant int 3.
19747  *
19748  * Revision 1.23  1994/06/17  12:23:31  mike
19749  * Support non-lighted texture maps.
19750  *
19751  * Revision 1.22  1994/06/11  08:10:24  mike
19752  * Fix mysterious hang bug, lighting value was out of range.
19753  *
19754  * Revision 1.21  1994/06/09  16:10:16  mike
19755  * Change SC2000 from constant to variable.
19756
19757 ------------------------------------------------------------------------
19758 texmap/scanline.c:
19759
19760  * Revision 1.2  1995/02/20  18:23:39  john
19761  * Added new module for C versions of inner loops.
19762  *
19763  * Revision 1.1  1995/02/20  17:42:27  john
19764  * Initial revision
19765
19766 ------------------------------------------------------------------------
19767 texmap/scanline.h:
19768
19769  * Revision 1.2  1995/02/20  18:23:40  john
19770  * Added new module for C versions of inner loops.
19771  *
19772  * Revision 1.1  1995/02/20  17:44:16  john
19773  * Initial revision
19774
19775 ------------------------------------------------------------------------
19776 texmap/texmapl.h:
19777
19778  * Revision 1.14  1995/02/20  18:23:02  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.13  1995/02/20  17:09:16  john
19784  * Added code so that you can build the tmapper with no assembly!
19785  *
19786  * Revision 1.12  1994/11/28  13:34:34  mike
19787  * optimizations.
19788  *
19789  * Revision 1.11  1994/11/12  16:41:27  mike
19790  * function prototype.
19791  *
19792  * Revision 1.10  1994/05/24  17:30:00  mike
19793  * Prototype fix_recip, asm_tmap_scanline_lin_v.
19794  *
19795  * Revision 1.9  1994/04/21  15:04:26  mike
19796  * Add prototype for texmapl.h
19797  *
19798  * Revision 1.8  1994/03/31  08:34:53  mike
19799  * *** empty log message ***
19800  *
19801  * Revision 1.7  1994/03/22  20:37:04  mike
19802  * *** empty log message ***
19803  *
19804  * Revision 1.6  1994/03/14  15:43:03  mike
19805  * streamline code.
19806  *
19807  * Revision 1.5  1994/01/31  15:43:18  mike
19808  * window_height, asm_tmap_scanline_lin_sky_v
19809  *
19810  * Revision 1.4  1994/01/21  21:12:27  mike
19811  * Prototype asm_tmap_scanline_lin_sky
19812  *
19813  * Revision 1.3  1994/01/14  14:01:45  mike
19814  * Add a bunch of variables.
19815  *
19816  * Revision 1.2  1993/11/22  10:25:11  mike
19817  * *** empty log message ***
19818  *
19819  * Revision 1.1  1993/09/08  17:29:13  mike
19820  * Initial revision
19821
19822 ------------------------------------------------------------------------
19823 texmap/tmap_flt.asm:
19824
19825 ; Revision 1.10  1995/02/20  18:22:53  john
19826 ; Put all the externs in the assembly modules into tmap_inc.asm.
19827 ; Also, moved all the C versions of the inner loops into a new module,
19828 ; scanline.c.
19829 ;
19830 ; Revision 1.9  1995/02/20  17:08:51  john
19831 ; Added code so that you can build the tmapper with no assembly!
19832 ;
19833 ; Revision 1.8  1994/12/02  23:29:21  mike
19834 ; change jb/ja to jl/jg.
19835 ;
19836 ; Revision 1.7  1994/11/12  16:39:35  mike
19837 ; jae to ja.
19838 ;
19839 ; Revision 1.6  1994/08/09  11:27:53  john
19840 ; Added cthru mode.
19841 ;
19842 ; Revision 1.5  1994/07/08  17:43:11  john
19843 ; Added flat-shaded-zbuffered polygon.
19844 ;
19845 ; Revision 1.4  1994/04/08  16:25:43  mike
19846 ; optimize inner loop of flat shader.
19847 ;
19848 ; Revision 1.3  1994/03/31  08:34:20  mike
19849 ; Optimized (well, speeded-up) inner loop for tmap-based flat shader.
19850 ;
19851 ; Revision 1.2  1993/11/22  10:24:57  mike
19852 ; *** empty log message ***
19853 ;
19854 ; Revision 1.1  1993/09/08  17:29:46  mike
19855 ; Initial revision
19856
19857 ------------------------------------------------------------------------
19858 texmap/tmap_inc.asm:
19859
19860 ; Revision 1.10  1995/02/20  18:22:52  john
19861 ; Put all the externs in the assembly modules into tmap_inc.asm.
19862 ; Also, moved all the C versions of the inner loops into a new module,
19863 ; scanline.c.
19864 ;
19865 ; Revision 1.9  1994/12/02  23:29:45  mike
19866 ; Add y_pointers.
19867 ;
19868 ; Revision 1.8  1994/11/12  16:39:36  mike
19869 ; jae to ja.
19870 ;
19871 ; Revision 1.7  1994/10/26  23:27:39  john
19872 ; Took out references to gr_inverse_table.
19873 ;
19874 ; Revision 1.6  1994/10/26  23:21:55  mike
19875 ; kill unused stuff.
19876 ;
19877 ; Revision 1.5  1994/07/27  18:39:20  john
19878 ; Took out references to blend table
19879 ;
19880 ; Revision 1.4  1994/01/31  15:40:17  mike
19881 ; Add window_height.
19882 ;
19883 ; Revision 1.3  1993/12/07  12:27:48  john
19884 ; Moved bmd_palette to gr_palette
19885 ;
19886 ; Revision 1.2  1993/11/22  10:24:10  mike
19887 ; *** empty log message ***
19888 ;
19889 ; Revision 1.1  1993/09/08  17:29:47  mike
19890 ; Initial revision
19891
19892 ------------------------------------------------------------------------
19893 texmap/tmap_lin.asm:
19894
19895 ; Revision 1.3  1995/02/20  18:22:57  john
19896 ; Put all the externs in the assembly modules into tmap_inc.asm.
19897 ; Also, moved all the C versions of the inner loops into a new module,
19898 ; scanline.c.
19899 ;
19900 ; Revision 1.2  1995/02/20  17:09:10  john
19901 ; Added code so that you can build the tmapper with no assembly!
19902 ;
19903 ; Revision 1.1  1994/11/30  12:24:04  mike
19904 ; Initial revision
19905 ;
19906 ; Revision 1.6  1994/11/12  16:39:40  mike
19907 ; jae to ja.
19908 ;
19909 ; Revision 1.5  1994/02/10  21:24:43  matt
19910 ; Got rid of debug_on set
19911 ;
19912 ; Revision 1.4  1994/01/31  15:39:53  mike
19913 ; Write additional inner loop for transparency.
19914 ;
19915 ; Revision 1.3  1994/01/26  11:50:04  john
19916 ; Added transparency to linear unlighted texture mapper.
19917 ;
19918 ; Revision 1.2  1993/11/22  10:24:36  mike
19919 ; *** empty log message ***
19920 ;
19921 ; Revision 1.1  1993/09/08  17:29:50  mike
19922 ; Initial revision
19923
19924 ------------------------------------------------------------------------
19925 texmap/tmap_ll.asm:
19926
19927 ; Revision 1.10  1995/02/20  18:22:54  john
19928 ; Put all the externs in the assembly modules into tmap_inc.asm.
19929 ; Also, moved all the C versions of the inner loops into a new module,
19930 ; scanline.c.
19931 ;
19932 ; Revision 1.9  1995/02/20  17:09:06  john
19933 ; Added code so that you can build the tmapper with no assembly!
19934 ;
19935 ; Revision 1.8  1994/11/19  23:52:56  mike
19936 ; rip out big unrolled loop to save 25K....remember when we cared more about speed?
19937 ;
19938 ; Revision 1.7  1994/11/12  16:39:41  mike
19939 ; jae to ja.
19940 ;
19941 ; Revision 1.6  1994/03/14  15:45:08  mike
19942 ; streamline code.
19943 ;
19944 ; Revision 1.5  1994/01/24  13:13:12  mike
19945 ; dithering.
19946 ;
19947 ; Revision 1.4  1994/01/14  14:02:47  mike
19948 ; *** empty log message ***
19949 ;
19950 ; Revision 1.3  1993/12/17  20:00:16  mike
19951 ; Change default setting of dither_intensity_lighting from 1 to 0
19952 ;
19953 ; Revision 1.2  1993/11/22  10:24:50  mike
19954 ; *** empty log message ***
19955 ;
19956 ; Revision 1.1  1993/09/08  17:29:52  mike
19957 ; Initial revision
19958
19959 ------------------------------------------------------------------------
19960 texmap/tmap_per.asm:
19961
19962 ; Revision 1.26  1995/02/20  18:22:55  john
19963 ; Put all the externs in the assembly modules into tmap_inc.asm.
19964 ; Also, moved all the C versions of the inner loops into a new module,
19965 ; scanline.c.
19966 ;
19967 ; Revision 1.25  1995/02/20  17:09:08  john
19968 ; Added code so that you can build the tmapper with no assembly!
19969 ;
19970 ; Revision 1.24  1995/01/10  09:32:07  mike
19971 ; mostly fix garbage at end of scanline, but slow down by 1-4%.
19972 ;
19973 ; Revision 1.23  1994/12/02  23:29:57  mike
19974 ; optimizations.
19975 ;
19976 ; Revision 1.22  1994/11/30  00:57:00  mike
19977 ; optimization.
19978 ;
19979 ; Revision 1.21  1994/11/21  13:57:42  mike
19980 ; fix right side shear bug
19981 ;
19982 ; Revision 1.20  1994/11/12  16:41:09  mike
19983 ; jae -> ja.
19984 ;
19985 ; Revision 1.19  1994/10/27  19:40:00  john
19986 ; Made lighting table lookup be _gr_fade_table[eax] instead
19987 ; of fs:[eax], which gets rig of a segment override that
19988 ; supposedly costs 1 clock on a 486.  Mainly, I wanted to verify
19989 ; that the only reason we need selectors is for the source texture
19990 ; data .
19991 ;
19992 ; Revision 1.18  1994/05/03  11:08:32  mike
19993 ; Trap divide overflows.
19994 ;
19995 ; Revision 1.17  1994/04/21  15:03:41  mike
19996 ; make faster.
19997 ;
19998 ; Revision 1.16  1994/04/08  16:46:57  john
19999 ; Made 32 fade levels. Hacked.
20000 ;
20001 ; Revision 1.15  1994/03/31  08:35:18  mike
20002 ; Fix quantized-by-4 bug in inner loop.
20003 ;
20004 ; Revision 1.14  1994/03/14  17:41:14  mike
20005 ; Fix bug in unlighted version.
20006 ;
20007 ; Revision 1.13  1994/03/14  15:45:14  mike
20008 ; streamline code.
20009 ;
20010 ; Revision 1.12  1994/01/14  14:01:58  mike
20011 ; *** empty log message ***
20012 ;
20013 ; Revision 1.11  1993/12/18  14:43:44  john
20014 ; Messed around with doing 1/z, the u*(1/z) and v*(1/z)
20015 ; (Went from 23 fps to 21 fps... not good! )
20016 ;
20017 ; Revision 1.10  1993/12/17  16:14:17  john
20018 ; Split lighted/nonlighted, so there is no cmp lighting
20019 ; in the inner loop.
20020 ;
20021 ; Revision 1.9  1993/12/17  12:34:29  john
20022 ; Made leftover bytes use linear approx instead of correct...
20023 ; should save about 8 divides per scanline on average.
20024 ; Also, took out anti-aliasing code and rearranged to
20025 ; order of some instructions to help on 486 pipelining.
20026 ; (The anti-aliasing code did *not* look good, so I
20027 ; figure there was no reason to keep it in. )
20028 ;
20029 ; Revision 1.8  1993/12/16  18:37:52  mike
20030 ; Align some stuff on 4 byte boundaries.
20031 ;
20032 ; Revision 1.7  1993/11/30  08:44:18  john
20033 ; Made selector set check for < 64*64 bitmaps.
20034 ;
20035 ; Revision 1.6  1993/11/23  17:25:26  john
20036 ; Added safety "and eax, 0fffh" in lighting lookup.
20037 ;
20038 ; Revision 1.5  1993/11/23  15:08:52  mike
20039 ; Fixed lighting bug.
20040 ;
20041 ; Revision 1.4  1993/11/23  14:38:50  john
20042 ; optimized NORMAL code by switching EBX and ESI, so BH can be used in
20043 ; the lighting process.
20044 ;
20045 ; Revision 1.3  1993/11/23  14:30:53  john
20046 ; Made the perspective tmapper do 1/8 divides; added lighting.
20047 ;
20048 ; Revision 1.2  1993/11/22  10:24:59  mike
20049 ; *** empty log message ***
20050 ;
20051 ; Revision 1.1  1993/09/08  17:29:53  mike
20052 ; Initial revision
20053
20054 ------------------------------------------------------------------------
20055 texmap/tmapfade.asm:
20056
20057 ; Revision 1.6  1995/02/20  18:23:01  john
20058 ; Put all the externs in the assembly modules into tmap_inc.asm.
20059 ; Also, moved all the C versions of the inner loops into a new module,
20060 ; scanline.c.
20061 ;
20062 ; Revision 1.5  1995/02/20  17:09:15  john
20063 ; Added code so that you can build the tmapper with no assembly!
20064 ;
20065 ; Revision 1.4  1994/12/02  23:29:36  mike
20066 ; change jb/ja to jl/jg.
20067 ;
20068 ; Revision 1.3  1994/11/30  00:57:36  mike
20069 ; *** empty log message ***
20070 ;
20071 ; Revision 1.2  1994/10/06  18:38:49  john
20072 ; Added the ability to fade a scanline by calling gr_upoly_tmap
20073 ; with Gr_scanline_darkening_level with a value < MAX_FADE_LEVELS.
20074 ;
20075 ; Revision 1.1  1994/10/06  18:04:42  john
20076 ; Initial revision
20077
20078 ------------------------------------------------------------------------
20079 texmap/tmapflat.c:
20080
20081  * Revision 1.13  1995/02/20  18:23:24  john
20082  * Added new module for C versions of inner loops.
20083  *
20084  * Revision 1.12  1995/02/20  17:09:17  john
20085  * Added code so that you can build the tmapper with no assembly!
20086  *
20087  * Revision 1.11  1994/11/30  00:58:01  mike
20088  * optimizations.
20089  *
20090  * Revision 1.10  1994/11/28  13:34:32  mike
20091  * optimizations.
20092  *
20093  * Revision 1.9  1994/11/19  15:21:46  mike
20094  * rip out unused code.
20095  *
20096  * Revision 1.8  1994/11/12  16:41:41  mike
20097  * *** empty log message ***
20098  *
20099  * Revision 1.7  1994/11/09  23:05:12  mike
20100  * do lighting on texture maps which get flat shaded instead.
20101  *
20102  * Revision 1.6  1994/10/06  19:53:07  matt
20103  * Added function that takes same parms as draw_tmap(), but renders flat
20104  *
20105  * Revision 1.5  1994/10/06  18:38:12  john
20106  * Added the ability to fade a scanline by calling gr_upoly_tmap
20107  * with Gr_scanline_darkening_level with a value < MAX_FADE_LEVELS.
20108  *
20109  * Revision 1.4  1994/05/25  18:46:32  matt
20110  * Added gr_upoly_tmap_ylr(), which generates ylr's for a polygon
20111  *
20112  * Revision 1.3  1994/04/08  16:25:58  mike
20113  * Comment out some includes (of header files)
20114  * call init_interface_vars_to_assembler.
20115  *
20116  * Revision 1.2  1994/03/31  08:33:44  mike
20117  * Fixup flat shading version of texture mapper (get it?)
20118  * (Or maybe not, I admit to not testing my code...hahahah!)
20119  *
20120  * Revision 1.1  1993/09/08  17:29:10  mike
20121  * Initial revision
20122 ------------------------------------------------------------------------